@nylas/react 1.1.0-canary.18 → 1.1.0-canary.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-circle-icon_2.entry-3b13ee64.js → add-circle-icon_2.entry-5cefae99.js} +5 -5
- package/dist/{add-circle-icon_2.entry-3091976b.cjs → add-circle-icon_2.entry-85523420.cjs} +1 -1
- package/dist/{archive-icon_7.entry-8932618a.js → archive-icon_7.entry-2f418a3e.js} +13 -13
- package/dist/{archive-icon_7.entry-c2b6d860.cjs → archive-icon_7.entry-eb90a353.cjs} +1 -1
- package/dist/arrow-icon.entry-753eb942.js +15 -0
- package/dist/{arrow-icon.entry-a159bee8.cjs → arrow-icon.entry-ac5e1a47.cjs} +1 -1
- package/dist/{bold-icon_3.entry-447d0537.js → bold-icon_3.entry-18507c82.js} +4 -4
- package/dist/{bold-icon_3.entry-c51e1af3.cjs → bold-icon_3.entry-4fff7400.cjs} +1 -1
- package/dist/button-component_4.entry-3c508e3b.js +115 -0
- package/dist/button-component_4.entry-f8ab53dc.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_35.entry-b56841a0.cjs +7 -0
- package/dist/calendar-agenda-fill-icon_35.entry-db989ce0.js +4182 -0
- package/dist/{calendar-cancel-icon.entry-a78f27bc.js → calendar-cancel-icon.entry-31caeae1.js} +1 -1
- package/dist/{calendar-cancel-icon.entry-805febcc.cjs → calendar-cancel-icon.entry-d2e10dfc.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-7c8b6c92.js → calendar-check-icon_2.entry-7f67c003.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-4a0fd7bd.cjs → calendar-check-icon_2.entry-d32551e9.cjs} +1 -1
- package/dist/{calendar-icon.entry-96f9727f.js → calendar-icon.entry-6e89816b.js} +1 -1
- package/dist/{calendar-icon.entry-1fc018b4.cjs → calendar-icon.entry-f3f1c623.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-25d90239.js → chevron-icon_3.entry-2e20a83e.js} +37 -34
- package/dist/chevron-icon_3.entry-3be68846.cjs +1 -0
- package/dist/{clock-icon_2.entry-2406c3d0.cjs → clock-icon_2.entry-074eb053.cjs} +1 -1
- package/dist/{clock-icon_2.entry-c1b22ed4.js → clock-icon_2.entry-bc938936.js} +5 -5
- package/dist/{constants-f34b9c6e-f1c4dd0d.js → constants-7ce66b44-3952e81c.js} +484 -383
- package/dist/{constants-f34b9c6e-b774916c.cjs → constants-7ce66b44-a6b777d4.cjs} +5 -5
- package/dist/copy-icon_4.entry-187edab9.js +45 -0
- package/dist/copy-icon_4.entry-f704b2f1.cjs +1 -0
- package/dist/{document-refresh-icon.entry-570f9c9d.js → document-refresh-icon.entry-9d7900d7.js} +5 -5
- package/dist/document-refresh-icon.entry-ea0e1ab9.cjs +1 -0
- package/dist/elements/index.d.ts +14 -0
- package/dist/{elements-dc5b338e-cafa7a55.js → elements-dc5b338e-e6271e48.js} +1 -1
- package/dist/{elements-dc5b338e-550a6cb1.cjs → elements-dc5b338e-edf63aa6.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-022799ce.js → focus-visible-e8093c16-4c45967c.js} +1 -1
- package/dist/{focus-visible-e8093c16-c14162e8.cjs → focus-visible-e8093c16-84e41b3b.cjs} +1 -1
- package/dist/{forward-icon_6.entry-55752b23.cjs → forward-icon_6.entry-4cb6eb63.cjs} +3 -3
- package/dist/{forward-icon_6.entry-9b832146.js → forward-icon_6.entry-949d0cfb.js} +9 -9
- package/dist/{globe-icon.entry-2b61820e.js → globe-icon.entry-04b35395.js} +2 -2
- package/dist/{globe-icon.entry-dabe7b8b.cjs → globe-icon.entry-741f8ad4.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-8e87cf66.cjs +1 -0
- package/dist/google-logo-icon_4.entry-f50de25f.js +598 -0
- package/dist/index-53420959-507f0a27.js +5 -0
- package/dist/index-53420959-e6c2e510.cjs +1 -0
- package/dist/{index-6d9eeb53-3049fc04.cjs → index-6d9eeb53-8b16e3b5.cjs} +1 -1
- package/dist/{index-6d9eeb53-3edef246.js → index-6d9eeb53-b15263de.js} +2 -2
- package/dist/index-a4831dfe.cjs +42 -0
- package/dist/{index-812162da.js → index-a68236be.js} +874 -854
- package/dist/{index.es-9cc0eb3c-0c99c055.cjs → index.es-9cc0eb3c-2e0f7d11.cjs} +1 -1
- package/dist/{index.es-9cc0eb3c-52226859.js → index.es-9cc0eb3c-e6c5dd2d.js} +1 -1
- package/dist/{info-icon_2.entry-5f6b9af8.cjs → info-icon_2.entry-c3468951.cjs} +1 -1
- package/dist/{info-icon_2.entry-2fe6c16c.js → info-icon_2.entry-d0270899.js} +8 -8
- package/dist/{input-dropdown_2.entry-dbdb5aa3.cjs → input-dropdown_2.entry-2485dcc3.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-dbd0d6f4.js → input-dropdown_2.entry-2cd6cfc7.js} +3 -3
- package/dist/{loading-icon.entry-e179f122.cjs → loading-icon.entry-5ed52afe.cjs} +1 -1
- package/dist/loading-icon.entry-96d9d1be.js +15 -0
- package/dist/{mailbox-store-64b4ef7c-22a6c565.js → mailbox-store-64b4ef7c-7c793d9a.js} +2 -2
- package/dist/{mailbox-store-64b4ef7c-0eac526c.cjs → mailbox-store-64b4ef7c-c609ac6d.cjs} +1 -1
- package/dist/multi-select-dropdown.entry-2ca73c71.js +91 -0
- package/dist/multi-select-dropdown.entry-f298ca2c.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-e0990f5b.js → nylas-booked-event-card_10.entry-2b01df7e.js} +267 -235
- package/dist/nylas-booked-event-card_10.entry-97977ac7.cjs +1 -0
- package/dist/{nylas-custom-booking-flow.entry-898c8cc9.cjs → nylas-custom-booking-flow.entry-05b9522a.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-bc64af5f.js → nylas-custom-booking-flow.entry-66beff43.js} +3 -3
- package/dist/{nylas-form-card.entry-c564b52e.js → nylas-form-card.entry-3de9f477.js} +11 -11
- package/dist/{nylas-form-card.entry-0c71f4fc.cjs → nylas-form-card.entry-3e1331c9.cjs} +1 -1
- package/dist/{nylas-if-state.entry-e9486e12.js → nylas-if-state.entry-a0689083.js} +3 -3
- package/dist/{nylas-if-state.entry-ff6a2046.cjs → nylas-if-state.entry-a734df46.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-0258af1e.js → nylas-list-folders.entry-4fb9d4c2.js} +7 -7
- package/dist/{nylas-list-folders.entry-90716d2b.cjs → nylas-list-folders.entry-74a56187.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-21edf012.cjs → nylas-list-threads.entry-0addc621.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-1abcdd30.js → nylas-list-threads.entry-9a6d4c33.js} +3 -3
- package/dist/{nylas-login.entry-2e0ce95e.cjs → nylas-login.entry-bdac29c0.cjs} +1 -1
- package/dist/{nylas-login.entry-ba7383ac.js → nylas-login.entry-beb6e0d9.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-f6186560.js → nylas-mailbox-pagination.entry-1d71850a.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-ba6beb08.cjs → nylas-mailbox-pagination.entry-c5d07bbe.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-0875aadb.cjs → nylas-mailbox-toolbar-button.entry-7d9d6293.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-e18059b0.js → nylas-mailbox-toolbar-button.entry-882c97a0.js} +10 -10
- package/dist/{nylas-mailbox.entry-bb2905bf.cjs → nylas-mailbox.entry-94eb97ec.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-2e3815ed.js → nylas-mailbox.entry-d810adba.js} +4 -4
- package/dist/{nylas-provider.entry-51c5cdbf.cjs → nylas-provider.entry-5a4bb86e.cjs} +1 -1
- package/dist/{nylas-provider.entry-69ee5061.js → nylas-provider.entry-fcaf9e1c.js} +39 -39
- package/dist/{nylas-scheduler-editor.entry-d4a9afb1.js → nylas-scheduler-editor.entry-1ca566d3.js} +138 -119
- package/dist/nylas-scheduler-editor.entry-30597812.cjs +2 -0
- package/dist/nylas-scheduling.entry-00c418c8.cjs +1 -0
- package/dist/{nylas-scheduling.entry-f82a2822.js → nylas-scheduling.entry-aefefe3d.js} +52 -52
- package/dist/{nylas-threads-refresh.entry-72482d2f.js → nylas-threads-refresh.entry-a85222e2.js} +10 -10
- package/dist/{nylas-threads-refresh.entry-99001756.cjs → nylas-threads-refresh.entry-f3b9fdf2.cjs} +1 -1
- package/dist/nylas-threads-search.entry-2c8ac7dc.cjs +1 -0
- package/dist/{nylas-threads-search.entry-c5fe50e5.js → nylas-threads-search.entry-b1bf455b.js} +17 -17
- package/dist/{nylas-time-window-picker.entry-ccffcf2b.cjs → nylas-time-window-picker.entry-3a34b29b.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-0d93e7cc.js → nylas-time-window-picker.entry-6d664a05.js} +2 -2
- package/dist/{nylas-view-thread.entry-58432a52.cjs → nylas-view-thread.entry-bf6cab2a.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-2d34b41c.js → nylas-view-thread.entry-ddcb042f.js} +6 -6
- package/dist/play-icon_2.entry-4f316c3d.cjs +1 -0
- package/dist/play-icon_2.entry-d55a018a.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +115 -101
- package/dist/{refresh-icon.entry-a041136d.js → refresh-icon.entry-0fdcb7af.js} +4 -4
- package/dist/{refresh-icon.entry-1e670732.cjs → refresh-icon.entry-99761cb6.cjs} +1 -1
- package/dist/{register-component-a5a9ca5d-b68b6039.cjs → register-component-a5a9ca5d-4439e573.cjs} +1 -1
- package/dist/{register-component-a5a9ca5d-a5c01c35.js → register-component-a5a9ca5d-ddae10b3.js} +1 -1
- package/dist/{scheduler-config-store-4a50a03d-ee42ff96.js → scheduler-config-store-9ccfba4d-84025740.js} +8 -6
- package/dist/scheduler-config-store-9ccfba4d-b774bfee.cjs +1 -0
- package/dist/{scheduler-store-f02ce045-23a14e3f.js → scheduler-store-8a400448-8ab7b63e.js} +125 -96
- package/dist/scheduler-store-8a400448-eaa566fa.cjs +1 -0
- package/dist/{textarea-component.entry-1b4c771b.js → textarea-component.entry-193d29fd.js} +7 -6
- package/dist/{textarea-component.entry-24a830c1.cjs → textarea-component.entry-359e4665.cjs} +1 -1
- package/dist/{translate-icon.entry-44bde57b.js → translate-icon.entry-22a3e72e.js} +2 -2
- package/dist/{translate-icon.entry-0c0add25.cjs → translate-icon.entry-32ec36de.cjs} +1 -1
- package/dist/{warning-icon.entry-8956cba2.js → warning-icon.entry-8d9b59c0.js} +5 -5
- package/dist/{warning-icon.entry-9a77ab01.cjs → warning-icon.entry-b8d483e1.cjs} +1 -1
- package/package.json +3 -3
- package/dist/arrow-icon.entry-1f54c377.js +0 -15
- package/dist/button-component.entry-52ccb6d9.js +0 -16
- package/dist/button-component.entry-e79b2d08.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-2054703c.cjs +0 -1
- package/dist/calendar-info-icon_28.entry-e7bebd13.js +0 -2083
- package/dist/chevron-icon_3.entry-7bd4a4b5.cjs +0 -1
- package/dist/document-refresh-icon.entry-a0293858.cjs +0 -1
- package/dist/google-logo-icon_4.entry-60c0d39a.cjs +0 -1
- package/dist/google-logo-icon_4.entry-a0dc33da.js +0 -467
- package/dist/index-53420959-67beefed.js +0 -5
- package/dist/index-53420959-d3254a34.cjs +0 -1
- package/dist/index-e3e9b594.cjs +0 -42
- package/dist/input-component.entry-1195d579.js +0 -45
- package/dist/input-component.entry-2b6e44c4.cjs +0 -1
- package/dist/loading-icon.entry-027a2ad1.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-84f64ba5.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-923b8566.cjs +0 -2
- package/dist/nylas-scheduling.entry-54f1a5e9.cjs +0 -1
- package/dist/nylas-threads-search.entry-462527fd.cjs +0 -1
- package/dist/play-icon_2.entry-1ea3fd6b.cjs +0 -1
- package/dist/play-icon_2.entry-d08adf17.js +0 -25
- package/dist/scheduler-config-store-4a50a03d-884e6df8.cjs +0 -1
- package/dist/scheduler-store-f02ce045-42e3647c.cjs +0 -1
package/dist/{nylas-scheduler-editor.entry-d4a9afb1.js → nylas-scheduler-editor.entry-1ca566d3.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var P = Object.defineProperty;
|
|
2
2
|
var O = (r, t, n) => t in r ? P(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
|
|
3
|
-
var
|
|
4
|
-
import { i as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, h, H as Host, g as getElement, B as Buffer, F as Fragment, j as dataResponse } from "./index-
|
|
5
|
-
import { N as NylasBaseProvider, X as Xr } from "./index.es-9cc0eb3c-
|
|
6
|
-
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-
|
|
7
|
-
import { p as process } from "./index-53420959-
|
|
3
|
+
var b = (r, t, n) => (O(r, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { i as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, h, H as Host, g as getElement, B as Buffer, F as Fragment, j as dataResponse } from "./index-a68236be.js";
|
|
5
|
+
import { N as NylasBaseProvider, X as Xr } from "./index.es-9cc0eb3c-e6c5dd2d.js";
|
|
6
|
+
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-9ccfba4d-84025740.js";
|
|
7
|
+
import { p as process } from "./index-53420959-507f0a27.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
class NylasSchedulerConfigAPIConnector {
|
|
@@ -51,21 +51,21 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
51
51
|
message: "Error fetching configuration: " + ((a = s.error) == null ? void 0 : a.message)
|
|
52
52
|
}) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = s.data, this.nylasSchedulerConfigStore.state.configurations.find((d) => d.id === t) ? this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map((d) => d.id === t ? s.data : d) : this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, s.data], dataResponse(s.data));
|
|
53
53
|
}
|
|
54
|
-
async getConfigurations() {
|
|
55
|
-
var
|
|
54
|
+
async getConfigurations(t) {
|
|
55
|
+
var a;
|
|
56
56
|
if (!this.nylasApiRequest)
|
|
57
57
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
58
58
|
message: "Error fetching configurations: Nylas API Request is not initialized"
|
|
59
59
|
});
|
|
60
|
-
const [
|
|
60
|
+
const n = 50, [s, c] = await this.nylasApiRequest.request({
|
|
61
61
|
method: "GET",
|
|
62
|
-
path:
|
|
62
|
+
path: `scheduling/configurations?limit=${n}${t ? `&page_token=${t}` : ""}`
|
|
63
63
|
});
|
|
64
|
-
return
|
|
65
|
-
message: "Error fetching configurations: " +
|
|
66
|
-
}) : Xr(
|
|
67
|
-
message: "Error fetching configurations: " + ((
|
|
68
|
-
}) : (this.nylasSchedulerConfigStore.state.configurations =
|
|
64
|
+
return c ? dataResponse(null, {
|
|
65
|
+
message: "Error fetching configurations: " + c.message
|
|
66
|
+
}) : Xr(s) ? dataResponse(null, {
|
|
67
|
+
message: "Error fetching configurations: " + ((a = s.error) == null ? void 0 : a.message)
|
|
68
|
+
}) : (this.nylasSchedulerConfigStore.state.configurations = s.data, this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor = s.next_cursor || null, dataResponse(s.data));
|
|
69
69
|
}
|
|
70
70
|
async createConfiguration(t) {
|
|
71
71
|
var c;
|
|
@@ -162,7 +162,7 @@ class LocalStorage {
|
|
|
162
162
|
const PKCE_KEY = "pkce", GRANT_KEY = "grant", USER_KEY = "user";
|
|
163
163
|
class Storage {
|
|
164
164
|
constructor(t) {
|
|
165
|
-
|
|
165
|
+
b(this, "Storage", new LocalStorage());
|
|
166
166
|
if (t) {
|
|
167
167
|
this.Storage = t;
|
|
168
168
|
return;
|
|
@@ -238,8 +238,8 @@ class Storage {
|
|
|
238
238
|
}
|
|
239
239
|
class IndexedDBStorage {
|
|
240
240
|
constructor() {
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
b(this, "databaseName", "identity-db");
|
|
242
|
+
b(this, "storeName", "identity");
|
|
243
243
|
}
|
|
244
244
|
get(t) {
|
|
245
245
|
const n = this;
|
|
@@ -265,11 +265,11 @@ class IndexedDBStorage {
|
|
|
265
265
|
}, a.onerror = () => {
|
|
266
266
|
c(a.error);
|
|
267
267
|
}, a.onsuccess = (d) => {
|
|
268
|
-
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"),
|
|
269
|
-
|
|
268
|
+
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"), y = u.objectStore(this.storeName).delete(t);
|
|
269
|
+
y.onsuccess = () => {
|
|
270
270
|
s(null);
|
|
271
|
-
},
|
|
272
|
-
c(
|
|
271
|
+
}, y.onerror = () => {
|
|
272
|
+
c(y.error);
|
|
273
273
|
}, u.oncomplete = () => {
|
|
274
274
|
l.close();
|
|
275
275
|
};
|
|
@@ -284,11 +284,11 @@ class IndexedDBStorage {
|
|
|
284
284
|
}, a.onupgradeneeded = (d) => {
|
|
285
285
|
d.target.result.createObjectStore(this.storeName);
|
|
286
286
|
}, a.onsuccess = (d) => {
|
|
287
|
-
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"),
|
|
288
|
-
|
|
287
|
+
const l = d.target.result, u = l.transaction(this.storeName, "readwrite"), y = u.objectStore(this.storeName).put(n, t);
|
|
288
|
+
y.onsuccess = () => {
|
|
289
289
|
s(n);
|
|
290
|
-
},
|
|
291
|
-
c(
|
|
290
|
+
}, y.onerror = () => {
|
|
291
|
+
c(y.error);
|
|
292
292
|
}, u.oncomplete = () => {
|
|
293
293
|
l.close();
|
|
294
294
|
};
|
|
@@ -465,11 +465,11 @@ var sha256 = { exports: {} };
|
|
|
465
465
|
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();
|
|
466
466
|
}
|
|
467
467
|
}, Sha256.prototype.hash = function() {
|
|
468
|
-
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = this.blocks, f,
|
|
468
|
+
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, c = this.h4, a = this.h5, d = this.h6, l = this.h7, u = this.blocks, f, y, g, w, p, S, m, x, R, _, A;
|
|
469
469
|
for (f = 16; f < 64; ++f)
|
|
470
|
-
p = u[f - 15],
|
|
470
|
+
p = u[f - 15], y = (p >>> 7 | p << 25) ^ (p >>> 18 | p << 14) ^ p >>> 3, p = u[f - 2], g = (p >>> 17 | p << 15) ^ (p >>> 19 | p << 13) ^ p >>> 10, u[f] = u[f - 16] + y + u[f - 7] + g << 0;
|
|
471
471
|
for (A = t & n, f = 0; f < 64; f += 4)
|
|
472
|
-
this.first ? (this.is224 ? (x = 300032, p = u[0] - 1413257819, l = p - 150054599 << 0, s = p + 24177077 << 0) : (x = 704751109, p = u[0] - 210244248, l = p - 1521486534 << 0, s = p + 143694565 << 0), this.first = !1) : (
|
|
472
|
+
this.first ? (this.is224 ? (x = 300032, p = u[0] - 1413257819, l = p - 150054599 << 0, s = p + 24177077 << 0) : (x = 704751109, p = u[0] - 210244248, l = p - 1521486534 << 0, s = p + 143694565 << 0), this.first = !1) : (y = (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10), g = (c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7), x = r & t, w = x ^ r & n ^ A, m = c & a ^ ~c & d, p = l + g + m + K[f] + u[f], S = y + w, l = s + p << 0, s = p + S << 0), y = (s >>> 2 | s << 30) ^ (s >>> 13 | s << 19) ^ (s >>> 22 | s << 10), g = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), R = s & r, w = R ^ s & t ^ x, m = l & c ^ ~l & a, p = d + g + m + K[f + 1] + u[f + 1], S = y + w, d = n + p << 0, n = p + S << 0, y = (n >>> 2 | n << 30) ^ (n >>> 13 | n << 19) ^ (n >>> 22 | n << 10), g = (d >>> 6 | d << 26) ^ (d >>> 11 | d << 21) ^ (d >>> 25 | d << 7), _ = n & s, w = _ ^ n & r ^ R, m = d & l ^ ~d & c, p = a + g + m + K[f + 2] + u[f + 2], S = y + w, a = t + p << 0, t = p + S << 0, y = (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10), g = (a >>> 6 | a << 26) ^ (a >>> 11 | a << 21) ^ (a >>> 25 | a << 7), A = t & n, w = A ^ t & s ^ _, m = a & d ^ ~a & l, p = c + g + m + K[f + 3] + u[f + 3], S = y + w, c = r + p << 0, r = p + S << 0;
|
|
473
473
|
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 + d << 0, this.h7 = this.h7 + l << 0;
|
|
474
474
|
}, Sha256.prototype.hex = function() {
|
|
475
475
|
this.finalize();
|
|
@@ -530,12 +530,12 @@ var sha256 = { exports: {} };
|
|
|
530
530
|
} else
|
|
531
531
|
throw new Error(ERROR);
|
|
532
532
|
r.length > 64 && (r = new Sha256(t, !0).update(r).array());
|
|
533
|
-
var f = [],
|
|
533
|
+
var f = [], y = [];
|
|
534
534
|
for (s = 0; s < 64; ++s) {
|
|
535
|
-
var
|
|
536
|
-
f[s] = 92 ^
|
|
535
|
+
var g = r[s] || 0;
|
|
536
|
+
f[s] = 92 ^ g, y[s] = 54 ^ g;
|
|
537
537
|
}
|
|
538
|
-
Sha256.call(this, t, n), this.update(
|
|
538
|
+
Sha256.call(this, t, n), this.update(y), this.oKeyPad = f, this.inner = !0, this.sharedMemory = n;
|
|
539
539
|
}
|
|
540
540
|
HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function() {
|
|
541
541
|
if (Sha256.prototype.finalize.call(this), this.inner) {
|
|
@@ -618,21 +618,21 @@ function getMessages(r, t, n) {
|
|
|
618
618
|
if (d.length === 0)
|
|
619
619
|
n == null || n(s), s = newMessage();
|
|
620
620
|
else if (l > 0) {
|
|
621
|
-
const u = c.decode(d.subarray(0, l)), f = l + (d[l + 1] === 32 ? 2 : 1),
|
|
621
|
+
const u = c.decode(d.subarray(0, l)), f = l + (d[l + 1] === 32 ? 2 : 1), y = c.decode(d.subarray(f));
|
|
622
622
|
switch (u) {
|
|
623
623
|
case "data":
|
|
624
624
|
s.data = s.data ? s.data + `
|
|
625
|
-
` +
|
|
625
|
+
` + y : y;
|
|
626
626
|
break;
|
|
627
627
|
case "event":
|
|
628
|
-
s.event =
|
|
628
|
+
s.event = y;
|
|
629
629
|
break;
|
|
630
630
|
case "id":
|
|
631
|
-
r(s.id =
|
|
631
|
+
r(s.id = y);
|
|
632
632
|
break;
|
|
633
633
|
case "retry":
|
|
634
|
-
const
|
|
635
|
-
isNaN(
|
|
634
|
+
const g = parseInt(y, 10);
|
|
635
|
+
isNaN(g) || t(s.retry = g);
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
}
|
|
@@ -661,37 +661,37 @@ var __rest = function(r, t) {
|
|
|
661
661
|
};
|
|
662
662
|
const EventStreamContentType = "text/event-stream", DefaultRetryInterval = 1e3, LastEventId = "last-event-id";
|
|
663
663
|
function fetchEventSource(r, t) {
|
|
664
|
-
var { signal: n, headers: s, onopen: c, onmessage: a, onclose: d, onerror: l, openWhenHidden: u, fetch: f } = t,
|
|
665
|
-
return new Promise((
|
|
664
|
+
var { signal: n, headers: s, onopen: c, onmessage: a, onclose: d, onerror: l, openWhenHidden: u, fetch: f } = t, y = __rest(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
665
|
+
return new Promise((g, w) => {
|
|
666
666
|
const p = Object.assign({}, s);
|
|
667
667
|
p.accept || (p.accept = EventStreamContentType);
|
|
668
668
|
let S;
|
|
669
|
-
function
|
|
669
|
+
function m() {
|
|
670
670
|
S.abort(), document.hidden || k();
|
|
671
671
|
}
|
|
672
|
-
u || document.addEventListener("visibilitychange",
|
|
672
|
+
u || document.addEventListener("visibilitychange", m);
|
|
673
673
|
let x = DefaultRetryInterval, R = 0;
|
|
674
674
|
function _() {
|
|
675
|
-
document.removeEventListener("visibilitychange",
|
|
675
|
+
document.removeEventListener("visibilitychange", m), window.clearTimeout(R), S.abort();
|
|
676
676
|
}
|
|
677
677
|
n == null || n.addEventListener("abort", () => {
|
|
678
|
-
_(),
|
|
678
|
+
_(), g();
|
|
679
679
|
});
|
|
680
|
-
const A = f ?? window.fetch,
|
|
680
|
+
const A = f ?? window.fetch, I = c ?? defaultOnOpen;
|
|
681
681
|
async function k() {
|
|
682
|
-
var
|
|
682
|
+
var U;
|
|
683
683
|
S = new AbortController();
|
|
684
684
|
try {
|
|
685
|
-
const T = await A(r, Object.assign(Object.assign({},
|
|
686
|
-
await
|
|
685
|
+
const T = await A(r, Object.assign(Object.assign({}, y), { headers: p, signal: S.signal }));
|
|
686
|
+
await I(T), await getBytes(T.body, getLines(getMessages((v) => {
|
|
687
687
|
v ? p[LastEventId] = v : delete p[LastEventId];
|
|
688
688
|
}, (v) => {
|
|
689
689
|
x = v;
|
|
690
|
-
}, a))), d == null || d(), _(),
|
|
690
|
+
}, a))), d == null || d(), _(), g();
|
|
691
691
|
} catch (T) {
|
|
692
692
|
if (!S.signal.aborted)
|
|
693
693
|
try {
|
|
694
|
-
const v = (
|
|
694
|
+
const v = (U = l == null ? void 0 : l(T)) !== null && U !== void 0 ? U : x;
|
|
695
695
|
window.clearTimeout(R), R = window.setTimeout(k, v);
|
|
696
696
|
} catch (v) {
|
|
697
697
|
_(), w(v);
|
|
@@ -765,15 +765,15 @@ function o(r, t) {
|
|
|
765
765
|
n$1.prototype = new Error(), n$1.prototype.name = "InvalidTokenError";
|
|
766
766
|
class NylasSessions {
|
|
767
767
|
constructor(t) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
768
|
+
b(this, "clientId");
|
|
769
|
+
b(this, "redirectUri");
|
|
770
|
+
b(this, "accessType", "online");
|
|
771
|
+
b(this, "domain", "http://api.nylas.com");
|
|
772
|
+
b(this, "versioned", !1);
|
|
773
|
+
b(this, "Storage");
|
|
774
|
+
b(this, "hosted", !1);
|
|
775
|
+
b(this, "multiAccount", !1);
|
|
776
|
+
b(this, "loginId", "");
|
|
777
777
|
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) {
|
|
778
778
|
const n = new IndexedDBStorage();
|
|
779
779
|
this.Storage = new Storage(n);
|
|
@@ -1006,17 +1006,17 @@ class NylasSessions {
|
|
|
1006
1006
|
code: s,
|
|
1007
1007
|
grant_type: "authorization_code",
|
|
1008
1008
|
code_verifier: u
|
|
1009
|
-
},
|
|
1009
|
+
}, g = await (await fetch(`${this.domain}/connect/token`, {
|
|
1010
1010
|
method: "POST",
|
|
1011
1011
|
headers: new Headers({ "content-type": "application/json" }),
|
|
1012
1012
|
body: JSON.stringify(f)
|
|
1013
1013
|
})).json();
|
|
1014
|
-
if (
|
|
1015
|
-
if (
|
|
1016
|
-
const p = { detail:
|
|
1014
|
+
if (g) {
|
|
1015
|
+
if (g.error) {
|
|
1016
|
+
const p = { detail: g };
|
|
1017
1017
|
return window.dispatchEvent(new CustomEvent("onLoginFail", p)), !0;
|
|
1018
1018
|
}
|
|
1019
|
-
const w = await this.handleCodeExchangeResponse(
|
|
1019
|
+
const w = await this.handleCodeExchangeResponse(g);
|
|
1020
1020
|
if (w.valid) {
|
|
1021
1021
|
c && (w.data.state = c);
|
|
1022
1022
|
const p = { detail: w.data };
|
|
@@ -1028,8 +1028,8 @@ class NylasSessions {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
return this.Storage.removePKCE(), !0;
|
|
1030
1030
|
} catch (f) {
|
|
1031
|
-
const
|
|
1032
|
-
return window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1031
|
+
const y = { detail: f };
|
|
1032
|
+
return window.dispatchEvent(new CustomEvent("onLoginFail", y)), window.history.pushState({}, document.title, window.location.pathname), !1;
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
// Token Exchange for session maintenece
|
|
@@ -1051,13 +1051,13 @@ class NylasSessions {
|
|
|
1051
1051
|
})).json();
|
|
1052
1052
|
if (d) {
|
|
1053
1053
|
if (d.error) {
|
|
1054
|
-
const
|
|
1055
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1054
|
+
const y = { detail: d };
|
|
1055
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", y)), !0;
|
|
1056
1056
|
}
|
|
1057
1057
|
const l = getTimestamp();
|
|
1058
1058
|
if (d.expires_in = l + d.expires_in, this.Storage.setGrant(d, this.multiAccount), !await this.validateIDToken(t)) {
|
|
1059
|
-
const
|
|
1060
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1059
|
+
const y = { detail: d };
|
|
1060
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", y)), !0;
|
|
1061
1061
|
}
|
|
1062
1062
|
const f = { detail: d };
|
|
1063
1063
|
return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess", f)), !0;
|
|
@@ -1093,19 +1093,19 @@ class NylasSessions {
|
|
|
1093
1093
|
return;
|
|
1094
1094
|
const f = setInterval(async () => {
|
|
1095
1095
|
if (u.closed) {
|
|
1096
|
-
const
|
|
1096
|
+
const y = {
|
|
1097
1097
|
detail: { error_description: "OAuth provider window closed" }
|
|
1098
1098
|
};
|
|
1099
|
-
window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1099
|
+
window.dispatchEvent(new CustomEvent("onLoginFail", y)), f && clearInterval(f);
|
|
1100
1100
|
return;
|
|
1101
1101
|
}
|
|
1102
1102
|
try {
|
|
1103
|
-
const
|
|
1104
|
-
if (!
|
|
1103
|
+
const y = u.location.href.split("?");
|
|
1104
|
+
if (!y[0])
|
|
1105
1105
|
return;
|
|
1106
|
-
const
|
|
1107
|
-
if (u.history.pushState({}, document.title, window.location.pathname),
|
|
1108
|
-
const w = await this.codeExchange(
|
|
1106
|
+
const g = u.location.search;
|
|
1107
|
+
if (u.history.pushState({}, document.title, window.location.pathname), y[0] === this.redirectUri && y.length > 1) {
|
|
1108
|
+
const w = await this.codeExchange(g);
|
|
1109
1109
|
u.close(), w && location.reload(), f && clearInterval(f);
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
@@ -1164,11 +1164,11 @@ class NylasSessions {
|
|
|
1164
1164
|
const f = await (u == null ? void 0 : u.json());
|
|
1165
1165
|
if (!await this.isAuthenticatedResponse(u.status, f)) {
|
|
1166
1166
|
if (d > 1) {
|
|
1167
|
-
const
|
|
1168
|
-
if (
|
|
1169
|
-
|
|
1167
|
+
const g = await this.getProfile(n.grant_id);
|
|
1168
|
+
if (g) {
|
|
1169
|
+
g.status = "unauthorized", await this.Storage.setUserToken(g);
|
|
1170
1170
|
const w = {
|
|
1171
|
-
detail: { user:
|
|
1171
|
+
detail: { user: g }
|
|
1172
1172
|
};
|
|
1173
1173
|
window.dispatchEvent(new CustomEvent("onSessionExpired", w));
|
|
1174
1174
|
}
|
|
@@ -1192,7 +1192,7 @@ class NylasSessions {
|
|
|
1192
1192
|
const w = await this.getAccessToken();
|
|
1193
1193
|
f.append("Authorization", `Bearer ${w}`);
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1195
|
+
const y = await fetch(u.toString(), {
|
|
1196
1196
|
method: n || "GET",
|
|
1197
1197
|
headers: f,
|
|
1198
1198
|
mode: "cors",
|
|
@@ -1200,7 +1200,7 @@ class NylasSessions {
|
|
|
1200
1200
|
body: s ? JSON.stringify(s) : void 0,
|
|
1201
1201
|
...d || {}
|
|
1202
1202
|
});
|
|
1203
|
-
return c ? await
|
|
1203
|
+
return c ? await y.json() : y.body;
|
|
1204
1204
|
}
|
|
1205
1205
|
// Checks if the response is not 401
|
|
1206
1206
|
async isAuthenticatedResponse(t, n) {
|
|
@@ -1301,60 +1301,79 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1301
1301
|
),
|
|
1302
1302
|
h("small", { class: "disclaimer-text" }, "* You will be redirected to authenticate your account.")
|
|
1303
1303
|
)
|
|
1304
|
-
)
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1304
|
+
);
|
|
1305
|
+
function ExpressFlow({ selectedConfiguration: r, currentUser: t, calendars: n }) {
|
|
1306
|
+
var c;
|
|
1307
|
+
const s = ((c = r.participants) == null ? void 0 : c.find((a) => a.is_organizer)) ?? t;
|
|
1308
|
+
return h(
|
|
1309
|
+
Fragment,
|
|
1309
1310
|
null,
|
|
1310
1311
|
h(
|
|
1311
|
-
"
|
|
1312
|
-
|
|
1313
|
-
h(
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
)
|
|
1312
|
+
"nylas-event-info",
|
|
1313
|
+
null,
|
|
1314
|
+
h(
|
|
1315
|
+
"div",
|
|
1316
|
+
{ slot: "inputs" },
|
|
1317
|
+
h("nylas-event-title", null),
|
|
1318
|
+
h("nylas-event-duration", null),
|
|
1319
|
+
h("nylas-event-location", null)
|
|
1320
|
+
)
|
|
1321
|
+
),
|
|
1322
|
+
h("nylas-booking-calendar-picker", { calendars: n, currentUser: t, defaultBookingCalendar: s == null ? void 0 : s.email })
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
const 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 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 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);border-radius:var(--nylas-border-radius-2x)}@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);border-radius:var(--nylas-border-radius-2x)}@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 {
|
|
1320
1326
|
constructor(r) {
|
|
1321
1327
|
registerInstance(this, r), this.init = createEvent(this, "init", 7), this.loggedIn = createEvent(this, "loggedIn", 7), this.loggedOut = createEvent(this, "loggedOut", 7), this.schedulerConfigCloseClicked = createEvent(this, "schedulerConfigCloseClicked", 7), this.handleSchedulerConfigCloseClicked = (t) => {
|
|
1322
1328
|
this.schedulerConfigCloseClicked.emit(this.host).defaultPrevented || (localStorage.removeItem("grant"), localStorage.removeItem("user"), window.location.reload());
|
|
1323
|
-
}, 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.additionalParticipants = void 0, this.automaticComponentRegistration = !0;
|
|
1329
|
+
}, 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.additionalParticipants = void 0, this.hideEditorTabs = [], this.conferenceProviders = void 0, this.automaticComponentRegistration = !0;
|
|
1324
1330
|
}
|
|
1325
1331
|
connectedCallback() {
|
|
1326
1332
|
debug("[nylas-scheduler-editor] connectedCallback");
|
|
1327
1333
|
}
|
|
1328
1334
|
async componentWillLoad() {
|
|
1329
|
-
var
|
|
1330
|
-
|
|
1335
|
+
var s, c, a, d, l, u, f, y;
|
|
1336
|
+
debug("[nylas-scheduler-editor] componentWillLoad");
|
|
1337
|
+
const r = (s = this.additionalParticipants) == null ? void 0 : s.filter((g) => {
|
|
1338
|
+
var p;
|
|
1339
|
+
const w = ((p = g.calendars) == null ? void 0 : p.length) > 0 ? g.calendars.filter((S) => S.id && S.name) : [];
|
|
1340
|
+
if (g.name && g.email && w.length > 0)
|
|
1341
|
+
return {
|
|
1342
|
+
name: g.name,
|
|
1343
|
+
email: g.email,
|
|
1344
|
+
calendars: w
|
|
1345
|
+
};
|
|
1346
|
+
});
|
|
1347
|
+
if (this.stores = {
|
|
1331
1348
|
schedulerConfig: CreateNylasSchedulerConfigStore({
|
|
1332
1349
|
...this.defaultSchedulerConfigState,
|
|
1333
|
-
additionalParticipants:
|
|
1350
|
+
additionalParticipants: r,
|
|
1351
|
+
conferenceProviders: this.conferenceProviders,
|
|
1352
|
+
hideEditorTabs: this.hideEditorTabs
|
|
1334
1353
|
})
|
|
1335
1354
|
}, !this.nylasApiRequest && this.nylasSessionsConfig) {
|
|
1336
|
-
const
|
|
1337
|
-
await
|
|
1338
|
-
var
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
}),
|
|
1342
|
-
var
|
|
1343
|
-
(
|
|
1344
|
-
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(
|
|
1355
|
+
const g = new NylasSessions(this.nylasSessionsConfig);
|
|
1356
|
+
await g.isLoggedIn(), g.onLoginSuccess(async () => {
|
|
1357
|
+
var p, S;
|
|
1358
|
+
const w = await ((S = (p = this.nylasSchedulerConfigConnector) == null ? void 0 : p.schedulerConfig) == null ? void 0 : S.currentUser());
|
|
1359
|
+
w && (this.loggedIn.emit(this.host), this.loggedInHandler(w));
|
|
1360
|
+
}), g.onLoginFail(async () => {
|
|
1361
|
+
var w, p;
|
|
1362
|
+
(p = (w = this.stores) == null ? void 0 : w.schedulerConfig) == null || p.set("currentUser", null), this.loggedOut.emit(this.host);
|
|
1363
|
+
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(g);
|
|
1345
1364
|
}
|
|
1346
1365
|
this.nylasApiRequest && this.defaultAuthArgs && this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs), this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
1347
|
-
const
|
|
1366
|
+
const t = this.baseProvider.getStore("schedulerConfig");
|
|
1348
1367
|
if (this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({
|
|
1349
1368
|
nylasApiRequest: this.nylasApiRequest,
|
|
1350
|
-
nylasSchedulerConfigStore:
|
|
1369
|
+
nylasSchedulerConfigStore: t
|
|
1351
1370
|
}), !this.init.emit(this.host).defaultPrevented) {
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1371
|
+
const g = await ((a = (c = this.nylasSchedulerConfigConnector) == null ? void 0 : c.schedulerConfig) == null ? void 0 : a.currentUser());
|
|
1372
|
+
g ? (this.loggedIn.emit(this.host), await this.loggedInHandler(g)) : ((l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || l.set("currentUser", null), this.loggedOut.emit(this.host));
|
|
1354
1373
|
}
|
|
1355
|
-
(
|
|
1356
|
-
|
|
1357
|
-
}), (
|
|
1374
|
+
(f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null || f.onChange("selectedConfiguration", async (g) => {
|
|
1375
|
+
g && g.id && (this.configurationId = g.id);
|
|
1376
|
+
}), (y = this.baseProvider) == null || y.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
1358
1377
|
}
|
|
1359
1378
|
async componentDidLoad() {
|
|
1360
1379
|
var r;
|
|
@@ -1394,8 +1413,8 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1394
1413
|
}
|
|
1395
1414
|
}
|
|
1396
1415
|
render() {
|
|
1397
|
-
var r, t, n, s, c, a, d, l;
|
|
1398
|
-
return h(Host, { key: "
|
|
1416
|
+
var r, t, n, s, c, a, d, l, u, f, y, g, w, p, S, m;
|
|
1417
|
+
return h(Host, { key: "843aa39842caf2c85154b6b70120bf7f66d6e13b" }, h("div", { key: "bb75d22d48ac322be916635dbbb6229b1077db36", class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: "ae180ddc9c742c58e91cfeae59c76129f2b8d4b1", class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: "6f96e2158cccdddbad611fb64fa5d37795a60ee7", width: "18", height: "18" }), "Scheduler editor"), h("button", { key: "f24abc88ac228e1b0c05689cbe9b33560d87a7a5", class: "scheduler-editor-close", title: "logout", onClick: (x) => this.handleSchedulerConfigCloseClicked(x), part: "nse__close-button" }, h("close-icon", { key: "916d5d1c0506995603598e6a56d16586690a509b", 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 && h("div", { class: "list-configurations" }, 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" && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { currentUser: (a = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null ? void 0 : a.state.currentUser, calendars: (u = (l = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null ? void 0 : l.state) == null ? void 0 : u.calendars, selectedConfiguration: (g = (y = (f = this.stores) == null ? void 0 : f.schedulerConfig) == null ? void 0 : y.state) == null ? void 0 : g.selectedConfiguration })), ((p = (w = this.stores) == null ? void 0 : w.schedulerConfig) == null ? void 0 : p.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && h("nylas-editor-tabs", { mode: this.mode }, this.mode === "composable" && h("slot", null)), !((m = (S = this.stores) == null ? void 0 : S.schedulerConfig) != null && m.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl })));
|
|
1399
1418
|
}
|
|
1400
1419
|
get host() {
|
|
1401
1420
|
return getElement(this);
|