@nylas/react 1.3.6 → 1.4.1

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.
Files changed (219) hide show
  1. package/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
  3. package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
  4. package/dist/archive-icon.entry-88459432.cjs +1 -0
  5. package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
  6. package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
  7. package/dist/bold-icon.entry-827e95bf.cjs +1 -0
  8. package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
  9. package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
  10. package/dist/button-component_2.entry-acd13f45.cjs +1 -0
  11. package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
  12. package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
  13. package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
  14. package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
  15. package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
  16. package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
  17. package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
  18. package/dist/calendar-icon.entry-a289313a.cjs +1 -0
  19. package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
  20. package/dist/checkbox-component.entry-f4f98226.js +43 -0
  21. package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
  22. package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
  23. package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
  24. package/dist/chevron-icon_3.entry-25533d13.js +148 -0
  25. package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
  26. package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
  27. package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
  28. package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
  29. package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
  30. package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
  31. package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
  32. package/dist/delete-icon.entry-96420b21.cjs +1 -0
  33. package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
  34. package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
  35. package/dist/elements/index.d.ts +10 -0
  36. package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
  37. package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
  38. package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
  39. package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
  40. package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
  41. package/dist/forward-icon.entry-af8d2147.js +16 -0
  42. package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
  43. package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
  44. package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
  45. package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
  46. package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
  47. package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
  48. package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
  49. package/dist/inbox-icon.entry-c005ebc5.js +16 -0
  50. package/dist/index-05630f15.cjs +57 -0
  51. package/dist/index-78390f2e.js +17607 -0
  52. package/dist/index.d.ts +1 -3
  53. package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
  54. package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
  55. package/dist/info-icon_2.entry-b17298b6.js +35 -0
  56. package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
  57. package/dist/input-component.entry-24366ab8.cjs +1 -0
  58. package/dist/input-component.entry-9da5da6c.js +84 -0
  59. package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
  60. package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
  61. package/dist/italic-icon.entry-afa4332a.cjs +1 -0
  62. package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
  63. package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
  64. package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
  65. package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
  66. package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
  67. package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
  68. package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
  69. package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
  70. package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
  71. package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
  72. package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
  73. package/dist/nylas-form-card.entry-62578338.cjs +1 -0
  74. package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
  75. package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
  76. package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
  77. package/dist/nylas-key-points.entry-449e1be0.js +29 -0
  78. package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
  79. package/dist/nylas-login.entry-36544dc8.cjs +1 -0
  80. package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
  81. package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
  82. package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
  83. package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
  84. package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
  85. package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
  86. package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
  87. package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
  88. package/dist/nylas-transcript.entry-b129565c.js +128 -0
  89. package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
  90. package/dist/nylas-video-player.entry-e208d443.js +39 -0
  91. package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
  92. package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
  93. package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
  94. package/dist/person-icon.entry-e4d11400.cjs +1 -0
  95. package/dist/play-icon.entry-68bc660a.js +16 -0
  96. package/dist/play-icon.entry-9cab598b.cjs +1 -0
  97. package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
  98. package/dist/radio-button-group.entry-f7679911.js +47 -0
  99. package/dist/react.cjs +1 -1
  100. package/dist/react.js +134 -125
  101. package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
  102. package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
  103. package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
  104. package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
  105. package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
  106. package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
  107. package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
  108. package/dist/reply-icon.entry-77342442.cjs +1 -0
  109. package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
  110. package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
  111. package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
  112. package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
  113. package/dist/sent-icon.entry-20a8945d.cjs +1 -0
  114. package/dist/sent-icon.entry-2d122865.js +16 -0
  115. package/dist/spam-icon.entry-86178cc5.cjs +1 -0
  116. package/dist/spam-icon.entry-9e374d44.js +16 -0
  117. package/dist/star-icon.entry-1b94c861.cjs +1 -0
  118. package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
  119. package/dist/stop-icon.entry-7b21833b.cjs +1 -0
  120. package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
  121. package/dist/textarea-component.entry-ba3c9311.js +39 -0
  122. package/dist/textarea-component.entry-fdba933d.cjs +1 -0
  123. package/dist/toggle-switch.entry-4a980d1d.js +34 -0
  124. package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
  125. package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
  126. package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
  127. package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
  128. package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
  129. package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
  130. package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
  131. package/dist/warning-icon.entry-b1480f57.cjs +1 -0
  132. package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
  133. package/package.json +12 -4
  134. package/dist/add-circle-icon.entry-25aecb13.js +0 -15
  135. package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
  136. package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
  137. package/dist/archive-icon.entry-89e31121.js +0 -15
  138. package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
  139. package/dist/bold-icon.entry-d591e701.cjs +0 -1
  140. package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
  141. package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
  142. package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
  143. package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
  144. package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
  145. package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
  146. package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
  147. package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
  148. package/dist/chevron-icon_3.entry-783588a9.js +0 -147
  149. package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
  150. package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
  151. package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
  152. package/dist/close-icon.entry-fef4f624.js +0 -15
  153. package/dist/constants-6da0ede7-151395ad.cjs +0 -1
  154. package/dist/copy-icon.entry-25699ab8.js +0 -15
  155. package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
  156. package/dist/core-js-38e53e34.cjs +0 -4
  157. package/dist/core-js-a9d3b6e1.js +0 -3297
  158. package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
  159. package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
  160. package/dist/dom-68f08be9.cjs +0 -15
  161. package/dist/dom-86e17616.js +0 -664
  162. package/dist/folder-icon.entry-351e61fc.cjs +0 -1
  163. package/dist/forward-icon.entry-0ccfb600.js +0 -15
  164. package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
  165. package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
  166. package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
  167. package/dist/google-logo-icon_4.entry-04174684.js +0 -790
  168. package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
  169. package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
  170. package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
  171. package/dist/index-7e7c24f1.js +0 -16837
  172. package/dist/index-81719cc6.cjs +0 -81
  173. package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
  174. package/dist/info-icon_2.entry-a6d0e842.js +0 -34
  175. package/dist/input-color-picker.entry-d98d06ca.js +0 -48
  176. package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
  177. package/dist/input-component.entry-2e57b00e.cjs +0 -1
  178. package/dist/input-component.entry-f3aa3419.js +0 -70
  179. package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
  180. package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
  181. package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
  182. package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
  183. package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
  184. package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
  185. package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
  186. package/dist/nylas-form-card.entry-67aec298.js +0 -57
  187. package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
  188. package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
  189. package/dist/nylas-login.entry-589e45d0.cjs +0 -1
  190. package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
  191. package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
  192. package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
  193. package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
  194. package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
  195. package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
  196. package/dist/person-icon.entry-36b21e95.cjs +0 -1
  197. package/dist/play-icon.entry-953b1bc8.js +0 -15
  198. package/dist/play-icon.entry-c35ade8a.cjs +0 -1
  199. package/dist/refresh-icon.entry-038501ca.cjs +0 -1
  200. package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
  201. package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
  202. package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
  203. package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
  204. package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
  205. package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
  206. package/dist/sent-icon.entry-ec433cec.js +0 -15
  207. package/dist/spam-icon.entry-3a553ae4.js +0 -15
  208. package/dist/spam-icon.entry-a79819fd.cjs +0 -1
  209. package/dist/star-icon.entry-47ea44e7.cjs +0 -1
  210. package/dist/stop-icon.entry-26e2e633.cjs +0 -1
  211. package/dist/textarea-component.entry-6939d0fc.js +0 -38
  212. package/dist/textarea-component.entry-da0a861e.cjs +0 -1
  213. package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
  214. package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
  215. package/dist/translate-icon.entry-72e0369e.cjs +0 -1
  216. package/dist/trash-fill-icon.entry-815859c6.js +0 -15
  217. package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
  218. package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
  219. package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { l as nr, d as T, u as rr, m as hn } from "./index-7e7c24f1.js";
1
+ import { n as nr, d as T, o as rr, q as bt } from "./index-78390f2e.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) => {
@@ -59,45 +59,59 @@ class sr {
59
59
  async registerComponent(e) {
60
60
  T(`~[${this.hostTagName}] (registerComponent) Registering component ${e.name}.`);
61
61
  const n = e.element.dataset.nylasId;
62
- if (n && this.registeredComponents[n]) {
63
- T(`[${this.hostTagName}] (registerComponent) Component ${e.name} already registered. Skipping.`);
64
- return;
62
+ n && this.registeredComponents[n] ? (T(`[${this.hostTagName}] (registerComponent) Component ${e.name} already registered. Updating registration.`), this.cleanupComponentRegistration(n, !1)) : e.element.dataset.nylasId = n || rr();
63
+ const s = e.element.dataset.nylasId;
64
+ s && (this.registeredComponents[s] = e), T(`[${this.hostTagName}] (registerComponent) Waiting for "${e.element.localName}" component to be defined`, { component: e });
65
+ try {
66
+ await customElements.whenDefined(e.element.tagName.toLowerCase()), T(`[${this.hostTagName}] (registerComponent) Component "${e.element.localName}" is now defined`);
67
+ } catch (p) {
68
+ T(`[${this.hostTagName}] (registerComponent) Error waiting for component "${e.element.localName}" to be defined:`, p);
65
69
  }
66
- T(`[${this.hostTagName}] (registerComponent) Checking if "${e.element.localName}" component is defined`, { component: e }), await customElements.whenDefined(e.element.tagName.toLowerCase());
67
- const { stateToProps: r, getStoresToProp: s, eventToProps: i, storeToProps: o, connectorToProp: u, localPropsToProp: a, element: c } = e;
68
- c.dataset.nylasId = rr(), this.registeredComponents[c.dataset.nylasId] = e;
69
- const d = this.eventOverrides;
70
- i == null || i.forEach((l, h) => {
71
- var y;
72
- const f = this.nylasConnector, m = async (g) => {
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);
74
- }, p = e.element.dataset.nylasId;
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.`);
76
- const v = hn(h.toString());
77
- T(`[${this.hostTagName}] (registerComponent) Adding event listener for "${v}" on "${c.tagName}"`), c.addEventListener(v, m);
78
- }), r == null || r.forEach((l, h) => {
79
- var y, g, b, k;
80
- const [f, m] = h.split("."), v = this.getStore(f).state[m];
81
- if (!c.dataset.nylasId) {
70
+ const i = this.eventOverrides, { stateToProps: o, getStoresToProp: l, eventToProps: a, storeToProps: c, connectorToProp: h, localPropsToProp: u, element: d } = e;
71
+ a == null || a.forEach((p, m) => {
72
+ var b;
73
+ const f = this.nylasConnector, v = async (w) => {
74
+ T(`[${this.hostTagName}] (registerComponent) Handling "${e.name}" prop "${String(m)}" event.`, { event: w }), m in i && (T(`[${this.hostTagName}] (registerComponent) Found event override for "${String(m)}" event. Calling override.`), await i[m](w, f)), w.defaultPrevented || await p(w, f);
75
+ }, y = e.element.dataset.nylasId;
76
+ y && !this.eventListenerRegistrations.has(y) && this.eventListenerRegistrations.set(y, []), y && ((b = this.eventListenerRegistrations.get(y)) == null || b.push([d, m, v])), T(`[${this.hostTagName}] (registerComponent) Setting "${e.name}" event "${String(m)}" to automcially call NylasConnector method.`);
77
+ const g = bt(m.toString());
78
+ T(`[${this.hostTagName}] (registerComponent) Adding event listener for "${g}" on "${d.tagName}"`), d.addEventListener(g, v);
79
+ }), o == null || o.forEach((p, m) => {
80
+ var b, w, C, k;
81
+ const [f, v] = m.split("."), g = this.getStore(f).state[v];
82
+ if (!d.dataset.nylasId) {
82
83
  T(`[${this.hostTagName}] (registerComponent) Component "${e.name}" not registered. Skipping.`, { component: e });
83
84
  return;
84
85
  }
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({
86
- elementId: c.dataset.nylasId,
87
- propKey: l
88
- }) : (g = this.propStateRegistrations.get(f)) == null || g.set(m, [
86
+ this.propStateRegistrations.has(f) || this.propStateRegistrations.set(f, /* @__PURE__ */ new Map()), (b = this.propStateRegistrations.get(f)) != null && b.has(v) ? (k = (C = this.propStateRegistrations.get(f)) == null ? void 0 : C.get(v)) == null || k.push({
87
+ elementId: d.dataset.nylasId,
88
+ propKey: p
89
+ }) : (w = this.propStateRegistrations.get(f)) == null || w.set(v, [
89
90
  {
90
- elementId: c.dataset.nylasId,
91
- propKey: l
91
+ elementId: d.dataset.nylasId,
92
+ propKey: p
92
93
  }
93
- ]), c[l.toString()] = v, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to "${h}" value.`, { stateValue: v });
94
- }), a == null || a.forEach((l, h) => {
95
- const f = this.host[h];
96
- c[l.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to the value of "${h}" value.`, { value: h, mappedPropValue: f });
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) => {
98
- const f = this.getStore(h);
99
- c[l.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to "${h}" store.`, { store: f });
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.`);
94
+ ]), d[p.toString()] = g, T(`[${this.hostTagName}] Setting "${e.name}" prop "${p.toString()}" to "${m}" value.`, { stateValue: g });
95
+ }), u == null || u.forEach((p, m) => {
96
+ const f = this.host[m];
97
+ d[p.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${p.toString()}" to the value of "${m}" value.`, { value: m, mappedPropValue: f });
98
+ }), l && (d[l == null ? void 0 : l.toString()] = this.getStore, T(`[${this.hostTagName}] Setting "${e.name}" prop "${l.toString()}" to "getStore" method.`)), c == null || c.forEach((p, m) => {
99
+ const f = this.getStore(m);
100
+ d[p.toString()] = f, T(`[${this.hostTagName}] Setting "${e.name}" prop "${p.toString()}" to "${m}" store.`, { store: f });
101
+ }), h && (d[h == null ? void 0 : h.toString()] = this.nylasConnector, T(`[${this.hostTagName}] Setting "${e.name}" prop "${h.toString()}" to "nylasConnector" value.`, { connectorToProp: h })), typeof d.registerCallback == "function" && (T(`[${this.hostTagName}] (registerComponent) Calling registerCallback method for "${e.name}".`), await d.registerCallback()), T(`[${this.hostTagName}] (registerComponent) Component ${e.name} registered.`);
102
+ }
103
+ cleanupComponentRegistration(e, n = !0) {
104
+ const r = this.eventListenerRegistrations.get(e);
105
+ r && (r.forEach(([s, i, o]) => {
106
+ const l = bt(i.toString());
107
+ T(`[${this.hostTagName}] (cleanupComponentRegistration) Removing event listener for "${l}" on "${s.tagName}"`), s.removeEventListener(l, o);
108
+ }), this.eventListenerRegistrations.delete(e)), this.propStateRegistrations.forEach((s, i) => {
109
+ s.forEach((o, l) => {
110
+ var c;
111
+ const a = o.filter((h) => h.elementId !== e);
112
+ a.length !== o.length && ((c = this.propStateRegistrations.get(i)) == null || c.set(l, a));
113
+ });
114
+ }), n && delete this.registeredComponents[e];
101
115
  }
