@nylas/react 1.3.5 → 1.4.0
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-6e8e4e1e.cjs +1 -0
- package/dist/add-circle-icon_2.entry-dbad9a3b.js +26 -0
- package/dist/archive-icon.entry-21f532af.cjs +1 -0
- package/dist/archive-icon.entry-802f7877.js +16 -0
- package/dist/{arrow-icon.entry-fa9584cf.js → arrow-icon.entry-e3dec626.js} +3 -2
- package/dist/arrow-icon.entry-e9af732a.cjs +1 -0
- package/dist/{bold-icon.entry-ac6a4956.js → bold-icon.entry-0492ff02.js} +3 -2
- package/dist/bold-icon.entry-1a2be28a.cjs +1 -0
- package/dist/button-component_2.entry-f0c7f894.cjs +1 -0
- package/dist/{button-component_2.entry-caf33abf.js → button-component_2.entry-fea9bd3d.js} +10 -9
- package/dist/calendar-agenda-fill-icon_36.entry-70681da2.cjs +6 -0
- package/dist/calendar-agenda-fill-icon_36.entry-c85d6a79.js +4642 -0
- package/dist/calendar-cancel-icon.entry-237b8c9e.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-02015d74.js → calendar-cancel-icon.entry-e7dd5b8f.js} +6 -5
- package/dist/calendar-check-icon_2.entry-a868e0bc.cjs +1 -0
- package/dist/{calendar-check-icon_2.entry-2f7dc236.js → calendar-check-icon_2.entry-c7f47fc8.js} +10 -9
- package/dist/calendar-icon.entry-071eb30d.cjs +1 -0
- package/dist/{calendar-icon.entry-70ac9bd6.js → calendar-icon.entry-324de624.js} +6 -5
- package/dist/checkbox-component.entry-0f9970cc.js +43 -0
- package/dist/checkbox-component.entry-5bcf4b08.cjs +1 -0
- package/dist/checkmark-icon_15.entry-7776e533.cjs +5 -0
- package/dist/checkmark-icon_15.entry-98377585.js +1337 -0
- package/dist/chevron-icon_3.entry-526b4b85.cjs +1 -0
- package/dist/chevron-icon_3.entry-ec66260c.js +148 -0
- package/dist/{clock-icon_4.entry-af5301d7.js → clock-icon_4.entry-4fa47996.js} +19 -18
- package/dist/clock-icon_4.entry-66d15f7c.cjs +1 -0
- package/dist/{constants-f6e79ab7-24392f9e.js → constants-f5ba52b9-40ab2ded.js} +121 -30
- package/dist/constants-f5ba52b9-a0866d2f.cjs +1 -0
- package/dist/customParseFormat-39eacb44-45ade322.cjs +1 -0
- package/dist/customParseFormat-39eacb44-eeffe2bb.js +135 -0
- package/dist/delete-icon.entry-540aa2bb.cjs +1 -0
- package/dist/{delete-icon.entry-00cb3ee8.js → delete-icon.entry-95d01eb8.js} +7 -6
- package/dist/document-refresh-icon.entry-b82d5da8.js +16 -0
- package/dist/document-refresh-icon.entry-c467f082.cjs +1 -0
- package/dist/elements/index.d.ts +11 -0
- package/dist/{feedbackSync-547e51ee-bcaf691c.js → feedbackSync-47d13bb0-5608d680.js} +1 -1
- package/dist/{feedbackSync-547e51ee-9b572309.cjs → feedbackSync-47d13bb0-9f249f33.cjs} +1 -1
- package/dist/folder-icon.entry-4d48c2ee.cjs +1 -0
- package/dist/{folder-icon.entry-60b3eda5.js → folder-icon.entry-cb0dc63d.js} +5 -4
- package/dist/forward-icon.entry-5aa01f53.js +16 -0
- package/dist/forward-icon.entry-d04aaf6d.cjs +1 -0
- package/dist/globe-icon_2.entry-87e29cdf.cjs +1 -0
- package/dist/globe-icon_2.entry-c7ae78cc.js +200 -0
- package/dist/google-logo-icon_6.entry-80a6bfa3.js +1457 -0
- package/dist/google-logo-icon_6.entry-a8b6efc0.cjs +2 -0
- package/dist/google-meet-icon_5.entry-26d667b6.cjs +1 -0
- package/dist/google-meet-icon_5.entry-4e71c83b.js +56 -0
- package/dist/inbox-icon.entry-60a82bfc.cjs +1 -0
- package/dist/inbox-icon.entry-77e4e17b.js +16 -0
- package/dist/index-04630615.js +17580 -0
- package/dist/index-3d1f13d6.cjs +57 -0
- package/dist/index.d.ts +1 -3
- package/dist/{index.es-2d849a15-2d84f7a5.cjs → index.es-1fdb1e36-830a422f.cjs} +6 -6
- package/dist/{index.es-2d849a15-4eb8e180.js → index.es-1fdb1e36-fbdb04fa.js} +818 -804
- package/dist/info-icon_2.entry-34800b66.cjs +1 -0
- package/dist/info-icon_2.entry-3c483f61.js +35 -0
- package/dist/input-component.entry-ea4016fe.js +84 -0
- package/dist/input-component.entry-f7ccf3d6.cjs +1 -0
- package/dist/input-dropdown_2.entry-c7730cf8.js +231 -0
- package/dist/input-dropdown_2.entry-d4024d2f.cjs +1 -0
- package/dist/italic-icon.entry-6e0805ab.js +16 -0
- package/dist/italic-icon.entry-8127c2ee.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-49d6f0e7.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-d749999d.js +187 -0
- package/dist/notebook-store-b61693cd-7a5576e7.js +14 -0
- package/dist/notebook-store-b61693cd-84de36d2.cjs +5 -0
- package/dist/nylas-booked-event-card_12.entry-29337b10.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-3fcfd6f9.js +1418 -0
- package/dist/nylas-call-summary.entry-38aed89a.js +16 -0
- package/dist/nylas-call-summary.entry-e9adcb93.cjs +1 -0
- package/dist/nylas-event-calendar_3.entry-48f656e5.cjs +6 -0
- package/dist/nylas-event-calendar_3.entry-62d1f1f5.js +9693 -0
- package/dist/nylas-form-card.entry-3828ccb1.js +58 -0
- package/dist/nylas-form-card.entry-b900b46e.cjs +1 -0
- package/dist/{nylas-if-state.entry-beef8af6.js → nylas-if-state.entry-2810dcf5.js} +4 -3
- package/dist/nylas-if-state.entry-92af0a51.cjs +1 -0
- package/dist/nylas-key-points.entry-977a6fae.js +29 -0
- package/dist/nylas-key-points.entry-de658637.cjs +1 -0
- package/dist/nylas-login.entry-4a6c11e6.cjs +1 -0
- package/dist/{nylas-login.entry-1661cbd4.js → nylas-login.entry-8101d3d0.js} +4 -3
- package/dist/nylas-provider.entry-b7ac25f5.cjs +1 -0
- package/dist/{nylas-provider.entry-1f140378.js → nylas-provider.entry-c054d68a.js} +6 -5
- package/dist/nylas-scheduler-editor.entry-1538950d.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-f184f72e.js → nylas-scheduler-editor.entry-e35fad5c.js} +530 -272
- package/dist/nylas-scheduling.entry-360b978c.js +439 -0
- package/dist/nylas-scheduling.entry-92351cd2.cjs +1 -0
- package/dist/nylas-transcript.entry-4d973027.cjs +6 -0
- package/dist/nylas-transcript.entry-81e2c821.js +128 -0
- package/dist/nylas-video-player.entry-60268c07.js +39 -0
- package/dist/nylas-video-player.entry-f3c2b073.cjs +1 -0
- package/dist/nylas-video-preview.entry-12e05e4d.cjs +1 -0
- package/dist/nylas-video-preview.entry-320421b6.js +16 -0
- package/dist/{person-icon.entry-f9ca9147.js → person-icon.entry-8533209c.js} +8 -7
- package/dist/person-icon.entry-967ad730.cjs +1 -0
- package/dist/play-icon.entry-15ee8568.js +16 -0
- package/dist/play-icon.entry-7b1fd79d.cjs +1 -0
- package/dist/radio-button-group.entry-24cb342f.cjs +1 -0
- package/dist/radio-button-group.entry-53dcf16c.js +47 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +133 -123
- package/dist/refresh-icon.entry-0486ae54.cjs +1 -0
- package/dist/{refresh-icon.entry-7886041f.js → refresh-icon.entry-f3320971.js} +7 -6
- package/dist/{register-component-677d8d2b-0113766e.js → register-component-504a1cbb-5f986d7f.js} +1 -1
- package/dist/{register-component-677d8d2b-4738af1d.cjs → register-component-504a1cbb-89124fd8.cjs} +1 -1
- package/dist/{reply-all-icon.entry-fdd0058e.js → reply-all-icon.entry-006fd1fb.js} +6 -5
- package/dist/reply-all-icon.entry-2cea1a40.cjs +1 -0
- package/dist/reply-icon.entry-bd252aed.cjs +1 -0
- package/dist/reply-icon.entry-d27166a1.js +16 -0
- package/dist/scheduler-config-store-d6729d8d-4a2defea.cjs +1 -0
- package/dist/{scheduler-config-store-ed4a8dfd-012dcf85.js → scheduler-config-store-d6729d8d-63e34849.js} +4 -1
- package/dist/scheduler-store-baf100ed-5c5d3aa5.cjs +1 -0
- package/dist/scheduler-store-baf100ed-81b183dc.js +533 -0
- package/dist/sent-icon.entry-bf101068.js +16 -0
- package/dist/sent-icon.entry-ee434395.cjs +1 -0
- package/dist/spam-icon.entry-11016b63.cjs +1 -0
- package/dist/spam-icon.entry-5193f9c6.js +16 -0
- package/dist/star-icon.entry-0e269252.cjs +1 -0
- package/dist/{star-icon.entry-501083c1.js → star-icon.entry-9c7449f3.js} +6 -5
- package/dist/stop-icon.entry-2ac11166.js +16 -0
- package/dist/stop-icon.entry-86412c9f.cjs +1 -0
- package/dist/textarea-component.entry-27717409.cjs +1 -0
- package/dist/textarea-component.entry-9df3fa96.js +39 -0
- package/dist/toggle-switch.entry-9623e2b2.cjs +1 -0
- package/dist/toggle-switch.entry-a5ddfad9.js +34 -0
- package/dist/translate-icon.entry-e0617680.cjs +1 -0
- package/dist/{translate-icon.entry-676a4150.js → translate-icon.entry-f22293e6.js} +5 -4
- package/dist/trash-fill-icon.entry-0275f657.cjs +1 -0
- package/dist/trash-fill-icon.entry-2616c5df.js +16 -0
- package/dist/{underline-icon.entry-3513c5ef.js → underline-icon.entry-1110dcb1.js} +5 -4
- package/dist/underline-icon.entry-d54b06ab.cjs +1 -0
- package/dist/warning-icon.entry-6d390ab7.cjs +1 -0
- package/dist/{warning-icon.entry-6e723597.js → warning-icon.entry-9a6e7913.js} +8 -7
- package/package.json +11 -3
- package/dist/add-circle-icon.entry-00c87903.js +0 -15
- package/dist/add-circle-icon.entry-640d2b46.cjs +0 -1
- package/dist/archive-icon.entry-5b209336.cjs +0 -1
- package/dist/archive-icon.entry-e8a39eda.js +0 -15
- package/dist/arrow-icon.entry-a25b7b7e.cjs +0 -1
- package/dist/bold-icon.entry-d837c73d.cjs +0 -1
- package/dist/button-component_2.entry-1471422a.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_53.entry-094bd4b9.cjs +0 -6
- package/dist/calendar-agenda-fill-icon_53.entry-6d7f9c79.js +0 -5757
- package/dist/calendar-cancel-icon.entry-42d3d226.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-45aacd91.cjs +0 -1
- package/dist/calendar-icon.entry-90d67b03.cjs +0 -1
- package/dist/checkbox-component_3.entry-231b2254.cjs +0 -1
- package/dist/checkbox-component_3.entry-7270533c.js +0 -153
- package/dist/chevron-icon_3.entry-3c95cc88.js +0 -147
- package/dist/chevron-icon_3.entry-ead3d4c8.cjs +0 -1
- package/dist/clock-icon_4.entry-b50cce70.cjs +0 -1
- package/dist/close-icon.entry-04008446.cjs +0 -1
- package/dist/close-icon.entry-0a4105c9.js +0 -15
- package/dist/constants-f6e79ab7-23d7236b.cjs +0 -1
- package/dist/copy-icon.entry-312ff230.js +0 -15
- package/dist/copy-icon.entry-74f8ebcd.cjs +0 -1
- package/dist/core-js-38e53e34.cjs +0 -4
- package/dist/core-js-a9d3b6e1.js +0 -3297
- package/dist/delete-icon.entry-b61a6706.cjs +0 -1
- package/dist/document-refresh-icon.entry-1c985b1e.js +0 -15
- package/dist/document-refresh-icon.entry-27ff5cb2.cjs +0 -1
- package/dist/dom-68f08be9.cjs +0 -15
- package/dist/dom-86e17616.js +0 -664
- package/dist/folder-icon.entry-c32a6e15.cjs +0 -1
- package/dist/forward-icon.entry-5f9a7639.js +0 -15
- package/dist/forward-icon.entry-8cd805dc.cjs +0 -1
- package/dist/globe-icon.entry-21a80591.cjs +0 -1
- package/dist/globe-icon.entry-397727e1.js +0 -15
- package/dist/google-logo-icon_4.entry-42e87368.cjs +0 -1
- package/dist/google-logo-icon_4.entry-6ccf8379.js +0 -778
- package/dist/inbox-icon.entry-1e448b4b.js +0 -15
- package/dist/inbox-icon.entry-50605b1d.cjs +0 -1
- package/dist/index-594c8e7b.js +0 -16763
- package/dist/index-cfb93df6.cjs +0 -81
- package/dist/info-icon_2.entry-65e0023f.js +0 -34
- package/dist/info-icon_2.entry-e7b86847.cjs +0 -1
- package/dist/input-color-picker.entry-37d2fb66.js +0 -48
- package/dist/input-color-picker.entry-aabfe638.cjs +0 -1
- package/dist/input-component.entry-51f6da14.cjs +0 -1
- package/dist/input-component.entry-c07d92b1.js +0 -70
- package/dist/input-dropdown_2.entry-20fb0552.cjs +0 -1
- package/dist/input-dropdown_2.entry-90c08f10.js +0 -228
- package/dist/italic-icon.entry-8e5599ff.js +0 -15
- package/dist/italic-icon.entry-ee10a040.cjs +0 -1
- package/dist/multi-select-dropdown.entry-656d2791.cjs +0 -1
- package/dist/multi-select-dropdown.entry-c143becc.js +0 -116
- package/dist/nylas-booked-event-card_12.entry-4974ffe6.js +0 -1332
- package/dist/nylas-booked-event-card_12.entry-669bb872.cjs +0 -1
- package/dist/nylas-form-card.entry-42e718e2.js +0 -57
- package/dist/nylas-form-card.entry-55d3909c.cjs +0 -1
- package/dist/nylas-if-state.entry-4de782b7.cjs +0 -1
- package/dist/nylas-login.entry-d6b80abe.cjs +0 -1
- package/dist/nylas-provider.entry-d5495e1a.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-bebe4e7d.cjs +0 -2
- package/dist/nylas-scheduling.entry-21c04831.cjs +0 -1
- package/dist/nylas-scheduling.entry-c335ad21.js +0 -415
- package/dist/nylas-time-window-picker_2.entry-9e0dd470.js +0 -336
- package/dist/nylas-time-window-picker_2.entry-a2651ee7.cjs +0 -1
- package/dist/person-icon.entry-21946944.cjs +0 -1
- package/dist/play-icon.entry-b27fcb18.cjs +0 -1
- package/dist/play-icon.entry-dbfed5e8.js +0 -15
- package/dist/refresh-icon.entry-9d94a60b.cjs +0 -1
- package/dist/reply-all-icon.entry-f0e0a5c4.cjs +0 -1
- package/dist/reply-icon.entry-0a42fb2c.cjs +0 -1
- package/dist/reply-icon.entry-a8d2b0f8.js +0 -15
- package/dist/scheduler-config-store-ed4a8dfd-a16d5c62.cjs +0 -1
- package/dist/scheduler-store-92eb8804-bc68a43a.js +0 -487
- package/dist/scheduler-store-92eb8804-c3deee73.cjs +0 -1
- package/dist/sent-icon.entry-c3f84a59.cjs +0 -1
- package/dist/sent-icon.entry-e047f087.js +0 -15
- package/dist/spam-icon.entry-55d01416.js +0 -15
- package/dist/spam-icon.entry-671eb165.cjs +0 -1
- package/dist/star-icon.entry-4dcae472.cjs +0 -1
- package/dist/stop-icon.entry-130a28b2.js +0 -15
- package/dist/stop-icon.entry-ed949255.cjs +0 -1
- package/dist/textarea-component.entry-65dd740a.cjs +0 -1
- package/dist/textarea-component.entry-efae9031.js +0 -37
- package/dist/translate-icon.entry-2591baf8.cjs +0 -1
- package/dist/trash-fill-icon.entry-5b373be7.js +0 -15
- package/dist/trash-fill-icon.entry-c411d0e0.cjs +0 -1
- package/dist/underline-icon.entry-6bf14476.cjs +0 -1
- package/dist/warning-icon.entry-719a094d.cjs +0 -1
package/dist/{nylas-scheduler-editor.entry-f184f72e.js → nylas-scheduler-editor.entry-e35fad5c.js}
RENAMED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { p as process,
|
|
5
|
-
import { N as NylasBaseProvider, X as Xr } from "./index.es-
|
|
6
|
-
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-
|
|
7
|
-
import { L as LANGUAGE_CODE, a as LANGUAGE_MAP } from "./constants-
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var pe = (r, t, n) => t in r ? ge(r, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[t] = n;
|
|
3
|
+
var P = (r, t, n) => (pe(r, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { b as dayjs, u as utc, t as timezone, p as process, e as commonjsGlobal, r as registerInstance, c as createEvent, d as debug, N as NylasIdentityRequestWrapper, i as instance, h, H as Host, g as getElement, B as Buffer, F as Fragment, f as dataResponse, j as getCalendarRange } from "./index-04630615.js";
|
|
5
|
+
import { N as NylasBaseProvider, X as Xr } from "./index.es-1fdb1e36-fbdb04fa.js";
|
|
6
|
+
import { C as CreateNylasSchedulerConfigStore } from "./scheduler-config-store-d6729d8d-63e34849.js";
|
|
7
|
+
import { L as LANGUAGE_CODE, a as LANGUAGE_MAP, C as CONFIGURATION_EVENT_TYPE, E as EXPERIMENTAL_FEATURES } from "./constants-f5ba52b9-40ab2ded.js";
|
|
8
8
|
import "react";
|
|
9
|
+
import "react/jsx-runtime";
|
|
9
10
|
import "react-dom";
|
|
11
|
+
dayjs.extend(utc);
|
|
12
|
+
dayjs.extend(timezone);
|
|
10
13
|
class NylasSchedulerConfigAPIConnector {
|
|
11
14
|
constructor({ nylasApiRequest: t, nylasSchedulerConfigStore: n }) {
|
|
12
15
|
this.nylasApiRequest = t, this.nylasSchedulerConfigStore = n;
|
|
@@ -31,44 +34,72 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
31
34
|
}) : (this.nylasSchedulerConfigStore.state.calendars = t.data, dataResponse(t.data));
|
|
32
35
|
}
|
|
33
36
|
async getConfigurationById(t, n = !1) {
|
|
34
|
-
var
|
|
37
|
+
var l;
|
|
35
38
|
if (!this.nylasApiRequest)
|
|
36
39
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
37
40
|
message: "Error fetching configuration: Nylas API Request is not initialized"
|
|
38
41
|
});
|
|
39
42
|
if (!n) {
|
|
40
|
-
const d = this.nylasSchedulerConfigStore.state.configurations.find((
|
|
43
|
+
const d = this.nylasSchedulerConfigStore.state.configurations.find((c) => c.id === t);
|
|
41
44
|
if (d)
|
|
42
45
|
return this.nylasSchedulerConfigStore.state.selectedConfiguration = d, dataResponse(d);
|
|
43
46
|
}
|
|
44
|
-
const [s,
|
|
47
|
+
const [s, a] = await this.nylasApiRequest.request({
|
|
45
48
|
method: "GET",
|
|
46
49
|
path: `scheduling/configurations/${t}`
|
|
47
50
|
});
|
|
48
|
-
return
|
|
49
|
-
message: "Error fetching configuration: " +
|
|
51
|
+
return a ? dataResponse(null, {
|
|
52
|
+
message: "Error fetching configuration: " + a.message
|
|
50
53
|
}) : Xr(s) ? dataResponse(null, {
|
|
51
|
-
message: "Error fetching configuration: " + ((
|
|
54
|
+
message: "Error fetching configuration: " + ((l = s.error) == null ? void 0 : l.message)
|
|
52
55
|
}) : (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
56
|
}
|
|
54
57
|
async getConfigurations(t) {
|
|
55
|
-
var
|
|
58
|
+
var l;
|
|
56
59
|
if (!this.nylasApiRequest)
|
|
57
60
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
58
61
|
message: "Error fetching configurations: Nylas API Request is not initialized"
|
|
59
62
|
});
|
|
60
|
-
const n = 50, [s,
|
|
63
|
+
const n = 50, [s, a] = await this.nylasApiRequest.request({
|
|
61
64
|
method: "GET",
|
|
62
65
|
path: `scheduling/configurations?limit=${n}${t ? `&page_token=${t}` : ""}`
|
|
63
66
|
});
|
|
64
|
-
return
|
|
65
|
-
message: "Error fetching configurations: " +
|
|
67
|
+
return a ? dataResponse(null, {
|
|
68
|
+
message: "Error fetching configurations: " + a.message
|
|
66
69
|
}) : Xr(s) ? dataResponse(null, {
|
|
67
|
-
message: "Error fetching configurations: " + ((
|
|
70
|
+
message: "Error fetching configurations: " + ((l = s.error) == null ? void 0 : l.message)
|
|
68
71
|
}) : (this.nylasSchedulerConfigStore.state.configurations = s.data, this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor = s.next_cursor || null, dataResponse(s.data));
|
|
69
72
|
}
|
|
73
|
+
async getMasterEventById(t) {
|
|
74
|
+
var u, f;
|
|
75
|
+
if (!this.nylasApiRequest)
|
|
76
|
+
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
77
|
+
message: "Error fetching master event: Nylas API Request is not initialized"
|
|
78
|
+
});
|
|
79
|
+
const n = this.nylasSchedulerConfigStore.state.selectedGroupEvent, s = (u = n == null ? void 0 : n.event) == null ? void 0 : u.calendar_id;
|
|
80
|
+
if (!s)
|
|
81
|
+
return console.warn("Calendar ID is not present"), dataResponse(null, {
|
|
82
|
+
message: "Error fetching master event: Calendar ID is not present"
|
|
83
|
+
});
|
|
84
|
+
const a = new URLSearchParams();
|
|
85
|
+
a.append("calendar_id", s);
|
|
86
|
+
const [l, d] = await this.nylasApiRequest.request({
|
|
87
|
+
method: "GET",
|
|
88
|
+
path: `events/${t}?${a.toString()}`
|
|
89
|
+
});
|
|
90
|
+
if (d)
|
|
91
|
+
return dataResponse(null, {
|
|
92
|
+
message: "Error fetching master event: " + d.message
|
|
93
|
+
});
|
|
94
|
+
if (Xr(l))
|
|
95
|
+
return dataResponse(null, {
|
|
96
|
+
message: "Error fetching master event: " + ((f = l.error) == null ? void 0 : f.message)
|
|
97
|
+
});
|
|
98
|
+
const c = this.nylasSchedulerConfigStore.state.masterGroupEvents;
|
|
99
|
+
return c[t] ? this.nylasSchedulerConfigStore.state.masterGroupEvents[t] = l.data : this.nylasSchedulerConfigStore.state.masterGroupEvents = { ...c, [t]: l.data }, dataResponse(l.data);
|
|
100
|
+
}
|
|
70
101
|
async createConfiguration(t) {
|
|
71
|
-
var
|
|
102
|
+
var a;
|
|
72
103
|
if (!this.nylasApiRequest)
|
|
73
104
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
74
105
|
message: "Error creating configuration: Nylas API Request is not initialized"
|
|
@@ -81,11 +112,11 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
81
112
|
return s ? dataResponse(null, {
|
|
82
113
|
message: "Error creating configuration: " + s.message
|
|
83
114
|
}) : Xr(n) ? dataResponse(null, {
|
|
84
|
-
message: "Error creating configuration: " + ((
|
|
115
|
+
message: "Error creating configuration: " + ((a = n.error) == null ? void 0 : a.message)
|
|
85
116
|
}) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = n.data, this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, n.data], dataResponse(n.data));
|
|
86
117
|
}
|
|
87
118
|
async updateConfiguration(t) {
|
|
88
|
-
var
|
|
119
|
+
var a;
|
|
89
120
|
if (!this.nylasApiRequest)
|
|
90
121
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
91
122
|
message: "Error updating configuration: Nylas API Request is not initialized"
|
|
@@ -98,11 +129,11 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
98
129
|
return s ? dataResponse(null, {
|
|
99
130
|
message: "Error updating configuration: " + s.message
|
|
100
131
|
}) : Xr(n) ? dataResponse(null, {
|
|
101
|
-
message: "Error updating configuration: " + ((
|
|
102
|
-
}) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = n.data, this.nylasSchedulerConfigStore.state.configurations.find((
|
|
132
|
+
message: "Error updating configuration: " + ((a = n.error) == null ? void 0 : a.message)
|
|
133
|
+
}) : (this.nylasSchedulerConfigStore.state.selectedConfiguration = n.data, this.nylasSchedulerConfigStore.state.configurations.find((l) => l.id === t.id) ? this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.map((l) => l.id === t.id ? n.data : l) : this.nylasSchedulerConfigStore.state.configurations = [...this.nylasSchedulerConfigStore.state.configurations, n.data], dataResponse(n.data));
|
|
103
134
|
}
|
|
104
135
|
async deleteConfiguration(t) {
|
|
105
|
-
var
|
|
136
|
+
var a, l;
|
|
106
137
|
if (!this.nylasApiRequest)
|
|
107
138
|
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
108
139
|
message: "Error deleting configuration: Nylas API Request is not initialized"
|
|
@@ -114,8 +145,178 @@ class NylasSchedulerConfigAPIConnector {
|
|
|
114
145
|
return s ? dataResponse(null, {
|
|
115
146
|
message: "Error deleting configuration: " + s.message
|
|
116
147
|
}) : Xr(n) ? dataResponse(null, {
|
|
117
|
-
message: "Error deleting configuration: " + ((
|
|
118
|
-
}) : (this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.filter((d) => d.id !== t), ((
|
|
148
|
+
message: "Error deleting configuration: " + ((a = n.error) == null ? void 0 : a.message)
|
|
149
|
+
}) : (this.nylasSchedulerConfigStore.state.configurations = this.nylasSchedulerConfigStore.state.configurations.filter((d) => d.id !== t), ((l = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : l.id) === t && this.nylasSchedulerConfigStore.resetSelectedConfiguration(), dataResponse(n.data));
|
|
150
|
+
}
|
|
151
|
+
async createGroupEvent(t, n) {
|
|
152
|
+
var l;
|
|
153
|
+
if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
|
|
154
|
+
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
155
|
+
message: "Error creating group event: Nylas API Request is not initialized"
|
|
156
|
+
});
|
|
157
|
+
const [s, a] = await this.nylasApiRequest.request({
|
|
158
|
+
method: "POST",
|
|
159
|
+
path: `scheduling/configurations/${n}/group-events`,
|
|
160
|
+
body: t
|
|
161
|
+
});
|
|
162
|
+
return a ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
163
|
+
message: "Error creating group event: " + a.message
|
|
164
|
+
})) : Xr(s) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
165
|
+
message: "Error creating group event: " + ((l = s.error) == null ? void 0 : l.message)
|
|
166
|
+
})) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = s.data, await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(s.data));
|
|
167
|
+
}
|
|
168
|
+
async getGroupEvents(t) {
|
|
169
|
+
var c, u, f;
|
|
170
|
+
if (!this.nylasApiRequest)
|
|
171
|
+
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
172
|
+
message: "Error fetching group events: Nylas API Request is not initialized"
|
|
173
|
+
});
|
|
174
|
+
const n = new URLSearchParams();
|
|
175
|
+
n.append("show_all", "true");
|
|
176
|
+
const s = this.nylasSchedulerConfigStore.state.calendarViewDateRange;
|
|
177
|
+
if (s)
|
|
178
|
+
n.append("start_time", s.start_time), n.append("end_time", s.end_time);
|
|
179
|
+
else {
|
|
180
|
+
const { startTime: p, endTime: g } = getCalendarRange((/* @__PURE__ */ new Date()).toISOString(), "week");
|
|
181
|
+
n.append("start_time", p.toString()), n.append("end_time", g.toString());
|
|
182
|
+
}
|
|
183
|
+
const a = (u = (c = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : c.group_booking) == null ? void 0 : u.calendar_id;
|
|
184
|
+
a && n.append("calendar_id", a);
|
|
185
|
+
const [l, d] = await this.nylasApiRequest.request({
|
|
186
|
+
method: "GET",
|
|
187
|
+
path: `scheduling/configurations/${t}/group-events?${n.toString()}`
|
|
188
|
+
});
|
|
189
|
+
return d ? dataResponse(null, {
|
|
190
|
+
message: "Error fetching group events: " + d.message
|
|
191
|
+
}) : Xr(l) ? dataResponse(null, {
|
|
192
|
+
message: "Error fetching group events: " + ((f = l.error) == null ? void 0 : f.message)
|
|
193
|
+
}) : (this.nylasSchedulerConfigStore.state.groupEvents = l.data, dataResponse(l.data));
|
|
194
|
+
}
|
|
195
|
+
async updateGroupEventById(t, n) {
|
|
196
|
+
var d;
|
|
197
|
+
if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
|
|
198
|
+
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
199
|
+
message: "Error updating group event: Nylas API Request is not initialized"
|
|
200
|
+
});
|
|
201
|
+
const s = t.id;
|
|
202
|
+
delete t.id;
|
|
203
|
+
const [a, l] = await this.nylasApiRequest.request({
|
|
204
|
+
method: "PATCH",
|
|
205
|
+
path: `scheduling/configurations/${n}/group-events/${s}`,
|
|
206
|
+
body: t
|
|
207
|
+
});
|
|
208
|
+
return l ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
209
|
+
message: "Error updating group event: " + l.message
|
|
210
|
+
})) : Xr(a) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
211
|
+
message: "Error updating group event: " + ((d = a.error) == null ? void 0 : d.message)
|
|
212
|
+
})) : (this.nylasSchedulerConfigStore.state.selectedGroupEvent = a.data, await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(a.data));
|
|
213
|
+
}
|
|
214
|
+
async updateGroupEvent(t, n, s) {
|
|
215
|
+
var g, m, y, w, b, x, R, A, k, U, N, O, I, T;
|
|
216
|
+
this.nylasSchedulerConfigStore.state.isLoading = !0;
|
|
217
|
+
const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (g = a == null ? void 0 : a.event) == null ? void 0 : g.master_event_id, d = (m = a == null ? void 0 : a.event) == null ? void 0 : m.id, c = (w = (y = a == null ? void 0 : a.event) == null ? void 0 : y.when) == null ? void 0 : w.start_time, u = (x = (b = a == null ? void 0 : a.group_event_info) == null ? void 0 : b.rrule) == null ? void 0 : x[0], f = u ? u.split(";").filter((S) => !S.startsWith("UNTIL")).join(";") : "", p = c ? dayjs(c * 1e3).subtract(1, "minute").format("YYYYMMDDTHHmmss[Z]") : "";
|
|
218
|
+
if (n === "this")
|
|
219
|
+
return this.updateGroupEventById({
|
|
220
|
+
...t,
|
|
221
|
+
id: d,
|
|
222
|
+
rrule: l ? void 0 : t.rrule
|
|
223
|
+
}, s);
|
|
224
|
+
if (n === "future" && l) {
|
|
225
|
+
const S = await this.createGroupEvent(t, s), v = {
|
|
226
|
+
location: (R = a == null ? void 0 : a.event) == null ? void 0 : R.location,
|
|
227
|
+
conferencing: (A = a == null ? void 0 : a.event) == null ? void 0 : A.conferencing,
|
|
228
|
+
title: (k = a == null ? void 0 : a.event) == null ? void 0 : k.title,
|
|
229
|
+
description: (U = a == null ? void 0 : a.event) == null ? void 0 : U.description,
|
|
230
|
+
capacity: (N = a == null ? void 0 : a.group_event_info) == null ? void 0 : N.capacity,
|
|
231
|
+
calendar_id: (O = a == null ? void 0 : a.event) == null ? void 0 : O.calendar_id,
|
|
232
|
+
rrule: f ? [f + ";UNTIL=" + p] : [`RRULE:FREQ=DAILY;UNTIL=${p}`]
|
|
233
|
+
};
|
|
234
|
+
return await this.updateGroupEventById({
|
|
235
|
+
...v,
|
|
236
|
+
id: l
|
|
237
|
+
}, s), [v, S];
|
|
238
|
+
} else if (n === "all") {
|
|
239
|
+
const S = t == null ? void 0 : t.when, v = (I = a == null ? void 0 : a.event) == null ? void 0 : I.when, L = (T = this.nylasSchedulerConfigStore.state.masterGroupEvents) == null ? void 0 : T[l];
|
|
240
|
+
let _ = L == null ? void 0 : L.when;
|
|
241
|
+
return (S == null ? void 0 : S.start_time) !== (v == null ? void 0 : v.start_time) && (_ = {
|
|
242
|
+
..._,
|
|
243
|
+
start_time: (S == null ? void 0 : S.start_time) || (_ == null ? void 0 : _.start_time)
|
|
244
|
+
}), (S == null ? void 0 : S.end_time) !== (v == null ? void 0 : v.end_time) && (_ = {
|
|
245
|
+
..._,
|
|
246
|
+
end_time: (S == null ? void 0 : S.end_time) || (_ == null ? void 0 : _.end_time)
|
|
247
|
+
}), (S == null ? void 0 : S.start_timezone) !== (v == null ? void 0 : v.start_timezone) && (_ = {
|
|
248
|
+
..._,
|
|
249
|
+
start_timezone: (S == null ? void 0 : S.start_timezone) || (_ == null ? void 0 : _.start_timezone)
|
|
250
|
+
}), (S == null ? void 0 : S.end_timezone) !== (v == null ? void 0 : v.end_timezone) && (_ = {
|
|
251
|
+
..._,
|
|
252
|
+
end_timezone: (S == null ? void 0 : S.end_timezone) || (_ == null ? void 0 : _.end_timezone)
|
|
253
|
+
}), this.updateGroupEventById({
|
|
254
|
+
...t,
|
|
255
|
+
when: _,
|
|
256
|
+
id: l
|
|
257
|
+
}, s);
|
|
258
|
+
}
|
|
259
|
+
throw this.nylasSchedulerConfigStore.state.isLoading = !1, new Error("Invalid option");
|
|
260
|
+
}
|
|
261
|
+
async deleteGroupEvent(t, n, s) {
|
|
262
|
+
var m, y, w, b, x, R, A, k, U, N, O, I;
|
|
263
|
+
this.nylasSchedulerConfigStore.state.isLoading = !0;
|
|
264
|
+
const a = this.nylasSchedulerConfigStore.state.selectedGroupEvent, l = (m = a == null ? void 0 : a.event) == null ? void 0 : m.master_event_id, d = (y = a == null ? void 0 : a.event) == null ? void 0 : y.id, c = (b = (w = a == null ? void 0 : a.event) == null ? void 0 : w.when) == null ? void 0 : b.start_time, u = (R = (x = a == null ? void 0 : a.group_event_info) == null ? void 0 : x.rrule) == null ? void 0 : R[0], f = u ? u.split(";").filter((T) => !T.startsWith("UNTIL")).join(";") : "", p = c ? dayjs(c * 1e3).format("YYYYMMDDTHHmmss[Z]") : "", g = {
|
|
265
|
+
location: (A = a == null ? void 0 : a.event) == null ? void 0 : A.location,
|
|
266
|
+
conferencing: (k = a == null ? void 0 : a.event) == null ? void 0 : k.conferencing,
|
|
267
|
+
title: (U = a == null ? void 0 : a.event) == null ? void 0 : U.title,
|
|
268
|
+
description: (N = a == null ? void 0 : a.event) == null ? void 0 : N.description,
|
|
269
|
+
capacity: (O = a == null ? void 0 : a.group_event_info) == null ? void 0 : O.capacity,
|
|
270
|
+
calendar_id: (I = a == null ? void 0 : a.event) == null ? void 0 : I.calendar_id,
|
|
271
|
+
rrule: f ? [f + ";UNTIL=" + p] : [`RRULE:UNTIL=${p}`]
|
|
272
|
+
};
|
|
273
|
+
if (n === "this" && d)
|
|
274
|
+
return this.deleteGroupEventById(d, s);
|
|
275
|
+
if (n === "future" && l && d)
|
|
276
|
+
return await this.deleteGroupEventById(d, s), await this.updateGroupEventById({
|
|
277
|
+
...g,
|
|
278
|
+
id: l
|
|
279
|
+
}, s);
|
|
280
|
+
if (n === "all" && l)
|
|
281
|
+
return this.deleteGroupEventById(l, s);
|
|
282
|
+
throw this.nylasSchedulerConfigStore.state.isLoading = !1, new Error("Invalid option");
|
|
283
|
+
}
|
|
284
|
+
async deleteGroupEventById(t, n) {
|
|
285
|
+
var c, u, f;
|
|
286
|
+
if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
|
|
287
|
+
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
288
|
+
message: "Error deleting group event: Nylas API Request is not initialized"
|
|
289
|
+
});
|
|
290
|
+
const s = new URLSearchParams(), a = (u = (c = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : c.group_booking) == null ? void 0 : u.calendar_id;
|
|
291
|
+
a && s.append("calendar_id", a);
|
|
292
|
+
const [l, d] = await this.nylasApiRequest.request({
|
|
293
|
+
method: "DELETE",
|
|
294
|
+
path: `scheduling/configurations/${n}/group-events/${t}?calendar_id=${a}`
|
|
295
|
+
});
|
|
296
|
+
return d ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
297
|
+
message: "Error deleting group event: " + d.message
|
|
298
|
+
})) : Xr(l) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
299
|
+
message: "Error deleting group event: " + ((f = l.error) == null ? void 0 : f.message)
|
|
300
|
+
})) : (await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
|
|
301
|
+
}
|
|
302
|
+
async importGroupEvent(t, n) {
|
|
303
|
+
var c, u, f, p, g;
|
|
304
|
+
if (this.nylasSchedulerConfigStore.state.isLoading = !0, !this.nylasApiRequest)
|
|
305
|
+
return console.warn("Nylas API Request is not initialized"), dataResponse(null, {
|
|
306
|
+
message: "Error importing group event: Nylas API Request is not initialized"
|
|
307
|
+
});
|
|
308
|
+
const s = new URLSearchParams(), a = (u = (c = this.nylasSchedulerConfigStore.state.selectedConfiguration) == null ? void 0 : c.group_booking) == null ? void 0 : u.calendar_id;
|
|
309
|
+
a && s.append("calendar_id", a);
|
|
310
|
+
const [l, d] = await this.nylasApiRequest.request({
|
|
311
|
+
method: "POST",
|
|
312
|
+
path: `scheduling/configurations/${n}/import-group-events?${s.toString()}`,
|
|
313
|
+
body: t
|
|
314
|
+
});
|
|
315
|
+
return d ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
316
|
+
message: "Error importing group event: " + d.message
|
|
317
|
+
})) : Xr(l) ? (this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(null, {
|
|
318
|
+
message: "Error importing group event: " + ((f = l.error) == null ? void 0 : f.message)
|
|
319
|
+
})) : (((g = (p = l.data) == null ? void 0 : p.imported_events) == null ? void 0 : g.length) > 0 && await this.getGroupEvents(n), this.nylasSchedulerConfigStore.state.isLoading = !1, dataResponse(l.data));
|
|
119
320
|
}
|
|
120
321
|
}
|
|
121
322
|
class NylasSchedulerConfigConnector {
|
|
@@ -162,7 +363,7 @@ class LocalStorage {
|
|
|
162
363
|
const PKCE_KEY = "pkce", GRANT_KEY = "grant", USER_KEY = "user";
|
|
163
364
|
class Storage {
|
|
164
365
|
constructor(t) {
|
|
165
|
-
|
|
366
|
+
P(this, "Storage", new LocalStorage());
|
|
166
367
|
if (t) {
|
|
167
368
|
this.Storage = t;
|
|
168
369
|
return;
|
|
@@ -200,12 +401,12 @@ class Storage {
|
|
|
200
401
|
async setUserToken(t) {
|
|
201
402
|
const n = await this.getUserTokens();
|
|
202
403
|
if (n)
|
|
203
|
-
if (n.find((
|
|
204
|
-
const
|
|
205
|
-
this.Storage.set(USER_KEY,
|
|
404
|
+
if (n.find((a) => a.sub === t.sub)) {
|
|
405
|
+
const a = n.map((l) => (l.sub === t.sub && (l = t), l));
|
|
406
|
+
this.Storage.set(USER_KEY, a);
|
|
206
407
|
} else {
|
|
207
|
-
const
|
|
208
|
-
this.Storage.set(USER_KEY,
|
|
408
|
+
const a = [...n, t];
|
|
409
|
+
this.Storage.set(USER_KEY, a);
|
|
209
410
|
}
|
|
210
411
|
else
|
|
211
412
|
this.Storage.set(USER_KEY, [t]);
|
|
@@ -213,7 +414,7 @@ class Storage {
|
|
|
213
414
|
// getUserToken is used to retrieve a specific IDToken from storage
|
|
214
415
|
async getUserToken(t = "") {
|
|
215
416
|
const n = await this.Storage.get(USER_KEY);
|
|
216
|
-
return n ? t === "" ? n[0] : n.find((
|
|
417
|
+
return n ? t === "" ? n[0] : n.find((a) => a.sub === t) : null;
|
|
217
418
|
}
|
|
218
419
|
// getUserTokens is used to retrieve all IDTokens from storage
|
|
219
420
|
async getUserTokens() {
|
|
@@ -226,7 +427,7 @@ class Storage {
|
|
|
226
427
|
}
|
|
227
428
|
// removeUserToken is used to remove a specific IDToken from storage
|
|
228
429
|
async removeUserToken(t) {
|
|
229
|
-
const n = await this.getUserTokens(), s = n == null ? void 0 : n.filter((
|
|
430
|
+
const n = await this.getUserTokens(), s = n == null ? void 0 : n.filter((a) => a.sub !== t);
|
|
230
431
|
this.Storage.set(USER_KEY, s);
|
|
231
432
|
}
|
|
232
433
|
async clearSession() {
|
|
@@ -238,59 +439,59 @@ class Storage {
|
|
|
238
439
|
}
|
|
239
440
|
class IndexedDBStorage {
|
|
240
441
|
constructor() {
|
|
241
|
-
|
|
242
|
-
|
|
442
|
+
P(this, "databaseName", "identity-db");
|
|
443
|
+
P(this, "storeName", "identity");
|
|
243
444
|
}
|
|
244
445
|
get(t) {
|
|
245
446
|
const n = this;
|
|
246
|
-
return new Promise((s,
|
|
247
|
-
n.openDatabase().then(function(
|
|
248
|
-
const d =
|
|
447
|
+
return new Promise((s, a) => {
|
|
448
|
+
n.openDatabase().then(function(l) {
|
|
449
|
+
const d = l.transaction(n.storeName, "readwrite"), u = d.objectStore(n.storeName).get(t);
|
|
249
450
|
u.onsuccess = () => {
|
|
250
451
|
s(u.result);
|
|
251
452
|
}, u.onerror = () => {
|
|
252
|
-
|
|
453
|
+
a(u.error);
|
|
253
454
|
}, d.oncomplete = () => {
|
|
254
|
-
|
|
455
|
+
l.close();
|
|
255
456
|
};
|
|
256
457
|
});
|
|
257
458
|
});
|
|
258
459
|
}
|
|
259
460
|
async remove(t) {
|
|
260
461
|
const n = this;
|
|
261
|
-
return new Promise((s,
|
|
262
|
-
const
|
|
263
|
-
|
|
462
|
+
return new Promise((s, a) => {
|
|
463
|
+
const l = indexedDB.open(this.databaseName);
|
|
464
|
+
l.onupgradeneeded = function(d) {
|
|
264
465
|
d.target.result.createObjectStore(n.storeName);
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
const
|
|
269
|
-
|
|
466
|
+
}, l.onerror = () => {
|
|
467
|
+
a(l.error);
|
|
468
|
+
}, l.onsuccess = (d) => {
|
|
469
|
+
const c = d.target.result, u = c.transaction(this.storeName, "readwrite"), p = u.objectStore(this.storeName).delete(t);
|
|
470
|
+
p.onsuccess = () => {
|
|
270
471
|
s(null);
|
|
271
|
-
},
|
|
272
|
-
|
|
472
|
+
}, p.onerror = () => {
|
|
473
|
+
a(p.error);
|
|
273
474
|
}, u.oncomplete = () => {
|
|
274
|
-
|
|
475
|
+
c.close();
|
|
275
476
|
};
|
|
276
477
|
};
|
|
277
478
|
});
|
|
278
479
|
}
|
|
279
480
|
set(t, n) {
|
|
280
|
-
return new Promise((s,
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
},
|
|
481
|
+
return new Promise((s, a) => {
|
|
482
|
+
const l = indexedDB.open(this.databaseName);
|
|
483
|
+
l.onerror = () => {
|
|
484
|
+
a(l.error);
|
|
485
|
+
}, l.onupgradeneeded = (d) => {
|
|
285
486
|
d.target.result.createObjectStore(this.storeName);
|
|
286
|
-
},
|
|
287
|
-
const
|
|
288
|
-
|
|
487
|
+
}, l.onsuccess = (d) => {
|
|
488
|
+
const c = d.target.result, u = c.transaction(this.storeName, "readwrite"), p = u.objectStore(this.storeName).put(n, t);
|
|
489
|
+
p.onsuccess = () => {
|
|
289
490
|
s(n);
|
|
290
|
-
},
|
|
291
|
-
|
|
491
|
+
}, p.onerror = () => {
|
|
492
|
+
a(p.error);
|
|
292
493
|
}, u.oncomplete = () => {
|
|
293
|
-
|
|
494
|
+
c.close();
|
|
294
495
|
};
|
|
295
496
|
};
|
|
296
497
|
});
|
|
@@ -298,13 +499,13 @@ class IndexedDBStorage {
|
|
|
298
499
|
openDatabase() {
|
|
299
500
|
const t = this;
|
|
300
501
|
return new Promise(function(n, s) {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
n(
|
|
306
|
-
},
|
|
307
|
-
s(
|
|
502
|
+
const a = indexedDB.open(t.databaseName, 2);
|
|
503
|
+
a.onupgradeneeded = function(l) {
|
|
504
|
+
l.target.result.createObjectStore(t.storeName);
|
|
505
|
+
}, a.onsuccess = function(l) {
|
|
506
|
+
n(l.target.result);
|
|
507
|
+
}, a.onerror = function(l) {
|
|
508
|
+
s(l.error);
|
|
308
509
|
};
|
|
309
510
|
});
|
|
310
511
|
}
|
|
@@ -395,8 +596,8 @@ var sha256 = { exports: {} };
|
|
|
395
596
|
var t = createOutputMethod("hex", r);
|
|
396
597
|
NODE_JS && (t = nodeWrap(t, r)), t.create = function() {
|
|
397
598
|
return new Sha256(r);
|
|
398
|
-
}, t.update = function(
|
|
399
|
-
return t.create().update(
|
|
599
|
+
}, t.update = function(a) {
|
|
600
|
+
return t.create().update(a);
|
|
400
601
|
};
|
|
401
602
|
for (var n = 0; n < OUTPUT_TYPES.length; ++n) {
|
|
402
603
|
var s = OUTPUT_TYPES[n];
|
|
@@ -418,10 +619,10 @@ var sha256 = { exports: {} };
|
|
|
418
619
|
};
|
|
419
620
|
}, createHmacMethod = function(r) {
|
|
420
621
|
var t = createHmacOutputMethod("hex", r);
|
|
421
|
-
t.create = function(
|
|
422
|
-
return new HmacSha256(
|
|
423
|
-
}, t.update = function(
|
|
424
|
-
return t.create(
|
|
622
|
+
t.create = function(a) {
|
|
623
|
+
return new HmacSha256(a, r);
|
|
624
|
+
}, t.update = function(a, l) {
|
|
625
|
+
return t.create(a).update(l);
|
|
425
626
|
};
|
|
426
627
|
for (var n = 0; n < OUTPUT_TYPES.length; ++n) {
|
|
427
628
|
var s = OUTPUT_TYPES[n];
|
|
@@ -447,14 +648,14 @@ var sha256 = { exports: {} };
|
|
|
447
648
|
throw new Error(ERROR);
|
|
448
649
|
t = !0;
|
|
449
650
|
}
|
|
450
|
-
for (var s,
|
|
451
|
-
if (this.hashed && (this.hashed = !1,
|
|
452
|
-
for (
|
|
453
|
-
l
|
|
651
|
+
for (var s, a = 0, l, d = r.length, c = this.blocks; a < d; ) {
|
|
652
|
+
if (this.hashed && (this.hashed = !1, c[0] = this.block, c[16] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = c[10] = c[11] = c[12] = c[13] = c[14] = c[15] = 0), t)
|
|
653
|
+
for (l = this.start; a < d && l < 64; ++a)
|
|
654
|
+
c[l >> 2] |= r[a] << SHIFT[l++ & 3];
|
|
454
655
|
else
|
|
455
|
-
for (
|
|
456
|
-
s = r.charCodeAt(
|
|
457
|
-
this.lastByteIndex =
|
|
656
|
+
for (l = this.start; a < d && l < 64; ++a)
|
|
657
|
+
s = r.charCodeAt(a), s < 128 ? c[l >> 2] |= s << SHIFT[l++ & 3] : s < 2048 ? (c[l >> 2] |= (192 | s >> 6) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s & 63) << SHIFT[l++ & 3]) : s < 55296 || s >= 57344 ? (c[l >> 2] |= (224 | s >> 12) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s >> 6 & 63) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s & 63) << SHIFT[l++ & 3]) : (s = 65536 + ((s & 1023) << 10 | r.charCodeAt(++a) & 1023), c[l >> 2] |= (240 | s >> 18) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s >> 12 & 63) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s >> 6 & 63) << SHIFT[l++ & 3], c[l >> 2] |= (128 | s & 63) << SHIFT[l++ & 3]);
|
|
658
|
+
this.lastByteIndex = l, this.bytes += l - this.start, l >= 64 ? (this.block = c[16], this.start = l - 64, this.hash(), this.hashed = !0) : this.start = l;
|
|
458
659
|
}
|
|
459
660
|
return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
|
|
460
661
|
}
|
|
@@ -465,19 +666,19 @@ var sha256 = { exports: {} };
|
|
|
465
666
|
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
667
|
}
|
|
467
668
|
}, Sha256.prototype.hash = function() {
|
|
468
|
-
var r = this.h0, t = this.h1, n = this.h2, s = this.h3,
|
|
669
|
+
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = this.blocks, f, p, g, m, y, w, b, x, R, A, k;
|
|
469
670
|
for (f = 16; f < 64; ++f)
|
|
470
|
-
|
|
471
|
-
for (
|
|
472
|
-
this.first ? (this.is224 ? (
|
|
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 +
|
|
671
|
+
y = u[f - 15], p = (y >>> 7 | y << 25) ^ (y >>> 18 | y << 14) ^ y >>> 3, y = u[f - 2], g = (y >>> 17 | y << 15) ^ (y >>> 19 | y << 13) ^ y >>> 10, u[f] = u[f - 16] + p + u[f - 7] + g << 0;
|
|
672
|
+
for (k = t & n, f = 0; f < 64; f += 4)
|
|
673
|
+
this.first ? (this.is224 ? (x = 300032, y = u[0] - 1413257819, c = y - 150054599 << 0, s = y + 24177077 << 0) : (x = 704751109, y = u[0] - 210244248, c = y - 1521486534 << 0, s = y + 143694565 << 0), this.first = !1) : (p = (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10), g = (a >>> 6 | a << 26) ^ (a >>> 11 | a << 21) ^ (a >>> 25 | a << 7), x = r & t, m = x ^ r & n ^ k, b = a & l ^ ~a & d, y = c + g + b + K[f] + u[f], w = p + m, c = s + y << 0, s = y + w << 0), p = (s >>> 2 | s << 30) ^ (s >>> 13 | s << 19) ^ (s >>> 22 | s << 10), g = (c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7), R = s & r, m = R ^ s & t ^ x, b = c & a ^ ~c & l, y = d + g + b + K[f + 1] + u[f + 1], w = p + m, d = n + y << 0, n = y + w << 0, p = (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), A = n & s, m = A ^ n & r ^ R, b = d & c ^ ~d & a, y = l + g + b + K[f + 2] + u[f + 2], w = p + m, l = t + y << 0, t = y + w << 0, p = (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10), g = (l >>> 6 | l << 26) ^ (l >>> 11 | l << 21) ^ (l >>> 25 | l << 7), k = t & n, m = k ^ t & s ^ A, b = l & d ^ ~l & c, y = a + g + b + K[f + 3] + u[f + 3], w = p + m, a = r + y << 0, r = y + w << 0;
|
|
674
|
+
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 + a << 0, this.h5 = this.h5 + l << 0, this.h6 = this.h6 + d << 0, this.h7 = this.h7 + c << 0;
|
|
474
675
|
}, Sha256.prototype.hex = function() {
|
|
475
676
|
this.finalize();
|
|
476
|
-
var r = this.h0, t = this.h1, n = this.h2, s = this.h3,
|
|
477
|
-
return this.is224 || (u += HEX_CHARS[
|
|
677
|
+
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = 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[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] + 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];
|
|
678
|
+
return this.is224 || (u += 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]), u;
|
|
478
679
|
}, Sha256.prototype.toString = Sha256.prototype.hex, Sha256.prototype.digest = function() {
|
|
479
680
|
this.finalize();
|
|
480
|
-
var r = this.h0, t = this.h1, n = this.h2, s = this.h3,
|
|
681
|
+
var r = this.h0, t = this.h1, n = this.h2, s = this.h3, a = this.h4, l = this.h5, d = this.h6, c = this.h7, u = [
|
|
481
682
|
r >> 24 & 255,
|
|
482
683
|
r >> 16 & 255,
|
|
483
684
|
r >> 8 & 255,
|
|
@@ -494,33 +695,33 @@ var sha256 = { exports: {} };
|
|
|
494
695
|
s >> 16 & 255,
|
|
495
696
|
s >> 8 & 255,
|
|
496
697
|
s & 255,
|
|
497
|
-
c >> 24 & 255,
|
|
498
|
-
c >> 16 & 255,
|
|
499
|
-
c >> 8 & 255,
|
|
500
|
-
c & 255,
|
|
501
698
|
a >> 24 & 255,
|
|
502
699
|
a >> 16 & 255,
|
|
503
700
|
a >> 8 & 255,
|
|
504
701
|
a & 255,
|
|
702
|
+
l >> 24 & 255,
|
|
703
|
+
l >> 16 & 255,
|
|
704
|
+
l >> 8 & 255,
|
|
705
|
+
l & 255,
|
|
505
706
|
d >> 24 & 255,
|
|
506
707
|
d >> 16 & 255,
|
|
507
708
|
d >> 8 & 255,
|
|
508
709
|
d & 255
|
|
509
710
|
];
|
|
510
|
-
return this.is224 || u.push(
|
|
711
|
+
return this.is224 || u.push(c >> 24 & 255, c >> 16 & 255, c >> 8 & 255, c & 255), u;
|
|
511
712
|
}, Sha256.prototype.array = Sha256.prototype.digest, Sha256.prototype.arrayBuffer = function() {
|
|
512
713
|
this.finalize();
|
|
513
714
|
var r = new ArrayBuffer(this.is224 ? 28 : 32), t = new DataView(r);
|
|
514
715
|
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;
|
|
515
716
|
};
|
|
516
717
|
function HmacSha256(r, t, n) {
|
|
517
|
-
var s,
|
|
518
|
-
if (
|
|
519
|
-
var
|
|
718
|
+
var s, a = typeof r;
|
|
719
|
+
if (a === "string") {
|
|
720
|
+
var l = [], d = r.length, c = 0, u;
|
|
520
721
|
for (s = 0; s < d; ++s)
|
|
521
|
-
u = r.charCodeAt(s), u < 128 ?
|
|
522
|
-
r =
|
|
523
|
-
} else if (
|
|
722
|
+
u = r.charCodeAt(s), u < 128 ? l[c++] = u : u < 2048 ? (l[c++] = 192 | u >> 6, l[c++] = 128 | u & 63) : u < 55296 || u >= 57344 ? (l[c++] = 224 | u >> 12, l[c++] = 128 | u >> 6 & 63, l[c++] = 128 | u & 63) : (u = 65536 + ((u & 1023) << 10 | r.charCodeAt(++s) & 1023), l[c++] = 240 | u >> 18, l[c++] = 128 | u >> 12 & 63, l[c++] = 128 | u >> 6 & 63, l[c++] = 128 | u & 63);
|
|
723
|
+
r = l;
|
|
724
|
+
} else if (a === "object") {
|
|
524
725
|
if (r === null)
|
|
525
726
|
throw new Error(ERROR);
|
|
526
727
|
if (ARRAY_BUFFER && r.constructor === ArrayBuffer)
|
|
@@ -530,12 +731,12 @@ var sha256 = { exports: {} };
|
|
|
530
731
|
} else
|
|
531
732
|
throw new Error(ERROR);
|
|
532
733
|
r.length > 64 && (r = new Sha256(t, !0).update(r).array());
|
|
533
|
-
var f = [],
|
|
734
|
+
var f = [], p = [];
|
|
534
735
|
for (s = 0; s < 64; ++s) {
|
|
535
736
|
var g = r[s] || 0;
|
|
536
|
-
f[s] = 92 ^ g,
|
|
737
|
+
f[s] = 92 ^ g, p[s] = 54 ^ g;
|
|
537
738
|
}
|
|
538
|
-
Sha256.call(this, t, n), this.update(
|
|
739
|
+
Sha256.call(this, t, n), this.update(p), this.oKeyPad = f, this.inner = !0, this.sharedMemory = n;
|
|
539
740
|
}
|
|
540
741
|
HmacSha256.prototype = new Sha256(), HmacSha256.prototype.finalize = function() {
|
|
541
742
|
if (Sha256.prototype.finalize.call(this), this.inner) {
|
|
@@ -572,8 +773,8 @@ function v4(r, t, n) {
|
|
|
572
773
|
var s = r.random || (r.rng || rng)();
|
|
573
774
|
if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, t) {
|
|
574
775
|
n = n || 0;
|
|
575
|
-
for (var
|
|
576
|
-
t[n +
|
|
776
|
+
for (var a = 0; a < 16; ++a)
|
|
777
|
+
t[n + a] = s[a];
|
|
577
778
|
return t;
|
|
578
779
|
}
|
|
579
780
|
return stringify(s);
|
|
@@ -585,21 +786,21 @@ async function getBytes(r, t) {
|
|
|
585
786
|
t(s.value);
|
|
586
787
|
}
|
|
587
788
|
function getLines(r) {
|
|
588
|
-
let t, n, s,
|
|
789
|
+
let t, n, s, a = !1;
|
|
589
790
|
return function(d) {
|
|
590
791
|
t === void 0 ? (t = d, n = 0, s = -1) : t = concat(t, d);
|
|
591
|
-
const
|
|
792
|
+
const c = t.length;
|
|
592
793
|
let u = 0;
|
|
593
|
-
for (; n <
|
|
594
|
-
|
|
794
|
+
for (; n < c; ) {
|
|
795
|
+
a && (t[n] === 10 && (u = ++n), a = !1);
|
|
595
796
|
let f = -1;
|
|
596
|
-
for (; n <
|
|
797
|
+
for (; n < c && f === -1; ++n)
|
|
597
798
|
switch (t[n]) {
|
|
598
799
|
case 58:
|
|
599
800
|
s === -1 && (s = n - u);
|
|
600
801
|
break;
|
|
601
802
|
case 13:
|
|
602
|
-
|
|
803
|
+
a = !0;
|
|
603
804
|
case 10:
|
|
604
805
|
f = n;
|
|
605
806
|
break;
|
|
@@ -608,30 +809,30 @@ function getLines(r) {
|
|
|
608
809
|
break;
|
|
609
810
|
r(t.subarray(u, f), s), u = n, s = -1;
|
|
610
811
|
}
|
|
611
|
-
u ===
|
|
812
|
+
u === c ? t = void 0 : u !== 0 && (t = t.subarray(u), n -= u);
|
|
612
813
|
};
|
|
613
814
|
}
|
|
614
815
|
function getMessages(r, t, n) {
|
|
615
816
|
let s = newMessage();
|
|
616
|
-
const
|
|
617
|
-
return function(d,
|
|
817
|
+
const a = new TextDecoder();
|
|
818
|
+
return function(d, c) {
|
|
618
819
|
if (d.length === 0)
|
|
619
820
|
n == null || n(s), s = newMessage();
|
|
620
|
-
else if (
|
|
621
|
-
const u =
|
|
821
|
+
else if (c > 0) {
|
|
822
|
+
const u = a.decode(d.subarray(0, c)), f = c + (d[c + 1] === 32 ? 2 : 1), p = a.decode(d.subarray(f));
|
|
622
823
|
switch (u) {
|
|
623
824
|
case "data":
|
|
624
825
|
s.data = s.data ? s.data + `
|
|
625
|
-
` +
|
|
826
|
+
` + p : p;
|
|
626
827
|
break;
|
|
627
828
|
case "event":
|
|
628
|
-
s.event =
|
|
829
|
+
s.event = p;
|
|
629
830
|
break;
|
|
630
831
|
case "id":
|
|
631
|
-
r(s.id =
|
|
832
|
+
r(s.id = p);
|
|
632
833
|
break;
|
|
633
834
|
case "retry":
|
|
634
|
-
const g = parseInt(
|
|
835
|
+
const g = parseInt(p, 10);
|
|
635
836
|
isNaN(g) || t(s.retry = g);
|
|
636
837
|
break;
|
|
637
838
|
}
|
|
@@ -655,50 +856,50 @@ var __rest = function(r, t) {
|
|
|
655
856
|
for (var s in r)
|
|
656
857
|
Object.prototype.hasOwnProperty.call(r, s) && t.indexOf(s) < 0 && (n[s] = r[s]);
|
|
657
858
|
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
658
|
-
for (var
|
|
659
|
-
t.indexOf(s[
|
|
859
|
+
for (var a = 0, s = Object.getOwnPropertySymbols(r); a < s.length; a++)
|
|
860
|
+
t.indexOf(s[a]) < 0 && Object.prototype.propertyIsEnumerable.call(r, s[a]) && (n[s[a]] = r[s[a]]);
|
|
660
861
|
return n;
|
|
661
862
|
};
|
|
662
863
|
const EventStreamContentType = "text/event-stream", DefaultRetryInterval = 1e3, LastEventId = "last-event-id";
|
|
663
864
|
function fetchEventSource(r, t) {
|
|
664
|
-
var { signal: n, headers: s, onopen:
|
|
865
|
+
var { signal: n, headers: s, onopen: a, onmessage: l, onclose: d, onerror: c, openWhenHidden: u, fetch: f } = t, p = __rest(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
665
866
|
return new Promise((g, m) => {
|
|
666
|
-
const
|
|
667
|
-
|
|
867
|
+
const y = Object.assign({}, s);
|
|
868
|
+
y.accept || (y.accept = EventStreamContentType);
|
|
668
869
|
let w;
|
|
669
|
-
function
|
|
670
|
-
w.abort(), document.hidden ||
|
|
870
|
+
function b() {
|
|
871
|
+
w.abort(), document.hidden || N();
|
|
671
872
|
}
|
|
672
|
-
u || document.addEventListener("visibilitychange",
|
|
673
|
-
let
|
|
674
|
-
function
|
|
675
|
-
document.removeEventListener("visibilitychange",
|
|
873
|
+
u || document.addEventListener("visibilitychange", b);
|
|
874
|
+
let x = DefaultRetryInterval, R = 0;
|
|
875
|
+
function A() {
|
|
876
|
+
document.removeEventListener("visibilitychange", b), window.clearTimeout(R), w.abort();
|
|
676
877
|
}
|
|
677
878
|
n == null || n.addEventListener("abort", () => {
|
|
678
|
-
|
|
879
|
+
A(), g();
|
|
679
880
|
});
|
|
680
|
-
const
|
|
681
|
-
async function
|
|
682
|
-
var
|
|
881
|
+
const k = f ?? window.fetch, U = a ?? defaultOnOpen;
|
|
882
|
+
async function N() {
|
|
883
|
+
var O;
|
|
683
884
|
w = new AbortController();
|
|
684
885
|
try {
|
|
685
|
-
const I = await
|
|
686
|
-
await U(I), await getBytes(I.body, getLines(getMessages((
|
|
687
|
-
|
|
688
|
-
}, (
|
|
689
|
-
|
|
690
|
-
},
|
|
886
|
+
const I = await k(r, Object.assign(Object.assign({}, p), { headers: y, signal: w.signal }));
|
|
887
|
+
await U(I), await getBytes(I.body, getLines(getMessages((T) => {
|
|
888
|
+
T ? y[LastEventId] = T : delete y[LastEventId];
|
|
889
|
+
}, (T) => {
|
|
890
|
+
x = T;
|
|
891
|
+
}, l))), d == null || d(), A(), g();
|
|
691
892
|
} catch (I) {
|
|
692
893
|
if (!w.signal.aborted)
|
|
693
894
|
try {
|
|
694
|
-
const
|
|
695
|
-
window.clearTimeout(
|
|
696
|
-
} catch (
|
|
697
|
-
|
|
895
|
+
const T = (O = c == null ? void 0 : c(I)) !== null && O !== void 0 ? O : x;
|
|
896
|
+
window.clearTimeout(R), R = window.setTimeout(N, T);
|
|
897
|
+
} catch (T) {
|
|
898
|
+
A(), m(T);
|
|
698
899
|
}
|
|
699
900
|
}
|
|
700
901
|
}
|
|
701
|
-
|
|
902
|
+
N();
|
|
702
903
|
});
|
|
703
904
|
}
|
|
704
905
|
function defaultOnOpen(r) {
|
|
@@ -720,7 +921,7 @@ var r$1 = typeof window < "u" && window.atob && window.atob.bind(window) || func
|
|
|
720
921
|
var t = String(r).replace(/=+$/, "");
|
|
721
922
|
if (t.length % 4 == 1)
|
|
722
923
|
throw new e("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
723
|
-
for (var n, s,
|
|
924
|
+
for (var n, s, a = 0, l = 0, d = ""; s = t.charAt(l++); ~s && (n = a % 4 ? 64 * n + s : s, a++ % 4) ? d += String.fromCharCode(255 & n >> (-2 * a & 6)) : 0)
|
|
724
925
|
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);
|
|
725
926
|
return d;
|
|
726
927
|
};
|
|
@@ -740,9 +941,9 @@ function t$1(r) {
|
|
|
740
941
|
}
|
|
741
942
|
try {
|
|
742
943
|
return function(n) {
|
|
743
|
-
return decodeURIComponent(r$1(n).replace(/(.)/g, function(s,
|
|
744
|
-
var
|
|
745
|
-
return
|
|
944
|
+
return decodeURIComponent(r$1(n).replace(/(.)/g, function(s, a) {
|
|
945
|
+
var l = a.charCodeAt(0).toString(16).toUpperCase();
|
|
946
|
+
return l.length < 2 && (l = "0" + l), "%" + l;
|
|
746
947
|
}));
|
|
747
948
|
}(t);
|
|
748
949
|
} catch {
|
|
@@ -765,15 +966,15 @@ function o(r, t) {
|
|
|
765
966
|
n$1.prototype = new Error(), n$1.prototype.name = "InvalidTokenError";
|
|
766
967
|
class NylasSessions {
|
|
767
968
|
constructor(t) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
969
|
+
P(this, "clientId");
|
|
970
|
+
P(this, "redirectUri");
|
|
971
|
+
P(this, "accessType", "online");
|
|
972
|
+
P(this, "domain", "http://api.nylas.com");
|
|
973
|
+
P(this, "versioned", !1);
|
|
974
|
+
P(this, "Storage");
|
|
975
|
+
P(this, "hosted", !1);
|
|
976
|
+
P(this, "multiAccount", !1);
|
|
977
|
+
P(this, "loginId", "");
|
|
777
978
|
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
979
|
const n = new IndexedDBStorage();
|
|
779
980
|
this.Storage = new Storage(n);
|
|
@@ -802,10 +1003,10 @@ class NylasSessions {
|
|
|
802
1003
|
return !1;
|
|
803
1004
|
const { id_token: s } = n;
|
|
804
1005
|
try {
|
|
805
|
-
const
|
|
1006
|
+
const a = await fetch(`${this.domain}/connect/tokeninfo?id_token=${s}`, {
|
|
806
1007
|
method: "GET"
|
|
807
1008
|
});
|
|
808
|
-
return !(
|
|
1009
|
+
return !(a.status !== 200 || !(await a.json()).data);
|
|
809
1010
|
} catch {
|
|
810
1011
|
return !1;
|
|
811
1012
|
}
|
|
@@ -834,9 +1035,9 @@ class NylasSessions {
|
|
|
834
1035
|
async generateReauthURL(t, n) {
|
|
835
1036
|
if (!t)
|
|
836
1037
|
throw new Error("Grant ID is required");
|
|
837
|
-
const s = await this.Storage.getUserToken(t),
|
|
838
|
-
let
|
|
839
|
-
return
|
|
1038
|
+
const s = await this.Storage.getUserToken(t), a = await this.getCodeChallege();
|
|
1039
|
+
let l = `${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;
|
|
1040
|
+
return a && (l += `&code_challenge=${a}&code_challenge_method=S256&options=rotate_refresh_token`), s != null && s.provider && (l += `&provider=${s.provider}`), s != null && s.email && (l += `&login_hint=${s.email}`), n && (l += `&scope=${n.join(" ")}`), l;
|
|
840
1041
|
}
|
|
841
1042
|
// Generates UUID code challenge
|
|
842
1043
|
async generateCodeChallenge() {
|
|
@@ -986,10 +1187,10 @@ class NylasSessions {
|
|
|
986
1187
|
async codeExchange(t) {
|
|
987
1188
|
let n = new URLSearchParams(window.location.search);
|
|
988
1189
|
t && (n = new URLSearchParams(t));
|
|
989
|
-
const s = n.get("code"),
|
|
990
|
-
if (
|
|
1190
|
+
const s = n.get("code"), a = n.get("state"), l = n.get("error"), d = n.get("error_description"), c = n.get("error_code");
|
|
1191
|
+
if (l && d && c) {
|
|
991
1192
|
const f = {
|
|
992
|
-
detail: { error:
|
|
1193
|
+
detail: { error: l, error_description: d, error_code: c }
|
|
993
1194
|
};
|
|
994
1195
|
return window.dispatchEvent(new CustomEvent("onLoginFail", f)), window.history.pushState({}, document.title, window.location.pathname), !1;
|
|
995
1196
|
}
|
|
@@ -1014,23 +1215,23 @@ class NylasSessions {
|
|
|
1014
1215
|
})).json();
|
|
1015
1216
|
if (g) {
|
|
1016
1217
|
if (g.error) {
|
|
1017
|
-
const
|
|
1018
|
-
return window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1218
|
+
const y = { detail: g };
|
|
1219
|
+
return window.dispatchEvent(new CustomEvent("onLoginFail", y)), !0;
|
|
1019
1220
|
}
|
|
1020
1221
|
const m = await this.handleCodeExchangeResponse(g);
|
|
1021
1222
|
if (m.valid) {
|
|
1022
|
-
|
|
1023
|
-
const
|
|
1024
|
-
window.dispatchEvent(new CustomEvent("onLoginSuccess",
|
|
1223
|
+
a && (m.data.state = a);
|
|
1224
|
+
const y = { detail: m.data };
|
|
1225
|
+
window.dispatchEvent(new CustomEvent("onLoginSuccess", y)), window.history.pushState({}, document.title, window.location.pathname);
|
|
1025
1226
|
} else {
|
|
1026
|
-
const
|
|
1027
|
-
return window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1227
|
+
const y = { detail: m.data };
|
|
1228
|
+
return window.dispatchEvent(new CustomEvent("onLoginFail", y)), !0;
|
|
1028
1229
|
}
|
|
1029
1230
|
}
|
|
1030
1231
|
return this.Storage.removePKCE(), !0;
|
|
1031
1232
|
} catch (f) {
|
|
1032
|
-
const
|
|
1033
|
-
return window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1233
|
+
const p = { detail: f };
|
|
1234
|
+
return window.dispatchEvent(new CustomEvent("onLoginFail", p)), window.history.pushState({}, document.title, window.location.pathname), !1;
|
|
1034
1235
|
}
|
|
1035
1236
|
}
|
|
1036
1237
|
// Token Exchange for session maintenece
|
|
@@ -1040,7 +1241,7 @@ class NylasSessions {
|
|
|
1040
1241
|
return !1;
|
|
1041
1242
|
const s = n.refresh_token;
|
|
1042
1243
|
try {
|
|
1043
|
-
const
|
|
1244
|
+
const a = {
|
|
1044
1245
|
client_id: this.clientId,
|
|
1045
1246
|
redirect_uri: this.redirectUri,
|
|
1046
1247
|
refresh_token: s,
|
|
@@ -1048,25 +1249,25 @@ class NylasSessions {
|
|
|
1048
1249
|
}, d = await (await fetch(`${this.domain}/connect/token`, {
|
|
1049
1250
|
method: "POST",
|
|
1050
1251
|
headers: new Headers({ "content-type": "application/json" }),
|
|
1051
|
-
body: JSON.stringify(
|
|
1252
|
+
body: JSON.stringify(a)
|
|
1052
1253
|
})).json();
|
|
1053
1254
|
if (d) {
|
|
1054
1255
|
if (d.error) {
|
|
1055
|
-
const
|
|
1056
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1256
|
+
const p = { detail: d };
|
|
1257
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", p)), !0;
|
|
1057
1258
|
}
|
|
1058
|
-
const
|
|
1059
|
-
if (d.expires_in =
|
|
1060
|
-
const
|
|
1061
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1259
|
+
const c = getTimestamp();
|
|
1260
|
+
if (d.expires_in = c + d.expires_in, this.Storage.setGrant(d, this.multiAccount), !await this.validateIDToken(t)) {
|
|
1261
|
+
const p = { detail: d };
|
|
1262
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", p)), !0;
|
|
1062
1263
|
}
|
|
1063
1264
|
const f = { detail: d };
|
|
1064
1265
|
return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess", f)), !0;
|
|
1065
1266
|
}
|
|
1066
1267
|
this.Storage.removePKCE();
|
|
1067
|
-
} catch (
|
|
1068
|
-
const
|
|
1069
|
-
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",
|
|
1268
|
+
} catch (a) {
|
|
1269
|
+
const l = { detail: a };
|
|
1270
|
+
return window.dispatchEvent(new CustomEvent("onTokenRefreshFail", l)), !1;
|
|
1070
1271
|
}
|
|
1071
1272
|
}
|
|
1072
1273
|
// Handles the response of code exchange
|
|
@@ -1078,8 +1279,8 @@ class NylasSessions {
|
|
|
1078
1279
|
};
|
|
1079
1280
|
const s = getTimestamp();
|
|
1080
1281
|
t.expires_in = s + t.expires_in, this.Storage.setGrant(t, this.multiAccount);
|
|
1081
|
-
const
|
|
1082
|
-
return
|
|
1282
|
+
const a = o(t.id_token);
|
|
1283
|
+
return a.status = "authenticated", this.Storage.setUserToken(a), await this.validateIDToken(a.sub) ? {
|
|
1083
1284
|
data: t,
|
|
1084
1285
|
valid: !0
|
|
1085
1286
|
} : {
|
|
@@ -1089,23 +1290,23 @@ class NylasSessions {
|
|
|
1089
1290
|
}
|
|
1090
1291
|
// Regulates POPUP behaivior
|
|
1091
1292
|
async popUp(t) {
|
|
1092
|
-
const
|
|
1293
|
+
const a = window.screenX + (window.outerWidth - 500) / 2, l = window.screenY + (window.outerHeight - 600) / 2.5, d = "uas-popup", c = t, u = window.open(c, d, `width=500,height=600,left=${a},top=${l}`);
|
|
1093
1294
|
if (!u)
|
|
1094
1295
|
return;
|
|
1095
1296
|
const f = setInterval(async () => {
|
|
1096
1297
|
if (u.closed) {
|
|
1097
|
-
const
|
|
1298
|
+
const p = {
|
|
1098
1299
|
detail: { error_description: "OAuth provider window closed" }
|
|
1099
1300
|
};
|
|
1100
|
-
window.dispatchEvent(new CustomEvent("onLoginFail",
|
|
1301
|
+
window.dispatchEvent(new CustomEvent("onLoginFail", p)), f && clearInterval(f);
|
|
1101
1302
|
return;
|
|
1102
1303
|
}
|
|
1103
1304
|
try {
|
|
1104
|
-
const
|
|
1105
|
-
if (!
|
|
1305
|
+
const p = u.location.href.split("?");
|
|
1306
|
+
if (!p[0])
|
|
1106
1307
|
return;
|
|
1107
1308
|
const g = u.location.search;
|
|
1108
|
-
if (u.history.pushState({}, document.title, window.location.pathname),
|
|
1309
|
+
if (u.history.pushState({}, document.title, window.location.pathname), p[0] === this.redirectUri && p.length > 1) {
|
|
1109
1310
|
const m = await this.codeExchange(g);
|
|
1110
1311
|
u.close(), m && location.reload(), f && clearInterval(f);
|
|
1111
1312
|
return;
|
|
@@ -1120,45 +1321,45 @@ class NylasSessions {
|
|
|
1120
1321
|
const n = getTimestamp(), s = await this.Storage.getGrant(t, this.multiAccount);
|
|
1121
1322
|
if (!s)
|
|
1122
1323
|
return null;
|
|
1123
|
-
const { access_token:
|
|
1124
|
-
return d &&
|
|
1324
|
+
const { access_token: a, expires_in: l } = s, d = a;
|
|
1325
|
+
return d && l && l > getTimestamp() && l - n > 30 ? d : (await this.tokenExchange(t), (await this.Storage.getGrant(t, this.multiAccount)).access_token);
|
|
1125
1326
|
}
|
|
1126
1327
|
async sse(t, n) {
|
|
1127
|
-
const s = n.headers || {},
|
|
1128
|
-
let
|
|
1328
|
+
const s = n.headers || {}, a = s["Grant-ID"];
|
|
1329
|
+
let l = "";
|
|
1129
1330
|
if (this.multiAccount) {
|
|
1130
|
-
if (!
|
|
1331
|
+
if (!a)
|
|
1131
1332
|
throw this.logout(), new Error("Grant ID is required for multi account calls");
|
|
1132
|
-
|
|
1333
|
+
l = await this.getAccessToken(a);
|
|
1133
1334
|
} else
|
|
1134
|
-
|
|
1135
|
-
return delete s["Grant-ID"], s.Authorization = `Bearer ${
|
|
1335
|
+
l = await this.getAccessToken();
|
|
1336
|
+
return delete s["Grant-ID"], s.Authorization = `Bearer ${l}`, s["content-type"] || (s["content-type"] = "application/json"), fetchEventSource(`${this.domain}/${t}`, {
|
|
1136
1337
|
...n,
|
|
1137
1338
|
headers: s
|
|
1138
1339
|
});
|
|
1139
1340
|
}
|
|
1140
1341
|
// Used to call Nylas API endpoints
|
|
1141
|
-
async fetch(t, n, s = !0,
|
|
1142
|
-
let
|
|
1342
|
+
async fetch(t, n, s = !0, a) {
|
|
1343
|
+
let l = "", d = 1;
|
|
1143
1344
|
if (this.multiAccount) {
|
|
1144
1345
|
if (!n.grant_id)
|
|
1145
1346
|
throw this.logout(), new Error("Grant ID is required for multi account calls");
|
|
1146
1347
|
const u = await this.getProfiles();
|
|
1147
|
-
d = u ? u.length : 1,
|
|
1348
|
+
d = u ? u.length : 1, l = await this.getAccessToken(n.grant_id);
|
|
1148
1349
|
} else
|
|
1149
|
-
|
|
1150
|
-
if (!
|
|
1350
|
+
l = await this.getAccessToken();
|
|
1351
|
+
if (!l)
|
|
1151
1352
|
throw new Error("Access token not found");
|
|
1152
|
-
let
|
|
1153
|
-
Headers.prototype.isPrototypeOf(
|
|
1154
|
-
Authorization: `Bearer ${
|
|
1353
|
+
let c = n.headers;
|
|
1354
|
+
Headers.prototype.isPrototypeOf(c) ? (c.append("Authorization", `Bearer ${l}`), c.has("content-type") || c.append("content-type", "application/json")) : c = new Headers({
|
|
1355
|
+
Authorization: `Bearer ${l}`,
|
|
1155
1356
|
"content-type": "application/json"
|
|
1156
1357
|
});
|
|
1157
1358
|
try {
|
|
1158
1359
|
n != null && n.body && (n.body = JSON.stringify(n == null ? void 0 : n.body));
|
|
1159
|
-
const u = await fetch(`${
|
|
1360
|
+
const u = await fetch(`${a || this.domain}/${t}`, {
|
|
1160
1361
|
...n,
|
|
1161
|
-
headers:
|
|
1362
|
+
headers: c
|
|
1162
1363
|
});
|
|
1163
1364
|
if (!s)
|
|
1164
1365
|
return u;
|
|
@@ -1187,13 +1388,13 @@ class NylasSessions {
|
|
|
1187
1388
|
throw u;
|
|
1188
1389
|
}
|
|
1189
1390
|
}
|
|
1190
|
-
async fetchRequest(t, n, s,
|
|
1191
|
-
const
|
|
1192
|
-
if (f.append("Accept", "application/json"), f.append("Content-Type", "application/json"), f.append("User-Agent", "nylas-identity"),
|
|
1391
|
+
async fetchRequest(t, n, s, a = !0, l, d) {
|
|
1392
|
+
const c = await this.isLoggedIn(), u = new URL(t, l ?? this.domain), f = new Headers();
|
|
1393
|
+
if (f.append("Accept", "application/json"), f.append("Content-Type", "application/json"), f.append("User-Agent", "nylas-identity"), c) {
|
|
1193
1394
|
const m = await this.getAccessToken();
|
|
1194
1395
|
f.append("Authorization", `Bearer ${m}`);
|
|
1195
1396
|
}
|
|
1196
|
-
const
|
|
1397
|
+
const p = await fetch(u.toString(), {
|
|
1197
1398
|
method: n || "GET",
|
|
1198
1399
|
headers: f,
|
|
1199
1400
|
mode: "cors",
|
|
@@ -1201,7 +1402,7 @@ class NylasSessions {
|
|
|
1201
1402
|
body: s ? JSON.stringify(s) : void 0,
|
|
1202
1403
|
...d || {}
|
|
1203
1404
|
});
|
|
1204
|
-
return
|
|
1405
|
+
return a ? await p.json() : p.body;
|
|
1205
1406
|
}
|
|
1206
1407
|
// Checks if the response is not 401
|
|
1207
1408
|
async isAuthenticatedResponse(t, n) {
|
|
@@ -1303,43 +1504,90 @@ const LoginRequired = ({ authenticationUrl: r }) => h(
|
|
|
1303
1504
|
h("small", { class: "disclaimer-text", part: "nse__login-required-disclaimer-text" }, "* You will be redirected to authenticate your account.")
|
|
1304
1505
|
)
|
|
1305
1506
|
);
|
|
1306
|
-
function ExpressFlow({ currentUser: r, calendars: t }) {
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1507
|
+
function ExpressFlow({ currentUser: r, calendars: t, selectedEventType: n }) {
|
|
1508
|
+
const s = (t == null ? void 0 : t.find((a) => a.is_primary)) || (t == null ? void 0 : t[0]);
|
|
1509
|
+
switch (n) {
|
|
1510
|
+
case CONFIGURATION_EVENT_TYPE.one_on_one:
|
|
1511
|
+
case CONFIGURATION_EVENT_TYPE.max_availability:
|
|
1512
|
+
case CONFIGURATION_EVENT_TYPE.max_fairness:
|
|
1513
|
+
return h(
|
|
1514
|
+
Fragment,
|
|
1515
|
+
null,
|
|
1516
|
+
h(
|
|
1517
|
+
"nylas-event-info",
|
|
1518
|
+
null,
|
|
1519
|
+
h(
|
|
1520
|
+
"div",
|
|
1521
|
+
{ slot: "inputs" },
|
|
1522
|
+
h("nylas-event-title", null),
|
|
1523
|
+
h("nylas-event-duration", null),
|
|
1524
|
+
h("nylas-event-location", { userProvider: r.provider })
|
|
1525
|
+
)
|
|
1526
|
+
),
|
|
1527
|
+
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: s == null ? void 0 : s.id }),
|
|
1528
|
+
h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1529
|
+
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
|
|
1530
|
+
);
|
|
1531
|
+
case CONFIGURATION_EVENT_TYPE.collective:
|
|
1532
|
+
return h(
|
|
1533
|
+
Fragment,
|
|
1534
|
+
null,
|
|
1535
|
+
h(
|
|
1536
|
+
"nylas-event-info",
|
|
1537
|
+
null,
|
|
1538
|
+
h(
|
|
1539
|
+
"div",
|
|
1540
|
+
{ slot: "inputs" },
|
|
1541
|
+
h("nylas-event-title", null),
|
|
1542
|
+
h("nylas-event-duration", null),
|
|
1543
|
+
h("nylas-event-location", { userProvider: r.provider })
|
|
1544
|
+
)
|
|
1545
|
+
),
|
|
1546
|
+
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: s == null ? void 0 : s.id }),
|
|
1547
|
+
h("nylas-scheduling-method", { exportparts: "nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content" }),
|
|
1548
|
+
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" }),
|
|
1549
|
+
h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" })
|
|
1550
|
+
);
|
|
1551
|
+
case CONFIGURATION_EVENT_TYPE.group:
|
|
1552
|
+
return h(
|
|
1553
|
+
Fragment,
|
|
1554
|
+
null,
|
|
1555
|
+
h(
|
|
1556
|
+
"nylas-event-info",
|
|
1557
|
+
null,
|
|
1558
|
+
h(
|
|
1559
|
+
"div",
|
|
1560
|
+
{ slot: "inputs" },
|
|
1561
|
+
h("nylas-event-title", null),
|
|
1562
|
+
h("nylas-event-description", { hideAutoPopulateButton: !0 }),
|
|
1563
|
+
h("nylas-event-location", { userProvider: r.provider }),
|
|
1564
|
+
h("nylas-event-timeslot", { name: "event-timeslot" }),
|
|
1565
|
+
h("nylas-event-capacity", null)
|
|
1566
|
+
)
|
|
1567
|
+
),
|
|
1568
|
+
h("nylas-booking-calendar-picker", { expressFlow: !0, calendars: t, currentUser: r, defaultBookingCalendar: s == null ? void 0 : s.id }),
|
|
1569
|
+
h("nylas-additional-participants", { name: "participants", eventParticipants: [{ name: (r == null ? void 0 : r.name) || (r == null ? void 0 : r.email), email: (r == null ? void 0 : r.email) || "", is_organizer: !0 }], exportparts: "nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant" }),
|
|
1570
|
+
h("nylas-page-name", { pageName: "Group events page" }),
|
|
1571
|
+
h("nylas-custom-event-slug", { name: "custom-event-slug", exportparts: "nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield" })
|
|
1572
|
+
);
|
|
1573
|
+
}
|
|
1326
1574
|
}
|
|
1327
|
-
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:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:610px}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}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}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-editor-tabs{width:auto;height:inherit}nylas-editor-tabs .composable{height:inherit;overflow: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:inherit;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:16px;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:16px;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:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}', NylasSchedulerEditorStyle0 = nylasSchedulerEditorCss, NylasSchedulerEditor = class {
|
|
1575
|
+
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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:610px}div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:auto}}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content--group{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content--group{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);min-width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}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);background-color:transparent}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-select-event-type{height:inherit;width:calc(924px + 2rem)}@media screen and (max-width: 768px){nylas-select-event-type{width:auto}}nylas-editor-tabs,nylas-editor-tabs-group{width:auto;height:inherit}nylas-editor-tabs .row,nylas-editor-tabs-group .row{display:flex;gap:1rem}nylas-editor-tabs .composable,nylas-editor-tabs-group .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs],nylas-editor-tabs-group nylas-event-info div[slot=inputs],nylas-editor-tabs-group 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:inherit;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:16px;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:16px;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:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}', NylasSchedulerEditorStyle0 = nylasSchedulerEditorCss, NylasSchedulerEditor = class {
|
|
1328
1576
|
constructor(r) {
|
|
1329
1577
|
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) => {
|
|
1330
1578
|
const n = this.schedulerConfigCloseClicked.emit(this.host);
|
|
1331
1579
|
"schedulerConfigCloseClicked" in this.eventOverrides && this.eventOverrides.schedulerConfigCloseClicked(n, this.nylasSchedulerConfigConnector), n.defaultPrevented || (localStorage.removeItem("grant"), localStorage.removeItem("user"), window.location.reload());
|
|
1332
|
-
}, 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.requiresSlug = !1, this.enableUserFeedback = !0, this.defaultLanguage = void 0, this.localization = void 0, this.nylasBranding = !0, this.automaticComponentRegistration = !0, this.selectedLanguage = this.defaultLanguage || LANGUAGE_CODE.en;
|
|
1580
|
+
}, 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.requiresSlug = !1, this.enableUserFeedback = !0, this.defaultLanguage = void 0, this.localization = void 0, this.nylasBranding = !0, this.experimentalFeatures = void 0, this.automaticComponentRegistration = !0, this.selectedLanguage = this.defaultLanguage || LANGUAGE_CODE.en, this.langVersion = 0;
|
|
1333
1581
|
}
|
|
1334
1582
|
connectedCallback() {
|
|
1335
1583
|
debug("[nylas-scheduler-editor] connectedCallback");
|
|
1336
1584
|
}
|
|
1337
1585
|
async componentWillLoad() {
|
|
1338
|
-
var s,
|
|
1586
|
+
var s, a, l, d, c, u, f, p;
|
|
1339
1587
|
debug("[nylas-scheduler-editor] componentWillLoad");
|
|
1340
1588
|
const r = (s = this.additionalParticipants) == null ? void 0 : s.filter((g) => {
|
|
1341
|
-
var
|
|
1342
|
-
const m = ((
|
|
1589
|
+
var y;
|
|
1590
|
+
const m = ((y = g.calendars) == null ? void 0 : y.length) > 0 ? g.calendars.filter((w) => w.id && w.name) : [];
|
|
1343
1591
|
if (g.name && g.email && m.length > 0)
|
|
1344
1592
|
return {
|
|
1345
1593
|
name: g.name,
|
|
@@ -1354,20 +1602,21 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1354
1602
|
conferenceProviders: this.conferenceProviders,
|
|
1355
1603
|
requiresSlug: this.requiresSlug,
|
|
1356
1604
|
selectedLanguage: this.defaultLanguage || LANGUAGE_CODE.en,
|
|
1357
|
-
nylasBranding: this.nylasBranding
|
|
1605
|
+
nylasBranding: this.nylasBranding,
|
|
1606
|
+
experimentalFeatures: this.experimentalFeatures
|
|
1358
1607
|
})
|
|
1359
1608
|
}, !this.nylasApiRequest && this.nylasSessionsConfig) {
|
|
1360
1609
|
const g = new NylasSessions(this.nylasSessionsConfig);
|
|
1361
1610
|
await g.isLoggedIn(), g.onLoginSuccess(async () => {
|
|
1362
|
-
var
|
|
1363
|
-
const m = await ((w = (
|
|
1611
|
+
var y, w;
|
|
1612
|
+
const m = await ((w = (y = this.nylasSchedulerConfigConnector) == null ? void 0 : y.schedulerConfig) == null ? void 0 : w.currentUser());
|
|
1364
1613
|
if (m) {
|
|
1365
|
-
const
|
|
1366
|
-
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(
|
|
1614
|
+
const b = this.loggedIn.emit(this.host);
|
|
1615
|
+
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(b, this.nylasSchedulerConfigConnector), b.defaultPrevented || await this.loggedInHandler(m);
|
|
1367
1616
|
}
|
|
1368
1617
|
}), g.onLoginFail(async () => {
|
|
1369
|
-
var
|
|
1370
|
-
(w = (
|
|
1618
|
+
var y, w;
|
|
1619
|
+
(w = (y = this.stores) == null ? void 0 : y.schedulerConfig) == null || w.set("currentUser", null);
|
|
1371
1620
|
const m = this.loggedOut.emit(this.host);
|
|
1372
1621
|
"loggedOut" in this.eventOverrides && (await this.eventOverrides.loggedOut(m, this.nylasSchedulerConfigConnector), m.defaultPrevented);
|
|
1373
1622
|
}), this.nylasApiRequest = new NylasIdentityRequestWrapper(g);
|
|
@@ -1380,12 +1629,12 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1380
1629
|
});
|
|
1381
1630
|
const n = this.init.emit(this.host);
|
|
1382
1631
|
if ("init" in this.eventOverrides && await this.eventOverrides.init(n, this.nylasSchedulerConfigConnector), !n.defaultPrevented) {
|
|
1383
|
-
const g = await ((
|
|
1632
|
+
const g = await ((l = (a = this.nylasSchedulerConfigConnector) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.currentUser());
|
|
1384
1633
|
if (g) {
|
|
1385
1634
|
const m = this.loggedIn.emit(this.host);
|
|
1386
1635
|
"loggedIn" in this.eventOverrides && await this.eventOverrides.loggedIn(m, this.nylasSchedulerConfigConnector), m.defaultPrevented || await this.loggedInHandler(g);
|
|
1387
1636
|
} else {
|
|
1388
|
-
(
|
|
1637
|
+
(c = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || c.set("currentUser", null);
|
|
1389
1638
|
const m = this.loggedOut.emit(this.host);
|
|
1390
1639
|
if ("loggedOut" in this.eventOverrides && (await this.eventOverrides.loggedOut(m, this.nylasSchedulerConfigConnector), m.defaultPrevented))
|
|
1391
1640
|
return;
|
|
@@ -1393,7 +1642,7 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1393
1642
|
}
|
|
1394
1643
|
(f = (u = this.stores) == null ? void 0 : u.schedulerConfig) == null || f.onChange("selectedConfiguration", async (g) => {
|
|
1395
1644
|
g && g.id && (this.configurationId = g.id);
|
|
1396
|
-
}), (
|
|
1645
|
+
}), (p = this.baseProvider) == null || p.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
1397
1646
|
}
|
|
1398
1647
|
async componentDidLoad() {
|
|
1399
1648
|
var r;
|
|
@@ -1404,18 +1653,22 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1404
1653
|
await ((r = this.baseProvider) == null ? void 0 : r.componentDisconnected());
|
|
1405
1654
|
}
|
|
1406
1655
|
async configurationIdChanged(r) {
|
|
1407
|
-
var t, n, s,
|
|
1408
|
-
r ? (await ((n = (t = this.nylasSchedulerConfigConnector) == null ? void 0 : t.schedulerConfig) == null ? void 0 : n.getConfigurationById(r)), (
|
|
1656
|
+
var t, n, s, a, l, d, c, u;
|
|
1657
|
+
r ? (await ((n = (t = this.nylasSchedulerConfigConnector) == null ? void 0 : t.schedulerConfig) == null ? void 0 : n.getConfigurationById(r)), (a = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null || a.set("action", "edit")) : ((d = (l = this.stores) == null ? void 0 : l.schedulerConfig) == null || d.set("selectedConfiguration", {}), (u = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null || u.set("action", null));
|
|
1409
1658
|
}
|
|
1410
1659
|
updateLocalization(r) {
|
|
1411
|
-
r && Object.keys(r).forEach((t) => {
|
|
1660
|
+
r && (Object.keys(r).forEach((t) => {
|
|
1412
1661
|
t in LANGUAGE_CODE && instance.addResourceBundle(t, "translation", r[t], !1, !0);
|
|
1413
|
-
});
|
|
1662
|
+
}), this.langVersion++);
|
|
1414
1663
|
}
|
|
1415
1664
|
updateNylasBranding(r) {
|
|
1416
1665
|
var t, n;
|
|
1417
1666
|
(n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("nylasBranding", r);
|
|
1418
1667
|
}
|
|
1668
|
+
updateExperimentalFeatures(r) {
|
|
1669
|
+
var t, n;
|
|
1670
|
+
(n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("experimentalFeatures", r);
|
|
1671
|
+
}
|
|
1419
1672
|
async store() {
|
|
1420
1673
|
var r;
|
|
1421
1674
|
return (r = this.stores) == null ? void 0 : r.schedulerConfig;
|
|
@@ -1432,26 +1685,30 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1432
1685
|
(t = this.baseProvider) == null || t.unregisterComponent(r.detail);
|
|
1433
1686
|
}
|
|
1434
1687
|
nylasFormDropdownChangedHandler(r) {
|
|
1435
|
-
var s,
|
|
1688
|
+
var s, a;
|
|
1436
1689
|
const { name: t, value: n } = r.detail;
|
|
1437
|
-
t === "language" && (this.selectedLanguage = LANGUAGE_CODE[n], instance.changeLanguage(this.selectedLanguage), (
|
|
1690
|
+
t === "language" && (this.selectedLanguage = LANGUAGE_CODE[n], instance.changeLanguage(this.selectedLanguage), (a = (s = this.stores) == null ? void 0 : s.schedulerConfig) == null || a.set("selectedLanguage", this.selectedLanguage));
|
|
1438
1691
|
}
|
|
1439
1692
|
async loggedInHandler(r) {
|
|
1440
|
-
var t, n, s,
|
|
1693
|
+
var t, n, s, a, l, d, c;
|
|
1441
1694
|
if ((n = (t = this.stores) == null ? void 0 : t.schedulerConfig) == null || n.set("currentUser", r), !!this.nylasSchedulerConfigConnector && (await ((s = this.nylasSchedulerConfigConnector.schedulerConfig) == null ? void 0 : s.getCalendars()), this.configurationId)) {
|
|
1442
|
-
const u = await ((
|
|
1443
|
-
u && ((
|
|
1695
|
+
const u = await ((a = this.nylasSchedulerConfigConnector.schedulerConfig) == null ? void 0 : a.getConfigurationById(this.configurationId));
|
|
1696
|
+
u && ((l = u[0]) != null && l.id) && ((c = (d = this.stores) == null ? void 0 : d.schedulerConfig) == null || c.set("action", "edit"));
|
|
1444
1697
|
}
|
|
1445
1698
|
}
|
|
1446
1699
|
render() {
|
|
1447
|
-
var
|
|
1448
|
-
const r = this.host.querySelector('[slot="custom-page-style-inputs"]'), t = (
|
|
1449
|
-
label: LANGUAGE_MAP[
|
|
1450
|
-
value:
|
|
1451
|
-
}));
|
|
1452
|
-
return h(Host, { key: "
|
|
1700
|
+
var a, l, d, c, u, f, p, g, m, y, w, b, x, R, A, k, U, N, O, I, T, S, v, L, _, X, $, j, z, Y, M, V, J, W, Z, Q, ee, te, ne, se, re, ie, oe, ae, le, ce, de, he, ue, fe;
|
|
1701
|
+
const r = this.host.querySelector('[slot="custom-page-style-inputs"]'), t = (d = (l = (a = this.stores) == null ? void 0 : a.schedulerConfig) == null ? void 0 : l.state.selectedConfiguration) == null ? void 0 : d.id, n = Object.keys(LANGUAGE_MAP).map((q) => ({
|
|
1702
|
+
label: LANGUAGE_MAP[q],
|
|
1703
|
+
value: q
|
|
1704
|
+
})), s = ((u = (c = this.stores) == null ? void 0 : c.schedulerConfig) == null ? void 0 : u.state.selectedEventType) === CONFIGURATION_EVENT_TYPE.group || ((g = (p = (f = this.stores) == null ? void 0 : f.schedulerConfig) == null ? void 0 : p.state.selectedConfiguration) == null ? void 0 : g.type) === CONFIGURATION_EVENT_TYPE.group;
|
|
1705
|
+
return h(Host, { key: "0053ea345fb1297974b68e859adc7caf738f0f35" }, h("div", { key: "e3059c866be7f1d804b451fb54e01a5c219019b1", class: "scheduler-editor-header", part: "nse__header" }, h("h1", { key: "56712052dd6fe1b8ff8a428c8ad3f0f491beac23", class: "scheduler-editor-title", part: "nse__title" }, h("calendar-icon", { key: "dfe74ae46374c05c480b419124ba2055606b400a", width: "18", height: "18" }), instance.t("schedulerEditorTitle")), h("div", { key: "f4ba96f86e1e6e79d720273e0808d87528d74fc1", class: {
|
|
1453
1706
|
language: !0
|
|
1454
|
-
}, part: "nse__language" }, h("select-dropdown", { key: "
|
|
1707
|
+
}, part: "nse__language" }, h("select-dropdown", { key: "3bfe4634f550553f0e2002aa5fec9b39b1cd9e75", name: "language", options: n, withChevron: !1, defaultSelectedOption: n.find((q) => q.value == this.selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { key: "9926723981f56a7606ff94f213215e93bf51c472", slot: "select-icon" }, h("translate-icon", { key: "d22a01ac1cef04ff5f2015c2cc73932c6fd7885c", width: "20", height: "20" })))), h("button", { key: "8f256e2b3978b33a0887bd3af8c987ab2b6b5782", class: "scheduler-editor-close", title: "logout", onClick: (q) => this.handleSchedulerConfigCloseClicked(q), part: "nse__close-button" }, h("close-icon", { key: "acd07b2fc1509f11440f4ad5047d20b3693e0750", width: "18", height: "18" }))), h("div", { key: "d39be68578574cbba4993ca63d2a8f087cecff04", class: {
|
|
1708
|
+
"scheduler-editor-content": !0,
|
|
1709
|
+
"scheduler-editor-content--group_feature_enabled": !!((w = (y = (m = this.stores) == null ? void 0 : m.schedulerConfig) == null ? void 0 : y.state.experimentalFeatures) != null && w[EXPERIMENTAL_FEATURES.group_events]),
|
|
1710
|
+
"scheduler-editor-content--group": s
|
|
1711
|
+
}, part: "nse__content" }, ((x = (b = this.stores) == null ? void 0 : b.schedulerConfig) == null ? void 0 : x.state.currentUser) && this.stores.schedulerConfig.state.action === null && h("div", { class: "list-configurations", part: "nse__list-configurations" }, h("nylas-list-configurations", { exportparts: "nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete" })), ((A = (R = this.stores) == null ? void 0 : R.schedulerConfig) == null ? void 0 : A.state.currentUser) && this.stores.schedulerConfig.state.action === "create-select" && ((N = (U = (k = this.stores) == null ? void 0 : k.schedulerConfig) == null ? void 0 : U.state.experimentalFeatures) == null ? void 0 : N[EXPERIMENTAL_FEATURES.group_events]) && h("nylas-select-event-type", null), ((I = (O = this.stores) == null ? void 0 : O.schedulerConfig) == null ? void 0 : I.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && s && h("nylas-editor-tabs-group", { mode: "composable" }, h(ExpressFlow, { selectedEventType: ((v = (S = (T = this.stores) == null ? void 0 : T.schedulerConfig) == null ? void 0 : S.state) == null ? void 0 : v.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (_ = (L = this.stores) == null ? void 0 : L.schedulerConfig) == null ? void 0 : _.state.currentUser, calendars: (j = ($ = (X = this.stores) == null ? void 0 : X.schedulerConfig) == null ? void 0 : $.state) == null ? void 0 : j.calendars, selectedConfiguration: (M = (Y = (z = this.stores) == null ? void 0 : z.schedulerConfig) == null ? void 0 : Y.state) == null ? void 0 : M.selectedConfiguration })), ((J = (V = this.stores) == null ? void 0 : V.schedulerConfig) == null ? void 0 : J.state.currentUser) && this.stores.schedulerConfig.state.action === "create" && !s && h("nylas-editor-tabs", { mode: "composable" }, h(ExpressFlow, { selectedEventType: ((Q = (Z = (W = this.stores) == null ? void 0 : W.schedulerConfig) == null ? void 0 : Z.state) == null ? void 0 : Q.selectedEventType) || CONFIGURATION_EVENT_TYPE.one_on_one, currentUser: (te = (ee = this.stores) == null ? void 0 : ee.schedulerConfig) == null ? void 0 : te.state.currentUser, calendars: (re = (se = (ne = this.stores) == null ? void 0 : ne.schedulerConfig) == null ? void 0 : se.state) == null ? void 0 : re.calendars, selectedConfiguration: (ae = (oe = (ie = this.stores) == null ? void 0 : ie.schedulerConfig) == null ? void 0 : oe.state) == null ? void 0 : ae.selectedConfiguration })), ((ce = (le = this.stores) == null ? void 0 : le.schedulerConfig) == null ? void 0 : ce.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && s && h("nylas-editor-tabs-group", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), ((he = (de = this.stores) == null ? void 0 : de.schedulerConfig) == null ? void 0 : he.state.currentUser) && this.stores.schedulerConfig.state.action === "edit" && !s && h("nylas-editor-tabs", { key: t, mode: this.mode }, this.mode === "composable" && h("slot", null), this.mode === "app" && r && h("div", { style: { display: "none" }, slot: "custom-page-style-inputs", key: t }, h("slot", { name: "custom-page-style-inputs" }))), !((fe = (ue = this.stores) == null ? void 0 : ue.schedulerConfig) != null && fe.state.currentUser) && h("slot", { name: "login-required" }, h(LoginRequired, { authenticationUrl: this.authenticationUrl }))));
|
|
1455
1712
|
}
|
|
1456
1713
|
get host() {
|
|
1457
1714
|
return getElement(this);
|
|
@@ -1460,7 +1717,8 @@ const nylasSchedulerEditorCss = ':host{display:flex;flex-direction:column;overfl
|
|
|
1460
1717
|
return {
|
|
1461
1718
|
configurationId: ["configurationIdChanged"],
|
|
1462
1719
|
localization: ["updateLocalization"],
|
|
1463
|
-
nylasBranding: ["updateNylasBranding"]
|
|
1720
|
+
nylasBranding: ["updateNylasBranding"],
|
|
1721
|
+
experimentalFeatures: ["updateExperimentalFeatures"]
|
|
1464
1722
|
};
|
|
1465
1723
|
}
|
|
1466
1724
|
};
|