@nylas/react 1.3.1 → 1.3.2
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.entry-d8358e3f.js → add-circle-icon.entry-0ea05c5b.js} +1 -1
- package/dist/{add-circle-icon.entry-606d3096.cjs → add-circle-icon.entry-10f2c319.cjs} +1 -1
- package/dist/{archive-icon.entry-e8ce8c7d.cjs → archive-icon.entry-7eeea6f4.cjs} +1 -1
- package/dist/{archive-icon.entry-8c6d31f2.js → archive-icon.entry-a0af58f2.js} +1 -1
- package/dist/{arrow-icon.entry-d950ddce.js → arrow-icon.entry-7fd7c18e.js} +1 -1
- package/dist/{arrow-icon.entry-13d23d01.cjs → arrow-icon.entry-954f2ba8.cjs} +1 -1
- package/dist/{bold-icon.entry-5382fea2.js → bold-icon.entry-690ecac8.js} +1 -1
- package/dist/{bold-icon.entry-12072568.cjs → bold-icon.entry-e970c498.cjs} +1 -1
- package/dist/{button-component_2.entry-4aa63891.js → button-component_2.entry-b57d03fc.js} +1 -1
- package/dist/{button-component_2.entry-d34ed360.cjs → button-component_2.entry-b7d39903.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_54.entry-50c9ed7b.js → calendar-agenda-fill-icon_53.entry-7792b45c.js} +432 -442
- package/dist/calendar-agenda-fill-icon_53.entry-89e5ac45.cjs +9 -0
- package/dist/{calendar-cancel-icon.entry-64ea7038.js → calendar-cancel-icon.entry-5757c056.js} +1 -1
- package/dist/{calendar-cancel-icon.entry-b13aa245.cjs → calendar-cancel-icon.entry-8cd02237.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-9cbe60a8.cjs → calendar-check-icon_2.entry-4f59d206.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-935310fc.js → calendar-check-icon_2.entry-6864b9d5.js} +1 -1
- package/dist/{calendar-icon.entry-0c560a35.cjs → calendar-icon.entry-0b1edb49.cjs} +1 -1
- package/dist/{calendar-icon.entry-2448eea2.js → calendar-icon.entry-3798880d.js} +1 -1
- package/dist/checkbox-component_3.entry-10293364.cjs +1 -0
- package/dist/checkbox-component_3.entry-3d9fa7b5.js +140 -0
- package/dist/{chevron-icon_3.entry-1f72ef71.js → chevron-icon_3.entry-43e83594.js} +11 -11
- package/dist/{chevron-icon_3.entry-da1751d2.cjs → chevron-icon_3.entry-a5175d87.cjs} +1 -1
- package/dist/{clock-icon_4.entry-4502c9f0.js → clock-icon_4.entry-219733d8.js} +1 -1
- package/dist/{clock-icon_4.entry-b87aaaa9.cjs → clock-icon_4.entry-76751b46.cjs} +1 -1
- package/dist/{close-icon.entry-e96749ed.js → close-icon.entry-286fc5ca.js} +1 -1
- package/dist/{close-icon.entry-92e93293.cjs → close-icon.entry-cecd3cdd.cjs} +1 -1
- package/dist/{constants-24eca8c9-922dc05c.js → constants-54af2051-767e8462.js} +12 -0
- package/dist/{constants-24eca8c9-d0d9f3ec.cjs → constants-54af2051-a3596673.cjs} +1 -1
- package/dist/{copy-icon.entry-7c958d7c.js → copy-icon.entry-121dd297.js} +1 -1
- package/dist/{copy-icon.entry-19bb7d2f.cjs → copy-icon.entry-d4835d9a.cjs} +1 -1
- package/dist/{delete-icon.entry-41c7d463.cjs → delete-icon.entry-14249f70.cjs} +1 -1
- package/dist/{delete-icon.entry-59c9ca04.js → delete-icon.entry-497ac8a2.js} +1 -1
- package/dist/{document-refresh-icon.entry-afc75ddb.cjs → document-refresh-icon.entry-c0eacb66.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-c32cda4f.js → document-refresh-icon.entry-f265bb1b.js} +1 -1
- package/dist/elements/index.d.ts +1 -0
- package/dist/{feedbackSync-b4015b72-0785986b.js → feedbackSync-e5cb0245-d84015c5.js} +1 -1
- package/dist/{feedbackSync-b4015b72-d343d411.cjs → feedbackSync-e5cb0245-ea7ddac9.cjs} +1 -1
- package/dist/{folder-icon.entry-5dcf707b.js → folder-icon.entry-d22b3e80.js} +1 -1
- package/dist/{folder-icon.entry-61ccaddd.cjs → folder-icon.entry-e4806f0a.cjs} +1 -1
- package/dist/{forward-icon.entry-3d598cb4.cjs → forward-icon.entry-42b98c73.cjs} +1 -1
- package/dist/{forward-icon.entry-5a156d37.js → forward-icon.entry-b6711af7.js} +1 -1
- package/dist/{globe-icon.entry-a88502ce.cjs → globe-icon.entry-18605371.cjs} +1 -1
- package/dist/{globe-icon.entry-99e8bebf.js → globe-icon.entry-4c5d6be0.js} +1 -1
- package/dist/google-logo-icon_4.entry-007f2813.cjs +1 -0
- package/dist/{google-logo-icon_4.entry-531021bd.js → google-logo-icon_4.entry-c3bae7b7.js} +176 -168
- package/dist/{inbox-icon.entry-6eadce9b.cjs → inbox-icon.entry-02c59267.cjs} +1 -1
- package/dist/{inbox-icon.entry-b2a2f48e.js → inbox-icon.entry-ae4383af.js} +1 -1
- package/dist/{index-13a43508.js → index-ad112f6a.js} +166 -161
- package/dist/{index-7dbf0ae7.cjs → index-bbbc79ad.cjs} +17 -17
- package/dist/{index.es-aa323594-17c2a3f6.js → index.es-e9d66a9b-62be34ce.js} +214 -211
- package/dist/{index.es-aa323594-84331fa3.cjs → index.es-e9d66a9b-a29322e0.cjs} +5 -5
- package/dist/{info-icon_2.entry-c6e650c4.js → info-icon_2.entry-3f143408.js} +5 -5
- package/dist/{info-icon_2.entry-f53d81e5.cjs → info-icon_2.entry-d10f1df5.cjs} +1 -1
- package/dist/{input-color-picker.entry-16fa8456.cjs → input-color-picker.entry-45caaa1d.cjs} +1 -1
- package/dist/{input-color-picker.entry-cd398537.js → input-color-picker.entry-8ce41f49.js} +1 -1
- package/dist/{input-component.entry-74b63249.cjs → input-component.entry-37b106dc.cjs} +1 -1
- package/dist/{input-component.entry-b471f023.js → input-component.entry-6db98fb0.js} +1 -1
- package/dist/{input-dropdown.entry-32b4b8be.cjs → input-dropdown.entry-1a2cdf40.cjs} +1 -1
- package/dist/{input-dropdown.entry-14e1f6cb.js → input-dropdown.entry-ec3d04ad.js} +1 -1
- package/dist/{italic-icon.entry-8a1a7568.js → italic-icon.entry-36d1e644.js} +1 -1
- package/dist/{italic-icon.entry-c9ae0186.cjs → italic-icon.entry-b5e4eec9.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-58b860a0.cjs → multi-select-dropdown.entry-00e43a89.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-bc4901aa.js → multi-select-dropdown.entry-6f22740f.js} +1 -1
- package/dist/nylas-booked-event-card_12.entry-4f115674.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-fbdb2f3d.js → nylas-booked-event-card_12.entry-cb6b2ce6.js} +270 -265
- package/dist/{nylas-form-card.entry-aa1d5aca.js → nylas-form-card.entry-07e46491.js} +11 -11
- package/dist/{nylas-form-card.entry-7e9a0cf1.cjs → nylas-form-card.entry-e2749723.cjs} +1 -1
- package/dist/{nylas-if-state.entry-96914d61.cjs → nylas-if-state.entry-88e01248.cjs} +1 -1
- package/dist/{nylas-if-state.entry-5e30f6b3.js → nylas-if-state.entry-e34c5cbb.js} +2 -2
- package/dist/{nylas-login.entry-e52648da.js → nylas-login.entry-a30bbd87.js} +3 -3
- package/dist/{nylas-login.entry-e26689b0.cjs → nylas-login.entry-ab50ca6a.cjs} +1 -1
- package/dist/{nylas-provider.entry-ac669351.js → nylas-provider.entry-070f8090.js} +5 -5
- package/dist/{nylas-provider.entry-9d43f4f0.cjs → nylas-provider.entry-7f4a1520.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-9655ce2e.js → nylas-scheduler-editor.entry-23e68865.js} +3 -3
- package/dist/{nylas-scheduler-editor.entry-0f1370d9.cjs → nylas-scheduler-editor.entry-287ca230.cjs} +2 -2
- package/dist/{nylas-scheduling.entry-14d4cd69.js → nylas-scheduling.entry-19fca55a.js} +8 -8
- package/dist/{nylas-scheduling.entry-ab10f8a4.cjs → nylas-scheduling.entry-c882ee9a.cjs} +1 -1
- package/dist/nylas-time-window-picker_2.entry-3d24eec4.js +336 -0
- package/dist/nylas-time-window-picker_2.entry-9a216230.cjs +1 -0
- package/dist/{person-icon.entry-40b5a8c5.js → person-icon.entry-a6d86572.js} +1 -1
- package/dist/{person-icon.entry-a45918af.cjs → person-icon.entry-b26a199b.cjs} +1 -1
- package/dist/{play-icon.entry-c5757946.cjs → play-icon.entry-5fc66fe6.cjs} +1 -1
- package/dist/{play-icon.entry-b2315f8c.js → play-icon.entry-87939760.js} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +73 -72
- package/dist/{refresh-icon.entry-b9afd192.cjs → refresh-icon.entry-3a8ae0f6.cjs} +1 -1
- package/dist/{refresh-icon.entry-37d038f8.js → refresh-icon.entry-820111be.js} +1 -1
- package/dist/{register-component-555477e7-42247763.js → register-component-5d7bcc15-35e4a5a0.js} +12 -12
- package/dist/{register-component-555477e7-ecafba1c.cjs → register-component-5d7bcc15-d9900fbc.cjs} +1 -1
- package/dist/{reply-all-icon.entry-89fd0e10.js → reply-all-icon.entry-5fbf1103.js} +1 -1
- package/dist/{reply-all-icon.entry-07a6783a.cjs → reply-all-icon.entry-864494e2.cjs} +1 -1
- package/dist/{reply-icon.entry-a53a6fc4.js → reply-icon.entry-7c136d06.js} +1 -1
- package/dist/{reply-icon.entry-8cddb112.cjs → reply-icon.entry-93084ffd.cjs} +1 -1
- package/dist/{scheduler-config-store-ed4a8dfd-733c6442.cjs → scheduler-config-store-ed4a8dfd-b2986359.cjs} +1 -1
- package/dist/{scheduler-config-store-ed4a8dfd-656579e3.js → scheduler-config-store-ed4a8dfd-f7f53255.js} +1 -1
- package/dist/{scheduler-store-c37aa5ca-0484b074.cjs → scheduler-store-20151a77-2dfd28c2.cjs} +1 -1
- package/dist/{scheduler-store-c37aa5ca-c9752707.js → scheduler-store-20151a77-4f7ffb6f.js} +2 -2
- package/dist/{sent-icon.entry-b740a32d.cjs → sent-icon.entry-18afc1f9.cjs} +1 -1
- package/dist/{sent-icon.entry-6ac749b3.js → sent-icon.entry-60f1b814.js} +1 -1
- package/dist/{spam-icon.entry-78cec025.cjs → spam-icon.entry-9d41427e.cjs} +1 -1
- package/dist/{spam-icon.entry-872ff1e4.js → spam-icon.entry-b580b108.js} +1 -1
- package/dist/{star-icon.entry-57246dc1.js → star-icon.entry-7cbe5a81.js} +1 -1
- package/dist/{star-icon.entry-ab9ad7df.cjs → star-icon.entry-8792026f.cjs} +1 -1
- package/dist/{stop-icon.entry-f79dce49.cjs → stop-icon.entry-5b605364.cjs} +1 -1
- package/dist/{stop-icon.entry-5054fa33.js → stop-icon.entry-ae629874.js} +1 -1
- package/dist/{textarea-component.entry-2967dd82.cjs → textarea-component.entry-2dae13db.cjs} +1 -1
- package/dist/{textarea-component.entry-15c9a676.js → textarea-component.entry-fa87a032.js} +2 -2
- package/dist/{time-period-selector.entry-9226fd08.js → time-period-selector.entry-0de79682.js} +2 -2
- package/dist/{time-period-selector.entry-a53c94c2.cjs → time-period-selector.entry-b1f5523b.cjs} +1 -1
- package/dist/{translate-icon.entry-52939fa4.js → translate-icon.entry-07e9c2cf.js} +1 -1
- package/dist/{translate-icon.entry-f4dcc479.cjs → translate-icon.entry-22ef3602.cjs} +1 -1
- package/dist/{trash-fill-icon.entry-b9ab3cfc.js → trash-fill-icon.entry-81ee0fdf.js} +1 -1
- package/dist/{trash-fill-icon.entry-7f4ddaf5.cjs → trash-fill-icon.entry-d332cf5d.cjs} +1 -1
- package/dist/{underline-icon.entry-c8142970.js → underline-icon.entry-dce1c48b.js} +1 -1
- package/dist/{underline-icon.entry-e9959c5c.cjs → underline-icon.entry-e381e3d2.cjs} +1 -1
- package/dist/{warning-icon.entry-00426457.js → warning-icon.entry-76d03910.js} +1 -1
- package/dist/{warning-icon.entry-98c0d003.cjs → warning-icon.entry-b55e52d0.cjs} +1 -1
- package/package.json +3 -3
- package/dist/calendar-agenda-fill-icon_54.entry-33d08f1a.cjs +0 -9
- package/dist/checkbox-component_2.entry-1e3afb3a.cjs +0 -1
- package/dist/checkbox-component_2.entry-ec5e75fb.js +0 -79
- package/dist/google-logo-icon_4.entry-9a7790d2.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-f64eecaa.cjs +0 -1
- package/dist/nylas-time-window-picker.entry-a2f71121.js +0 -316
- package/dist/nylas-time-window-picker.entry-dfbd975e.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as nr, d as T, u as rr, m as hn } from "./index-
|
|
1
|
+
import { l as nr, d as T, u as rr, m as hn } from "./index-ad112f6a.js";
|
|
2
2
|
class sr {
|
|
3
3
|
constructor(e, n, r = !0, s) {
|
|
4
4
|
this.automaticComponentRegistration = !0, this.registeredComponents = {}, this.propStateRegistrations = /* @__PURE__ */ new Map(), this.eventListenerRegistrations = /* @__PURE__ */ new Map(), this.host = e, this.stores = n, this.automaticComponentRegistration = r, this.eventOverrides = s, T(`[${this.hostTagName}] Initializing (abstract) provider.`, { eventOverrides: s }), this.registerComponent = this.registerComponent.bind(this), this.getStore = this.getStore.bind(this), Object.keys(this.stores).forEach((i) => {
|
|
@@ -7,33 +7,35 @@ class sr {
|
|
|
7
7
|
}
|
|
8
8
|
async componentWillLoad(e) {
|
|
9
9
|
T(`[${this.hostTagName}] Will load`), this.setupStoreListeners(), this.nylasConnector = e;
|
|
10
|
-
const n = Array.from(this.host.querySelectorAll("*")).filter((
|
|
11
|
-
T(`[${this.hostTagName}] Found ${n.length} child component(s).`, { childComponents: n })
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const n = Array.from(this.host.querySelectorAll("*")).filter((s) => s.tagName.toLowerCase().startsWith("nylas-"));
|
|
11
|
+
T(`[${this.hostTagName}] Found ${n.length} child component(s).`, { childComponents: n });
|
|
12
|
+
const r = n.map(async (s) => {
|
|
13
|
+
const i = s;
|
|
14
|
+
if (!i) {
|
|
15
|
+
T(`[~${this.hostTagName}] (componentWillLoad) Component ${i.tagName} does not have a name. Skipping.`);
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
if (!
|
|
18
|
-
T(`[~${this.hostTagName}] Component ${
|
|
18
|
+
if (!i.registerNylasComponent) {
|
|
19
|
+
T(`[~${this.hostTagName}] (componentWillLoad) Component ${i.tagName} is not a component that can be registered. Skipping.`, { component: i });
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
-
element:
|
|
23
|
-
name:
|
|
24
|
-
getStoresToProp:
|
|
25
|
-
storeToProps:
|
|
26
|
-
stateToProps:
|
|
27
|
-
authToProp:
|
|
28
|
-
eventToProps:
|
|
29
|
-
connectorToProp:
|
|
30
|
-
localPropsToProp:
|
|
22
|
+
const o = {
|
|
23
|
+
element: i,
|
|
24
|
+
name: i.tagName.toLowerCase(),
|
|
25
|
+
getStoresToProp: i.getStoresToProp,
|
|
26
|
+
storeToProps: i.storeToProps,
|
|
27
|
+
stateToProps: i.stateToProps,
|
|
28
|
+
authToProp: i.authToProp,
|
|
29
|
+
eventToProps: i.eventToProps,
|
|
30
|
+
connectorToProp: i.connectorToProp,
|
|
31
|
+
localPropsToProp: i.localPropsToProp
|
|
31
32
|
};
|
|
32
|
-
this.registerComponent(
|
|
33
|
+
await this.registerComponent(o);
|
|
33
34
|
});
|
|
35
|
+
await Promise.all(r);
|
|
34
36
|
}
|
|
35
37
|
async componentDidLoad() {
|
|
36
|
-
T(`[
|
|
38
|
+
T(`[~${this.hostTagName}] (componentDidLoad) Did load`);
|
|
37
39
|
}
|
|
38
40
|
async componentDisconnected() {
|
|
39
41
|
Object.values(this.stores).forEach((e) => {
|
|
@@ -42,41 +44,42 @@ class sr {
|
|
|
42
44
|
}
|
|
43
45
|
async registerComponentHandler(e) {
|
|
44
46
|
if (e.stopPropagation(), !this.automaticComponentRegistration) {
|
|
45
|
-
T(
|
|
47
|
+
T(`~[${this.hostTagName}] (registerComponentHandler) Automatic component registration disabled. Skipping registration of ${e.detail.name}.`);
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
|
-
this.registerComponent(e.detail);
|
|
50
|
+
await this.registerComponent(e.detail);
|
|
49
51
|
}
|
|
50
52
|
async unregisterComponentHandler(e) {
|
|
51
53
|
if (e.stopPropagation(), !this.automaticComponentRegistration) {
|
|
52
|
-
T(
|
|
54
|
+
T(`~[${this.hostTagName}] (unregisterComponentHandler) Automatic component registration disabled. Skipping unregistration of ${e.detail.name}.`);
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
this.unregisterComponent(e.detail);
|
|
56
58
|
}
|
|
57
|
-
registerComponent(e) {
|
|
58
|
-
T(
|
|
59
|
+
async registerComponent(e) {
|
|
60
|
+
T(`~[${this.hostTagName}] (registerComponent) Registering component ${e.name}.`);
|
|
59
61
|
const n = e.element.dataset.nylasId;
|
|
60
62
|
if (n && this.registeredComponents[n]) {
|
|
61
|
-
T(`[${this.hostTagName}] Component ${e.name} already registered. Skipping.`);
|
|
63
|
+
T(`[${this.hostTagName}] (registerComponent) Component ${e.name} already registered. Skipping.`);
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
66
|
+
T(`[${this.hostTagName}] (registerComponent) Checking if "${e.element.localName}" component is defined`, { component: e }), await customElements.whenDefined(e.element.tagName.toLowerCase());
|
|
64
67
|
const { stateToProps: r, getStoresToProp: s, eventToProps: i, storeToProps: o, connectorToProp: u, localPropsToProp: a, element: c } = e;
|
|
65
68
|
c.dataset.nylasId = rr(), this.registeredComponents[c.dataset.nylasId] = e;
|
|
66
69
|
const d = this.eventOverrides;
|
|
67
70
|
i == null || i.forEach((l, h) => {
|
|
68
71
|
var y;
|
|
69
72
|
const f = this.nylasConnector, m = async (g) => {
|
|
70
|
-
T(`[${this.hostTagName}] Handling "${e.name}" prop "${String(h)}" event.`, { event: g }), h in d && (T(`[${this.hostTagName}] Found event override for "${String(h)}" event. Calling override.`), await d[h](g, f)), g.defaultPrevented || await l(g, f);
|
|
73
|
+
T(`[${this.hostTagName}] (registerComponent) Handling "${e.name}" prop "${String(h)}" event.`, { event: g }), h in d && (T(`[${this.hostTagName}] (registerComponent) Found event override for "${String(h)}" event. Calling override.`), await d[h](g, f)), g.defaultPrevented || await l(g, f);
|
|
71
74
|
}, p = e.element.dataset.nylasId;
|
|
72
|
-
p && !this.eventListenerRegistrations.has(p) && this.eventListenerRegistrations.set(p, []), p && ((y = this.eventListenerRegistrations.get(p)) == null || y.push([c, h, m])), T(`[${this.hostTagName}] Setting "${e.name}" event "${String(h)}" to automcially call NylasConnector method.`);
|
|
75
|
+
p && !this.eventListenerRegistrations.has(p) && this.eventListenerRegistrations.set(p, []), p && ((y = this.eventListenerRegistrations.get(p)) == null || y.push([c, h, m])), T(`[${this.hostTagName}] (registerComponent) Setting "${e.name}" event "${String(h)}" to automcially call NylasConnector method.`);
|
|
73
76
|
const v = hn(h.toString());
|
|
74
|
-
T(`[${this.hostTagName}] Adding event listener for "${v}" on "${c.tagName}"`), c.addEventListener(v, m);
|
|
77
|
+
T(`[${this.hostTagName}] (registerComponent) Adding event listener for "${v}" on "${c.tagName}"`), c.addEventListener(v, m);
|
|
75
78
|
}), r == null || r.forEach((l, h) => {
|
|
76
79
|
var y, g, b, k;
|
|
77
80
|
const [f, m] = h.split("."), v = this.getStore(f).state[m];
|
|
78
81
|
if (!c.dataset.nylasId) {
|
|
79
|
-
T(`[${this.hostTagName}] Component "${e.name}" not registered. Skipping.`, { component: e });
|
|
82
|
+
T(`[${this.hostTagName}] (registerComponent) Component "${e.name}" not registered. Skipping.`, { component: e });
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
85
|
this.propStateRegistrations.has(f) || this.propStateRegistrations.set(f, /* @__PURE__ */ new Map()), (y = this.propStateRegistrations.get(f)) != null && y.has(m) ? (k = (b = this.propStateRegistrations.get(f)) == null ? void 0 : b.get(m)) == null || k.push({
|
|
@@ -94,17 +97,17 @@ class sr {
|
|
|
94
97
|
}), s && (c[s == null ? void 0 : s.toString()] = this.getStore, T(`[${this.hostTagName}] Setting "${e.name}" prop "${s.toString()}" to "getStore" method.`)), o == null || o.forEach((l, h) => {
|
|
95
98
|
const f = this.getStore(h);
|
|
96
99
|
c[l.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to "${h}" store.`, { store: f });
|
|
97
|
-
}), u && (c[u == null ? void 0 : u.toString()] = this.nylasConnector, T(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`, { connectorToProp: u })), T(`[${this.hostTagName}] Component ${e.name} registered.`);
|
|
100
|
+
}), u && (c[u == null ? void 0 : u.toString()] = this.nylasConnector, T(`[${this.hostTagName}] Setting "${e.name}" prop "${u.toString()}" to "nylasConnector" value.`, { connectorToProp: u })), typeof c.registerCallback == "function" && (T(`[${this.hostTagName}] (registerComponent) Calling registerCallback method for "${e.name}".`), await c.registerCallback()), T(`[${this.hostTagName}] (registerComponent) Component ${e.name} registered.`);
|
|
98
101
|
}
|
|
99
102
|
unregisterComponent(e) {
|
|
100
103
|
T(`[${this.hostTagName}] Unregistering component ${e.name}.`);
|
|
101
104
|
const n = e.element.dataset.nylasId;
|
|
102
105
|
if (!n) {
|
|
103
|
-
T(`[${this.hostTagName}]
|
|
106
|
+
T(`[${this.hostTagName}] (unregisterComponent) Unregistering component ${e.name}.`);
|
|
104
107
|
return;
|
|
105
108
|
}
|
|
106
109
|
if (this.registeredComponents[n]) {
|
|
107
|
-
T(`[${this.hostTagName}] Component ${e.name} not registered. Skipping.`);
|
|
110
|
+
T(`[${this.hostTagName}] (unregisterComponent) Component ${e.name} not registered. Skipping.`);
|
|
108
111
|
return;
|
|
109
112
|
}
|
|
110
113
|
this.propStateRegistrations.forEach((s, i) => {
|
|
@@ -117,7 +120,7 @@ class sr {
|
|
|
117
120
|
const r = this.eventListenerRegistrations.get(n);
|
|
118
121
|
r == null || r.forEach(([s, i, o]) => {
|
|
119
122
|
const u = hn(i.toString());
|
|
120
|
-
T(`[${this.hostTagName}] Removing event listener for "${u}" on "${s.tagName}"`), s.removeEventListener(u, o);
|
|
123
|
+
T(`[${this.hostTagName}] (unregisterComponent) Removing event listener for "${u}" on "${s.tagName}"`), s.removeEventListener(u, o);
|
|
121
124
|
}), delete this.registeredComponents[n];
|
|
122
125
|
}
|
|
123
126
|
getStore(e) {
|
|
@@ -129,30 +132,30 @@ class sr {
|
|
|
129
132
|
async setupStoreListeners() {
|
|
130
133
|
const e = this;
|
|
131
134
|
Object.entries(this.stores).forEach(([n, r]) => {
|
|
132
|
-
T(`[${e.hostTagName}] Listening for changes in "${n}" store.`), r.use({
|
|
135
|
+
T(`[${e.hostTagName}] (setupStoreListeners) Listening for changes in "${n}" store.`), r.use({
|
|
133
136
|
set(s, i, o) {
|
|
134
137
|
var c;
|
|
135
|
-
if (T(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" changed`, { newValue: i, oldValue: o }), i === o) {
|
|
136
|
-
T(`[${e.hostTagName}] Store "${n}" state "${s.toString()}" unchanged. Skipping.`);
|
|
138
|
+
if (T(`[${e.hostTagName}] (setupStoreListeners) Store "${n}" state "${s.toString()}" changed`, { newValue: i, oldValue: o }), i === o) {
|
|
139
|
+
T(`[${e.hostTagName}] (setupStoreListeners) Store "${n}" state "${s.toString()}" unchanged. Skipping.`);
|
|
137
140
|
return;
|
|
138
141
|
}
|
|
139
142
|
const u = e.registeredComponents;
|
|
140
143
|
if (!u) {
|
|
141
|
-
T(`[${e.hostTagName}] No registered components found. Skipping.`);
|
|
144
|
+
T(`[${e.hostTagName}] (setupStoreListeners) No registered components found. Skipping.`);
|
|
142
145
|
return;
|
|
143
146
|
}
|
|
144
147
|
const a = ((c = e.propStateRegistrations.get(n)) == null ? void 0 : c.get(s.toString())) || [];
|
|
145
|
-
T(`[${e.hostTagName}] Found ${a.length} prop(s) registered for "${s.toString()}" store.`, {
|
|
148
|
+
T(`[${e.hostTagName}] (setupStoreListeners) Found ${a.length} prop(s) registered for "${s.toString()}" store.`, {
|
|
146
149
|
props: a,
|
|
147
150
|
propStateRegistrations: e.propStateRegistrations
|
|
148
151
|
}), a.forEach(({ elementId: d, propKey: l }) => {
|
|
149
152
|
const h = u[d];
|
|
150
153
|
if (!h) {
|
|
151
|
-
T(`[${e.hostTagName}] Component "${d}" not found. Skipping.`, { component: h });
|
|
154
|
+
T(`[${e.hostTagName}] (setupStoreListeners) Component "${d}" not found. Skipping.`, { component: h });
|
|
152
155
|
return;
|
|
153
156
|
}
|
|
154
157
|
const m = e.getStore(n).state[s];
|
|
155
|
-
h.element[l.toString()] = m, T(`[${e.hostTagName}] Setting "${h.name}" prop "${l.toString()}" to "${s.toString()}" value.`, { stateValue: m });
|
|
158
|
+
h.element[l.toString()] = m, T(`[${e.hostTagName}] (setupStoreListeners) Setting "${h.name}" prop "${l.toString()}" to "${s.toString()}" value.`, { stateValue: m });
|
|
156
159
|
});
|
|
157
160
|
}
|
|
158
161
|
});
|
|
@@ -165,7 +168,7 @@ class sr {
|
|
|
165
168
|
}
|
|
166
169
|
class ns extends sr {
|
|
167
170
|
}
|
|
168
|
-
var ir = Object.defineProperty, or = (t, e, n) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n,
|
|
171
|
+
var ir = Object.defineProperty, or = (t, e, n) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Pt = (t, e, n) => (or(t, typeof e != "symbol" ? e + "" : e, n), n), ar = /* @__PURE__ */ ((t) => (t.Error = "error", t.Warning = "warning", t.Info = "info", t.Success = "success", t))(ar || {});
|
|
169
172
|
const rs = (t) => t !== null && typeof t == "object" && "error" in t;
|
|
170
173
|
async function dn(t) {
|
|
171
174
|
const e = new TextEncoder().encode(t), n = await crypto.subtle.digest("SHA-256", e), r = Array.from(new Uint8Array(n)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
@@ -182,18 +185,18 @@ const Be = Object.getPrototypeOf, ur = {}.hasOwnProperty;
|
|
|
182
185
|
function z(t, e) {
|
|
183
186
|
return ur.call(t, e);
|
|
184
187
|
}
|
|
185
|
-
function
|
|
188
|
+
function Ce(t, e) {
|
|
186
189
|
typeof e == "function" && (e = e(Be(t))), (typeof Reflect > "u" ? N : Reflect.ownKeys)(e).forEach((n) => {
|
|
187
190
|
ee(t, n, e[n]);
|
|
188
191
|
});
|
|
189
192
|
}
|
|
190
|
-
const
|
|
193
|
+
const Cn = Object.defineProperty;
|
|
191
194
|
function ee(t, e, n, r) {
|
|
192
|
-
|
|
195
|
+
Cn(t, e, U(n && z(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
193
196
|
}
|
|
194
197
|
function ke(t) {
|
|
195
198
|
return { from: function(e) {
|
|
196
|
-
return t.prototype = Object.create(e.prototype), ee(t.prototype, "constructor", t), { extend:
|
|
199
|
+
return t.prototype = Object.create(e.prototype), ee(t.prototype, "constructor", t), { extend: Ce.bind(null, t.prototype) };
|
|
197
200
|
} };
|
|
198
201
|
}
|
|
199
202
|
const lr = Object.getOwnPropertyDescriptor;
|
|
@@ -205,14 +208,14 @@ const cr = [].slice;
|
|
|
205
208
|
function ut(t, e, n) {
|
|
206
209
|
return cr.call(t, e, n);
|
|
207
210
|
}
|
|
208
|
-
function
|
|
211
|
+
function Pn(t, e) {
|
|
209
212
|
return e(t);
|
|
210
213
|
}
|
|
211
214
|
function Ie(t) {
|
|
212
215
|
if (!t)
|
|
213
216
|
throw new Error("Assertion Failed");
|
|
214
217
|
}
|
|
215
|
-
function
|
|
218
|
+
function En(t) {
|
|
216
219
|
K.setImmediate ? setImmediate(t) : setTimeout(t, 0);
|
|
217
220
|
}
|
|
218
221
|
function Tn(t, e) {
|
|
@@ -274,10 +277,10 @@ Tn(In, (t) => [t, !0]);
|
|
|
274
277
|
let se = null;
|
|
275
278
|
function We(t) {
|
|
276
279
|
se = typeof WeakMap < "u" && /* @__PURE__ */ new WeakMap();
|
|
277
|
-
const e =
|
|
280
|
+
const e = Et(t);
|
|
278
281
|
return se = null, e;
|
|
279
282
|
}
|
|
280
|
-
function
|
|
283
|
+
function Et(t) {
|
|
281
284
|
if (!t || typeof t != "object")
|
|
282
285
|
return t;
|
|
283
286
|
let e = se && se.get(t);
|
|
@@ -286,13 +289,13 @@ function Ct(t) {
|
|
|
286
289
|
if (M(t)) {
|
|
287
290
|
e = [], se && se.set(t, e);
|
|
288
291
|
for (var n = 0, r = t.length; n < r; ++n)
|
|
289
|
-
e.push(
|
|
292
|
+
e.push(Et(t[n]));
|
|
290
293
|
} else if (dr.indexOf(t.constructor) >= 0)
|
|
291
294
|
e = t;
|
|
292
295
|
else {
|
|
293
296
|
const i = Be(t);
|
|
294
297
|
for (var s in e = i === Object.prototype ? {} : Object.create(i), se && se.set(t, e), t)
|
|
295
|
-
z(t, s) && (e[s] =
|
|
298
|
+
z(t, s) && (e[s] = Et(t[s]));
|
|
296
299
|
}
|
|
297
300
|
return e;
|
|
298
301
|
}
|
|
@@ -338,7 +341,7 @@ function Kn(t, e) {
|
|
|
338
341
|
}
|
|
339
342
|
var jn = () => !0;
|
|
340
343
|
const mr = !new Error("").stack;
|
|
341
|
-
function
|
|
344
|
+
function Pe() {
|
|
342
345
|
if (mr)
|
|
343
346
|
try {
|
|
344
347
|
throw new Error();
|
|
@@ -356,17 +359,17 @@ function Ot(t, e) {
|
|
|
356
359
|
}
|
|
357
360
|
var Rn = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], en = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Rn), gr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
358
361
|
function xe(t, e) {
|
|
359
|
-
this._e =
|
|
362
|
+
this._e = Pe(), this.name = t, this.message = e;
|
|
360
363
|
}
|
|
361
364
|
function $n(t, e) {
|
|
362
365
|
return t + ". Errors: " + Object.keys(e).map((n) => e[n].toString()).filter((n, r, s) => s.indexOf(n) === r).join(`
|
|
363
366
|
`);
|
|
364
367
|
}
|
|
365
368
|
function lt(t, e, n, r) {
|
|
366
|
-
this._e =
|
|
369
|
+
this._e = Pe(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = $n(t, e);
|
|
367
370
|
}
|
|
368
371
|
function je(t, e) {
|
|
369
|
-
this._e =
|
|
372
|
+
this._e = Pe(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message = $n(t, e);
|
|
370
373
|
}
|
|
371
374
|
ke(xe).from(Error).extend({ stack: { get: function() {
|
|
372
375
|
return this._stack || (this._stack = this.name + ": " + this.message + Ot(this._e, 2));
|
|
@@ -375,16 +378,16 @@ ke(xe).from(Error).extend({ stack: { get: function() {
|
|
|
375
378
|
} }), ke(lt).from(xe), ke(je).from(xe);
|
|
376
379
|
var tn = en.reduce((t, e) => (t[e] = e + "Error", t), {});
|
|
377
380
|
const yr = xe;
|
|
378
|
-
var
|
|
381
|
+
var E = en.reduce((t, e) => {
|
|
379
382
|
var n = e + "Error";
|
|
380
383
|
function r(s, i) {
|
|
381
|
-
this._e =
|
|
384
|
+
this._e = Pe(), this.name = n, s ? typeof s == "string" ? (this.message = `${s}${i ? `
|
|
382
385
|
` + i : ""}`, this.inner = i || null) : typeof s == "object" && (this.message = `${s.name} ${s.message}`, this.inner = s) : (this.message = gr[e] || n, this.inner = null);
|
|
383
386
|
}
|
|
384
387
|
return ke(r).from(yr), t[e] = r, t;
|
|
385
388
|
}, {});
|
|
386
|
-
|
|
387
|
-
var fn = Rn.reduce((t, e) => (t[e + "Error"] =
|
|
389
|
+
E.Syntax = SyntaxError, E.Type = TypeError, E.Range = RangeError;
|
|
390
|
+
var fn = Rn.reduce((t, e) => (t[e + "Error"] = E[e], t), {}), tt = en.reduce((t, e) => (["Syntax", "Type", "Range"].indexOf(e) === -1 && (t[e + "Error"] = E[e]), t), {});
|
|
388
391
|
function I() {
|
|
389
392
|
}
|
|
390
393
|
function Fe(t) {
|
|
@@ -472,13 +475,13 @@ var jt = !1, xr = Kt ? () => {
|
|
|
472
475
|
} catch {
|
|
473
476
|
}
|
|
474
477
|
});
|
|
475
|
-
} },
|
|
478
|
+
} }, P = Se, Ke = [], fe = 0, st = [];
|
|
476
479
|
function S(t) {
|
|
477
480
|
if (typeof this != "object")
|
|
478
481
|
throw new TypeError("Promises must be constructed via new");
|
|
479
482
|
this._listeners = [], this.onuncatched = I, this._lib = !1;
|
|
480
|
-
var e = this._PSD =
|
|
481
|
-
if (G && (this._stackHolder =
|
|
483
|
+
var e = this._PSD = P;
|
|
484
|
+
if (G && (this._stackHolder = Pe(), this._prev = null, this._numPrev = 0), typeof t != "function") {
|
|
482
485
|
if (t !== Me)
|
|
483
486
|
throw new TypeError("Not a function");
|
|
484
487
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Bt(this, this._value));
|
|
@@ -486,9 +489,9 @@ function S(t) {
|
|
|
486
489
|
this._state = null, this._value = null, ++e.ref, Fn(this, t);
|
|
487
490
|
}
|
|
488
491
|
const Dt = { get: function() {
|
|
489
|
-
var t =
|
|
492
|
+
var t = P, e = dt;
|
|
490
493
|
function n(r, s) {
|
|
491
|
-
var i = !t.global && (t !==
|
|
494
|
+
var i = !t.global && (t !== P || e !== dt);
|
|
492
495
|
const o = i && !ne();
|
|
493
496
|
var u = new S((a, c) => {
|
|
494
497
|
sn(this, new Bn(ft(r, t, i, o), ft(s, t, i, o), a, c, t));
|
|
@@ -615,9 +618,9 @@ function Ge(t) {
|
|
|
615
618
|
return new S(Me, !1, t);
|
|
616
619
|
}
|
|
617
620
|
function j(t, e) {
|
|
618
|
-
var n =
|
|
621
|
+
var n = P;
|
|
619
622
|
return function() {
|
|
620
|
-
var r = ze(), s =
|
|
623
|
+
var r = ze(), s = P;
|
|
621
624
|
try {
|
|
622
625
|
return ae(n, !0), t.apply(this, arguments);
|
|
623
626
|
} catch (i) {
|
|
@@ -627,8 +630,8 @@ function j(t, e) {
|
|
|
627
630
|
}
|
|
628
631
|
};
|
|
629
632
|
}
|
|
630
|
-
|
|
631
|
-
sn(this, new Bn(null, null, t, e,
|
|
633
|
+
Ce(S.prototype, { then: Dt, _then: function(t, e) {
|
|
634
|
+
sn(this, new Bn(null, null, t, e, P));
|
|
632
635
|
}, catch: function(t) {
|
|
633
636
|
if (arguments.length === 1)
|
|
634
637
|
return this.then(null, t);
|
|
@@ -649,10 +652,10 @@ From previous: `);
|
|
|
649
652
|
}
|
|
650
653
|
} }, timeout: function(t, e) {
|
|
651
654
|
return t < 1 / 0 ? new S((n, r) => {
|
|
652
|
-
var s = setTimeout(() => r(new
|
|
655
|
+
var s = setTimeout(() => r(new E.Timeout(e)), t);
|
|
653
656
|
this.then(n, r).finally(clearTimeout.bind(null, s));
|
|
654
657
|
}) : this;
|
|
655
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ee(S.prototype, Symbol.toStringTag, "Dexie.Promise"), Se.env = Un(),
|
|
658
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ee(S.prototype, Symbol.toStringTag, "Dexie.Promise"), Se.env = Un(), Ce(S, { all: function() {
|
|
656
659
|
var t = J.apply(null, arguments).map(Xe);
|
|
657
660
|
return new S(function(e, n) {
|
|
658
661
|
t.length === 0 && e([]);
|
|
@@ -675,12 +678,12 @@ From previous: `);
|
|
|
675
678
|
return new S((e, n) => {
|
|
676
679
|
t.map((r) => S.resolve(r).then(e, n));
|
|
677
680
|
});
|
|
678
|
-
}, PSD: { get: () =>
|
|
681
|
+
}, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => dt }, newPSD: oe, usePSD: Te, scheduler: { get: () => Re, set: (t) => {
|
|
679
682
|
Re = t;
|
|
680
683
|
} }, rejectionMapper: { get: () => Nt, set: (t) => {
|
|
681
684
|
Nt = t;
|
|
682
685
|
} }, follow: (t, e) => new S((n, r) => oe((s, i) => {
|
|
683
|
-
var o =
|
|
686
|
+
var o = P;
|
|
684
687
|
o.unhandleds = [], o.onunhandled = i, o.finalize = me(function() {
|
|
685
688
|
(function(u) {
|
|
686
689
|
function a() {
|
|
@@ -713,10 +716,10 @@ From previous: `);
|
|
|
713
716
|
});
|
|
714
717
|
}));
|
|
715
718
|
const F = { awaits: 0, echoes: 0, id: 0 };
|
|
716
|
-
var
|
|
719
|
+
var Cr = 0, it = [], bt = 0, dt = 0, Pr = 0;
|
|
717
720
|
function oe(t, e, n, r) {
|
|
718
|
-
var s =
|
|
719
|
-
i.parent = s, i.ref = 0, i.global = !1, i.id = ++
|
|
721
|
+
var s = P, i = Object.create(s);
|
|
722
|
+
i.parent = s, i.ref = 0, i.global = !1, i.id = ++Pr;
|
|
720
723
|
var o = Se.env;
|
|
721
724
|
i.env = rn ? { Promise: S, PromiseProp: { value: S, configurable: !0, writable: !0 }, all: S.all, race: S.race, allSettled: S.allSettled, any: S.any, resolve: S.resolve, reject: S.reject, nthen: pn(o.nthen, i), gthen: pn(o.gthen, i) } : {}, e && U(i, e), ++s.ref, i.finalize = function() {
|
|
722
725
|
--this.parent.ref || this.parent.finalize();
|
|
@@ -724,25 +727,25 @@ function oe(t, e, n, r) {
|
|
|
724
727
|
var u = Te(i, t, n, r);
|
|
725
728
|
return i.ref === 0 && i.finalize(), u;
|
|
726
729
|
}
|
|
727
|
-
function
|
|
728
|
-
return F.id || (F.id = ++
|
|
730
|
+
function Ee() {
|
|
731
|
+
return F.id || (F.id = ++Cr), ++F.awaits, F.echoes += Nn, F.id;
|
|
729
732
|
}
|
|
730
733
|
function ne() {
|
|
731
734
|
return !!F.awaits && (--F.awaits == 0 && (F.id = 0), F.echoes = F.awaits * Nn, !0);
|
|
732
735
|
}
|
|
733
736
|
function Xe(t) {
|
|
734
|
-
return F.echoes && t && t.constructor === nt ? (
|
|
737
|
+
return F.echoes && t && t.constructor === nt ? (Ee(), t.then((e) => (ne(), e), (e) => (ne(), D(e)))) : t;
|
|
735
738
|
}
|
|
736
|
-
function
|
|
737
|
-
++dt, F.echoes && --F.echoes != 0 || (F.echoes = F.id = 0), it.push(
|
|
739
|
+
function Er(t) {
|
|
740
|
+
++dt, F.echoes && --F.echoes != 0 || (F.echoes = F.id = 0), it.push(P), ae(t, !0);
|
|
738
741
|
}
|
|
739
742
|
function Tr() {
|
|
740
743
|
var t = it[it.length - 1];
|
|
741
744
|
it.pop(), ae(t, !1);
|
|
742
745
|
}
|
|
743
746
|
function ae(t, e) {
|
|
744
|
-
var n =
|
|
745
|
-
if ((e ? !F.echoes || bt++ && t ===
|
|
747
|
+
var n = P;
|
|
748
|
+
if ((e ? !F.echoes || bt++ && t === P : !bt || --bt && t === P) || Vn(e ? Er.bind(null, t) : Tr), t !== P && (P = t, n === Se && (Se.env = Un()), rn)) {
|
|
746
749
|
var r = Se.env.Promise, s = t.env;
|
|
747
750
|
ct.then = s.nthen, r.prototype.then = s.gthen, (n.global || t.global) && (Object.defineProperty(K, "Promise", s.PromiseProp), r.all = s.all, r.race = s.race, r.resolve = s.resolve, r.reject = s.reject, s.allSettled && (r.allSettled = s.allSettled), s.any && (r.any = s.any));
|
|
748
751
|
}
|
|
@@ -752,7 +755,7 @@ function Un() {
|
|
|
752
755
|
return rn ? { Promise: t, PromiseProp: Object.getOwnPropertyDescriptor(K, "Promise"), all: t.all, race: t.race, allSettled: t.allSettled, any: t.any, resolve: t.resolve, reject: t.reject, nthen: ct.then, gthen: t.prototype.then } : {};
|
|
753
756
|
}
|
|
754
757
|
function Te(t, e, n, r, s) {
|
|
755
|
-
var i =
|
|
758
|
+
var i = P;
|
|
756
759
|
try {
|
|
757
760
|
return ae(t, !0), e(n, r, s);
|
|
758
761
|
} finally {
|
|
@@ -764,8 +767,8 @@ function Vn(t) {
|
|
|
764
767
|
}
|
|
765
768
|
function ft(t, e, n, r) {
|
|
766
769
|
return typeof t != "function" ? t : function() {
|
|
767
|
-
var s =
|
|
768
|
-
n &&
|
|
770
|
+
var s = P;
|
|
771
|
+
n && Ee(), ae(e, !0);
|
|
769
772
|
try {
|
|
770
773
|
return t.apply(this, arguments);
|
|
771
774
|
} finally {
|
|
@@ -778,7 +781,7 @@ function pn(t, e) {
|
|
|
778
781
|
return t.call(this, ft(n, e), ft(r, e));
|
|
779
782
|
};
|
|
780
783
|
}
|
|
781
|
-
("" + Dn).indexOf("[native code]") === -1 && (
|
|
784
|
+
("" + Dn).indexOf("[native code]") === -1 && (Ee = ne = I);
|
|
782
785
|
const mn = "unhandledrejection";
|
|
783
786
|
function gn(t, e) {
|
|
784
787
|
var n;
|
|
@@ -800,20 +803,20 @@ function gn(t, e) {
|
|
|
800
803
|
}
|
|
801
804
|
var D = S.reject;
|
|
802
805
|
function Ft(t, e, n, r) {
|
|
803
|
-
if (t.idbdb && (t._state.openComplete ||
|
|
806
|
+
if (t.idbdb && (t._state.openComplete || P.letThrough || t._vip)) {
|
|
804
807
|
var s = t._createTransaction(e, n, t._dbSchema);
|
|
805
808
|
try {
|
|
806
809
|
s.create(), t._state.PR1398_maxLoop = 3;
|
|
807
810
|
} catch (i) {
|
|
808
811
|
return i.name === tn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Ft(t, e, n, r))) : D(i);
|
|
809
812
|
}
|
|
810
|
-
return s._promise(e, (i, o) => oe(() => (
|
|
813
|
+
return s._promise(e, (i, o) => oe(() => (P.trans = s, r(i, o, s)))).then((i) => s._completion.then(() => i));
|
|
811
814
|
}
|
|
812
815
|
if (t._state.openComplete)
|
|
813
|
-
return D(new
|
|
816
|
+
return D(new E.DatabaseClosed(t._state.dbOpenError));
|
|
814
817
|
if (!t._state.isBeingOpened) {
|
|
815
818
|
if (!t._options.autoOpen)
|
|
816
|
-
return D(new
|
|
819
|
+
return D(new E.DatabaseClosed());
|
|
817
820
|
t.open().catch(I);
|
|
818
821
|
}
|
|
819
822
|
return t._state.dbReadyPromise.then(() => Ft(t, e, n, r));
|
|
@@ -830,15 +833,15 @@ function Qe(t) {
|
|
|
830
833
|
}
|
|
831
834
|
class Ir {
|
|
832
835
|
_trans(e, n, r) {
|
|
833
|
-
const s = this._tx ||
|
|
836
|
+
const s = this._tx || P.trans, i = this.name;
|
|
834
837
|
function o(a, c, d) {
|
|
835
838
|
if (!d.schema[i])
|
|
836
|
-
throw new
|
|
839
|
+
throw new E.NotFound("Table " + i + " not part of transaction");
|
|
837
840
|
return n(d.idbtrans, d);
|
|
838
841
|
}
|
|
839
842
|
const u = ze();
|
|
840
843
|
try {
|
|
841
|
-
return s && s.db === this.db ? s ===
|
|
844
|
+
return s && s.db === this.db ? s === P.trans ? s._promise(e, o, r) : oe(() => s._promise(e, o, r), { trans: s, transless: P.transless || P }) : Ft(this.db, e, [this.name], o);
|
|
842
845
|
} finally {
|
|
843
846
|
u && He();
|
|
844
847
|
}
|
|
@@ -941,7 +944,7 @@ class Ir {
|
|
|
941
944
|
{
|
|
942
945
|
const r = te(e, this.schema.primKey.keyPath);
|
|
943
946
|
if (r === void 0)
|
|
944
|
-
return D(new
|
|
947
|
+
return D(new E.InvalidArgument("Given object does not contain its primary key"));
|
|
945
948
|
try {
|
|
946
949
|
typeof n != "function" ? N(n).forEach((s) => {
|
|
947
950
|
H(e, s, n[s]);
|
|
@@ -977,9 +980,9 @@ class Ir {
|
|
|
977
980
|
return this._trans("readwrite", (o) => {
|
|
978
981
|
const { auto: u, keyPath: a } = this.schema.primKey;
|
|
979
982
|
if (a && s)
|
|
980
|
-
throw new
|
|
983
|
+
throw new E.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
981
984
|
if (s && s.length !== e.length)
|
|
982
|
-
throw new
|
|
985
|
+
throw new E.InvalidArgument("Arguments objects and keys must have the same length");
|
|
983
986
|
const c = e.length;
|
|
984
987
|
let d = a && u ? e.map(Qe(a)) : e;
|
|
985
988
|
return this.core.mutate({ trans: o, type: "add", keys: s, values: d, wantResults: i }).then(({ numFailures: l, results: h, lastResult: f, failures: m }) => {
|
|
@@ -994,9 +997,9 @@ class Ir {
|
|
|
994
997
|
return this._trans("readwrite", (o) => {
|
|
995
998
|
const { auto: u, keyPath: a } = this.schema.primKey;
|
|
996
999
|
if (a && s)
|
|
997
|
-
throw new
|
|
1000
|
+
throw new E.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
998
1001
|
if (s && s.length !== e.length)
|
|
999
|
-
throw new
|
|
1002
|
+
throw new E.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1000
1003
|
const c = e.length;
|
|
1001
1004
|
let d = a && u ? e.map(Qe(a)) : e;
|
|
1002
1005
|
return this.core.mutate({ trans: o, type: "put", keys: s, values: d, wantResults: i }).then(({ numFailures: l, results: h, lastResult: f, failures: m }) => {
|
|
@@ -1048,12 +1051,12 @@ function Ne(t) {
|
|
|
1048
1051
|
i(l, c[l][0], c[l][1]);
|
|
1049
1052
|
else {
|
|
1050
1053
|
if (h !== "asap")
|
|
1051
|
-
throw new
|
|
1054
|
+
throw new E.InvalidArgument("Invalid event config");
|
|
1052
1055
|
var f = i(l, Fe, function() {
|
|
1053
1056
|
for (var m = arguments.length, p = new Array(m); m--; )
|
|
1054
1057
|
p[m] = arguments[m];
|
|
1055
1058
|
f.subscribers.forEach(function(v) {
|
|
1056
|
-
|
|
1059
|
+
En(function() {
|
|
1057
1060
|
v.apply(null, p);
|
|
1058
1061
|
});
|
|
1059
1062
|
});
|
|
@@ -1080,7 +1083,7 @@ function ot(t, e) {
|
|
|
1080
1083
|
return e.primaryKey;
|
|
1081
1084
|
const n = e.getIndexByKeyPath(t.index);
|
|
1082
1085
|
if (!n)
|
|
1083
|
-
throw new
|
|
1086
|
+
throw new E.Schema("KeyPath " + t.index + " on object store " + e.name + " is not indexed");
|
|
1084
1087
|
return n;
|
|
1085
1088
|
}
|
|
1086
1089
|
function vn(t, e, n) {
|
|
@@ -1362,17 +1365,17 @@ class Kr {
|
|
|
1362
1365
|
const v = (y) => {
|
|
1363
1366
|
const g = Math.min(d, p.length - y);
|
|
1364
1367
|
return u.getMany({ trans: r, keys: p.slice(y, y + g), cache: "immutable" }).then((b) => {
|
|
1365
|
-
const k = [],
|
|
1368
|
+
const k = [], C = [], x = a ? [] : null, w = [];
|
|
1366
1369
|
for (let _ = 0; _ < g; ++_) {
|
|
1367
1370
|
const R = b[_], O = { value: We(R), primKey: p[y + _] };
|
|
1368
|
-
s.call(O, O.value, O) !== !1 && (O.value == null ? w.push(p[y + _]) : a || L(c(R), c(O.value)) === 0 ? (
|
|
1371
|
+
s.call(O, O.value, O) !== !1 && (O.value == null ? w.push(p[y + _]) : a || L(c(R), c(O.value)) === 0 ? (C.push(O.value), a && x.push(p[y + _])) : (w.push(p[y + _]), k.push(O.value)));
|
|
1369
1372
|
}
|
|
1370
1373
|
const A = be(n) && n.limit === 1 / 0 && (typeof e != "function" || e === St) && { index: n.index, range: n.range };
|
|
1371
1374
|
return Promise.resolve(k.length > 0 && u.mutate({ trans: r, type: "add", values: k }).then((_) => {
|
|
1372
1375
|
for (let R in _.failures)
|
|
1373
1376
|
w.splice(parseInt(R), 1);
|
|
1374
1377
|
m(k.length, _);
|
|
1375
|
-
})).then(() => (
|
|
1378
|
+
})).then(() => (C.length > 0 || A && typeof e == "object") && u.mutate({ trans: r, type: "put", keys: x, values: C, criteria: A, changeSpec: typeof e != "function" && e }).then((_) => m(C.length, _))).then(() => (w.length > 0 || A && e === St) && u.mutate({ trans: r, type: "delete", keys: w, criteria: A }).then((_) => m(w.length, _))).then(() => p.length > y + g && v(y + d));
|
|
1376
1379
|
});
|
|
1377
1380
|
};
|
|
1378
1381
|
return v(0).then(() => {
|
|
@@ -1452,9 +1455,9 @@ function Ze(t, e, n, r) {
|
|
|
1452
1455
|
var b = i(g);
|
|
1453
1456
|
if (e(b, a, m))
|
|
1454
1457
|
return !0;
|
|
1455
|
-
for (var k = null,
|
|
1456
|
-
var x = $r(g, b, u[
|
|
1457
|
-
x === null && k === null ? m =
|
|
1458
|
+
for (var k = null, C = m; C < l; ++C) {
|
|
1459
|
+
var x = $r(g, b, u[C], a[C], o, c);
|
|
1460
|
+
x === null && k === null ? m = C + 1 : (k === null || o(k, x) > 0) && (k = x);
|
|
1458
1461
|
}
|
|
1459
1462
|
return v(k !== null ? function() {
|
|
1460
1463
|
p.continue(k + d);
|
|
@@ -1556,7 +1559,7 @@ class Gn {
|
|
|
1556
1559
|
if (e.length === 0)
|
|
1557
1560
|
return we(this);
|
|
1558
1561
|
if (!e.every((g) => g[0] !== void 0 && g[1] !== void 0 && s(g[0], g[1]) <= 0))
|
|
1559
|
-
return W(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",
|
|
1562
|
+
return W(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", E.InvalidArgument);
|
|
1560
1563
|
const a = !n || n.includeLowers !== !1, c = n && n.includeUppers === !0;
|
|
1561
1564
|
let d, l = s;
|
|
1562
1565
|
function h(g, b) {
|
|
@@ -1564,15 +1567,15 @@ class Gn {
|
|
|
1564
1567
|
}
|
|
1565
1568
|
try {
|
|
1566
1569
|
d = e.reduce(function(g, b) {
|
|
1567
|
-
let k = 0,
|
|
1568
|
-
for (; k <
|
|
1570
|
+
let k = 0, C = g.length;
|
|
1571
|
+
for (; k < C; ++k) {
|
|
1569
1572
|
const x = g[k];
|
|
1570
1573
|
if (r(b[0], x[1]) < 0 && r(b[1], x[0]) > 0) {
|
|
1571
1574
|
x[0] = o(x[0], b[0]), x[1] = u(x[1], b[1]);
|
|
1572
1575
|
break;
|
|
1573
1576
|
}
|
|
1574
1577
|
}
|
|
1575
|
-
return k ===
|
|
1578
|
+
return k === C && g.push(b), g;
|
|
1576
1579
|
}, []), d.sort(h);
|
|
1577
1580
|
} catch {
|
|
1578
1581
|
return W(this, X);
|
|
@@ -1584,12 +1587,12 @@ class Gn {
|
|
|
1584
1587
|
return y._ondirectionchange = (g) => {
|
|
1585
1588
|
g === "next" ? (v = m, l = s) : (v = p, l = i), d.sort(h);
|
|
1586
1589
|
}, y._addAlgorithm((g, b, k) => {
|
|
1587
|
-
for (var
|
|
1590
|
+
for (var C = g.key; v(C); )
|
|
1588
1591
|
if (++f, f === d.length)
|
|
1589
1592
|
return b(k), !1;
|
|
1590
1593
|
return !!function(x) {
|
|
1591
1594
|
return !m(x) && !p(x);
|
|
1592
|
-
}(
|
|
1595
|
+
}(C) || (this._cmp(C, d[f][1]) === 0 || this._cmp(C, d[f][0]) === 0 || b(() => {
|
|
1593
1596
|
l === s ? g.continue(d[f][0]) : g.continue(d[f][1]);
|
|
1594
1597
|
}), !1);
|
|
1595
1598
|
}), y;
|
|
@@ -1610,11 +1613,11 @@ function qe(t) {
|
|
|
1610
1613
|
const Le = "storagemutated", ie = "x-storagemutated-1", ue = Ne(null, Le);
|
|
1611
1614
|
class Nr {
|
|
1612
1615
|
_lock() {
|
|
1613
|
-
return Ie(!
|
|
1616
|
+
return Ie(!P.global), ++this._reculock, this._reculock !== 1 || P.global || (P.lockOwnerFor = this), this;
|
|
1614
1617
|
}
|
|
1615
1618
|
_unlock() {
|
|
1616
|
-
if (Ie(!
|
|
1617
|
-
for (
|
|
1619
|
+
if (Ie(!P.global), --this._reculock == 0)
|
|
1620
|
+
for (P.global || (P.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked(); ) {
|
|
1618
1621
|
var e = this._blockedFuncs.shift();
|
|
1619
1622
|
try {
|
|
1620
1623
|
Te(e[1], e[0]);
|
|
@@ -1624,7 +1627,7 @@ class Nr {
|
|
|
1624
1627
|
return this;
|
|
1625
1628
|
}
|
|
1626
1629
|
_locked() {
|
|
1627
|
-
return this._reculock &&
|
|
1630
|
+
return this._reculock && P.lockOwnerFor !== this;
|
|
1628
1631
|
}
|
|
1629
1632
|
create(e) {
|
|
1630
1633
|
if (!this.mode)
|
|
@@ -1633,32 +1636,32 @@ class Nr {
|
|
|
1633
1636
|
if (Ie(!this.idbtrans), !e && !n)
|
|
1634
1637
|
switch (r && r.name) {
|
|
1635
1638
|
case "DatabaseClosedError":
|
|
1636
|
-
throw new
|
|
1639
|
+
throw new E.DatabaseClosed(r);
|
|
1637
1640
|
case "MissingAPIError":
|
|
1638
|
-
throw new
|
|
1641
|
+
throw new E.MissingAPI(r.message, r);
|
|
1639
1642
|
default:
|
|
1640
|
-
throw new
|
|
1643
|
+
throw new E.OpenFailed(r);
|
|
1641
1644
|
}
|
|
1642
1645
|
if (!this.active)
|
|
1643
|
-
throw new
|
|
1646
|
+
throw new E.TransactionInactive();
|
|
1644
1647
|
return Ie(this._completion._state === null), (e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }))).onerror = j((s) => {
|
|
1645
1648
|
qe(s), this._reject(e.error);
|
|
1646
1649
|
}), e.onabort = j((s) => {
|
|
1647
|
-
qe(s), this.active && this._reject(new
|
|
1650
|
+
qe(s), this.active && this._reject(new E.Abort(e.error)), this.active = !1, this.on("abort").fire(s);
|
|
1648
1651
|
}), e.oncomplete = j(() => {
|
|
1649
1652
|
this.active = !1, this._resolve(), "mutatedParts" in e && ue.storagemutated.fire(e.mutatedParts);
|
|
1650
1653
|
}), this;
|
|
1651
1654
|
}
|
|
1652
1655
|
_promise(e, n, r) {
|
|
1653
1656
|
if (e === "readwrite" && this.mode !== "readwrite")
|
|
1654
|
-
return D(new
|
|
1657
|
+
return D(new E.ReadOnly("Transaction is readonly"));
|
|
1655
1658
|
if (!this.active)
|
|
1656
|
-
return D(new
|
|
1659
|
+
return D(new E.TransactionInactive());
|
|
1657
1660
|
if (this._locked())
|
|
1658
1661
|
return new S((i, o) => {
|
|
1659
1662
|
this._blockedFuncs.push([() => {
|
|
1660
1663
|
this._promise(e, n, r).then(i, o);
|
|
1661
|
-
},
|
|
1664
|
+
}, P]);
|
|
1662
1665
|
});
|
|
1663
1666
|
if (r)
|
|
1664
1667
|
return oe(() => {
|
|
@@ -1700,7 +1703,7 @@ class Nr {
|
|
|
1700
1703
|
});
|
|
1701
1704
|
}
|
|
1702
1705
|
abort() {
|
|
1703
|
-
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new
|
|
1706
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new E.Abort()));
|
|
1704
1707
|
}
|
|
1705
1708
|
table(e) {
|
|
1706
1709
|
const n = this._memoizedTables || (this._memoizedTables = {});
|
|
@@ -1708,7 +1711,7 @@ class Nr {
|
|
|
1708
1711
|
return n[e];
|
|
1709
1712
|
const r = this.schema[e];
|
|
1710
1713
|
if (!r)
|
|
1711
|
-
throw new
|
|
1714
|
+
throw new E.NotFound("Table " + e + " not part of transaction");
|
|
1712
1715
|
const s = new this.db.Table(e, r, this);
|
|
1713
1716
|
return s.core = this.db.core.table(e), n[e] = s, s;
|
|
1714
1717
|
}
|
|
@@ -1755,7 +1758,7 @@ function Br(t, e, n) {
|
|
|
1755
1758
|
const d = kn(a.objectStoreNames);
|
|
1756
1759
|
return { schema: { name: a.name, tables: d.map((l) => c.objectStore(l)).map((l) => {
|
|
1757
1760
|
const { keyPath: h, autoIncrement: f } = l, m = M(h), p = h == null, v = {}, y = { name: l.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p, compound: m, keyPath: h, autoIncrement: f, unique: !0, extractKey: Lt(h) }, indexes: kn(l.indexNames).map((g) => l.index(g)).map((g) => {
|
|
1758
|
-
const { name: b, unique: k, multiEntry:
|
|
1761
|
+
const { name: b, unique: k, multiEntry: C, keyPath: x } = g, w = { name: b, compound: M(x), keyPath: x, unique: k, multiEntry: C, extractKey: Lt(x) };
|
|
1759
1762
|
return v[De(x)] = w, w;
|
|
1760
1763
|
}), getIndexByKeyPath: (g) => v[De(g)] };
|
|
1761
1764
|
return v[":id"] = y.primaryKey, h != null && (v[De(h)] = y.primaryKey), y;
|
|
@@ -1768,10 +1771,10 @@ function Br(t, e, n) {
|
|
|
1768
1771
|
const g = l.objectStore(d), b = g.keyPath == null, k = h === "put" || h === "add";
|
|
1769
1772
|
if (!k && h !== "delete" && h !== "deleteRange")
|
|
1770
1773
|
throw new Error("Invalid operation type: " + h);
|
|
1771
|
-
const { length:
|
|
1774
|
+
const { length: C } = f || m || { length: 1 };
|
|
1772
1775
|
if (f && m && f.length !== m.length)
|
|
1773
1776
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1774
|
-
if (
|
|
1777
|
+
if (C === 0)
|
|
1775
1778
|
return v({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1776
1779
|
let x;
|
|
1777
1780
|
const w = [], A = [];
|
|
@@ -1786,10 +1789,10 @@ function Br(t, e, n) {
|
|
|
1786
1789
|
} else {
|
|
1787
1790
|
const [q, B] = k ? b ? [m, f] : [m, null] : [f, null];
|
|
1788
1791
|
if (k)
|
|
1789
|
-
for (let $ = 0; $ <
|
|
1792
|
+
for (let $ = 0; $ < C; ++$)
|
|
1790
1793
|
w.push(x = B && B[$] !== void 0 ? g[h](q[$], B[$]) : g[h](q[$])), x.onerror = R;
|
|
1791
1794
|
else
|
|
1792
|
-
for (let $ = 0; $ <
|
|
1795
|
+
for (let $ = 0; $ < C; ++$)
|
|
1793
1796
|
w.push(x = g[h](q[$])), x.onerror = R;
|
|
1794
1797
|
}
|
|
1795
1798
|
const O = (q) => {
|
|
@@ -1804,12 +1807,12 @@ function Br(t, e, n) {
|
|
|
1804
1807
|
f = j(f);
|
|
1805
1808
|
const p = l.objectStore(d), v = h.length, y = new Array(v);
|
|
1806
1809
|
let g, b = 0, k = 0;
|
|
1807
|
-
const
|
|
1810
|
+
const C = (w) => {
|
|
1808
1811
|
const A = w.target;
|
|
1809
1812
|
y[A._pos] = A.result, ++k === b && f(y);
|
|
1810
1813
|
}, x = Y(m);
|
|
1811
1814
|
for (let w = 0; w < v; ++w)
|
|
1812
|
-
h[w] != null && (g = p.get(h[w]), g._pos = w, g.onsuccess =
|
|
1815
|
+
h[w] != null && (g = p.get(h[w]), g._pos = w, g.onsuccess = C, g.onerror = x, ++b);
|
|
1813
1816
|
b === 0 && f(y);
|
|
1814
1817
|
}), get: ({ trans: l, key: h }) => new Promise((f, m) => {
|
|
1815
1818
|
f = j(f);
|
|
@@ -1818,7 +1821,7 @@ function Br(t, e, n) {
|
|
|
1818
1821
|
}), query: function(l) {
|
|
1819
1822
|
return (h) => new Promise((f, m) => {
|
|
1820
1823
|
f = j(f);
|
|
1821
|
-
const { trans: p, values: v, limit: y, query: g } = h, b = y === 1 / 0 ? void 0 : y, { index: k, range:
|
|
1824
|
+
const { trans: p, values: v, limit: y, query: g } = h, b = y === 1 / 0 ? void 0 : y, { index: k, range: C } = g, x = p.objectStore(d), w = k.isPrimaryKey ? x : x.index(k.name), A = r(C);
|
|
1822
1825
|
if (y === 0)
|
|
1823
1826
|
return f({ result: [] });
|
|
1824
1827
|
if (l) {
|
|
@@ -1836,7 +1839,7 @@ function Br(t, e, n) {
|
|
|
1836
1839
|
}(i), openCursor: function({ trans: l, values: h, query: f, reverse: m, unique: p }) {
|
|
1837
1840
|
return new Promise((v, y) => {
|
|
1838
1841
|
v = j(v);
|
|
1839
|
-
const { index: g, range: b } = f, k = l.objectStore(d),
|
|
1842
|
+
const { index: g, range: b } = f, k = l.objectStore(d), C = g.isPrimaryKey ? k : k.index(g.name), x = m ? p ? "prevunique" : "prev" : p ? "nextunique" : "next", w = h || !("openKeyCursor" in C) ? C.openCursor(r(b), x) : C.openKeyCursor(r(b), x);
|
|
1840
1843
|
w.onerror = Y(y), w.onsuccess = j((A) => {
|
|
1841
1844
|
const _ = w.result;
|
|
1842
1845
|
if (!_)
|
|
@@ -1880,7 +1883,7 @@ function Br(t, e, n) {
|
|
|
1880
1883
|
const { index: f, range: m } = l;
|
|
1881
1884
|
return new Promise((p, v) => {
|
|
1882
1885
|
const y = h.objectStore(d), g = f.isPrimaryKey ? y : y.index(f.name), b = r(m), k = b ? g.count(b) : g.count();
|
|
1883
|
-
k.onsuccess = j((
|
|
1886
|
+
k.onsuccess = j((C) => p(C.target.result)), k.onerror = Y(v);
|
|
1884
1887
|
});
|
|
1885
1888
|
} };
|
|
1886
1889
|
}(a)), u = {};
|
|
@@ -1909,7 +1912,7 @@ function pt({ _novip: t }, e, n, r) {
|
|
|
1909
1912
|
(!u || "value" in u && u.value === void 0) && (o === t.Transaction.prototype || o instanceof t.Transaction ? ee(o, s, { get() {
|
|
1910
1913
|
return this.table(s);
|
|
1911
1914
|
}, set(a) {
|
|
1912
|
-
|
|
1915
|
+
Cn(this, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
|
|
1913
1916
|
} }) : o[s] = new t.Table(s, i));
|
|
1914
1917
|
});
|
|
1915
1918
|
});
|
|
@@ -1926,10 +1929,10 @@ function Fr(t, e) {
|
|
|
1926
1929
|
function Mr(t, e, n, r) {
|
|
1927
1930
|
const s = t._dbSchema, i = t._createTransaction("readwrite", t._storeNames, s);
|
|
1928
1931
|
i.create(n), i._completion.catch(r);
|
|
1929
|
-
const o = i._reject.bind(i), u =
|
|
1932
|
+
const o = i._reject.bind(i), u = P.transless || P;
|
|
1930
1933
|
oe(() => {
|
|
1931
|
-
|
|
1932
|
-
|
|
1934
|
+
P.trans = i, P.transless = u, e === 0 ? (N(s).forEach((a) => {
|
|
1935
|
+
Ct(n, a, s[a].primKey, s[a].indexes);
|
|
1933
1936
|
}), Ut(t, n), S.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: a }, c, d, l) {
|
|
1934
1937
|
const h = [], f = a._versions;
|
|
1935
1938
|
let m = a._dbSchema = zt(a, a.idbdb, l), p = !1;
|
|
@@ -1941,12 +1944,12 @@ function Mr(t, e, n, r) {
|
|
|
1941
1944
|
h.push(() => {
|
|
1942
1945
|
const b = m, k = g._cfg.dbschema;
|
|
1943
1946
|
Ht(a, b, l), Ht(a, k, l), m = a._dbSchema = k;
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
}),
|
|
1947
|
+
const C = Jn(b, k);
|
|
1948
|
+
C.add.forEach((w) => {
|
|
1949
|
+
Ct(l, w[0], w[1].primKey, w[1].indexes);
|
|
1950
|
+
}), C.change.forEach((w) => {
|
|
1948
1951
|
if (w.recreate)
|
|
1949
|
-
throw new
|
|
1952
|
+
throw new E.Upgrade("Not yet support for changing primary key");
|
|
1950
1953
|
{
|
|
1951
1954
|
const A = l.objectStore(w.name);
|
|
1952
1955
|
w.add.forEach((_) => Wt(A, _)), w.change.forEach((_) => {
|
|
@@ -1958,12 +1961,12 @@ function Mr(t, e, n, r) {
|
|
|
1958
1961
|
if (x && g._cfg.version > c) {
|
|
1959
1962
|
Ut(a, l), d._memoizedTables = {}, p = !0;
|
|
1960
1963
|
let w = An(k);
|
|
1961
|
-
|
|
1964
|
+
C.del.forEach((O) => {
|
|
1962
1965
|
w[O] = b[O];
|
|
1963
1966
|
}), Vt(a, [a.Transaction.prototype]), pt(a, [a.Transaction.prototype], N(w), w), d.schema = w;
|
|
1964
1967
|
const A = Zt(x);
|
|
1965
1968
|
let _;
|
|
1966
|
-
A &&
|
|
1969
|
+
A && Ee();
|
|
1967
1970
|
const R = S.follow(() => {
|
|
1968
1971
|
if (_ = x(d), _ && A) {
|
|
1969
1972
|
var O = ne.bind(null, null);
|
|
@@ -1973,14 +1976,14 @@ function Mr(t, e, n, r) {
|
|
|
1973
1976
|
return _ && typeof _.then == "function" ? S.resolve(_) : R.then(() => _);
|
|
1974
1977
|
}
|
|
1975
1978
|
}), h.push((b) => {
|
|
1976
|
-
(!p || !Ar) && function(k,
|
|
1977
|
-
[].slice.call(
|
|
1979
|
+
(!p || !Ar) && function(k, C) {
|
|
1980
|
+
[].slice.call(C.db.objectStoreNames).forEach((x) => k[x] == null && C.db.deleteObjectStore(x));
|
|
1978
1981
|
}(g._cfg.dbschema, b), Vt(a, [a.Transaction.prototype]), pt(a, [a.Transaction.prototype], a._storeNames, a._dbSchema), d.schema = a._dbSchema;
|
|
1979
1982
|
});
|
|
1980
1983
|
}), y().then(() => {
|
|
1981
1984
|
var g, b;
|
|
1982
1985
|
b = l, N(g = m).forEach((k) => {
|
|
1983
|
-
b.db.objectStoreNames.contains(k) ||
|
|
1986
|
+
b.db.objectStoreNames.contains(k) || Ct(b, k, g[k].primKey, g[k].indexes);
|
|
1984
1987
|
});
|
|
1985
1988
|
});
|
|
1986
1989
|
}(t, e, i, n).catch(o);
|
|
@@ -2013,7 +2016,7 @@ function Jn(t, e) {
|
|
|
2013
2016
|
}
|
|
2014
2017
|
return n;
|
|
2015
2018
|
}
|
|
2016
|
-
function
|
|
2019
|
+
function Ct(t, e, n, r) {
|
|
2017
2020
|
const s = t.db.createObjectStore(e, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2018
2021
|
return r.forEach((i) => Wt(s, i)), s;
|
|
2019
2022
|
}
|
|
@@ -2059,12 +2062,12 @@ class qr {
|
|
|
2059
2062
|
return qt(a, c || null, /\&/.test(o), /\*/.test(o), /\+\+/.test(o), M(c), u === 0);
|
|
2060
2063
|
}), i = s.shift();
|
|
2061
2064
|
if (i.multi)
|
|
2062
|
-
throw new
|
|
2065
|
+
throw new E.Schema("Primary key cannot be multi-valued");
|
|
2063
2066
|
s.forEach((o) => {
|
|
2064
2067
|
if (o.auto)
|
|
2065
|
-
throw new
|
|
2068
|
+
throw new E.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2066
2069
|
if (!o.keyPath)
|
|
2067
|
-
throw new
|
|
2070
|
+
throw new E.Schema("Index must have a name and cannot be an empty string");
|
|
2068
2071
|
}), n[r] = Qn(r, i, s);
|
|
2069
2072
|
}
|
|
2070
2073
|
});
|
|
@@ -2091,7 +2094,7 @@ function un(t) {
|
|
|
2091
2094
|
}
|
|
2092
2095
|
function Yt(t) {
|
|
2093
2096
|
return oe(function() {
|
|
2094
|
-
return
|
|
2097
|
+
return P.letThrough = !0, t();
|
|
2095
2098
|
});
|
|
2096
2099
|
}
|
|
2097
2100
|
function Lr() {
|
|
@@ -2109,25 +2112,25 @@ function Ur(t) {
|
|
|
2109
2112
|
const e = t._state, { indexedDB: n } = t._deps;
|
|
2110
2113
|
if (e.isBeingOpened || t.idbdb)
|
|
2111
2114
|
return e.dbReadyPromise.then(() => e.dbOpenError ? D(e.dbOpenError) : t);
|
|
2112
|
-
G && (e.openCanceller._stackHolder =
|
|
2115
|
+
G && (e.openCanceller._stackHolder = Pe()), e.isBeingOpened = !0, e.dbOpenError = null, e.openComplete = !1;
|
|
2113
2116
|
const r = e.openCanceller;
|
|
2114
2117
|
function s() {
|
|
2115
2118
|
if (e.openCanceller !== r)
|
|
2116
|
-
throw new
|
|
2119
|
+
throw new E.DatabaseClosed("db.open() was cancelled");
|
|
2117
2120
|
}
|
|
2118
2121
|
let i = e.dbReadyResolve, o = null, u = !1;
|
|
2119
2122
|
return S.race([r, (typeof navigator > "u" ? S.resolve() : Lr()).then(() => new S((a, c) => {
|
|
2120
2123
|
if (s(), !n)
|
|
2121
|
-
throw new
|
|
2124
|
+
throw new E.MissingAPI();
|
|
2122
2125
|
const d = t.name, l = e.autoSchema ? n.open(d) : n.open(d, Math.round(10 * t.verno));
|
|
2123
2126
|
if (!l)
|
|
2124
|
-
throw new
|
|
2127
|
+
throw new E.MissingAPI();
|
|
2125
2128
|
l.onerror = Y(c), l.onblocked = j(t._fireOnBlocked), l.onupgradeneeded = j((h) => {
|
|
2126
2129
|
if (o = l.transaction, e.autoSchema && !t._options.allowEmptyDB) {
|
|
2127
2130
|
l.onerror = qe, o.abort(), l.result.close();
|
|
2128
2131
|
const m = n.deleteDatabase(d);
|
|
2129
2132
|
m.onsuccess = m.onerror = j(() => {
|
|
2130
|
-
c(new
|
|
2133
|
+
c(new E.NoSuchDatabase(`Database ${d} doesnt exist`));
|
|
2131
2134
|
});
|
|
2132
2135
|
} else {
|
|
2133
2136
|
o.onerror = Y(c);
|
|
@@ -2190,14 +2193,14 @@ function Gt(t) {
|
|
|
2190
2193
|
function Vr(t, e, n) {
|
|
2191
2194
|
var r = arguments.length;
|
|
2192
2195
|
if (r < 2)
|
|
2193
|
-
throw new
|
|
2196
|
+
throw new E.InvalidArgument("Too few arguments");
|
|
2194
2197
|
for (var s = new Array(r - 1); --r; )
|
|
2195
2198
|
s[r - 1] = arguments[r];
|
|
2196
2199
|
return n = s.pop(), [t, On(s), n];
|
|
2197
2200
|
}
|
|
2198
2201
|
function Zn(t, e, n, r, s) {
|
|
2199
2202
|
return S.resolve().then(() => {
|
|
2200
|
-
const i =
|
|
2203
|
+
const i = P.transless || P, o = t._createTransaction(e, n, t._dbSchema, r), u = { trans: o, transless: i };
|
|
2201
2204
|
if (r)
|
|
2202
2205
|
o.idbtrans = r.idbtrans;
|
|
2203
2206
|
else
|
|
@@ -2208,7 +2211,7 @@ function Zn(t, e, n, r, s) {
|
|
|
2208
2211
|
}
|
|
2209
2212
|
const a = Zt(s);
|
|
2210
2213
|
let c;
|
|
2211
|
-
a &&
|
|
2214
|
+
a && Ee();
|
|
2212
2215
|
const d = S.follow(() => {
|
|
2213
2216
|
if (c = s.call(o, o), c)
|
|
2214
2217
|
if (a) {
|
|
@@ -2217,7 +2220,7 @@ function Zn(t, e, n, r, s) {
|
|
|
2217
2220
|
} else
|
|
2218
2221
|
typeof c.next == "function" && typeof c.throw == "function" && (c = Gt(c));
|
|
2219
2222
|
}, u);
|
|
2220
|
-
return (c && typeof c.then == "function" ? S.resolve(c).then((l) => o.active ? l : D(new
|
|
2223
|
+
return (c && typeof c.then == "function" ? S.resolve(c).then((l) => o.active ? l : D(new E.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))) : d.then(() => c)).then((l) => (r && o._resolve(), o._completion.then(() => l))).catch((l) => (o._reject(l), D(l)));
|
|
2221
2224
|
});
|
|
2222
2225
|
}
|
|
2223
2226
|
function et(t, e, n) {
|
|
@@ -2278,7 +2281,7 @@ function ln(t, e, n, r) {
|
|
|
2278
2281
|
const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) => ({ ...t, table(e) {
|
|
2279
2282
|
const n = t.table(e), { primaryKey: r } = n.schema;
|
|
2280
2283
|
return { ...n, mutate(s) {
|
|
2281
|
-
const i =
|
|
2284
|
+
const i = P.trans, { deleting: o, creating: u, updating: a } = i.table(e).hook;
|
|
2282
2285
|
switch (s.type) {
|
|
2283
2286
|
case "add":
|
|
2284
2287
|
if (u.fire === I)
|
|
@@ -2301,7 +2304,7 @@ const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2301
2304
|
}
|
|
2302
2305
|
return n.mutate(s);
|
|
2303
2306
|
function c(l) {
|
|
2304
|
-
const h =
|
|
2307
|
+
const h = P.trans, f = l.keys || function(m, p) {
|
|
2305
2308
|
return p.type === "delete" ? p.keys : p.keys || p.values.map(m.extractKey);
|
|
2306
2309
|
}(r, l);
|
|
2307
2310
|
if (!f)
|
|
@@ -2317,11 +2320,11 @@ const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2317
2320
|
const k = u.fire.call(b, v, l.values[y], h);
|
|
2318
2321
|
v == null && k != null && (v = k, l.keys[y] = v, r.outbound || H(l.values[y], r.keyPath, v));
|
|
2319
2322
|
} else {
|
|
2320
|
-
const k = ln(g, l.values[y]),
|
|
2321
|
-
if (
|
|
2323
|
+
const k = ln(g, l.values[y]), C = a.fire.call(b, k, v, g, h);
|
|
2324
|
+
if (C) {
|
|
2322
2325
|
const x = l.values[y];
|
|
2323
|
-
Object.keys(
|
|
2324
|
-
z(x, w) ? x[w] =
|
|
2326
|
+
Object.keys(C).forEach((w) => {
|
|
2327
|
+
z(x, w) ? x[w] = C[w] : H(x, w, C[w]);
|
|
2325
2328
|
});
|
|
2326
2329
|
}
|
|
2327
2330
|
}
|
|
@@ -2329,8 +2332,8 @@ const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2329
2332
|
});
|
|
2330
2333
|
return n.mutate(l).then(({ failures: v, results: y, numFailures: g, lastResult: b }) => {
|
|
2331
2334
|
for (let k = 0; k < f.length; ++k) {
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2335
|
+
const C = y ? y[k] : f[k], x = p[k];
|
|
2336
|
+
C == null ? x.onerror && x.onerror(v[k]) : x.onsuccess && x.onsuccess(l.type === "put" && m[k] ? l.values[k] : C);
|
|
2334
2337
|
}
|
|
2335
2338
|
return { failures: v, results: y, numFailures: g, lastResult: b };
|
|
2336
2339
|
}).catch((v) => (p.forEach((y) => y.onerror && y.onerror(v)), Promise.reject(v)));
|
|
@@ -2448,7 +2451,7 @@ function xn(t) {
|
|
|
2448
2451
|
function Sn({ r: t, l: e }) {
|
|
2449
2452
|
return (t ? e ? Math.max(t.d, e.d) : t.d : e ? e.d : 0) + 1;
|
|
2450
2453
|
}
|
|
2451
|
-
|
|
2454
|
+
Ce(Q.prototype, { add(t) {
|
|
2452
2455
|
return mt(this, t), this;
|
|
2453
2456
|
}, addKey(t) {
|
|
2454
2457
|
return Ve(this, t, t), this;
|
|
@@ -2466,11 +2469,11 @@ const Gr = { stack: "dbcore", level: 0, create: (t) => {
|
|
|
2466
2469
|
return m[w] || (m[w] = new Q());
|
|
2467
2470
|
}, v = p(""), y = p(":dels"), { type: g } = h;
|
|
2468
2471
|
let [b, k] = h.type === "deleteRange" ? [h.range] : h.type === "delete" ? [h.keys] : h.values.length < 50 ? [[], h.values] : [];
|
|
2469
|
-
const
|
|
2472
|
+
const C = h.trans._cache;
|
|
2470
2473
|
return s.mutate(h).then((x) => {
|
|
2471
2474
|
if (M(b)) {
|
|
2472
2475
|
g !== "delete" && (b = x.results), v.addKeys(b);
|
|
2473
|
-
const w = er(b,
|
|
2476
|
+
const w = er(b, C);
|
|
2474
2477
|
w || g === "add" || y.addKeys(b), (w || k) && function(A, _, R, O) {
|
|
2475
2478
|
function q(B) {
|
|
2476
2479
|
const $ = A(B.name || "");
|
|
@@ -2498,29 +2501,29 @@ const Gr = { stack: "dbcore", level: 0, create: (t) => {
|
|
|
2498
2501
|
}, l = { get: (h) => [o, new Q(h.key)], getMany: (h) => [o, new Q().addKeys(h.keys)], count: d, query: d, openCursor: d };
|
|
2499
2502
|
return N(l).forEach((h) => {
|
|
2500
2503
|
c[h] = function(f) {
|
|
2501
|
-
const { subscr: m } =
|
|
2504
|
+
const { subscr: m } = P;
|
|
2502
2505
|
if (m) {
|
|
2503
2506
|
const p = (k) => {
|
|
2504
|
-
const
|
|
2505
|
-
return m[
|
|
2507
|
+
const C = `idb://${e}/${r}/${k}`;
|
|
2508
|
+
return m[C] || (m[C] = new Q());
|
|
2506
2509
|
}, v = p(""), y = p(":dels"), [g, b] = l[h](f);
|
|
2507
2510
|
if (p(g.name || "").add(b), !g.isPrimaryKey) {
|
|
2508
2511
|
if (h !== "count") {
|
|
2509
2512
|
const k = h === "query" && a && f.values && s.query({ ...f, values: !1 });
|
|
2510
|
-
return s[h].apply(this, arguments).then((
|
|
2513
|
+
return s[h].apply(this, arguments).then((C) => {
|
|
2511
2514
|
if (h === "query") {
|
|
2512
2515
|
if (a && f.values)
|
|
2513
|
-
return k.then(({ result: w }) => (v.addKeys(w),
|
|
2514
|
-
const x = f.values ?
|
|
2516
|
+
return k.then(({ result: w }) => (v.addKeys(w), C));
|
|
2517
|
+
const x = f.values ? C.result.map(u) : C.result;
|
|
2515
2518
|
f.values ? v.addKeys(x) : y.addKeys(x);
|
|
2516
2519
|
} else if (h === "openCursor") {
|
|
2517
|
-
const x =
|
|
2520
|
+
const x = C, w = f.values;
|
|
2518
2521
|
return x && Object.create(x, { key: { get: () => (y.addKey(x.primaryKey), x.key) }, primaryKey: { get() {
|
|
2519
2522
|
const A = x.primaryKey;
|
|
2520
2523
|
return y.addKey(A), A;
|
|
2521
2524
|
} }, value: { get: () => (w && v.addKey(x.primaryKey), x.value) } });
|
|
2522
2525
|
}
|
|
2523
|
-
return
|
|
2526
|
+
return C;
|
|
2524
2527
|
});
|
|
2525
2528
|
}
|
|
2526
2529
|
y.add(n);
|
|
@@ -2544,7 +2547,7 @@ class pe {
|
|
|
2544
2547
|
i.dbReadyResolve = u;
|
|
2545
2548
|
}), i.openCanceller = new S((u, a) => {
|
|
2546
2549
|
i.cancelOpen = a;
|
|
2547
|
-
}), this._state = i, this.name = e, this.on = Ne(this, "populate", "blocked", "versionchange", "close", { ready: [nn, I] }), this.on.ready.subscribe =
|
|
2550
|
+
}), this._state = i, this.name = e, this.on = Ne(this, "populate", "blocked", "versionchange", "close", { ready: [nn, I] }), this.on.ready.subscribe = Pn(this.on.ready.subscribe, (u) => (a, c) => {
|
|
2548
2551
|
pe.vip(() => {
|
|
2549
2552
|
const d = this._state;
|
|
2550
2553
|
if (d.openComplete)
|
|
@@ -2594,7 +2597,7 @@ class pe {
|
|
|
2594
2597
|
this.db = u, this._ctx = { table: a, index: c === ":id" ? null : c, or: d };
|
|
2595
2598
|
const l = u._deps.indexedDB;
|
|
2596
2599
|
if (!l)
|
|
2597
|
-
throw new
|
|
2600
|
+
throw new E.MissingAPI();
|
|
2598
2601
|
this._cmp = this._ascending = l.cmp.bind(l), this._descending = (h, f) => l.cmp(f, h), this._max = (h, f) => l.cmp(h, f) > 0 ? h : f, this._min = (h, f) => l.cmp(h, f) < 0 ? h : f, this._IDBKeyRange = u._deps.IDBKeyRange;
|
|
2599
2602
|
});
|
|
2600
2603
|
}(this), this.on("versionchange", (u) => {
|
|
@@ -2607,21 +2610,21 @@ class pe {
|
|
|
2607
2610
|
}
|
|
2608
2611
|
version(e) {
|
|
2609
2612
|
if (isNaN(e) || e < 0.1)
|
|
2610
|
-
throw new
|
|
2613
|
+
throw new E.Type("Given version is not a positive number");
|
|
2611
2614
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened)
|
|
2612
|
-
throw new
|
|
2615
|
+
throw new E.Schema("Cannot add version when database is open");
|
|
2613
2616
|
this.verno = Math.max(this.verno, e);
|
|
2614
2617
|
const n = this._versions;
|
|
2615
2618
|
var r = n.filter((s) => s._cfg.version === e)[0];
|
|
2616
2619
|
return r || (r = new this.Version(e), n.push(r), n.sort(Fr), r.stores({}), this._state.autoSchema = !1, r);
|
|
2617
2620
|
}
|
|
2618
2621
|
_whenReady(e) {
|
|
2619
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2622
|
+
return this.idbdb && (this._state.openComplete || P.letThrough || this._vip) ? e() : new S((n, r) => {
|
|
2620
2623
|
if (this._state.openComplete)
|
|
2621
|
-
return r(new
|
|
2624
|
+
return r(new E.DatabaseClosed(this._state.dbOpenError));
|
|
2622
2625
|
if (!this._state.isBeingOpened) {
|
|
2623
2626
|
if (!this._options.autoOpen)
|
|
2624
|
-
return void r(new
|
|
2627
|
+
return void r(new E.DatabaseClosed());
|
|
2625
2628
|
this.open().catch(I);
|
|
2626
2629
|
}
|
|
2627
2630
|
this._state.dbReadyPromise.then(n, r);
|
|
@@ -2656,7 +2659,7 @@ class pe {
|
|
|
2656
2659
|
close() {
|
|
2657
2660
|
this._close();
|
|
2658
2661
|
const e = this._state;
|
|
2659
|
-
this._options.autoOpen = !1, e.dbOpenError = new
|
|
2662
|
+
this._options.autoOpen = !1, e.dbOpenError = new E.DatabaseClosed(), e.isBeingOpened && e.cancelOpen(e.dbOpenError);
|
|
2660
2663
|
}
|
|
2661
2664
|
delete() {
|
|
2662
2665
|
const e = arguments.length > 0, n = this._state;
|
|
@@ -2671,7 +2674,7 @@ class pe {
|
|
|
2671
2674
|
}), o.onerror = Y(s), o.onblocked = this._fireOnBlocked;
|
|
2672
2675
|
};
|
|
2673
2676
|
if (e)
|
|
2674
|
-
throw new
|
|
2677
|
+
throw new E.InvalidArgument("Arguments not allowed in db.delete()");
|
|
2675
2678
|
n.isBeingOpened ? n.dbReadyPromise.then(i) : i();
|
|
2676
2679
|
});
|
|
2677
2680
|
}
|
|
@@ -2699,7 +2702,7 @@ class pe {
|
|
|
2699
2702
|
return this._transaction.apply(this, e);
|
|
2700
2703
|
}
|
|
2701
2704
|
_transaction(e, n, r) {
|
|
2702
|
-
let s =
|
|
2705
|
+
let s = P.trans;
|
|
2703
2706
|
s && s.db === this && e.indexOf("!") === -1 || (s = null);
|
|
2704
2707
|
const i = e.indexOf("?") !== -1;
|
|
2705
2708
|
let o, u;
|
|
@@ -2714,19 +2717,19 @@ class pe {
|
|
|
2714
2717
|
o = wt;
|
|
2715
2718
|
else {
|
|
2716
2719
|
if (e != "rw" && e != _t)
|
|
2717
|
-
throw new
|
|
2720
|
+
throw new E.InvalidArgument("Invalid transaction mode: " + e);
|
|
2718
2721
|
o = _t;
|
|
2719
2722
|
}
|
|
2720
2723
|
if (s) {
|
|
2721
2724
|
if (s.mode === wt && o === _t) {
|
|
2722
2725
|
if (!i)
|
|
2723
|
-
throw new
|
|
2726
|
+
throw new E.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2724
2727
|
s = null;
|
|
2725
2728
|
}
|
|
2726
2729
|
s && u.forEach((c) => {
|
|
2727
2730
|
if (s && s.storeNames.indexOf(c) === -1) {
|
|
2728
2731
|
if (!i)
|
|
2729
|
-
throw new
|
|
2732
|
+
throw new E.SubTransaction("Table " + c + " not included in parent transaction.");
|
|
2730
2733
|
s = null;
|
|
2731
2734
|
}
|
|
2732
2735
|
}), i && s && !s.active && (s = null);
|
|
@@ -2737,11 +2740,11 @@ class pe {
|
|
|
2737
2740
|
}) : D(c);
|
|
2738
2741
|
}
|
|
2739
2742
|
const a = Zn.bind(null, this, o, u, s, r);
|
|
2740
|
-
return s ? s._promise(o, a, "lock") :
|
|
2743
|
+
return s ? s._promise(o, a, "lock") : P.trans ? Te(P.transless, () => this._whenReady(a)) : this._whenReady(a);
|
|
2741
2744
|
}
|
|
2742
2745
|
table(e) {
|
|
2743
2746
|
if (!z(this._allTables, e))
|
|
2744
|
-
throw new
|
|
2747
|
+
throw new E.InvalidTable(`Table ${e} does not exist`);
|
|
2745
2748
|
return this._allTables[e];
|
|
2746
2749
|
}
|
|
2747
2750
|
}
|
|
@@ -2784,8 +2787,8 @@ function Jr(t) {
|
|
|
2784
2787
|
return;
|
|
2785
2788
|
u = {};
|
|
2786
2789
|
const p = {}, v = function(y) {
|
|
2787
|
-
i &&
|
|
2788
|
-
const g = () => oe(t, { subscr: y, trans: null }), b =
|
|
2790
|
+
i && Ee();
|
|
2791
|
+
const g = () => oe(t, { subscr: y, trans: null }), b = P.trans ? Te(P.transless, g) : g();
|
|
2789
2792
|
return i && b.then(ne, ne), b;
|
|
2790
2793
|
}(p);
|
|
2791
2794
|
l || (ue(Le, f), l = !0), d = !0, Promise.resolve(v).then((y) => {
|
|
@@ -2813,17 +2816,17 @@ function at(t) {
|
|
|
2813
2816
|
Z = e;
|
|
2814
2817
|
}
|
|
2815
2818
|
}
|
|
2816
|
-
|
|
2819
|
+
Ce(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) => new ce(t, { addons: [] }).open().then((e) => (e.close(), !0)).catch("NoSuchDatabaseError", () => !1), getDatabaseNames(t) {
|
|
2817
2820
|
try {
|
|
2818
2821
|
return function({ indexedDB: e, IDBKeyRange: n }) {
|
|
2819
2822
|
return un(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== yt)) : an(e, n).toCollection().primaryKeys();
|
|
2820
2823
|
}(ce.dependencies).then(t);
|
|
2821
2824
|
} catch {
|
|
2822
|
-
return D(new
|
|
2825
|
+
return D(new E.MissingAPI());
|
|
2823
2826
|
}
|
|
2824
2827
|
}, defineClass: () => function(t) {
|
|
2825
2828
|
U(this, t);
|
|
2826
|
-
}, ignoreTransaction: (t) =>
|
|
2829
|
+
}, ignoreTransaction: (t) => P.trans ? Te(P.transless, t) : t(), vip: Yt, async: function(t) {
|
|
2827
2830
|
return function() {
|
|
2828
2831
|
try {
|
|
2829
2832
|
var e = Gt(t.apply(this, arguments));
|
|
@@ -2839,16 +2842,16 @@ Pe(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) =
|
|
|
2839
2842
|
} catch (s) {
|
|
2840
2843
|
return D(s);
|
|
2841
2844
|
}
|
|
2842
|
-
}, currentTransaction: { get: () =>
|
|
2845
|
+
}, currentTransaction: { get: () => P.trans || null }, waitFor: function(t, e) {
|
|
2843
2846
|
const n = S.resolve(typeof t == "function" ? ce.ignoreTransaction(t) : t).timeout(e || 6e4);
|
|
2844
|
-
return
|
|
2847
|
+
return P.trans ? P.trans.waitFor(n) : n;
|
|
2845
2848
|
}, Promise: S, debug: { get: () => G, set: (t) => {
|
|
2846
2849
|
Kn(t, t === "dexie" ? () => !0 : zn);
|
|
2847
|
-
} }, derive: ke, extend: U, props:
|
|
2850
|
+
} }, derive: ke, extend: U, props: Ce, override: Pn, Events: Ne, on: ue, liveQuery: Jr, extendObservabilitySet: tr, getByKeyPath: te, setByKeyPath: H, delByKeyPath: function(t, e) {
|
|
2848
2851
|
typeof e == "string" ? H(t, e, void 0) : "length" in e && [].map.call(e, function(n) {
|
|
2849
2852
|
H(t, n, void 0);
|
|
2850
2853
|
});
|
|
2851
|
-
}, shallowClone: An, deepClone: We, getObjectDiff: ln, cmp: L, asap:
|
|
2854
|
+
}, shallowClone: An, deepClone: We, getObjectDiff: ln, cmp: L, asap: En, minKey: Mt, addons: [], connections: $e, errnames: tn, dependencies: Qt, semVer: yn, version: yn.split(".").map((t) => parseInt(t)).reduce((t, e, n) => t + e / Math.pow(10, 2 * n)) }), ce.maxKey = Ue(ce.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (ue(Le, (t) => {
|
|
2852
2855
|
if (!Z) {
|
|
2853
2856
|
let e;
|
|
2854
2857
|
gt ? (e = document.createEvent("CustomEvent"), e.initCustomEvent(ie, !0, !0, t)) : e = new CustomEvent(ie, { detail: t }), Z = !0, dispatchEvent(e), Z = !1;
|
|
@@ -2891,7 +2894,7 @@ S.rejectionMapper = function(t, e) {
|
|
|
2891
2894
|
}, Kn(G, zn);
|
|
2892
2895
|
class Zr extends pe {
|
|
2893
2896
|
constructor() {
|
|
2894
|
-
super("NylasAuthDatabase"),
|
|
2897
|
+
super("NylasAuthDatabase"), Pt(this, "grant"), Pt(this, "pkce"), this.version(1).stores({
|
|
2895
2898
|
grant: "++id,token",
|
|
2896
2899
|
pkce: "++id,codeVerifier"
|
|
2897
2900
|
}), this.grant = this.table("grant"), this.pkce = this.table("pkce");
|
|
@@ -2899,7 +2902,7 @@ class Zr extends pe {
|
|
|
2899
2902
|
}
|
|
2900
2903
|
class es {
|
|
2901
2904
|
constructor() {
|
|
2902
|
-
|
|
2905
|
+
Pt(this, "theDB"), this.theDB = new Zr();
|
|
2903
2906
|
}
|
|
2904
2907
|
async setCodeVerifier(e) {
|
|
2905
2908
|
await this.theDB.pkce.put({ id: 1, codeVerifier: e }, 1);
|