102
116
  unregisterComponent(e) {
103
117
  T(`[${this.hostTagName}] Unregistering component ${e.name}.`);
@@ -111,16 +125,16 @@ class sr {
111
125
  return;
112
126
  }
113
127
  this.propStateRegistrations.forEach((s, i) => {
114
- s.forEach((o, u) => {
115
- var d, l;
116
- const a = (d = this.propStateRegistrations.get(i)) == null ? void 0 : d.get(u), c = a == null ? void 0 : a.filter((h) => h.elementId !== n);
117
- c && ((l = this.propStateRegistrations.get(i)) == null || l.set(u, c));
128
+ s.forEach((o, l) => {
129
+ var h, u;
130
+ const a = (h = this.propStateRegistrations.get(i)) == null ? void 0 : h.get(l), c = a == null ? void 0 : a.filter((d) => d.elementId !== n);
131
+ c && ((u = this.propStateRegistrations.get(i)) == null || u.set(l, c));
118
132
  });
119
133
  });
120
134
  const r = this.eventListenerRegistrations.get(n);
121
135
  r == null || r.forEach(([s, i, o]) => {
122
- const u = hn(i.toString());
123
- T(`[${this.hostTagName}] (unregisterComponent) Removing event listener for "${u}" on "${s.tagName}"`), s.removeEventListener(u, o);
136
+ const l = bt(i.toString());
137
+ T(`[${this.hostTagName}] (unregisterComponent) Removing event listener for "${l}" on "${s.tagName}"`), s.removeEventListener(l, o);
124
138
  }), delete this.registeredComponents[n];
125
139
  }
126
140
  getStore(e) {
@@ -139,8 +153,8 @@ class sr {
139
153
  T(`[${e.hostTagName}] (setupStoreListeners) Store "${n}" state "${s.toString()}" unchanged. Skipping.`);
140
154
  return;
141
155
  }
142
- const u = e.registeredComponents;
143
- if (!u) {
156
+ const l = e.registeredComponents;
157
+ if (!l) {
144
158
  T(`[${e.hostTagName}] (setupStoreListeners) No registered components found. Skipping.`);
145
159
  return;
146
160
  }
@@ -148,14 +162,14 @@ class sr {
148
162
  T(`[${e.hostTagName}] (setupStoreListeners) Found ${a.length} prop(s) registered for "${s.toString()}" store.`, {
149
163
  props: a,
150
164
  propStateRegistrations: e.propStateRegistrations
151
- }), a.forEach(({ elementId: d, propKey: l }) => {
152
- const h = u[d];
153
- if (!h) {
154
- T(`[${e.hostTagName}] (setupStoreListeners) Component "${d}" not found. Skipping.`, { component: h });
165
+ }), a.forEach(({ elementId: h, propKey: u }) => {
166
+ const d = l[h];
167
+ if (!d) {
168
+ T(`[${e.hostTagName}] (setupStoreListeners) Component "${h}" not found. Skipping.`, { component: d });
155
169
  return;
156
170
  }
157
171
  const m = e.getStore(n).state[s];
158
- h.element[l.toString()] = m, T(`[${e.hostTagName}] (setupStoreListeners) Setting "${h.name}" prop "${l.toString()}" to "${s.toString()}" value.`, { stateValue: m });
172
+ d.element[u.toString()] = m, T(`[${e.hostTagName}] (setupStoreListeners) Setting "${d.name}" prop "${u.toString()}" to "${s.toString()}" value.`, { stateValue: m });
159
173
  });
160
174
  }
161
175
  });
@@ -168,25 +182,25 @@ class sr {
168
182
  }
169
183
  class ns extends sr {
170
184
  }
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 || {});
185
+ 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, Et = (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 || {});
172
186
  const rs = (t) => t !== null && typeof t == "object" && "error" in t;
173
187
  async function dn(t) {
174
188
  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("");
175
189
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
176
190
  }
177
- const K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : nr, N = Object.keys, M = Array.isArray;
191
+ const R = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : nr, j = Object.keys, M = Array.isArray;
178
192
  function U(t, e) {
179
- return typeof e != "object" || N(e).forEach(function(n) {
193
+ return typeof e != "object" || j(e).forEach(function(n) {
180
194
  t[n] = e[n];
181
195
  }), t;
182
196
  }
183
- typeof Promise > "u" || K.Promise || (K.Promise = Promise);
184
- const Be = Object.getPrototypeOf, ur = {}.hasOwnProperty;
197
+ typeof Promise > "u" || R.Promise || (R.Promise = Promise);
198
+ const Be = Object.getPrototypeOf, lr = {}.hasOwnProperty;
185
199
  function z(t, e) {
186
- return ur.call(t, e);
200
+ return lr.call(t, e);
187
201
  }
188
202
  function Ce(t, e) {
189
- typeof e == "function" && (e = e(Be(t))), (typeof Reflect > "u" ? N : Reflect.ownKeys)(e).forEach((n) => {
203
+ typeof e == "function" && (e = e(Be(t))), (typeof Reflect > "u" ? j : Reflect.ownKeys)(e).forEach((n) => {
190
204
  ee(t, n, e[n]);
191
205
  });
192
206
  }
@@ -199,13 +213,13 @@ function ke(t) {
199
213
  return t.prototype = Object.create(e.prototype), ee(t.prototype, "constructor", t), { extend: Ce.bind(null, t.prototype) };
200
214
  } };
201
215
  }
202
- const lr = Object.getOwnPropertyDescriptor;
203
- function Jt(t, e) {
216
+ const ur = Object.getOwnPropertyDescriptor;
217
+ function Zt(t, e) {
204
218
  let n;
205
- return lr(t, e) || (n = Be(t)) && Jt(n, e);
219
+ return ur(t, e) || (n = Be(t)) && Zt(n, e);
206
220
  }
207
221
  const cr = [].slice;
208
- function ut(t, e, n) {
222
+ function lt(t, e, n) {
209
223
  return cr.call(t, e, n);
210
224
  }
211
225
  function Pn(t, e) {
@@ -216,7 +230,7 @@ function Ie(t) {
216
230
  throw new Error("Assertion Failed");
217
231
  }
218
232
  function En(t) {
219
- K.setImmediate ? setImmediate(t) : setTimeout(t, 0);
233
+ R.setImmediate ? setImmediate(t) : setTimeout(t, 0);
220
234
  }
221
235
  function Tn(t, e) {
222
236
  return t.reduce((n, r, s) => {
@@ -238,8 +252,8 @@ function te(t, e) {
238
252
  }
239
253
  var o = e.indexOf(".");
240
254
  if (o !== -1) {
241
- var u = t[e.substr(0, o)];
242
- return u === void 0 ? void 0 : te(u, e.substr(o + 1));
255
+ var l = t[e.substr(0, o)];
256
+ return l === void 0 ? void 0 : te(l, e.substr(o + 1));
243
257
  }
244
258
  }
245
259
  function H(t, e, n) {
@@ -251,12 +265,12 @@ function H(t, e, n) {
251
265
  } else {
252
266
  var i = e.indexOf(".");
253
267
  if (i !== -1) {
254
- var o = e.substr(0, i), u = e.substr(i + 1);
255
- if (u === "")
268
+ var o = e.substr(0, i), l = e.substr(i + 1);
269
+ if (l === "")
256
270
  n === void 0 ? M(t) && !isNaN(parseInt(o)) ? t.splice(o, 1) : delete t[o] : t[o] = n;
257
271
  else {
258
272
  var a = t[o];
259
- a && z(t, o) || (a = t[o] = {}), H(a, u, n);
273
+ a && z(t, o) || (a = t[o] = {}), H(a, l, n);
260
274
  }
261
275
  } else
262
276
  n === void 0 ? M(t) && !isNaN(parseInt(e)) ? t.splice(e, 1) : delete t[e] : t[e] = n;
@@ -272,15 +286,15 @@ const hr = [].concat;
272
286
  function On(t) {
273
287
  return hr.apply([], t);
274
288
  }
275
- const In = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(On([8, 16, 32, 64].map((t) => ["Int", "Uint", "Float"].map((e) => e + t + "Array")))).filter((t) => K[t]), dr = In.map((t) => K[t]);
289
+ const In = "Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(On([8, 16, 32, 64].map((t) => ["Int", "Uint", "Float"].map((e) => e + t + "Array")))).filter((t) => R[t]), dr = In.map((t) => R[t]);
276
290
  Tn(In, (t) => [t, !0]);
277
291
  let se = null;
278
292
  function We(t) {
279
293
  se = typeof WeakMap < "u" && /* @__PURE__ */ new WeakMap();
280
- const e = Et(t);
294
+ const e = Tt(t);
281
295
  return se = null, e;
282
296
  }
283
- function Et(t) {
297
+ function Tt(t) {
284
298
  if (!t || typeof t != "object")
285
299
  return t;
286
300
  let e = se && se.get(t);
@@ -289,23 +303,23 @@ function Et(t) {
289
303
  if (M(t)) {
290
304
  e = [], se && se.set(t, e);
291
305
  for (var n = 0, r = t.length; n < r; ++n)
292
- e.push(Et(t[n]));
306
+ e.push(Tt(t[n]));
293
307
  } else if (dr.indexOf(t.constructor) >= 0)
294
308
  e = t;
295
309
  else {
296
310
  const i = Be(t);
297
311
  for (var s in e = i === Object.prototype ? {} : Object.create(i), se && se.set(t, e), t)
298
- z(t, s) && (e[s] = Et(t[s]));
312
+ z(t, s) && (e[s] = Tt(t[s]));
299
313
  }
300
314
  return e;
301
315
  }
302
316
  const { toString: fr } = {};
303
- function Tt(t) {
317
+ function At(t) {
304
318
  return fr.call(t).slice(8, -1);
305
319
  }
306
- const At = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", pr = typeof At == "symbol" ? function(t) {
320
+ const Ot = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", pr = typeof Ot == "symbol" ? function(t) {
307
321
  var e;
308
- return t != null && (e = t[At]) && e.apply(t);
322
+ return t != null && (e = t[Ot]) && e.apply(t);
309
323
  } : function() {
310
324
  return null;
311
325
  }, _e = {};
@@ -334,12 +348,12 @@ function J(t) {
334
348
  n[e] = arguments[e];
335
349
  return n;
336
350
  }
337
- const Zt = typeof Symbol < "u" ? (t) => t[Symbol.toStringTag] === "AsyncFunction" : () => !1;
351
+ const en = typeof Symbol < "u" ? (t) => t[Symbol.toStringTag] === "AsyncFunction" : () => !1;
338
352
  var G = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
339
- function Kn(t, e) {
340
- G = t, jn = e;
353
+ function Rn(t, e) {
354
+ G = t, $n = e;
341
355
  }
342
- var jn = () => !0;
356
+ var $n = () => !0;
343
357
  const mr = !new Error("").stack;
344
358
  function Pe() {
345
359
  if (mr)
@@ -350,35 +364,35 @@ function Pe() {
350
364
  }
351
365
  return new Error();
352
366
  }
353
- function Ot(t, e) {
367
+ function It(t, e) {
354
368
  var n = t.stack;
355
369
  return n ? (e = e || 0, n.indexOf(t.name) === 0 && (e += (t.name + t.message).split(`
356
370
  `).length), n.split(`
357
- `).slice(e).filter(jn).map((r) => `
371
+ `).slice(e).filter($n).map((r) => `
358
372
  ` + r).join("")) : "";
359
373
  }
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" };
374
+ var Nn = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], tn = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Nn), 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" };
361
375
  function xe(t, e) {
362
376
  this._e = Pe(), this.name = t, this.message = e;
363
377
  }
364
- function $n(t, e) {
378
+ function Kn(t, e) {
365
379
  return t + ". Errors: " + Object.keys(e).map((n) => e[n].toString()).filter((n, r, s) => s.indexOf(n) === r).join(`
366
380
  `);
367
381
  }
368
- function lt(t, e, n, r) {
369
- this._e = Pe(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = $n(t, e);
382
+ function ut(t, e, n, r) {
383
+ this._e = Pe(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = Kn(t, e);
370
384
  }
371
- function je(t, 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);
385
+ function $e(t, e) {
386
+ this._e = Pe(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message = Kn(t, e);
373
387
  }
374
388
  ke(xe).from(Error).extend({ stack: { get: function() {
375
- return this._stack || (this._stack = this.name + ": " + this.message + Ot(this._e, 2));
389
+ return this._stack || (this._stack = this.name + ": " + this.message + It(this._e, 2));
376
390
  } }, toString: function() {
377
391
  return this.name + ": " + this.message;
378
- } }), ke(lt).from(xe), ke(je).from(xe);
379
- var tn = en.reduce((t, e) => (t[e] = e + "Error", t), {});
392
+ } }), ke(ut).from(xe), ke($e).from(xe);
393
+ var nn = tn.reduce((t, e) => (t[e] = e + "Error", t), {});
380
394
  const yr = xe;
381
- var E = en.reduce((t, e) => {
395
+ var E = tn.reduce((t, e) => {
382
396
  var n = e + "Error";
383
397
  function r(s, i) {
384
398
  this._e = Pe(), this.name = n, s ? typeof s == "string" ? (this.message = `${s}${i ? `
@@ -387,7 +401,7 @@ var E = en.reduce((t, e) => {
387
401
  return ke(r).from(yr), t[e] = r, t;
388
402
  }, {});
389
403
  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), {});
404
+ var fn = Nn.reduce((t, e) => (t[e + "Error"] = E[e], t), {}), tt = tn.reduce((t, e) => (["Syntax", "Type", "Range"].indexOf(e) === -1 && (t[e + "Error"] = E[e]), t), {});
391
405
  function I() {
392
406
  }
393
407
  function Fe(t) {
@@ -435,7 +449,7 @@ function kr(t, e) {
435
449
  return e.apply(this, arguments) !== !1 && t.apply(this, arguments);
436
450
  };
437
451
  }
438
- function nn(t, e) {
452
+ function rn(t, e) {
439
453
  return t === I ? e : function() {
440
454
  var n = t.apply(this, arguments);
441
455
  if (n && typeof n.then == "function") {
@@ -448,34 +462,34 @@ function nn(t, e) {
448
462
  return e.apply(this, arguments);
449
463
  };
450
464
  }
451
- tt.ModifyError = lt, tt.DexieError = xe, tt.BulkError = je;
465
+ tt.ModifyError = ut, tt.DexieError = xe, tt.BulkError = $e;
452
466
  var Me = {};
453
- const Nn = 100, [It, ct, Kt] = typeof Promise > "u" ? [] : (() => {
467
+ const jn = 100, [Rt, ct, $t] = typeof Promise > "u" ? [] : (() => {
454
468
  let t = Promise.resolve();
455
469
  if (typeof crypto > "u" || !crypto.subtle)
456
470
  return [t, Be(t), t];
457
471
  const e = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
458
472
  return [e, Be(e), t];
459
- })(), Dn = ct && ct.then, nt = It && It.constructor, rn = !!Kt;
460
- var jt = !1, xr = Kt ? () => {
461
- Kt.then(Ye);
462
- } : K.setImmediate ? setImmediate.bind(null, Ye) : K.MutationObserver ? () => {
473
+ })(), Dn = ct && ct.then, nt = Rt && Rt.constructor, sn = !!$t;
474
+ var Nt = !1, xr = $t ? () => {
475
+ $t.then(Ye);
476
+ } : R.setImmediate ? setImmediate.bind(null, Ye) : R.MutationObserver ? () => {
463
477
  var t = document.createElement("div");
464
478
  new MutationObserver(() => {
465
479
  Ye(), t = null;
466
480
  }).observe(t, { attributes: !0 }), t.setAttribute("i", "1");
467
481
  } : () => {
468
482
  setTimeout(Ye, 0);
469
- }, Re = function(t, e) {
470
- Ke.push([t, e]), ht && (xr(), ht = !1);
471
- }, Rt = !0, ht = !0, de = [], rt = [], $t = null, Nt = Fe, Se = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: gn, pgp: !1, env: {}, finalize: function() {
483
+ }, Ne = function(t, e) {
484
+ Re.push([t, e]), ht && (xr(), ht = !1);
485
+ }, Kt = !0, ht = !0, de = [], rt = [], jt = null, Dt = Fe, Se = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: gn, pgp: !1, env: {}, finalize: function() {
472
486
  this.unhandleds.forEach((t) => {
473
487
  try {
474
488
  gn(t[0], t[1]);
475
489
  } catch {
476
490
  }
477
491
  });
478
- } }, P = Se, Ke = [], fe = 0, st = [];
492
+ } }, P = Se, Re = [], fe = 0, st = [];
479
493
  function S(t) {
480
494
  if (typeof this != "object")
481
495
  throw new TypeError("Promises must be constructed via new");
@@ -484,25 +498,25 @@ function S(t) {
484
498
  if (G && (this._stackHolder = Pe(), this._prev = null, this._numPrev = 0), typeof t != "function") {
485
499
  if (t !== Me)
486
500
  throw new TypeError("Not a function");
487
- return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Bt(this, this._value));
501
+ return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Ft(this, this._value));
488
502
  }
489
503
  this._state = null, this._value = null, ++e.ref, Fn(this, t);
490
504
  }
491
- const Dt = { get: function() {
505
+ const Bt = { get: function() {
492
506
  var t = P, e = dt;
493
507
  function n(r, s) {
494
508
  var i = !t.global && (t !== P || e !== dt);
495
509
  const o = i && !ne();
496
- var u = new S((a, c) => {
497
- sn(this, new Bn(ft(r, t, i, o), ft(s, t, i, o), a, c, t));
510
+ var l = new S((a, c) => {
511
+ on(this, new Bn(ft(r, t, i, o), ft(s, t, i, o), a, c, t));
498
512
  });
499
- return G && Ln(u, this), u;
513
+ return G && Ln(l, this), l;
500
514
  }
501
515
  return n.prototype = Me, n;
502
516
  }, set: function(t) {
503
- ee(this, "then", t && t.prototype === Me ? Dt : { get: function() {
517
+ ee(this, "then", t && t.prototype === Me ? Bt : { get: function() {
504
518
  return t;
505
- }, set: Dt.set });
519
+ }, set: Bt.set });
506
520
  } };
507
521
  function Bn(t, e, n, r, s) {
508
522
  this.onFulfilled = typeof t == "function" ? t : null, this.onRejected = typeof e == "function" ? e : null, this.resolve = n, this.reject = r, this.psd = s;
@@ -518,23 +532,23 @@ function Fn(t, e) {
518
532
  n instanceof S ? n._then(s, i) : n.then(s, i);
519
533
  }) : (t._state = !0, t._value = n, Mn(t)), r && He();
520
534
  }
521
- }, Bt.bind(null, t));
535
+ }, Ft.bind(null, t));
522
536
  } catch (n) {
523
- Bt(t, n);
537
+ Ft(t, n);
524
538
  }
525
539
  }
526
- function Bt(t, e) {
540
+ function Ft(t, e) {
527
541
  if (rt.push(e), t._state === null) {
528
542
  var n = t._lib && ze();
529
- e = Nt(e), t._state = !1, t._value = e, G && e !== null && typeof e == "object" && !e._promise && function(r, s, i) {
543
+ e = Dt(e), t._state = !1, t._value = e, G && e !== null && typeof e == "object" && !e._promise && function(r, s, i) {
530
544
  try {
531
545
  r.apply(null, i);
532
546
  } catch (o) {
533
547
  s && s(o);
534
548
  }
535
549
  }(() => {
536
- var r = Jt(e, "stack");
537
- e._promise = t, ee(e, "stack", { get: () => jt ? r && (r.get ? r.get.apply(e) : r.value) : t.stack });
550
+ var r = Zt(e, "stack");
551
+ e._promise = t, ee(e, "stack", { get: () => Nt ? r && (r.get ? r.get.apply(e) : r.value) : t.stack });
538
552
  }), function(r) {
539
553
  de.some((s) => s._value === r._value) || de.push(r);
540
554
  }(t), Mn(t), n && He();
@@ -544,24 +558,24 @@ function Mn(t) {
544
558
  var e = t._listeners;
545
559
  t._listeners = [];
546
560
  for (var n = 0, r = e.length; n < r; ++n)
547
- sn(t, e[n]);
561
+ on(t, e[n]);
548
562
  var s = t._PSD;
549
- --s.ref || s.finalize(), fe === 0 && (++fe, Re(() => {
550
- --fe == 0 && on();
563
+ --s.ref || s.finalize(), fe === 0 && (++fe, Ne(() => {
564
+ --fe == 0 && an();
551
565
  }, []));
552
566
  }
553
- function sn(t, e) {
567
+ function on(t, e) {
554
568
  if (t._state !== null) {
555
569
  var n = t._state ? e.onFulfilled : e.onRejected;
556
570
  if (n === null)
557
571
  return (t._state ? e.resolve : e.reject)(t._value);
558
- ++e.psd.ref, ++fe, Re(Sr, [n, t, e]);
572
+ ++e.psd.ref, ++fe, Ne(Sr, [n, t, e]);
559
573
  } else
560
574
  t._listeners.push(e);
561
575
  }
562
576
  function Sr(t, e, n) {
563
577
  try {
564
- $t = e;
578
+ jt = e;
565
579
  var r, s = e._value;
566
580
  e._state ? r = t(s) : (rt.length && (rt = []), r = t(s), rt.indexOf(s) === -1 && function(i) {
567
581
  for (var o = de.length; o; )
@@ -571,7 +585,7 @@ function Sr(t, e, n) {
571
585
  } catch (i) {
572
586
  n.reject(i);
573
587
  } finally {
574
- $t = null, --fe == 0 && on(), --n.psd.ref || n.psd.finalize();
588
+ jt = null, --fe == 0 && an(), --n.psd.ref || n.psd.finalize();
575
589
  }
576
590
  }
577
591
  function qn(t, e, n) {
@@ -580,9 +594,9 @@ function qn(t, e, n) {
580
594
  var r = "";
581
595
  if (t._state === !1) {
582
596
  var s, i, o = t._value;
583
- o != null ? (s = o.name || "Error", i = o.message || o, r = Ot(o, 0)) : (s = o, i = ""), e.push(s + (i ? ": " + i : "") + r);
597
+ o != null ? (s = o.name || "Error", i = o.message || o, r = It(o, 0)) : (s = o, i = ""), e.push(s + (i ? ": " + i : "") + r);
584
598
  }
585
- return G && ((r = Ot(t._stackHolder, 2)) && e.indexOf(r) === -1 && e.push(r), t._prev && qn(t._prev, e, n)), e;
599
+ return G && ((r = It(t._stackHolder, 2)) && e.indexOf(r) === -1 && e.push(r), t._prev && qn(t._prev, e, n)), e;
586
600
  }
587
601
  function Ln(t, e) {
588
602
  var n = e ? e._numPrev + 1 : 0;
@@ -592,21 +606,21 @@ function Ye() {
592
606
  ze() && He();
593
607
  }
594
608
  function ze() {
595
- var t = Rt;
596
- return Rt = !1, ht = !1, t;
609
+ var t = Kt;
610
+ return Kt = !1, ht = !1, t;
597
611
  }
598
612
  function He() {
599
613
  var t, e, n;
600
614
  do
601
- for (; Ke.length > 0; )
602
- for (t = Ke, Ke = [], n = t.length, e = 0; e < n; ++e) {
615
+ for (; Re.length > 0; )
616
+ for (t = Re, Re = [], n = t.length, e = 0; e < n; ++e) {
603
617
  var r = t[e];
604
618
  r[0].apply(null, r[1]);
605
619
  }
606
- while (Ke.length > 0);
607
- Rt = !0, ht = !0;
620
+ while (Re.length > 0);
621
+ Kt = !0, ht = !0;
608
622
  }
609
- function on() {
623
+ function an() {
610
624
  var t = de;
611
625
  de = [], t.forEach((r) => {
612
626
  r._PSD.onunhandled.call(null, r._value, r);
@@ -617,7 +631,7 @@ function on() {
617
631
  function Ge(t) {
618
632
  return new S(Me, !1, t);
619
633
  }
620
- function j(t, e) {
634
+ function $(t, e) {
621
635
  var n = P;
622
636
  return function() {
623
637
  var r = ze(), s = P;
@@ -630,8 +644,8 @@ function j(t, e) {
630
644
  }
631
645
  };
632
646
  }
633
- Ce(S.prototype, { then: Dt, _then: function(t, e) {
634
- sn(this, new Bn(null, null, t, e, P));
647
+ Ce(S.prototype, { then: Bt, _then: function(t, e) {
648
+ on(this, new Bn(null, null, t, e, P));
635
649
  }, catch: function(t) {
636
650
  if (arguments.length === 1)
637
651
  return this.then(null, t);
@@ -643,12 +657,12 @@ Ce(S.prototype, { then: Dt, _then: function(t, e) {
643
657
  if (this._stack)
644
658
  return this._stack;
645
659
  try {
646
- jt = !0;
660
+ Nt = !0;
647
661
  var t = qn(this, [], 20).join(`
648
662
  From previous: `);
649
663
  return this._state !== null && (this._stack = t), t;
650
664
  } finally {
651
- jt = !1;
665
+ Nt = !1;
652
666
  }
653
667
  } }, timeout: function(t, e) {
654
668
  return t < 1 / 0 ? new S((n, r) => {
@@ -672,25 +686,25 @@ From previous: `);
672
686
  t.then(n, r);
673
687
  });
674
688
  var e = new S(Me, !0, t);
675
- return Ln(e, $t), e;
689
+ return Ln(e, jt), e;
676
690
  }, reject: Ge, race: function() {
677
691
  var t = J.apply(null, arguments).map(Xe);
678
692
  return new S((e, n) => {
679
693
  t.map((r) => S.resolve(r).then(e, n));
680
694
  });
681
- }, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => dt }, newPSD: oe, usePSD: Te, scheduler: { get: () => Re, set: (t) => {
682
- Re = t;
683
- } }, rejectionMapper: { get: () => Nt, set: (t) => {
684
- Nt = t;
695
+ }, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => dt }, newPSD: oe, usePSD: Te, scheduler: { get: () => Ne, set: (t) => {
696
+ Ne = t;
697
+ } }, rejectionMapper: { get: () => Dt, set: (t) => {
698
+ Dt = t;
685
699
  } }, follow: (t, e) => new S((n, r) => oe((s, i) => {
686
700
  var o = P;
687
701
  o.unhandleds = [], o.onunhandled = i, o.finalize = me(function() {
688
- (function(u) {
702
+ (function(l) {
689
703
  function a() {
690
- u(), st.splice(st.indexOf(a), 1);
704
+ l(), st.splice(st.indexOf(a), 1);
691
705
  }
692
- st.push(a), ++fe, Re(() => {
693
- --fe == 0 && on();
706
+ st.push(a), ++fe, Ne(() => {
707
+ --fe == 0 && an();
694
708
  }, []);
695
709
  })(() => {
696
710
  this.unhandleds.length === 0 ? s() : i(this.unhandleds[0]);
@@ -710,28 +724,28 @@ From previous: `);
710
724
  t.length === 0 && n(new AggregateError([]));
711
725
  let r = t.length;
712
726
  const s = new Array(r);
713
- t.forEach((i, o) => S.resolve(i).then((u) => e(u), (u) => {
714
- s[o] = u, --r || n(new AggregateError(s));
727
+ t.forEach((i, o) => S.resolve(i).then((l) => e(l), (l) => {
728
+ s[o] = l, --r || n(new AggregateError(s));
715
729
  }));
716
730
  });
717
731
  }));
718
732
  const F = { awaits: 0, echoes: 0, id: 0 };
719
- var Cr = 0, it = [], bt = 0, dt = 0, Pr = 0;
733
+ var Cr = 0, it = [], wt = 0, dt = 0, Pr = 0;
720
734
  function oe(t, e, n, r) {
721
735
  var s = P, i = Object.create(s);
722
736
  i.parent = s, i.ref = 0, i.global = !1, i.id = ++Pr;
723
737
  var o = Se.env;
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() {
738
+ i.env = sn ? { 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() {
725
739
  --this.parent.ref || this.parent.finalize();
726
740
  };
727
- var u = Te(i, t, n, r);
728
- return i.ref === 0 && i.finalize(), u;
741
+ var l = Te(i, t, n, r);
742
+ return i.ref === 0 && i.finalize(), l;
729
743
  }
730
744
  function Ee() {
731
- return F.id || (F.id = ++Cr), ++F.awaits, F.echoes += Nn, F.id;
745
+ return F.id || (F.id = ++Cr), ++F.awaits, F.echoes += jn, F.id;
732
746
  }
733
747
  function ne() {
734
- return !!F.awaits && (--F.awaits == 0 && (F.id = 0), F.echoes = F.awaits * Nn, !0);
748
+ return !!F.awaits && (--F.awaits == 0 && (F.id = 0), F.echoes = F.awaits * jn, !0);
735
749
  }
736
750
  function Xe(t) {
737
751
  return F.echoes && t && t.constructor === nt ? (Ee(), t.then((e) => (ne(), e), (e) => (ne(), D(e)))) : t;
@@ -745,14 +759,14 @@ function Tr() {
745
759
  }
746
760
  function ae(t, e) {
747
761
  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)) {
762
+ if ((e ? !F.echoes || wt++ && t === P : !wt || --wt && t === P) || Vn(e ? Er.bind(null, t) : Tr), t !== P && (P = t, n === Se && (Se.env = Un()), sn)) {
749
763
  var r = Se.env.Promise, s = t.env;
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));
764
+ ct.then = s.nthen, r.prototype.then = s.gthen, (n.global || t.global) && (Object.defineProperty(R, "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));
751
765
  }
752
766
  }
753
767
  function Un() {
754
- var t = K.Promise;
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 } : {};
768
+ var t = R.Promise;
769
+ return sn ? { Promise: t, PromiseProp: Object.getOwnPropertyDescriptor(R, "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 } : {};
756
770
  }
757
771
  function Te(t, e, n, r, s) {
758
772
  var i = P;
@@ -763,7 +777,7 @@ function Te(t, e, n, r, s) {
763
777
  }
764
778
  }
765
779
  function Vn(t) {
766
- Dn.call(It, t);
780
+ Dn.call(Rt, t);
767
781
  }
768
782
  function ft(t, e, n, r) {
769
783
  return typeof t != "function" ? t : function() {
@@ -792,9 +806,9 @@ function gn(t, e) {
792
806
  if (n !== !1)
793
807
  try {
794
808
  var r, s = { promise: e, reason: t };
795
- if (K.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(mn, !0, !0), U(r, s)) : K.CustomEvent && U(r = new CustomEvent(mn, { detail: s }), s), r && K.dispatchEvent && (dispatchEvent(r), !K.PromiseRejectionEvent && K.onunhandledrejection))
809
+ if (R.document && document.createEvent ? ((r = document.createEvent("Event")).initEvent(mn, !0, !0), U(r, s)) : R.CustomEvent && U(r = new CustomEvent(mn, { detail: s }), s), r && R.dispatchEvent && (dispatchEvent(r), !R.PromiseRejectionEvent && R.onunhandledrejection))
796
810
  try {
797
- K.onunhandledrejection(r);
811
+ R.onunhandledrejection(r);
798
812
  } catch {
799
813
  }
800
814
  G && r && !r.defaultPrevented && console.warn(`Unhandled rejection: ${t.stack || t}`);
@@ -802,13 +816,13 @@ function gn(t, e) {
802
816
  }
803
817
  }
804
818
  var D = S.reject;
805
- function Ft(t, e, n, r) {
819
+ function Mt(t, e, n, r) {
806
820
  if (t.idbdb && (t._state.openComplete || P.letThrough || t._vip)) {
807
821
  var s = t._createTransaction(e, n, t._dbSchema);
808
822
  try {
809
823
  s.create(), t._state.PR1398_maxLoop = 3;
810
824
  } catch (i) {
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);
825
+ return i.name === nn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Mt(t, e, n, r))) : D(i);
812
826
  }
813
827
  return s._promise(e, (i, o) => oe(() => (P.trans = s, r(i, o, s)))).then((i) => s._completion.then(() => i));
814
828
  }
@@ -819,9 +833,9 @@ function Ft(t, e, n, r) {
819
833
  return D(new E.DatabaseClosed());
820
834
  t.open().catch(I);
821
835
  }
822
- return t._state.dbReadyPromise.then(() => Ft(t, e, n, r));
836
+ return t._state.dbReadyPromise.then(() => Mt(t, e, n, r));
823
837
  }
824
- const yn = "3.2.4", he = String.fromCharCode(65535), Mt = -1 / 0, X = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Wn = "String expected.", $e = [], gt = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Ar = gt, Or = gt, zn = (t) => !/(dexie\.js|dexie\.min\.js)/.test(t), yt = "__dbnames", wt = "readonly", _t = "readwrite";
838
+ const yn = "3.2.4", he = String.fromCharCode(65535), qt = -1 / 0, X = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Wn = "String expected.", Ke = [], gt = typeof navigator < "u" && /(MSIE|Trident|Edge)/.test(navigator.userAgent), Ar = gt, Or = gt, zn = (t) => !/(dexie\.js|dexie\.min\.js)/.test(t), yt = "__dbnames", _t = "readonly", kt = "readwrite";
825
839
  function ge(t, e) {
826
840
  return t ? e ? function() {
827
841
  return t.apply(this, arguments) && e.apply(this, arguments);
@@ -834,16 +848,16 @@ function Qe(t) {
834
848
  class Ir {
835
849
  _trans(e, n, r) {
836
850
  const s = this._tx || P.trans, i = this.name;
837
- function o(a, c, d) {
838
- if (!d.schema[i])
851
+ function o(a, c, h) {
852
+ if (!h.schema[i])
839
853
  throw new E.NotFound("Table " + i + " not part of transaction");
840
- return n(d.idbtrans, d);
854
+ return n(h.idbtrans, h);
841
855
  }
842
- const u = ze();
856
+ const l = ze();
843
857
  try {
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);
858
+ 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 }) : Mt(this.db, e, [this.name], o);
845
859
  } finally {
846
- u && He();
860
+ l && He();
847
861
  }
848
862
  }
849
863
  get(e, n) {
@@ -854,29 +868,29 @@ class Ir {
854
868
  return new this.db.WhereClause(this, e);
855
869
  if (M(e))
856
870
  return new this.db.WhereClause(this, `[${e.join("+")}]`);
857
- const n = N(e);
871
+ const n = j(e);
858
872
  if (n.length === 1)
859
873
  return this.where(n[0]).equals(e[n[0]]);
860
- const r = this.schema.indexes.concat(this.schema.primKey).filter((c) => c.compound && n.every((d) => c.keyPath.indexOf(d) >= 0) && c.keyPath.every((d) => n.indexOf(d) >= 0))[0];
874
+ const r = this.schema.indexes.concat(this.schema.primKey).filter((c) => c.compound && n.every((h) => c.keyPath.indexOf(h) >= 0) && c.keyPath.every((h) => n.indexOf(h) >= 0))[0];
861
875
  if (r && this.db._maxKey !== he)
862
876
  return this.where(r.name).equals(r.keyPath.map((c) => e[c]));
863
877
  !r && G && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);
864
878
  const { idxByName: s } = this.schema, i = this.db._deps.indexedDB;
865
- function o(c, d) {
879
+ function o(c, h) {
866
880
  try {
867
- return i.cmp(c, d) === 0;
881
+ return i.cmp(c, h) === 0;
868
882
  } catch {
869
883
  return !1;
870
884
  }
871
885
  }
872
- const [u, a] = n.reduce(([c, d], l) => {
873
- const h = s[l], f = e[l];
874
- return [c || h, c || !h ? ge(d, h && h.multi ? (m) => {
875
- const p = te(m, l);
876
- return M(p) && p.some((v) => o(f, v));
877
- } : (m) => o(f, te(m, l))) : d];
886
+ const [l, a] = n.reduce(([c, h], u) => {
887
+ const d = s[u], p = e[u];
888
+ return [c || d, c || !d ? ge(h, d && d.multi ? (m) => {
889
+ const f = te(m, u);
890
+ return M(f) && f.some((v) => o(p, v));
891
+ } : (m) => o(p, te(m, u))) : h];
878
892
  }, [null, null]);
879
- return u ? this.where(u.name).equals(e[u.keyPath]).filter(a) : r ? this.filter(a) : this.where(n).equals("");
893
+ return l ? this.where(l.name).equals(e[l.keyPath]).filter(a) : r ? this.filter(a) : this.where(n).equals("");
880
894
  }
881
895
  filter(e) {
882
896
  return this.toCollection().and(e);
@@ -946,7 +960,7 @@ class Ir {
946
960
  if (r === void 0)
947
961
  return D(new E.InvalidArgument("Given object does not contain its primary key"));
948
962
  try {
949
- typeof n != "function" ? N(n).forEach((s) => {
963
+ typeof n != "function" ? j(n).forEach((s) => {
950
964
  H(e, s, n[s]);
951
965
  }) : n(e, { value: e, primKey: r });
952
966
  } catch {
@@ -978,34 +992,34 @@ class Ir {
978
992
  bulkAdd(e, n, r) {
979
993
  const s = Array.isArray(n) ? n : void 0, i = (r = r || (s ? void 0 : n)) ? r.allKeys : void 0;
980
994
  return this._trans("readwrite", (o) => {
981
- const { auto: u, keyPath: a } = this.schema.primKey;
995
+ const { auto: l, keyPath: a } = this.schema.primKey;
982
996
  if (a && s)
983
997
  throw new E.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
984
998
  if (s && s.length !== e.length)
985
999
  throw new E.InvalidArgument("Arguments objects and keys must have the same length");
986
1000
  const c = e.length;
987
- let d = a && u ? e.map(Qe(a)) : e;
988
- return this.core.mutate({ trans: o, type: "add", keys: s, values: d, wantResults: i }).then(({ numFailures: l, results: h, lastResult: f, failures: m }) => {
989
- if (l === 0)
990
- return i ? h : f;
991
- throw new je(`${this.name}.bulkAdd(): ${l} of ${c} operations failed`, m);
1001
+ let h = a && l ? e.map(Qe(a)) : e;
1002
+ return this.core.mutate({ trans: o, type: "add", keys: s, values: h, wantResults: i }).then(({ numFailures: u, results: d, lastResult: p, failures: m }) => {
1003
+ if (u === 0)
1004
+ return i ? d : p;
1005
+ throw new $e(`${this.name}.bulkAdd(): ${u} of ${c} operations failed`, m);
992
1006
  });
993
1007
  });
994
1008
  }
995
1009
  bulkPut(e, n, r) {
996
1010
  const s = Array.isArray(n) ? n : void 0, i = (r = r || (s ? void 0 : n)) ? r.allKeys : void 0;
997
1011
  return this._trans("readwrite", (o) => {
998
- const { auto: u, keyPath: a } = this.schema.primKey;
1012
+ const { auto: l, keyPath: a } = this.schema.primKey;
999
1013
  if (a && s)
1000
1014
  throw new E.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
1001
1015
  if (s && s.length !== e.length)
1002
1016
  throw new E.InvalidArgument("Arguments objects and keys must have the same length");
1003
1017
  const c = e.length;
1004
- let d = a && u ? e.map(Qe(a)) : e;
1005
- return this.core.mutate({ trans: o, type: "put", keys: s, values: d, wantResults: i }).then(({ numFailures: l, results: h, lastResult: f, failures: m }) => {
1006
- if (l === 0)
1007
- return i ? h : f;
1008
- throw new je(`${this.name}.bulkPut(): ${l} of ${c} operations failed`, m);
1018
+ let h = a && l ? e.map(Qe(a)) : e;
1019
+ return this.core.mutate({ trans: o, type: "put", keys: s, values: h, wantResults: i }).then(({ numFailures: u, results: d, lastResult: p, failures: m }) => {
1020
+ if (u === 0)
1021
+ return i ? d : p;
1022
+ throw new $e(`${this.name}.bulkPut(): ${u} of ${c} operations failed`, m);
1009
1023
  });
1010
1024
  });
1011
1025
  }
@@ -1014,13 +1028,13 @@ class Ir {
1014
1028
  return this._trans("readwrite", (r) => this.core.mutate({ trans: r, type: "delete", keys: e })).then(({ numFailures: r, lastResult: s, failures: i }) => {
1015
1029
  if (r === 0)
1016
1030
  return s;
1017
- throw new je(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
1031
+ throw new $e(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`, i);
1018
1032
  });
1019
1033
  }
1020
1034
  }
1021
- function Ne(t) {
1022
- var e = {}, n = function(o, u) {
1023
- if (u) {
1035
+ function je(t) {
1036
+ var e = {}, n = function(o, l) {
1037
+ if (l) {
1024
1038
  for (var a = arguments.length, c = new Array(a - 1); --a; )
1025
1039
  c[a - 1] = arguments[a];
1026
1040
  return e[o].subscribe.apply(null, c), t;
@@ -1032,32 +1046,32 @@ function Ne(t) {
1032
1046
  for (var r = 1, s = arguments.length; r < s; ++r)
1033
1047
  i(arguments[r]);
1034
1048
  return n;
1035
- function i(o, u, a) {
1049
+ function i(o, l, a) {
1036
1050
  if (typeof o != "object") {
1037
1051
  var c;
1038
- u || (u = kr), a || (a = I);
1039
- var d = { subscribers: [], fire: a, subscribe: function(l) {
1040
- d.subscribers.indexOf(l) === -1 && (d.subscribers.push(l), d.fire = u(d.fire, l));
1041
- }, unsubscribe: function(l) {
1042
- d.subscribers = d.subscribers.filter(function(h) {
1043
- return h !== l;
1044
- }), d.fire = d.subscribers.reduce(u, a);
1052
+ l || (l = kr), a || (a = I);
1053
+ var h = { subscribers: [], fire: a, subscribe: function(u) {
1054
+ h.subscribers.indexOf(u) === -1 && (h.subscribers.push(u), h.fire = l(h.fire, u));
1055
+ }, unsubscribe: function(u) {
1056
+ h.subscribers = h.subscribers.filter(function(d) {
1057
+ return d !== u;
1058
+ }), h.fire = h.subscribers.reduce(l, a);
1045
1059
  } };
1046
- return e[o] = n[o] = d, d;
1060
+ return e[o] = n[o] = h, h;
1047
1061
  }
1048
- N(c = o).forEach(function(l) {
1049
- var h = c[l];
1050
- if (M(h))
1051
- i(l, c[l][0], c[l][1]);
1062
+ j(c = o).forEach(function(u) {
1063
+ var d = c[u];
1064
+ if (M(d))
1065
+ i(u, c[u][0], c[u][1]);
1052
1066
  else {
1053
- if (h !== "asap")
1067
+ if (d !== "asap")
1054
1068
  throw new E.InvalidArgument("Invalid event config");
1055
- var f = i(l, Fe, function() {
1056
- for (var m = arguments.length, p = new Array(m); m--; )
1057
- p[m] = arguments[m];
1058
- f.subscribers.forEach(function(v) {
1069
+ var p = i(u, Fe, function() {
1070
+ for (var m = arguments.length, f = new Array(m); m--; )
1071
+ f[m] = arguments[m];
1072
+ p.subscribers.forEach(function(v) {
1059
1073
  En(function() {
1060
- v.apply(null, p);
1074
+ v.apply(null, f);
1061
1075
  });
1062
1076
  });
1063
1077
  });
@@ -1071,10 +1085,10 @@ function Oe(t, e) {
1071
1085
  function be(t, e) {
1072
1086
  return !(t.filter || t.algorithm || t.or) && (e ? t.justLimit : !t.replayFilter);
1073
1087
  }
1074
- function kt(t, e) {
1088
+ function xt(t, e) {
1075
1089
  t.filter = ge(t.filter, e);
1076
1090
  }
1077
- function xt(t, e, n) {
1091
+ function St(t, e, n) {
1078
1092
  var r = t.replayFilter;
1079
1093
  t.replayFilter = r ? () => ge(r(), e()) : e, t.justLimit = n && !r;
1080
1094
  }
@@ -1093,10 +1107,10 @@ function vn(t, e, n) {
1093
1107
  function Je(t, e, n, r) {
1094
1108
  const s = t.replayFilter ? ge(t.filter, t.replayFilter()) : t.filter;
1095
1109
  if (t.or) {
1096
- const i = {}, o = (u, a, c) => {
1097
- if (!s || s(a, c, (h) => a.stop(h), (h) => a.fail(h))) {
1098
- var d = a.primaryKey, l = "" + d;
1099
- l === "[object ArrayBuffer]" && (l = "" + new Uint8Array(d)), z(i, l) || (i[l] = !0, e(u, a, c));
1110
+ const i = {}, o = (l, a, c) => {
1111
+ if (!s || s(a, c, (d) => a.stop(d), (d) => a.fail(d))) {
1112
+ var h = a.primaryKey, u = "" + h;
1113
+ u === "[object ArrayBuffer]" && (u = "" + new Uint8Array(h)), z(i, u) || (i[u] = !0, e(l, a, c));
1100
1114
  }
1101
1115
  };
1102
1116
  return Promise.all([t.or._iterate(o, n), bn(vn(t, r, n), t.algorithm, o, !t.keysOnly && t.valueMapper)]);
@@ -1104,16 +1118,16 @@ function Je(t, e, n, r) {
1104
1118
  return bn(vn(t, r, n), ge(t.algorithm, s), e, !t.keysOnly && t.valueMapper);
1105
1119
  }
1106
1120
  function bn(t, e, n, r) {
1107
- var s = j(r ? (i, o, u) => n(r(i), o, u) : n);
1121
+ var s = $(r ? (i, o, l) => n(r(i), o, l) : n);
1108
1122
  return t.then((i) => {
1109
1123
  if (i)
1110
1124
  return i.start(() => {
1111
1125
  var o = () => i.continue();
1112
- e && !e(i, (u) => o = u, (u) => {
1113
- i.stop(u), o = I;
1114
- }, (u) => {
1115
- i.fail(u), o = I;
1116
- }) || s(i.value, i, (u) => o = u), o();
1126
+ e && !e(i, (l) => o = l, (l) => {
1127
+ i.stop(l), o = I;
1128
+ }, (l) => {
1129
+ i.fail(l), o = I;
1130
+ }) || s(i.value, i, (l) => o = l), o();
1117
1131
  });
1118
1132
  });
1119
1133
  }
@@ -1129,21 +1143,21 @@ function L(t, e) {
1129
1143
  return t > e ? 1 : t < e ? -1 : 0;
1130
1144
  case "binary":
1131
1145
  return function(s, i) {
1132
- const o = s.length, u = i.length, a = o < u ? o : u;
1146
+ const o = s.length, l = i.length, a = o < l ? o : l;
1133
1147
  for (let c = 0; c < a; ++c)
1134
1148
  if (s[c] !== i[c])
1135
1149
  return s[c] < i[c] ? -1 : 1;
1136
- return o === u ? 0 : o < u ? -1 : 1;
1150
+ return o === l ? 0 : o < l ? -1 : 1;
1137
1151
  }(_n(t), _n(e));
1138
1152
  case "Array":
1139
1153
  return function(s, i) {
1140
- const o = s.length, u = i.length, a = o < u ? o : u;
1154
+ const o = s.length, l = i.length, a = o < l ? o : l;
1141
1155
  for (let c = 0; c < a; ++c) {
1142
- const d = L(s[c], i[c]);
1143
- if (d !== 0)
1144
- return d;
1156
+ const h = L(s[c], i[c]);
1157
+ if (h !== 0)
1158
+ return h;
1145
1159
  }
1146
- return o === u ? 0 : o < u ? -1 : 1;
1160
+ return o === l ? 0 : o < l ? -1 : 1;
1147
1161
  }(t, e);
1148
1162
  }
1149
1163
  } catch {
@@ -1156,13 +1170,13 @@ function wn(t) {
1156
1170
  return e;
1157
1171
  if (ArrayBuffer.isView(t))
1158
1172
  return "binary";
1159
- const n = Tt(t);
1173
+ const n = At(t);
1160
1174
  return n === "ArrayBuffer" ? "binary" : n;
1161
1175
  }
1162
1176
  function _n(t) {
1163
1177
  return t instanceof Uint8Array ? t : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : new Uint8Array(t);
1164
1178
  }
1165
- class Kr {
1179
+ class Rr {
1166
1180
  _read(e, n) {
1167
1181
  var r = this._ctx;
1168
1182
  return r.error ? r.table._trans(null, D.bind(null, r.error)) : r.table._trans("readonly", e).then(n);
@@ -1200,13 +1214,13 @@ class Kr {
1200
1214
  }
1201
1215
  sortBy(e, n) {
1202
1216
  const r = e.split(".").reverse(), s = r[0], i = r.length - 1;
1203
- function o(c, d) {
1204
- return d ? o(c[r[d]], d - 1) : c[s];
1217
+ function o(c, h) {
1218
+ return h ? o(c[r[h]], h - 1) : c[s];
1205
1219
  }
1206
- var u = this._ctx.dir === "next" ? 1 : -1;
1207
- function a(c, d) {
1208
- var l = o(c, i), h = o(d, i);
1209
- return l < h ? -u : l > h ? u : 0;
1220
+ var l = this._ctx.dir === "next" ? 1 : -1;
1221
+ function a(c, h) {
1222
+ var u = o(c, i), d = o(h, i);
1223
+ return u < d ? -l : u > d ? l : 0;
1210
1224
  }
1211
1225
  return this.toArray(function(c) {
1212
1226
  return c.sort(a);
@@ -1227,18 +1241,18 @@ class Kr {
1227
1241
  }
1228
1242
  offset(e) {
1229
1243
  var n = this._ctx;
1230
- return e <= 0 || (n.offset += e, be(n) ? xt(n, () => {
1244
+ return e <= 0 || (n.offset += e, be(n) ? St(n, () => {
1231
1245
  var r = e;
1232
1246
  return (s, i) => r === 0 || (r === 1 ? (--r, !1) : (i(() => {
1233
1247
  s.advance(r), r = 0;
1234
1248
  }), !1));
1235
- }) : xt(n, () => {
1249
+ }) : St(n, () => {
1236
1250
  var r = e;
1237
1251
  return () => --r < 0;
1238
1252
  })), this;
1239
1253
  }
1240
1254
  limit(e) {
1241
- return this._ctx.limit = Math.min(this._ctx.limit, e), xt(this._ctx, () => {
1255
+ return this._ctx.limit = Math.min(this._ctx.limit, e), St(this._ctx, () => {
1242
1256
  var n = e;
1243
1257
  return function(r, s, i) {
1244
1258
  return --n <= 0 && s(i), n >= 0;
@@ -1246,7 +1260,7 @@ class Kr {
1246
1260
  }, !0), this;
1247
1261
  }
1248
1262
  until(e, n) {
1249
- return kt(this._ctx, function(r, s, i) {
1263
+ return xt(this._ctx, function(r, s, i) {
1250
1264
  return !e(r.value) || (s(i), n);
1251
1265
  }), this;
1252
1266
  }
@@ -1260,7 +1274,7 @@ class Kr {
1260
1274
  }
1261
1275
  filter(e) {
1262
1276
  var n, r;
1263
- return kt(this._ctx, function(s) {
1277
+ return xt(this._ctx, function(s) {
1264
1278
  return e(s.value);
1265
1279
  }), n = this._ctx, r = e, n.isMatch = ge(n.isMatch, r), this;
1266
1280
  }
@@ -1332,7 +1346,7 @@ class Kr {
1332
1346
  if (!n || !n.multi)
1333
1347
  return this;
1334
1348
  var r = {};
1335
- return kt(this._ctx, function(s) {
1349
+ return xt(this._ctx, function(s) {
1336
1350
  var i = s.primaryKey.toString(), o = z(r, i);
1337
1351
  return r[i] = !0, !o;
1338
1352
  }), this;
@@ -1344,44 +1358,44 @@ class Kr {
1344
1358
  if (typeof e == "function")
1345
1359
  s = e;
1346
1360
  else {
1347
- var i = N(e), o = i.length;
1348
- s = function(p) {
1361
+ var i = j(e), o = i.length;
1362
+ s = function(f) {
1349
1363
  for (var v = !1, y = 0; y < o; ++y) {
1350
1364
  var g = i[y], b = e[g];
1351
- te(p, g) !== b && (H(p, g, b), v = !0);
1365
+ te(f, g) !== b && (H(f, g, b), v = !0);
1352
1366
  }
1353
1367
  return v;
1354
1368
  };
1355
1369
  }
1356
- const u = n.table.core, { outbound: a, extractKey: c } = u.schema.primaryKey, d = this.db._options.modifyChunkSize || 200, l = [];
1357
- let h = 0;
1358
- const f = [], m = (p, v) => {
1370
+ const l = n.table.core, { outbound: a, extractKey: c } = l.schema.primaryKey, h = this.db._options.modifyChunkSize || 200, u = [];
1371
+ let d = 0;
1372
+ const p = [], m = (f, v) => {
1359
1373
  const { failures: y, numFailures: g } = v;
1360
- h += p - g;
1361
- for (let b of N(y))
1362
- l.push(y[b]);
1374
+ d += f - g;
1375
+ for (let b of j(y))
1376
+ u.push(y[b]);
1363
1377
  };
1364
- return this.clone().primaryKeys().then((p) => {
1378
+ return this.clone().primaryKeys().then((f) => {
1365
1379
  const v = (y) => {
1366
- const g = Math.min(d, p.length - y);
1367
- return u.getMany({ trans: r, keys: p.slice(y, y + g), cache: "immutable" }).then((b) => {
1368
- const k = [], C = [], x = a ? [] : null, w = [];
1369
- for (let _ = 0; _ < g; ++_) {
1370
- const R = b[_], O = { value: We(R), primKey: p[y + _] };
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)));
1380
+ const g = Math.min(h, f.length - y);
1381
+ return l.getMany({ trans: r, keys: f.slice(y, y + g), cache: "immutable" }).then((b) => {
1382
+ const w = [], C = [], k = a ? [] : null, _ = [];
1383
+ for (let x = 0; x < g; ++x) {
1384
+ const N = b[x], O = { value: We(N), primKey: f[y + x] };
1385
+ s.call(O, O.value, O) !== !1 && (O.value == null ? _.push(f[y + x]) : a || L(c(N), c(O.value)) === 0 ? (C.push(O.value), a && k.push(f[y + x])) : (_.push(f[y + x]), w.push(O.value)));
1372
1386
  }
1373
- const A = be(n) && n.limit === 1 / 0 && (typeof e != "function" || e === St) && { index: n.index, range: n.range };
1374
- return Promise.resolve(k.length > 0 && u.mutate({ trans: r, type: "add", values: k }).then((_) => {
1375
- for (let R in _.failures)
1376
- w.splice(parseInt(R), 1);
1377
- m(k.length, _);
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));
1387
+ const A = be(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Ct) && { index: n.index, range: n.range };
1388
+ return Promise.resolve(w.length > 0 && l.mutate({ trans: r, type: "add", values: w }).then((x) => {
1389
+ for (let N in x.failures)
1390
+ _.splice(parseInt(N), 1);
1391
+ m(w.length, x);
1392
+ })).then(() => (C.length > 0 || A && typeof e == "object") && l.mutate({ trans: r, type: "put", keys: k, values: C, criteria: A, changeSpec: typeof e != "function" && e }).then((x) => m(C.length, x))).then(() => (_.length > 0 || A && e === Ct) && l.mutate({ trans: r, type: "delete", keys: _, criteria: A }).then((x) => m(_.length, x))).then(() => f.length > y + g && v(y + h));
1379
1393
  });
1380
1394
  };
1381
1395
  return v(0).then(() => {
1382
- if (l.length > 0)
1383
- throw new lt("Error modifying one or more objects", l, h, f);
1384
- return p.length;
1396
+ if (u.length > 0)
1397
+ throw new ut("Error modifying one or more objects", u, d, p);
1398
+ return f.length;
1385
1399
  });
1386
1400
  });
1387
1401
  });
@@ -1390,19 +1404,19 @@ class Kr {
1390
1404
  var e = this._ctx, n = e.range;
1391
1405
  return be(e) && (e.isPrimKey && !Or || n.type === 3) ? this._write((r) => {
1392
1406
  const { primaryKey: s } = e.table.core.schema, i = n;
1393
- return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: u, lastResult: a, results: c, numFailures: d }) => {
1394
- if (d)
1395
- throw new lt("Could not delete some values", Object.keys(u).map((l) => u[l]), o - d);
1396
- return o - d;
1407
+ return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: l, lastResult: a, results: c, numFailures: h }) => {
1408
+ if (h)
1409
+ throw new ut("Could not delete some values", Object.keys(l).map((u) => l[u]), o - h);
1410
+ return o - h;
1397
1411
  }));
1398
- }) : this.modify(St);
1412
+ }) : this.modify(Ct);
1399
1413
  }
1400
1414
  }
1401
- const St = (t, e) => e.value = null;
1402
- function jr(t, e) {
1415
+ const Ct = (t, e) => e.value = null;
1416
+ function $r(t, e) {
1403
1417
  return t < e ? -1 : t === e ? 0 : 1;
1404
1418
  }
1405
- function Rr(t, e) {
1419
+ function Nr(t, e) {
1406
1420
  return t > e ? -1 : t === e ? 0 : 1;
1407
1421
  }
1408
1422
  function W(t, e, n) {
@@ -1412,57 +1426,57 @@ function W(t, e, n) {
1412
1426
  function we(t) {
1413
1427
  return new t.Collection(t, () => Yn("")).limit(0);
1414
1428
  }
1415
- function $r(t, e, n, r, s, i) {
1416
- for (var o = Math.min(t.length, r.length), u = -1, a = 0; a < o; ++a) {
1429
+ function Kr(t, e, n, r, s, i) {
1430
+ for (var o = Math.min(t.length, r.length), l = -1, a = 0; a < o; ++a) {
1417
1431
  var c = e[a];
1418
1432
  if (c !== r[a])
1419
- return s(t[a], n[a]) < 0 ? t.substr(0, a) + n[a] + n.substr(a + 1) : s(t[a], r[a]) < 0 ? t.substr(0, a) + r[a] + n.substr(a + 1) : u >= 0 ? t.substr(0, u) + e[u] + n.substr(u + 1) : null;
1420
- s(t[a], c) < 0 && (u = a);
1433
+ return s(t[a], n[a]) < 0 ? t.substr(0, a) + n[a] + n.substr(a + 1) : s(t[a], r[a]) < 0 ? t.substr(0, a) + r[a] + n.substr(a + 1) : l >= 0 ? t.substr(0, l) + e[l] + n.substr(l + 1) : null;
1434
+ s(t[a], c) < 0 && (l = a);
1421
1435
  }
1422
- return o < r.length && i === "next" ? t + n.substr(t.length) : o < t.length && i === "prev" ? t.substr(0, n.length) : u < 0 ? null : t.substr(0, u) + r[u] + n.substr(u + 1);
1436
+ return o < r.length && i === "next" ? t + n.substr(t.length) : o < t.length && i === "prev" ? t.substr(0, n.length) : l < 0 ? null : t.substr(0, l) + r[l] + n.substr(l + 1);
1423
1437
  }
1424
1438
  function Ze(t, e, n, r) {
1425
- var s, i, o, u, a, c, d, l = n.length;
1426
- if (!n.every((p) => typeof p == "string"))
1439
+ var s, i, o, l, a, c, h, u = n.length;
1440
+ if (!n.every((f) => typeof f == "string"))
1427
1441
  return W(t, Wn);
1428
- function h(p) {
1442
+ function d(f) {
1429
1443
  s = function(y) {
1430
1444
  return y === "next" ? (g) => g.toUpperCase() : (g) => g.toLowerCase();
1431
- }(p), i = function(y) {
1445
+ }(f), i = function(y) {
1432
1446
  return y === "next" ? (g) => g.toLowerCase() : (g) => g.toUpperCase();
1433
- }(p), o = p === "next" ? jr : Rr;
1447
+ }(f), o = f === "next" ? $r : Nr;
1434
1448
  var v = n.map(function(y) {
1435
1449
  return { lower: i(y), upper: s(y) };
1436
1450
  }).sort(function(y, g) {
1437
1451
  return o(y.lower, g.lower);
1438
1452
  });
1439
- u = v.map(function(y) {
1453
+ l = v.map(function(y) {
1440
1454
  return y.upper;
1441
1455
  }), a = v.map(function(y) {
1442
1456
  return y.lower;
1443
- }), c = p, d = p === "next" ? "" : r;
1457
+ }), c = f, h = f === "next" ? "" : r;
1444
1458
  }
1445
- h("next");
1446
- var f = new t.Collection(t, () => re(u[0], a[l - 1] + r));
1447
- f._ondirectionchange = function(p) {
1448
- h(p);
1459
+ d("next");
1460
+ var p = new t.Collection(t, () => re(l[0], a[u - 1] + r));
1461
+ p._ondirectionchange = function(f) {
1462
+ d(f);
1449
1463
  };
1450
1464
  var m = 0;
1451
- return f._addAlgorithm(function(p, v, y) {
1452
- var g = p.key;
1465
+ return p._addAlgorithm(function(f, v, y) {
1466
+ var g = f.key;
1453
1467
  if (typeof g != "string")
1454
1468
  return !1;
1455
1469
  var b = i(g);
1456
1470
  if (e(b, a, m))
1457
1471
  return !0;
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);
1472
+ for (var w = null, C = m; C < u; ++C) {
1473
+ var k = Kr(g, b, l[C], a[C], o, c);
1474
+ k === null && w === null ? m = C + 1 : (w === null || o(w, k) > 0) && (w = k);
1461
1475
  }
1462
- return v(k !== null ? function() {
1463
- p.continue(k + d);
1476
+ return v(w !== null ? function() {
1477
+ f.continue(w + h);
1464
1478
  } : y), !1;
1465
- }), f;
1479
+ }), p;
1466
1480
  }
1467
1481
  function re(t, e, n, r) {
1468
1482
  return { type: 2, lower: t, upper: e, lowerOpen: n, upperOpen: r };
@@ -1529,18 +1543,18 @@ class Gn {
1529
1543
  n = i === "next" ? this._ascending : this._descending, e.sort(n);
1530
1544
  };
1531
1545
  let s = 0;
1532
- return r._addAlgorithm((i, o, u) => {
1546
+ return r._addAlgorithm((i, o, l) => {
1533
1547
  const a = i.key;
1534
1548
  for (; n(a, e[s]) > 0; )
1535
1549
  if (++s, s === e.length)
1536
- return o(u), !1;
1550
+ return o(l), !1;
1537
1551
  return n(a, e[s]) === 0 || (o(() => {
1538
1552
  i.continue(e[s]);
1539
1553
  }), !1);
1540
1554
  }), r;
1541
1555
  }
1542
1556
  notEqual(e) {
1543
- return this.inAnyRange([[Mt, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
1557
+ return this.inAnyRange([[qt, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
1544
1558
  }
1545
1559
  noneOf() {
1546
1560
  const e = J.apply(_e, arguments);
@@ -1551,49 +1565,49 @@ class Gn {
1551
1565
  } catch {
1552
1566
  return W(this, X);
1553
1567
  }
1554
- const n = e.reduce((r, s) => r ? r.concat([[r[r.length - 1][1], s]]) : [[Mt, s]], null);
1568
+ const n = e.reduce((r, s) => r ? r.concat([[r[r.length - 1][1], s]]) : [[qt, s]], null);
1555
1569
  return n.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
1556
1570
  }
1557
1571
  inAnyRange(e, n) {
1558
- const r = this._cmp, s = this._ascending, i = this._descending, o = this._min, u = this._max;
1572
+ const r = this._cmp, s = this._ascending, i = this._descending, o = this._min, l = this._max;
1559
1573
  if (e.length === 0)
1560
1574
  return we(this);
1561
1575
  if (!e.every((g) => g[0] !== void 0 && g[1] !== void 0 && s(g[0], g[1]) <= 0))
1562
1576
  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);
1563
1577
  const a = !n || n.includeLowers !== !1, c = n && n.includeUppers === !0;
1564
- let d, l = s;
1565
- function h(g, b) {
1566
- return l(g[0], b[0]);
1578
+ let h, u = s;
1579
+ function d(g, b) {
1580
+ return u(g[0], b[0]);
1567
1581
  }
1568
1582
  try {
1569
- d = e.reduce(function(g, b) {
1570
- let k = 0, C = g.length;
1571
- for (; k < C; ++k) {
1572
- const x = g[k];
1573
- if (r(b[0], x[1]) < 0 && r(b[1], x[0]) > 0) {
1574
- x[0] = o(x[0], b[0]), x[1] = u(x[1], b[1]);
1583
+ h = e.reduce(function(g, b) {
1584
+ let w = 0, C = g.length;
1585
+ for (; w < C; ++w) {
1586
+ const k = g[w];
1587
+ if (r(b[0], k[1]) < 0 && r(b[1], k[0]) > 0) {
1588
+ k[0] = o(k[0], b[0]), k[1] = l(k[1], b[1]);
1575
1589
  break;
1576
1590
  }
1577
1591
  }
1578
- return k === C && g.push(b), g;
1579
- }, []), d.sort(h);
1592
+ return w === C && g.push(b), g;
1593
+ }, []), h.sort(d);
1580
1594
  } catch {
1581
1595
  return W(this, X);
1582
1596
  }
1583
- let f = 0;
1584
- const m = c ? (g) => s(g, d[f][1]) > 0 : (g) => s(g, d[f][1]) >= 0, p = a ? (g) => i(g, d[f][0]) > 0 : (g) => i(g, d[f][0]) >= 0;
1597
+ let p = 0;
1598
+ const m = c ? (g) => s(g, h[p][1]) > 0 : (g) => s(g, h[p][1]) >= 0, f = a ? (g) => i(g, h[p][0]) > 0 : (g) => i(g, h[p][0]) >= 0;
1585
1599
  let v = m;
1586
- const y = new this.Collection(this, () => re(d[0][0], d[d.length - 1][1], !a, !c));
1600
+ const y = new this.Collection(this, () => re(h[0][0], h[h.length - 1][1], !a, !c));
1587
1601
  return y._ondirectionchange = (g) => {
1588
- g === "next" ? (v = m, l = s) : (v = p, l = i), d.sort(h);
1589
- }, y._addAlgorithm((g, b, k) => {
1602
+ g === "next" ? (v = m, u = s) : (v = f, u = i), h.sort(d);
1603
+ }, y._addAlgorithm((g, b, w) => {
1590
1604
  for (var C = g.key; v(C); )
1591
- if (++f, f === d.length)
1592
- return b(k), !1;
1593
- return !!function(x) {
1594
- return !m(x) && !p(x);
1595
- }(C) || (this._cmp(C, d[f][1]) === 0 || this._cmp(C, d[f][0]) === 0 || b(() => {
1596
- l === s ? g.continue(d[f][0]) : g.continue(d[f][1]);
1605
+ if (++p, p === h.length)
1606
+ return b(w), !1;
1607
+ return !!function(k) {
1608
+ return !m(k) && !f(k);
1609
+ }(C) || (this._cmp(C, h[p][1]) === 0 || this._cmp(C, h[p][0]) === 0 || b(() => {
1610
+ u === s ? g.continue(h[p][0]) : g.continue(h[p][1]);
1597
1611
  }), !1);
1598
1612
  }), y;
1599
1613
  }
@@ -1603,15 +1617,15 @@ class Gn {
1603
1617
  }
1604
1618
  }
1605
1619
  function Y(t) {
1606
- return j(function(e) {
1620
+ return $(function(e) {
1607
1621
  return qe(e), t(e.target.error), !1;
1608
1622
  });
1609
1623
  }
1610
1624
  function qe(t) {
1611
1625
  t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault();
1612
1626
  }
1613
- const Le = "storagemutated", ie = "x-storagemutated-1", ue = Ne(null, Le);
1614
- class Nr {
1627
+ const Le = "storagemutated", ie = "x-storagemutated-1", le = je(null, Le);
1628
+ class jr {
1615
1629
  _lock() {
1616
1630
  return Ie(!P.global), ++this._reculock, this._reculock !== 1 || P.global || (P.lockOwnerFor = this), this;
1617
1631
  }
@@ -1644,12 +1658,12 @@ class Nr {
1644
1658
  }
1645
1659
  if (!this.active)
1646
1660
  throw new E.TransactionInactive();
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) => {
1661
+ 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 = $((s) => {
1648
1662
  qe(s), this._reject(e.error);
1649
- }), e.onabort = j((s) => {
1663
+ }), e.onabort = $((s) => {
1650
1664
  qe(s), this.active && this._reject(new E.Abort(e.error)), this.active = !1, this.on("abort").fire(s);
1651
- }), e.oncomplete = j(() => {
1652
- this.active = !1, this._resolve(), "mutatedParts" in e && ue.storagemutated.fire(e.mutatedParts);
1665
+ }), e.oncomplete = $(() => {
1666
+ this.active = !1, this._resolve(), "mutatedParts" in e && le.storagemutated.fire(e.mutatedParts);
1653
1667
  }), this;
1654
1668
  }
1655
1669
  _promise(e, n, r) {
@@ -1665,16 +1679,16 @@ class Nr {
1665
1679
  });
1666
1680
  if (r)
1667
1681
  return oe(() => {
1668
- var i = new S((o, u) => {
1682
+ var i = new S((o, l) => {
1669
1683
  this._lock();
1670
- const a = n(o, u, this);
1671
- a && a.then && a.then(o, u);
1684
+ const a = n(o, l, this);
1685
+ a && a.then && a.then(o, l);
1672
1686
  });
1673
1687
  return i.finally(() => this._unlock()), i._lib = !0, i;
1674
1688
  });
1675
1689
  var s = new S((i, o) => {
1676
- var u = n(i, o, this);
1677
- u && u.then && u.then(i, o);
1690
+ var l = n(i, o, this);
1691
+ l && l.then && l.then(i, o);
1678
1692
  });
1679
1693
  return s._lib = !0, s;
1680
1694
  }
@@ -1696,8 +1710,8 @@ class Nr {
1696
1710
  })();
1697
1711
  }
1698
1712
  var i = n._waitingFor;
1699
- return new S((o, u) => {
1700
- r.then((a) => n._waitingQueue.push(j(o.bind(null, a))), (a) => n._waitingQueue.push(j(u.bind(null, a)))).finally(() => {
1713
+ return new S((o, l) => {
1714
+ r.then((a) => n._waitingQueue.push($(o.bind(null, a))), (a) => n._waitingQueue.push($(l.bind(null, a)))).finally(() => {
1701
1715
  n._waitingFor === i && (n._waitingFor = null);
1702
1716
  });
1703
1717
  });
@@ -1716,7 +1730,7 @@ class Nr {
1716
1730
  return s.core = this.db.core.table(e), n[e] = s, s;
1717
1731
  }
1718
1732
  }
1719
- function qt(t, e, n, r, s, i, o) {
1733
+ function Lt(t, e, n, r, s, i, o) {
1720
1734
  return { name: t, keyPath: e, unique: n, multi: r, auto: s, compound: i, src: (n && !o ? "&" : "") + (r ? "*" : "") + (s ? "++" : "") + Xn(e) };
1721
1735
  }
1722
1736
  function Xn(t) {
@@ -1732,7 +1746,7 @@ let Ue = (t) => {
1732
1746
  return Ue = () => he, he;
1733
1747
  }
1734
1748
  };
1735
- function Lt(t) {
1749
+ function Ut(t) {
1736
1750
  return t == null ? () => {
1737
1751
  } : typeof t == "string" ? function(e) {
1738
1752
  return e.split(".").length === 1 ? (n) => n[e] : (n) => te(n, e);
@@ -1751,152 +1765,152 @@ function Br(t, e, n) {
1751
1765
  return null;
1752
1766
  if (a.type === 4)
1753
1767
  throw new Error("Cannot convert never type to IDBKeyRange");
1754
- const { lower: c, upper: d, lowerOpen: l, upperOpen: h } = a;
1755
- return c === void 0 ? d === void 0 ? null : e.upperBound(d, !!h) : d === void 0 ? e.lowerBound(c, !!l) : e.bound(c, d, !!l, !!h);
1768
+ const { lower: c, upper: h, lowerOpen: u, upperOpen: d } = a;
1769
+ return c === void 0 ? h === void 0 ? null : e.upperBound(h, !!d) : h === void 0 ? e.lowerBound(c, !!u) : e.bound(c, h, !!u, !!d);
1756
1770
  }
1757
1771
  const { schema: s, hasGetAll: i } = function(a, c) {
1758
- const d = kn(a.objectStoreNames);
1759
- return { schema: { name: a.name, tables: d.map((l) => c.objectStore(l)).map((l) => {
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) => {
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) };
1762
- return v[De(x)] = w, w;
1772
+ const h = kn(a.objectStoreNames);
1773
+ return { schema: { name: a.name, tables: h.map((u) => c.objectStore(u)).map((u) => {
1774
+ const { keyPath: d, autoIncrement: p } = u, m = M(d), f = d == null, v = {}, y = { name: u.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: f, compound: m, keyPath: d, autoIncrement: p, unique: !0, extractKey: Ut(d) }, indexes: kn(u.indexNames).map((g) => u.index(g)).map((g) => {
1775
+ const { name: b, unique: w, multiEntry: C, keyPath: k } = g, _ = { name: b, compound: M(k), keyPath: k, unique: w, multiEntry: C, extractKey: Ut(k) };
1776
+ return v[De(k)] = _, _;
1763
1777
  }), getIndexByKeyPath: (g) => v[De(g)] };
1764
- return v[":id"] = y.primaryKey, h != null && (v[De(h)] = y.primaryKey), y;
1765
- }) }, hasGetAll: d.length > 0 && "getAll" in c.objectStore(d[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
1778
+ return v[":id"] = y.primaryKey, d != null && (v[De(d)] = y.primaryKey), y;
1779
+ }) }, hasGetAll: h.length > 0 && "getAll" in c.objectStore(h[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) };
1766
1780
  }(t, n), o = s.tables.map((a) => function(c) {
1767
- const d = c.name;
1768
- return { name: d, schema: c, mutate: function({ trans: l, type: h, keys: f, values: m, range: p }) {
1781
+ const h = c.name;
1782
+ return { name: h, schema: c, mutate: function({ trans: u, type: d, keys: p, values: m, range: f }) {
1769
1783
  return new Promise((v, y) => {
1770
- v = j(v);
1771
- const g = l.objectStore(d), b = g.keyPath == null, k = h === "put" || h === "add";
1772
- if (!k && h !== "delete" && h !== "deleteRange")
1773
- throw new Error("Invalid operation type: " + h);
1774
- const { length: C } = f || m || { length: 1 };
1775
- if (f && m && f.length !== m.length)
1784
+ v = $(v);
1785
+ const g = u.objectStore(h), b = g.keyPath == null, w = d === "put" || d === "add";
1786
+ if (!w && d !== "delete" && d !== "deleteRange")
1787
+ throw new Error("Invalid operation type: " + d);
1788
+ const { length: C } = p || m || { length: 1 };
1789
+ if (p && m && p.length !== m.length)
1776
1790
  throw new Error("Given keys array must have same length as given values array.");
1777
1791
  if (C === 0)
1778
1792
  return v({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
1779
- let x;
1780
- const w = [], A = [];
1781
- let _ = 0;
1782
- const R = (q) => {
1783
- ++_, qe(q);
1793
+ let k;
1794
+ const _ = [], A = [];
1795
+ let x = 0;
1796
+ const N = (q) => {
1797
+ ++x, qe(q);
1784
1798
  };
1785
- if (h === "deleteRange") {
1786
- if (p.type === 4)
1787
- return v({ numFailures: _, failures: A, results: [], lastResult: void 0 });
1788
- p.type === 3 ? w.push(x = g.clear()) : w.push(x = g.delete(r(p)));
1799
+ if (d === "deleteRange") {
1800
+ if (f.type === 4)
1801
+ return v({ numFailures: x, failures: A, results: [], lastResult: void 0 });
1802
+ f.type === 3 ? _.push(k = g.clear()) : _.push(k = g.delete(r(f)));
1789
1803
  } else {
1790
- const [q, B] = k ? b ? [m, f] : [m, null] : [f, null];
1791
- if (k)
1792
- for (let $ = 0; $ < C; ++$)
1793
- w.push(x = B && B[$] !== void 0 ? g[h](q[$], B[$]) : g[h](q[$])), x.onerror = R;
1804
+ const [q, B] = w ? b ? [m, p] : [m, null] : [p, null];
1805
+ if (w)
1806
+ for (let K = 0; K < C; ++K)
1807
+ _.push(k = B && B[K] !== void 0 ? g[d](q[K], B[K]) : g[d](q[K])), k.onerror = N;
1794
1808
  else
1795
- for (let $ = 0; $ < C; ++$)
1796
- w.push(x = g[h](q[$])), x.onerror = R;
1809
+ for (let K = 0; K < C; ++K)
1810
+ _.push(k = g[d](q[K])), k.onerror = N;
1797
1811
  }
1798
1812
  const O = (q) => {
1799
1813
  const B = q.target.result;
1800
- w.forEach(($, ye) => $.error != null && (A[ye] = $.error)), v({ numFailures: _, failures: A, results: h === "delete" ? f : w.map(($) => $.result), lastResult: B });
1814
+ _.forEach((K, ye) => K.error != null && (A[ye] = K.error)), v({ numFailures: x, failures: A, results: d === "delete" ? p : _.map((K) => K.result), lastResult: B });
1801
1815
  };
1802
- x.onerror = (q) => {
1803
- R(q), O(q);
1804
- }, x.onsuccess = O;
1816
+ k.onerror = (q) => {
1817
+ N(q), O(q);
1818
+ }, k.onsuccess = O;
1805
1819
  });
1806
- }, getMany: ({ trans: l, keys: h }) => new Promise((f, m) => {
1807
- f = j(f);
1808
- const p = l.objectStore(d), v = h.length, y = new Array(v);
1809
- let g, b = 0, k = 0;
1810
- const C = (w) => {
1811
- const A = w.target;
1812
- y[A._pos] = A.result, ++k === b && f(y);
1813
- }, x = Y(m);
1814
- for (let w = 0; w < v; ++w)
1815
- h[w] != null && (g = p.get(h[w]), g._pos = w, g.onsuccess = C, g.onerror = x, ++b);
1816
- b === 0 && f(y);
1817
- }), get: ({ trans: l, key: h }) => new Promise((f, m) => {
1818
- f = j(f);
1819
- const p = l.objectStore(d).get(h);
1820
- p.onsuccess = (v) => f(v.target.result), p.onerror = Y(m);
1821
- }), query: function(l) {
1822
- return (h) => new Promise((f, m) => {
1823
- f = j(f);
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);
1820
+ }, getMany: ({ trans: u, keys: d }) => new Promise((p, m) => {
1821
+ p = $(p);
1822
+ const f = u.objectStore(h), v = d.length, y = new Array(v);
1823
+ let g, b = 0, w = 0;
1824
+ const C = (_) => {
1825
+ const A = _.target;
1826
+ y[A._pos] = A.result, ++w === b && p(y);
1827
+ }, k = Y(m);
1828
+ for (let _ = 0; _ < v; ++_)
1829
+ d[_] != null && (g = f.get(d[_]), g._pos = _, g.onsuccess = C, g.onerror = k, ++b);
1830
+ b === 0 && p(y);
1831
+ }), get: ({ trans: u, key: d }) => new Promise((p, m) => {
1832
+ p = $(p);
1833
+ const f = u.objectStore(h).get(d);
1834
+ f.onsuccess = (v) => p(v.target.result), f.onerror = Y(m);
1835
+ }), query: function(u) {
1836
+ return (d) => new Promise((p, m) => {
1837
+ p = $(p);
1838
+ const { trans: f, values: v, limit: y, query: g } = d, b = y === 1 / 0 ? void 0 : y, { index: w, range: C } = g, k = f.objectStore(h), _ = w.isPrimaryKey ? k : k.index(w.name), A = r(C);
1825
1839
  if (y === 0)
1826
- return f({ result: [] });
1827
- if (l) {
1828
- const _ = v ? w.getAll(A, b) : w.getAllKeys(A, b);
1829
- _.onsuccess = (R) => f({ result: R.target.result }), _.onerror = Y(m);
1840
+ return p({ result: [] });
1841
+ if (u) {
1842
+ const x = v ? _.getAll(A, b) : _.getAllKeys(A, b);
1843
+ x.onsuccess = (N) => p({ result: N.target.result }), x.onerror = Y(m);
1830
1844
  } else {
1831
- let _ = 0;
1832
- const R = v || !("openKeyCursor" in w) ? w.openCursor(A) : w.openKeyCursor(A), O = [];
1833
- R.onsuccess = (q) => {
1834
- const B = R.result;
1835
- return B ? (O.push(v ? B.value : B.primaryKey), ++_ === y ? f({ result: O }) : void B.continue()) : f({ result: O });
1836
- }, R.onerror = Y(m);
1845
+ let x = 0;
1846
+ const N = v || !("openKeyCursor" in _) ? _.openCursor(A) : _.openKeyCursor(A), O = [];
1847
+ N.onsuccess = (q) => {
1848
+ const B = N.result;
1849
+ return B ? (O.push(v ? B.value : B.primaryKey), ++x === y ? p({ result: O }) : void B.continue()) : p({ result: O });
1850
+ }, N.onerror = Y(m);
1837
1851
  }
1838
1852
  });
1839
- }(i), openCursor: function({ trans: l, values: h, query: f, reverse: m, unique: p }) {
1853
+ }(i), openCursor: function({ trans: u, values: d, query: p, reverse: m, unique: f }) {
1840
1854
  return new Promise((v, y) => {
1841
- v = j(v);
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);
1843
- w.onerror = Y(y), w.onsuccess = j((A) => {
1844
- const _ = w.result;
1845
- if (!_)
1855
+ v = $(v);
1856
+ const { index: g, range: b } = p, w = u.objectStore(h), C = g.isPrimaryKey ? w : w.index(g.name), k = m ? f ? "prevunique" : "prev" : f ? "nextunique" : "next", _ = d || !("openKeyCursor" in C) ? C.openCursor(r(b), k) : C.openKeyCursor(r(b), k);
1857
+ _.onerror = Y(y), _.onsuccess = $((A) => {
1858
+ const x = _.result;
1859
+ if (!x)
1846
1860
  return void v(null);
1847
- _.___id = ++Dr, _.done = !1;
1848
- const R = _.continue.bind(_);
1849
- let O = _.continuePrimaryKey;
1850
- O && (O = O.bind(_));
1851
- const q = _.advance.bind(_), B = () => {
1861
+ x.___id = ++Dr, x.done = !1;
1862
+ const N = x.continue.bind(x);
1863
+ let O = x.continuePrimaryKey;
1864
+ O && (O = O.bind(x));
1865
+ const q = x.advance.bind(x), B = () => {
1852
1866
  throw new Error("Cursor not stopped");
1853
1867
  };
1854
- _.trans = l, _.stop = _.continue = _.continuePrimaryKey = _.advance = () => {
1868
+ x.trans = u, x.stop = x.continue = x.continuePrimaryKey = x.advance = () => {
1855
1869
  throw new Error("Cursor not started");
1856
- }, _.fail = j(y), _.next = function() {
1857
- let $ = 1;
1858
- return this.start(() => $-- ? this.continue() : this.stop()).then(() => this);
1859
- }, _.start = ($) => {
1860
- const ye = new Promise((V, le) => {
1861
- V = j(V), w.onerror = Y(le), _.fail = le, _.stop = (Ae) => {
1862
- _.stop = _.continue = _.continuePrimaryKey = _.advance = B, V(Ae);
1870
+ }, x.fail = $(y), x.next = function() {
1871
+ let K = 1;
1872
+ return this.start(() => K-- ? this.continue() : this.stop()).then(() => this);
1873
+ }, x.start = (K) => {
1874
+ const ye = new Promise((V, ue) => {
1875
+ V = $(V), _.onerror = Y(ue), x.fail = ue, x.stop = (Ae) => {
1876
+ x.stop = x.continue = x.continuePrimaryKey = x.advance = B, V(Ae);
1863
1877
  };
1864
1878
  }), ve = () => {
1865
- if (w.result)
1879
+ if (_.result)
1866
1880
  try {
1867
- $();
1881
+ K();
1868
1882
  } catch (V) {
1869
- _.fail(V);
1883
+ x.fail(V);
1870
1884
  }
1871
1885
  else
1872
- _.done = !0, _.start = () => {
1886
+ x.done = !0, x.start = () => {
1873
1887
  throw new Error("Cursor behind last entry");
1874
- }, _.stop();
1888
+ }, x.stop();
1875
1889
  };
1876
- return w.onsuccess = j((V) => {
1877
- w.onsuccess = ve, ve();
1878
- }), _.continue = R, _.continuePrimaryKey = O, _.advance = q, ve(), ye;
1879
- }, v(_);
1890
+ return _.onsuccess = $((V) => {
1891
+ _.onsuccess = ve, ve();
1892
+ }), x.continue = N, x.continuePrimaryKey = O, x.advance = q, ve(), ye;
1893
+ }, v(x);
1880
1894
  }, y);
1881
1895
  });
1882
- }, count({ query: l, trans: h }) {
1883
- const { index: f, range: m } = l;
1884
- return new Promise((p, v) => {
1885
- const y = h.objectStore(d), g = f.isPrimaryKey ? y : y.index(f.name), b = r(m), k = b ? g.count(b) : g.count();
1886
- k.onsuccess = j((C) => p(C.target.result)), k.onerror = Y(v);
1896
+ }, count({ query: u, trans: d }) {
1897
+ const { index: p, range: m } = u;
1898
+ return new Promise((f, v) => {
1899
+ const y = d.objectStore(h), g = p.isPrimaryKey ? y : y.index(p.name), b = r(m), w = b ? g.count(b) : g.count();
1900
+ w.onsuccess = $((C) => f(C.target.result)), w.onerror = Y(v);
1887
1901
  });
1888
1902
  } };
1889
- }(a)), u = {};
1890
- return o.forEach((a) => u[a.name] = a), { stack: "dbcore", transaction: t.transaction.bind(t), table(a) {
1891
- if (!u[a])
1903
+ }(a)), l = {};
1904
+ return o.forEach((a) => l[a.name] = a), { stack: "dbcore", transaction: t.transaction.bind(t), table(a) {
1905
+ if (!l[a])
1892
1906
  throw new Error(`Table '${a}' not found`);
1893
- return u[a];
1907
+ return l[a];
1894
1908
  }, MIN_KEY: -1 / 0, MAX_KEY: Ue(e), schema: s };
1895
1909
  }
1896
- function Ut({ _novip: t }, e) {
1897
- const n = e.db, r = function(s, i, { IDBKeyRange: o, indexedDB: u }, a) {
1898
- return { dbcore: function(c, d) {
1899
- return d.reduce((l, { create: h }) => ({ ...l, ...h(l) }), c);
1910
+ function Vt({ _novip: t }, e) {
1911
+ const n = e.db, r = function(s, i, { IDBKeyRange: o, indexedDB: l }, a) {
1912
+ return { dbcore: function(c, h) {
1913
+ return h.reduce((u, { create: d }) => ({ ...u, ...d(u) }), c);
1900
1914
  }(Br(i, o, a), s.dbcore) };
1901
1915
  }(t._middlewares, n, t._deps, e);
1902
1916
  t.core = r.dbcore, t.tables.forEach((s) => {
@@ -1908,8 +1922,8 @@ function pt({ _novip: t }, e, n, r) {
1908
1922
  n.forEach((s) => {
1909
1923
  const i = r[s];
1910
1924
  e.forEach((o) => {
1911
- const u = Jt(o, s);
1912
- (!u || "value" in u && u.value === void 0) && (o === t.Transaction.prototype || o instanceof t.Transaction ? ee(o, s, { get() {
1925
+ const l = Zt(o, s);
1926
+ (!l || "value" in l && l.value === void 0) && (o === t.Transaction.prototype || o instanceof t.Transaction ? ee(o, s, { get() {
1913
1927
  return this.table(s);
1914
1928
  }, set(a) {
1915
1929
  Cn(this, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
@@ -1917,7 +1931,7 @@ function pt({ _novip: t }, e, n, r) {
1917
1931
  });
1918
1932
  });
1919
1933
  }
1920
- function Vt({ _novip: t }, e) {
1934
+ function Wt({ _novip: t }, e) {
1921
1935
  e.forEach((n) => {
1922
1936
  for (let r in n)
1923
1937
  n[r] instanceof t.Table && delete n[r];
@@ -1929,61 +1943,61 @@ function Fr(t, e) {
1929
1943
  function Mr(t, e, n, r) {
1930
1944
  const s = t._dbSchema, i = t._createTransaction("readwrite", t._storeNames, s);
1931
1945
  i.create(n), i._completion.catch(r);
1932
- const o = i._reject.bind(i), u = P.transless || P;
1946
+ const o = i._reject.bind(i), l = P.transless || P;
1933
1947
  oe(() => {
1934
- P.trans = i, P.transless = u, e === 0 ? (N(s).forEach((a) => {
1935
- Ct(n, a, s[a].primKey, s[a].indexes);
1936
- }), Ut(t, n), S.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: a }, c, d, l) {
1937
- const h = [], f = a._versions;
1938
- let m = a._dbSchema = zt(a, a.idbdb, l), p = !1;
1939
- const v = f.filter((g) => g._cfg.version >= c);
1948
+ P.trans = i, P.transless = l, e === 0 ? (j(s).forEach((a) => {
1949
+ Pt(n, a, s[a].primKey, s[a].indexes);
1950
+ }), Vt(t, n), S.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: a }, c, h, u) {
1951
+ const d = [], p = a._versions;
1952
+ let m = a._dbSchema = Ht(a, a.idbdb, u), f = !1;
1953
+ const v = p.filter((g) => g._cfg.version >= c);
1940
1954
  function y() {
1941
- return h.length ? S.resolve(h.shift()(d.idbtrans)).then(y) : S.resolve();
1955
+ return d.length ? S.resolve(d.shift()(h.idbtrans)).then(y) : S.resolve();
1942
1956
  }
1943
1957
  return v.forEach((g) => {
1944
- h.push(() => {
1945
- const b = m, k = g._cfg.dbschema;
1946
- Ht(a, b, l), Ht(a, k, l), m = a._dbSchema = k;
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) => {
1951
- if (w.recreate)
1958
+ d.push(() => {
1959
+ const b = m, w = g._cfg.dbschema;
1960
+ Yt(a, b, u), Yt(a, w, u), m = a._dbSchema = w;
1961
+ const C = Jn(b, w);
1962
+ C.add.forEach((_) => {
1963
+ Pt(u, _[0], _[1].primKey, _[1].indexes);
1964
+ }), C.change.forEach((_) => {
1965
+ if (_.recreate)
1952
1966
  throw new E.Upgrade("Not yet support for changing primary key");
1953
1967
  {
1954
- const A = l.objectStore(w.name);
1955
- w.add.forEach((_) => Wt(A, _)), w.change.forEach((_) => {
1956
- A.deleteIndex(_.name), Wt(A, _);
1957
- }), w.del.forEach((_) => A.deleteIndex(_));
1968
+ const A = u.objectStore(_.name);
1969
+ _.add.forEach((x) => zt(A, x)), _.change.forEach((x) => {
1970
+ A.deleteIndex(x.name), zt(A, x);
1971
+ }), _.del.forEach((x) => A.deleteIndex(x));
1958
1972
  }
1959
1973
  });
1960
- const x = g._cfg.contentUpgrade;
1961
- if (x && g._cfg.version > c) {
1962
- Ut(a, l), d._memoizedTables = {}, p = !0;
1963
- let w = An(k);
1974
+ const k = g._cfg.contentUpgrade;
1975
+ if (k && g._cfg.version > c) {
1976
+ Vt(a, u), h._memoizedTables = {}, f = !0;
1977
+ let _ = An(w);
1964
1978
  C.del.forEach((O) => {
1965
- w[O] = b[O];
1966
- }), Vt(a, [a.Transaction.prototype]), pt(a, [a.Transaction.prototype], N(w), w), d.schema = w;
1967
- const A = Zt(x);
1968
- let _;
1979
+ _[O] = b[O];
1980
+ }), Wt(a, [a.Transaction.prototype]), pt(a, [a.Transaction.prototype], j(_), _), h.schema = _;
1981
+ const A = en(k);
1982
+ let x;
1969
1983
  A && Ee();
1970
- const R = S.follow(() => {
1971
- if (_ = x(d), _ && A) {
1984
+ const N = S.follow(() => {
1985
+ if (x = k(h), x && A) {
1972
1986
  var O = ne.bind(null, null);
1973
- _.then(O, O);
1987
+ x.then(O, O);
1974
1988
  }
1975
1989
  });
1976
- return _ && typeof _.then == "function" ? S.resolve(_) : R.then(() => _);
1990
+ return x && typeof x.then == "function" ? S.resolve(x) : N.then(() => x);
1977
1991
  }
1978
- }), h.push((b) => {
1979
- (!p || !Ar) && function(k, C) {
1980
- [].slice.call(C.db.objectStoreNames).forEach((x) => k[x] == null && C.db.deleteObjectStore(x));
1981
- }(g._cfg.dbschema, b), Vt(a, [a.Transaction.prototype]), pt(a, [a.Transaction.prototype], a._storeNames, a._dbSchema), d.schema = a._dbSchema;
1992
+ }), d.push((b) => {
1993
+ (!f || !Ar) && function(w, C) {
1994
+ [].slice.call(C.db.objectStoreNames).forEach((k) => w[k] == null && C.db.deleteObjectStore(k));
1995
+ }(g._cfg.dbschema, b), Wt(a, [a.Transaction.prototype]), pt(a, [a.Transaction.prototype], a._storeNames, a._dbSchema), h.schema = a._dbSchema;
1982
1996
  });
1983
1997
  }), y().then(() => {
1984
1998
  var g, b;
1985
- b = l, N(g = m).forEach((k) => {
1986
- b.db.objectStoreNames.contains(k) || Ct(b, k, g[k].primKey, g[k].indexes);
1999
+ b = u, j(g = m).forEach((w) => {
2000
+ b.db.objectStoreNames.contains(w) || Pt(b, w, g[w].primKey, g[w].indexes);
1987
2001
  });
1988
2002
  });
1989
2003
  }(t, e, i, n).catch(o);
@@ -2001,13 +2015,13 @@ function Jn(t, e) {
2001
2015
  if ("" + (s.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || s.primKey.auto !== i.primKey.auto && !gt)
2002
2016
  o.recreate = !0, n.change.push(o);
2003
2017
  else {
2004
- const u = s.idxByName, a = i.idxByName;
2018
+ const l = s.idxByName, a = i.idxByName;
2005
2019
  let c;
2006
- for (c in u)
2020
+ for (c in l)
2007
2021
  a[c] || o.del.push(c);
2008
2022
  for (c in a) {
2009
- const d = u[c], l = a[c];
2010
- d ? d.src !== l.src && o.change.push(l) : o.add.push(l);
2023
+ const h = l[c], u = a[c];
2024
+ h ? h.src !== u.src && o.change.push(u) : o.add.push(u);
2011
2025
  }
2012
2026
  (o.del.length > 0 || o.add.length > 0 || o.change.length > 0) && n.change.push(o);
2013
2027
  }
@@ -2016,50 +2030,50 @@ function Jn(t, e) {
2016
2030
  }
2017
2031
  return n;
2018
2032
  }
2019
- function Ct(t, e, n, r) {
2033
+ function Pt(t, e, n, r) {
2020
2034
  const s = t.db.createObjectStore(e, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
2021
- return r.forEach((i) => Wt(s, i)), s;
2035
+ return r.forEach((i) => zt(s, i)), s;
2022
2036
  }
2023
- function Wt(t, e) {
2037
+ function zt(t, e) {
2024
2038
  t.createIndex(e.name, e.keyPath, { unique: e.unique, multiEntry: e.multi });
2025
2039
  }
2026
- function zt(t, e, n) {
2040
+ function Ht(t, e, n) {
2027
2041
  const r = {};
2028
- return ut(e.objectStoreNames, 0).forEach((s) => {
2042
+ return lt(e.objectStoreNames, 0).forEach((s) => {
2029
2043
  const i = n.objectStore(s);
2030
2044
  let o = i.keyPath;
2031
- const u = qt(Xn(o), o || "", !1, !1, !!i.autoIncrement, o && typeof o != "string", !0), a = [];
2032
- for (let d = 0; d < i.indexNames.length; ++d) {
2033
- const l = i.index(i.indexNames[d]);
2034
- o = l.keyPath;
2035
- var c = qt(l.name, o, !!l.unique, !!l.multiEntry, !1, o && typeof o != "string", !1);
2045
+ const l = Lt(Xn(o), o || "", !1, !1, !!i.autoIncrement, o && typeof o != "string", !0), a = [];
2046
+ for (let h = 0; h < i.indexNames.length; ++h) {
2047
+ const u = i.index(i.indexNames[h]);
2048
+ o = u.keyPath;
2049
+ var c = Lt(u.name, o, !!u.unique, !!u.multiEntry, !1, o && typeof o != "string", !1);
2036
2050
  a.push(c);
2037
2051
  }
2038
- r[s] = Qn(s, u, a);
2052
+ r[s] = Qn(s, l, a);
2039
2053
  }), r;
2040
2054
  }
2041
- function Ht({ _novip: t }, e, n) {
2055
+ function Yt({ _novip: t }, e, n) {
2042
2056
  const r = n.db.objectStoreNames;
2043
2057
  for (let s = 0; s < r.length; ++s) {
2044
2058
  const i = r[s], o = n.objectStore(i);
2045
2059
  t._hasGetAll = "getAll" in o;
2046
- for (let u = 0; u < o.indexNames.length; ++u) {
2047
- const a = o.indexNames[u], c = o.index(a).keyPath, d = typeof c == "string" ? c : "[" + ut(c).join("+") + "]";
2060
+ for (let l = 0; l < o.indexNames.length; ++l) {
2061
+ const a = o.indexNames[l], c = o.index(a).keyPath, h = typeof c == "string" ? c : "[" + lt(c).join("+") + "]";
2048
2062
  if (e[i]) {
2049
- const l = e[i].idxByName[d];
2050
- l && (l.name = a, delete e[i].idxByName[d], e[i].idxByName[a] = l);
2063
+ const u = e[i].idxByName[h];
2064
+ u && (u.name = a, delete e[i].idxByName[h], e[i].idxByName[a] = u);
2051
2065
  }
2052
2066
  }
2053
2067
  }
2054
- typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && K.WorkerGlobalScope && K instanceof K.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (t._hasGetAll = !1);
2068
+ typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && R.WorkerGlobalScope && R instanceof R.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (t._hasGetAll = !1);
2055
2069
  }
2056
2070
  class qr {
2057
2071
  _parseStoresSpec(e, n) {
2058
- N(e).forEach((r) => {
2072
+ j(e).forEach((r) => {
2059
2073
  if (e[r] !== null) {
2060
- var s = e[r].split(",").map((o, u) => {
2074
+ var s = e[r].split(",").map((o, l) => {
2061
2075
  const a = (o = o.trim()).replace(/([&*]|\+\+)/g, ""), c = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
2062
- return qt(a, c || null, /\&/.test(o), /\*/.test(o), /\+\+/.test(o), M(c), u === 0);
2076
+ return Lt(a, c || null, /\&/.test(o), /\*/.test(o), /\+\+/.test(o), M(c), l === 0);
2063
2077
  }), i = s.shift();
2064
2078
  if (i.multi)
2065
2079
  throw new E.Schema("Primary key cannot be multi-valued");
@@ -2079,20 +2093,20 @@ class qr {
2079
2093
  let i = {};
2080
2094
  return r.forEach((o) => {
2081
2095
  U(s, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(s, i);
2082
- }), n._dbSchema = i, Vt(n, [n._allTables, n, n.Transaction.prototype]), pt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], N(i), i), n._storeNames = N(i), this;
2096
+ }), n._dbSchema = i, Wt(n, [n._allTables, n, n.Transaction.prototype]), pt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], j(i), i), n._storeNames = j(i), this;
2083
2097
  }
2084
2098
  upgrade(e) {
2085
- return this._cfg.contentUpgrade = nn(this._cfg.contentUpgrade || I, e), this;
2099
+ return this._cfg.contentUpgrade = rn(this._cfg.contentUpgrade || I, e), this;
2086
2100
  }
2087
2101
  }
2088
- function an(t, e) {
2102
+ function ln(t, e) {
2089
2103
  let n = t._dbNamesDB;
2090
2104
  return n || (n = t._dbNamesDB = new pe(yt, { addons: [], indexedDB: t, IDBKeyRange: e }), n.version(1).stores({ dbnames: "name" })), n.table("dbnames");
2091
2105
  }
2092
2106
  function un(t) {
2093
2107
  return t && typeof t.databases == "function";
2094
2108
  }
2095
- function Yt(t) {
2109
+ function Gt(t) {
2096
2110
  return oe(function() {
2097
2111
  return P.letThrough = !0, t();
2098
2112
  });
@@ -2118,54 +2132,54 @@ function Ur(t) {
2118
2132
  if (e.openCanceller !== r)
2119
2133
  throw new E.DatabaseClosed("db.open() was cancelled");
2120
2134
  }
2121
- let i = e.dbReadyResolve, o = null, u = !1;
2135
+ let i = e.dbReadyResolve, o = null, l = !1;
2122
2136
  return S.race([r, (typeof navigator > "u" ? S.resolve() : Lr()).then(() => new S((a, c) => {
2123
2137
  if (s(), !n)
2124
2138
  throw new E.MissingAPI();
2125
- const d = t.name, l = e.autoSchema ? n.open(d) : n.open(d, Math.round(10 * t.verno));
2126
- if (!l)
2139
+ const h = t.name, u = e.autoSchema ? n.open(h) : n.open(h, Math.round(10 * t.verno));
2140
+ if (!u)
2127
2141
  throw new E.MissingAPI();
2128
- l.onerror = Y(c), l.onblocked = j(t._fireOnBlocked), l.onupgradeneeded = j((h) => {
2129
- if (o = l.transaction, e.autoSchema && !t._options.allowEmptyDB) {
2130
- l.onerror = qe, o.abort(), l.result.close();
2131
- const m = n.deleteDatabase(d);
2132
- m.onsuccess = m.onerror = j(() => {
2133
- c(new E.NoSuchDatabase(`Database ${d} doesnt exist`));
2142
+ u.onerror = Y(c), u.onblocked = $(t._fireOnBlocked), u.onupgradeneeded = $((d) => {
2143
+ if (o = u.transaction, e.autoSchema && !t._options.allowEmptyDB) {
2144
+ u.onerror = qe, o.abort(), u.result.close();
2145
+ const m = n.deleteDatabase(h);
2146
+ m.onsuccess = m.onerror = $(() => {
2147
+ c(new E.NoSuchDatabase(`Database ${h} doesnt exist`));
2134
2148
  });
2135
2149
  } else {
2136
2150
  o.onerror = Y(c);
2137
- var f = h.oldVersion > Math.pow(2, 62) ? 0 : h.oldVersion;
2138
- u = f < 1, t._novip.idbdb = l.result, Mr(t, f / 10, o, c);
2151
+ var p = d.oldVersion > Math.pow(2, 62) ? 0 : d.oldVersion;
2152
+ l = p < 1, t._novip.idbdb = u.result, Mr(t, p / 10, o, c);
2139
2153
  }
2140
- }, c), l.onsuccess = j(() => {
2154
+ }, c), u.onsuccess = $(() => {
2141
2155
  o = null;
2142
- const h = t._novip.idbdb = l.result, f = ut(h.objectStoreNames);
2143
- if (f.length > 0)
2156
+ const d = t._novip.idbdb = u.result, p = lt(d.objectStoreNames);
2157
+ if (p.length > 0)
2144
2158
  try {
2145
- const p = h.transaction((m = f).length === 1 ? m[0] : m, "readonly");
2159
+ const f = d.transaction((m = p).length === 1 ? m[0] : m, "readonly");
2146
2160
  e.autoSchema ? function({ _novip: v }, y, g) {
2147
2161
  v.verno = y.version / 10;
2148
- const b = v._dbSchema = zt(0, y, g);
2149
- v._storeNames = ut(y.objectStoreNames, 0), pt(v, [v._allTables], N(b), b);
2150
- }(t, h, p) : (Ht(t, t._dbSchema, p), function(v, y) {
2151
- const g = Jn(zt(0, v.idbdb, y), v._dbSchema);
2162
+ const b = v._dbSchema = Ht(0, y, g);
2163
+ v._storeNames = lt(y.objectStoreNames, 0), pt(v, [v._allTables], j(b), b);
2164
+ }(t, d, f) : (Yt(t, t._dbSchema, f), function(v, y) {
2165
+ const g = Jn(Ht(0, v.idbdb, y), v._dbSchema);
2152
2166
  return !(g.add.length || g.change.some((b) => b.add.length || b.change.length));
2153
- }(t, p) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Ut(t, p);
2167
+ }(t, f) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), Vt(t, f);
2154
2168
  } catch {
2155
2169
  }
2156
2170
  var m;
2157
- $e.push(t), h.onversionchange = j((p) => {
2158
- e.vcFired = !0, t.on("versionchange").fire(p);
2159
- }), h.onclose = j((p) => {
2160
- t.on("close").fire(p);
2161
- }), u && function({ indexedDB: p, IDBKeyRange: v }, y) {
2162
- !un(p) && y !== yt && an(p, v).put({ name: y }).catch(I);
2163
- }(t._deps, d), a();
2171
+ Ke.push(t), d.onversionchange = $((f) => {
2172
+ e.vcFired = !0, t.on("versionchange").fire(f);
2173
+ }), d.onclose = $((f) => {
2174
+ t.on("close").fire(f);
2175
+ }), l && function({ indexedDB: f, IDBKeyRange: v }, y) {
2176
+ !un(f) && y !== yt && ln(f, v).put({ name: y }).catch(I);
2177
+ }(t._deps, h), a();
2164
2178
  }, c);
2165
- }))]).then(() => (s(), e.onReadyBeingFired = [], S.resolve(Yt(() => t.on.ready.fire(t.vip))).then(function a() {
2179
+ }))]).then(() => (s(), e.onReadyBeingFired = [], S.resolve(Gt(() => t.on.ready.fire(t.vip))).then(function a() {
2166
2180
  if (e.onReadyBeingFired.length > 0) {
2167
- let c = e.onReadyBeingFired.reduce(nn, I);
2168
- return e.onReadyBeingFired = [], S.resolve(Yt(() => c(t.vip))).then(a);
2181
+ let c = e.onReadyBeingFired.reduce(rn, I);
2182
+ return e.onReadyBeingFired = [], S.resolve(Gt(() => c(t.vip))).then(a);
2169
2183
  }
2170
2184
  }))).finally(() => {
2171
2185
  e.onReadyBeingFired = null, e.isBeingOpened = !1;
@@ -2180,12 +2194,12 @@ function Ur(t) {
2180
2194
  e.openComplete = !0, i();
2181
2195
  });
2182
2196
  }
2183
- function Gt(t) {
2197
+ function Xt(t) {
2184
2198
  var e = (i) => t.next(i), n = s(e), r = s((i) => t.throw(i));
2185
2199
  function s(i) {
2186
2200
  return (o) => {
2187
- var u = i(o), a = u.value;
2188
- return u.done ? a : a && typeof a.then == "function" ? a.then(n, r) : M(a) ? Promise.all(a).then(n, r) : n(a);
2201
+ var l = i(o), a = l.value;
2202
+ return l.done ? a : a && typeof a.then == "function" ? a.then(n, r) : M(a) ? Promise.all(a).then(n, r) : n(a);
2189
2203
  };
2190
2204
  }
2191
2205
  return s(e)();
@@ -2200,27 +2214,27 @@ function Vr(t, e, n) {
2200
2214
  }
2201
2215
  function Zn(t, e, n, r, s) {
2202
2216
  return S.resolve().then(() => {
2203
- const i = P.transless || P, o = t._createTransaction(e, n, t._dbSchema, r), u = { trans: o, transless: i };
2217
+ const i = P.transless || P, o = t._createTransaction(e, n, t._dbSchema, r), l = { trans: o, transless: i };
2204
2218
  if (r)
2205
2219
  o.idbtrans = r.idbtrans;
2206
2220
  else
2207
2221
  try {
2208
2222
  o.create(), t._state.PR1398_maxLoop = 3;
2209
- } catch (l) {
2210
- return l.name === tn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Zn(t, e, n, null, s))) : D(l);
2223
+ } catch (u) {
2224
+ return u.name === nn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => Zn(t, e, n, null, s))) : D(u);
2211
2225
  }
2212
- const a = Zt(s);
2226
+ const a = en(s);
2213
2227
  let c;
2214
2228
  a && Ee();
2215
- const d = S.follow(() => {
2229
+ const h = S.follow(() => {
2216
2230
  if (c = s.call(o, o), c)
2217
2231
  if (a) {
2218
- var l = ne.bind(null, null);
2219
- c.then(l, l);
2232
+ var u = ne.bind(null, null);
2233
+ c.then(u, u);
2220
2234
  } else
2221
- typeof c.next == "function" && typeof c.throw == "function" && (c = Gt(c));
2222
- }, u);
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)));
2235
+ typeof c.next == "function" && typeof c.throw == "function" && (c = Xt(c));
2236
+ }, l);
2237
+ return (c && typeof c.then == "function" ? S.resolve(c).then((u) => o.active ? u : D(new E.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))) : h.then(() => c)).then((u) => (r && o._resolve(), o._completion.then(() => u))).catch((u) => (o._reject(u), D(u)));
2224
2238
  });
2225
2239
  }
2226
2240
  function et(t, e, n) {
@@ -2232,63 +2246,63 @@ function et(t, e, n) {
2232
2246
  const Wr = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(t) {
2233
2247
  return { ...t, table(e) {
2234
2248
  const n = t.table(e), { schema: r } = n, s = {}, i = [];
2235
- function o(c, d, l) {
2236
- const h = De(c), f = s[h] = s[h] || [], m = c == null ? 0 : typeof c == "string" ? 1 : c.length, p = d > 0, v = { ...l, isVirtual: p, keyTail: d, keyLength: m, extractKey: Lt(c), unique: !p && l.unique };
2237
- return f.push(v), v.isPrimaryKey || i.push(v), m > 1 && o(m === 2 ? c[0] : c.slice(0, m - 1), d + 1, l), f.sort((y, g) => y.keyTail - g.keyTail), v;
2249
+ function o(c, h, u) {
2250
+ const d = De(c), p = s[d] = s[d] || [], m = c == null ? 0 : typeof c == "string" ? 1 : c.length, f = h > 0, v = { ...u, isVirtual: f, keyTail: h, keyLength: m, extractKey: Ut(c), unique: !f && u.unique };
2251
+ return p.push(v), v.isPrimaryKey || i.push(v), m > 1 && o(m === 2 ? c[0] : c.slice(0, m - 1), h + 1, u), p.sort((y, g) => y.keyTail - g.keyTail), v;
2238
2252
  }
2239
- const u = o(r.primaryKey.keyPath, 0, r.primaryKey);
2240
- s[":id"] = [u];
2253
+ const l = o(r.primaryKey.keyPath, 0, r.primaryKey);
2254
+ s[":id"] = [l];
2241
2255
  for (const c of r.indexes)
2242
2256
  o(c.keyPath, 0, c);
2243
2257
  function a(c) {
2244
- const d = c.query.index;
2245
- return d.isVirtual ? { ...c, query: { index: d, range: (l = c.query.range, h = d.keyTail, { type: l.type === 1 ? 2 : l.type, lower: et(l.lower, l.lowerOpen ? t.MAX_KEY : t.MIN_KEY, h), lowerOpen: !0, upper: et(l.upper, l.upperOpen ? t.MIN_KEY : t.MAX_KEY, h), upperOpen: !0 }) } } : c;
2246
- var l, h;
2258
+ const h = c.query.index;
2259
+ return h.isVirtual ? { ...c, query: { index: h, range: (u = c.query.range, d = h.keyTail, { type: u.type === 1 ? 2 : u.type, lower: et(u.lower, u.lowerOpen ? t.MAX_KEY : t.MIN_KEY, d), lowerOpen: !0, upper: et(u.upper, u.upperOpen ? t.MIN_KEY : t.MAX_KEY, d), upperOpen: !0 }) } } : c;
2260
+ var u, d;
2247
2261
  }
2248
- return { ...n, schema: { ...r, primaryKey: u, indexes: i, getIndexByKeyPath: function(c) {
2249
- const d = s[De(c)];
2250
- return d && d[0];
2262
+ return { ...n, schema: { ...r, primaryKey: l, indexes: i, getIndexByKeyPath: function(c) {
2263
+ const h = s[De(c)];
2264
+ return h && h[0];
2251
2265
  } }, count: (c) => n.count(a(c)), query: (c) => n.query(a(c)), openCursor(c) {
2252
- const { keyTail: d, isVirtual: l, keyLength: h } = c.query.index;
2253
- return l ? n.openCursor(a(c)).then((f) => f && function(m) {
2254
- return Object.create(m, { continue: { value: function(p) {
2255
- p != null ? m.continue(et(p, c.reverse ? t.MAX_KEY : t.MIN_KEY, d)) : c.unique ? m.continue(m.key.slice(0, h).concat(c.reverse ? t.MIN_KEY : t.MAX_KEY, d)) : m.continue();
2256
- } }, continuePrimaryKey: { value(p, v) {
2257
- m.continuePrimaryKey(et(p, t.MAX_KEY, d), v);
2266
+ const { keyTail: h, isVirtual: u, keyLength: d } = c.query.index;
2267
+ return u ? n.openCursor(a(c)).then((p) => p && function(m) {
2268
+ return Object.create(m, { continue: { value: function(f) {
2269
+ f != null ? m.continue(et(f, c.reverse ? t.MAX_KEY : t.MIN_KEY, h)) : c.unique ? m.continue(m.key.slice(0, d).concat(c.reverse ? t.MIN_KEY : t.MAX_KEY, h)) : m.continue();
2270
+ } }, continuePrimaryKey: { value(f, v) {
2271
+ m.continuePrimaryKey(et(f, t.MAX_KEY, h), v);
2258
2272
  } }, primaryKey: { get: () => m.primaryKey }, key: { get() {
2259
- const p = m.key;
2260
- return h === 1 ? p[0] : p.slice(0, h);
2273
+ const f = m.key;
2274
+ return d === 1 ? f[0] : f.slice(0, d);
2261
2275
  } }, value: { get: () => m.value } });
2262
- }(f)) : n.openCursor(c);
2276
+ }(p)) : n.openCursor(c);
2263
2277
  } };
2264
2278
  } };
2265
2279
  } };
2266
- function ln(t, e, n, r) {
2267
- return n = n || {}, r = r || "", N(t).forEach((s) => {
2280
+ function cn(t, e, n, r) {
2281
+ return n = n || {}, r = r || "", j(t).forEach((s) => {
2268
2282
  if (z(e, s)) {
2269
2283
  var i = t[s], o = e[s];
2270
2284
  if (typeof i == "object" && typeof o == "object" && i && o) {
2271
- const u = Tt(i);
2272
- u !== Tt(o) ? n[r + s] = e[s] : u === "Object" ? ln(i, o, n, r + s + ".") : i !== o && (n[r + s] = e[s]);
2285
+ const l = At(i);
2286
+ l !== At(o) ? n[r + s] = e[s] : l === "Object" ? cn(i, o, n, r + s + ".") : i !== o && (n[r + s] = e[s]);
2273
2287
  } else
2274
2288
  i !== o && (n[r + s] = e[s]);
2275
2289
  } else
2276
2290
  n[r + s] = void 0;
2277
- }), N(e).forEach((s) => {
2291
+ }), j(e).forEach((s) => {
2278
2292
  z(t, s) || (n[r + s] = e[s]);
2279
2293
  }), n;
2280
2294
  }
2281
2295
  const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) => ({ ...t, table(e) {
2282
2296
  const n = t.table(e), { primaryKey: r } = n.schema;
2283
2297
  return { ...n, mutate(s) {
2284
- const i = P.trans, { deleting: o, creating: u, updating: a } = i.table(e).hook;
2298
+ const i = P.trans, { deleting: o, creating: l, updating: a } = i.table(e).hook;
2285
2299
  switch (s.type) {
2286
2300
  case "add":
2287
- if (u.fire === I)
2301
+ if (l.fire === I)
2288
2302
  break;
2289
2303
  return i._promise("readwrite", () => c(s), !0);
2290
2304
  case "put":
2291
- if (u.fire === I && a.fire === I)
2305
+ if (l.fire === I && a.fire === I)
2292
2306
  break;
2293
2307
  return i._promise("readwrite", () => c(s), !0);
2294
2308
  case "delete":
@@ -2298,49 +2312,49 @@ const zr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
2298
2312
  case "deleteRange":
2299
2313
  if (o.fire === I)
2300
2314
  break;
2301
- return i._promise("readwrite", () => function(l) {
2302
- return d(l.trans, l.range, 1e4);
2315
+ return i._promise("readwrite", () => function(u) {
2316
+ return h(u.trans, u.range, 1e4);
2303
2317
  }(s), !0);
2304
2318
  }
2305
2319
  return n.mutate(s);
2306
- function c(l) {
2307
- const h = P.trans, f = l.keys || function(m, p) {
2308
- return p.type === "delete" ? p.keys : p.keys || p.values.map(m.extractKey);
2309
- }(r, l);
2310
- if (!f)
2320
+ function c(u) {
2321
+ const d = P.trans, p = u.keys || function(m, f) {
2322
+ return f.type === "delete" ? f.keys : f.keys || f.values.map(m.extractKey);
2323
+ }(r, u);
2324
+ if (!p)
2311
2325
  throw new Error("Keys missing");
2312
- return (l = l.type === "add" || l.type === "put" ? { ...l, keys: f } : { ...l }).type !== "delete" && (l.values = [...l.values]), l.keys && (l.keys = [...l.keys]), function(m, p, v) {
2313
- return p.type === "add" ? Promise.resolve([]) : m.getMany({ trans: p.trans, keys: v, cache: "immutable" });
2314
- }(n, l, f).then((m) => {
2315
- const p = f.map((v, y) => {
2326
+ return (u = u.type === "add" || u.type === "put" ? { ...u, keys: p } : { ...u }).type !== "delete" && (u.values = [...u.values]), u.keys && (u.keys = [...u.keys]), function(m, f, v) {
2327
+ return f.type === "add" ? Promise.resolve([]) : m.getMany({ trans: f.trans, keys: v, cache: "immutable" });
2328
+ }(n, u, p).then((m) => {
2329
+ const f = p.map((v, y) => {
2316
2330
  const g = m[y], b = { onerror: null, onsuccess: null };
2317
- if (l.type === "delete")
2318
- o.fire.call(b, v, g, h);
2319
- else if (l.type === "add" || g === void 0) {
2320
- const k = u.fire.call(b, v, l.values[y], h);
2321
- v == null && k != null && (v = k, l.keys[y] = v, r.outbound || H(l.values[y], r.keyPath, v));
2331
+ if (u.type === "delete")
2332
+ o.fire.call(b, v, g, d);
2333
+ else if (u.type === "add" || g === void 0) {
2334
+ const w = l.fire.call(b, v, u.values[y], d);
2335
+ v == null && w != null && (v = w, u.keys[y] = v, r.outbound || H(u.values[y], r.keyPath, v));
2322
2336
  } else {
2323
- const k = ln(g, l.values[y]), C = a.fire.call(b, k, v, g, h);
2337
+ const w = cn(g, u.values[y]), C = a.fire.call(b, w, v, g, d);
2324
2338
  if (C) {
2325
- const x = l.values[y];
2326
- Object.keys(C).forEach((w) => {
2327
- z(x, w) ? x[w] = C[w] : H(x, w, C[w]);
2339
+ const k = u.values[y];
2340
+ Object.keys(C).forEach((_) => {
2341
+ z(k, _) ? k[_] = C[_] : H(k, _, C[_]);
2328
2342
  });
2329
2343
  }
2330
2344
  }
2331
2345
  return b;
2332
2346
  });
2333
- return n.mutate(l).then(({ failures: v, results: y, numFailures: g, lastResult: b }) => {
2334
- for (let k = 0; k < f.length; ++k) {
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);
2347
+ return n.mutate(u).then(({ failures: v, results: y, numFailures: g, lastResult: b }) => {
2348
+ for (let w = 0; w < p.length; ++w) {
2349
+ const C = y ? y[w] : p[w], k = f[w];
2350
+ C == null ? k.onerror && k.onerror(v[w]) : k.onsuccess && k.onsuccess(u.type === "put" && m[w] ? u.values[w] : C);
2337
2351
  }
2338
2352
  return { failures: v, results: y, numFailures: g, lastResult: b };
2339
- }).catch((v) => (p.forEach((y) => y.onerror && y.onerror(v)), Promise.reject(v)));
2353
+ }).catch((v) => (f.forEach((y) => y.onerror && y.onerror(v)), Promise.reject(v)));
2340
2354
  });
2341
2355
  }
2342
- function d(l, h, f) {
2343
- return n.query({ trans: l, values: !1, query: { index: r, range: h }, limit: f }).then(({ result: m }) => c({ type: "delete", keys: m, trans: l }).then((p) => p.numFailures > 0 ? Promise.reject(p.failures[0]) : m.length < f ? { failures: [], numFailures: 0, lastResult: void 0 } : d(l, { ...h, lower: m[m.length - 1], lowerOpen: !0 }, f)));
2356
+ function h(u, d, p) {
2357
+ return n.query({ trans: u, values: !1, query: { index: r, range: d }, limit: p }).then(({ result: m }) => c({ type: "delete", keys: m, trans: u }).then((f) => f.numFailures > 0 ? Promise.reject(f.failures[0]) : m.length < p ? { failures: [], numFailures: 0, lastResult: void 0 } : h(u, { ...d, lower: m[m.length - 1], lowerOpen: !0 }, p)));
2344
2358
  }
2345
2359
  } };
2346
2360
  } }) };
@@ -2365,7 +2379,7 @@ const Hr = { stack: "dbcore", level: -1, create: (t) => ({ table: (e) => {
2365
2379
  return s ? S.resolve(s) : n.getMany(r).then((i) => (r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? We(i) : i }, i));
2366
2380
  }, mutate: (r) => (r.type !== "add" && (r.trans._cache = null), n.mutate(r)) };
2367
2381
  } }) };
2368
- function cn(t) {
2382
+ function hn(t) {
2369
2383
  return !("from" in t);
2370
2384
  }
2371
2385
  const Q = function(t, e) {
@@ -2381,7 +2395,7 @@ function Ve(t, e, n) {
2381
2395
  return;
2382
2396
  if (r > 0)
2383
2397
  throw RangeError();
2384
- if (cn(t))
2398
+ if (hn(t))
2385
2399
  return U(t, { from: e, to: n, d: 1 });
2386
2400
  const s = t.l, i = t.r;
2387
2401
  if (L(n, t.from) < 0)
@@ -2393,27 +2407,27 @@ function Ve(t, e, n) {
2393
2407
  s && !t.l && mt(t, s), i && o && mt(t, i);
2394
2408
  }
2395
2409
  function mt(t, e) {
2396
- cn(e) || function n(r, { from: s, to: i, l: o, r: u }) {
2397
- Ve(r, s, i), o && n(r, o), u && n(r, u);
2410
+ hn(e) || function n(r, { from: s, to: i, l: o, r: l }) {
2411
+ Ve(r, s, i), o && n(r, o), l && n(r, l);
2398
2412
  }(t, e);
2399
2413
  }
2400
2414
  function Yr(t, e) {
2401
- const n = Xt(e);
2415
+ const n = Qt(e);
2402
2416
  let r = n.next();
2403
2417
  if (r.done)
2404
2418
  return !1;
2405
2419
  let s = r.value;
2406
- const i = Xt(t);
2407
- let o = i.next(s.from), u = o.value;
2420
+ const i = Qt(t);
2421
+ let o = i.next(s.from), l = o.value;
2408
2422
  for (; !r.done && !o.done; ) {
2409
- if (L(u.from, s.to) <= 0 && L(u.to, s.from) >= 0)
2423
+ if (L(l.from, s.to) <= 0 && L(l.to, s.from) >= 0)
2410
2424
  return !0;
2411
- L(s.from, u.from) < 0 ? s = (r = n.next(u.from)).value : u = (o = i.next(s.from)).value;
2425
+ L(s.from, l.from) < 0 ? s = (r = n.next(l.from)).value : l = (o = i.next(s.from)).value;
2412
2426
  }
2413
2427
  return !1;
2414
2428
  }
2415
- function Xt(t) {
2416
- let e = cn(t) ? null : { s: 0, n: t };
2429
+ function Qt(t) {
2430
+ let e = hn(t) ? null : { s: 0, n: t };
2417
2431
  return { next(n) {
2418
2432
  const r = arguments.length > 0;
2419
2433
  for (; e; )
@@ -2443,8 +2457,8 @@ function xn(t) {
2443
2457
  var e, n;
2444
2458
  const r = (((e = t.r) === null || e === void 0 ? void 0 : e.d) || 0) - (((n = t.l) === null || n === void 0 ? void 0 : n.d) || 0), s = r > 1 ? "r" : r < -1 ? "l" : "";
2445
2459
  if (s) {
2446
- const i = s === "r" ? "l" : "r", o = { ...t }, u = t[s];
2447
- t.from = u.from, t.to = u.to, t[s] = u[s], o[s] = u[i], t[i] = o, o.d = Sn(o);
2460
+ const i = s === "r" ? "l" : "r", o = { ...t }, l = t[s];
2461
+ t.from = l.from, t.to = l.to, t[s] = l[s], o[s] = l[i], t[i] = o, o.d = Sn(o);
2448
2462
  }
2449
2463
  t.d = Sn(t);
2450
2464
  }
@@ -2457,71 +2471,71 @@ Ce(Q.prototype, { add(t) {
2457
2471
  return Ve(this, t, t), this;
2458
2472
  }, addKeys(t) {
2459
2473
  return t.forEach((e) => Ve(this, e, e)), this;
2460
- }, [At]() {
2461
- return Xt(this);
2474
+ }, [Ot]() {
2475
+ return Qt(this);
2462
2476
  } });
2463
2477
  const Gr = { stack: "dbcore", level: 0, create: (t) => {
2464
2478
  const e = t.schema.name, n = new Q(t.MIN_KEY, t.MAX_KEY);
2465
2479
  return { ...t, table: (r) => {
2466
- const s = t.table(r), { schema: i } = s, { primaryKey: o } = i, { extractKey: u, outbound: a } = o, c = { ...s, mutate: (h) => {
2467
- const f = h.trans, m = f.mutatedParts || (f.mutatedParts = {}), p = (x) => {
2468
- const w = `idb://${e}/${r}/${x}`;
2469
- return m[w] || (m[w] = new Q());
2470
- }, v = p(""), y = p(":dels"), { type: g } = h;
2471
- let [b, k] = h.type === "deleteRange" ? [h.range] : h.type === "delete" ? [h.keys] : h.values.length < 50 ? [[], h.values] : [];
2472
- const C = h.trans._cache;
2473
- return s.mutate(h).then((x) => {
2480
+ const s = t.table(r), { schema: i } = s, { primaryKey: o } = i, { extractKey: l, outbound: a } = o, c = { ...s, mutate: (d) => {
2481
+ const p = d.trans, m = p.mutatedParts || (p.mutatedParts = {}), f = (k) => {
2482
+ const _ = `idb://${e}/${r}/${k}`;
2483
+ return m[_] || (m[_] = new Q());
2484
+ }, v = f(""), y = f(":dels"), { type: g } = d;
2485
+ let [b, w] = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [[], d.values] : [];
2486
+ const C = d.trans._cache;
2487
+ return s.mutate(d).then((k) => {
2474
2488
  if (M(b)) {
2475
- g !== "delete" && (b = x.results), v.addKeys(b);
2476
- const w = er(b, C);
2477
- w || g === "add" || y.addKeys(b), (w || k) && function(A, _, R, O) {
2489
+ g !== "delete" && (b = k.results), v.addKeys(b);
2490
+ const _ = er(b, C);
2491
+ _ || g === "add" || y.addKeys(b), (_ || w) && function(A, x, N, O) {
2478
2492
  function q(B) {
2479
- const $ = A(B.name || "");
2493
+ const K = A(B.name || "");
2480
2494
  function ye(V) {
2481
2495
  return V != null ? B.extractKey(V) : null;
2482
2496
  }
2483
- const ve = (V) => B.multiEntry && M(V) ? V.forEach((le) => $.addKey(le)) : $.addKey(V);
2484
- (R || O).forEach((V, le) => {
2485
- const Ae = R && ye(R[le]), vt = O && ye(O[le]);
2497
+ const ve = (V) => B.multiEntry && M(V) ? V.forEach((ue) => K.addKey(ue)) : K.addKey(V);
2498
+ (N || O).forEach((V, ue) => {
2499
+ const Ae = N && ye(N[ue]), vt = O && ye(O[ue]);
2486
2500
  L(Ae, vt) !== 0 && (Ae != null && ve(Ae), vt != null && ve(vt));
2487
2501
  });
2488
2502
  }
2489
- _.indexes.forEach(q);
2490
- }(p, i, w, k);
2503
+ x.indexes.forEach(q);
2504
+ }(f, i, _, w);
2491
2505
  } else if (b) {
2492
- const w = { from: b.lower, to: b.upper };
2493
- y.add(w), v.add(w);
2506
+ const _ = { from: b.lower, to: b.upper };
2507
+ y.add(_), v.add(_);
2494
2508
  } else
2495
- v.add(n), y.add(n), i.indexes.forEach((w) => p(w.name).add(n));
2496
- return x;
2509
+ v.add(n), y.add(n), i.indexes.forEach((_) => f(_.name).add(n));
2510
+ return k;
2497
2511
  });
2498
- } }, d = ({ query: { index: h, range: f } }) => {
2499
- var m, p;
2500
- return [h, new Q((m = f.lower) !== null && m !== void 0 ? m : t.MIN_KEY, (p = f.upper) !== null && p !== void 0 ? p : t.MAX_KEY)];
2501
- }, l = { get: (h) => [o, new Q(h.key)], getMany: (h) => [o, new Q().addKeys(h.keys)], count: d, query: d, openCursor: d };
2502
- return N(l).forEach((h) => {
2503
- c[h] = function(f) {
2512
+ } }, h = ({ query: { index: d, range: p } }) => {
2513
+ var m, f;
2514
+ return [d, new Q((m = p.lower) !== null && m !== void 0 ? m : t.MIN_KEY, (f = p.upper) !== null && f !== void 0 ? f : t.MAX_KEY)];
2515
+ }, u = { get: (d) => [o, new Q(d.key)], getMany: (d) => [o, new Q().addKeys(d.keys)], count: h, query: h, openCursor: h };
2516
+ return j(u).forEach((d) => {
2517
+ c[d] = function(p) {
2504
2518
  const { subscr: m } = P;
2505
2519
  if (m) {
2506
- const p = (k) => {
2507
- const C = `idb://${e}/${r}/${k}`;
2520
+ const f = (w) => {
2521
+ const C = `idb://${e}/${r}/${w}`;
2508
2522
  return m[C] || (m[C] = new Q());
2509
- }, v = p(""), y = p(":dels"), [g, b] = l[h](f);
2510
- if (p(g.name || "").add(b), !g.isPrimaryKey) {
2511
- if (h !== "count") {
2512
- const k = h === "query" && a && f.values && s.query({ ...f, values: !1 });
2513
- return s[h].apply(this, arguments).then((C) => {
2514
- if (h === "query") {
2515
- if (a && f.values)
2516
- return k.then(({ result: w }) => (v.addKeys(w), C));
2517
- const x = f.values ? C.result.map(u) : C.result;
2518
- f.values ? v.addKeys(x) : y.addKeys(x);
2519
- } else if (h === "openCursor") {
2520
- const x = C, w = f.values;
2521
- return x && Object.create(x, { key: { get: () => (y.addKey(x.primaryKey), x.key) }, primaryKey: { get() {
2522
- const A = x.primaryKey;
2523
+ }, v = f(""), y = f(":dels"), [g, b] = u[d](p);
2524
+ if (f(g.name || "").add(b), !g.isPrimaryKey) {
2525
+ if (d !== "count") {
2526
+ const w = d === "query" && a && p.values && s.query({ ...p, values: !1 });
2527
+ return s[d].apply(this, arguments).then((C) => {
2528
+ if (d === "query") {
2529
+ if (a && p.values)
2530
+ return w.then(({ result: _ }) => (v.addKeys(_), C));
2531
+ const k = p.values ? C.result.map(l) : C.result;
2532
+ p.values ? v.addKeys(k) : y.addKeys(k);
2533
+ } else if (d === "openCursor") {
2534
+ const k = C, _ = p.values;
2535
+ return k && Object.create(k, { key: { get: () => (y.addKey(k.primaryKey), k.key) }, primaryKey: { get() {
2536
+ const A = k.primaryKey;
2523
2537
  return y.addKey(A), A;
2524
- } }, value: { get: () => (w && v.addKey(x.primaryKey), x.value) } });
2538
+ } }, value: { get: () => (_ && v.addKey(k.primaryKey), k.value) } });
2525
2539
  }
2526
2540
  return C;
2527
2541
  });
@@ -2529,7 +2543,7 @@ const Gr = { stack: "dbcore", level: 0, create: (t) => {
2529
2543
  y.add(n);
2530
2544
  }
2531
2545
  }
2532
- return s[h].apply(this, arguments);
2546
+ return s[d].apply(this, arguments);
2533
2547
  };
2534
2548
  }), c;
2535
2549
  } };
@@ -2543,70 +2557,70 @@ class pe {
2543
2557
  this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
2544
2558
  const i = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: I, dbReadyPromise: null, cancelOpen: I, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3 };
2545
2559
  var o;
2546
- i.dbReadyPromise = new S((u) => {
2547
- i.dbReadyResolve = u;
2548
- }), i.openCanceller = new S((u, a) => {
2560
+ i.dbReadyPromise = new S((l) => {
2561
+ i.dbReadyResolve = l;
2562
+ }), i.openCanceller = new S((l, a) => {
2549
2563
  i.cancelOpen = a;
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) => {
2564
+ }), this._state = i, this.name = e, this.on = je(this, "populate", "blocked", "versionchange", "close", { ready: [rn, I] }), this.on.ready.subscribe = Pn(this.on.ready.subscribe, (l) => (a, c) => {
2551
2565
  pe.vip(() => {
2552
- const d = this._state;
2553
- if (d.openComplete)
2554
- d.dbOpenError || S.resolve().then(a), c && u(a);
2555
- else if (d.onReadyBeingFired)
2556
- d.onReadyBeingFired.push(a), c && u(a);
2566
+ const h = this._state;
2567
+ if (h.openComplete)
2568
+ h.dbOpenError || S.resolve().then(a), c && l(a);
2569
+ else if (h.onReadyBeingFired)
2570
+ h.onReadyBeingFired.push(a), c && l(a);
2557
2571
  else {
2558
- u(a);
2559
- const l = this;
2560
- c || u(function h() {
2561
- l.on.ready.unsubscribe(a), l.on.ready.unsubscribe(h);
2572
+ l(a);
2573
+ const u = this;
2574
+ c || l(function d() {
2575
+ u.on.ready.unsubscribe(a), u.on.ready.unsubscribe(d);
2562
2576
  });
2563
2577
  }
2564
2578
  });
2565
- }), this.Collection = (o = this, Oe(Kr.prototype, function(u, a) {
2579
+ }), this.Collection = (o = this, Oe(Rr.prototype, function(l, a) {
2566
2580
  this.db = o;
2567
- let c = Hn, d = null;
2581
+ let c = Hn, h = null;
2568
2582
  if (a)
2569
2583
  try {
2570
2584
  c = a();
2571
2585
  } catch (m) {
2572
- d = m;
2586
+ h = m;
2573
2587
  }
2574
- const l = u._ctx, h = l.table, f = h.hook.reading.fire;
2575
- this._ctx = { table: h, index: l.index, isPrimKey: !l.index || h.schema.primKey.keyPath && l.index === h.schema.primKey.name, range: c, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: d, or: l.or, valueMapper: f !== Fe ? f : null };
2576
- })), this.Table = function(u) {
2577
- return Oe(Ir.prototype, function(a, c, d) {
2578
- this.db = u, this._tx = d, this.name = a, this.schema = c, this.hook = u._allTables[a] ? u._allTables[a].hook : Ne(null, { creating: [br, I], reading: [vr, Fe], updating: [_r, I], deleting: [wr, I] });
2588
+ const u = l._ctx, d = u.table, p = d.hook.reading.fire;
2589
+ this._ctx = { table: d, index: u.index, isPrimKey: !u.index || d.schema.primKey.keyPath && u.index === d.schema.primKey.name, range: c, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: h, or: u.or, valueMapper: p !== Fe ? p : null };
2590
+ })), this.Table = function(l) {
2591
+ return Oe(Ir.prototype, function(a, c, h) {
2592
+ this.db = l, this._tx = h, this.name = a, this.schema = c, this.hook = l._allTables[a] ? l._allTables[a].hook : je(null, { creating: [br, I], reading: [vr, Fe], updating: [_r, I], deleting: [wr, I] });
2579
2593
  });
2580
- }(this), this.Transaction = function(u) {
2581
- return Oe(Nr.prototype, function(a, c, d, l, h) {
2582
- this.db = u, this.mode = a, this.storeNames = c, this.schema = d, this.chromeTransactionDurability = l, this.idbtrans = null, this.on = Ne(this, "complete", "error", "abort"), this.parent = h || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new S((f, m) => {
2583
- this._resolve = f, this._reject = m;
2594
+ }(this), this.Transaction = function(l) {
2595
+ return Oe(jr.prototype, function(a, c, h, u, d) {
2596
+ this.db = l, this.mode = a, this.storeNames = c, this.schema = h, this.chromeTransactionDurability = u, this.idbtrans = null, this.on = je(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new S((p, m) => {
2597
+ this._resolve = p, this._reject = m;
2584
2598
  }), this._completion.then(() => {
2585
2599
  this.active = !1, this.on.complete.fire();
2586
- }, (f) => {
2600
+ }, (p) => {
2587
2601
  var m = this.active;
2588
- return this.active = !1, this.on.error.fire(f), this.parent ? this.parent._reject(f) : m && this.idbtrans && this.idbtrans.abort(), D(f);
2602
+ return this.active = !1, this.on.error.fire(p), this.parent ? this.parent._reject(p) : m && this.idbtrans && this.idbtrans.abort(), D(p);
2589
2603
  });
2590
2604
  });
2591
- }(this), this.Version = function(u) {
2605
+ }(this), this.Version = function(l) {
2592
2606
  return Oe(qr.prototype, function(a) {
2593
- this.db = u, this._cfg = { version: a, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
2607
+ this.db = l, this._cfg = { version: a, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
2594
2608
  });
2595
- }(this), this.WhereClause = function(u) {
2596
- return Oe(Gn.prototype, function(a, c, d) {
2597
- this.db = u, this._ctx = { table: a, index: c === ":id" ? null : c, or: d };
2598
- const l = u._deps.indexedDB;
2599
- if (!l)
2609
+ }(this), this.WhereClause = function(l) {
2610
+ return Oe(Gn.prototype, function(a, c, h) {
2611
+ this.db = l, this._ctx = { table: a, index: c === ":id" ? null : c, or: h };
2612
+ const u = l._deps.indexedDB;
2613
+ if (!u)
2600
2614
  throw new E.MissingAPI();
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;
2615
+ this._cmp = this._ascending = u.cmp.bind(u), this._descending = (d, p) => u.cmp(p, d), this._max = (d, p) => u.cmp(d, p) > 0 ? d : p, this._min = (d, p) => u.cmp(d, p) < 0 ? d : p, this._IDBKeyRange = l._deps.IDBKeyRange;
2602
2616
  });
2603
- }(this), this.on("versionchange", (u) => {
2604
- u.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`), this.close();
2605
- }), this.on("blocked", (u) => {
2606
- !u.newVersion || u.newVersion < u.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${u.oldVersion / 10}`);
2607
- }), this._maxKey = Ue(n.IDBKeyRange), this._createTransaction = (u, a, c, d) => new this.Transaction(u, a, c, this._options.chromeTransactionDurability, d), this._fireOnBlocked = (u) => {
2608
- this.on("blocked").fire(u), $e.filter((a) => a.name === this.name && a !== this && !a._state.vcFired).map((a) => a.on("versionchange").fire(u));
2609
- }, this.use(Wr), this.use(zr), this.use(Gr), this.use(Hr), this.vip = Object.create(this, { _vip: { value: !0 } }), s.forEach((u) => u(this));
2617
+ }(this), this.on("versionchange", (l) => {
2618
+ l.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`), this.close();
2619
+ }), this.on("blocked", (l) => {
2620
+ !l.newVersion || l.newVersion < l.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${l.oldVersion / 10}`);
2621
+ }), this._maxKey = Ue(n.IDBKeyRange), this._createTransaction = (l, a, c, h) => new this.Transaction(l, a, c, this._options.chromeTransactionDurability, h), this._fireOnBlocked = (l) => {
2622
+ this.on("blocked").fire(l), Ke.filter((a) => a.name === this.name && a !== this && !a._state.vcFired).map((a) => a.on("versionchange").fire(l));
2623
+ }, this.use(Wr), this.use(zr), this.use(Gr), this.use(Hr), this.vip = Object.create(this, { _vip: { value: !0 } }), s.forEach((l) => l(this));
2610
2624
  }
2611
2625
  version(e) {
2612
2626
  if (isNaN(e) || e < 0.1)
@@ -2633,7 +2647,7 @@ class pe {
2633
2647
  use({ stack: e, create: n, level: r, name: s }) {
2634
2648
  s && this.unuse({ stack: e, name: s });
2635
2649
  const i = this._middlewares[e] || (this._middlewares[e] = []);
2636
- return i.push({ stack: e, create: n, level: r ?? 10, name: s }), i.sort((o, u) => o.level - u.level), this;
2650
+ return i.push({ stack: e, create: n, level: r ?? 10, name: s }), i.sort((o, l) => o.level - l.level), this;
2637
2651
  }
2638
2652
  unuse({ stack: e, name: n, create: r }) {
2639
2653
  return e && this._middlewares[e] && (this._middlewares[e] = this._middlewares[e].filter((s) => r ? s.create !== r : !!n && s.name !== n)), this;
@@ -2642,8 +2656,8 @@ class pe {
2642
2656
  return Ur(this);
2643
2657
  }
2644
2658
  _close() {
2645
- const e = this._state, n = $e.indexOf(this);
2646
- if (n >= 0 && $e.splice(n, 1), this.idbdb) {
2659
+ const e = this._state, n = Ke.indexOf(this);
2660
+ if (n >= 0 && Ke.splice(n, 1), this.idbdb) {
2647
2661
  try {
2648
2662
  this.idbdb.close();
2649
2663
  } catch {
@@ -2667,9 +2681,9 @@ class pe {
2667
2681
  const i = () => {
2668
2682
  this.close();
2669
2683
  var o = this._deps.indexedDB.deleteDatabase(this.name);
2670
- o.onsuccess = j(() => {
2671
- (function({ indexedDB: u, IDBKeyRange: a }, c) {
2672
- !un(u) && c !== yt && an(u, a).delete(c).catch(I);
2684
+ o.onsuccess = $(() => {
2685
+ (function({ indexedDB: l, IDBKeyRange: a }, c) {
2686
+ !un(l) && c !== yt && ln(l, a).delete(c).catch(I);
2673
2687
  })(this._deps, this.name), r();
2674
2688
  }), o.onerror = Y(s), o.onblocked = this._fireOnBlocked;
2675
2689
  };
@@ -2695,7 +2709,7 @@ class pe {
2695
2709
  return this._state.autoSchema;
2696
2710
  }
2697
2711
  get tables() {
2698
- return N(this._allTables).map((e) => this._allTables[e]);
2712
+ return j(this._allTables).map((e) => this._allTables[e]);
2699
2713
  }
2700
2714
  transaction() {
2701
2715
  const e = Vr.apply(this, arguments);
@@ -2705,28 +2719,28 @@ class pe {
2705
2719
  let s = P.trans;
2706
2720
  s && s.db === this && e.indexOf("!") === -1 || (s = null);
2707
2721
  const i = e.indexOf("?") !== -1;
2708
- let o, u;
2722
+ let o, l;
2709
2723
  e = e.replace("!", "").replace("?", "");
2710
2724
  try {
2711
- if (u = n.map((c) => {
2712
- var d = c instanceof this.Table ? c.name : c;
2713
- if (typeof d != "string")
2725
+ if (l = n.map((c) => {
2726
+ var h = c instanceof this.Table ? c.name : c;
2727
+ if (typeof h != "string")
2714
2728
  throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
2715
- return d;
2716
- }), e == "r" || e === wt)
2717
- o = wt;
2729
+ return h;
2730
+ }), e == "r" || e === _t)
2731
+ o = _t;
2718
2732
  else {
2719
- if (e != "rw" && e != _t)
2733
+ if (e != "rw" && e != kt)
2720
2734
  throw new E.InvalidArgument("Invalid transaction mode: " + e);
2721
- o = _t;
2735
+ o = kt;
2722
2736
  }
2723
2737
  if (s) {
2724
- if (s.mode === wt && o === _t) {
2738
+ if (s.mode === _t && o === kt) {
2725
2739
  if (!i)
2726
2740
  throw new E.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
2727
2741
  s = null;
2728
2742
  }
2729
- s && u.forEach((c) => {
2743
+ s && l.forEach((c) => {
2730
2744
  if (s && s.storeNames.indexOf(c) === -1) {
2731
2745
  if (!i)
2732
2746
  throw new E.SubTransaction("Table " + c + " not included in parent transaction.");
@@ -2735,11 +2749,11 @@ class pe {
2735
2749
  }), i && s && !s.active && (s = null);
2736
2750
  }
2737
2751
  } catch (c) {
2738
- return s ? s._promise(null, (d, l) => {
2739
- l(c);
2752
+ return s ? s._promise(null, (h, u) => {
2753
+ u(c);
2740
2754
  }) : D(c);
2741
2755
  }
2742
- const a = Zn.bind(null, this, o, u, s, r);
2756
+ const a = Zn.bind(null, this, o, l, s, r);
2743
2757
  return s ? s._promise(o, a, "lock") : P.trans ? Te(P.transless, () => this._whenReady(a)) : this._whenReady(a);
2744
2758
  }
2745
2759
  table(e) {
@@ -2761,57 +2775,57 @@ class Qr {
2761
2775
  }
2762
2776
  }
2763
2777
  function tr(t, e) {
2764
- return N(e).forEach((n) => {
2778
+ return j(e).forEach((n) => {
2765
2779
  mt(t[n] || (t[n] = new Q()), e[n]);
2766
2780
  }), t;
2767
2781
  }
2768
2782
  function Jr(t) {
2769
2783
  let e, n = !1;
2770
2784
  const r = new Qr((s) => {
2771
- const i = Zt(t);
2772
- let o = !1, u = {}, a = {};
2785
+ const i = en(t);
2786
+ let o = !1, l = {}, a = {};
2773
2787
  const c = { get closed() {
2774
2788
  return o;
2775
2789
  }, unsubscribe: () => {
2776
- o = !0, ue.storagemutated.unsubscribe(f);
2790
+ o = !0, le.storagemutated.unsubscribe(p);
2777
2791
  } };
2778
2792
  s.start && s.start(c);
2779
- let d = !1, l = !1;
2780
- function h() {
2781
- return N(a).some((p) => u[p] && Yr(u[p], a[p]));
2793
+ let h = !1, u = !1;
2794
+ function d() {
2795
+ return j(a).some((f) => l[f] && Yr(l[f], a[f]));
2782
2796
  }
2783
- const f = (p) => {
2784
- tr(u, p), h() && m();
2797
+ const p = (f) => {
2798
+ tr(l, f), d() && m();
2785
2799
  }, m = () => {
2786
- if (d || o)
2800
+ if (h || o)
2787
2801
  return;
2788
- u = {};
2789
- const p = {}, v = function(y) {
2802
+ l = {};
2803
+ const f = {}, v = function(y) {
2790
2804
  i && Ee();
2791
2805
  const g = () => oe(t, { subscr: y, trans: null }), b = P.trans ? Te(P.transless, g) : g();
2792
2806
  return i && b.then(ne, ne), b;
2793
- }(p);
2794
- l || (ue(Le, f), l = !0), d = !0, Promise.resolve(v).then((y) => {
2795
- n = !0, e = y, d = !1, o || (h() ? m() : (u = {}, a = p, s.next && s.next(y)));
2807
+ }(f);
2808
+ u || (le(Le, p), u = !0), h = !0, Promise.resolve(v).then((y) => {
2809
+ n = !0, e = y, h = !1, o || (d() ? m() : (l = {}, a = f, s.next && s.next(y)));
2796
2810
  }, (y) => {
2797
- d = !1, n = !1, s.error && s.error(y), c.unsubscribe();
2811
+ h = !1, n = !1, s.error && s.error(y), c.unsubscribe();
2798
2812
  });
2799
2813
  };
2800
2814
  return m(), c;
2801
2815
  });
2802
2816
  return r.hasValue = () => n, r.getValue = () => e, r;
2803
2817
  }
2804
- let Qt;
2818
+ let Jt;
2805
2819
  try {
2806
- Qt = { indexedDB: K.indexedDB || K.mozIndexedDB || K.webkitIndexedDB || K.msIndexedDB, IDBKeyRange: K.IDBKeyRange || K.webkitIDBKeyRange };
2820
+ Jt = { indexedDB: R.indexedDB || R.mozIndexedDB || R.webkitIndexedDB || R.msIndexedDB, IDBKeyRange: R.IDBKeyRange || R.webkitIDBKeyRange };
2807
2821
  } catch {
2808
- Qt = { indexedDB: null, IDBKeyRange: null };
2822
+ Jt = { indexedDB: null, IDBKeyRange: null };
2809
2823
  }
2810
2824
  const ce = pe;
2811
2825
  function at(t) {
2812
2826
  let e = Z;
2813
2827
  try {
2814
- Z = !0, ue.storagemutated.fire(t);
2828
+ Z = !0, le.storagemutated.fire(t);
2815
2829
  } finally {
2816
2830
  Z = e;
2817
2831
  }
@@ -2819,17 +2833,17 @@ function at(t) {
2819
2833
  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) {
2820
2834
  try {
2821
2835
  return function({ indexedDB: e, IDBKeyRange: n }) {
2822
- return un(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== yt)) : an(e, n).toCollection().primaryKeys();
2836
+ return un(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== yt)) : ln(e, n).toCollection().primaryKeys();
2823
2837
  }(ce.dependencies).then(t);
2824
2838
  } catch {
2825
2839
  return D(new E.MissingAPI());
2826
2840
  }
2827
2841
  }, defineClass: () => function(t) {
2828
2842
  U(this, t);
2829
- }, ignoreTransaction: (t) => P.trans ? Te(P.transless, t) : t(), vip: Yt, async: function(t) {
2843
+ }, ignoreTransaction: (t) => P.trans ? Te(P.transless, t) : t(), vip: Gt, async: function(t) {
2830
2844
  return function() {
2831
2845
  try {
2832
- var e = Gt(t.apply(this, arguments));
2846
+ var e = Xt(t.apply(this, arguments));
2833
2847
  return e && typeof e.then == "function" ? e : S.resolve(e);
2834
2848
  } catch (n) {
2835
2849
  return D(n);
@@ -2837,7 +2851,7 @@ Ce(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) =
2837
2851
  };
2838
2852
  }, spawn: function(t, e, n) {
2839
2853
  try {
2840
- var r = Gt(t.apply(n, e || []));
2854
+ var r = Xt(t.apply(n, e || []));
2841
2855
  return r && typeof r.then == "function" ? r : S.resolve(r);
2842
2856
  } catch (s) {
2843
2857
  return D(s);
@@ -2846,12 +2860,12 @@ Ce(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) =
2846
2860
  const n = S.resolve(typeof t == "function" ? ce.ignoreTransaction(t) : t).timeout(e || 6e4);
2847
2861
  return P.trans ? P.trans.waitFor(n) : n;
2848
2862
  }, Promise: S, debug: { get: () => G, set: (t) => {
2849
- Kn(t, t === "dexie" ? () => !0 : zn);
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) {
2863
+ Rn(t, t === "dexie" ? () => !0 : zn);
2864
+ } }, derive: ke, extend: U, props: Ce, override: Pn, Events: je, on: le, liveQuery: Jr, extendObservabilitySet: tr, getByKeyPath: te, setByKeyPath: H, delByKeyPath: function(t, e) {
2851
2865
  typeof e == "string" ? H(t, e, void 0) : "length" in e && [].map.call(e, function(n) {
2852
2866
  H(t, n, void 0);
2853
2867
  });
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) => {
2868
+ }, shallowClone: An, deepClone: We, getObjectDiff: cn, cmp: L, asap: En, minKey: qt, addons: [], connections: Ke, errnames: nn, dependencies: Jt, 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" && (le(Le, (t) => {
2855
2869
  if (!Z) {
2856
2870
  let e;
2857
2871
  gt ? (e = document.createEvent("CustomEvent"), e.initCustomEvent(ie, !0, !0, t)) : e = new CustomEvent(ie, { detail: t }), Z = !0, dispatchEvent(e), Z = !1;
@@ -2862,13 +2876,13 @@ Ce(ce, { ...tt, delete: (t) => new ce(t, { addons: [] }).delete(), exists: (t) =
2862
2876
  let Z = !1;
2863
2877
  if (typeof BroadcastChannel < "u") {
2864
2878
  const t = new BroadcastChannel(ie);
2865
- typeof t.unref == "function" && t.unref(), ue(Le, (e) => {
2879
+ typeof t.unref == "function" && t.unref(), le(Le, (e) => {
2866
2880
  Z || t.postMessage(e);
2867
2881
  }), t.onmessage = (e) => {
2868
2882
  e.data && at(e.data);
2869
2883
  };
2870
2884
  } else if (typeof self < "u" && typeof navigator < "u") {
2871
- ue(Le, (e) => {
2885
+ le(Le, (e) => {
2872
2886
  try {
2873
2887
  Z || (typeof localStorage < "u" && localStorage.setItem(ie, JSON.stringify({ trig: Math.random(), changedParts: e })), typeof self.clients == "object" && [...self.clients.matchAll({ includeUncontrolled: !0 })].forEach((n) => n.postMessage({ type: ie, changedParts: e })));
2874
2888
  } catch {
@@ -2891,10 +2905,10 @@ S.rejectionMapper = function(t, e) {
2891
2905
  return "stack" in t && ee(n, "stack", { get: function() {
2892
2906
  return this.inner.stack;
2893
2907
  } }), n;
2894
- }, Kn(G, zn);
2908
+ }, Rn(G, zn);
2895
2909
  class Zr extends pe {
2896
2910
  constructor() {
2897
- super("NylasAuthDatabase"), Pt(this, "grant"), Pt(this, "pkce"), this.version(1).stores({
2911
+ super("NylasAuthDatabase"), Et(this, "grant"), Et(this, "pkce"), this.version(1).stores({
2898
2912
  grant: "++id,token",
2899
2913
  pkce: "++id,codeVerifier"
2900
2914
  }), this.grant = this.table("grant"), this.pkce = this.table("pkce");
@@ -2902,7 +2916,7 @@ class Zr extends pe {
2902
2916
  }
2903
2917
  class es {
2904
2918
  constructor() {
2905
- Pt(this, "theDB"), this.theDB = new Zr();
2919
+ Et(this, "theDB"), this.theDB = new Zr();
2906
2920
  }
2907
2921
  async setCodeVerifier(e) {
2908
2922
  await this.theDB.pkce.put({ id: 1, codeVerifier: e }, 1);
@@ -2980,18 +2994,18 @@ function ss(t) {
2980
2994
  value: "offline_access"
2981
2995
  }
2982
2996
  ];
2983
- async function i(o, u, a, c = !0, d, l) {
2984
- const h = await (n == null ? void 0 : n.getTokenInfo()), f = new URL(o, d ?? t.apiUri), m = new Headers();
2985
- m.append("Accept", "application/json"), m.append("Content-Type", "application/json"), m.append("User-Agent", e), h && m.append("Authorization", `Bearer ${h.access_token}`);
2986
- const p = await fetch(f.toString(), {
2987
- method: u || "GET",
2997
+ async function i(o, l, a, c = !0, h, u) {
2998
+ const d = await (n == null ? void 0 : n.getTokenInfo()), p = new URL(o, h ?? t.apiUri), m = new Headers();
2999
+ m.append("Accept", "application/json"), m.append("Content-Type", "application/json"), m.append("User-Agent", e), d && m.append("Authorization", `Bearer ${d.access_token}`);
3000
+ const f = await fetch(p.toString(), {
3001
+ method: l || "GET",
2988
3002
  headers: m,
2989
3003
  mode: "cors",
2990
3004
  referrer: location.origin,
2991
3005
  body: a ? JSON.stringify(a) : void 0,
2992
- ...l || {}
3006
+ ...u || {}
2993
3007
  });
2994
- return c ? await p.json() : p.body;
3008
+ return c ? await f.json() : f.body;
2995
3009
  }
2996
3010
  return {
2997
3011
  config: t,
@@ -3002,11 +3016,11 @@ function ss(t) {
3002
3016
  * @param provider The provider that was used to generate the authorization code
3003
3017
  * @returns A promise that resolves to a URL string that can be used to redirect the user to the Nylas API to complete the authorization flow
3004
3018
  */
3005
- async getHostedAuthRedirectURL(o = t.defaultScopes, u, a) {
3006
- const c = await dn(Math.random().toString()), d = await dn(c);
3019
+ async getHostedAuthRedirectURL(o = t.defaultScopes, l, a) {
3020
+ const c = await dn(Math.random().toString()), h = await dn(c);
3007
3021
  await (n == null ? void 0 : n.setCodeVerifier(c));
3008
- const l = new URL(`${t.apiUri}/v3/connect/auth`);
3009
- return l.searchParams.set("client_id", t.clientId), l.searchParams.set("response_type", "code"), l.searchParams.set("scope", o.join(" ")), l.searchParams.set("redirect_uri", t.redirectURI), l.searchParams.set("access_type", "offline"), l.searchParams.set("code_challenge", d), l.searchParams.set("code_challenge_method", "S256"), l.searchParams.set("options", "rotate_refresh_token"), a && l.searchParams.set("provider", a), u && l.searchParams.set("login_hint", u), l.toString();
3022
+ const u = new URL(`${t.apiUri}/v3/connect/auth`);
3023
+ return u.searchParams.set("client_id", t.clientId), u.searchParams.set("response_type", "code"), u.searchParams.set("scope", o.join(" ")), u.searchParams.set("redirect_uri", t.redirectURI), u.searchParams.set("access_type", "offline"), u.searchParams.set("code_challenge", h), u.searchParams.set("code_challenge_method", "S256"), u.searchParams.set("options", "rotate_refresh_token"), a && u.searchParams.set("provider", a), l && u.searchParams.set("login_hint", l), u.toString();
3010
3024
  },
3011
3025
  /**
3012
3026
  * This method will make a request to the Nylas API to exchange an authorization code for an access token.
@@ -3026,23 +3040,23 @@ function ss(t) {
3026
3040
  async exchangeAuthCodeForTokenInfo(o) {
3027
3041
  if (!o)
3028
3042
  return null;
3029
- const u = await (n == null ? void 0 : n.getCodeVerifier()), a = await this.nylasAPIRequest("/v3/connect/token", "POST", {
3043
+ const l = await (n == null ? void 0 : n.getCodeVerifier()), a = await this.nylasAPIRequest("/v3/connect/token", "POST", {
3030
3044
  code: o,
3031
3045
  client_id: t.clientId,
3032
3046
  grant_type: "authorization_code",
3033
3047
  redirect_uri: t.redirectURI,
3034
- code_verifier: u
3048
+ code_verifier: l
3035
3049
  });
3036
3050
  return "error" in a || await (n == null ? void 0 : n.setTokenInfo(a)), a;
3037
3051
  },
3038
3052
  /**
3039
3053
  * This method will make a `application/octet-stream` request to the Nylas API to download a file.
3040
3054
  */
3041
- async nylasDownloadFileRequest(o, u = "GET", a) {
3042
- const c = await (n == null ? void 0 : n.getTokenInfo()), d = new URL(o, t.apiUri), l = new Headers();
3043
- return l.append("Accept", "application/json"), l.append("Content-Type", "application/octet-stream"), l.append("User-Agent", e), c && l.append("Authorization", `Bearer ${c.access_token}`), (await fetch(d.toString(), {
3044
- method: u,
3045
- headers: l,
3055
+ async nylasDownloadFileRequest(o, l = "GET", a) {
3056
+ const c = await (n == null ? void 0 : n.getTokenInfo()), h = new URL(o, t.apiUri), u = new Headers();
3057
+ return u.append("Accept", "application/json"), u.append("Content-Type", "application/octet-stream"), u.append("User-Agent", e), c && u.append("Authorization", `Bearer ${c.access_token}`), (await fetch(h.toString(), {
3058
+ method: l,
3059
+ headers: u,
3046
3060
  mode: "cors",
3047
3061
  referrer: location.origin,
3048
3062
  body: a ? JSON.stringify(a) : void 0
@@ -3070,7 +3084,7 @@ function ss(t) {
3070
3084
  const o = await (n == null ? void 0 : n.getTokenInfo());
3071
3085
  if (!o)
3072
3086
  return null;
3073
- const { access_token: u, ...a } = o;
3087
+ const { access_token: l, ...a } = o;
3074
3088
  return a;
3075
3089
  },
3076
3090
  /**
@@ -3089,26 +3103,26 @@ function ss(t) {
3089
3103
  const o = await (n == null ? void 0 : n.getTokenInfo());
3090
3104
  if (!o)
3091
3105
  return null;
3092
- const u = await this.nylasAPIRequest("/v3/connect/token", "POST", {
3106
+ const l = await this.nylasAPIRequest("/v3/connect/token", "POST", {
3093
3107
  client_id: t.clientId,
3094
3108
  grant_type: "refresh_token",
3095
3109
  refresh_token: o.refresh_token
3096
3110
  });
3097
- return "error" in u || await (n == null ? void 0 : n.setTokenInfo(u)), u;
3111
+ return "error" in l || await (n == null ? void 0 : n.setTokenInfo(l)), l;
3098
3112
  },
3099
3113
  /**
3100
3114
  * This method will return true if the current access token has the given scope
3101
3115
  * based on the type of scope (e.g. 'read-only', 'modify', 'compose', 'insert', 'labels', 'metadata', 'settings.basic', or 'settings.sharing')
3102
3116
  * @param type Either 'read-only', 'modify', 'compose', 'insert', 'labels', 'metadata', 'settings.basic', or 'settings.sharing'
3103
3117
  */
3104
- async hasScopeByType(o = "email", u) {
3118
+ async hasScopeByType(o = "email", l) {
3105
3119
  const a = await (n == null ? void 0 : n.getTokenInfo());
3106
3120
  if (!a)
3107
3121
  return !1;
3108
3122
  const c = a.scope.toLowerCase().split(" ");
3109
- let d = [];
3110
- const l = Array.isArray(u) ? u : [u];
3111
- return o === "email" && (d = [...s, ...r].filter((h) => l.includes(h.type))), d.every((h) => c.includes(h.value));
3123
+ let h = [];
3124
+ const u = Array.isArray(l) ? l : [l];
3125
+ return o === "email" && (h = [...s, ...r].filter((d) => u.includes(d.type))), h.every((d) => c.includes(d.value));
3112
3126
  },
3113
3127
  /**
3114
3128
  * A helper method to check if the current access token has a given scope.
@@ -3116,10 +3130,10 @@ function ss(t) {
3116
3130
  * @returns boolean indicating whether the current access token has the given scope
3117
3131
  */
3118
3132
  async hasScope(o) {
3119
- const u = await (n == null ? void 0 : n.getTokenInfo());
3120
- if (!u)
3133
+ const l = await (n == null ? void 0 : n.getTokenInfo());
3134
+ if (!l)
3121
3135
  return !1;
3122
- const a = u.scope.toLowerCase().split(" ");
3136
+ const a = l.scope.toLowerCase().split(" ");
3123
3137
  return (Array.isArray(o) ? o : [o]).some((c) => a.includes(c.toLowerCase()));
3124
3138
  }
3125
3139
  };