@graffiti-garden/wrapper-vue 0.7.1 → 1.0.3

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 (70) hide show
  1. package/README.md +2 -3
  2. package/dist/browser/ajv-D_HICdxS.mjs +4447 -0
  3. package/dist/browser/ajv-D_HICdxS.mjs.map +1 -0
  4. package/dist/browser/plugin.mjs +999 -941
  5. package/dist/browser/plugin.mjs.map +1 -1
  6. package/dist/node/components/ActorToHandle.vue.d.ts +23 -0
  7. package/dist/node/components/ActorToHandle.vue.d.ts.map +1 -0
  8. package/dist/node/{Discover.vue.d.ts → components/Discover.vue.d.ts} +4 -4
  9. package/dist/node/components/Discover.vue.d.ts.map +1 -0
  10. package/dist/node/{Get.vue.d.ts → components/Get.vue.d.ts} +2 -5
  11. package/dist/node/components/Get.vue.d.ts.map +1 -0
  12. package/dist/node/components/GetMedia.vue.d.ts +36 -0
  13. package/dist/node/components/GetMedia.vue.d.ts.map +1 -0
  14. package/dist/node/components/HandleToActor.vue.d.ts +23 -0
  15. package/dist/node/components/HandleToActor.vue.d.ts.map +1 -0
  16. package/dist/node/components/ObjectInfo.vue.d.ts +7 -0
  17. package/dist/node/components/ObjectInfo.vue.d.ts.map +1 -0
  18. package/dist/node/composables/actor-to-handle.d.ts +25 -0
  19. package/dist/node/composables/actor-to-handle.d.ts.map +1 -0
  20. package/dist/node/composables/discover.d.ts +38 -0
  21. package/dist/node/composables/discover.d.ts.map +1 -0
  22. package/dist/node/composables/get-media.d.ts +31 -0
  23. package/dist/node/composables/get-media.d.ts.map +1 -0
  24. package/dist/node/composables/get.d.ts +28 -0
  25. package/dist/node/composables/get.d.ts.map +1 -0
  26. package/dist/node/composables/handle-to-actor.d.ts +25 -0
  27. package/dist/node/composables/handle-to-actor.d.ts.map +1 -0
  28. package/dist/node/composables/resolve-string.d.ts +6 -0
  29. package/dist/node/composables/resolve-string.d.ts.map +1 -0
  30. package/dist/node/globals.d.ts +3 -5
  31. package/dist/node/globals.d.ts.map +1 -1
  32. package/dist/node/plugin.d.ts +174 -75
  33. package/dist/node/plugin.d.ts.map +1 -1
  34. package/dist/node/plugin.js +1 -1
  35. package/dist/node/plugin.js.map +1 -1
  36. package/dist/node/plugin.mjs +468 -331
  37. package/dist/node/plugin.mjs.map +1 -1
  38. package/package.json +15 -14
  39. package/src/components/ActorToHandle.vue +16 -0
  40. package/src/{Discover.vue → components/Discover.vue} +15 -9
  41. package/src/{Get.vue → components/Get.vue} +7 -11
  42. package/src/components/GetMedia.vue +75 -0
  43. package/src/components/HandleToActor.vue +16 -0
  44. package/src/components/ObjectInfo.vue +127 -0
  45. package/src/composables/actor-to-handle.ts +32 -0
  46. package/src/composables/discover.ts +202 -0
  47. package/src/composables/get-media.ts +116 -0
  48. package/src/composables/get.ts +109 -0
  49. package/src/composables/handle-to-actor.ts +32 -0
  50. package/src/composables/resolve-string.ts +46 -0
  51. package/src/globals.ts +24 -2
  52. package/src/plugin.ts +84 -29
  53. package/dist/browser/ajv-C30pimY5.mjs +0 -4400
  54. package/dist/browser/ajv-C30pimY5.mjs.map +0 -1
  55. package/dist/browser/index-CWfNKdDL.mjs +0 -424
  56. package/dist/browser/index-CWfNKdDL.mjs.map +0 -1
  57. package/dist/node/Discover.vue.d.ts.map +0 -1
  58. package/dist/node/Get.vue.d.ts.map +0 -1
  59. package/dist/node/RecoverOrphans.vue.d.ts +0 -31
  60. package/dist/node/RecoverOrphans.vue.d.ts.map +0 -1
  61. package/dist/node/composables.d.ts +0 -75
  62. package/dist/node/composables.d.ts.map +0 -1
  63. package/dist/node/pollers.d.ts +0 -28
  64. package/dist/node/pollers.d.ts.map +0 -1
  65. package/dist/node/reducers.d.ts +0 -37
  66. package/dist/node/reducers.d.ts.map +0 -1
  67. package/src/RecoverOrphans.vue +0 -37
  68. package/src/composables.ts +0 -343
  69. package/src/pollers.ts +0 -119
  70. package/src/reducers.ts +0 -124
