@nylas/react 1.1.0-canary.12 → 1.1.0-canary.13
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_22.entry-26980c9f.cjs +1 -0
- package/dist/add-circle-icon_22.entry-a63de90d.js +1895 -0
- package/dist/{archive-icon_7.entry-e892a458.js → archive-icon_7.entry-561a5deb.js} +13 -13
- package/dist/{archive-icon_7.entry-59d9e24f.cjs → archive-icon_7.entry-97628ff8.cjs} +1 -1
- package/dist/{arrow-icon.entry-834b8066.cjs → arrow-icon.entry-68a3ba5b.cjs} +1 -1
- package/dist/arrow-icon.entry-c9b46bbc.js +15 -0
- package/dist/{bold-icon_3.entry-0f038db3.js → bold-icon_3.entry-e5a6fea9.js} +4 -4
- package/dist/{bold-icon_3.entry-eb0fcdaa.cjs → bold-icon_3.entry-f8473940.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-27a6f628.cjs → calendar-cancel-icon.entry-1fd6b27a.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-96156441.js → calendar-cancel-icon.entry-4bc3ceb1.js} +2 -2
- package/dist/{calendar-check-icon_2.entry-b6d6d220.cjs → calendar-check-icon_2.entry-3f734e43.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-c7c13e3e.js → calendar-check-icon_2.entry-a7033bf7.js} +11 -11
- package/dist/{calendar-icon.entry-e7f6a9a8.cjs → calendar-icon.entry-2943ea63.cjs} +1 -1
- package/dist/{calendar-icon.entry-f088fb14.js → calendar-icon.entry-2f963a7d.js} +4 -4
- package/dist/{chevron-icon_3.entry-8c6e6f74.cjs → chevron-icon_3.entry-ac1be504.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-90a3e89c.js → chevron-icon_3.entry-d10c854b.js} +5 -5
- package/dist/clock-icon_2.entry-7c576457.cjs +1 -0
- package/dist/clock-icon_2.entry-c8b0693e.js +25 -0
- package/dist/close-icon.entry-5cc5ae00.cjs +1 -0
- package/dist/close-icon.entry-e01b32cc.js +15 -0
- package/dist/{constants-f34b9c6e-593e21cc.cjs → constants-f34b9c6e-0e1cb070.cjs} +1 -1
- package/dist/{constants-f34b9c6e-91f6ad05.js → constants-f34b9c6e-ada541f4.js} +1 -1
- package/dist/{document-refresh-icon.entry-ca98d879.js → document-refresh-icon.entry-a18e5222.js} +5 -5
- package/dist/document-refresh-icon.entry-b0927573.cjs +1 -0
- package/dist/elements/index.d.ts +4 -1
- package/dist/{elements-dc5b338e-60f95088.cjs → elements-dc5b338e-272b5dff.cjs} +1 -1
- package/dist/{elements-dc5b338e-68eab1e5.js → elements-dc5b338e-d6cbe948.js} +1 -1
- package/dist/{focus-visible-e8093c16-a0869441.cjs → focus-visible-e8093c16-6991ac1b.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-b5d785fc.js → focus-visible-e8093c16-d239362e.js} +1 -1
- package/dist/{forward-icon_6.entry-84ac76ac.js → forward-icon_6.entry-230c7ab2.js} +9 -9
- package/dist/{forward-icon_6.entry-4b321b9a.cjs → forward-icon_6.entry-ee238c52.cjs} +3 -3
- package/dist/{globe-icon.entry-ef04c8bf.cjs → globe-icon.entry-539f0052.cjs} +1 -1
- package/dist/{globe-icon.entry-14a60f32.js → globe-icon.entry-e8c272c0.js} +2 -2
- package/dist/{google-logo-icon_4.entry-4fa3cb8e.js → google-logo-icon_4.entry-0c46cddd.js} +103 -93
- package/dist/google-logo-icon_4.entry-a5add4b4.cjs +1 -0
- package/dist/index-53420959-71fdd6ef.js +5 -0
- package/dist/index-53420959-f15601a9.cjs +1 -0
- package/dist/index-553c0327.cjs +42 -0
- package/dist/index-cd0e2d77.js +4977 -0
- package/dist/index-ef01c714-839c3029.cjs +41 -0
- package/dist/index-ef01c714-d85134a4.js +4971 -0
- package/dist/{index.es-9190f785-60475c4c.cjs → index.es-74f70f7d-1d137fdb.cjs} +5 -5
- package/dist/{index.es-9190f785-69269065.js → index.es-74f70f7d-960f947f.js} +11 -12
- package/dist/{info-icon_2.entry-fb099090.cjs → info-icon_2.entry-00ea6504.cjs} +1 -1
- package/dist/{info-icon_2.entry-45f6f01f.js → info-icon_2.entry-42f77d4b.js} +5 -5
- package/dist/{loading-icon.entry-67c8b1fa.js → loading-icon.entry-0692e093.js} +4 -4
- package/dist/{loading-icon.entry-eaabff41.cjs → loading-icon.entry-fb7464c3.cjs} +1 -1
- package/dist/{mailbox-store-29139d89-dd9d3d1b.cjs → mailbox-store-050a2914-9c975586.cjs} +1 -1
- package/dist/{mailbox-store-29139d89-e3513416.js → mailbox-store-050a2914-cfb1b1c0.js} +2 -2
- package/dist/{nylas-additional-participants.entry-a1fb4ef4.js → nylas-additional-participants.entry-1d7bda06.js} +12 -12
- package/dist/{nylas-additional-participants.entry-6413fc87.cjs → nylas-additional-participants.entry-d97b8bb4.cjs} +1 -1
- package/dist/{nylas-booked-event-card_10.entry-e435ff63.js → nylas-booked-event-card_10.entry-041a10c7.js} +255 -252
- package/dist/nylas-booked-event-card_10.entry-dfec7c8d.cjs +1 -0
- package/dist/{nylas-custom-booking-flow.entry-3e690bb7.cjs → nylas-custom-booking-flow.entry-3ec838df.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-56075ecd.js → nylas-custom-booking-flow.entry-ced72cc5.js} +3 -3
- package/dist/nylas-form-card.entry-8d594514.cjs +1 -0
- package/dist/nylas-form-card.entry-9b8176ad.js +57 -0
- package/dist/{nylas-if-state.entry-1e4b0a58.cjs → nylas-if-state.entry-445ec109.cjs} +1 -1
- package/dist/{nylas-if-state.entry-3d22bca7.js → nylas-if-state.entry-eb11630d.js} +3 -3
- package/dist/{nylas-list-folders.entry-3da37b1c.cjs → nylas-list-folders.entry-32a1e254.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-e634780d.js → nylas-list-folders.entry-822436d4.js} +3 -3
- package/dist/{nylas-list-threads.entry-26dbb8ff.js → nylas-list-threads.entry-0186e9e7.js} +4 -4
- package/dist/{nylas-list-threads.entry-ef4743af.cjs → nylas-list-threads.entry-181872dd.cjs} +1 -1
- package/dist/{nylas-login.entry-a76e4aae.cjs → nylas-login.entry-0261e74e.cjs} +1 -1
- package/dist/{nylas-login.entry-ff7d9db5.js → nylas-login.entry-7460c1d4.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-fcb3cc47.js → nylas-mailbox-pagination.entry-107b3fbc.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-565ee29b.cjs → nylas-mailbox-pagination.entry-eaf08163.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-3a94b1e9.cjs → nylas-mailbox-toolbar-button.entry-23fc08a6.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-ae13c538.js → nylas-mailbox-toolbar-button.entry-40e8d9ad.js} +8 -8
- package/dist/{nylas-mailbox.entry-6d86abe9.js → nylas-mailbox.entry-2199a6b4.js} +9 -10
- package/dist/nylas-mailbox.entry-de8618eb.cjs +1 -0
- package/dist/nylas-provider.entry-11a95d86.cjs +1 -0
- package/dist/{nylas-provider.entry-01e0944e.js → nylas-provider.entry-a8f8bad2.js} +9 -10
- package/dist/nylas-scheduler-editor.entry-73794266.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-8f62880a.js → nylas-scheduler-editor.entry-c58c813c.js} +28 -14
- package/dist/nylas-scheduling.entry-b449ab24.cjs +1 -0
- package/dist/{nylas-scheduling.entry-f15b3106.js → nylas-scheduling.entry-fe9d6b69.js} +91 -68
- package/dist/{nylas-threads-refresh.entry-d62d0574.cjs → nylas-threads-refresh.entry-4f17fa6c.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-d7727ccb.js → nylas-threads-refresh.entry-c8438752.js} +4 -4
- package/dist/{nylas-threads-search.entry-eec50b1b.cjs → nylas-threads-search.entry-0ed36372.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-4803d20b.js → nylas-threads-search.entry-b1f88916.js} +4 -4
- package/dist/{nylas-view-thread.entry-2b85f8e2.js → nylas-view-thread.entry-8dfe1352.js} +3 -3
- package/dist/{nylas-view-thread.entry-5da789da.cjs → nylas-view-thread.entry-c50bea78.cjs} +1 -1
- package/dist/{people-icon.entry-b6426fe6.cjs → people-icon.entry-0875cac0.cjs} +1 -1
- package/dist/{people-icon.entry-63f63064.js → people-icon.entry-8392a21c.js} +6 -6
- package/dist/{play-icon_2.entry-a3262db3.js → play-icon_2.entry-4a15f215.js} +8 -8
- package/dist/play-icon_2.entry-d6ff1cc3.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +87 -84
- package/dist/{refresh-icon.entry-542f680c.cjs → refresh-icon.entry-1ebb9376.cjs} +1 -1
- package/dist/{refresh-icon.entry-64679ef7.js → refresh-icon.entry-76b2d888.js} +4 -4
- package/dist/{register-component-83e24412-51af5293.js → register-component-e4dc8778-408dc241.js} +1 -1
- package/dist/{register-component-83e24412-d76a2962.cjs → register-component-e4dc8778-99eb91ca.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-2710b76a.cjs → scheduler-config-store-ec3b6190-4abd56df.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-df09ddc0.js → scheduler-config-store-ec3b6190-f292fe19.js} +1 -1
- package/dist/scheduler-store-3afbcda0-166e84ff.cjs +1 -0
- package/dist/{scheduler-store-dabdbc4f-6f6096d6.js → scheduler-store-3afbcda0-53680387.js} +130 -89
- package/dist/time-period-selector.entry-846b64bd.cjs +1 -0
- package/dist/{time-period-selector.entry-8e6954f5.js → time-period-selector.entry-f6128367.js} +3 -3
- package/dist/{translate-icon.entry-57dedacf.js → translate-icon.entry-84778350.js} +6 -6
- package/dist/{translate-icon.entry-49a653f0.cjs → translate-icon.entry-f3060124.cjs} +1 -1
- package/dist/warning-icon.entry-246eb6fb.cjs +1 -0
- package/dist/warning-icon.entry-eeaae1a7.js +15 -0
- package/package.json +2 -2
- package/dist/add-circle-icon_21.entry-172d31c3.js +0 -6726
- package/dist/add-circle-icon_21.entry-71af48f1.cjs +0 -41
- package/dist/arrow-icon.entry-060b9b4f.js +0 -15
- package/dist/close-icon.entry-175b9674.cjs +0 -1
- package/dist/close-icon.entry-e694948f.js +0 -15
- package/dist/document-refresh-icon.entry-a54c74b9.cjs +0 -1
- package/dist/global-37eeb0cd-6c5934cf.cjs +0 -1
- package/dist/global-37eeb0cd-b42e0abc.js +0 -4
- package/dist/google-logo-icon_4.entry-ffeec491.cjs +0 -1
- package/dist/index-3a004ec1.cjs +0 -37
- package/dist/index-4c7e8f2f.js +0 -4045
- package/dist/index-92989ac4-69175657.js +0 -902
- package/dist/index-92989ac4-6f32ff2a.cjs +0 -6
- package/dist/nylas-booked-event-card_10.entry-ce660783.cjs +0 -1
- package/dist/nylas-form-card.entry-33ff95e1.js +0 -54
- package/dist/nylas-form-card.entry-64d7be4d.cjs +0 -1
- package/dist/nylas-mailbox.entry-8f41c35a.cjs +0 -1
- package/dist/nylas-provider.entry-65f0f8da.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-7dc20e4d.cjs +0 -2
- package/dist/nylas-scheduling.entry-1b6628a3.cjs +0 -1
- package/dist/play-icon_2.entry-2b8094d7.cjs +0 -1
- package/dist/scheduler-store-dabdbc4f-404dc261.cjs +0 -1
- package/dist/time-period-selector.entry-c5faae46.cjs +0 -1
- package/dist/warning-icon.entry-a7977526.js +0 -15
- package/dist/warning-icon.entry-bce861bd.cjs +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";const v=require("./global-37eeb0cd-6c5934cf.cjs"),j=require("./index-3a004ec1.cjs");var A=[],E=[],b=typeof Uint8Array<"u"?Uint8Array:Array,C=!1;function d(){C=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E["-".charCodeAt(0)]=62,E["_".charCodeAt(0)]=63}function rr(n){C||d();var r,i,t,e,u,o,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");u=n[h-2]==="="?2:n[h-1]==="="?1:0,o=new b(h*3/4-u),t=u>0?h-4:h;var a=0;for(r=0,i=0;r<t;r+=4,i+=3)e=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return u===2?(e=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,o[a++]=e&255):u===1&&(e=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function ir(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function nr(n,r,i){for(var t,e=[],u=r;u<i;u+=3)t=(n[u]<<16)+(n[u+1]<<8)+n[u+2],e.push(ir(t));return e.join("")}function M(n){C||d();for(var r,i=n.length,t=i%3,e="",u=[],o=16383,h=0,a=i-t;h<a;h+=o)u.push(nr(n,h,h+o>a?a:h+o));return t===1?(r=n[i-1],e+=A[r>>2],e+=A[r<<4&63],e+="=="):t===2&&(r=(n[i-2]<<8)+n[i-1],e+=A[r>>10],e+=A[r>>4&63],e+=A[r<<2&63],e+="="),u.push(e),u.join("")}function I(n,r,i,t,e){var u,o,h=e*8-t-1,a=(1<<h)-1,p=a>>1,l=-7,c=i?e-1:0,F=i?-1:1,w=n[r+c];for(c+=F,u=w&(1<<-l)-1,w>>=-l,l+=h;l>0;u=u*256+n[r+c],c+=F,l-=8);for(o=u&(1<<-l)-1,u>>=-l,l+=t;l>0;o=o*256+n[r+c],c+=F,l-=8);if(u===0)u=1-p;else{if(u===a)return o?NaN:(w?-1:1)*(1/0);o=o+Math.pow(2,t),u=u-p}return(w?-1:1)*o*Math.pow(2,u-t)}function L(n,r,i,t,e,u){var o,h,a,p=u*8-e-1,l=(1<<p)-1,c=l>>1,F=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=t?0:u-1,_=t?1:-1,Q=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,o=l):(o=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+c>=1?r+=F/a:r+=F*Math.pow(2,1-c),r*a>=2&&(o++,a/=2),o+c>=l?(h=0,o=l):o+c>=1?(h=(r*a-1)*Math.pow(2,e),o=o+c):(h=r*Math.pow(2,c-1)*Math.pow(2,e),o=0));e>=8;n[i+w]=h&255,w+=_,h/=256,e-=8);for(o=o<<e|h,p+=e;p>0;n[i+w]=o&255,w+=_,o/=256,p-=8);n[i+w-_]|=Q*128}var tr={}.toString,W=Array.isArray||function(n){return tr.call(n)=="[object Array]"};/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/var er=50;f.TYPED_ARRAY_SUPPORT=v.global$1.TYPED_ARRAY_SUPPORT!==void 0?v.global$1.TYPED_ARRAY_SUPPORT:!0;function D(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(n,r){if(D()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=f.prototype):(n===null&&(n=new f(r)),n.length=r),n}function f(n,r,i){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return P(this,n)}return G(this,n,r,i)}f.poolSize=8192;f._augment=function(n){return n.__proto__=f.prototype,n};function G(n,r,i,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?fr(n,r,i,t):typeof r=="string"?or(n,r,i):hr(n,r)}f.from=function(n,r,i){return G(null,n,r,i)};f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array);function H(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function ur(n,r,i,t){return H(r),r<=0?R(n,r):i!==void 0?typeof t=="string"?R(n,r).fill(i,t):R(n,r).fill(i):R(n,r)}f.alloc=function(n,r,i){return ur(null,n,r,i)};function P(n,r){if(H(r),n=R(n,r<0?0:S(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}f.allocUnsafe=function(n){return P(null,n)};f.allocUnsafeSlow=function(n){return P(null,n)};function or(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!f.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var t=V(r,i)|0;n=R(n,t);var e=n.write(r,i);return e!==t&&(n=n.slice(0,e)),n}function Y(n,r){var i=r.length<0?0:S(r.length)|0;n=R(n,i);for(var t=0;t<i;t+=1)n[t]=r[t]&255;return n}function fr(n,r,i,t){if(i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(t||0))throw new RangeError("'length' is out of bounds");return i===void 0&&t===void 0?r=new Uint8Array(r):t===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,t),f.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=f.prototype):n=Y(n,r),n}function hr(n,r){if(y(r)){var i=S(r.length)|0;return n=R(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Tr(r.length)?R(n,0):Y(n,r);if(r.type==="Buffer"&&W(r.data))return Y(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function S(n){if(n>=D())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D().toString(16)+" bytes");return n|0}f.isBuffer=Dr;function y(n){return!!(n!=null&&n._isBuffer)}f.compare=function(r,i){if(!y(r)||!y(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var t=r.length,e=i.length,u=0,o=Math.min(t,e);u<o;++u)if(r[u]!==i[u]){t=r[u],e=i[u];break}return t<e?-1:e<t?1:0};f.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};f.concat=function(r,i){if(!W(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var t;if(i===void 0)for(i=0,t=0;t<r.length;++t)i+=r[t].length;var e=f.allocUnsafe(i),u=0;for(t=0;t<r.length;++t){var o=r[t];if(!y(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,u),u+=o.length}return e};function V(n,r){if(y(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var t=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return m(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Z(n).length;default:if(t)return m(n).length;r=(""+r).toLowerCase(),t=!0}}f.byteLength=V;function ar(n,r,i){var t=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return yr(this,r,i);case"utf8":case"utf-8":return $(this,r,i);case"ascii":return Fr(this,r,i);case"latin1":case"binary":return Ar(this,r,i);case"base64":return wr(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rr(this,r,i);default:if(t)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),t=!0}}f.prototype._isBuffer=!0;function g(n,r,i){var t=n[r];n[r]=n[i],n[i]=t}f.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)g(this,i,i+1);return this};f.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)g(this,i,i+3),g(this,i+1,i+2);return this};f.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)g(this,i,i+7),g(this,i+1,i+6),g(this,i+2,i+5),g(this,i+3,i+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?$(this,0,r):ar.apply(this,arguments)};f.prototype.equals=function(r){if(!y(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.inspect=function(){var r="",i=er;return this.length>0&&(r=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(r+=" ... ")),"<Buffer "+r+">"};f.prototype.compare=function(r,i,t,e,u){if(!y(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),t===void 0&&(t=r?r.length:0),e===void 0&&(e=0),u===void 0&&(u=this.length),i<0||t>r.length||e<0||u>this.length)throw new RangeError("out of range index");if(e>=u&&i>=t)return 0;if(e>=u)return-1;if(i>=t)return 1;if(i>>>=0,t>>>=0,e>>>=0,u>>>=0,this===r)return 0;for(var o=u-e,h=t-i,a=Math.min(o,h),p=this.slice(e,u),l=r.slice(i,t),c=0;c<a;++c)if(p[c]!==l[c]){o=p[c],h=l[c];break}return o<h?-1:h<o?1:0};function J(n,r,i,t,e){if(n.length===0)return-1;if(typeof i=="string"?(t=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=e?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(e)return-1;i=n.length-1}else if(i<0)if(e)i=0;else return-1;if(typeof r=="string"&&(r=f.from(r,t)),y(r))return r.length===0?-1:k(n,r,i,t,e);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):k(n,[r],i,t,e);throw new TypeError("val must be string, number or Buffer")}function k(n,r,i,t,e){var u=1,o=n.length,h=r.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(n.length<2||r.length<2)return-1;u=2,o/=2,h/=2,i/=2}function a(w,_){return u===1?w[_]:w.readUInt16BE(_*u)}var p;if(e){var l=-1;for(p=i;p<o;p++)if(a(n,p)===a(r,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===h)return l*u}else l!==-1&&(p-=p-l),l=-1}else for(i+h>o&&(i=o-h),p=i;p>=0;p--){for(var c=!0,F=0;F<h;F++)if(a(n,p+F)!==a(r,F)){c=!1;break}if(c)return p}return-1}f.prototype.includes=function(r,i,t){return this.indexOf(r,i,t)!==-1};f.prototype.indexOf=function(r,i,t){return J(this,r,i,t,!0)};f.prototype.lastIndexOf=function(r,i,t){return J(this,r,i,t,!1)};function cr(n,r,i,t){i=Number(i)||0;var e=n.length-i;t?(t=Number(t),t>e&&(t=e)):t=e;var u=r.length;if(u%2!==0)throw new TypeError("Invalid hex string");t>u/2&&(t=u/2);for(var o=0;o<t;++o){var h=parseInt(r.substr(o*2,2),16);if(isNaN(h))return o;n[i+o]=h}return o}function pr(n,r,i,t){return T(m(r,n.length-i),n,i,t)}function X(n,r,i,t){return T(Br(r),n,i,t)}function lr(n,r,i,t){return X(n,r,i,t)}function sr(n,r,i,t){return T(Z(r),n,i,t)}function xr(n,r,i,t){return T(Ur(r,n.length-i),n,i,t)}f.prototype.write=function(r,i,t,e){if(i===void 0)e="utf8",t=this.length,i=0;else if(t===void 0&&typeof i=="string")e=i,t=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(t)?(t=t|0,e===void 0&&(e="utf8")):(e=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-i;if((t===void 0||t>u)&&(t=u),r.length>0&&(t<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var o=!1;;)switch(e){case"hex":return cr(this,r,i,t);case"utf8":case"utf-8":return pr(this,r,i,t);case"ascii":return X(this,r,i,t);case"latin1":case"binary":return lr(this,r,i,t);case"base64":return sr(this,r,i,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xr(this,r,i,t);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),o=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wr(n,r,i){return r===0&&i===n.length?M(n):M(n.slice(r,i))}function $(n,r,i){i=Math.min(n.length,i);for(var t=[],e=r;e<i;){var u=n[e],o=null,h=u>239?4:u>223?3:u>191?2:1;if(e+h<=i){var a,p,l,c;switch(h){case 1:u<128&&(o=u);break;case 2:a=n[e+1],(a&192)===128&&(c=(u&31)<<6|a&63,c>127&&(o=c));break;case 3:a=n[e+1],p=n[e+2],(a&192)===128&&(p&192)===128&&(c=(u&15)<<12|(a&63)<<6|p&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:a=n[e+1],p=n[e+2],l=n[e+3],(a&192)===128&&(p&192)===128&&(l&192)===128&&(c=(u&15)<<18|(a&63)<<12|(p&63)<<6|l&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,h=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),e+=h}return Er(t)}var N=4096;function Er(n){var r=n.length;if(r<=N)return String.fromCharCode.apply(String,n);for(var i="",t=0;t<r;)i+=String.fromCharCode.apply(String,n.slice(t,t+=N));return i}function Fr(n,r,i){var t="";i=Math.min(n.length,i);for(var e=r;e<i;++e)t+=String.fromCharCode(n[e]&127);return t}function Ar(n,r,i){var t="";i=Math.min(n.length,i);for(var e=r;e<i;++e)t+=String.fromCharCode(n[e]);return t}function yr(n,r,i){var t=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>t)&&(i=t);for(var e="",u=r;u<i;++u)e+=Ir(n[u]);return e}function Rr(n,r,i){for(var t=n.slice(r,i),e="",u=0;u<t.length;u+=2)e+=String.fromCharCode(t[u]+t[u+1]*256);return e}f.prototype.slice=function(r,i){var t=this.length;r=~~r,i=i===void 0?t:~~i,r<0?(r+=t,r<0&&(r=0)):r>t&&(r=t),i<0?(i+=t,i<0&&(i=0)):i>t&&(i=t),i<r&&(i=r);var e;if(f.TYPED_ARRAY_SUPPORT)e=this.subarray(r,i),e.__proto__=f.prototype;else{var u=i-r;e=new f(u,void 0);for(var o=0;o<u;++o)e[o]=this[o+r]}return e};function s(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,i,t){r=r|0,i=i|0,t||s(r,i,this.length);for(var e=this[r],u=1,o=0;++o<i&&(u*=256);)e+=this[r+o]*u;return e};f.prototype.readUIntBE=function(r,i,t){r=r|0,i=i|0,t||s(r,i,this.length);for(var e=this[r+--i],u=1;i>0&&(u*=256);)e+=this[r+--i]*u;return e};f.prototype.readUInt8=function(r,i){return i||s(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,i){return i||s(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,i){return i||s(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,i){return i||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,i){return i||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,i,t){r=r|0,i=i|0,t||s(r,i,this.length);for(var e=this[r],u=1,o=0;++o<i&&(u*=256);)e+=this[r+o]*u;return u*=128,e>=u&&(e-=Math.pow(2,8*i)),e};f.prototype.readIntBE=function(r,i,t){r=r|0,i=i|0,t||s(r,i,this.length);for(var e=i,u=1,o=this[r+--e];e>0&&(u*=256);)o+=this[r+--e]*u;return u*=128,o>=u&&(o-=Math.pow(2,8*i)),o};f.prototype.readInt8=function(r,i){return i||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,i){i||s(r,2,this.length);var t=this[r]|this[r+1]<<8;return t&32768?t|4294901760:t};f.prototype.readInt16BE=function(r,i){i||s(r,2,this.length);var t=this[r+1]|this[r]<<8;return t&32768?t|4294901760:t};f.prototype.readInt32LE=function(r,i){return i||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,i){return i||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,i){return i||s(r,4,this.length),I(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,i){return i||s(r,4,this.length),I(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,i){return i||s(r,8,this.length),I(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,i){return i||s(r,8,this.length),I(this,r,!1,52,8)};function x(n,r,i,t,e,u){if(!y(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>e||r<u)throw new RangeError('"value" argument is out of bounds');if(i+t>n.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,i,t,e){if(r=+r,i=i|0,t=t|0,!e){var u=Math.pow(2,8*t)-1;x(this,r,i,t,u,0)}var o=1,h=0;for(this[i]=r&255;++h<t&&(o*=256);)this[i+h]=r/o&255;return i+t};f.prototype.writeUIntBE=function(r,i,t,e){if(r=+r,i=i|0,t=t|0,!e){var u=Math.pow(2,8*t)-1;x(this,r,i,t,u,0)}var o=t-1,h=1;for(this[i+o]=r&255;--o>=0&&(h*=256);)this[i+o]=r/h&255;return i+t};f.prototype.writeUInt8=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function B(n,r,i,t){r<0&&(r=65535+r+1);for(var e=0,u=Math.min(n.length-i,2);e<u;++e)n[i+e]=(r&255<<8*(t?e:1-e))>>>(t?e:1-e)*8}f.prototype.writeUInt16LE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):B(this,r,i,!0),i+2};f.prototype.writeUInt16BE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):B(this,r,i,!1),i+2};function U(n,r,i,t){r<0&&(r=4294967295+r+1);for(var e=0,u=Math.min(n.length-i,4);e<u;++e)n[i+e]=r>>>(t?e:3-e)*8&255}f.prototype.writeUInt32LE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):U(this,r,i,!0),i+4};f.prototype.writeUInt32BE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):U(this,r,i,!1),i+4};f.prototype.writeIntLE=function(r,i,t,e){if(r=+r,i=i|0,!e){var u=Math.pow(2,8*t-1);x(this,r,i,t,u-1,-u)}var o=0,h=1,a=0;for(this[i]=r&255;++o<t&&(h*=256);)r<0&&a===0&&this[i+o-1]!==0&&(a=1),this[i+o]=(r/h>>0)-a&255;return i+t};f.prototype.writeIntBE=function(r,i,t,e){if(r=+r,i=i|0,!e){var u=Math.pow(2,8*t-1);x(this,r,i,t,u-1,-u)}var o=t-1,h=1,a=0;for(this[i+o]=r&255;--o>=0&&(h*=256);)r<0&&a===0&&this[i+o+1]!==0&&(a=1),this[i+o]=(r/h>>0)-a&255;return i+t};f.prototype.writeInt8=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};f.prototype.writeInt16LE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):B(this,r,i,!0),i+2};f.prototype.writeInt16BE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):B(this,r,i,!1),i+2};f.prototype.writeInt32LE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):U(this,r,i,!0),i+4};f.prototype.writeInt32BE=function(r,i,t){return r=+r,i=i|0,t||x(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):U(this,r,i,!1),i+4};function q(n,r,i,t,e,u){if(i+t>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(n,r,i,t,e){return e||q(n,r,i,4),L(n,r,i,t,23,4),i+4}f.prototype.writeFloatLE=function(r,i,t){return z(this,r,i,!0,t)};f.prototype.writeFloatBE=function(r,i,t){return z(this,r,i,!1,t)};function O(n,r,i,t,e){return e||q(n,r,i,8),L(n,r,i,t,52,8),i+8}f.prototype.writeDoubleLE=function(r,i,t){return O(this,r,i,!0,t)};f.prototype.writeDoubleBE=function(r,i,t){return O(this,r,i,!1,t)};f.prototype.copy=function(r,i,t,e){if(t||(t=0),!e&&e!==0&&(e=this.length),i>=r.length&&(i=r.length),i||(i=0),e>0&&e<t&&(e=t),e===t||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),r.length-i<e-t&&(e=r.length-i+t);var u=e-t,o;if(this===r&&t<i&&i<e)for(o=u-1;o>=0;--o)r[o+i]=this[o+t];else if(u<1e3||!f.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)r[o+i]=this[o+t];else Uint8Array.prototype.set.call(r,this.subarray(t,t+u),i);return u};f.prototype.fill=function(r,i,t,e){if(typeof r=="string"){if(typeof i=="string"?(e=i,i=0,t=this.length):typeof t=="string"&&(e=t,t=this.length),r.length===1){var u=r.charCodeAt(0);u<256&&(r=u)}if(e!==void 0&&typeof e!="string")throw new TypeError("encoding must be a string");if(typeof e=="string"&&!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<t)throw new RangeError("Out of range index");if(t<=i)return this;i=i>>>0,t=t===void 0?this.length:t>>>0,r||(r=0);var o;if(typeof r=="number")for(o=i;o<t;++o)this[o]=r;else{var h=y(r)?r:m(new f(r,e).toString()),a=h.length;for(o=0;o<t-i;++o)this[o+i]=h[o%a]}return this};var gr=/[^+\/0-9A-Za-z-_]/g;function _r(n){if(n=mr(n).replace(gr,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function mr(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Ir(n){return n<16?"0"+n.toString(16):n.toString(16)}function m(n,r){r=r||1/0;for(var i,t=n.length,e=null,u=[],o=0;o<t;++o){if(i=n.charCodeAt(o),i>55295&&i<57344){if(!e){if(i>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(o+1===t){(r-=3)>-1&&u.push(239,191,189);continue}e=i;continue}if(i<56320){(r-=3)>-1&&u.push(239,191,189),e=i;continue}i=(e-55296<<10|i-56320)+65536}else e&&(r-=3)>-1&&u.push(239,191,189);if(e=null,i<128){if((r-=1)<0)break;u.push(i)}else if(i<2048){if((r-=2)<0)break;u.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;u.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;u.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return u}function Br(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function Ur(n,r){for(var i,t,e,u=[],o=0;o<n.length&&!((r-=2)<0);++o)i=n.charCodeAt(o),t=i>>8,e=i%256,u.push(e),u.push(t);return u}function Z(n){return rr(_r(n))}function T(n,r,i,t){for(var e=0;e<t&&!(e+i>=r.length||e>=n.length);++e)r[e+i]=n[e];return e}function Tr(n){return n!==n}function Dr(n){return n!=null&&(!!n._isBuffer||K(n)||Yr(n))}function K(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Yr(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&K(n.slice(0,0))}var Cr=j.commonjsGlobal.process;exports.Buffer=f;exports.process=Cr;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-3a004ec1.cjs"),b=require("./register-component-83e24412-d76a2962.cjs"),d=require("./constants-f34b9c6e-593e21cc.cjs");require("react");require("react-dom");const Z=':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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:1rem;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}',V=Z;var q=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},y=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const z=class{constructor(e){t.registerInstance(this,e),this.cancelBookingButtonClicked=t.createEvent(this,"cancelBookingButtonClicked",7),this.rescheduleButtonClicked=t.createEvent(this,"rescheduleButtonClicked",7),this.rescheduleBookedEventError=t.createEvent(this,"rescheduleBookedEventError",7),this.cancelBookedEventValidationError=t.createEvent(this,"cancelBookedEventValidationError",7),this.handleCancelBookingButtonClicked=()=>{var o;const a=new Date,n=(o=this.configSettings)==null?void 0:o.scheduler.min_cancellation_notice,s=t.addMinutesToCurrentTime(a,n);a.getTime()<s.getTime()?this.cancelBookedEventValidationError.emit({error:{title:"Cancellation Error",message:`You cannot cancel the booking within ${n} minutes of the event.`}}):this.cancelBookingButtonClicked.emit({bookingId:this.eventInfo.booking_id})},this.handleRescheduleButtonClicked=()=>{const a=n=>{this.rescheduleBookedEventError.emit(n)};this.rescheduleButtonClicked.emit({bookingId:this.eventInfo.booking_id,errorHandler:a})},this.getOrganizer=a=>a==null?void 0:a.organizer,this.getPaticipantType=a=>{switch(a){case"host":return"Host";case"you":return"You";default:return""}},this.eventInfo=void 0,this.rescheduleBookingId=void 0,this.bookingInfo=void 0,this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.selectedTimeslot=void 0,this.configSettings=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){t.debug("[nylas-booked-event-card] Component will load")}async componentDidLoad(){t.debug("[nylas-booked-event-card] Component did load")}render(){var e,a,n,s,o,i,r,l,c;return t.h(t.Host,{key:"5bd3216b60b7cdb86a44435706fb43b6a898e61c",part:"nbec"},t.h("sp-theme",{key:"f6059be8647e7340db11f12db85596b2493a3032",theme:"spectrum",color:"dark",scale:"medium"},t.h("div",{key:"5f6cf3edb7b911c7c2c24d4ce82357298cc10108",class:"booked-event-timezone"},t.h("globe-icon",{key:"b23ca20aa43dc402a2071ed0019ff103f455e769"}),d.TIMEZONE_MAP[this.selectedTimezone]),t.h("div",{key:"664f226bd33a6ee1ee938ac76eca60085e822915",class:"event-card-wrapper",part:"nbec__card"},t.h("div",{key:"0de5fccaf726cc6a6fb1917249ffcccbaf45190f",class:"calendar-icon"},t.h("calendar-check-icon",{key:"94bbe15e7acddbc88916355337170a6753fa70b3"})),t.h("div",{key:"f3876bccacb3a99e7c337aff930095884b3e6be3",class:"booked-event-header"},t.h("h2",{key:"da46d3cb4865421827cd7b3f499cae06ca09e365",slot:"card-title",part:"nbec__title"},"Booking ",this.rescheduleBookingId?"rescheduled":"confirmed","!"),t.h("div",{key:"57ed93864ee0cbdbf5755b0fe9a6b2803ca7a869",part:"nbec__description"},((e=this.getOrganizer(this.eventInfo))==null?void 0:e.name)||((a=this.getOrganizer(this.eventInfo))==null?void 0:a.email)," & ",((s=(n=this.bookingInfo)==null?void 0:n.primaryParticipant)==null?void 0:s.name)||((i=(o=this.bookingInfo)==null?void 0:o.primaryParticipant)==null?void 0:i.email))),t.h("sp-divider",{key:"4fab8afdbdc7e9a2b55e35779ff087a5497b0c3e"}),t.h("div",{key:"54ffc748a0da3bd9ae866137b600d0dc1da5eb5e",class:"booking-date-time"},t.h("checkmark-circle-icon",{key:"674edd7058565b837a618089c653d20b8b8f08e7"}),t.h("h3",{key:"51f406b68b2e310e354e79703aea3efd14236d57"},"Booking date and time"),t.h("p",{key:"404211c1b06bb80da3eb7274f4a41fba962ce0b9"},new Date((r=this.selectedTimeslot)==null?void 0:r.start_time).toLocaleDateString(void 0,{dateStyle:"full"})," ",t.h("br",{key:"221f96d994e440affff5a347fbb9da5a2566ab29"}),new Date((l=this.selectedTimeslot)==null?void 0:l.start_time).toLocaleTimeString(void 0,{timeStyle:"short"})," -"," ",new Date((c=this.selectedTimeslot)==null?void 0:c.end_time).toLocaleTimeString(void 0,{timeStyle:"short"}))),t.h("div",{key:"d333515e59086254d2484c5f55ad9b69a21bf0bb",class:"booking-participants"}),t.h("sp-divider",{key:"f6ee5cd38d186d943a345f037357419f2af7e3c7"}),t.h("div",{key:"c6eb21904c9db747ceb7a2daed88bf86057f4046",class:"footer"},t.h("sp-button",{key:"ee4a439cd71eb0c9c6a1a82be35698a3b027c6c5",variant:"secondary",treatment:"outline",class:"cancel",onClick:this.handleCancelBookingButtonClicked,part:"nbec__button-outline nbec__cancel-cta"},"Cancel booking"),t.h("sp-button",{key:"36aa6cc83eb259f21098787e61d36c4a8ca5b3df",variant:"secondary",treatment:"outline",class:"reschedule",onClick:this.handleRescheduleButtonClicked,part:"nbec__button-outline nbec__reschedule-cta"},"Reschedule")))))}};q([b.RegisterComponent({name:"nylas-booked-event-card",stateToProps:new Map([["scheduler.bookingInfo","bookingInfo"],["scheduler.rescheduleBookingId","rescheduleBookingId"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.configSettings","configSettings"]]),eventToProps:{cancelBookingButtonClicked:async(e,a)=>{a.scheduler.setCancel(e.detail.bookingId)},rescheduleButtonClicked:async(e,a)=>{const n=await a.scheduler.setReschedule(e.detail.bookingId),{errorHandler:s}=e.detail;s&&(!n||"error"in n)&&s(n)}},fireRegisterEvent:!0}),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",void 0)],z.prototype,"render",null);z.style=V;const G=':host{display:block;height:100%;--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-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family)}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}',U=G;var W=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},g=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const v=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,B=class{constructor(e){t.registerInstance(this,e),this.nameChanged=t.createEvent(this,"nameChanged",7),this.emailChanged=t.createEvent(this,"emailChanged",7),this.backButtonClicked=t.createEvent(this,"backButtonClicked",7),this.detailsConfirmed=t.createEvent(this,"detailsConfirmed",7),this.bookingFormError=t.createEvent(this,"bookingFormError",7),this.handleGuestChange=(a,n)=>{this.resetGuestEmailError(a);const s=[...this.guestEmails];s[a]=n,this.guestEmails=[...s]},this.handleGuestBlur=(a,n)=>{if(this.resetGuestEmailError(a),n===""){this.guestEmailErrors[a]="Email is required";return}if(!v.test(n)){this.guestEmailErrors[a]="Enter a valid email address";return}this.handleGuestChange(a,n)},this.addGuestButtonClickedHandler=()=>{this.guestEmails=[...this.guestEmails,""]},this.removeGuestButtonClickHandler=(a,n)=>{a.preventDefault(),this.resetGuestEmailError(n);const s=[...this.guestEmails];s.splice(n,1),this.guestEmails=[...s]},this.handleBackButtonClicked=()=>{this.backButtonClicked.emit()},this.bookButtonClickedHandler=async a=>{var i,r,l,c,f,N,O;a.preventDefault(),t.debug("nylas-booking-form","bookButtonClickedHandler",this.bookingInfo);const n=this.name||((r=(i=this.bookingInfo)==null?void 0:i.primaryParticipant)==null?void 0:r.name),s=this.email||((c=(l=this.bookingInfo)==null?void 0:l.primaryParticipant)==null?void 0:c.email);if(!n||n===""){this.isNameValid=!1,this.validationError.name="Name is required",this.bookingFormError.emit({title:"Booking form error",description:"Name is required"});return}if(!s||s===""){this.isEmailValid=!1,this.validationError.email="Email is required",this.bookingFormError.emit({title:"Booking form error",description:"Email is required"});return}if(!v.test(s)){this.isEmailValid=!1,this.validationError.email="Enter a valid email address",this.bookingFormError.emit({title:"Booking form error",description:"Invalid email"});return}let o=[];if(this.guestEmails.length>0){let p=!1;if(this.guestEmails.forEach((h,F)=>{h===""?(p=!0,this.guestEmailErrors={...this.guestEmailErrors,[F]:"Email is required"}):v.test(h)||(p=!0,this.guestEmailErrors={...this.guestEmailErrors,[F]:"Enter a valid email address"})}),p){this.bookingFormError.emit({title:"Booking form error",description:"Invalid guest email"});return}o=this.guestEmails.map(h=>({name:"",email:h.trim()}))}else(f=this.bookingInfo)!=null&&f.guests&&(o=(N=this.bookingInfo)==null?void 0:N.guests);this.detailsConfirmed.emit({primaryParticipant:{name:n,email:s},guests:o,additionalFields:{...(O=this.bookingInfo)==null?void 0:O.additionalFields}})},this.isLoading=void 0,this.bookingInfo=void 0,this.eventInfo=void 0,this.name="",this.email="",this.guestEmails=[],this.guestEmailErrors={},this.isNameValid=!0,this.isEmailValid=!0,this.validationError={name:"",email:""}}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){var e,a;t.debug("nylas-booking-form","componentWillLoad",this.bookingInfo),this.bookingInfo&&(this.name=(e=this.bookingInfo.primaryParticipant)==null?void 0:e.name,this.email=(a=this.bookingInfo.primaryParticipant)==null?void 0:a.email)}bookingInfoChangedHandler(e){e&&e.primaryParticipant&&(this.name=e.primaryParticipant.name,this.email=e.primaryParticipant.email)}changeName(e){this.isNameValid=!0,this.validationError.name="",this.name=e,this.nameChanged.emit(e)}changeEmail(e){this.isEmailValid=!0,this.validationError.email="",this.email=e,this.emailChanged.emit(e)}resetGuestEmailError(e){const a={...this.guestEmailErrors};delete a[e],this.guestEmailErrors={...a}}render(){return t.h(t.Host,{key:"018357db1ce7dbbeb11ebc236b869a3baf246c69"},t.h("form",{key:"5f26a98903372d4c587df1d1045bcb240c4ee7cd",onSubmit:e=>this.bookButtonClickedHandler(e),noValidate:!0},t.h("div",{key:"4ad84c89bb19933cb5d8403939104c38705ddfba",class:"nylas-booking-form"},t.h("slot",{key:"c594f51e9d8cbd40e1d42f9aa86baae536a9c7e7",name:"custom-booking-form"},t.h("div",{key:"fe026c1562cb85c773e31cec8a0a3574b3515e0c",class:"input-wrapper"},t.h("label",{key:"27ecf20858dd3133ec4914970f7148720bc603ed",htmlFor:"name",class:{"input-label":!0,error:!this.isNameValid},part:"nbf__input-label"},"Name ",t.h("span",{key:"4a39ea8d7aa693f860c17aa28b2130ae49f31a1c",class:"required"},"*")),t.h("input",{key:"69fb70d74fe3b3cd883ca7fc0a9f174b6f81936a",id:"name",type:"text",placeholder:"Enter your name",value:this.name,class:{input:!0,error:!this.isNameValid},part:"nbf__input-textfield",onInput:e=>{var a;return this.changeName((a=e.target)==null?void 0:a.value)}}),t.h("p",{key:"e4be03fd299cbc94713e5561fb9ed69a78af200c",class:"help-text"},this.validationError.name)),t.h("div",{key:"017e724bfd408c5bde7714ae8b2a941d4a1194d9",class:"input-wrapper"},t.h("label",{key:"ed19f30d50d5d2ae95bcbf567b5c888b7906463d",htmlFor:"email",class:{"input-label":!0,error:!this.isEmailValid},part:"nbf__input-label"},"Email ",t.h("span",{key:"9b3ab493851edfcc407a38fad0994da171ac9976",class:"required"},"*")),t.h("input",{key:"768690b3cc350537be1fa39cc7a295f688c1d91d",id:"email",type:"email",placeholder:"Enter your email",value:this.email,class:{input:!0,error:!this.isEmailValid},part:"nbf__input-textfield",onInput:e=>{var a;return this.changeEmail((a=e.target)==null?void 0:a.value)}}),t.h("p",{key:"24a39d859e700d000a363fe8df2f000365542fb0",class:"help-text"},this.validationError.email)))),t.h("div",{key:"40b4b99dcf471afb8079d49fb9a0efe6bb7e406c",class:"cta"},t.h("sp-button",{key:"ae6bc3f620953f355184c7aef3ce692c2509c81d",treatment:"outline",variant:"secondary",class:"back",part:"nbf__button-outline",onClick:this.handleBackButtonClicked},t.h("slot",{key:"e5a10ff0978756f7c3f8751a7aca6e3281f5046b",name:"booking-form-back-label"},"Back")),t.h("sp-button",{key:"3aa5fe99000d52ef64db4191950109caeb526878",variant:"primary",class:"book",part:"nbf__button-primary",type:"submit"},this.isLoading&&t.h("loading-icon",{slot:"icon"}),t.h("slot",{key:"83c5332efd5eb82617dc0a0f5275950431d95c26",name:"booking-form-book-label"},"Book now")))))}get host(){return t.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChangedHandler"]}}};W([b.RegisterComponent({name:"nylas-booking-form",stateToProps:new Map([["scheduler.isLoading","isLoading"],["scheduler.bookingInfo","bookingInfo"],["scheduler.eventInfo","eventInfo"]]),eventToProps:{backButtonClicked:async(e,a)=>{a.scheduler.toggleAdditionalData(!1)},nameChanged:async(e,a)=>{a.scheduler.setParticipantName(e.detail)},emailChanged:async(e,a)=>{a.scheduler.setParticipantEmail(e.detail)}},fireRegisterEvent:!0}),g("design:type",Function),g("design:paramtypes",[]),g("design:returntype",void 0)],B.prototype,"render",null);B.style=U;const Y=':host{display:block;width:400px;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}',X=Y;var J=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},k=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const L=class{constructor(e){t.registerInstance(this,e),this.goBackButtonClicked=t.createEvent(this,"goBackButtonClicked",7),this.cancelBookingFormSubmitted=t.createEvent(this,"cancelBookingFormSubmitted",7),this.cancelBookedEventError=t.createEvent(this,"cancelBookedEventError",7),this.cancelBookingFormError=t.createEvent(this,"cancelBookingFormError",7),this.handleGoBackClicked=()=>{this.goBackButtonClicked.emit()},this.handleSubmitCancelBooking=a=>{if(a.preventDefault(),!this.cancellationReason){this.cancellationError="Please provide a reason for cancellation.",this.cancelBookingFormError.emit({title:"Cancel booking form error",description:"Please provide a reason for cancellation."});return}t.debug(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);const n=s=>{this.cancelBookedEventError.emit(s)};this.cancelBookingFormSubmitted.emit({bookingId:this.cancelBookingId,reason:this.cancellationReason,errorHandler:n})},this.handleOnChangeCancellationReason=a=>{this.cancellationError="",this.cancellationReason=a.target.value},this.cancelBookingId=void 0,this.cancellationReason="",this.cancellationError=""}connectedCallback(){t.debug("[nylas-cancel-booking-form] Component connected")}async componentWillLoad(){t.debug("[nylas-cancel-booking-form] Component will load")}async componentDidLoad(){t.debug("[nylas-cancel-booking-form] Component did load")}disconnectedCallback(){t.debug("[nylas-cancel-booking-form] Component disconnected")}render(){return t.h(t.Host,{key:"98dc29d53d8a05beb16dea271cab5c574df4dfd0",part:"ncec"},t.h("sp-theme",{key:"04feb774090fb57270a3d3c05576687ec78c230d",theme:"spectrum",scale:"medium"},t.h("div",{key:"024a947c805b9f2ab6204a8548e9c775078fa969",class:"nylas-cancel-booking-form",part:"ncec__card"},t.h("div",{key:"93295919797719199fbbe6eccdef4e42045c330d",class:"nylas-cancel-booking-form__calendar-icon",part:"ncec__icon"},t.h("calendar-cancel-icon",{key:"b8da092aa626ebdef64dd3f2f54ca2df5082d1f3"})),t.h("h3",{key:"8e33cc23c5bc26aa8e5c979814fa5a398c798237",class:"nylas-cancel-booking-form__title",part:"ncec__title"},"Cancel booking?"),t.h("div",{key:"2c8cd37241e6cfe38bb012be4d700ae03c33876e",class:"nylas-cancel-booking-form__description",part:"ncec__description"},"Your current timeslot will become available to others."),t.h("form",{key:"be720382bd84086cd8a25279dd4ec58dbfc113e6",onSubmit:this.handleSubmitCancelBooking},t.h("sp-field-label",{key:"fadd2793a898975b8ba8da0549bcbb37879a68bf",for:"cancel-reason",class:this.cancellationError?"error":""},"Reason for cancellation ",t.h("span",{key:"0748781625ea7ec8332b4ca20eae8986ad9e8efb",class:"required"},"*")),t.h("sp-textfield",{key:"e8daf40a5c26b1e6b9b59ab42bbe613da72c987a",id:"cancel-reason",class:this.cancellationError?"error":"",part:"ncec__reason-textarea",multiline:!0,value:this.cancellationReason,onInput:this.handleOnChangeCancellationReason,onFocus:this.handleOnChangeCancellationReason,invalid:!!this.cancellationError},t.h("sp-help-text",{key:"f876e2f41098845a235fe2b563e85891843d5351",slot:"negative-help-text"},this.cancellationError)),t.h("sp-button",{key:"a05211715fda7fa75935c974bd20ce6c6ef4206a",variant:"primary",class:"cancel",type:"submit",part:"ncec__button-cta"},"Cancel booking"),t.h("sp-button",{key:"3dd7832e698181eaca4df52835d64c09b664f5f9",variant:"secondary",class:"back",treatment:"outline",part:"ncec__button-outline",onClick:this.handleGoBackClicked},"Go back")))))}};J([b.RegisterComponent({name:"nylas-cancel-booking-form",eventToProps:{cancelBookingFormSubmitted:async(e,a)=>{const n=await a.scheduler.cancelBooking(e.detail.bookingId),{errorHandler:s}=e.detail;s&&(!n||"error"in n)&&s(n)}},fireRegisterEvent:!0}),k("design:type",Function),k("design:paramtypes",[]),k("design:returntype",void 0)],L.prototype,"render",null);L.style=X;const K=':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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}',Q=K;var ee=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},x=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const I=class{constructor(e){t.registerInstance(this,e),this.closeCancelEventCardClicked=t.createEvent(this,"closeCancelEventCardClicked",7),this.cancelledEventCardError=t.createEvent(this,"cancelledEventCardError",7),this.handleCloseClicked=()=>{this.isClosing=!0;const a=n=>{this.cancelledEventCardError.emit(n),this.isClosing=!1};this.closeCancelEventCardClicked.emit({errorHandler:a})},this.cancelledEventInfo=void 0,this.isClosing=!1,this.configSettings=void 0}connectedCallback(){t.debug("[nylas-cancelled-event-card] Component connected")}async componentWillLoad(){t.debug("[nylas-cancelled-event-card] Component will load")}async componentDidLoad(){t.debug("[nylas-cancelled-event-card] Component did load")}disconnectedCallback(){t.debug("[nylas-cancelled-event-card] Component disconnected")}render(){var e,a;return t.h(t.Host,{key:"105954b6497f7a8cf45faedb592896629e90c6d0",part:"ncec"},t.h("sp-theme",{key:"d248975c2139a611ab60c5c585d87e8701327a4b",theme:"spectrum",color:"dark",scale:"medium"},t.h("div",{key:"090b767111679ca9968ac0b128c6685fed6e39db",class:"nylas-cancelled-event-card",part:"ncec__card"},t.h("div",{key:"ae1e57f0f2a39f5ad7f4b7b9ed493f3e93ccdeba",class:"nylas-cancelled-event-card__calendar-icon",part:"ncec__icon"},t.h("calendar-cancel-icon",{key:"06250b1c0f330957f0f691d0f7724c608dffa28b"})),t.h("h3",{key:"1826c12ca770476cfd206d9d1a3b80f0d890da56",class:"nylas-cancelled-event-card__title",part:"ncec__title"},"Your booking has been cancelled successfully!"),t.h("div",{key:"93c4c7e4ed245372e736c61c30b23e9be11453ec",class:"nylas-cancelled-event-card__description",part:"ncec__description"},"A cancellation email has been sent to ",((a=(e=this.configSettings)==null?void 0:e.organizer)==null?void 0:a.name)||"the participants","."),t.h("div",{key:"21162d4c4e2ee6c2f95038b0e25e9ad0aed63742",class:"nylas-cancelled-event-card__cta"},t.h("sp-button",{key:"ab6cb1da324717c3b375c9280f307a2590224f27",variant:"secondary",treatment:"outline",disabled:this.isClosing,part:"ncec__button-outline",onClick:this.handleCloseClicked},this.isClosing?"Closing...":"Close")))))}};ee([b.RegisterComponent({name:"nylas-cancelled-event-card",stateToProps:new Map([["scheduler.configSettings","configSettings"]]),eventToProps:{closeCancelEventCardClicked:async(e,a)=>{const n=await a.scheduler.resetCancel(),{errorHandler:s}=e.detail;s&&(!n||"error"in n)&&s(n)}},fireRegisterEvent:!0}),x("design:type",Function),x("design:paramtypes",[]),x("design:returntype",void 0)],I.prototype,"render",null);I.style=Q;const C=new Date,w=new Date;function u(e,a,n,s){function o(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(e(i=new Date(+i)),i),o.ceil=i=>(e(i=new Date(i-1)),a(i,1),e(i),i),o.round=i=>{const r=o(i),l=o.ceil(i);return i-r<l-i?r:l},o.offset=(i,r)=>(a(i=new Date(+i),r==null?1:Math.floor(r)),i),o.range=(i,r,l)=>{const c=[];if(i=o.ceil(i),l=l==null?1:Math.floor(l),!(i<r)||!(l>0))return c;let f;do c.push(f=new Date(+i)),a(i,l),e(i);while(f<i&&i<r);return c},o.filter=i=>u(r=>{if(r>=r)for(;e(r),!i(r);)r.setTime(r-1)},(r,l)=>{if(r>=r)if(l<0)for(;++l<=0;)for(;a(r,-1),!i(r););else for(;--l>=0;)for(;a(r,1),!i(r););}),n&&(o.count=(i,r)=>(C.setTime(+i),w.setTime(+r),e(C),e(w),Math.floor(n(C,w))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(s?r=>s(r)%i===0:r=>o.count(0,r)%i===0):o)),o}const te=1e3,H=te*60,ae=H*60,m=ae*24,_=u(e=>e.setHours(0,0,0,0),(e,a)=>e.setDate(e.getDate()+a),(e,a)=>(a-e-(a.getTimezoneOffset()-e.getTimezoneOffset())*H)/m,e=>e.getDate()-1);u(e=>{e.setUTCHours(0,0,0,0)},(e,a)=>{e.setUTCDate(e.getUTCDate()+a)},(e,a)=>(a-e)/m,e=>e.getUTCDate()-1);u(e=>{e.setUTCHours(0,0,0,0)},(e,a)=>{e.setUTCDate(e.getUTCDate()+a)},(e,a)=>(a-e)/m,e=>Math.floor(e/m));const ne=':host{display:block;min-height:444px;--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}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:1rem}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}',ie=ne;var se=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},E=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const R=class{constructor(e){t.registerInstance(this,e),this.dateSelected=t.createEvent(this,"dateSelected",7),this.monthChanged=t.createEvent(this,"monthChanged",7),this.selectableDates=void 0,this.selectedDate=void 0,this.configSettings=void 0,this.isLoading=void 0,this.month=this.selectedDate||new Date,this.dates=this.getDates(),this.disableNextMonthButton=!1}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}getDates(){const e=t.getLastDayOfMonth(this.month),a=t.getFirstDayOfMonth(this.month);return _.range(_.offset(a,-a.getDay()),_.offset(e,7-e.getDay()))}selectDate(e){this.dateSelected.emit(e)}changeMonth(e){var o,i;this.month=new Date(this.month.getFullYear(),this.month.getMonth()+e,1);const a=new Date(this.month.getFullYear(),this.month.getMonth()+1,1),n=(i=(o=this.configSettings)==null?void 0:o.scheduler)==null?void 0:i.available_days_in_future;t.addDaysToCurrentDate(new Date,n).getTime()<a.getTime()?this.disableNextMonthButton=!0:this.disableNextMonthButton=!1,this.dates=this.getDates(),this.monthChanged.emit(this.month),this.selectDate()}isSelected(e,a,n){return e&&a&&t.isSameDay(e,a)&&n&&(n==null?void 0:n.length)>0}isDisabled(e,a){return e&&(a==null?void 0:a.find(n=>t.isSameDay(n,e)))===void 0}render(){var e,a;return t.h(t.Host,{key:"d6122ec547ac33e6febfe41497a1bd3de1eeb6b3",part:"ndp"},t.h("div",{key:"cee58b509bf57156342c7506a020b64611f62209",class:"nylas-date-picker"},t.h("div",{key:"bb3a8356004b07fd86fb05961eb400215b824e3a",class:"header flex-row"},t.h("h2",{key:"681f87b531eaa6c26b99bb2616fd59cd388e6bd9",part:"ndp__month-header"},t.h("strong",{key:"e93fb4feacb91042cbfa8bb65b0a196fafb343d2"},this.month.toLocaleDateString(void 0,{month:"long"}))," ",this.month.toLocaleDateString(void 0,{year:"numeric"})),t.h("div",{key:"fb4c4671c2cf24d4ae2ddf1077d0431a8a6261a8",class:"pagination"},t.h("button",{key:"6810b244baf594e6a9c69b2916704744a0d18f74",onClick:()=>this.changeMonth(-1),class:{"chevron-left":!0,button:!0},disabled:!((e=this.selectableDates)!=null&&e.length)||this.month<=new Date,part:"ndp__month-button"},t.h("chevron-icon",{key:"8a14ef5e447da88e3c1c19b77f7d42454243dd4e"})),t.h("button",{key:"aa6efd17b59da3308fec14032c64017849750702",onClick:()=>this.changeMonth(1),class:{"chevron-right":!0,button:!0},disabled:!((a=this.selectableDates)!=null&&a.length)||this.disableNextMonthButton,part:"ndp__month-button"},t.h("chevron-icon",{key:"3a1704b4c41d92ac54a6936e487402a98bba5de1"})))),t.h("div",{key:"85910baac9b8b411ebfede44c0a11bff2e489efe",class:"dates"},["SUN","MON","TUE","WED","THU","FRI","SAT"].map(n=>t.h("div",{class:"day",part:"ndp__day"},n)),this.dates.map((n,s)=>{var i;const o=this.isDisabled(n,this.selectableDates);return this.isLoading?t.h("button",{disabled:!0,class:{"date day-skeleton":!0,"current-month":t.isSameMonth(n,this.month)},style:{animationDelay:`${s*20}ms`},part:"ndp__date"},n.getDate()):t.h("button",{class:{date:!0,selected:!!(this.selectedDate&&t.isSameDay(n,this.selectedDate)&&this.selectableDates&&((i=this.selectableDates)==null?void 0:i.length)>0),"current-day":t.isSameDay(n,new Date),"current-month":t.isSameMonth(n,this.month)},"aria-lang":n.toLocaleDateString(void 0,{dateStyle:"full"}),disabled:o,onClick:()=>this.selectDate(n),part:`ndp__date ${this.isSelected(n,this.selectedDate,this.selectableDates)?"ndp__date--selected":""} ${t.isSameDay(n,new Date)?"ndp__date--current-day":""} ${t.isSameMonth(n,this.month)?"ndp__date--current-month":""}`},n.getDate())}))))}};se([b.RegisterComponent({name:"nylas-date-picker",stateToProps:new Map([["scheduler.selectableDates","selectableDates"],["scheduler.selectedDate","selectedDate"],["scheduler.isLoading","isLoading"],["scheduler.configSettings","configSettings"]]),eventToProps:{dateSelected:async(e,a)=>{a.scheduler.selectDate(e.detail)}},fireRegisterEvent:!0}),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",void 0)],R.prototype,"render",null);R.style=ie;const re=':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-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}',oe=re;var le=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},T=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const M=class{constructor(e){t.registerInstance(this,e),this.timezoneChanged=t.createEvent(this,"timezoneChanged",7),this.languageChanged=t.createEvent(this,"languageChanged",7),this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.selectedLanguage=navigator.language}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}changeTimezone(e){this.selectedTimezone=e,this.timezoneChanged.emit(e)}changeLanguage(e){this.selectedLanguage=e,this.languageChanged.emit(e)}selectedOptionChangedHandler(e){const{name:a,value:n}=e.detail;a==="timezone"?this.changeTimezone(n):a==="language"&&this.changeLanguage(n)}getTimezoneLabelHTML(e){const a=d.getTimezoneOffset(e);return t.h("span",{class:"timezone-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"-webkit-fill-available"}},d.TIMEZONE_MAP[e]," ",t.h("span",{class:"timezone-offset",style:{fontSize:"14px",fontWeight:"400",color:"var(--nylas-base-500)"}},a))}render(){const e=Object.keys(d.TIMEZONE_MAP).map(n=>({labelHTML:this.getTimezoneLabelHTML(n),label:d.TIMEZONE_MAP[n],value:n})),a=Object.keys(d.LANGUAGE_MAP).map(n=>({label:d.LANGUAGE_MAP[n],value:n}));return t.h(t.Host,{key:"9b59f6361d95bf132b22ff7d03edd20c58d81f9a"},t.h("div",{key:"f2ebeeaed33b6e750f71d23ca24aa2d1ad858a10",class:"nylas-locale-switch"},t.h("div",{key:"3bb086e794c113b62d88b458f213beaeb28bf5c7",class:{"select-wrapper":!0,timezone:!0}},t.h("select-dropdown",{key:"169822d4f1c58f795f0a9189c074699814a2790e",name:"timezone",options:e,defaultSelectedOption:e.find(n=>n.value==this.selectedTimezone)},t.h("span",{key:"54fd84316990a375e60291bc68406a2fd1a43f57",slot:"select-icon"},t.h("globe-icon",{key:"2cd6a94baef61202b97411e10cb212b48ddd527a",width:"20",height:"20"})))),t.h("div",{key:"39e1a7f52109e87ebfcd41f5eb35146a21ab7911",class:{"select-wrapper":!0,language:!0}},t.h("select-dropdown",{key:"b803b2685efe46673d125b3d10714bafd48197c1",name:"language",options:a,defaultSelectedOption:a.find(n=>n.value==this.selectedLanguage)},t.h("span",{key:"b8a7d37f9bd60a14f2652fd17d7572b2bd853ee7",slot:"select-icon"},t.h("translate-icon",{key:"b36f31c8ddec7a70fdce4154006fce11af4e3bb3",width:"20",height:"20"}))))))}};le([b.RegisterComponent({name:"nylas-locale-switch",stateToProps:new Map([["scheduler.selectedLanguage","selectedLanguage"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{timezoneChanged:async(e,a)=>{a.scheduler.selectTimezone(e.detail)}},fireRegisterEvent:!0}),T("design:type",Function),T("design:paramtypes",[]),T("design:returntype",void 0)],M.prototype,"render",null);M.style=oe;const ce=".sc-nylas-logo-h{display:flex}",de=ce,$=class{constructor(e){t.registerInstance(this,e),this.width="69",this.height="24"}render(){return t.h("svg",{key:"5aea87a70e3fd0d4db9231f986662a0e51d5225e",width:this.width,height:this.height,viewBox:"0 0 69 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("g",{key:"635ee7b2cff95d3949dc8a7aba5d7897ac42bec8","clip-path":"url(#clip0_455_3543)"},t.h("path",{key:"818b4ab1d5087f3dbd4b65ec92c46da729b7b034",d:"M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z",fill:"currentColor"}),t.h("path",{key:"0519037016d40d4c264b929f042bffde6fcb4095",d:"M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z",fill:"currentColor"}),t.h("path",{key:"10efd16fe4864b407bed8c54611001c6a0f5098f",d:"M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z",fill:"currentColor"}),t.h("path",{key:"0282ae1035c07bd0f8af5c3530ce7ce799dc2dc1",d:"M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z",fill:"currentColor"}),t.h("path",{key:"16e1d732c5e6eee5f772d45085103b099c3130bf",d:"M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z",fill:"currentColor"}),t.h("path",{key:"495550fe08ebeba1c89726b7009112e89088472a",d:"M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z",fill:"currentColor"}),t.h("path",{key:"effe06423b66ff0a533bfb8ec6d9a0cbbf19f765",d:"M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z",fill:"currentColor"}),t.h("path",{key:"785098f3a2ac3a19e79056e355365fd8ccc81cd9",d:"M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z",fill:"currentColor"})),t.h("defs",{key:"9466fc6ad025006936d16136c6f4be4b79282759"},t.h("clipPath",{key:"901a3ef6048680de4ddbdd8e3fd8edfbb7afc0f3",id:"clip0_455_3543"},t.h("rect",{key:"aee5f90208b83c446e4ac3877ce788d0dcad0de3",width:"68.7123",height:"19.2877",fill:"white",transform:"translate(0.144043 0.356201)"}))))}};$.style=de;const be=':host{display:block;margin-bottom:-12px;width:100%;z-index: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}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}',fe=be,A=class{constructor(e){t.registerInstance(this,e),this.ttl=5e3,this.allowedCategories=["component","api","validation","invalid_session"],this.notifications=[]}onError(e){t.debug(`[nylas-notification] Error: ${e.detail.title}`),this.handleNotification(e)}onWarning(e){t.debug(`[nylas-notification] Warning: ${e.detail.title}`),this.handleNotification(e)}onInfo(e){t.debug(`[nylas-notification] Info: ${e.detail.title}`),this.handleNotification(e)}onSuccess(e){t.debug(`[nylas-notification] Success: ${e.detail.title}`),this.handleNotification(e)}handleNotification(e){if(e.defaultPrevented){t.debug("[nylas-notification] Event default prevented");return}if(this.ttl===0){t.debug("[nylas-notification] TTL is 0");return}if(this.allowedCategories.length>0&&!this.allowedCategories.includes(e.detail.category)){t.debug("[nylas-notification] Category not allowed");return}if(this.notifications=[...this.notifications,{...e.detail}],e.detail.ttl!=="none"){const a=e.detail.ttl?e.detail.ttl:this.ttl;window.setTimeout(()=>{this.notifications=this.notifications.filter(n=>n.id!==e.detail.id)},a)}}dismissNotification(e){this.notifications=this.notifications.filter(a=>a.id!==e)}render(){return t.h(t.Host,{key:"16bd673245819e3ed76ba5689c3292be510e3cd7"},t.h(t.Fragment,{key:"d88e8ea863d00a8c982c7e26007c975526c7457f"},this.notifications.map(e=>t.h("div",{class:`notif ${e.type}`,key:e.id},t.h("div",{class:"content"},t.h("span",{class:`icon ${e.type}`},(e.type==="error"||e.type==="warning")&&t.h("warning-icon",null)),t.h("span",{class:"message"},t.h("span",{class:"title"},e.title),e.description&&t.h("span",{class:"description"},e.description))),t.h("button",{class:"dismiss-btn",onClick:()=>this.dismissNotification(e.id)},t.h("close-icon",null)))),t.h("slot",{key:"c40cb61ce0a1dbd3416824b7c26e08e3aea01eae"})))}};A.style=fe;const he=":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:min(max(14px, 3vw), 16px);font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}",me=he;var ue=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},D=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const P=class{constructor(e){t.registerInstance(this,e),this.selectedDate=void 0,this.selectedTimeslot=void 0,this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.startTime="",this.endTime=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){t.debug("[nylas-selected-event-card] Component will load")}async componentDidLoad(){t.debug("[nylas-selected-event-card] Component did load")}handleSelectedTimeslotChange(e){this.startTime=new Date(e==null?void 0:e.start_time).toLocaleString(void 0,{timeStyle:"short"}),this.endTime=new Date(e==null?void 0:e.end_time).toLocaleString(void 0,{timeStyle:"short"})}render(){var e;return t.h(t.Host,{key:"c84565db48fc177fd6f8af71db7f9776516cf46f",part:"nsec"},t.h("sp-theme",{key:"7de2e148c85b878e735ac6a69a62892110de9b65",theme:"spectrum",color:"dark",scale:"medium"},t.h("div",{key:"0a9f43a55c68fdd7d93b42600b94e2f10d551dd4",class:"event-card",part:"nsec__card"},t.h("div",{key:"18b16b39d4c3d7c1a0f9c16c084d99f1b9b9ff5b",class:"calendar-icon",part:"nsec__icon"},t.h("calendar-icon",{key:"92202409a7e922975ab31216d8f68c3fb8767cbe"})),t.h("div",{key:"79006fdf073ed56acec50e1e11ddf101fcfca81c",class:"nylas-selected-event-card__date",part:"nsec__date"},(e=this.selectedDate)==null?void 0:e.toLocaleDateString(void 0,{dateStyle:"full"})),t.h("div",{key:"1f605b2bc03f290b5a5b3ac858256f438ac33651",class:"nylas-selected-event-card__time",part:"nsec__time"},this.startTime," - ",this.endTime)),t.h("div",{key:"03f9f64e0229904519984305751c388886838b99",class:"event-timezone",part:"nsec__timezone"},t.h("globe-icon",{key:"7bd33f03d96671423199113ee24fe913f78c1bca"}),d.TIMEZONE_MAP[this.selectedTimezone])))}static get watchers(){return{selectedTimeslot:["handleSelectedTimeslotChange"]}}};ue([b.RegisterComponent({name:"nylas-selected-event-card",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"]]),eventToProps:{},fireRegisterEvent:!0}),D("design:type",Function),D("design:paramtypes",[]),D("design:returntype",void 0)],P.prototype,"render",null);P.style=me;const pe=":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}",ye=pe;var ge=function(e,a,n,s){var o=arguments.length,i=o<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,a,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(o<3?r(i):o>3?r(a,n,i):r(a,n))||i);return o>3&&i&&Object.defineProperty(a,n,i),i},S=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const j=class{constructor(e){t.registerInstance(this,e),this.timeslotSelected=t.createEvent(this,"timeslotSelected",7),this.timeslotConfirmed=t.createEvent(this,"timeslotConfirmed",7),this.handleConfirmedTimeslot=async(a,n)=>{a.preventDefault(),t.debug("[nylas-timeslot-picker] Confirm timeslot",n),this.timeslotConfirmed.emit(n)},this.handleMouseEnter=a=>{this.hoveredTimeslotIndex=a},this.handleMouseLeave=()=>{this.hoveredTimeslotIndex=-1},this.selectedDate=new Date,this.availability=void 0,this.selectedTimeslot=void 0,this.isLoading=void 0,this.selectedTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.times=[],this.hoveredTimeslotIndex=void 0,this.selectedTimeslotIndex=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){var a;const e=(a=this.availability)==null?void 0:a.filter(n=>this.selectedDate&&t.isSameDay(n.start_time,this.selectedDate)).map(n=>n);this.times=e||[],t.debug("[nylas-timeslot-picker] Component will load",{selectedDate:this.selectedDate,availability:this.availability,times:this.times})}async componentDidLoad(){t.debug("[nylas-timeslot-picker] Component did load")}getTimeslotId(e,a){return`${e.toLocaleDateString()}-${a}`}onClickSelectTime(e,a){t.debug("[nylas-timeslot-picker] Time selected",e,a),this.selectedTimeslotIndex=this.getTimeslotId(e.start_time,a),this.timeslotSelected.emit({start_time:e.start_time,end_time:e.end_time})}getTimeSlotLabel(e){const a=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"numeric",timeZone:this.selectedTimezone});return`${a.format(e.start_time)} - ${a.format(e.end_time)}`}selectedDateChanged(e){var a;if(t.debug("[nylas-timeslot-picker] Selected date changed",{newVal:e}),e&&(this.selectedTimeslotIndex="",typeof e<"u")){const n=(a=this.availability)==null?void 0:a.filter(s=>t.isSameDay(s.start_time,e)).map(s=>s);this.times=n||[]}}availabilityChanged(e){if(t.debug("[nylas-timeslot-picker] Available times changed",{newVal:e,selectedDate:this.selectedDate}),typeof e<"u"){const a=e==null?void 0:e.filter(n=>this.selectedDate&&t.isSameDay(n.start_time,this.selectedDate)).map(n=>n);this.times=a||[]}}render(){return this.isLoading?t.h(t.Host,null,t.h("div",{class:"loading"},new Array(6).fill(0).map((e,a)=>t.h("div",{class:"time-slot-skeleton",style:{animationDelay:`${a*20}ms`}})))):this.availability&&this.availability.length===0?t.h(t.Host,null,t.h("div",{class:"empty"},t.h("span",null,"No dates available"))):(!this.times||this.times.length===0)&&this.selectedDate?t.h(t.Host,null,t.h("div",{class:"empty"},t.h("span",null,"No time slots available for selected date"))):this.selectedDate?t.h(t.Host,{part:"ntp"},t.h("div",{class:"time-picker-wrapper"},t.h("div",{class:"time-slots"},this.times.map((e,a)=>{var n,s,o,i;return t.h("button",{part:`ntp__timeslot ${((s=(n=this.selectedTimeslot)==null?void 0:n.start_time)==null?void 0:s.getTime())===e.start_time.getTime()?"ntp__timeslot--selected":""}`,"aria-role":"button",class:{time:!0,selected:typeof this.selectedTimeslot<"u"&&((i=(o=this.selectedTimeslot)==null?void 0:o.start_time)==null?void 0:i.getTime())===e.start_time.getTime()},onClick:()=>this.onClickSelectTime(e,a),onMouseEnter:()=>this.handleMouseEnter(a),onMouseLeave:()=>this.handleMouseLeave()},this.hoveredTimeslotIndex==a||this.selectedTimeslotIndex==this.getTimeslotId(e.start_time,a)?this.getTimeSlotLabel(e):e.start_time.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",timeZone:this.selectedTimezone}))})),this.selectedTimeslot&&t.h("div",{class:"footer"},t.h("sp-button",{variant:"primary",onClick:e=>this.handleConfirmedTimeslot(e,this.selectedTimeslot),part:"ntp__button-primary"},t.h("slot",{name:"timeslot-picker-cta-label"},"Next"))))):t.h(t.Host,null)}static get watchers(){return{selectedDate:["selectedDateChanged"],availability:["availabilityChanged"]}}};ge([b.RegisterComponent({name:"nylas-timeslot-picker",stateToProps:new Map([["scheduler.selectedDate","selectedDate"],["scheduler.availability","availability"],["scheduler.selectedTimeslot","selectedTimeslot"],["scheduler.selectedTimezone","selectedTimezone"],["scheduler.isLoading","isLoading"]]),eventToProps:{timeslotSelected:async(e,a)=>{a.scheduler.selectTime(e.detail)},timeslotConfirmed:async(e,a)=>{e.detail&&a.scheduler.toggleAdditionalData(!0)}},fireRegisterEvent:!0}),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",void 0)],j.prototype,"render",null);j.style=ye;exports.nylas_booked_event_card=z;exports.nylas_booking_form=B;exports.nylas_cancel_booking_form=L;exports.nylas_cancelled_event_card=I;exports.nylas_date_picker=R;exports.nylas_locale_switch=M;exports.nylas_logo=$;exports.nylas_notification=A;exports.nylas_selected_event_card=P;exports.nylas_timeslot_picker=j;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { r as i, d as l, h as s, H as y } from "./index-4c7e8f2f.js";
|
|
2
|
-
import { R as m } from "./register-component-83e24412-51af5293.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const p = ':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-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}', u = p;
|
|
6
|
-
var v = function(e, a, r, t) {
|
|
7
|
-
var c = arguments.length, n = c < 3 ? a : t === null ? t = Object.getOwnPropertyDescriptor(a, r) : t, d;
|
|
8
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
9
|
-
n = Reflect.decorate(e, a, r, t);
|
|
10
|
-
else
|
|
11
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
12
|
-
(d = e[o]) && (n = (c < 3 ? d(n) : c > 3 ? d(a, r, n) : d(a, r)) || n);
|
|
13
|
-
return c > 3 && n && Object.defineProperty(a, r, n), n;
|
|
14
|
-
}, f = function(e, a) {
|
|
15
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
16
|
-
return Reflect.metadata(e, a);
|
|
17
|
-
};
|
|
18
|
-
const b = class {
|
|
19
|
-
constructor(e) {
|
|
20
|
-
i(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
|
|
21
|
-
}
|
|
22
|
-
connectedCallback() {
|
|
23
|
-
l("nylas-event-card", "connectedCallback");
|
|
24
|
-
}
|
|
25
|
-
componentWillLoad() {
|
|
26
|
-
l("nylas-event-card", "componentWillLoad");
|
|
27
|
-
}
|
|
28
|
-
componentDidLoad() {
|
|
29
|
-
l("nylas-event-card", "componentDidLoad");
|
|
30
|
-
}
|
|
31
|
-
disconnectedCallback() {
|
|
32
|
-
l("nylas-event-card", "disconnectedCallback");
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
return s(y, { key: "ccce348d0ddf9bec8fddb815cf63cbc9d9df4973" }, s("div", { key: "6c0f3120bc608ac05fb631752834636cdb5a4845", class: "nylas-form-card" }, s("div", { key: "08a045eb3b7190d38373efb80f4f709987956347", class: "nylas-form-card__header" }, s("slot", { key: "a9a076210a056c984ad40eced110f2d9b737f36d", name: "header-title" }), s("slot", { key: "65cc8f117db216d458338da2b3a0f673864234bc", name: "header-subtitle" })), s("div", { key: "6c308c3377952cd7a1b3ad112de55333ef517a03", class: "nylas-form-card__content" }, s("slot", { key: "5c0e7388949d250f0e3b027df2bfd9a3342d1574", name: "content" }))));
|
|
36
|
-
}
|
|
37
|
-
static get formAssociated() {
|
|
38
|
-
return !0;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
v([
|
|
42
|
-
m({
|
|
43
|
-
name: "nylas-form-card",
|
|
44
|
-
eventToProps: {},
|
|
45
|
-
fireRegisterEvent: !0
|
|
46
|
-
}),
|
|
47
|
-
f("design:type", Function),
|
|
48
|
-
f("design:paramtypes", []),
|
|
49
|
-
f("design:returntype", void 0)
|
|
50
|
-
], b.prototype, "render", null);
|
|
51
|
-
b.style = u;
|
|
52
|
-
export {
|
|
53
|
-
b as nylas_form_card
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-3a004ec1.cjs"),f=require("./register-component-83e24412-d76a2962.cjs");require("react");require("react-dom");const i=':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-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}',y=i;var m=function(a,n,r,t){var d=arguments.length,s=d<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,r):t,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(a,n,r,t);else for(var l=a.length-1;l>=0;l--)(c=a[l])&&(s=(d<3?c(s):d>3?c(n,r,s):c(n,r))||s);return d>3&&s&&Object.defineProperty(n,r,s),s},o=function(a,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,n)};const b=class{constructor(a){e.registerInstance(this,a),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals)}connectedCallback(){e.debug("nylas-event-card","connectedCallback")}componentWillLoad(){e.debug("nylas-event-card","componentWillLoad")}componentDidLoad(){e.debug("nylas-event-card","componentDidLoad")}disconnectedCallback(){e.debug("nylas-event-card","disconnectedCallback")}render(){return e.h(e.Host,{key:"ccce348d0ddf9bec8fddb815cf63cbc9d9df4973"},e.h("div",{key:"6c0f3120bc608ac05fb631752834636cdb5a4845",class:"nylas-form-card"},e.h("div",{key:"08a045eb3b7190d38373efb80f4f709987956347",class:"nylas-form-card__header"},e.h("slot",{key:"a9a076210a056c984ad40eced110f2d9b737f36d",name:"header-title"}),e.h("slot",{key:"65cc8f117db216d458338da2b3a0f673864234bc",name:"header-subtitle"})),e.h("div",{key:"6c308c3377952cd7a1b3ad112de55333ef517a03",class:"nylas-form-card__content"},e.h("slot",{key:"5c0e7388949d250f0e3b027df2bfd9a3342d1574",name:"content"}))))}static get formAssociated(){return!0}};m([f.RegisterComponent({name:"nylas-form-card",eventToProps:{},fireRegisterEvent:!0}),o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],b.prototype,"render",null);b.style=y;exports.nylas_form_card=b;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-3a004ec1.cjs"),m=require("./index.es-9190f785-60475c4c.cjs"),n=require("./mailbox-store-29139d89-dd9d3d1b.cjs");require("react");require("react-dom");require("./global-37eeb0cd-6c5934cf.cjs");class v{constructor(e,o,r,l){this.router=e,this.nylasAuth=o,this.nylasAuthStore=r,this.nylasMailboxStore=l}init(){s.debug("NylasMailboxConnector init")}get mailboxStore(){return this.nylasMailboxStore}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new n.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new n.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new n.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new n.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasMailboxStore.reset(),this.nylasAuthStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const _=":host{display:contents}",p=_,x=class{constructor(t){s.registerInstance(this,t),this.init=s.createEvent(this,"init",7),this.loggedIn=s.createEvent(this,"loggedIn",7),this.loggedOut=s.createEvent(this,"loggedOut",7),this.handleAuthChange=async e=>{var o;e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((o=this.nylasMailboxConnector)==null?void 0:o.logout())},this.automaticComponentRegistration=!0,this.eventOverrides={},this.authConfig=void 0,this.defaultAuthStoreState=void 0,this.defaultMailboxStoreState=void 0}connectedCallback(){s.debug("[nylas-mailbox] connectedCallback")}async componentWillLoad(){var r,l,u,c,y,g,b;this.stores={auth:n.CreateNylasAuthStore(this.defaultAuthStoreState),mailbox:n.CreateNylasMailboxStore(this.defaultMailboxStoreState)},this.baseProvider=new m.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.router=new n.HashRouter,this.nylasAuth=m.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(r=this.baseProvider)==null?void 0:r.getStore("auth");if(!t)throw new Error("Auth store is not defined");const e=(l=this.baseProvider)==null?void 0:l.getStore("mailbox");if(!e)throw new Error("Mailbox store is not defined");this.nylasMailboxConnector=new v(this.router,this.nylasAuth,t,e),this.init.emit(this.host).defaultPrevented||await((u=this.nylasMailboxConnector)==null?void 0:u.auth.validateSession()),(c=this.router)==null||c.addRouteChangeListener("/thread/:threadId",async(A,M,C)=>{var a,h;const d=C.threadId,i=await((a=this.nylasMailboxConnector)==null?void 0:a.threads.getThread(d));i&&((h=this.nylasMailboxConnector)==null||h.mailboxStore.set("selectedThread",i))}),(y=this.router)==null||y.addRouteChangeListener("/",async(A,M,C)=>{var i,a,h,S;if(!t.state.isAuthenticated)return;(i=this.nylasMailboxConnector)==null||i.threads.unSelectThread(),(a=this.nylasMailboxConnector)==null||a.folders.getFolders();const d=window.location.hash.split("?")[1];if(d){const f=new URLSearchParams(d).get("query");f&&await((h=this.nylasMailboxConnector)==null?void 0:h.threads.getThreads({search_query_native:f,page_token:void 0}))}else(S=this.nylasMailboxConnector)==null||S.threads.getThreads()}),(g=this.router)==null||g.init(),this.handleAuthChange(t.state.isAuthenticated),(b=this.baseProvider)==null||b.componentWillLoad(this.nylasMailboxConnector)}async componentDidLoad(){var e,o;const t=(e=this.baseProvider)==null?void 0:e.getStore("auth");if(!t)throw new Error("Auth store is not defined");t.onChange("isAuthenticated",this.handleAuthChange),(o=this.baseProvider)==null||o.componentDidLoad()}componentDisconnected(){var t;(t=this.baseProvider)==null||t.componentDisconnected()}async registerComponentHandler(t){var e;(e=this.baseProvider)==null||e.registerComponent(t.detail)}async unregisterComponentHandler(t){var e;(e=this.baseProvider)==null||e.unregisterComponent(t.detail)}async getMailboxStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("mailbox")}async getAuthStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("auth")}async getNylasAuth(){return this.nylasAuth}async getNylasMailboxConnector(){return this.nylasMailboxConnector}render(){return s.h(s.Host,{key:"662c4d3f763c5cf9db31c4d2ba26bcdf47ead164"},s.h("slot",{key:"5c2b75a569779dd2af6388648a4304721e82ba76"}))}get host(){return s.getElement(this)}};x.style=p;exports.nylas_mailbox=x;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-3a004ec1.cjs"),g=require("./index.es-9190f785-60475c4c.cjs"),o=require("./mailbox-store-29139d89-dd9d3d1b.cjs"),S=require("./scheduler-store-dabdbc4f-404dc261.cjs"),b=require("./scheduler-config-store-ec3b6190-2710b76a.cjs");require("react");require("react-dom");require("./global-37eeb0cd-6c5934cf.cjs");class f{constructor(t,r,n,i,l,h,a="https://api.us.nylas.com"){this.router=t,this.schedulerAPIURL=a,this.nylasAuth=r,this.nylasAuthStore=n,this.nylasMailboxStore=i,this.nylasSchedulerStore=l,this.nylasSchedulerConfigStore=h}init(){s.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get mailboxStore(){return this.nylasMailboxStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new o.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new o.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new o.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new o.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new S.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset(),this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const m=":host{display:contents}",A=m,C=class{constructor(e){s.registerInstance(this,e),this.init=s.createEvent(this,"init",7),this.loggedIn=s.createEvent(this,"loggedIn",7),this.loggedOut=s.createEvent(this,"loggedOut",7),this.handleAuthChange=async t=>{t?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.automaticComponentRegistration=!0}connectedCallback(){s.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var h,a,c,u,d,y;s.debug("[nylas-provider] componentWillLoad"),this.stores={auth:o.CreateNylasAuthStore(),mailbox:o.CreateNylasMailboxStore(),scheduler:S.CreateNylasSchedulerStore(),schedulerConfig:b.CreateNylasSchedulerConfigStore()},this.baseProvider=new g.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=new o.HashRouter;this.nylasAuth=g.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(h=this.baseProvider)==null?void 0:h.getStore("mailbox");if(!t)throw new Error("The mailbox store is not set");const r=(a=this.baseProvider)==null?void 0:a.getStore("auth");if(!r)throw new Error("The auth store is not set");const n=(c=this.baseProvider)==null?void 0:c.getStore("scheduler");if(!n)throw new Error("The scheduler store is not set");const i=(u=this.baseProvider)==null?void 0:u.getStore("schedulerConfig");if(!i)throw new Error("The scheduler config store is not set");this.nylasConnector=new f(e,this.nylasAuth,r,t,n,i),this.init.emit(this.host).defaultPrevented||await((d=this.nylasConnector)==null?void 0:d.auth.validateSession()),this.handleAuthChange(r.state.isAuthenticated),(y=this.baseProvider)==null||y.componentWillLoad(this.nylasConnector)}componentDidLoad(){var t,r;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");e==null||e.onChange("isAuthenticated",this.handleAuthChange),(r=this.baseProvider)==null||r.componentDidLoad()}componentDisconnected(){var e;(e=this.baseProvider)==null||e.componentDisconnected()}async registerComponentHandler(e){var t;(t=this.baseProvider)==null||t.registerComponent(e.detail)}async unregisterComponentHandler(e){var t;(t=this.baseProvider)==null||t.unregisterComponent(e.detail)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getMailboxStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("mailbox")}async getAuthStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("auth")}async getNylasSchedulerStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("scheduler")}async getNylasSchedulerConfigStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("schedulerConfig")}render(){return s.h(s.Host,{key:"782d47608825fb870d87153c8d43d778dc6c2b87"},s.h("slot",{key:"2b01537d9d4a0cf4c81ad0b77ce3e6d761f3e1db"}))}get host(){return s.getElement(this)}};C.style=A;exports.nylas_provider=C;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var I=Object.defineProperty;var P=(r,t,n)=>t in r?I(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var S=(r,t,n)=>(P(r,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const index=require("./index-3a004ec1.cjs"),index_es9190f785=require("./index.es-9190f785-60475c4c.cjs"),schedulerConfigStoreEc3b6190=require("./scheduler-config-store-ec3b6190-2710b76a.cjs"),index92989ac4=require("./index-92989ac4-6f32ff2a.cjs");require("react");require("react-dom");require("./global-37eeb0cd-6c5934cf.cjs");class NylasSchedulerConfigAPIConnector{constructor({nylasApiRequest:t,nylasSchedulerConfigStore:n}){this.nylasApiRequest=t,this.nylasSchedulerConfigStore=n}async currentUser(){return this.nylasApiRequest?this.nylasApiRequest.currentUser():(console.warn("Nylas API Request is not initialized"),null)}async getCalendars(){var s;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching calendars: Nylas API Request is not initialized"});const[t,n]=await this.nylasApiRequest.request({method:"GET",path:"calendars"});return n?index.dataResponse(null,{message:"Error fetching calendars: "+n.message}):index_es9190f785.Xr(t)?index.dataResponse(null,{message:"Error fetching calendars: "+((s=t.error)==null?void 0:s.message)}):(this.nylasSchedulerConfigStore.state.calendars=t.data,index.dataResponse(t.data))}async getConfigurationById(t,n=!1){var a;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching configuration: Nylas API Request is not initialized"});if(!n){const l=this.nylasSchedulerConfigStore.state.configurations.find(d=>d.id===t);if(l)return this.nylasSchedulerConfigStore.state.selectedConfiguration=l,index.dataResponse(l)}const[s,c]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${t}`});return c?index.dataResponse(null,{message:"Error fetching configuration: "+c.message}):index_es9190f785.Xr(s)?index.dataResponse(null,{message:"Error fetching configuration: "+((a=s.error)==null?void 0:a.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=s.data,this.nylasSchedulerConfigStore.state.configurations.find(l=>l.id===t)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(l=>l.id===t?s.data:l):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,s.data],index.dataResponse(s.data))}async getConfigurations(){var s;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error fetching configurations: Nylas API Request is not initialized"});const[t,n]=await this.nylasApiRequest.request({method:"GET",path:"scheduling/configurations"});return n?index.dataResponse(null,{message:"Error fetching configurations: "+n.message}):index_es9190f785.Xr(t)?index.dataResponse(null,{message:"Error fetching configurations: "+((s=t.error)==null?void 0:s.message)}):(this.nylasSchedulerConfigStore.state.configurations=t.data,index.dataResponse(t.data))}async createConfiguration(t){var c;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error creating configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"POST",path:"scheduling/configurations",body:t});return s?index.dataResponse(null,{message:"Error creating configuration: "+s.message}):index_es9190f785.Xr(n)?index.dataResponse(null,{message:"Error creating configuration: "+((c=n.error)==null?void 0:c.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],index.dataResponse(n.data))}async updateConfiguration(t){var c;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error updating configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"PUT",path:`scheduling/configurations/${t.id}`,body:t});return s?index.dataResponse(null,{message:"Error updating configuration: "+s.message}):index_es9190f785.Xr(n)?index.dataResponse(null,{message:"Error updating configuration: "+((c=n.error)==null?void 0:c.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations.find(a=>a.id===t.id)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(a=>a.id===t.id?n.data:a):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],index.dataResponse(n.data))}async deleteConfiguration(t){var c,a;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),index.dataResponse(null,{message:"Error deleting configuration: Nylas API Request is not initialized"});const[n,s]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${t}`});return s?index.dataResponse(null,{message:"Error deleting configuration: "+s.message}):index_es9190f785.Xr(n)?index.dataResponse(null,{message:"Error deleting configuration: "+((c=n.error)==null?void 0:c.message)}):(this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.filter(l=>l.id!==t),((a=this.nylasSchedulerConfigStore.state.selectedConfiguration)==null?void 0:a.id)===t&&this.nylasSchedulerConfigStore.resetSelectedConfiguration(),index.dataResponse(n.data))}}class NylasSchedulerConfigConnector{constructor({nylasApiRequest:t,nylasSchedulerConfigStore:n}){this.nylasApiRequest=t,this.nylasSchedulerConfigStore=n}init(){index.debug("NylasSchedulerConfigConnector init")}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new NylasSchedulerConfigAPIConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}resetStores(){index.debug("NylasSchedulerConfigConnector resetStores"),this.nylasSchedulerConfigStore.reset()}async logout(){index.debug("NylasSchedulerConfigConnector logout"),this.resetStores()}}class LocalStorage{get(t){return new Promise(n=>{const s=window.localStorage.getItem(t);n(s?JSON.parse(s):null)})}async remove(t){return window.localStorage.removeItem(t),new Promise(n=>{n(null)})}set(t,n){return window.localStorage.setItem(t,JSON.stringify(n)),new Promise(s=>{s(null)})}}const PKCE_KEY="pkce",GRANT_KEY="grant",USER_KEY="user";class Storage{constructor(t){S(this,"Storage",new LocalStorage);if(t){this.Storage=t;return}}setPKCE(t){const n=index92989ac4.Buffer.from(t);this.Storage.set(PKCE_KEY,n.toString("base64"))}async getPKCE(){try{const t=await this.Storage.get(PKCE_KEY);if(t)return index92989ac4.Buffer.from(t,"base64").toString("utf8")}catch{return null}return null}removePKCE(){this.Storage.remove(PKCE_KEY)}setGrant(t,n=!1){const{grant_id:s}=t;this.Storage.set(`${GRANT_KEY}${n?"-"+s:""}`,t)}removeGrant(t,n=!1){this.Storage.remove(`${GRANT_KEY}${n?"-"+t:""}`)}async getGrant(t,n=!1){const s=await this.Storage.get(`${GRANT_KEY}${n?"-"+t:""}`);return s||null}async setUserToken(t){const n=await this.getUserTokens();if(n)if(n.find(c=>c.sub===t.sub)){const c=n.map(a=>(a.sub===t.sub&&(a=t),a));this.Storage.set(USER_KEY,c)}else{const c=[...n,t];this.Storage.set(USER_KEY,c)}else this.Storage.set(USER_KEY,[t])}async getUserToken(t=""){const n=await this.Storage.get(USER_KEY);return n?t===""?n[0]:n.find(c=>c.sub===t):null}async getUserTokens(){const t=await this.Storage.get(USER_KEY);return t||null}removeUserTokens(){this.Storage.remove(USER_KEY)}async removeUserToken(t){const n=await this.getUserTokens(),s=n==null?void 0:n.filter(c=>c.sub!==t);this.Storage.set(USER_KEY,s)}async clearSession(){const t=await this.getUserTokens();t==null||t.forEach(n=>{this.removeGrant(n.sub)}),this.removePKCE(),this.removeUserTokens()}}class IndexedDBStorage{constructor(){S(this,"databaseName","identity-db");S(this,"storeName","identity")}get(t){const n=this;return new Promise((s,c)=>{n.openDatabase().then(function(a){const l=a.transaction(n.storeName,"readwrite"),h=l.objectStore(n.storeName).get(t);h.onsuccess=()=>{s(h.result)},h.onerror=()=>{c(h.error)},l.oncomplete=()=>{a.close()}})})}async remove(t){const n=this;return new Promise((s,c)=>{const a=indexedDB.open(this.databaseName);a.onupgradeneeded=function(l){l.target.result.createObjectStore(n.storeName)},a.onerror=()=>{c(a.error)},a.onsuccess=l=>{const d=l.target.result,h=d.transaction(this.storeName,"readwrite"),f=h.objectStore(this.storeName).delete(t);f.onsuccess=()=>{s(null)},f.onerror=()=>{c(f.error)},h.oncomplete=()=>{d.close()}}})}set(t,n){return new Promise((s,c)=>{const a=indexedDB.open(this.databaseName);a.onerror=()=>{c(a.error)},a.onupgradeneeded=l=>{l.target.result.createObjectStore(this.storeName)},a.onsuccess=l=>{const d=l.target.result,h=d.transaction(this.storeName,"readwrite"),f=h.objectStore(this.storeName).put(n,t);f.onsuccess=()=>{s(n)},f.onerror=()=>{c(f.error)},h.oncomplete=()=>{d.close()}}})}openDatabase(){const t=this;return new Promise(function(n,s){const c=indexedDB.open(t.databaseName,2);c.onupgradeneeded=function(a){a.target.result.createObjectStore(t.storeName)},c.onsuccess=function(a){n(a.target.result)},c.onerror=function(a){s(a.error)}})}}var sha256={exports:{}};(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof index92989ac4.process=="object"&&index92989ac4.process.versions&&index92989ac4.process.versions.node;NODE_JS?root=index.commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,t){return function(n){return new Sha256(t,!0).update(n)[r]()}},createMethod=function(r){var t=createOutputMethod("hex",r);NODE_JS&&(t=nodeWrap(t,r)),t.create=function(){return new Sha256(r)},t.update=function(c){return t.create().update(c)};for(var n=0;n<OUTPUT_TYPES.length;++n){var s=OUTPUT_TYPES[n];t[s]=createOutputMethod(s,r)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,t){return function(n,s){return new HmacSha256(n,t,!0).update(s)[r]()}},createHmacMethod=function(r){var t=createHmacOutputMethod("hex",r);t.create=function(c){return new HmacSha256(c,r)},t.update=function(c,a){return t.create(c).update(a)};for(var n=0;n<OUTPUT_TYPES.length;++n){var s=OUTPUT_TYPES[n];t[s]=createHmacOutputMethod(s,r)}return t};function Sha256(r,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=r}Sha256.prototype.update=function(r){if(!this.finalized){var t,n=typeof r;if(n!=="string"){if(n==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var s,c=0,a,l=r.length,d=this.blocks;c<l;){if(this.hashed&&(this.hashed=!1,d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),t)for(a=this.start;c<l&&a<64;++c)d[a>>2]|=r[c]<<SHIFT[a++&3];else for(a=this.start;c<l&&a<64;++c)s=r.charCodeAt(c),s<128?d[a>>2]|=s<<SHIFT[a++&3]:s<2048?(d[a>>2]|=(192|s>>6)<<SHIFT[a++&3],d[a>>2]|=(128|s&63)<<SHIFT[a++&3]):s<55296||s>=57344?(d[a>>2]|=(224|s>>12)<<SHIFT[a++&3],d[a>>2]|=(128|s>>6&63)<<SHIFT[a++&3],d[a>>2]|=(128|s&63)<<SHIFT[a++&3]):(s=65536+((s&1023)<<10|r.charCodeAt(++c)&1023),d[a>>2]|=(240|s>>18)<<SHIFT[a++&3],d[a>>2]|=(128|s>>12&63)<<SHIFT[a++&3],d[a>>2]|=(128|s>>6&63)<<SHIFT[a++&3],d[a>>2]|=(128|s&63)<<SHIFT[a++&3]);this.lastByteIndex=a,this.bytes+=a-this.start,a>=64?(this.block=d[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,t=this.lastByteIndex;r[16]=this.block,r[t>>2]|=EXTRA[t&3],this.block=r[16],t>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,t=this.h1,n=this.h2,s=this.h3,c=this.h4,a=this.h5,l=this.h6,d=this.h7,h=this.blocks,u,f,p,y,g,x,w,m,v,R,_;for(u=16;u<64;++u)g=h[u-15],f=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,g=h[u-2],p=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,h[u]=h[u-16]+f+h[u-7]+p<<0;for(_=t&n,u=0;u<64;u+=4)this.first?(this.is224?(m=300032,g=h[0]-1413257819,d=g-150054599<<0,s=g+24177077<<0):(m=704751109,g=h[0]-210244248,d=g-1521486534<<0,s=g+143694565<<0),this.first=!1):(f=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),p=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),m=r&t,y=m^r&n^_,w=c&a^~c&l,g=d+p+w+K[u]+h[u],x=f+y,d=s+g<<0,s=g+x<<0),f=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),p=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),v=s&r,y=v^s&t^m,w=d&c^~d&a,g=l+p+w+K[u+1]+h[u+1],x=f+y,l=n+g<<0,n=g+x<<0,f=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),p=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),R=n&s,y=R^n&r^v,w=l&d^~l&c,g=a+p+w+K[u+2]+h[u+2],x=f+y,a=t+g<<0,t=g+x<<0,f=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),p=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),_=t&n,y=_^t&s^R,w=a&l^~a&d,g=c+p+w+K[u+3]+h[u+3],x=f+y,c=r+g<<0,r=g+x<<0;this.h0=this.h0+r<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+s<<0,this.h4=this.h4+c<<0,this.h5=this.h5+a<<0,this.h6=this.h6+l<<0,this.h7=this.h7+d<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,t=this.h1,n=this.h2,s=this.h3,c=this.h4,a=this.h5,l=this.h6,d=this.h7,h=HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15];return this.is224||(h+=HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]),h},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,t=this.h1,n=this.h2,s=this.h3,c=this.h4,a=this.h5,l=this.h6,d=this.h7,h=[r>>24&255,r>>16&255,r>>8&255,r&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,s>>24&255,s>>16&255,s>>8&255,s&255,c>>24&255,c>>16&255,c>>8&255,c&255,a>>24&255,a>>16&255,a>>8&255,a&255,l>>24&255,l>>16&255,l>>8&255,l&255];return this.is224||h.push(d>>24&255,d>>16&255,d>>8&255,d&255),h},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),t=new DataView(r);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),r};function HmacSha256(r,t,n){var s,c=typeof r;if(c==="string"){var a=[],l=r.length,d=0,h;for(s=0;s<l;++s)h=r.charCodeAt(s),h<128?a[d++]=h:h<2048?(a[d++]=192|h>>6,a[d++]=128|h&63):h<55296||h>=57344?(a[d++]=224|h>>12,a[d++]=128|h>>6&63,a[d++]=128|h&63):(h=65536+((h&1023)<<10|r.charCodeAt(++s)&1023),a[d++]=240|h>>18,a[d++]=128|h>>12&63,a[d++]=128|h>>6&63,a[d++]=128|h&63);r=a}else if(c==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(t,!0).update(r).array());var u=[],f=[];for(s=0;s<64;++s){var p=r[s]||0;u[s]=92^p,f[s]=54^p}Sha256.call(this,t,n),this.update(f),this.oKeyPad=u,this.inner=!0,this.sharedMemory=n}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256);var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(r){return typeof r=="string"&®EX.test(r)}var byteToHex=[];for(var i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));function stringify(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(byteToHex[r[t+0]]+byteToHex[r[t+1]]+byteToHex[r[t+2]]+byteToHex[r[t+3]]+"-"+byteToHex[r[t+4]]+byteToHex[r[t+5]]+"-"+byteToHex[r[t+6]]+byteToHex[r[t+7]]+"-"+byteToHex[r[t+8]]+byteToHex[r[t+9]]+"-"+byteToHex[r[t+10]]+byteToHex[r[t+11]]+byteToHex[r[t+12]]+byteToHex[r[t+13]]+byteToHex[r[t+14]]+byteToHex[r[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(r,t,n){r=r||{};var s=r.random||(r.rng||rng)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){n=n||0;for(var c=0;c<16;++c)t[n+c]=s[c];return t}return stringify(s)}async function getBytes(r,t){const n=r.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}function getLines(r){let t,n,s,c=!1;return function(l){t===void 0?(t=l,n=0,s=-1):t=concat(t,l);const d=t.length;let h=0;for(;n<d;){c&&(t[n]===10&&(h=++n),c=!1);let u=-1;for(;n<d&&u===-1;++n)switch(t[n]){case 58:s===-1&&(s=n-h);break;case 13:c=!0;case 10:u=n;break}if(u===-1)break;r(t.subarray(h,u),s),h=n,s=-1}h===d?t=void 0:h!==0&&(t=t.subarray(h),n-=h)}}function getMessages(r,t,n){let s=newMessage();const c=new TextDecoder;return function(l,d){if(l.length===0)n==null||n(s),s=newMessage();else if(d>0){const h=c.decode(l.subarray(0,d)),u=d+(l[d+1]===32?2:1),f=c.decode(l.subarray(u));switch(h){case"data":s.data=s.data?s.data+`
|
|
2
|
-
`+f:f;break;case"event":s.event=f;break;case"id":r(s.id=f);break;case"retry":const p=parseInt(f,10);isNaN(p)||t(s.retry=p);break}}}}function concat(r,t){const n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function newMessage(){return{data:"",event:"",id:"",retry:void 0}}var __rest=function(r,t){var n={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&t.indexOf(s)<0&&(n[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(r);c<s.length;c++)t.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(r,s[c])&&(n[s[c]]=r[s[c]]);return n};const EventStreamContentType="text/event-stream",DefaultRetryInterval=1e3,LastEventId="last-event-id";function fetchEventSource(r,t){var{signal:n,headers:s,onopen:c,onmessage:a,onclose:l,onerror:d,openWhenHidden:h,fetch:u}=t,f=__rest(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,y)=>{const g=Object.assign({},s);g.accept||(g.accept=EventStreamContentType);let x;function w(){x.abort(),document.hidden||T()}h||document.addEventListener("visibilitychange",w);let m=DefaultRetryInterval,v=0;function R(){document.removeEventListener("visibilitychange",w),window.clearTimeout(v),x.abort()}n==null||n.addEventListener("abort",()=>{R(),p()});const _=u??window.fetch,U=c??defaultOnOpen;async function T(){var k;x=new AbortController;try{const A=await _(r,Object.assign(Object.assign({},f),{headers:g,signal:x.signal}));await U(A),await getBytes(A.body,getLines(getMessages(b=>{b?g[LastEventId]=b:delete g[LastEventId]},b=>{m=b},a))),l==null||l(),R(),p()}catch(A){if(!x.signal.aborted)try{const b=(k=d==null?void 0:d(A))!==null&&k!==void 0?k:m;window.clearTimeout(v),v=window.setTimeout(T,b)}catch(b){R(),y(b)}}}T()})}function defaultOnOpen(r){const t=r.headers.get("content-type");if(!(t!=null&&t.startsWith(EventStreamContentType)))throw new Error(`Expected content-type to be ${EventStreamContentType}, Actual: ${t}`)}function Base64EncodeUrl(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function getTimestamp(){return Math.floor(Date.now()/1e3)}function e(r){this.message=r}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r$1=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,s,c=0,a=0,l="";s=t.charAt(a++);~s&&(n=c%4?64*n+s:s,c++%4)?l+=String.fromCharCode(255&n>>(-2*c&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return l};function t$1(r){var t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(r$1(n).replace(/(.)/g,function(s,c){var a=c.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a}))}(t)}catch{return r$1(t)}}function n$1(r){this.message=r}function o(r,t){if(typeof r!="string")throw new n$1("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(t$1(r.split(".")[n]))}catch(s){throw new n$1("Invalid token specified: "+s.message)}}n$1.prototype=new Error,n$1.prototype.name="InvalidTokenError";class NylasSessions{constructor(t){S(this,"clientId");S(this,"redirectUri");S(this,"accessType","online");S(this,"domain","http://api.nylas.com");S(this,"versioned",!1);S(this,"Storage");S(this,"hosted",!1);S(this,"multiAccount",!1);S(this,"loginId","");if(this.clientId=t.clientId,this.redirectUri=t.redirectUri,t.domain&&(this.domain=t.domain,this.domain.substring(this.domain.length-3).includes("/v")&&(this.versioned=!0)),t.multiAccount&&(this.multiAccount=t.multiAccount),t.sw){const n=new IndexedDBStorage;this.Storage=new Storage(n)}else this.Storage=new Storage;t.accessType&&(this.accessType=t.accessType),t.loginId&&(this.loginId=t.loginId),t.hosted&&(this.hosted=t.hosted),this.codeExchange(null)}async validateAccessToken(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const{access_token:s}=n;try{return!!(await(await fetch(`${this.domain}/connect/tokeninfo?access_token=${s}`,{method:"GET"})).json()).data}catch{return!1}}async validateIDToken(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const{id_token:s}=n;try{const c=await fetch(`${this.domain}/connect/tokeninfo?id_token=${s}`,{method:"GET"});return!(c.status!==200||!(await c.json()).data)}catch{return!1}}getDomain(){return this.domain}async auth(t){this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))&&await this.hostedSetCodeChallenge();const n=await this.generateAuthURL(t);if(t.popup){this.popUp(n);return}return n}async generateAuthURL(t){const n=await this.getCodeChallege();let s=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return n&&(s+=`&code_challenge=${n}&code_challenge_method=S256&options=rotate_refresh_token`),t.provider&&(s+=`&provider=${t.provider}`),t.loginHint&&(s+=`&login_hint=${t.loginHint}`,t.includeGrantScopes&&(s+=`&include_grant_scopes=${t.includeGrantScopes}`)),t.scope&&(s+=`&scope=${t.scope.join(" ")}`),t.prompt&&(s+=`&prompt=${t.prompt}`),t.metadata&&(s+=`&metadata=${t.metadata}`),(t.state||this.loginId)&&(s+=`&state=${this.loginId?this.loginId:t.state}`),s}async generateReauthURL(t,n){if(!t)throw new Error("Grant ID is required");const s=await this.Storage.getUserToken(t),c=await this.getCodeChallege();let a=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return c&&(a+=`&code_challenge=${c}&code_challenge_method=S256&options=rotate_refresh_token`),s!=null&&s.provider&&(a+=`&provider=${s.provider}`),s!=null&&s.email&&(a+=`&login_hint=${s.email}`),n&&(a+=`&scope=${n.join(" ")}`),a}async generateCodeChallenge(){if(await this.Storage.getPKCE())return;const n=v4();this.Storage.setPKCE(n)}async hostedSetCodeChallenge(){if(!this.hosted)throw console.error("Method only used with hosted flag enabled");const n=new URLSearchParams(window.location.search).get("code_challenge");if(!n){if(await this.Storage.getPKCE())return;console.warn("Code challenge is recomended");return}this.Storage.setPKCE(n)}async getCodeChallege(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))){const s=new URLSearchParams(window.location.search).get("code_challenge");return s||(console.warn("Code challenge is recomended"),"")}const t=await this.Storage.getPKCE();if(t){const n=sha256.exports.sha256(t);let s=index92989ac4.Buffer.from(n).toString("base64");return s=Base64EncodeUrl(s),s}return""}async isLoggedIn(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin)))return!1;const t=await this.Storage.getUserTokens();return t&&t.length>0?(this.multiAccount&&await this.generateCodeChallenge(),!0):(await this.generateCodeChallenge(),!1)}isMultiAccount(){return this.multiAccount}async logout(){const t=await this.getProfile();await this.Storage.clearSession();const n={detail:t};window.dispatchEvent(new CustomEvent("onLogoutSuccess",n))}async getProfile(t=""){let n;return t?n=await this.Storage.getUserToken(t):n=await this.Storage.getUserToken(),n||null}async getProfiles(){const t=await this.Storage.getUserTokens();return t||null}async removeProfile(t){return await this.Storage.removeUserToken(t),await this.Storage.removeGrant(t),null}async authIMAP(t){const n=await this.getCodeChallege(),s={imap_username:t.username,imap_password:t.password,imap_host:t.hostIMAP,imap_port:t.portIMAP,type:t.type,smtp_host:t.hostSMTP,smtp_port:t.portSMTP,provider:t.provider,redirect_uri:this.redirectUri,state:t.state,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(s.id=this.loginId),n!=""&&(s.code_challenge=n,s.code_challenge_method="S256"),await(await fetch(`${this.domain}/connect/login/imap`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(s)})).json()}async authEWS(t){const n=await this.getCodeChallege(),s={...t,redirect_uri:this.redirectUri,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(s.id=this.loginId),n!=""&&(s.code_challenge=n,s.code_challenge_method="S256"),await(await fetch(`${this.domain}/connect/login/ews`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(s)})).json()}async detectEmail(t){return(await(await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/providers/detect?client_id=${this.clientId}&email=${t}`,{method:"POST",headers:new Headers({"content-type":"application/json"})})).json()).data}async applicationInfo(){return(await(await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/applications?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})})).json()).data}async getAvailableProviders(){const t=await fetch(`${this.domain}/connect/providers/find?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});return t?(await t.json()).data:null}onLoginSuccess(t){window.addEventListener("onLoginSuccess",n=>t(n))}onLogoutSuccess(t){window.addEventListener("onLogoutSuccess",n=>t(n))}onLoginFail(t){window.addEventListener("onLoginFail",n=>t(n))}onTokenRefreshSuccess(t){window.addEventListener("onTokenRefreshSuccess",n=>t(n))}onTokenRefreshFail(t){window.addEventListener("onTokenRefreshFail",n=>t(n))}onSessionExpired(t){window.addEventListener("onSessionExpired",n=>t(n))}async codeExchange(t){let n=new URLSearchParams(window.location.search);t&&(n=new URLSearchParams(t));const s=n.get("code"),c=n.get("state"),a=n.get("error"),l=n.get("error_description"),d=n.get("error_code");if(a&&l&&d){const u={detail:{error:a,error_description:l,error_code:d}};return window.dispatchEvent(new CustomEvent("onLoginFail",u)),window.history.pushState({},document.title,window.location.pathname),!1}if(!s)return console.warn("No code found"),!1;if(window.opener&&window.name==="uas-popup")return console.warn("Popup window detected"),!1;const h=await this.Storage.getPKCE();if(!h)return console.warn("No code verifier found"),!1;try{const u={client_id:this.clientId,redirect_uri:this.redirectUri,code:s,grant_type:"authorization_code",code_verifier:h},p=await(await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(u)})).json();if(p){if(p.error){const g={detail:p};return window.dispatchEvent(new CustomEvent("onLoginFail",g)),!0}const y=await this.handleCodeExchangeResponse(p);if(y.valid){c&&(y.data.state=c);const g={detail:y.data};window.dispatchEvent(new CustomEvent("onLoginSuccess",g)),window.history.pushState({},document.title,window.location.pathname)}else{const g={detail:y.data};return window.dispatchEvent(new CustomEvent("onLoginFail",g)),!0}}return this.Storage.removePKCE(),!0}catch(u){const f={detail:u};return window.dispatchEvent(new CustomEvent("onLoginFail",f)),window.history.pushState({},document.title,window.location.pathname),!1}}async tokenExchange(t=""){const n=await this.Storage.getGrant(t,this.multiAccount);if(!n)return!1;const s=n.refresh_token;try{const c={client_id:this.clientId,redirect_uri:this.redirectUri,refresh_token:s,grant_type:"refresh_token"},l=await(await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(c)})).json();if(l){if(l.error){const f={detail:l};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",f)),!0}const d=getTimestamp();if(l.expires_in=d+l.expires_in,this.Storage.setGrant(l,this.multiAccount),!await this.validateIDToken(t)){const f={detail:l};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",f)),!0}const u={detail:l};return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess",u)),!0}this.Storage.removePKCE()}catch(c){const a={detail:c};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",a)),!1}}async handleCodeExchangeResponse(t){if(t.error)return{data:t,valid:!1};const s=getTimestamp();t.expires_in=s+t.expires_in,this.Storage.setGrant(t,this.multiAccount);const c=o(t.id_token);return c.status="authenticated",this.Storage.setUserToken(c),await this.validateIDToken(c.sub)?{data:t,valid:!0}:{data:t,valid:!1}}async popUp(t){const c=window.screenX+(window.outerWidth-500)/2,a=window.screenY+(window.outerHeight-600)/2.5,l="uas-popup",d=t,h=window.open(d,l,`width=500,height=600,left=${c},top=${a}`);if(!h)return;const u=setInterval(async()=>{if(h.closed){const f={detail:{error_description:"OAuth provider window closed"}};window.dispatchEvent(new CustomEvent("onLoginFail",f)),u&&clearInterval(u);return}try{const f=h.location.href.split("?");if(!f[0])return;const p=h.location.search;if(h.history.pushState({},document.title,window.location.pathname),f[0]===this.redirectUri&&f.length>1){const y=await this.codeExchange(p);h.close(),y&&location.reload(),u&&clearInterval(u);return}}catch{return}},1e3)}async getAccessToken(t=""){const n=getTimestamp(),s=await this.Storage.getGrant(t,this.multiAccount);if(!s)return null;const{access_token:c,expires_in:a}=s,l=c;return l&&a&&a>getTimestamp()&&a-n>30?l:(await this.tokenExchange(t),(await this.Storage.getGrant(t,this.multiAccount)).access_token)}async sse(t,n){const s=n.headers||{},c=s["Grant-ID"];let a="";if(this.multiAccount){if(!c)throw new Error("Grant ID is required for multi account calls");a=await this.getAccessToken(c)}else a=await this.getAccessToken();return delete s["Grant-ID"],s.Authorization=`Bearer ${a}`,s["content-type"]||(s["content-type"]="application/json"),fetchEventSource(`${this.domain}/${t}`,{...n,headers:s})}async fetch(t,n,s=!0,c){let a="",l=1;if(this.multiAccount){if(!n.grant_id)throw new Error("Grant ID is required for multi account calls");const h=await this.getProfiles();l=h?h.length:1,a=await this.getAccessToken(n.grant_id)}else a=await this.getAccessToken();if(!a)throw new Error("Access token not found");let d=n.headers;Headers.prototype.isPrototypeOf(d)?(d.append("Authorization",`Bearer ${a}`),d.has("content-type")||d.append("content-type","application/json")):d=new Headers({Authorization:`Bearer ${a}`,"content-type":"application/json"});try{n!=null&&n.body&&(n.body=JSON.stringify(n==null?void 0:n.body));const h=await fetch(`${c||this.domain}/${t}`,{...n,headers:d});if(!s)return h;const u=await(h==null?void 0:h.json());if(!await this.isAuthenticatedResponse(h.status,u)){if(l>1){const p=await this.getProfile(n.grant_id);if(p){p.status="unauthorized",await this.Storage.setUserToken(p);const y={detail:{user:p}};window.dispatchEvent(new CustomEvent("onSessionExpired",y))}}else{const y={detail:{user:await this.Storage.getUserToken()}};window.dispatchEvent(new CustomEvent("onSessionExpired",y))}this.logout();return}return u}catch(h){throw h}}async fetchRequest(t,n,s,c=!0,a,l){const d=await this.isLoggedIn(),h=new URL(t,a??this.domain),u=new Headers;if(u.append("Accept","application/json"),u.append("Content-Type","application/json"),u.append("User-Agent","nylas-identity"),d){const y=await this.getAccessToken();u.append("Authorization",`Bearer ${y}`)}const f=await fetch(h.toString(),{method:n||"GET",headers:u,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0,...l||{}});return c?await f.json():f.body}async isAuthenticatedResponse(t,n){var s;return!(t==401&&((s=n==null?void 0:n.error)==null?void 0:s.type)=="token.unauthorized_access")}addAPIKey(t,n,s){this.Storage.setUserToken({aud:"https://api-staging.us.nylas.com/",exp:2e9,email_verified:!0,iat:getTimestamp(),iss:"",email:n,provider:"virtual-calendar",status:"authenticated",name:n,sub:t}),this.Storage.setGrant({grant_id:t,access_token:s,expires_in:2e9},this.multiAccount)}}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(r,t,n){this.props=r,this.context=t,this.refs=D,this.updater=n||B}E.prototype.isReactComponent={};E.prototype.setState=function(r,t){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,t,"setState")};E.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(r,t,n){this.props=r,this.context=t,this.refs=D,this.updater=n||B}var H=G.prototype=new F;H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;const LoginRequired=({authenticationUrl:r})=>index.h("div",{class:"login-required"},index.h("div",{class:"card"},index.h("p",null,"Log into your account to use the Scheduler Editor."),index.h("button",{class:"google-button",onClick:async t=>{t.preventDefault();const n=await r("google");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},index.h("span",{class:"icon"},index.h("google-logo-icon",{width:"15",height:"15"})),"Continue with Google"),index.h("button",{class:"microsoft-button",onClick:async t=>{t.preventDefault();const n=await r("microsoft");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},index.h("span",{class:"icon"},index.h("microsoft-logo-icon",{width:"15",height:"15"})),"Continue with Microsoft"),index.h("button",{class:"other-provider-button",onClick:async t=>{t.preventDefault();const n=await r();n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},"View all providers ",index.h("chevron-icon",{width:"17",height:"17"})),index.h("small",{class:"disclaimer-text"},"* You will be redirected to authenticate your account."))),nylasSchedulerEditorCss=':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 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px 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}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}div.scheduler-editor-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900)}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;width:858px;margin:0;font-size:18px;line-height:24px;font-weight:600}@media screen and (max-width: 768px){div.scheduler-editor-header h1.scheduler-editor-title{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary)}div.scheduler-editor-header button:disabled{cursor:not-allowed}nylas-editor-tabs{width:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:554px;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:554px;background:var(--nylas-base-25)}@media screen and (max-width: 768px){.list-configurations{height:auto}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}',NylasSchedulerEditorStyle0=nylasSchedulerEditorCss,NylasSchedulerEditor=class{constructor(r){index.registerInstance(this,r),this.init=index.createEvent(this,"init",7),this.loggedIn=index.createEvent(this,"loggedIn",7),this.loggedOut=index.createEvent(this,"loggedOut",7),this.schedulerConfigCloseClicked=index.createEvent(this,"schedulerConfigCloseClicked",7),this.handleSchedulerConfigCloseClicked=t=>{this.schedulerConfigCloseClicked.emit(this.host)},this.authenticationUrl=async t=>this.nylasApiRequest?await this.nylasApiRequest.authenticationUrl({provider:t})||"":(console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."),""),this.configurationId=void 0,this.nylasApiRequest=void 0,this.nylasSessionsConfig=void 0,this.defaultAuthArgs=void 0,this.eventOverrides={},this.schedulerPreviewLink="",this.defaultSchedulerConfigState=void 0,this.mode="app",this.automaticComponentRegistration=!0}connectedCallback(){index.debug("[nylas-scheduler-editor] connectedCallback")}async componentWillLoad(){var n,s,c,a,l,d,h;if(index.debug("[nylas-scheduler-editor] componentWillLoad"),this.stores={schedulerConfig:schedulerConfigStoreEc3b6190.CreateNylasSchedulerConfigStore({...this.defaultSchedulerConfigState})},!this.nylasApiRequest&&this.nylasSessionsConfig){const u=new NylasSessions(this.nylasSessionsConfig);await u.isLoggedIn(),u.onLoginSuccess(async()=>{var p,y;const f=await((y=(p=this.nylasSchedulerConfigConnector)==null?void 0:p.schedulerConfig)==null?void 0:y.currentUser());f&&(this.loggedIn.emit(this.host),this.loggedInHandler(f))}),u.onLoginFail(async()=>{var f,p;(p=(f=this.stores)==null?void 0:f.schedulerConfig)==null||p.set("currentUser",null),this.loggedOut.emit(this.host)}),this.nylasApiRequest=new index.NylasIdentityRequestWrapper(u)}this.nylasApiRequest&&this.defaultAuthArgs&&this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs),this.baseProvider=new index_es9190f785.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const r=this.baseProvider.getStore("schedulerConfig");if(this.nylasSchedulerConfigConnector=new NylasSchedulerConfigConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:r}),!this.init.emit(this.host).defaultPrevented){const u=await((s=(n=this.nylasSchedulerConfigConnector)==null?void 0:n.schedulerConfig)==null?void 0:s.currentUser());u?(this.loggedIn.emit(this.host),await this.loggedInHandler(u)):((a=(c=this.stores)==null?void 0:c.schedulerConfig)==null||a.set("currentUser",null),this.loggedOut.emit(this.host))}(d=(l=this.stores)==null?void 0:l.schedulerConfig)==null||d.onChange("selectedConfiguration",async u=>{u&&u.id&&(this.configurationId=u.id)}),(h=this.baseProvider)==null||h.componentWillLoad(this.nylasSchedulerConfigConnector)}async componentDidLoad(){var r;index.debug("[nylas-scheduler-editor] componentDidLoad"),(r=this.baseProvider)==null||r.componentDidLoad()}componentDisconnected(){var r;(r=this.baseProvider)==null||r.componentDisconnected()}async configurationIdChanged(r){var t,n,s,c,a,l,d,h;r?(await((n=(t=this.nylasSchedulerConfigConnector)==null?void 0:t.schedulerConfig)==null?void 0:n.getConfigurationById(r)),(c=(s=this.stores)==null?void 0:s.schedulerConfig)==null||c.set("action","edit")):((l=(a=this.stores)==null?void 0:a.schedulerConfig)==null||l.set("selectedConfiguration",{}),(h=(d=this.stores)==null?void 0:d.schedulerConfig)==null||h.set("action",null))}async store(){var r;return(r=this.stores)==null?void 0:r.schedulerConfig}async schedulerConnector(){return this.nylasSchedulerConfigConnector}async registerComponentHandler(r){var t;(t=this.baseProvider)==null||t.registerComponent(r.detail)}async unregisterComponentHandler(r){var t;(t=this.baseProvider)==null||t.unregisterComponent(r.detail)}async loggedInHandler(r){var t,n,s,c;(n=(t=this.stores)==null?void 0:t.schedulerConfig)==null||n.set("currentUser",r),this.nylasSchedulerConfigConnector&&(this.configurationId&&await((s=this.nylasSchedulerConfigConnector.schedulerConfig)==null?void 0:s.getConfigurationById(this.configurationId)),await((c=this.nylasSchedulerConfigConnector.schedulerConfig)==null?void 0:c.getCalendars()))}render(){var r,t,n,s,c,a,l,d;return index.h(index.Host,{key:"3c990c6167ba6e5913c2c0389ca7765f8d036abc"},index.h("div",{key:"c4bded9f12b1d13892b405dd3d0210f1becce497",class:"scheduler-editor-header",part:"nse__header"},index.h("h1",{key:"28d2f14a1d2ee9de3a6afb6b19d38a483ec3e900",class:"scheduler-editor-title",part:"nse__title"},index.h("calendar-icon",{key:"d0ad4ea0bb536139e44193f720ba21d81f536c58",width:"18",height:"18"}),"Scheduler editor"),index.h("button",{key:"3dc7ee50b862662adc1379631cafb5c4bfe05379",class:"scheduler-editor-close",onClick:h=>this.handleSchedulerConfigCloseClicked(h),part:"nse__close-button"},index.h("close-icon",{key:"680cbbe8436d0ba6bf4a64198c7aa8abc21f0938",width:"18",height:"18"}))),((t=(r=this.stores)==null?void 0:r.schedulerConfig)==null?void 0:t.state.currentUser)&&this.stores.schedulerConfig.state.action===null&&index.h("div",{class:"list-configurations"},index.h("nylas-list-configurations",null)),((s=(n=this.stores)==null?void 0:n.schedulerConfig)==null?void 0:s.state.currentUser)&&this.stores.schedulerConfig.state.action==="create"&&index.h("nylas-editor-tabs",{mode:"composable"},index.h("nylas-event-info",null,index.h("div",{slot:"inputs"},index.h("nylas-event-title",null),index.h("nylas-event-duration",null),index.h("nylas-location-component",null))),index.h("nylas-booking-calendar-picker",null)),((a=(c=this.stores)==null?void 0:c.schedulerConfig)==null?void 0:a.state.currentUser)&&this.stores.schedulerConfig.state.action==="edit"&&index.h("nylas-editor-tabs",{mode:this.mode},this.mode==="composable"&&index.h("slot",null)),!((d=(l=this.stores)==null?void 0:l.schedulerConfig)!=null&&d.state.currentUser)&&index.h("slot",{name:"login-required"},index.h(LoginRequired,{authenticationUrl:this.authenticationUrl})))}get host(){return index.getElement(this)}static get watchers(){return{configurationId:["configurationIdChanged"]}}};NylasSchedulerEditor.style=NylasSchedulerEditorStyle0;exports.nylas_scheduler_editor=NylasSchedulerEditor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-3a004ec1.cjs"),m=require("./index.es-9190f785-60475c4c.cjs"),y=require("./scheduler-store-dabdbc4f-404dc261.cjs");require("react");require("react-dom");require("./global-37eeb0cd-6c5934cf.cjs");class C{constructor({schedulerAPIURL:e,nylasSchedulerStore:a,sessionId:i,configId:s}){if(!e)throw new Error("schedulerAPIURL is required");if(!a)throw new Error("nylasSchedulerStore is required");if(!i&&!s)throw new Error("sessionId is required for private configs, if not config id is required for public configs");e==="/"&&(e=new URL(window.location.href).origin),this.configId=s,this.sessionId=i,this.schedulerAPIURL=e,this.nylasSchedulerStore=a}init(){t.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new y.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const b=(n,e)=>{const a=n.isLoading,i=n.showNotification,s=n.nylasBranding;return t.h(t.Fragment,null,i&&t.h("nylas-notification",null),a&&t.h("div",{class:"loading"},t.h("div",{class:"left"},t.h("div",{class:"skeleton"})),t.h("div",{class:"right"},t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}))),!a&&e,t.h("div",{class:"footer"},s&&t.h(t.Fragment,null,"Powered by ",t.h("nylas-logo",null))))},_=(n,e)=>t.h("div",{class:"message-banner"},e),E=':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 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px 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-top:1rem}.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,.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{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{padding:1rem 20px 0;gap:1rem;height:512px;min-width:384px;border-top-left-radius:inherit;background:var(--nylas-base-0)}@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}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:1px;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:512px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@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:496px}@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}',D=E,x={title:"Something went wrong...",type:m.nr.Error,category:y.ErrorCategory.Component},k=class{constructor(n){t.registerInstance(this,n),this.init=t.createEvent(this,"init",7),this.schedulerWillLoad=t.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=t.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=t.createEvent(this,"nylasSchedulerError",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingId=void 0,this.cancelBookingId=void 0,this.configurationId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.showNotification=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||"No date selected"}connectedCallback(){t.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var a,i;if(t.debug("[nylas-scheduler] Component will load"),this.schedulerWillLoad.emit(this.host).defaultPrevented||!this.checkIfSessionIdOrConfigIdExists())return;this.stores={scheduler:y.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})},this.baseProvider=new m.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=(a=this.baseProvider)==null?void 0:a.getStore("scheduler");if(this.nylasSchedulerConnector=new C({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.configurationId,nylasSchedulerStore:e}),this.init.emit(this.host),(i=this.baseProvider)==null||i.componentWillLoad(this.nylasSchedulerConnector),this.themeConfig)for(const[s,o]of Object.entries(this.themeConfig))this.host.style.setProperty(`${s}`,o)}async componentDidLoad(){var d,l,h,c,g,v,w;if((d=this.baseProvider)==null||d.componentDidLoad(),!this.checkIfSessionIdOrConfigIdExists())return;const n=await((l=this.nylasSchedulerConnector)==null?void 0:l.scheduler.getUISettings());(!n||"error"in n)&&this.nylasSchedulerError.emit({...this.getErrorObject(n==null?void 0:n.error)});const e=(h=this.baseProvider)==null?void 0:h.getStore("scheduler"),a=(g=(c=e==null?void 0:e.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:g.available_days_in_future,i=e==null?void 0:e.get("selectedTimeslot");if(i&&(i!=null&&i.start_time)){if(!this.isTimeslotValid(i))return;if(e!=null&&e.get("showBookingForm")){e==null||e.set("selectedDate",i.start_time);return}}const s=e==null?void 0:e.get("selectedDate"),o=e==null?void 0:e.get("availability");let r;if(!(o&&o.length>0)){if(s){const{startTime:u,endTime:p,endTimeForAvailableDaysInFuture:f}=this.validateAvailableDaysInFuture(s,a||30);s.getTime()<f*1e3&&(r=await((w=this.nylasSchedulerConnector)==null?void 0:w.scheduler.getAvailability(u,p)))}else{const u=new Date,{startTime:p,endTime:f,endTimeForAvailableDaysInFuture:I}=this.validateAvailableDaysInFuture(u,a||30);u.getTime()<I*1e3&&(r=await((v=this.nylasSchedulerConnector)==null?void 0:v.scheduler.getAvailability(p,f)))}if((!r||"error"in r)&&this.nylasSchedulerError.emit({...this.getErrorObject(r==null?void 0:r.error)}),!s){let u=new Date;const p=e==null?void 0:e.get("availability").find(f=>new Date(f.start_time)>new Date);p&&(u=p.start_time),e==null||e.set("selectedDate",u)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var e;(e=this.stores)==null||e.scheduler.set("bookingInfo",n)}async registerComponentHandler(n){var e;(e=this.baseProvider)==null||e.registerComponent(n.detail)}async unregisterComponentHandler(n){var e;(e=this.baseProvider)==null||e.unregisterComponent(n.detail)}async monthChangedHandler(n){var r,d,l,h,c;const e=n.detail,a=(h=(l=(d=(r=this.nylasSchedulerConnector)==null?void 0:r.schedulerStore)==null?void 0:d.get("configSettings"))==null?void 0:l.scheduler)==null?void 0:h.available_days_in_future,{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(e,a||30);if(i<o&&e.getTime()<o*1e3){const g=await((c=this.nylasSchedulerConnector)==null?void 0:c.scheduler.getAvailability(i,s));(!g||"error"in g)&&this.nylasSchedulerError.emit({...this.getErrorObject(g==null?void 0:g.error)})}}async bookButtonClickedHandler(n){var s,o,r,d;const e=(o=(s=this.nylasSchedulerConnector)==null?void 0:s.schedulerStore)==null?void 0:o.get("rescheduleBookingId"),a=this.rescheduleBookingId||e;if(a){const l=await((r=this.nylasSchedulerConnector)==null?void 0:r.scheduler.rescheduleBooking(a,n.detail));(!l||"error"in l)&&this.nylasSchedulerError.emit({...this.getErrorObject(l==null?void 0:l.error)});return}const i=await((d=this.nylasSchedulerConnector)==null?void 0:d.scheduler.bookTimeslot(n.detail));(!i||"error"in i)&&this.nylasSchedulerError.emit({...this.getErrorObject(i==null?void 0:i.error)})}dateSelectedHandler(n){const e=n.detail;this.selectedDateLabel=e?e.toLocaleDateString(void 0,{dateStyle:"full"}):"No date selected"}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({...this.getErrorObject(n.detail.error)})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({...this.getErrorObject(n.detail.error)})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({...this.getErrorObject(n.detail.error)})}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)||x.title,category:(n==null?void 0:n.category)||x.category,type:m.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){return!this.sessionId&&!this.configurationId?(this.nylasSchedulerError.emit({title:"No sessionId!",category:y.ErrorCategory.Component,type:m.nr.Error,description:"Session ID is required",id:new Date().getTime().toString(),ttl:"none"}),!1):!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({title:"Invalid tiemslot!",category:y.ErrorCategory.Component,type:m.nr.Error,description:"The selected timeslot is invalid.",id:new Date().getTime().toString(),ttl:"none"}),!1):!0}validateAvailableDaysInFuture(n,e){const a=new Date,i=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,s=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,o=Math.floor(t.addDaysToCurrentDate(a,e).getTime()/1e3),r=Math.min(o,s);return{startTime:i,endTime:r,endTimeForAvailableDaysInFuture:o}}render(){var h;const n=this.mode==="app",e=(h=this.baseProvider)==null?void 0:h.getStore("scheduler"),a=e==null?void 0:e.get("eventInfo"),i=e==null?void 0:e.get("showBookingForm"),s=e==null?void 0:e.get("cancelledEventInfo"),o=(e==null?void 0:e.get("cancelBookingId"))||this.cancelBookingId,r=e==null?void 0:e.get("selectedTimeslot"),d=(e==null?void 0:e.get("rescheduleBookingId"))||this.rescheduleBookingId,l=(e==null?void 0:e.get("nylasBranding"))||this.nylasBranding;if(n&&o&&!s)return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},t.h("nylas-cancel-booking-form",{cancelBookingId:o,exportparts:"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label"}))));if(n&&s)return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},t.h("nylas-cancelled-event-card",{cancelledEventInfo:s,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(n&&a)return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"booked-event-page",part:"booked-event-page"},t.h("nylas-booked-event-card",{selectedTimeslot:r,eventInfo:a,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))));if(n&&(!a||d)&&!i){const c=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},d&&t.h(_,null,"Choose another time slot to reschedule your meeting"),t.h("div",{class:"select-date-page",part:"select-date-page"},t.h("div",{class:"left-panel"},t.h("nylas-date-picker",{exportparts:"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),t.h("div",{class:"border"}),t.h("nylas-locale-switch",null)),t.h("div",{class:"right-panel"},t.h("h2",null,t.h("calendar-icon",null),t.h("span",{id:"selectedDate"},this.selectedDateLabel)),t.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},c&&t.h("span",{slot:"timeslot-picker-cta-label"},t.h("slot",{name:"timeslot-picker-cta-label"})))))))}if(n&&!a&&i){const c=this.host.querySelector('[slot="custom-booking-form"]');return t.h(t.Host,null,t.h(b,{nylasBranding:l,isLoading:this.isLoading,showNotification:this.showNotification},d&&t.h(_,null,"Choose another time slot to reschedule your meeting"),t.h("div",{class:"additional-data-page",part:"additional-data-page"},t.h("div",{class:"left-panel"},t.h("div",{class:"wrapper"},t.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time"}))),t.h("div",{class:"right-panel"},t.h("nylas-booking-form",{exportparts:"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline"},c&&t.h("div",{slot:"custom-booking-form"},t.h("slot",{name:"custom-booking-form"})))))))}return t.h(t.Host,null,t.h("slot",null))}get host(){return t.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"]}}};k.style=D;exports.nylas_scheduling=k;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-3a004ec1.cjs");require("react");require("react-dom");const o=".sc-play-icon-h{display:flex}",c=o,s=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"01461bf1925b9c4a5b755ee500c5c9d9ea9a4c9c",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"c60c140ea197f53c9f5df04e3a2ef0e8736787c2",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};s.style=c;const n=".sc-stop-icon-h{display:flex}",h=n,i=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"f6149723fe23e788bd2a2b7fb075fb929222cb31",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"4f6c453999391dae9f8271f341c9ffac4458fd79",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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const y=require("./index-3a004ec1.cjs");exports.ErrorCategory=void 0;(function(o){o.Component="component",o.Api="api",o.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var b;(function(o){o.endtime_not_in_future="endtime_not_in_future",o.no_booking_info="no_booking_info",o.no_timeslot_selected="no_timeslot_selected",o.no_timezone_selected="no_timezone_selected",o.no_booking_id="no_booking_id",o.invalid_start_time="invalid_start_time",o.invalid_end_time="invalid_end_time",o.invalid_timezone="invalid_timezone"})(b||(b={}));var P;(function(o){o.invalid_session="invalid_session",o.general_error="general_error",o.internal_error="internal_error",o.invalid_request_error="invalid_request_error",o.timeslot_not_available="timeslot_not_available"})(P||(P={}));class z{constructor(){this.component=e=>{const i=exports.ErrorCategory.Component,s=`${e} error`;return{endtime_not_in_future:(t='"endtime" can not be in the future')=>({title:s,message:t,category:i}),no_booking_info:(t="No booking info provided")=>({title:s,message:t,category:i}),no_timeslot_selected:(t="No timeslot selected")=>({title:s,message:t,category:i}),no_timezone_selected:(t="No timezone selected")=>({title:s,message:t,category:i}),no_booking_id:(t="No booking id provided")=>({title:s,message:t,category:i}),invalid_start_time:(t="Invalid start time")=>({title:s,message:t,category:i}),invalid_end_time:(t="Invalid end time")=>({title:s,message:t,category:i}),invalid_timezone:(t="Invalid timezone")=>({title:s,message:t,category:i})}},this.api=e=>{const i=exports.ErrorCategory.Api,s=`${e} error`;return{invalid_session:t=>({title:s,message:t,category:i}),general_error:t=>({title:s,message:t,category:i}),internal_error:t=>({title:s,message:t,category:i}),invalid_request_error:t=>({title:s,message:t,category:i}),timeslot_not_available:t=>({title:s,message:t,category:i})}}}}class L{constructor({schedulerAPIURL:e,schedulerStore:i,sessionId:s,configId:t}){this.errors=new z,this.schedulerStore=i,this.schedulerAPIURL=e,this.sessionId=s,this.configId=t}getHeaders(){return this.configId?{}:{Authorization:`Bearer ${this.sessionId}`}}async makeAPIRequest(e,i,s,t={}){try{const n=new URL(this.schedulerAPIURL);return n.pathname=e,await(await fetch(decodeURIComponent(n.toString()),{method:i,headers:{"Content-Type":"application/json",Origin:window.location.origin,...t},body:s})).json()}catch(n){return{error:{message:n.message,title:"API request failed",type:"api"}}}}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)}toggleAdditionalData(e){this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:i}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...i,primaryParticipant:{...i==null?void 0:i.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:i}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...i,primaryParticipant:{...i==null?void 0:i.primaryParticipant,email:e}})}async resetStoreStateAndFetchAvailability(){const e=new Date,i=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3,t=await this.getAvailability(i,s),n=this.schedulerStore.get("availability").find(a=>new Date(a.start_time)>new Date);let r=e;return n&&(r=n.start_time),this.schedulerStore.set("selectedDate",r),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1),this.schedulerStore.set("selectedTimeslot",null),t}async setReschedule(e){const i=this.schedulerStore.state.eventInfo;i&&this.schedulerStore.set("reschedulingEventInfo",i);const s=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("rescheduleBookingId",e),s}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async bookTimeslot(e){var d;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:i,selectedTimezone:s,bookingInfo:t}=this.schedulerStore.state;if(!e&&!t)return{error:this.errors.component("Booking").no_booking_info()};const n=(e==null?void 0:e.timeslot)||i;if(!n)return{error:this.errors.component("Create Booking").no_timeslot_selected()};const r=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:s;if(!r)return{error:this.errors.component("Create Booking").no_timezone_selected()};const a=e?e==null?void 0:e.primaryParticipant:t==null?void 0:t.primaryParticipant,c=e?(e==null?void 0:e.guests)||[]:(t==null?void 0:t.guests)||[],u=e?{...e==null?void 0:e.additionalFields,guests:c}:{...t==null?void 0:t.additionalFields,guests:c},S=this.getHeaders(),_=`/v3/scheduling/bookings${this.configId?`?configuration_id=${this.configId}`:""}`,l=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({additional_fields:u,guest:{...a},start_time:n.start_time.getTime()/1e3,end_time:n.end_time.getTime()/1e3,timezone:r}),S);if("error"in l){this.schedulerStore.set("isLoading",!1);const h=(d=l.error)==null?void 0:d.type;let g=l.error;return h&&h in this.errors.api("Create Booking")&&(g=this.errors.api("Create Booking")[h]((g==null?void 0:g.message)||(g==null?void 0:g.title)||"Something went wrong")),{error:g}}return"data"in l&&this.schedulerStore.set("eventInfo",l==null?void 0:l.data),this.schedulerStore.set("isLoading",!1),l}async getUISettings(){var n;this.schedulerStore.set("isLoading",!0);const e=this.getHeaders(),s=`/v3/scheduling/ui-settings${this.configId?`?configuration_id=${this.configId}`:""}`,t=await this.makeAPIRequest(s,"GET",void 0,e);if("error"in t){this.schedulerStore.set("isLoading",!1);const r=(n=t.error)==null?void 0:n.type;let a=t.error;return r&&r in this.errors.api("Get UI Settings")&&(a=this.errors.api("Get UI Settings")[r]((a==null?void 0:a.message)||(a==null?void 0:a.title)||"Something went wrong")),{error:a}}return"data"in t&&this.schedulerStore.set("configSettings",t.data),this.schedulerStore.set("isLoading",!1),t}async getAvailability(e=0,i=0){var S,p,_;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,t=new Date,n=t.getTime();if(i&&i<n/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component("Get Availability").endtime_not_in_future()};if(!e){const l=new Date(t.getFullYear(),t.getMonth(),1);e=Math.floor(l.getTime()/1e3)}if(!i){const l=new Date(t.getFullYear(),t.getMonth()+1,0);i=Math.floor(l.getTime()/1e3)}s.append("start_time",encodeURIComponent(e.toString())),s.append("end_time",encodeURIComponent(i.toString())),this.configId&&s.append("configuration_id",encodeURIComponent(this.configId));const r=s.toString(),a=`/v3/scheduling/availability${r?`?${r}`:""}`,c=this.getHeaders(),u=await this.makeAPIRequest(decodeURIComponent(a),"GET",void 0,c);if("error"in u){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const l=(S=u.error)==null?void 0:S.type;let d=u.error;return l&&l in this.errors.api("Get Availability")&&(d=this.errors.api("Get Availability")[l]((d==null?void 0:d.message)||(d==null?void 0:d.title)||"Something went wrong")),{error:d}}if("data"in u){const d=(((_=(p=u.data)==null?void 0:p.time_slots)==null?void 0:_.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",d)}return this.schedulerStore.set("isLoading",!1),u}async cancelBooking(e){var r;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component("Cancel Booking").no_booking_id()};const i=this.configId?`?configuration_id=${this.configId}`:"",s=`/v3/scheduling/bookings/${e}${i}`,t=this.getHeaders(),n=await this.makeAPIRequest(decodeURIComponent(s),"DELETE",JSON.stringify({action:"cancel"}),t);if("error"in n){this.schedulerStore.set("isLoading",!1);const a=(r=n.error)==null?void 0:r.type;let c=n.error;return a&&a in this.errors.api("Cancel Booking")&&(c=this.errors.api("Cancel Booking")[a]((c==null?void 0:c.message)||(c==null?void 0:c.title)||"Something went wrong")),{error:c}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("isLoading",!1),n}async rescheduleBooking(e,i){var w;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component("Reschedule Booking").no_booking_id()};const s=this.errors.api("Reschedule Booking"),t=this.errors.component("Reschedule Booking"),{bookingInfo:n,selectedTimeslot:r,selectedTimezone:a}=this.schedulerStore.state,{startTime:c,endTime:u,timezone:S}=i,p=c||(r==null?void 0:r.start_time);if(!p)return{error:t.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const _=u||(r==null?void 0:r.end_time);if(!_)return{error:t.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const l=S||a;if(!l)return{error:t.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const d=i?i==null?void 0:i.primaryParticipant:n==null?void 0:n.primaryParticipant,h=i?(i==null?void 0:i.guests)||[]:(n==null?void 0:n.guests)||[],g=i?{...i==null?void 0:i.additionalFields,guests:h}:{...n==null?void 0:n.additionalFields,guests:h},k=this.configId?`?configuration_id=${this.configId}`:"",T=`/v3/scheduling/bookings/${e}${k}`,A=this.getHeaders(),m=await this.makeAPIRequest(decodeURIComponent(T),"PATCH",JSON.stringify({start_time:p.getTime()/1e3,end_time:_.getTime()/1e3,time_zone:l,additional_fields:g,guest:{...d}}),A);if("error"in m){this.schedulerStore.set("isLoading",!1);const v=(w=m.error)==null?void 0:w.type;let f=m.error;v&&v in s&&(f=s[v]((f==null?void 0:f.message)||(f==null?void 0:f.title)||"Something went wrong"))}const I=this.schedulerStore.get("reschedulingEventInfo");if("data"in m)this.schedulerStore.set("eventInfo",m==null?void 0:m.data);else if(I)this.schedulerStore.set("eventInfo",I);else{const v={booking_id:e};this.schedulerStore.set("eventInfo",v)}return this.schedulerStore.set("isLoading",!1),m}}function C(o={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,selectableDates:null,availability:[],state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...o};y.debug("[defaultNylasStoreState]: ",e);const i=y.createStore(e);return i.onChange("availability",s=>{y.debug("[availability]: ",s);const t=s.map(n=>n.start_time);y.debug("[selectableDates]: ",t),i.set("selectableDates",t)}),i.reset=()=>{for(const s in e){const t=e[s];i.set(s,t)}},i}exports.CreateNylasSchedulerStore=C;exports.NylaSchedulerAPIConnector=L;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-3a004ec1.cjs");require("react");require("react-dom");const s=".time-period-selector.sc-time-period-selector{display:flex;gap:0.5rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){min-width:108px}.time-period-selector.sc-time-period-selector select-dropdown#time-number.sc-time-period-selector::part(sd_dropdown-button){min-width:84px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}",n=s,i=class{constructor(e){d.registerInstance(this,e),this.timePeriodChanged=d.createEvent(this,"timePeriodChanged",7),this.timePeriods=["hour","day","week","month"],this.defaultSelectedPeriod="hour",this.defaultSelectedNumber=1,this.selectedPeriod=this.defaultSelectedPeriod,this.selectedNumber=this.defaultSelectedNumber,this.numberOptions=this.calculateOptions("hour").map(t=>({label:t.toString(),value:t.toString()})),this.timePeriodOptions=this.timePeriods.map(t=>({label:t,value:t}))}defaultSelectedPeriodChangedHandler(e){this.selectedPeriod=e,this.updateNumberOptionsAndSelectedNumber(e)}defaultSelectedNumberChangedHandler(e){this.selectedNumber=e}timePeriodsChangedHandler(e){this.timePeriodOptions=e.map(t=>({label:t,value:t}))}calculateOptions(e){switch(e){case"hour":return Array.from({length:23},(t,r)=>r+1);case"minute":return Array.from({length:60},(t,r)=>r);case"day":return Array.from({length:30},(t,r)=>r+1);case"week":return Array.from({length:4},(t,r)=>r+1);case"month":return Array.from({length:12},(t,r)=>r+1);default:return[]}}selectedOptionChangedHandler(e){d.debug("time-period-selector","selectedOptionChangedHandler",e.detail);const{value:t,name:r}=e.detail;r==="time-period"?(this.selectedPeriod=t,this.updateNumberOptionsAndSelectedNumber(t)):r==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}updateNumberOptionsAndSelectedNumber(e){const t=this.calculateOptions(e);this.numberOptions=t.map(r=>({label:r.toString(),value:r.toString()})),this.selectedNumber=parseInt(this.numberOptions[0].value)}render(){return d.h("div",{key:"eaec00db41b0c2410fc4a9ccc341fc4ec4012e10",class:"time-period-selector"},d.h("select-dropdown",{key:"0d53efe90429a05d4f52a8f1b92bf46b14b1e6ad",id:"time-number",name:"time-number",exportparts:"sd__dropdown: tps__number-dropdown, sd__dropdown-button: tps__number-dropdown-button, sd__dropdown-content: tps__number-dropdown-content",options:this.numberOptions,defaultSelectedOption:this.numberOptions.find(e=>e.value==this.selectedNumber.toString())??this.numberOptions[0],withSearch:!1}),d.h("select-dropdown",{key:"bce764e3e959eb4fad73d1e410173d584f243ee5",id:"time-period",name:"time-period",options:this.timePeriodOptions,exportparts:"sd__dropdown: tps__period-dropdown, sd__dropdown-button: tps__period-dropdown-button, sd__dropdown-content: tps__period-dropdown-content",pluralizedLabel:this.selectedNumber>1?"s":"",defaultSelectedOption:this.timePeriodOptions.find(e=>e.value==this.selectedPeriod)??this.timePeriodOptions[0],withSearch:!1}))}get host(){return d.getElement(this)}static get watchers(){return{defaultSelectedPeriod:["defaultSelectedPeriodChangedHandler"],defaultSelectedNumber:["defaultSelectedNumberChangedHandler"],timePeriods:["timePeriodsChangedHandler"]}}};i.style=n;exports.time_period_selector=i;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as a, h as n } from "./index-4c7e8f2f.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const e = ".sc-warning-icon-h{display:flex}", r = e, i = class {
|
|
5
|
-
constructor(t) {
|
|
6
|
-
a(this, t), this.width = "16", this.height = "16";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return n("svg", { key: "5a655b4440d40d0e22c0e8bb3d9e3f08a947eb32", width: "21", height: "21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "c3de0f39d8816fcc092f0a4bc6231e9cb91283de", d: "M10.149 7.054a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0v-4a.5.5 0 0 1 .5-.5Zm0 7.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.834 2.906a1.5 1.5 0 0 1 2.63 0l6.558 11.925a1.5 1.5 0 0 1-1.314 2.223H3.59a1.5 1.5 0 0 1-1.314-2.223L8.834 2.906Zm1.753.482a.5.5 0 0 0-.876 0L3.15 15.313a.5.5 0 0 0 .439.741h13.117a.5.5 0 0 0 .439-.741l-6.56-11.925Z", fill: "currentColor" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
i.style = r;
|
|
13
|
-
export {
|
|
14
|
-
i as warning_icon
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-3a004ec1.cjs");require("react");require("react-dom");const r=".sc-warning-icon-h{display:flex}",i=r,n=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"5a655b4440d40d0e22c0e8bb3d9e3f08a947eb32",width:"21",height:"21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"c3de0f39d8816fcc092f0a4bc6231e9cb91283de",d:"M10.149 7.054a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0v-4a.5.5 0 0 1 .5-.5Zm0 7.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.834 2.906a1.5 1.5 0 0 1 2.63 0l6.558 11.925a1.5 1.5 0 0 1-1.314 2.223H3.59a1.5 1.5 0 0 1-1.314-2.223L8.834 2.906Zm1.753.482a.5.5 0 0 0-.876 0L3.15 15.313a.5.5 0 0 0 .439.741h13.117a.5.5 0 0 0 .439-.741l-6.56-11.925Z",fill:"currentColor"}))}};n.style=i;exports.warning_icon=n;
|