@@ -1,308 +1,291 @@
1
- var fe = Object.defineProperty;
2
- var he = (t, n, e) => n in t ? fe(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var v = (t, n, e) => he(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { ref as B, computed as pe, watch as de, onScopeDispose as ye, toValue as P, defineComponent as W, toRef as b, renderSlot as J, unref as g } from "vue";
5
- const q = {};
6
- function M() {
7
- const t = q.graffitiSynchronize;
8
- if (!t)
1
+ import { ref as k, onScopeDispose as le, watch as H, toValue as P, defineComponent as _, toRef as S, renderSlot as N, unref as v, createElementVNode as p, toDisplayString as O, createElementBlock as b, openBlock as w, createVNode as V, createCommentVNode as de, Fragment as re, renderList as oe } from "vue";
2
+ var D = class pe extends Error {
3
+ constructor(n) {
4
+ super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, pe.prototype);
5
+ }
6
+ }, Se = class ve extends Error {
7
+ constructor(n) {
8
+ super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ve.prototype);
9
+ }
10
+ };
11
+ function te(e) {
12
+ return typeof e == "string" ? e : e.url;
13
+ }
14
+ function Ge(e, n) {
15
+ try {
16
+ return e.compile(n);
17
+ } catch (t) {
18
+ throw new Se(t instanceof Error ? t.message : void 0);
19
+ }
20
+ }
21
+ function ke(e, n) {
22
+ return !Array.isArray(e.allowed) || typeof n?.actor == "string" && (e.actor === n.actor || e.allowed.includes(n.actor));
23
+ }
24
+ function Ee(e, n, t) {
25
+ e.actor !== t?.actor && (e.allowed = e.allowed && t ? [t.actor] : void 0, e.channels = e.channels.filter((o) => n.includes(o)));
26
+ }
27
+ const I = {};
28
+ function Oe(e) {
29
+ if (!I.graffitiSession)
30
+ I.graffitiSession = e;
31
+ else
32
+ throw new Error(
33
+ "Graffiti session already set - plugin installed multiple times?"
34
+ );
35
+ }
36
+ function Ae(e) {
37
+ if (!I.graffitiSynchronize)
38
+ I.graffitiSynchronize = e;
39
+ else
40
+ throw new Error(
41
+ "Graffiti synchronize already set - plugin installed multiple times?"
42
+ );
43
+ }
44
+ function X() {
45
+ const e = I.graffitiSynchronize;
46
+ if (!e)
9
47
  throw new Error(
10
48
  "No Graffiti instance provided, did you forget to install the plugin?"
11
49
  );
12
- return t;
50
+ return e;
13
51
  }
14
- function $e() {
15
- return M();
52
+ function ae() {
53
+ return X();
16
54
  }
17
- function Y() {
18
- const t = q.graffitiSession;
19
- if (!t)
55
+ function ct() {
56
+ const e = I.graffitiSession;
57
+ if (!e)
20
58
  throw new Error(
21
59
  "No Graffiti session provided, did you forget to install the plugin?"
22
60
  );
23
- return t;
61
+ return e;
24
62
  }
25
- var ve = class {
26
- }, me = class Z extends Error {
27
- constructor(n) {
28
- super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, Z.prototype);
29
- }
30
- }, be = class ee extends Error {
31
- constructor(n) {
32
- super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ee.prototype);
33
- }
34
- }, we = class te extends Error {
35
- constructor(n) {
36
- super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, te.prototype);
37
- }
38
- }, ge = class ne extends Error {
39
- constructor(n) {
40
- super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ne.prototype);
41
- }
42
- };
43
- class Pe {
44
- constructor(n) {
45
- v(this, "poll", async (n) => {
46
- let e;
47
- const r = this.getter;
48
- try {
49
- e = await r();
50
- } catch {
51
- this.getter === r && n(null);
52
- return;
53
- }
54
- this.getter === r && n({ object: e });
63
+ function Te(e, n, t, o = !1) {
64
+ const i = X(), r = /* @__PURE__ */ new Map(), s = k([]);
65
+ let a = async () => {
66
+ };
67
+ const c = async () => a(), u = k(!0);
68
+ let f, h;
69
+ le(() => {
70
+ f?.return(null), h?.return({
71
+ continue: () => h,
72
+ cursor: ""
55
73
  });
56
- this.getter = n;
57
- }
58
- clear() {
74
+ });
75
+ const l = k(0);
76
+ function y(d = 0) {
77
+ setTimeout(() => {
78
+ l.value++;
79
+ }, d);
59
80
  }
60
- }
61
- class re {
62
- constructor(n) {
63
- v(this, "iterator");
64
- v(this, "continue");
65
- v(this, "poll", async (n) => {
66
- if (!this.iterator)
67
- if (this.continue)
81
+ return H(
82
+ () => ({
83
+ args: [P(e), P(n), P(t)],
84
+ refresh: l.value
85
+ }),
86
+ ({ args: d }, m, j) => {
87
+ r.clear(), s.value = [], u.value = !0;
88
+ const E = i.synchronizeDiscover(...d);
89
+ f = E;
90
+ let G, g = !0;
91
+ j(() => {
92
+ g = !1, E.return(null), G?.return({
93
+ continue: () => h,
94
+ cursor: ""
95
+ });
96
+ });
97
+ let q;
98
+ (async () => {
99
+ for await (const x of E) {
100
+ if (!g) break;
101
+ x.tombstone ? r.delete(x.object.url) : r.set(x.object.url, x.object), q || (q = new Promise((ee) => {
102
+ setTimeout(() => {
103
+ g && (s.value = Array.from(r.values())), q = void 0, ee();
104
+ }, 50);
105
+ }));
106
+ }
107
+ })();
108
+ let Z = !1, fe = () => i.discover(...d);
109
+ a = async () => {
110
+ if (!(Z || !g)) {
111
+ Z = !0;
68
112
  try {
69
- this.iterator = this.continue();
70
- } catch (e) {
71
- if (e instanceof me)
72
- n("clear"), this.iterator = this.streamFactory();
73
- else
74
- throw e;
75
- }
76
- else
77
- this.iterator = this.streamFactory();
78
- for (; this.iterator; ) {
79
- const e = this.iterator, r = await e.next();
80
- if (e === this.iterator) {
81
- if (r.done) {
82
- r.value && (this.iterator = void 0, this.continue = r.value.continue);
83
- break;
113
+ G = fe(d[2]);
114
+ } catch {
115
+ return y(5e3);
84
116
  }
85
- if (r.value.error) {
86
- console.error(r.value.error);
87
- continue;
117
+ if (g) {
118
+ for (h = G; ; ) {
119
+ let x;
120
+ try {
121
+ x = await G.next();
122
+ } catch (ee) {
123
+ return ee instanceof D ? y() : y(5e3);
124
+ }
125
+ if (!g) return;
126
+ if (x.done) {
127
+ fe = x.value.continue;
128
+ break;
129
+ } else x.value.error && console.error(x.value.error);
130
+ }
131
+ await new Promise((x) => setTimeout(x, 0)), q && await q, g && (Z = !1, u.value = !1, P(o) && c());
88
132
  }
89
- n(r.value);
90
133
  }
91
- }
92
- });
93
- this.streamFactory = n;
94
- }
95
- clear() {
96
- if (this.iterator) {
97
- const n = this.iterator;
98
- this.iterator.return({
99
- continue: () => n,
100
- cursor: ""
101
- });
102
- }
103
- this.iterator = void 0, this.continue = void 0;
104
- }
105
- }
106
- function ie(t, n) {
107
- return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
108
- }
109
- class je {
110
- constructor() {
111
- v(this, "entry", B());
112
- }
113
- get result() {
114
- return pe(() => {
115
- const n = this.entry.value;
116
- return n && (n.tombstone ? null : n.object);
117
- });
118
- }
119
- clear() {
120
- this.entry.value = void 0;
121
- }
122
- onEntry(n) {
123
- if (n === "clear") {
124
- this.clear();
125
- return;
126
- }
127
- (!n || ie(n, this.entry.value)) && (this.entry.value = n);
128
- }
129
- }
130
- class oe {
131
- constructor(n) {
132
- v(this, "results", B([]));
133
- v(this, "resultsRaw", /* @__PURE__ */ new Map());
134
- v(this, "batchFlattenTimer");
135
- this.graffiti = n;
136
- }
137
- clear() {
138
- this.resultsRaw.clear(), this.results.value = [], clearTimeout(this.batchFlattenTimer), this.batchFlattenTimer = void 0;
139
- }
140
- flattenResults() {
141
- this.results.value = Array.from(this.resultsRaw.values()).reduce((n, e) => (e.tombstone || n.push(e.object), n), []);
142
- }
143
- onEntry(n) {
144
- if (!n) return;
145
- if (n === "clear") {
146
- this.clear();
147
- return;
148
- }
149
- const e = this.resultsRaw.get(n.object.url);
150
- ie(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
151
- this.flattenResults(), this.batchFlattenTimer = void 0;
152
- }, 0)));
153
- }
134
+ }, c();
135
+ },
136
+ { immediate: !0 }
137
+ ), H(
138
+ () => P(o),
139
+ (d) => d && c()
140
+ ), {
141
+ objects: s,
142
+ poll: c,
143
+ isFirstPoll: u
144
+ };
154
145
  }
155
- function H(t, n, e, r, o) {
156
- let i;
157
- async function a() {
158
- i = e();
159
- for await (const h of i) {
160
- if (h.error) {
161
- console.error(h.error);
162
- continue;
163
- }
164
- t.onEntry(h);
165
- }
166
- }
167
- let l = !1, c;
168
- const s = async () => {
169
- if (l || !c) return;
170
- const h = c;
171
- l = !0;
172
- try {
173
- await h();
174
- } finally {
175
- if (h !== c) return;
176
- l = !1, P(o) && s();
177
- }
178
- }, f = B(!1);
179
- return de(
180
- r,
181
- async (h, u) => {
182
- if (JSON.stringify(h) === JSON.stringify(u))
183
- return;
184
- i == null || i.return(null), t.clear(), n.clear(), a(), c = () => n.poll(t.onEntry.bind(t));
185
- const d = c;
186
- l = !1, f.value = !0;
146
+ function me(e, n) {
147
+ const t = k(void 0);
148
+ return H(
149
+ () => P(e),
150
+ async (o, i, r) => {
151
+ let s = !0;
152
+ r(() => {
153
+ s = !1;
154
+ }), t.value = void 0;
187
155
  try {
188
- await s();
189
- } finally {
190
- if (d !== c) return;
191
- f.value = !1;
156
+ const a = await n(o);
157
+ s && (t.value = a);
158
+ } catch (a) {
159
+ if (!s) return;
160
+ a instanceof D ? t.value = null : console.error(a);
192
161
  }
193
162
  },
194
- {
195
- immediate: !0
196
- }
197
- ), ye(() => {
198
- i == null || i.return(null), t.clear(), n.clear(), c = void 0;
199
- }), { poll: s, isInitialPolling: f };
200
- }
201
- function se(t, n) {
202
- return () => {
203
- const e = P(n);
204
- return e === void 0 ? t == null ? void 0 : t.value : e;
163
+ { immediate: !0 }
164
+ ), {
165
+ output: t
205
166
  };
206
167
  }
207
- function E(t) {
208
- return t.map((n) => n());
168
+ function be(e) {
169
+ return e === void 0 ? "Loading..." : e === null ? "Not found" : e;
209
170
  }
210
- function xe(t, n, e, r = !1) {
211
- const o = M(), i = Y(), a = () => P(t), l = () => P(n), c = se(i, e), s = [a, l, c], f = () => o.synchronizeDiscover(...E(s)), h = () => o.discover(...E(s)), u = new oe(o), d = new re(h), { poll: p, isInitialPolling: y } = H(
212
- u,
213
- d,
214
- f,
215
- s,
216
- r
171
+ function $e(e) {
172
+ const n = ae(), { output: t } = me(
173
+ e,
174
+ n.actorToHandle.bind(n)
217
175
  );
218
- return {
219
- /**
220
- * A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
221
- * an array of Graffiti objects.
222
- */
223
- objects: u.results,
224
- /**
225
- * A method to poll for new results.
226
- */
227
- poll: p,
228
- /**
229
- * A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
230
- * that indicates if the *first* poll is currently running.
231
- * Useful to show a loading spinner or disable a button.
232
- *
233
- * This also tracks new polls when the arguments have changed,
234
- * but it does not track ongoing polls from either calling
235
- * {@link poll} or using the `autopoll` argument.
236
- */
237
- isInitialPolling: y
238
- };
239
- }
240
- function Oe(t, n, e, r = !1) {
241
- const o = M(), i = Y(), a = () => P(t), l = () => P(n), c = se(i, e), s = [
242
- a,
243
- l,
244
- c
245
- ], f = () => o.synchronizeGet(...E(s)), h = new je(), u = () => o.get(...E(s)), d = new Pe(u), { poll: p, isInitialPolling: y } = H(
246
- h,
247
- d,
248
- f,
249
- s,
250
- r
251
- );
252
- return {
253
- /**
254
- * A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
255
- * the retrieved Graffiti object, if it exists. If the object has been deleted,
256
- * the result is `null`. If the object is still being fetched, the result is `undefined`.
257
- */
258
- object: h.result,
259
- /**
260
- * A method to poll for new results.
261
- */
262
- poll: p,
263
- /**
264
- * A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
265
- * that indicates if the *first* poll is currently running.
266
- * Useful to show a loading spinner or disable a button.
267
- *
268
- * This also tracks new polls when the arguments have changed,
269
- * but it does not track ongoing polls from either calling
270
- * {@link poll} or using the `autopoll` argument.
271
- */
272
- isInitialPolling: y
273
- };
176
+ return { handle: t };
274
177
  }
275
- function Se(t, n, e = !1) {
276
- const r = M(), a = [() => P(t), () => P(n)], l = () => r.synchronizeRecoverOrphans(...E(a)), c = new oe(r), s = () => r.recoverOrphans(...E(a)), f = new re(s), { poll: h, isInitialPolling: u } = H(
277
- c,
278
- f,
279
- l,
280
- a,
281
- e
282
- );
283
- return {
284
- /**
285
- * A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
286
- * an array of Graffiti objects.
287
- */
288
- objects: c.results,
289
- /**
290
- * A method to poll for new results.
291
- */
292
- poll: h,
293
- /**
294
- * A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
295
- * that indicates if the *first* poll is currently running.
296
- * Useful to show a loading spinner or disable a button.
297
- *
298
- * This also tracks new polls when the arguments have changed,
299
- * but it does not track ongoing polls from either calling
300
- * {@link poll} or using the `autopoll` argument.
301
- */
302
- isInitialPolling: u
303
- };
304
- }
305
- const ae = /* @__PURE__ */ W({
178
+ const W = /* @__PURE__ */ _({
179
+ __name: "ActorToHandle",
180
+ props: {
181
+ actor: {}
182
+ },
183
+ setup(e) {
184
+ const t = S(e, "actor"), { handle: o } = $e(t);
185
+ return (i, r) => N(i.$slots, "default", { handle: v(o) }, () => [
186
+ p("span", null, O(v(be)(v(o))), 1)
187
+ ]);
188
+ }
189
+ }), ze = ["data-url"], De = { key: 0 }, Ie = { key: 1 }, Me = { key: 0 }, _e = { key: 1 }, Re = { key: 0 }, qe = ["disabled"], Le = { key: 1 }, He = { key: 2 }, K = /* @__PURE__ */ _({
190
+ __name: "ObjectInfo",
191
+ props: {
192
+ object: {}
193
+ },
194
+ setup(e) {
195
+ const n = ae(), t = k(!1);
196
+ async function o(i, r) {
197
+ t.value = !0, await new Promise((s) => setTimeout(s, 0)), confirm(
198
+ "Are you sure you want to delete this object? It cannot be undone."
199
+ ) && await n.delete(i, r), t.value = !1;
200
+ }
201
+ return (i, r) => e.object ? (w(), b("article", {
202
+ key: 0,
203
+ "data-url": e.object.url
204
+ }, [
205
+ p("header", null, [
206
+ r[4] || (r[4] = p("h2", null, "Graffiti Object", -1)),
207
+ p("dl", null, [
208
+ r[1] || (r[1] = p("dt", null, "Object URL", -1)),
209
+ p("dd", null, [
210
+ p("code", null, O(e.object.url), 1)
211
+ ]),
212
+ r[2] || (r[2] = p("dt", null, "Actor", -1)),
213
+ p("dd", null, [
214
+ p("code", null, O(e.object.actor), 1)
215
+ ]),
216
+ r[3] || (r[3] = p("dt", null, "Handle", -1)),
217
+ p("dd", null, [
218
+ V(W, {
219
+ actor: e.object.actor
220
+ }, null, 8, ["actor"])
221
+ ])
222
+ ])
223
+ ]),
224
+ p("section", null, [
225
+ r[5] || (r[5] = p("h3", null, "Content", -1)),
226
+ p("pre", null, O(e.object.value), 1)
227
+ ]),
228
+ p("section", null, [
229
+ r[10] || (r[10] = p("h3", null, "Allowed Actors", -1)),
230
+ Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (w(), b("p", Ie, [...r[7] || (r[7] = [
231
+ p("em", null, "Noone", -1)
232
+ ])])) : de("", !0) : (w(), b("p", De, [...r[6] || (r[6] = [
233
+ p("em", null, "Public", -1)
234
+ ])])),
235
+ p("ul", null, [
236
+ (w(!0), b(re, null, oe(e.object.allowed, (s) => (w(), b("li", { key: s }, [
237
+ p("dl", null, [
238
+ r[8] || (r[8] = p("dt", null, "Actor", -1)),
239
+ p("dd", null, [
240
+ p("code", null, O(s), 1)
241
+ ]),
242
+ r[9] || (r[9] = p("dt", null, "Handle", -1)),
243
+ p("dd", null, [
244
+ V(W, { actor: s }, null, 8, ["actor"])
245
+ ])
246
+ ])
247
+ ]))), 128))
248
+ ])
249
+ ]),
250
+ p("section", null, [
251
+ r[12] || (r[12] = p("h3", null, "Channels", -1)),
252
+ e.object.channels?.length ? (w(), b("ul", Me, [
253
+ (w(!0), b(re, null, oe(e.object.channels, (s) => (w(), b("li", { key: s }, [
254
+ p("code", null, O(s), 1)
255
+ ]))), 128))
256
+ ])) : (w(), b("p", _e, [...r[11] || (r[11] = [
257
+ p("em", null, "No channels", -1)
258
+ ])]))
259
+ ]),
260
+ p("footer", null, [
261
+ p("nav", null, [
262
+ p("ul", null, [
263
+ i.$graffitiSession.value?.actor === e.object.actor ? (w(), b("li", Re, [
264
+ p("button", {
265
+ disabled: t.value,
266
+ onClick: r[0] || (r[0] = (s) => o(e.object, i.$graffitiSession.value))
267
+ }, O(t.value ? "Deleting..." : "Delete"), 9, qe)
268
+ ])) : de("", !0)
269
+ ])
270
+ ])
271
+ ])
272
+ ], 8, ze)) : e.object === null ? (w(), b("article", Le, [...r[13] || (r[13] = [
273
+ p("header", null, [
274
+ p("h2", null, "Graffiti Object")
275
+ ], -1),
276
+ p("p", null, [
277
+ p("em", null, "Object not found")
278
+ ], -1)
279
+ ])])) : (w(), b("article", He, [...r[14] || (r[14] = [
280
+ p("header", null, [
281
+ p("h2", null, "Graffiti Object")
282
+ ], -1),
283
+ p("p", null, [
284
+ p("em", null, "Loading...")
285
+ ], -1)
286
+ ])]));
287
+ }
288
+ }), Ce = { key: 0 }, Ne = { key: 1 }, we = /* @__PURE__ */ _({
306
289
  __name: "Discover",
307
290
  props: {
308
291
  channels: {},
@@ -310,516 +293,658 @@ const ae = /* @__PURE__ */ W({
310
293
  session: {},
311
294
  autopoll: { type: Boolean }
312
295
  },
313
- setup(t) {
314
- const n = t, { objects: e, poll: r, isInitialPolling: o } = xe(
315
- b(n, "channels"),
316
- b(n, "schema"),
317
- b(n, "session"),
318
- b(n, "autopoll")
296
+ setup(e) {
297
+ const n = e, { objects: t, poll: o, isFirstPoll: i } = Te(
298
+ S(n, "channels"),
299
+ S(n, "schema"),
300
+ S(n, "session"),
301
+ S(n, "autopoll")
319
302
  );
320
- return (i, a) => J(i.$slots, "default", {
321
- objects: g(e),
322
- poll: g(r),
323
- isInitialPolling: g(o)
324
- });
303
+ return (r, s) => N(r.$slots, "default", {
304
+ objects: v(t),
305
+ poll: v(o),
306
+ isFirstPoll: v(i)
307
+ }, () => [
308
+ v(i) ? (w(), b("p", Ne, [...s[0] || (s[0] = [
309
+ p("em", null, " Loading... ", -1)
310
+ ])])) : (w(), b("ul", Ce, [
311
+ (w(!0), b(re, null, oe(v(t), (a) => (w(), b("li", {
312
+ key: a.url
313
+ }, [
314
+ V(K, { object: a }, null, 8, ["object"])
315
+ ]))), 128))
316
+ ]))
317
+ ]);
325
318
  }
326
- }), ue = /* @__PURE__ */ W({
319
+ });
320
+ function Ue(e, n, t) {
321
+ const o = X(), i = k(void 0);
322
+ let r = async () => {
323
+ };
324
+ const s = async () => r();
325
+ let a;
326
+ return le(() => {
327
+ a?.return(null);
328
+ }), H(
329
+ () => [P(e), P(n), P(t)],
330
+ (c, u, f) => {
331
+ i.value = void 0;
332
+ const h = o.synchronizeGet(...c);
333
+ a = h;
334
+ let l = !0;
335
+ f(() => {
336
+ l = !1, h.return(null);
337
+ }), (async () => {
338
+ for await (const d of h) {
339
+ if (!l) return;
340
+ d.tombstone ? i.value = null : i.value = d.object;
341
+ }
342
+ })();
343
+ let y = !1;
344
+ r = async () => {
345
+ if (!(y || !l)) {
346
+ y = !0;
347
+ try {
348
+ await o.get(...c);
349
+ } catch (d) {
350
+ d instanceof D || console.error(d);
351
+ }
352
+ await new Promise((d) => setTimeout(d, 0)), y = !1;
353
+ }
354
+ }, s();
355
+ },
356
+ { immediate: !0 }
357
+ ), {
358
+ object: i,
359
+ poll: s
360
+ };
361
+ }
362
+ const ge = /* @__PURE__ */ _({
327
363
  __name: "Get",
328
364
  props: {
329
365
  url: {},
330
366
  schema: {},
331
- session: {},
332
- autopoll: { type: Boolean }
367
+ session: {}
333
368
  },
334
- setup(t) {
335
- const n = t, { object: e, poll: r, isInitialPolling: o } = Oe(
336
- b(n, "url"),
337
- b(n, "schema"),
338
- b(n, "session"),
339
- b(n, "autopoll")
369
+ setup(e) {
370
+ const n = e, { object: t, poll: o } = Ue(
371
+ S(n, "url"),
372
+ S(n, "schema"),
373
+ S(n, "session")
340
374
  );
341
- return (i, a) => J(i.$slots, "default", {
342
- object: g(e),
343
- poll: g(r),
344
- isInitialPolling: g(o)
345
- });
375
+ return (i, r) => N(i.$slots, "default", {
376
+ object: v(t),
377
+ poll: v(o)
378
+ }, () => [
379
+ V(K, { object: v(t) }, null, 8, ["object"])
380
+ ]);
381
+ }
382
+ });
383
+ function Be(e, n, t) {
384
+ const o = X(), i = k(
385
+ void 0
386
+ ), r = k(0);
387
+ let s = null, a = () => {
388
+ };
389
+ function c() {
390
+ return s || (r.value++, s = new Promise((u) => {
391
+ a = () => {
392
+ s = null, u();
393
+ };
394
+ }), s);
346
395
  }
347
- }), ce = /* @__PURE__ */ W({
348
- __name: "RecoverOrphans",
396
+ return H(
397
+ () => ({
398
+ args: [P(e), P(n), P(t)],
399
+ pollCounter: r.value
400
+ }),
401
+ async ({ args: u }, f, h) => {
402
+ i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl), i.value = void 0;
403
+ let l = !0;
404
+ h(() => {
405
+ l = !1;
406
+ });
407
+ try {
408
+ const { data: y, actor: d, allowed: m } = await o.getMedia(...u);
409
+ if (!l) return;
410
+ const j = URL.createObjectURL(y);
411
+ i.value = {
412
+ data: y,
413
+ dataUrl: j,
414
+ actor: d,
415
+ allowed: m
416
+ };
417
+ } catch (y) {
418
+ if (!l) return;
419
+ y instanceof D ? i.value = null : console.error(y);
420
+ } finally {
421
+ a();
422
+ }
423
+ },
424
+ { immediate: !0 }
425
+ ), le(() => {
426
+ a(), i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl);
427
+ }), {
428
+ media: i,
429
+ poll: c
430
+ };
431
+ }
432
+ const Ve = ["src", "alt"], We = ["src", "alt"], Fe = ["src", "alt"], Je = ["src", "alt"], Qe = ["data", "alt"], Xe = { key: 6 }, Ke = { key: 7 }, je = /* @__PURE__ */ _({
433
+ __name: "GetMedia",
349
434
  props: {
350
- schema: {},
351
- session: {},
352
- autopoll: { type: Boolean }
435
+ url: {},
436
+ requirements: {},
437
+ session: {}
353
438
  },
354
- setup(t) {
355
- const n = t, { objects: e, poll: r, isInitialPolling: o } = Se(
356
- b(n, "schema"),
357
- b(n, "session"),
358
- b(n, "autopoll")
439
+ setup(e) {
440
+ const n = e, { media: t, poll: o } = Be(
441
+ S(n, "url"),
442
+ S(n, "requirements"),
443
+ S(n, "session")
359
444
  );
360
- return (i, a) => J(i.$slots, "default", {
361
- objects: g(e),
362
- poll: g(r),
363
- isInitialPolling: g(o)
364
- });
445
+ function i() {
446
+ t.value && (window.location.href = t.value.dataUrl);
447
+ }
448
+ return (r, s) => N(r.$slots, "default", {
449
+ media: v(t),
450
+ poll: v(o)
451
+ }, () => [
452
+ v(t)?.data.type.startsWith("image/") ? (w(), b("img", {
453
+ key: 0,
454
+ src: v(t).dataUrl,
455
+ alt: `An image by ${v(t).actor}`
456
+ }, null, 8, Ve)) : v(t)?.data.type.startsWith("video/") ? (w(), b("video", {
457
+ key: 1,
458
+ controls: "",
459
+ src: v(t).dataUrl,
460
+ alt: `A video by ${v(t).actor}`
461
+ }, null, 8, We)) : v(t)?.data.type.startsWith("audio/") ? (w(), b("audio", {
462
+ key: 2,
463
+ controls: "",
464
+ src: v(t).dataUrl,
465
+ alt: `Audio by ${v(t).actor}`
466
+ }, null, 8, Fe)) : v(t)?.data.type === "text/html" ? (w(), b("iframe", {
467
+ key: 3,
468
+ src: v(t).dataUrl,
469
+ alt: `HTML by ${v(t).actor}`,
470
+ sandbox: ""
471
+ }, null, 8, Je)) : v(t)?.data.type.startsWith("application/pdf") ? (w(), b("object", {
472
+ key: 4,
473
+ data: v(t).dataUrl,
474
+ type: "application/pdf",
475
+ alt: `PDF by ${v(t).actor}`
476
+ }, null, 8, Qe)) : v(t) ? (w(), b("button", {
477
+ key: 5,
478
+ onClick: i
479
+ }, "Download")) : v(t) === null ? (w(), b("p", Xe, [...s[0] || (s[0] = [
480
+ p("em", null, "Media not found", -1)
481
+ ])])) : (w(), b("p", Ke, [...s[1] || (s[1] = [
482
+ p("em", null, " Loading... ", -1)
483
+ ])]))
484
+ ]);
485
+ }
486
+ });
487
+ function Ye(e) {
488
+ const n = ae(), { output: t } = me(
489
+ e,
490
+ n.handleToActor.bind(n)
491
+ );
492
+ return { actor: t };
493
+ }
494
+ const xe = /* @__PURE__ */ _({
495
+ __name: "HandleToActor",
496
+ props: {
497
+ handle: {}
498
+ },
499
+ setup(e) {
500
+ const t = S(e, "handle"), { actor: o } = Ye(t);
501
+ return (i, r) => N(i.$slots, "default", { actor: v(o) }, () => [
502
+ p("span", null, O(v(be)(v(o))), 1)
503
+ ]);
365
504
  }
366
505
  });
367
- /*! *****************************************************************************
368
- Copyright (c) Microsoft Corporation.
369
-
370
- Permission to use, copy, modify, and/or distribute this software for any
371
- purpose with or without fee is hereby granted.
372
-
373
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
374
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
375
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
376
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
377
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
378
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
379
- PERFORMANCE OF THIS SOFTWARE.
380
- ***************************************************************************** */
381
- var $ = function(t, n) {
382
- return $ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
383
- e.__proto__ = r;
384
- } || function(e, r) {
385
- for (var o in r) r.hasOwnProperty(o) && (e[o] = r[o]);
386
- }, $(t, n);
506
+ var ie = function(e, n) {
507
+ return ie = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, o) {
508
+ t.__proto__ = o;
509
+ } || function(t, o) {
510
+ for (var i in o) o.hasOwnProperty(i) && (t[i] = o[i]);
511
+ }, ie(e, n);
387
512
  };
388
- function Ee(t, n) {
389
- $(t, n);
390
- function e() {
391
- this.constructor = t;
513
+ function Ze(e, n) {
514
+ ie(e, n);
515
+ function t() {
516
+ this.constructor = e;
392
517
  }
393
- t.prototype = n === null ? Object.create(n) : (e.prototype = n.prototype, new e());
518
+ e.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
394
519
  }
395
- function G(t, n, e, r) {
396
- function o(i) {
397
- return i instanceof e ? i : new e(function(a) {
398
- a(i);
520
+ function M(e, n, t, o) {
521
+ function i(r) {
522
+ return r instanceof t ? r : new t(function(s) {
523
+ s(r);
399
524
  });
400
525
  }
401
- return new (e || (e = Promise))(function(i, a) {
402
- function l(f) {
526
+ return new (t || (t = Promise))(function(r, s) {
527
+ function a(f) {
403
528
  try {
404
- s(r.next(f));
529
+ u(o.next(f));
405
530
  } catch (h) {
406
- a(h);
531
+ s(h);
407
532
  }
408
533
  }
409
534
  function c(f) {
410
535
  try {
411
- s(r.throw(f));
536
+ u(o.throw(f));
412
537
  } catch (h) {
413
- a(h);
538
+ s(h);
414
539
  }
415
540
  }
416
- function s(f) {
417
- f.done ? i(f.value) : o(f.value).then(l, c);
541
+ function u(f) {
542
+ f.done ? r(f.value) : i(f.value).then(a, c);
418
543
  }
419
- s((r = r.apply(t, [])).next());
544
+ u((o = o.apply(e, [])).next());
420
545
  });
421
546
  }
422
- function j(t, n) {
423
- var e = { label: 0, sent: function() {
424
- if (i[0] & 1) throw i[1];
425
- return i[1];
426
- }, trys: [], ops: [] }, r, o, i, a;
427
- return a = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
547
+ function A(e, n) {
548
+ var t = { label: 0, sent: function() {
549
+ if (r[0] & 1) throw r[1];
550
+ return r[1];
551
+ }, trys: [], ops: [] }, o, i, r, s;
552
+ return s = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
428
553
  return this;
429
- }), a;
430
- function l(s) {
554
+ }), s;
555
+ function a(u) {
431
556
  return function(f) {
432
- return c([s, f]);
557
+ return c([u, f]);
433
558
  };
434
559
  }
435
- function c(s) {
436
- if (r) throw new TypeError("Generator is already executing.");
437
- for (; e; ) try {
438
- if (r = 1, o && (i = s[0] & 2 ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
439
- switch (o = 0, i && (s = [s[0] & 2, i.value]), s[0]) {
560
+ function c(u) {
561
+ if (o) throw new TypeError("Generator is already executing.");
562
+ for (; t; ) try {
563
+ if (o = 1, i && (r = u[0] & 2 ? i.return : u[0] ? i.throw || ((r = i.return) && r.call(i), 0) : i.next) && !(r = r.call(i, u[1])).done) return r;
564
+ switch (i = 0, r && (u = [u[0] & 2, r.value]), u[0]) {
440
565
  case 0:
441
566
  case 1:
442
- i = s;
567
+ r = u;
443
568
  break;
444
569
  case 4:
445
- return e.label++, { value: s[1], done: !1 };
570
+ return t.label++, { value: u[1], done: !1 };
446
571
  case 5:
447
- e.label++, o = s[1], s = [0];
572
+ t.label++, i = u[1], u = [0];
448
573
  continue;
449
574
  case 7:
450
- s = e.ops.pop(), e.trys.pop();
575
+ u = t.ops.pop(), t.trys.pop();
451
576
  continue;
452
577
  default:
453
- if (i = e.trys, !(i = i.length > 0 && i[i.length - 1]) && (s[0] === 6 || s[0] === 2)) {
454
- e = 0;
578
+ if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (u[0] === 6 || u[0] === 2)) {
579
+ t = 0;
455
580
  continue;
456
581
  }
457
- if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
458
- e.label = s[1];
582
+ if (u[0] === 3 && (!r || u[1] > r[0] && u[1] < r[3])) {
583
+ t.label = u[1];
459
584
  break;
460
585
  }
461
- if (s[0] === 6 && e.label < i[1]) {
462
- e.label = i[1], i = s;
586
+ if (u[0] === 6 && t.label < r[1]) {
587
+ t.label = r[1], r = u;
463
588
  break;
464
589
  }
465
- if (i && e.label < i[2]) {
466
- e.label = i[2], e.ops.push(s);
590
+ if (r && t.label < r[2]) {
591
+ t.label = r[2], t.ops.push(u);
467
592
  break;
468
593
  }
469
- i[2] && e.ops.pop(), e.trys.pop();
594
+ r[2] && t.ops.pop(), t.trys.pop();
470
595
  continue;
471
596
  }
472
- s = n.call(t, e);
597
+ u = n.call(e, t);
473
598
  } catch (f) {
474
- s = [6, f], o = 0;
599
+ u = [6, f], i = 0;
475
600
  } finally {
476
- r = i = 0;
601
+ o = r = 0;
477
602
  }
478
- if (s[0] & 5) throw s[1];
479
- return { value: s[0] ? s[1] : void 0, done: !0 };
603
+ if (u[0] & 5) throw u[1];
604
+ return { value: u[0] ? u[1] : void 0, done: !0 };
480
605
  }
481
606
  }
482
- function _(t) {
483
- var n = typeof Symbol == "function" && Symbol.iterator, e = n && t[n], r = 0;
484
- if (e) return e.call(t);
485
- if (t && typeof t.length == "number") return {
607
+ function R(e) {
608
+ var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n], o = 0;
609
+ if (t) return t.call(e);
610
+ if (e && typeof e.length == "number") return {
486
611
  next: function() {
487
- return t && r >= t.length && (t = void 0), { value: t && t[r++], done: !t };
612
+ return e && o >= e.length && (e = void 0), { value: e && e[o++], done: !e };
488
613
  }
489
614
  };
490
615
  throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
491
616
  }
492
- function R(t) {
493
- return this instanceof R ? (this.v = t, this) : new R(t);
617
+ function C(e) {
618
+ return this instanceof C ? (this.v = e, this) : new C(e);
494
619
  }
495
- function Ge(t, n, e) {
620
+ function et(e, n, t) {
496
621
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
497
- var r = e.apply(t, n || []), o, i = [];
498
- return o = {}, a("next"), a("throw"), a("return"), o[Symbol.asyncIterator] = function() {
622
+ var o = t.apply(e, n || []), i, r = [];
623
+ return i = {}, s("next"), s("throw"), s("return"), i[Symbol.asyncIterator] = function() {
499
624
  return this;
500
- }, o;
501
- function a(u) {
502
- r[u] && (o[u] = function(d) {
503
- return new Promise(function(p, y) {
504
- i.push([u, d, p, y]) > 1 || l(u, d);
625
+ }, i;
626
+ function s(l) {
627
+ o[l] && (i[l] = function(y) {
628
+ return new Promise(function(d, m) {
629
+ r.push([l, y, d, m]) > 1 || a(l, y);
505
630
  });
506
631
  });
507
632
  }
508
- function l(u, d) {
633
+ function a(l, y) {
509
634
  try {
510
- c(r[u](d));
511
- } catch (p) {
512
- h(i[0][3], p);
635
+ c(o[l](y));
636
+ } catch (d) {
637
+ h(r[0][3], d);
513
638
  }
514
639
  }
515
- function c(u) {
516
- u.value instanceof R ? Promise.resolve(u.value.v).then(s, f) : h(i[0][2], u);
640
+ function c(l) {
641
+ l.value instanceof C ? Promise.resolve(l.value.v).then(u, f) : h(r[0][2], l);
517
642
  }
518
- function s(u) {
519
- l("next", u);
643
+ function u(l) {
644
+ a("next", l);
520
645
  }
521
- function f(u) {
522
- l("throw", u);
646
+ function f(l) {
647
+ a("throw", l);
523
648
  }
524
- function h(u, d) {
525
- u(d), i.shift(), i.length && l(i[0][0], i[0][1]);
649
+ function h(l, y) {
650
+ l(y), r.shift(), r.length && a(r[0][0], r[0][1]);
526
651
  }
527
652
  }
528
- var le = (
653
+ var Pe = (
529
654
  /** @class */
530
- function(t) {
531
- Ee(n, t);
532
- function n(e) {
533
- var r = t.call(this, e) || this;
534
- return Object.defineProperty(r, "name", {
655
+ (function(e) {
656
+ Ze(n, e);
657
+ function n(t) {
658
+ var o = e.call(this, t) || this;
659
+ return Object.defineProperty(o, "name", {
535
660
  value: "RepeaterOverflowError",
536
661
  enumerable: !1
537
- }), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(r, r.constructor.prototype) : r.__proto__ = r.constructor.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(r, r.constructor), r;
662
+ }), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(o, o.constructor.prototype) : o.__proto__ = o.constructor.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(o, o.constructor), o;
538
663
  }
539
664
  return n;
540
- }(Error)
665
+ })(Error)
541
666
  );
542
667
  (function() {
543
- function t(n) {
668
+ function e(n) {
544
669
  if (n < 0)
545
670
  throw new RangeError("Capacity may not be less than 0");
546
671
  this._c = n, this._q = [];
547
672
  }
548
- return Object.defineProperty(t.prototype, "empty", {
673
+ return Object.defineProperty(e.prototype, "empty", {
549
674
  get: function() {
550
675
  return this._q.length === 0;
551
676
  },
552
677
  enumerable: !1,
553
678
  configurable: !0
554
- }), Object.defineProperty(t.prototype, "full", {
679
+ }), Object.defineProperty(e.prototype, "full", {
555
680
  get: function() {
556
681
  return this._q.length >= this._c;
557
682
  },
558
683
  enumerable: !1,
559
684
  configurable: !0
560
- }), t.prototype.add = function(n) {
685
+ }), e.prototype.add = function(n) {
561
686
  if (this.full)
562
687
  throw new Error("Buffer full");
563
688
  this._q.push(n);
564
- }, t.prototype.remove = function() {
689
+ }, e.prototype.remove = function() {
565
690
  if (this.empty)
566
691
  throw new Error("Buffer empty");
567
692
  return this._q.shift();
568
- }, t;
693
+ }, e;
569
694
  })();
570
695
  (function() {
571
- function t(n) {
696
+ function e(n) {
572
697
  if (n < 1)
573
698
  throw new RangeError("Capacity may not be less than 1");
574
699
  this._c = n, this._q = [];
575
700
  }
576
- return Object.defineProperty(t.prototype, "empty", {
701
+ return Object.defineProperty(e.prototype, "empty", {
577
702
  get: function() {
578
703
  return this._q.length === 0;
579
704
  },
580
705
  enumerable: !1,
581
706
  configurable: !0
582
- }), Object.defineProperty(t.prototype, "full", {
707
+ }), Object.defineProperty(e.prototype, "full", {
583
708
  get: function() {
584
709
  return !1;
585
710
  },
586
711
  enumerable: !1,
587
712
  configurable: !0
588
- }), t.prototype.add = function(n) {
713
+ }), e.prototype.add = function(n) {
589
714
  for (; this._q.length >= this._c; )
590
715
  this._q.shift();
591
716
  this._q.push(n);
592
- }, t.prototype.remove = function() {
717
+ }, e.prototype.remove = function() {
593
718
  if (this.empty)
594
719
  throw new Error("Buffer empty");
595
720
  return this._q.shift();
596
- }, t;
721
+ }, e;
597
722
  })();
598
723
  (function() {
599
- function t(n) {
724
+ function e(n) {
600
725
  if (n < 1)
601
726
  throw new RangeError("Capacity may not be less than 1");
602
727
  this._c = n, this._q = [];
603
728
  }
604
- return Object.defineProperty(t.prototype, "empty", {
729
+ return Object.defineProperty(e.prototype, "empty", {
605
730
  get: function() {
606
731
  return this._q.length === 0;
607
732
  },
608
733
  enumerable: !1,
609
734
  configurable: !0
610
- }), Object.defineProperty(t.prototype, "full", {
735
+ }), Object.defineProperty(e.prototype, "full", {
611
736
  get: function() {
612
737
  return !1;
613
738
  },
614
739
  enumerable: !1,
615
740
  configurable: !0
616
- }), t.prototype.add = function(n) {
741
+ }), e.prototype.add = function(n) {
617
742
  this._q.length < this._c && this._q.push(n);
618
- }, t.prototype.remove = function() {
743
+ }, e.prototype.remove = function() {
619
744
  if (this.empty)
620
745
  throw new Error("Buffer empty");
621
746
  return this._q.shift();
622
- }, t;
747
+ }, e;
623
748
  })();
624
- function U(t) {
625
- t != null && typeof t.then == "function" && t.then(N, N);
749
+ function se(e) {
750
+ e != null && typeof e.then == "function" && e.then(Q, Q);
626
751
  }
627
- var C = 0, X = 1, O = 2, D = 3, L = 4, A = 1024, N = function() {
752
+ var ne = 0, he = 1, $ = 2, F = 3, ue = 4, J = 1024, Q = function() {
628
753
  };
629
- function S(t) {
630
- var n = t.err, e = Promise.resolve(t.execution).then(function(r) {
754
+ function z(e) {
755
+ var n = e.err, t = Promise.resolve(e.execution).then(function(o) {
631
756
  if (n != null)
632
757
  throw n;
633
- return r;
758
+ return o;
634
759
  });
635
- return t.err = void 0, t.execution = e.then(function() {
760
+ return e.err = void 0, e.execution = t.then(function() {
636
761
  }, function() {
637
- }), t.pending === void 0 ? e : t.pending.then(function() {
638
- return e;
762
+ }), e.pending === void 0 ? t : e.pending.then(function() {
763
+ return t;
639
764
  });
640
765
  }
641
- function x(t, n) {
642
- var e = t.state >= D;
643
- return Promise.resolve(n).then(function(r) {
644
- return !e && t.state >= L ? S(t).then(function(o) {
766
+ function T(e, n) {
767
+ var t = e.state >= F;
768
+ return Promise.resolve(n).then(function(o) {
769
+ return !t && e.state >= ue ? z(e).then(function(i) {
645
770
  return {
646
- value: o,
771
+ value: i,
647
772
  done: !0
648
773
  };
649
- }) : { value: r, done: e };
774
+ }) : { value: o, done: t };
650
775
  });
651
776
  }
652
- function Q(t, n) {
653
- var e, r;
654
- if (!(t.state >= O))
655
- if (t.state = O, t.onnext(), t.onstop(), t.err == null && (t.err = n), t.pushes.length === 0 && (typeof t.buffer > "u" || t.buffer.empty))
656
- z(t);
777
+ function ce(e, n) {
778
+ var t, o;
779
+ if (!(e.state >= $))
780
+ if (e.state = $, e.onnext(), e.onstop(), e.err == null && (e.err = n), e.pushes.length === 0 && (typeof e.buffer > "u" || e.buffer.empty))
781
+ L(e);
657
782
  else
658
783
  try {
659
- for (var o = _(t.pushes), i = o.next(); !i.done; i = o.next()) {
660
- var a = i.value;
661
- a.resolve();
784
+ for (var i = R(e.pushes), r = i.next(); !r.done; r = i.next()) {
785
+ var s = r.value;
786
+ s.resolve();
662
787
  }
663
- } catch (l) {
664
- e = { error: l };
788
+ } catch (a) {
789
+ t = { error: a };
665
790
  } finally {
666
791
  try {
667
- i && !i.done && (r = o.return) && r.call(o);
792
+ r && !r.done && (o = i.return) && o.call(i);
668
793
  } finally {
669
- if (e) throw e.error;
794
+ if (t) throw t.error;
670
795
  }
671
796
  }
672
797
  }
673
- function z(t) {
674
- var n, e;
675
- if (!(t.state >= D)) {
676
- t.state < O && Q(t), t.state = D, t.buffer = void 0;
798
+ function L(e) {
799
+ var n, t;
800
+ if (!(e.state >= F)) {
801
+ e.state < $ && ce(e), e.state = F, e.buffer = void 0;
677
802
  try {
678
- for (var r = _(t.nexts), o = r.next(); !o.done; o = r.next()) {
679
- var i = o.value, a = t.pending === void 0 ? S(t) : t.pending.then(function() {
680
- return S(t);
803
+ for (var o = R(e.nexts), i = o.next(); !i.done; i = o.next()) {
804
+ var r = i.value, s = e.pending === void 0 ? z(e) : e.pending.then(function() {
805
+ return z(e);
681
806
  });
682
- i.resolve(x(t, a));
807
+ r.resolve(T(e, s));
683
808
  }
684
- } catch (l) {
685
- n = { error: l };
809
+ } catch (a) {
810
+ n = { error: a };
686
811
  } finally {
687
812
  try {
688
- o && !o.done && (e = r.return) && e.call(r);
813
+ i && !i.done && (t = o.return) && t.call(o);
689
814
  } finally {
690
815
  if (n) throw n.error;
691
816
  }
692
817
  }
693
- t.pushes = [], t.nexts = [];
818
+ e.pushes = [], e.nexts = [];
694
819
  }
695
820
  }
696
- function K(t) {
697
- t.state >= L || (t.state < D && z(t), t.state = L);
821
+ function ye(e) {
822
+ e.state >= ue || (e.state < F && L(e), e.state = ue);
698
823
  }
699
- function _e(t, n) {
700
- if (U(n), t.pushes.length >= A)
701
- throw new le("No more than " + A + " pending calls to push are allowed on a single repeater.");
702
- if (t.state >= O)
824
+ function tt(e, n) {
825
+ if (se(n), e.pushes.length >= J)
826
+ throw new Pe("No more than " + J + " pending calls to push are allowed on a single repeater.");
827
+ if (e.state >= $)
703
828
  return Promise.resolve(void 0);
704
- var e = t.pending === void 0 ? Promise.resolve(n) : t.pending.then(function() {
829
+ var t = e.pending === void 0 ? Promise.resolve(n) : e.pending.then(function() {
705
830
  return n;
706
831
  });
707
- e = e.catch(function(c) {
708
- t.state < O && (t.err = c), K(t);
832
+ t = t.catch(function(c) {
833
+ e.state < $ && (e.err = c), ye(e);
709
834
  });
710
- var r;
711
- if (t.nexts.length) {
712
- var o = t.nexts.shift();
713
- o.resolve(x(t, e)), t.nexts.length ? r = Promise.resolve(t.nexts[0].value) : typeof t.buffer < "u" && !t.buffer.full ? r = Promise.resolve(void 0) : r = new Promise(function(c) {
714
- return t.onnext = c;
835
+ var o;
836
+ if (e.nexts.length) {
837
+ var i = e.nexts.shift();
838
+ i.resolve(T(e, t)), e.nexts.length ? o = Promise.resolve(e.nexts[0].value) : typeof e.buffer < "u" && !e.buffer.full ? o = Promise.resolve(void 0) : o = new Promise(function(c) {
839
+ return e.onnext = c;
715
840
  });
716
- } else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(c) {
717
- return t.pushes.push({ resolve: c, value: e });
841
+ } else typeof e.buffer < "u" && !e.buffer.full ? (e.buffer.add(t), o = Promise.resolve(void 0)) : o = new Promise(function(c) {
842
+ return e.pushes.push({ resolve: c, value: t });
718
843
  });
719
- var i = !0, a = {}, l = r.catch(function(c) {
720
- if (i)
844
+ var r = !0, s = {}, a = o.catch(function(c) {
845
+ if (r)
721
846
  throw c;
722
847
  });
723
- return a.then = function(c, s) {
724
- return i = !1, Promise.prototype.then.call(r, c, s);
725
- }, a.catch = function(c) {
726
- return i = !1, Promise.prototype.catch.call(r, c);
727
- }, a.finally = r.finally.bind(r), t.pending = e.then(function() {
728
- return l;
848
+ return s.then = function(c, u) {
849
+ return r = !1, Promise.prototype.then.call(o, c, u);
850
+ }, s.catch = function(c) {
851
+ return r = !1, Promise.prototype.catch.call(o, c);
852
+ }, s.finally = o.finally.bind(o), e.pending = t.then(function() {
853
+ return a;
729
854
  }).catch(function(c) {
730
- t.err = c, K(t);
731
- }), a;
855
+ e.err = c, ye(e);
856
+ }), s;
732
857
  }
733
- function ze(t) {
734
- var n = Q.bind(null, t), e = new Promise(function(r) {
735
- return t.onstop = r;
858
+ function nt(e) {
859
+ var n = ce.bind(null, e), t = new Promise(function(o) {
860
+ return e.onstop = o;
736
861
  });
737
- return n.then = e.then.bind(e), n.catch = e.catch.bind(e), n.finally = e.finally.bind(e), n;
862
+ return n.then = t.then.bind(t), n.catch = t.catch.bind(t), n.finally = t.finally.bind(t), n;
738
863
  }
739
- function Re(t) {
740
- if (!(t.state >= X)) {
741
- t.state = X;
742
- var n = _e.bind(null, t), e = ze(t);
743
- t.execution = new Promise(function(r) {
744
- return r(t.executor(n, e));
745
- }), t.execution.catch(function() {
746
- return Q(t);
864
+ function rt(e) {
865
+ if (!(e.state >= he)) {
866
+ e.state = he;
867
+ var n = tt.bind(null, e), t = nt(e);
868
+ e.execution = new Promise(function(o) {
869
+ return o(e.executor(n, t));
870
+ }), e.execution.catch(function() {
871
+ return ce(e);
747
872
  });
748
873
  }
749
874
  }
750
- var F = /* @__PURE__ */ new WeakMap(), k = (
875
+ var B = /* @__PURE__ */ new WeakMap(), U = (
751
876
  /** @class */
752
- function() {
753
- function t(n, e) {
754
- F.set(this, {
877
+ (function() {
878
+ function e(n, t) {
879
+ B.set(this, {
755
880
  executor: n,
756
- buffer: e,
881
+ buffer: t,
757
882
  err: void 0,
758
- state: C,
883
+ state: ne,
759
884
  pushes: [],
760
885
  nexts: [],
761
886
  pending: void 0,
762
887
  execution: void 0,
763
- onnext: N,
764
- onstop: N
888
+ onnext: Q,
889
+ onstop: Q
765
890
  });
766
891
  }
767
- return t.prototype.next = function(n) {
768
- U(n);
769
- var e = F.get(this);
770
- if (e === void 0)
892
+ return e.prototype.next = function(n) {
893
+ se(n);
894
+ var t = B.get(this);
895
+ if (t === void 0)
771
896
  throw new Error("WeakMap error");
772
- if (e.nexts.length >= A)
773
- throw new le("No more than " + A + " pending calls to next are allowed on a single repeater.");
774
- if (e.state <= C && Re(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
775
- var r = x(e, e.buffer.remove());
776
- if (e.pushes.length) {
777
- var o = e.pushes.shift();
778
- e.buffer.add(o.value), e.onnext = o.resolve;
897
+ if (t.nexts.length >= J)
898
+ throw new Pe("No more than " + J + " pending calls to next are allowed on a single repeater.");
899
+ if (t.state <= ne && rt(t), t.onnext(n), typeof t.buffer < "u" && !t.buffer.empty) {
900
+ var o = T(t, t.buffer.remove());
901
+ if (t.pushes.length) {
902
+ var i = t.pushes.shift();
903
+ t.buffer.add(i.value), t.onnext = i.resolve;
779
904
  }
780
- return r;
781
- } else if (e.pushes.length) {
782
- var i = e.pushes.shift();
783
- return e.onnext = i.resolve, x(e, i.value);
784
- } else if (e.state >= O)
785
- return z(e), x(e, S(e));
786
- return new Promise(function(a) {
787
- return e.nexts.push({ resolve: a, value: n });
905
+ return o;
906
+ } else if (t.pushes.length) {
907
+ var r = t.pushes.shift();
908
+ return t.onnext = r.resolve, T(t, r.value);
909
+ } else if (t.state >= $)
910
+ return L(t), T(t, z(t));
911
+ return new Promise(function(s) {
912
+ return t.nexts.push({ resolve: s, value: n });
788
913
  });
789
- }, t.prototype.return = function(n) {
790
- U(n);
791
- var e = F.get(this);
792
- if (e === void 0)
914
+ }, e.prototype.return = function(n) {
915
+ se(n);
916
+ var t = B.get(this);
917
+ if (t === void 0)
793
918
  throw new Error("WeakMap error");
794
- return z(e), e.execution = Promise.resolve(e.execution).then(function() {
919
+ return L(t), t.execution = Promise.resolve(t.execution).then(function() {
795
920
  return n;
796
- }), x(e, S(e));
797
- }, t.prototype.throw = function(n) {
798
- var e = F.get(this);
799
- if (e === void 0)
921
+ }), T(t, z(t));
922
+ }, e.prototype.throw = function(n) {
923
+ var t = B.get(this);
924
+ if (t === void 0)
800
925
  throw new Error("WeakMap error");
801
- return e.state <= C || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (z(e), e.err == null && (e.err = n), x(e, S(e))) : this.next(Promise.reject(n));
802
- }, t.prototype[Symbol.asyncIterator] = function() {
926
+ return t.state <= ne || t.state >= $ || typeof t.buffer < "u" && !t.buffer.empty ? (L(t), t.err == null && (t.err = n), T(t, z(t))) : this.next(Promise.reject(n));
927
+ }, e.prototype[Symbol.asyncIterator] = function() {
803
928
  return this;
804
- }, t.race = ke, t.merge = Ie, t.zip = Te, t.latest = Fe, t;
805
- }()
929
+ }, e.race = ot, e.merge = it, e.zip = st, e.latest = ut, e;
930
+ })()
806
931
  );
807
- function V(t, n) {
808
- var e, r, o = [], i = function(s) {
809
- s != null && typeof s[Symbol.asyncIterator] == "function" ? o.push(s[Symbol.asyncIterator]()) : s != null && typeof s[Symbol.iterator] == "function" ? o.push(s[Symbol.iterator]()) : o.push(function() {
810
- return Ge(this, arguments, function() {
811
- return j(this, function(u) {
812
- switch (u.label) {
932
+ function Y(e, n) {
933
+ var t, o, i = [], r = function(u) {
934
+ u != null && typeof u[Symbol.asyncIterator] == "function" ? i.push(u[Symbol.asyncIterator]()) : u != null && typeof u[Symbol.iterator] == "function" ? i.push(u[Symbol.iterator]()) : i.push((function() {
935
+ return et(this, arguments, function() {
936
+ return A(this, function(l) {
937
+ switch (l.label) {
813
938
  case 0:
814
- return n.yieldValues ? [4, R(s)] : [3, 3];
939
+ return n.yieldValues ? [4, C(u)] : [3, 3];
815
940
  case 1:
816
- return [4, u.sent()];
941
+ return [4, l.sent()];
817
942
  case 2:
818
- u.sent(), u.label = 3;
943
+ l.sent(), l.label = 3;
819
944
  case 3:
820
- return n.returnValues ? [4, R(s)] : [3, 5];
945
+ return n.returnValues ? [4, C(u)] : [3, 5];
821
946
  case 4:
822
- return [2, u.sent()];
947
+ return [2, l.sent()];
823
948
  case 5:
824
949
  return [
825
950
  2
@@ -828,70 +953,70 @@ function V(t, n) {
828
953
  }
829
954
  });
830
955
  });
831
- }());
956
+ })());
832
957
  };
833
958
  try {
834
- for (var a = _(t), l = a.next(); !l.done; l = a.next()) {
835
- var c = l.value;
836
- i(c);
959
+ for (var s = R(e), a = s.next(); !a.done; a = s.next()) {
960
+ var c = a.value;
961
+ r(c);
837
962
  }
838
- } catch (s) {
839
- e = { error: s };
963
+ } catch (u) {
964
+ t = { error: u };
840
965
  } finally {
841
966
  try {
842
- l && !l.done && (r = a.return) && r.call(a);
967
+ a && !a.done && (o = s.return) && o.call(s);
843
968
  } finally {
844
- if (e) throw e.error;
969
+ if (t) throw t.error;
845
970
  }
846
971
  }
847
- return o;
972
+ return i;
848
973
  }
849
- function ke(t) {
850
- var n = this, e = V(t, { returnValues: !0 });
851
- return new k(function(r, o) {
852
- return G(n, void 0, void 0, function() {
853
- var i, a, l, c, s, f;
854
- return j(this, function(h) {
974
+ function ot(e) {
975
+ var n = this, t = Y(e, { returnValues: !0 });
976
+ return new U(function(o, i) {
977
+ return M(n, void 0, void 0, function() {
978
+ var r, s, a, c, u, f;
979
+ return A(this, function(h) {
855
980
  switch (h.label) {
856
981
  case 0:
857
- if (!e.length)
858
- return o(), [
982
+ if (!t.length)
983
+ return i(), [
859
984
  2
860
985
  /*return*/
861
986
  ];
862
- a = !1, o.then(function() {
863
- i(), a = !0;
987
+ s = !1, i.then(function() {
988
+ r(), s = !0;
864
989
  }), h.label = 1;
865
990
  case 1:
866
- h.trys.push([1, , 5, 7]), c = void 0, s = 0, f = function() {
867
- var u, d, p, y, m, I;
868
- return j(this, function(T) {
869
- switch (T.label) {
991
+ h.trys.push([1, , 5, 7]), c = void 0, u = 0, f = function() {
992
+ var l, y, d, m, j, E;
993
+ return A(this, function(G) {
994
+ switch (G.label) {
870
995
  case 0:
871
- u = s;
996
+ l = u;
872
997
  try {
873
- for (d = (m = void 0, _(e)), p = d.next(); !p.done; p = d.next())
874
- y = p.value, Promise.resolve(y.next()).then(function(w) {
875
- w.done ? (o(), l === void 0 && (l = w)) : s === u && (s++, i(w));
876
- }, function(w) {
877
- return o(w);
998
+ for (y = (j = void 0, R(t)), d = y.next(); !d.done; d = y.next())
999
+ m = d.value, Promise.resolve(m.next()).then(function(g) {
1000
+ g.done ? (i(), a === void 0 && (a = g)) : u === l && (u++, r(g));
1001
+ }, function(g) {
1002
+ return i(g);
878
1003
  });
879
- } catch (w) {
880
- m = { error: w };
1004
+ } catch (g) {
1005
+ j = { error: g };
881
1006
  } finally {
882
1007
  try {
883
- p && !p.done && (I = d.return) && I.call(d);
1008
+ d && !d.done && (E = y.return) && E.call(y);
884
1009
  } finally {
885
- if (m) throw m.error;
1010
+ if (j) throw j.error;
886
1011
  }
887
1012
  }
888
- return [4, new Promise(function(w) {
889
- return i = w;
1013
+ return [4, new Promise(function(g) {
1014
+ return r = g;
890
1015
  })];
891
1016
  case 1:
892
- return c = T.sent(), c === void 0 ? [3, 3] : [4, r(c.value)];
1017
+ return c = G.sent(), c === void 0 ? [3, 3] : [4, o(c.value)];
893
1018
  case 2:
894
- T.sent(), T.label = 3;
1019
+ G.sent(), G.label = 3;
895
1020
  case 3:
896
1021
  return [
897
1022
  2
@@ -901,14 +1026,14 @@ function ke(t) {
901
1026
  });
902
1027
  }, h.label = 2;
903
1028
  case 2:
904
- return a ? [3, 4] : [5, f()];
1029
+ return s ? [3, 4] : [5, f()];
905
1030
  case 3:
906
1031
  return h.sent(), [3, 2];
907
1032
  case 4:
908
- return [2, l && l.value];
1033
+ return [2, a && a.value];
909
1034
  case 5:
910
- return o(), [4, Promise.race(e.map(function(u) {
911
- return u.return && u.return();
1035
+ return i(), [4, Promise.race(t.map(function(l) {
1036
+ return l.return && l.return();
912
1037
  }))];
913
1038
  case 6:
914
1039
  return h.sent(), [
@@ -925,68 +1050,68 @@ function ke(t) {
925
1050
  });
926
1051
  });
927
1052
  }
928
- function Ie(t) {
929
- var n = this, e = V(t, { yieldValues: !0 });
930
- return new k(function(r, o) {
931
- return G(n, void 0, void 0, function() {
932
- var i, a, l, c = this;
933
- return j(this, function(s) {
934
- switch (s.label) {
1053
+ function it(e) {
1054
+ var n = this, t = Y(e, { yieldValues: !0 });
1055
+ return new U(function(o, i) {
1056
+ return M(n, void 0, void 0, function() {
1057
+ var r, s, a, c = this;
1058
+ return A(this, function(u) {
1059
+ switch (u.label) {
935
1060
  case 0:
936
- if (!e.length)
937
- return o(), [
1061
+ if (!t.length)
1062
+ return i(), [
938
1063
  2
939
1064
  /*return*/
940
1065
  ];
941
- i = [], a = !1, o.then(function() {
1066
+ r = [], s = !1, i.then(function() {
942
1067
  var f, h;
943
- a = !0;
1068
+ s = !0;
944
1069
  try {
945
- for (var u = _(i), d = u.next(); !d.done; d = u.next()) {
946
- var p = d.value;
947
- p();
1070
+ for (var l = R(r), y = l.next(); !y.done; y = l.next()) {
1071
+ var d = y.value;
1072
+ d();
948
1073
  }
949
- } catch (y) {
950
- f = { error: y };
1074
+ } catch (m) {
1075
+ f = { error: m };
951
1076
  } finally {
952
1077
  try {
953
- d && !d.done && (h = u.return) && h.call(u);
1078
+ y && !y.done && (h = l.return) && h.call(l);
954
1079
  } finally {
955
1080
  if (f) throw f.error;
956
1081
  }
957
1082
  }
958
- }), s.label = 1;
1083
+ }), u.label = 1;
959
1084
  case 1:
960
- return s.trys.push([1, , 3, 4]), [4, Promise.all(e.map(function(f, h) {
961
- return G(c, void 0, void 0, function() {
962
- var u, d;
963
- return j(this, function(p) {
964
- switch (p.label) {
1085
+ return u.trys.push([1, , 3, 4]), [4, Promise.all(t.map(function(f, h) {
1086
+ return M(c, void 0, void 0, function() {
1087
+ var l, y;
1088
+ return A(this, function(d) {
1089
+ switch (d.label) {
965
1090
  case 0:
966
- p.trys.push([0, , 6, 9]), p.label = 1;
1091
+ d.trys.push([0, , 6, 9]), d.label = 1;
967
1092
  case 1:
968
- return a ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
969
- return i[h](y);
970
- }, function(y) {
971
- return o(y);
972
- }), [4, new Promise(function(y) {
973
- i[h] = y;
1093
+ return s ? [3, 5] : (Promise.resolve(f.next()).then(function(m) {
1094
+ return r[h](m);
1095
+ }, function(m) {
1096
+ return i(m);
1097
+ }), [4, new Promise(function(m) {
1098
+ r[h] = m;
974
1099
  })]);
975
1100
  case 2:
976
- return u = p.sent(), u === void 0 ? [3, 4] : u.done ? (l = u, [
1101
+ return l = d.sent(), l === void 0 ? [3, 4] : l.done ? (a = l, [
977
1102
  2
978
1103
  /*return*/
979
- ]) : [4, r(u.value)];
1104
+ ]) : [4, o(l.value)];
980
1105
  case 3:
981
- p.sent(), p.label = 4;
1106
+ d.sent(), d.label = 4;
982
1107
  case 4:
983
1108
  return [3, 1];
984
1109
  case 5:
985
1110
  return [3, 9];
986
1111
  case 6:
987
- return d = f.return, d ? [4, f.return()] : [3, 8];
1112
+ return y = f.return, y ? [4, f.return()] : [3, 8];
988
1113
  case 7:
989
- d = p.sent(), p.label = 8;
1114
+ y = d.sent(), d.label = 8;
990
1115
  case 8:
991
1116
  return [
992
1117
  7
@@ -1002,9 +1127,9 @@ function Ie(t) {
1002
1127
  });
1003
1128
  }))];
1004
1129
  case 2:
1005
- return s.sent(), [2, l && l.value];
1130
+ return u.sent(), [2, a && a.value];
1006
1131
  case 3:
1007
- return o(), [
1132
+ return i(), [
1008
1133
  7
1009
1134
  /*endfinally*/
1010
1135
  ];
@@ -1018,50 +1143,50 @@ function Ie(t) {
1018
1143
  });
1019
1144
  });
1020
1145
  }
1021
- function Te(t) {
1022
- var n = this, e = V(t, { returnValues: !0 });
1023
- return new k(function(r, o) {
1024
- return G(n, void 0, void 0, function() {
1025
- var i, a, l, c;
1026
- return j(this, function(s) {
1027
- switch (s.label) {
1146
+ function st(e) {
1147
+ var n = this, t = Y(e, { returnValues: !0 });
1148
+ return new U(function(o, i) {
1149
+ return M(n, void 0, void 0, function() {
1150
+ var r, s, a, c;
1151
+ return A(this, function(u) {
1152
+ switch (u.label) {
1028
1153
  case 0:
1029
- if (!e.length)
1030
- return o(), [2, []];
1031
- a = !1, o.then(function() {
1032
- i(), a = !0;
1033
- }), s.label = 1;
1154
+ if (!t.length)
1155
+ return i(), [2, []];
1156
+ s = !1, i.then(function() {
1157
+ r(), s = !0;
1158
+ }), u.label = 1;
1034
1159
  case 1:
1035
- s.trys.push([1, , 6, 8]), s.label = 2;
1160
+ u.trys.push([1, , 6, 8]), u.label = 2;
1036
1161
  case 2:
1037
- return a ? [3, 5] : (Promise.all(e.map(function(f) {
1162
+ return s ? [3, 5] : (Promise.all(t.map(function(f) {
1038
1163
  return f.next();
1039
1164
  })).then(function(f) {
1040
- return i(f);
1165
+ return r(f);
1041
1166
  }, function(f) {
1042
- return o(f);
1167
+ return i(f);
1043
1168
  }), [4, new Promise(function(f) {
1044
- return i = f;
1169
+ return r = f;
1045
1170
  })]);
1046
1171
  case 3:
1047
- return l = s.sent(), l === void 0 ? [
1172
+ return a = u.sent(), a === void 0 ? [
1048
1173
  2
1049
1174
  /*return*/
1050
- ] : (c = l.map(function(f) {
1175
+ ] : (c = a.map(function(f) {
1051
1176
  return f.value;
1052
- }), l.some(function(f) {
1177
+ }), a.some(function(f) {
1053
1178
  return f.done;
1054
- }) ? [2, c] : [4, r(c)]);
1179
+ }) ? [2, c] : [4, o(c)]);
1055
1180
  case 4:
1056
- return s.sent(), [3, 2];
1181
+ return u.sent(), [3, 2];
1057
1182
  case 5:
1058
1183
  return [3, 8];
1059
1184
  case 6:
1060
- return o(), [4, Promise.all(e.map(function(f) {
1185
+ return i(), [4, Promise.all(t.map(function(f) {
1061
1186
  return f.return && f.return();
1062
1187
  }))];
1063
1188
  case 7:
1064
- return s.sent(), [
1189
+ return u.sent(), [
1065
1190
  7
1066
1191
  /*endfinally*/
1067
1192
  ];
@@ -1075,79 +1200,79 @@ function Te(t) {
1075
1200
  });
1076
1201
  });
1077
1202
  }
1078
- function Fe(t) {
1079
- var n = this, e = V(t, {
1203
+ function ut(e) {
1204
+ var n = this, t = Y(e, {
1080
1205
  yieldValues: !0,
1081
1206
  returnValues: !0
1082
1207
  });
1083
- return new k(function(r, o) {
1084
- return G(n, void 0, void 0, function() {
1085
- var i, a, l, c, s, f = this;
1086
- return j(this, function(h) {
1208
+ return new U(function(o, i) {
1209
+ return M(n, void 0, void 0, function() {
1210
+ var r, s, a, c, u, f = this;
1211
+ return A(this, function(h) {
1087
1212
  switch (h.label) {
1088
1213
  case 0:
1089
- if (!e.length)
1090
- return o(), [2, []];
1091
- a = [], l = !1, o.then(function() {
1092
- var u, d;
1093
- i();
1214
+ if (!t.length)
1215
+ return i(), [2, []];
1216
+ s = [], a = !1, i.then(function() {
1217
+ var l, y;
1218
+ r();
1094
1219
  try {
1095
- for (var p = _(a), y = p.next(); !y.done; y = p.next()) {
1096
- var m = y.value;
1097
- m();
1220
+ for (var d = R(s), m = d.next(); !m.done; m = d.next()) {
1221
+ var j = m.value;
1222
+ j();
1098
1223
  }
1099
- } catch (I) {
1100
- u = { error: I };
1224
+ } catch (E) {
1225
+ l = { error: E };
1101
1226
  } finally {
1102
1227
  try {
1103
- y && !y.done && (d = p.return) && d.call(p);
1228
+ m && !m.done && (y = d.return) && y.call(d);
1104
1229
  } finally {
1105
- if (u) throw u.error;
1230
+ if (l) throw l.error;
1106
1231
  }
1107
1232
  }
1108
- l = !0;
1233
+ a = !0;
1109
1234
  }), h.label = 1;
1110
1235
  case 1:
1111
- return h.trys.push([1, , 5, 7]), Promise.all(e.map(function(u) {
1112
- return u.next();
1113
- })).then(function(u) {
1114
- return i(u);
1115
- }, function(u) {
1116
- return o(u);
1117
- }), [4, new Promise(function(u) {
1118
- return i = u;
1236
+ return h.trys.push([1, , 5, 7]), Promise.all(t.map(function(l) {
1237
+ return l.next();
1238
+ })).then(function(l) {
1239
+ return r(l);
1240
+ }, function(l) {
1241
+ return i(l);
1242
+ }), [4, new Promise(function(l) {
1243
+ return r = l;
1119
1244
  })];
1120
1245
  case 2:
1121
1246
  return c = h.sent(), c === void 0 ? [
1122
1247
  2
1123
1248
  /*return*/
1124
- ] : (s = c.map(function(u) {
1125
- return u.value;
1126
- }), c.every(function(u) {
1127
- return u.done;
1128
- }) ? [2, s] : [4, r(s.slice())]);
1249
+ ] : (u = c.map(function(l) {
1250
+ return l.value;
1251
+ }), c.every(function(l) {
1252
+ return l.done;
1253
+ }) ? [2, u] : [4, o(u.slice())]);
1129
1254
  case 3:
1130
- return h.sent(), [4, Promise.all(e.map(function(u, d) {
1131
- return G(f, void 0, void 0, function() {
1132
- var p;
1133
- return j(this, function(y) {
1134
- switch (y.label) {
1255
+ return h.sent(), [4, Promise.all(t.map(function(l, y) {
1256
+ return M(f, void 0, void 0, function() {
1257
+ var d;
1258
+ return A(this, function(m) {
1259
+ switch (m.label) {
1135
1260
  case 0:
1136
- if (c[d].done)
1137
- return [2, c[d].value];
1138
- y.label = 1;
1261
+ if (c[y].done)
1262
+ return [2, c[y].value];
1263
+ m.label = 1;
1139
1264
  case 1:
1140
- return l ? [3, 4] : (Promise.resolve(u.next()).then(function(m) {
1141
- return a[d](m);
1142
- }, function(m) {
1143
- return o(m);
1144
- }), [4, new Promise(function(m) {
1145
- return a[d] = m;
1265
+ return a ? [3, 4] : (Promise.resolve(l.next()).then(function(j) {
1266
+ return s[y](j);
1267
+ }, function(j) {
1268
+ return i(j);
1269
+ }), [4, new Promise(function(j) {
1270
+ return s[y] = j;
1146
1271
  })]);
1147
1272
  case 2:
1148
- return p = y.sent(), p === void 0 ? [2, c[d].value] : p.done ? [2, p.value] : (s[d] = p.value, [4, r(s.slice())]);
1273
+ return d = m.sent(), d === void 0 ? [2, c[y].value] : d.done ? [2, d.value] : (u[y] = d.value, [4, o(u.slice())]);
1149
1274
  case 3:
1150
- return y.sent(), [3, 1];
1275
+ return m.sent(), [3, 1];
1151
1276
  case 4:
1152
1277
  return [
1153
1278
  2
@@ -1160,8 +1285,8 @@ function Fe(t) {
1160
1285
  case 4:
1161
1286
  return [2, h.sent()];
1162
1287
  case 5:
1163
- return o(), [4, Promise.all(e.map(function(u) {
1164
- return u.return && u.return();
1288
+ return i(), [4, Promise.all(t.map(function(l) {
1289
+ return l.return && l.return();
1165
1290
  }))];
1166
1291
  case 6:
1167
1292
  return h.sent(), [
@@ -1178,149 +1303,57 @@ function Fe(t) {
1178
1303
  });
1179
1304
  });
1180
1305
  }
1181
- function qe(t) {
1182
- return typeof t == "string" ? t : t.url;
1183
- }
1184
- function De(t, n, e, r) {
1185
- const o = e[n];
1186
- if (!(!o || !o.length))
1187
- try {
1188
- r[n] = t(r[n], o, !0, !1).newDocument;
1189
- } catch (i) {
1190
- throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new we(i.message) : new ge(i.name + ": " + i.message) : i;
1191
- }
1192
- }
1193
- function Ae(t, n) {
1194
- try {
1195
- return t.compile(n);
1196
- } catch (e) {
1197
- throw new be(
1198
- e instanceof Error ? e.message : void 0
1199
- );
1306
+ class lt {
1307
+ ajv_;
1308
+ graffiti;
1309
+ callbacks = /* @__PURE__ */ new Set();
1310
+ options;
1311
+ login;
1312
+ logout;
1313
+ sessionEvents;
1314
+ postMedia;
1315
+ getMedia;
1316
+ deleteMedia;
1317
+ actorToHandle;
1318
+ handleToActor;
1319
+ get ajv() {
1320
+ return this.ajv_ || (this.ajv_ = (async () => {
1321
+ const { default: n } = await import("./ajv-D_HICdxS.mjs").then((t) => t.a);
1322
+ return new n({ strict: !1 });
1323
+ })()), this.ajv_;
1200
1324
  }
1201
- }
1202
- function Ne(t, n, e) {
1203
- t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
1204
- (r) => n.includes(r)
1205
- ));
1206
- }
1207
- function Be(t, n) {
1208
- return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
1209
- }
1210
- class Me extends ve {
1211
1325
  /**
1212
1326
  * Wraps a Graffiti API instance to provide the synchronize methods.
1213
1327
  * The GraffitiSyncrhonize class rather than the Graffiti class
1214
1328
  * must be used for all functions for the synchronize methods to work.
1215
1329
  */
1216
- constructor(e, r) {
1217
- super();
1218
- v(this, "ajv_");
1219
- v(this, "applyPatch_");
1220
- v(this, "graffiti");
1221
- v(this, "callbacks", /* @__PURE__ */ new Set());
1222
- v(this, "options");
1223
- v(this, "channelStats");
1224
- v(this, "login");
1225
- v(this, "logout");
1226
- v(this, "sessionEvents");
1227
- v(this, "get", async (...e) => {
1228
- const r = await this.graffiti.get(...e);
1229
- return this.synchronizeDispatch({ object: r }), r;
1230
- });
1231
- v(this, "put", async (...e) => {
1232
- const r = await this.graffiti.put(...e), o = e[0], i = {
1233
- ...r,
1234
- value: o.value,
1235
- channels: o.channels,
1236
- allowed: o.allowed
1237
- };
1238
- return await this.synchronizeDispatch(
1239
- {
1240
- tombstone: !0,
1241
- object: r
1242
- },
1243
- {
1244
- object: i
1245
- },
1246
- !0
1247
- ), r;
1248
- });
1249
- v(this, "patch", async (...e) => {
1250
- const r = await this.graffiti.patch(...e), o = { ...r };
1251
- for (const i of ["value", "channels", "allowed"])
1252
- De(await this.applyPatch, i, e[0], o);
1253
- return await this.synchronizeDispatch(
1254
- {
1255
- tombstone: !0,
1256
- object: r
1257
- },
1258
- {
1259
- object: o
1260
- },
1261
- !0
1262
- ), r;
1263
- });
1264
- v(this, "delete", async (...e) => {
1265
- const r = await this.graffiti.delete(...e);
1266
- return await this.synchronizeDispatch(
1267
- {
1268
- tombstone: !0,
1269
- object: r
1270
- },
1271
- void 0,
1272
- !0
1273
- ), r;
1274
- });
1275
- v(this, "discover", (...e) => {
1276
- const r = this.graffiti.discover(...e);
1277
- return this.objectStream(r);
1278
- });
1279
- v(this, "recoverOrphans", (...e) => {
1280
- const r = this.graffiti.recoverOrphans(...e);
1281
- return this.objectStream(r);
1282
- });
1283
- v(this, "continueObjectStream", (...e) => this.graffiti.continueObjectStream(...e));
1284
- this.options = r ?? {}, this.graffiti = e, this.channelStats = e.channelStats.bind(e), this.login = e.login.bind(e), this.logout = e.logout.bind(e), this.sessionEvents = e.sessionEvents;
1285
- }
1286
- get ajv() {
1287
- return this.ajv_ || (this.ajv_ = (async () => {
1288
- const { default: e } = await import("./ajv-C30pimY5.mjs").then((r) => r.a);
1289
- return new e({ strict: !1 });
1290
- })()), this.ajv_;
1330
+ constructor(n, t) {
1331
+ this.options = t ?? {}, this.graffiti = n, this.login = n.login.bind(n), this.logout = n.logout.bind(n), this.sessionEvents = n.sessionEvents, this.postMedia = n.postMedia.bind(n), this.getMedia = n.getMedia.bind(n), this.deleteMedia = n.deleteMedia.bind(n), this.actorToHandle = n.actorToHandle.bind(n), this.handleToActor = n.handleToActor.bind(n);
1291
1332
  }
1292
- get applyPatch() {
1293
- return this.applyPatch_ || (this.applyPatch_ = (async () => {
1294
- const { applyPatch: e } = await import("./index-CWfNKdDL.mjs");
1295
- return e;
1296
- })()), this.applyPatch_;
1297
- }
1298
- synchronize(e, r, o, i) {
1299
- const a = /* @__PURE__ */ new Set();
1300
- return new k(
1301
- async (c, s) => {
1302
- const f = Ae(await this.ajv, o), h = (u, d) => {
1303
- for (const p of [d, u])
1304
- if (p != null && p.tombstone)
1305
- a.has(p.object.url) && c(p);
1306
- else if (p && e(p.object) && (this.options.omniscient || Be(p.object, i))) {
1307
- const y = JSON.parse(
1308
- JSON.stringify(p.object)
1309
- );
1310
- if (this.options.omniscient || Ne(y, r, i), f(y)) {
1311
- c({ object: y }), a.add(y.url);
1312
- break;
1313
- }
1314
- }
1333
+ synchronize(n, t, o, i, r = /* @__PURE__ */ new Set()) {
1334
+ const s = new U(
1335
+ async (a, c) => {
1336
+ const u = Ge(await this.ajv, o), f = (h) => {
1337
+ if (h?.tombstone)
1338
+ r.has(h.object.url) && a(h);
1339
+ else if (h && n(h.object) && (this.options.omniscient || ke(h.object, i))) {
1340
+ const l = JSON.parse(
1341
+ JSON.stringify(h.object)
1342
+ );
1343
+ this.options.omniscient || Ee(l, t, i), u(l) && (a({ object: l }), r.add(l.url));
1344
+ }
1315
1345
  };
1316
- this.callbacks.add(h), await s, this.callbacks.delete(h);
1346
+ this.callbacks.add(f), await c, this.callbacks.delete(f);
1317
1347
  }
1318
1348
  );
1349
+ return (async function* () {
1350
+ for await (const a of s) yield a;
1351
+ })();
1319
1352
  }
1320
1353
  /**
1321
1354
  * This method has the same signature as {@link discover} but listens for
1322
- * changes made via {@link put}, {@link patch}, and {@link delete} or
1323
- * fetched from {@link get}, {@link discover}, and {@link recoverOrphans}
1355
+ * changes made via {@link post} and {@link delete} or
1356
+ * fetched from {@link get}, {@link discover}, and {@link continueDiscover}
1324
1357
  * and then streams appropriate changes to provide a responsive and
1325
1358
  * consistent user experience.
1326
1359
  *
@@ -1328,53 +1361,38 @@ class Me extends ve {
1328
1361
  * and will not terminate unless the user calls the `return` method on the iterator
1329
1362
  * or `break`s out of the loop.
1330
1363
  *
1331
- * @group Synchronize Methods
1364
+ * @group 0 - Synchronize Methods
1332
1365
  */
1333
- synchronizeDiscover(...e) {
1334
- const [r, o, i] = e;
1335
- function a(l) {
1336
- return l.channels.some((c) => r.includes(c));
1366
+ synchronizeDiscover(n, t, o) {
1367
+ function i(r) {
1368
+ return r.channels.some((s) => n.includes(s));
1337
1369
  }
1338
- return this.synchronize(a, r, o, i);
1370
+ return this.synchronize(i, n, t, o);
1339
1371
  }
1340
1372
  /**
1341
1373
  * This method has the same signature as {@link get} but
1342
- * listens for changes made via {@link put}, {@link patch}, and {@link delete} or
1343
- * fetched from {@link get}, {@link discover}, and {@link recoverOrphans} and then
1374
+ * listens for changes made via {@link post}, and {@link delete} or
1375
+ * fetched from {@link get}, {@link discover}, and {@link continueDiscover} and then
1344
1376
  * streams appropriate changes to provide a responsive and consistent user experience.
1345
1377
  *
1346
1378
  * Unlike {@link get}, which returns a single result, this method continuously
1347
1379
  * listens for changes which are output as an asynchronous stream, similar
1348
1380
  * to {@link discover}.
1349
1381
  *
1350
- * @group Synchronize Methods
1351
- */
1352
- synchronizeGet(...e) {
1353
- const [r, o, i] = e, a = qe(r);
1354
- function l(c) {
1355
- return c.url === a;
1356
- }
1357
- return this.synchronize(l, [], o, i);
1358
- }
1359
- /**
1360
- * This method has the same signature as {@link recoverOrphans} but
1361
- * listens for changes made via
1362
- * {@link put}, {@link patch}, and {@link delete} or fetched from
1363
- * {@link get}, {@link discover}, and {@link recoverOrphans} and then
1364
- * streams appropriate changes to provide a responsive and consistent user experience.
1365
- *
1366
- * Unlike {@link recoverOrphans}, this method continuously listens for changes
1367
- * and will not terminate unless the user calls the `return` method on the iterator
1368
- * or `break`s out of the loop.
1369
- *
1370
- * @group Synchronize Methods
1382
+ * @group 0 - Synchronize Methods
1371
1383
  */
1372
- synchronizeRecoverOrphans(...e) {
1373
- const [r, o] = e;
1374
- function i(a) {
1375
- return a.actor === o.actor && a.channels.length === 0;
1384
+ synchronizeGet(n, t, o) {
1385
+ const i = te(n);
1386
+ function r(s) {
1387
+ return s.url === i;
1376
1388
  }
1377
- return this.synchronize(i, [], r, o);
1389
+ return this.synchronize(
1390
+ r,
1391
+ [],
1392
+ t,
1393
+ o,
1394
+ /* @__PURE__ */ new Set([i])
1395
+ );
1378
1396
  }
1379
1397
  /**
1380
1398
  * Streams changes made to *any* object in *any* channel
@@ -1385,80 +1403,120 @@ class Me extends ve {
1385
1403
  *
1386
1404
  * Be careful using this method. Without additional filters it can
1387
1405
  * expose the user to content out of context.
1406
+ *
1407
+ * @group 0 - Synchronize Methods
1388
1408
  */
1389
- synchronizeAll(e, r) {
1390
- return this.synchronize(() => !0, [], e, r);
1409
+ synchronizeAll(n, t) {
1410
+ return this.synchronize(() => !0, [], n, t);
1391
1411
  }
1392
- async synchronizeDispatch(e, r, o = !1) {
1393
- for (const i of this.callbacks)
1394
- i(e, r);
1395
- o && await new Promise((i) => setTimeout(i, 0));
1412
+ async synchronizeDispatch(n, t = !1) {
1413
+ for (const o of this.callbacks)
1414
+ o(n);
1415
+ t && await new Promise((o) => setTimeout(o, 0));
1396
1416
  }
1397
- objectStreamContinue(e) {
1398
- const r = this;
1399
- return async function* () {
1417
+ get = async (...n) => {
1418
+ try {
1419
+ const t = await this.graffiti.get(...n);
1420
+ return this.synchronizeDispatch({ object: t }), t;
1421
+ } catch (t) {
1422
+ throw t instanceof D && this.synchronizeDispatch({
1423
+ tombstone: !0,
1424
+ object: { url: te(n[0]) }
1425
+ }), t;
1426
+ }
1427
+ };
1428
+ post = async (...n) => {
1429
+ const t = await this.graffiti.post(...n);
1430
+ return await this.synchronizeDispatch({ object: t }, !0), t;
1431
+ };
1432
+ delete = async (...n) => {
1433
+ const t = {
1434
+ tombstone: !0,
1435
+ object: { url: te(n[0]) }
1436
+ };
1437
+ try {
1438
+ const o = await this.graffiti.delete(...n);
1439
+ return await this.synchronizeDispatch(t, !0), o;
1440
+ } catch (o) {
1441
+ throw o instanceof D && await this.synchronizeDispatch(t, !0), o;
1442
+ }
1443
+ };
1444
+ objectStreamContinue(n) {
1445
+ const t = this;
1446
+ return (async function* () {
1400
1447
  for (; ; ) {
1401
- const o = await e.next();
1448
+ const o = await n.next();
1402
1449
  if (o.done) {
1403
- const { continue: i, cursor: a } = o.value;
1450
+ const { continue: i, cursor: r } = o.value;
1404
1451
  return {
1405
- continue: () => r.objectStreamContinue(i()),
1406
- cursor: a
1452
+ continue: (s) => t.objectStreamContinue(i(s)),
1453
+ cursor: r
1407
1454
  };
1408
1455
  }
1409
- o.value.error || r.synchronizeDispatch(
1410
- o.value
1411
- ), yield o.value;
1456
+ o.value.error || t.synchronizeDispatch(o.value), yield o.value;
1412
1457
  }
1413
- }();
1458
+ })();
1414
1459
  }
1415
- objectStream(e) {
1416
- const r = this.objectStreamContinue(e);
1417
- return async function* () {
1460
+ objectStream(n) {
1461
+ const t = this.objectStreamContinue(n);
1462
+ return (async function* () {
1418
1463
  for (; ; ) {
1419
- const o = await r.next();
1464
+ const o = await t.next();
1420
1465
  if (o.done) return o.value;
1421
1466
  (o.value.error || !o.value.tombstone) && (yield o.value);
1422
1467
  }
1423
- }();
1468
+ })();
1424
1469
  }
1470
+ discover = (...n) => {
1471
+ const t = this.graffiti.discover(...n);
1472
+ return this.objectStream(t);
1473
+ };
1474
+ continueDiscover = (...n) => {
1475
+ const t = this.graffiti.continueDiscover(...n);
1476
+ return this.objectStreamContinue(t);
1477
+ };
1425
1478
  }
1426
- const Ue = {
1427
- install(t, n) {
1428
- const e = n.graffiti, r = new Me(e), o = B(void 0);
1429
- r.sessionEvents.addEventListener("initialized", async (i) => {
1430
- const a = i.detail;
1431
- if (a && a.error && console.error(a.error), a && a.href) {
1432
- const l = t.config.globalProperties.$router;
1433
- if (l) {
1434
- const c = l.options.history.base, s = new URL(a.href);
1435
- s.pathname.startsWith(c) && (s.pathname = s.pathname.slice(c.length)), await l.replace(s.pathname + s.search + s.hash);
1479
+ const ft = {
1480
+ install(e, n) {
1481
+ const t = n.graffiti, o = new lt(t), i = k(void 0);
1482
+ o.sessionEvents.addEventListener("initialized", async (r) => {
1483
+ const s = r.detail;
1484
+ if (s && s.error && console.error(s.error), s && s.href) {
1485
+ const a = e.config.globalProperties.$router;
1486
+ if (a) {
1487
+ const c = a.options.history.base, u = new URL(s.href);
1488
+ u.pathname.startsWith(c) && (u.pathname = u.pathname.slice(c.length)), await a.replace(u.pathname + u.search + u.hash);
1436
1489
  }
1437
1490
  }
1438
- o.value || (o.value = null);
1439
- }), r.sessionEvents.addEventListener("login", (i) => {
1440
- const a = i.detail;
1441
- if (a.error) {
1442
- console.error("Error logging in:"), console.error(a.error);
1491
+ i.value || (i.value = null);
1492
+ }), o.sessionEvents.addEventListener("login", (r) => {
1493
+ const s = r.detail;
1494
+ if (s.error) {
1495
+ console.error("Error logging in:"), console.error(s.error);
1443
1496
  return;
1444
1497
  } else
1445
- o.value = a.session;
1446
- }), r.sessionEvents.addEventListener("logout", (i) => {
1447
- const a = i.detail;
1448
- a.error ? (console.error("Error logging out:"), console.error(a.error)) : o.value = null;
1449
- }), q.graffitiSynchronize = r, q.graffitiSession = o, t.component("GraffitiDiscover", ae), t.component("GraffitiGet", ue), t.component("GraffitiRecoverOrphans", ce), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
1498
+ i.value = s.session;
1499
+ }), o.sessionEvents.addEventListener("logout", (r) => {
1500
+ const s = r.detail;
1501
+ s.error ? (console.error("Error logging out:"), console.error(s.error)) : i.value = null;
1502
+ }), Ae(o), Oe(i), e.component("GraffitiDiscover", we), e.component("GraffitiGet", ge), e.component("GraffitiGetMedia", je), e.component("GraffitiActorToHandle", W), e.component("GraffitiHandleToActor", xe), e.component("GraffitiObjectInfo", K), e.config.globalProperties.$graffiti = o, e.config.globalProperties.$graffitiSession = i;
1450
1503
  }
1451
- }, Le = ae, We = ue, Je = ce;
1504
+ }, dt = we, ht = ge, yt = je, pt = W, vt = xe, mt = K;
1452
1505
  export {
1453
- Le as GraffitiDiscover,
1454
- We as GraffitiGet,
1455
- Ue as GraffitiPlugin,
1456
- Je as GraffitiRecoverOrphans,
1457
- $e as useGraffiti,
1458
- xe as useGraffitiDiscover,
1459
- Oe as useGraffitiGet,
1460
- Se as useGraffitiRecoverOrphans,
1461
- Y as useGraffitiSession,
1462
- M as useGraffitiSynchronize
1506
+ pt as GraffitiActorToHandle,
1507
+ dt as GraffitiDiscover,
1508
+ ht as GraffitiGet,
1509
+ yt as GraffitiGetMedia,
1510
+ vt as GraffitiHandleToActor,
1511
+ mt as GraffitiObjectInfo,
1512
+ ft as GraffitiPlugin,
1513
+ ae as useGraffiti,
1514
+ $e as useGraffitiActorToHandle,
1515
+ Te as useGraffitiDiscover,
1516
+ Ue as useGraffitiGet,
1517
+ Be as useGraffitiGetMedia,
1518
+ Ye as useGraffitiHandleToActor,
1519
+ ct as useGraffitiSession,
1520
+ X as useGraffitiSynchronize
1463
1521
  };
1464
1522
  //# sourceMappingURL=plugin.mjs.map