@graffiti-garden/wrapper-vue 0.6.3 → 0.6.5

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.
@@ -1,9 +1,9 @@
1
- var he = Object.defineProperty;
2
- var pe = (t, n, e) => n in t ? he(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var v = (t, n, e) => pe(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { inject as X, ref as M, computed as de, watch as ye, onScopeDispose as ve, toValue as j, defineComponent as L, toRef as g, renderSlot as W, unref as b } from "vue";
1
+ var pe = Object.defineProperty;
2
+ var de = (t, n, e) => n in t ? pe(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var v = (t, n, e) => de(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { inject as X, ref as U, computed as ye, watch as ve, onScopeDispose as me, toValue as P, defineComponent as L, toRef as w, renderSlot as W, unref as m } from "vue";
5
5
  const Y = Symbol(), Z = Symbol();
6
- function N() {
6
+ function B() {
7
7
  const t = X(Y);
8
8
  if (!t)
9
9
  throw new Error(
@@ -11,8 +11,8 @@ function N() {
11
11
  );
12
12
  return t;
13
13
  }
14
- function $e() {
15
- return N();
14
+ function Le() {
15
+ return B();
16
16
  }
17
17
  function ee() {
18
18
  const t = X(Z);
@@ -22,21 +22,25 @@ function ee() {
22
22
  );
23
23
  return t;
24
24
  }
25
- var me = class {
25
+ var be = class {
26
26
  }, we = class te extends Error {
27
27
  constructor(n) {
28
- super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, te.prototype);
28
+ super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, te.prototype);
29
29
  }
30
- }, be = class ne extends Error {
30
+ }, ge = class ne extends Error {
31
31
  constructor(n) {
32
- super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, ne.prototype);
32
+ super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ne.prototype);
33
33
  }
34
- }, ge = class re extends Error {
34
+ }, Pe = class re extends Error {
35
35
  constructor(n) {
36
- super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, re.prototype);
36
+ super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, re.prototype);
37
+ }
38
+ }, je = class ie extends Error {
39
+ constructor(n) {
40
+ super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ie.prototype);
37
41
  }
38
42
  };
39
- class Pe {
43
+ class xe {
40
44
  constructor(n) {
41
45
  v(this, "poll", async (n) => {
42
46
  let e;
@@ -54,12 +58,24 @@ class Pe {
54
58
  clear() {
55
59
  }
56
60
  }
57
- class ie {
61
+ class oe {
58
62
  constructor(n) {
59
63
  v(this, "iterator");
60
64
  v(this, "continue");
61
65
  v(this, "poll", async (n) => {
62
- for (this.iterator || (this.continue ? this.iterator = this.continue() : this.iterator = this.streamFactory()); this.iterator; ) {
66
+ if (!this.iterator)
67
+ if (this.continue)
68
+ try {
69
+ this.iterator = this.continue();
70
+ } catch (e) {
71
+ if (e instanceof we)
72
+ n("clear"), this.iterator = this.streamFactory();
73
+ else
74
+ throw e;
75
+ }
76
+ else
77
+ this.iterator = this.streamFactory();
78
+ for (; this.iterator; ) {
63
79
  const e = this.iterator, r = await e.next();
64
80
  if (e === this.iterator) {
65
81
  if (r.done) {
@@ -87,15 +103,15 @@ class ie {
87
103
  this.iterator = void 0, this.continue = void 0;
88
104
  }
89
105
  }
90
- function oe(t, n) {
106
+ function se(t, n) {
91
107
  return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
92
108
  }
93
- class xe {
109
+ class Oe {
94
110
  constructor() {
95
- v(this, "entry", M());
111
+ v(this, "entry", U());
96
112
  }
97
113
  get result() {
98
- return de(() => {
114
+ return ye(() => {
99
115
  const n = this.entry.value;
100
116
  return n && (n.tombstone ? null : n.object);
101
117
  });
@@ -104,12 +120,16 @@ class xe {
104
120
  this.entry.value = void 0;
105
121
  }
106
122
  onEntry(n) {
107
- (!n || oe(n, this.entry.value)) && (this.entry.value = n);
123
+ if (n === "clear") {
124
+ this.clear();
125
+ return;
126
+ }
127
+ (!n || se(n, this.entry.value)) && (this.entry.value = n);
108
128
  }
109
129
  }
110
- class se {
130
+ class ae {
111
131
  constructor(n) {
112
- v(this, "results", M([]));
132
+ v(this, "results", U([]));
113
133
  v(this, "resultsRaw", /* @__PURE__ */ new Map());
114
134
  v(this, "batchFlattenTimer");
115
135
  this.graffiti = n;
@@ -122,184 +142,273 @@ class se {
122
142
  }
123
143
  onEntry(n) {
124
144
  if (!n) return;
145
+ if (n === "clear") {
146
+ this.clear();
147
+ return;
148
+ }
125
149
  const e = this.resultsRaw.get(n.object.url);
126
- oe(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
150
+ se(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
127
151
  this.flattenResults(), this.batchFlattenTimer = void 0;
128
152
  }, 0)));
129
153
  }
130
154
  }
131
- function J(t, n, e, r) {
132
- let o;
133
- async function i() {
134
- o = e();
135
- for await (const a of o) {
136
- if (a.error) {
137
- console.error(a.error);
155
+ function J(t, n, e, r, o) {
156
+ let i;
157
+ async function a() {
158
+ i = e();
159
+ for await (const f of i) {
160
+ if (f.error) {
161
+ console.error(f.error);
138
162
  continue;
139
163
  }
140
- t.onEntry(a);
164
+ t.onEntry(f);
141
165
  }
142
166
  }
143
- const u = () => n.poll(t.onEntry.bind(t)), l = M(!1);
144
- return ye(
167
+ let c = !1;
168
+ const l = async () => {
169
+ if (!c) {
170
+ c = !0;
171
+ try {
172
+ await n.poll(t.onEntry.bind(t));
173
+ } finally {
174
+ c = !1, P(o) && l();
175
+ }
176
+ }
177
+ }, s = U(!1);
178
+ return ve(
145
179
  r,
146
- async (a, s) => {
147
- if (JSON.stringify(a) !== JSON.stringify(s)) {
148
- o == null || o.return(null), t.clear(), n.clear(), i(), l.value = !0;
180
+ async (f, p) => {
181
+ if (JSON.stringify(f) !== JSON.stringify(p)) {
182
+ i == null || i.return(null), t.clear(), n.clear(), a(), s.value = !0;
149
183
  try {
150
- await u();
184
+ await l();
151
185
  } finally {
152
- l.value = !1;
186
+ s.value = !1;
153
187
  }
154
188
  }
155
189
  },
156
190
  {
157
191
  immediate: !0
158
192
  }
159
- ), ve(() => o == null ? void 0 : o.return(null)), { poll: u, isPolling: l };
193
+ ), me(() => i == null ? void 0 : i.return(null)), { poll: l, isInitialPolling: s };
160
194
  }
161
195
  function ue(t, n) {
162
196
  return () => {
163
- const e = j(n);
197
+ const e = P(n);
164
198
  return e === void 0 ? t == null ? void 0 : t.value : e;
165
199
  };
166
200
  }
167
- function E(t) {
201
+ function S(t) {
168
202
  return t.map((n) => n());
169
203
  }
170
- function je(t, n, e) {
171
- const r = N(), o = ee(), i = () => j(t), u = () => j(n), l = ue(o, e), a = [i, u, l], s = () => r.synchronizeDiscover(...E(a)), f = () => r.discover(...E(a)), p = new se(r), c = new ie(f), { poll: d, isPolling: h } = J(
172
- p,
173
- c,
204
+ function Ee(t, n, e, r = !1) {
205
+ const o = B(), i = ee(), a = () => P(t), c = () => P(n), l = ue(i, e), s = [a, c, l], f = () => o.synchronizeDiscover(...S(s)), p = () => o.discover(...S(s)), u = new ae(o), d = new oe(p), { poll: h, isInitialPolling: y } = J(
206
+ u,
207
+ d,
208
+ f,
174
209
  s,
175
- a
210
+ r
176
211
  );
177
212
  return {
178
213
  /**
179
- * A [Ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
180
- * an array of Graffiti objects. All tombstoned objects have been filtered out.
214
+ * A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
215
+ * an array of Graffiti objects.
181
216
  */
182
- results: p.results,
217
+ objects: u.results,
218
+ /**
219
+ * @deprecated Use {@link objects} instead.
220
+ */
221
+ get results() {
222
+ return console.warn(
223
+ "The `results` property is deprecated. Use `objects` instead."
224
+ ), this.objects;
225
+ },
183
226
  /**
184
227
  * A method to poll for new results.
185
228
  */
186
- poll: d,
229
+ poll: h,
187
230
  /**
188
- * A boolean [Ref](https://vuejs.org/api/reactivity-core.html#ref)
189
- * that indicates if the poll is currently running.
231
+ * A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
232
+ * that indicates if the *first* poll is currently running.
190
233
  * Useful to show a loading spinner or disable a button.
234
+ *
235
+ * This also tracks new polls when the arguments have changed,
236
+ * but it does not track ongoing polls from either calling
237
+ * {@link poll} or using the `autopoll` argument.
238
+ */
239
+ isInitialPolling: y,
240
+ /**
241
+ * @deprecated Use {@link isInitialPolling} instead.
191
242
  */
192
- isPolling: h
243
+ get isPolling() {
244
+ return console.warn(
245
+ "The `isPolling` property is deprecated. Use `isInitialPolling` instead."
246
+ ), this.isInitialPolling;
247
+ }
193
248
  };
194
249
  }
195
- function Oe(t, n, e) {
196
- const r = N(), o = ee(), i = () => j(t), u = () => j(n), l = ue(o, e), a = [
197
- i,
198
- u,
250
+ function Se(t, n, e, r = !1) {
251
+ const o = B(), i = ee(), a = () => P(t), c = () => P(n), l = ue(i, e), s = [
252
+ a,
253
+ c,
199
254
  l
200
- ], s = () => r.synchronizeGet(...E(a)), f = new xe(), p = () => r.get(...E(a)), c = new Pe(p), { poll: d, isPolling: h } = J(
255
+ ], f = () => o.synchronizeGet(...S(s)), p = new Oe(), u = () => o.get(...S(s)), d = new xe(u), { poll: h, isInitialPolling: y } = J(
256
+ p,
257
+ d,
201
258
  f,
202
- c,
203
259
  s,
204
- a
260
+ r
205
261
  );
206
262
  return {
207
263
  /**
208
- * A [Ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
264
+ * A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
209
265
  * the retrieved Graffiti object, if it exists. If the object has been deleted,
210
266
  * the result is `null`. If the object is still being fetched, the result is `undefined`.
211
267
  */
212
- result: f.result,
268
+ object: p.result,
269
+ /**
270
+ * @deprecated Use {@link object} instead.
271
+ */
272
+ get result() {
273
+ return console.warn(
274
+ "The `result` property is deprecated. Use `object` instead."
275
+ ), this.object;
276
+ },
213
277
  /**
214
278
  * A method to poll for new results.
215
279
  */
216
- poll: d,
280
+ poll: h,
217
281
  /**
218
- * A boolean [Ref](https://vuejs.org/api/reactivity-core.html#ref)
219
- * that indicates if the poll is currently running.
282
+ * A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
283
+ * that indicates if the *first* poll is currently running.
220
284
  * Useful to show a loading spinner or disable a button.
285
+ *
286
+ * This also tracks new polls when the arguments have changed,
287
+ * but it does not track ongoing polls from either calling
288
+ * {@link poll} or using the `autopoll` argument.
289
+ */
290
+ isInitialPolling: y,
291
+ /**
292
+ * @deprecated Use {@link isInitialPolling} instead.
221
293
  */
222
- isPolling: h
294
+ get isPolling() {
295
+ return console.warn(
296
+ "The `isPolling` property is deprecated. Use `isInitialPolling` instead."
297
+ ), this.isInitialPolling;
298
+ }
223
299
  };
224
300
  }
225
- function Se(t, n) {
226
- const e = N(), i = [() => j(t), () => j(n)], u = () => e.synchronizeRecoverOrphans(...E(i)), l = new se(e), a = () => e.recoverOrphans(...E(i)), s = new ie(a), { poll: f, isPolling: p } = J(
301
+ function Ge(t, n, e = !1) {
302
+ const r = B(), a = [() => P(t), () => P(n)], c = () => r.synchronizeRecoverOrphans(...S(a)), l = new ae(r), s = () => r.recoverOrphans(...S(a)), f = new oe(s), { poll: p, isInitialPolling: u } = J(
227
303
  l,
228
- s,
229
- u,
230
- i
304
+ f,
305
+ c,
306
+ a,
307
+ e
231
308
  );
232
309
  return {
233
310
  /**
234
- * A [Ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
235
- * an array of Graffiti objects. All tombstoned objects have been filtered out.
311
+ * A [ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
312
+ * an array of Graffiti objects.
236
313
  */
237
- results: l.results,
314
+ objects: l.results,
315
+ /**
316
+ * @deprecated Use {@link objects} instead.
317
+ */
318
+ get results() {
319
+ return console.warn(
320
+ "The `result` property is deprecated. Use `object` instead."
321
+ ), this.objects;
322
+ },
238
323
  /**
239
324
  * A method to poll for new results.
240
325
  */
241
- poll: f,
326
+ poll: p,
242
327
  /**
243
- * A boolean [Ref](https://vuejs.org/api/reactivity-core.html#ref)
244
- * that indicates if the poll is currently running.
328
+ * A boolean [ref](https://vuejs.org/api/reactivity-core.html#ref)
329
+ * that indicates if the *first* poll is currently running.
245
330
  * Useful to show a loading spinner or disable a button.
331
+ *
332
+ * This also tracks new polls when the arguments have changed,
333
+ * but it does not track ongoing polls from either calling
334
+ * {@link poll} or using the `autopoll` argument.
335
+ */
336
+ isInitialPolling: u,
337
+ /**
338
+ * @deprecated Use {@link isInitialPolling} instead.
246
339
  */
247
- isPolling: p
340
+ get isPolling() {
341
+ return console.warn(
342
+ "The `isPolling` property is deprecated. Use `isInitialPolling` instead."
343
+ ), this.isInitialPolling;
344
+ }
248
345
  };
249
346
  }
250
- const ae = /* @__PURE__ */ L({
347
+ const ce = /* @__PURE__ */ L({
251
348
  __name: "Discover",
252
349
  props: {
253
350
  channels: {},
254
351
  schema: {},
255
- session: {}
352
+ session: {},
353
+ autopoll: { type: Boolean }
256
354
  },
257
355
  setup(t) {
258
- const n = t, { results: e, poll: r, isPolling: o } = je(
259
- g(n, "channels"),
260
- g(n, "schema"),
261
- g(n, "session")
356
+ const n = t, { objects: e, results: r, poll: o, isPolling: i, isInitialPolling: a } = Ee(
357
+ w(n, "channels"),
358
+ w(n, "schema"),
359
+ w(n, "session"),
360
+ w(n, "autopoll")
262
361
  );
263
- return (i, u) => W(i.$slots, "default", {
264
- results: b(e),
265
- poll: b(r),
266
- isPolling: b(o)
362
+ return (c, l) => W(c.$slots, "default", {
363
+ objects: m(e),
364
+ results: m(r),
365
+ poll: m(o),
366
+ isPolling: m(i),
367
+ isInitialPolling: m(a)
267
368
  });
268
369
  }
269
- }), ce = /* @__PURE__ */ L({
370
+ }), le = /* @__PURE__ */ L({
270
371
  __name: "Get",
271
372
  props: {
272
373
  url: {},
273
374
  schema: {},
274
- session: {}
375
+ session: {},
376
+ autopoll: { type: Boolean }
275
377
  },
276
378
  setup(t) {
277
- const n = t, { result: e, poll: r, isPolling: o } = Oe(
278
- g(n, "url"),
279
- g(n, "schema"),
280
- g(n, "session")
379
+ const n = t, { object: e, result: r, poll: o, isPolling: i, isInitialPolling: a } = Se(
380
+ w(n, "url"),
381
+ w(n, "schema"),
382
+ w(n, "session"),
383
+ w(n, "autopoll")
281
384
  );
282
- return (i, u) => W(i.$slots, "default", {
283
- result: b(e),
284
- poll: b(r),
285
- isPolling: b(o)
385
+ return (c, l) => W(c.$slots, "default", {
386
+ object: m(e),
387
+ result: m(r),
388
+ poll: m(o),
389
+ isPolling: m(i),
390
+ isInitialPolling: m(a)
286
391
  });
287
392
  }
288
- }), le = /* @__PURE__ */ L({
393
+ }), fe = /* @__PURE__ */ L({
289
394
  __name: "RecoverOrphans",
290
395
  props: {
291
396
  schema: {},
292
- session: {}
397
+ session: {},
398
+ autopoll: { type: Boolean }
293
399
  },
294
400
  setup(t) {
295
- const n = t, { results: e, poll: r, isPolling: o } = Se(
296
- g(n, "schema"),
297
- g(n, "session")
401
+ const n = t, { objects: e, results: r, poll: o, isPolling: i, isInitialPolling: a } = Ge(
402
+ w(n, "schema"),
403
+ w(n, "session"),
404
+ w(n, "autopoll")
298
405
  );
299
- return (i, u) => W(i.$slots, "default", {
300
- results: b(e),
301
- poll: b(r),
302
- isPolling: b(o)
406
+ return (c, l) => W(c.$slots, "default", {
407
+ objects: m(e),
408
+ results: m(r),
409
+ poll: m(o),
410
+ isPolling: m(i),
411
+ isInitialPolling: m(a)
303
412
  });
304
413
  }
305
414
  });
@@ -317,15 +426,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
317
426
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
318
427
  PERFORMANCE OF THIS SOFTWARE.
319
428
  ***************************************************************************** */
320
- var C = function(t, n) {
321
- return C = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
429
+ var V = function(t, n) {
430
+ return V = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
322
431
  e.__proto__ = r;
323
432
  } || function(e, r) {
324
433
  for (var o in r) r.hasOwnProperty(o) && (e[o] = r[o]);
325
- }, C(t, n);
434
+ }, V(t, n);
326
435
  };
327
- function Ee(t, n) {
328
- C(t, n);
436
+ function _e(t, n) {
437
+ V(t, n);
329
438
  function e() {
330
439
  this.constructor = t;
331
440
  }
@@ -333,45 +442,45 @@ function Ee(t, n) {
333
442
  }
334
443
  function G(t, n, e, r) {
335
444
  function o(i) {
336
- return i instanceof e ? i : new e(function(u) {
337
- u(i);
445
+ return i instanceof e ? i : new e(function(a) {
446
+ a(i);
338
447
  });
339
448
  }
340
- return new (e || (e = Promise))(function(i, u) {
341
- function l(f) {
449
+ return new (e || (e = Promise))(function(i, a) {
450
+ function c(f) {
342
451
  try {
343
452
  s(r.next(f));
344
453
  } catch (p) {
345
- u(p);
454
+ a(p);
346
455
  }
347
456
  }
348
- function a(f) {
457
+ function l(f) {
349
458
  try {
350
459
  s(r.throw(f));
351
460
  } catch (p) {
352
- u(p);
461
+ a(p);
353
462
  }
354
463
  }
355
464
  function s(f) {
356
- f.done ? i(f.value) : o(f.value).then(l, a);
465
+ f.done ? i(f.value) : o(f.value).then(c, l);
357
466
  }
358
467
  s((r = r.apply(t, [])).next());
359
468
  });
360
469
  }
361
- function P(t, n) {
470
+ function j(t, n) {
362
471
  var e = { label: 0, sent: function() {
363
472
  if (i[0] & 1) throw i[1];
364
473
  return i[1];
365
- }, trys: [], ops: [] }, r, o, i, u;
366
- return u = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
474
+ }, trys: [], ops: [] }, r, o, i, a;
475
+ return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
367
476
  return this;
368
- }), u;
369
- function l(s) {
477
+ }), a;
478
+ function c(s) {
370
479
  return function(f) {
371
- return a([s, f]);
480
+ return l([s, f]);
372
481
  };
373
482
  }
374
- function a(s) {
483
+ function l(s) {
375
484
  if (r) throw new TypeError("Generator is already executing.");
376
485
  for (; e; ) try {
377
486
  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;
@@ -428,46 +537,46 @@ function _(t) {
428
537
  };
429
538
  throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
430
539
  }
431
- function z(t) {
432
- return this instanceof z ? (this.v = t, this) : new z(t);
540
+ function T(t) {
541
+ return this instanceof T ? (this.v = t, this) : new T(t);
433
542
  }
434
- function Ge(t, n, e) {
543
+ function Ie(t, n, e) {
435
544
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
436
545
  var r = e.apply(t, n || []), o, i = [];
437
- return o = {}, u("next"), u("throw"), u("return"), o[Symbol.asyncIterator] = function() {
546
+ return o = {}, a("next"), a("throw"), a("return"), o[Symbol.asyncIterator] = function() {
438
547
  return this;
439
548
  }, o;
440
- function u(c) {
441
- r[c] && (o[c] = function(d) {
549
+ function a(u) {
550
+ r[u] && (o[u] = function(d) {
442
551
  return new Promise(function(h, y) {
443
- i.push([c, d, h, y]) > 1 || l(c, d);
552
+ i.push([u, d, h, y]) > 1 || c(u, d);
444
553
  });
445
554
  });
446
555
  }
447
- function l(c, d) {
556
+ function c(u, d) {
448
557
  try {
449
- a(r[c](d));
558
+ l(r[u](d));
450
559
  } catch (h) {
451
560
  p(i[0][3], h);
452
561
  }
453
562
  }
454
- function a(c) {
455
- c.value instanceof z ? Promise.resolve(c.value.v).then(s, f) : p(i[0][2], c);
563
+ function l(u) {
564
+ u.value instanceof T ? Promise.resolve(u.value.v).then(s, f) : p(i[0][2], u);
456
565
  }
457
- function s(c) {
458
- l("next", c);
566
+ function s(u) {
567
+ c("next", u);
459
568
  }
460
- function f(c) {
461
- l("throw", c);
569
+ function f(u) {
570
+ c("throw", u);
462
571
  }
463
- function p(c, d) {
464
- c(d), i.shift(), i.length && l(i[0][0], i[0][1]);
572
+ function p(u, d) {
573
+ u(d), i.shift(), i.length && c(i[0][0], i[0][1]);
465
574
  }
466
575
  }
467
- var fe = (
576
+ var he = (
468
577
  /** @class */
469
578
  function(t) {
470
- Ee(n, t);
579
+ _e(n, t);
471
580
  function n(e) {
472
581
  var r = t.call(this, e) || this;
473
582
  return Object.defineProperty(r, "name", {
@@ -560,12 +669,12 @@ var fe = (
560
669
  return this._q.shift();
561
670
  }, t;
562
671
  })();
563
- function $(t) {
672
+ function C(t) {
564
673
  t != null && typeof t.then == "function" && t.then(A, A);
565
674
  }
566
- var B = 0, H = 1, O = 2, F = 3, U = 4, I = 1024, A = function() {
675
+ var M = 0, H = 1, O = 2, q = 3, $ = 4, D = 1024, A = function() {
567
676
  };
568
- function S(t) {
677
+ function E(t) {
569
678
  var n = t.err, e = Promise.resolve(t.execution).then(function(r) {
570
679
  if (n != null)
571
680
  throw n;
@@ -578,9 +687,9 @@ function S(t) {
578
687
  });
579
688
  }
580
689
  function x(t, n) {
581
- var e = t.state >= F;
690
+ var e = t.state >= q;
582
691
  return Promise.resolve(n).then(function(r) {
583
- return !e && t.state >= U ? S(t).then(function(o) {
692
+ return !e && t.state >= $ ? E(t).then(function(o) {
584
693
  return {
585
694
  value: o,
586
695
  done: !0
@@ -592,15 +701,15 @@ function K(t, n) {
592
701
  var e, r;
593
702
  if (!(t.state >= O))
594
703
  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))
595
- R(t);
704
+ I(t);
596
705
  else
597
706
  try {
598
707
  for (var o = _(t.pushes), i = o.next(); !i.done; i = o.next()) {
599
- var u = i.value;
600
- u.resolve();
708
+ var a = i.value;
709
+ a.resolve();
601
710
  }
602
- } catch (l) {
603
- e = { error: l };
711
+ } catch (c) {
712
+ e = { error: c };
604
713
  } finally {
605
714
  try {
606
715
  i && !i.done && (r = o.return) && r.call(o);
@@ -609,19 +718,19 @@ function K(t, n) {
609
718
  }
610
719
  }
611
720
  }
612
- function R(t) {
721
+ function I(t) {
613
722
  var n, e;
614
- if (!(t.state >= F)) {
615
- t.state < O && K(t), t.state = F, t.buffer = void 0;
723
+ if (!(t.state >= q)) {
724
+ t.state < O && K(t), t.state = q, t.buffer = void 0;
616
725
  try {
617
726
  for (var r = _(t.nexts), o = r.next(); !o.done; o = r.next()) {
618
- var i = o.value, u = t.pending === void 0 ? S(t) : t.pending.then(function() {
619
- return S(t);
727
+ var i = o.value, a = t.pending === void 0 ? E(t) : t.pending.then(function() {
728
+ return E(t);
620
729
  });
621
- i.resolve(x(t, u));
730
+ i.resolve(x(t, a));
622
731
  }
623
- } catch (l) {
624
- n = { error: l };
732
+ } catch (c) {
733
+ n = { error: c };
625
734
  } finally {
626
735
  try {
627
736
  o && !o.done && (e = r.return) && e.call(r);
@@ -633,41 +742,41 @@ function R(t) {
633
742
  }
634
743
  }
635
744
  function Q(t) {
636
- t.state >= U || (t.state < F && R(t), t.state = U);
745
+ t.state >= $ || (t.state < q && I(t), t.state = $);
637
746
  }
638
- function _e(t, n) {
639
- if ($(n), t.pushes.length >= I)
640
- throw new fe("No more than " + I + " pending calls to push are allowed on a single repeater.");
747
+ function Te(t, n) {
748
+ if (C(n), t.pushes.length >= D)
749
+ throw new he("No more than " + D + " pending calls to push are allowed on a single repeater.");
641
750
  if (t.state >= O)
642
751
  return Promise.resolve(void 0);
643
752
  var e = t.pending === void 0 ? Promise.resolve(n) : t.pending.then(function() {
644
753
  return n;
645
754
  });
646
- e = e.catch(function(a) {
647
- t.state < O && (t.err = a), Q(t);
755
+ e = e.catch(function(l) {
756
+ t.state < O && (t.err = l), Q(t);
648
757
  });
649
758
  var r;
650
759
  if (t.nexts.length) {
651
760
  var o = t.nexts.shift();
652
- 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(a) {
653
- return t.onnext = a;
761
+ 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(l) {
762
+ return t.onnext = l;
654
763
  });
655
- } else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(a) {
656
- return t.pushes.push({ resolve: a, value: e });
764
+ } else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(l) {
765
+ return t.pushes.push({ resolve: l, value: e });
657
766
  });
658
- var i = !0, u = {}, l = r.catch(function(a) {
767
+ var i = !0, a = {}, c = r.catch(function(l) {
659
768
  if (i)
660
- throw a;
769
+ throw l;
661
770
  });
662
- return u.then = function(a, s) {
663
- return i = !1, Promise.prototype.then.call(r, a, s);
664
- }, u.catch = function(a) {
665
- return i = !1, Promise.prototype.catch.call(r, a);
666
- }, u.finally = r.finally.bind(r), t.pending = e.then(function() {
667
- return l;
668
- }).catch(function(a) {
669
- t.err = a, Q(t);
670
- }), u;
771
+ return a.then = function(l, s) {
772
+ return i = !1, Promise.prototype.then.call(r, l, s);
773
+ }, a.catch = function(l) {
774
+ return i = !1, Promise.prototype.catch.call(r, l);
775
+ }, a.finally = r.finally.bind(r), t.pending = e.then(function() {
776
+ return c;
777
+ }).catch(function(l) {
778
+ t.err = l, Q(t);
779
+ }), a;
671
780
  }
672
781
  function Re(t) {
673
782
  var n = K.bind(null, t), e = new Promise(function(r) {
@@ -678,7 +787,7 @@ function Re(t) {
678
787
  function ze(t) {
679
788
  if (!(t.state >= H)) {
680
789
  t.state = H;
681
- var n = _e.bind(null, t), e = Re(t);
790
+ var n = Te.bind(null, t), e = Re(t);
682
791
  t.execution = new Promise(function(r) {
683
792
  return r(t.executor(n, e));
684
793
  }), t.execution.catch(function() {
@@ -686,15 +795,15 @@ function ze(t) {
686
795
  });
687
796
  }
688
797
  }
689
- var D = /* @__PURE__ */ new WeakMap(), k = (
798
+ var F = /* @__PURE__ */ new WeakMap(), R = (
690
799
  /** @class */
691
800
  function() {
692
801
  function t(n, e) {
693
- D.set(this, {
802
+ F.set(this, {
694
803
  executor: n,
695
804
  buffer: e,
696
805
  err: void 0,
697
- state: B,
806
+ state: M,
698
807
  pushes: [],
699
808
  nexts: [],
700
809
  pending: void 0,
@@ -704,13 +813,13 @@ var D = /* @__PURE__ */ new WeakMap(), k = (
704
813
  });
705
814
  }
706
815
  return t.prototype.next = function(n) {
707
- $(n);
708
- var e = D.get(this);
816
+ C(n);
817
+ var e = F.get(this);
709
818
  if (e === void 0)
710
819
  throw new Error("WeakMap error");
711
- if (e.nexts.length >= I)
712
- throw new fe("No more than " + I + " pending calls to next are allowed on a single repeater.");
713
- if (e.state <= B && ze(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
820
+ if (e.nexts.length >= D)
821
+ throw new he("No more than " + D + " pending calls to next are allowed on a single repeater.");
822
+ if (e.state <= M && ze(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
714
823
  var r = x(e, e.buffer.remove());
715
824
  if (e.pushes.length) {
716
825
  var o = e.pushes.shift();
@@ -721,44 +830,44 @@ var D = /* @__PURE__ */ new WeakMap(), k = (
721
830
  var i = e.pushes.shift();
722
831
  return e.onnext = i.resolve, x(e, i.value);
723
832
  } else if (e.state >= O)
724
- return R(e), x(e, S(e));
725
- return new Promise(function(u) {
726
- return e.nexts.push({ resolve: u, value: n });
833
+ return I(e), x(e, E(e));
834
+ return new Promise(function(a) {
835
+ return e.nexts.push({ resolve: a, value: n });
727
836
  });
728
837
  }, t.prototype.return = function(n) {
729
- $(n);
730
- var e = D.get(this);
838
+ C(n);
839
+ var e = F.get(this);
731
840
  if (e === void 0)
732
841
  throw new Error("WeakMap error");
733
- return R(e), e.execution = Promise.resolve(e.execution).then(function() {
842
+ return I(e), e.execution = Promise.resolve(e.execution).then(function() {
734
843
  return n;
735
- }), x(e, S(e));
844
+ }), x(e, E(e));
736
845
  }, t.prototype.throw = function(n) {
737
- var e = D.get(this);
846
+ var e = F.get(this);
738
847
  if (e === void 0)
739
848
  throw new Error("WeakMap error");
740
- return e.state <= B || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (R(e), e.err == null && (e.err = n), x(e, S(e))) : this.next(Promise.reject(n));
849
+ return e.state <= M || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (I(e), e.err == null && (e.err = n), x(e, E(e))) : this.next(Promise.reject(n));
741
850
  }, t.prototype[Symbol.asyncIterator] = function() {
742
851
  return this;
743
- }, t.race = ke, t.merge = Te, t.zip = qe, t.latest = De, t;
852
+ }, t.race = ke, t.merge = Fe, t.zip = qe, t.latest = De, t;
744
853
  }()
745
854
  );
746
- function V(t, n) {
855
+ function N(t, n) {
747
856
  var e, r, o = [], i = function(s) {
748
857
  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() {
749
- return Ge(this, arguments, function() {
750
- return P(this, function(c) {
751
- switch (c.label) {
858
+ return Ie(this, arguments, function() {
859
+ return j(this, function(u) {
860
+ switch (u.label) {
752
861
  case 0:
753
- return n.yieldValues ? [4, z(s)] : [3, 3];
862
+ return n.yieldValues ? [4, T(s)] : [3, 3];
754
863
  case 1:
755
- return [4, c.sent()];
864
+ return [4, u.sent()];
756
865
  case 2:
757
- c.sent(), c.label = 3;
866
+ u.sent(), u.label = 3;
758
867
  case 3:
759
- return n.returnValues ? [4, z(s)] : [3, 5];
868
+ return n.returnValues ? [4, T(s)] : [3, 5];
760
869
  case 4:
761
- return [2, c.sent()];
870
+ return [2, u.sent()];
762
871
  case 5:
763
872
  return [
764
873
  2
@@ -770,15 +879,15 @@ function V(t, n) {
770
879
  }());
771
880
  };
772
881
  try {
773
- for (var u = _(t), l = u.next(); !l.done; l = u.next()) {
774
- var a = l.value;
775
- i(a);
882
+ for (var a = _(t), c = a.next(); !c.done; c = a.next()) {
883
+ var l = c.value;
884
+ i(l);
776
885
  }
777
886
  } catch (s) {
778
887
  e = { error: s };
779
888
  } finally {
780
889
  try {
781
- l && !l.done && (r = u.return) && r.call(u);
890
+ c && !c.done && (r = a.return) && r.call(a);
782
891
  } finally {
783
892
  if (e) throw e.error;
784
893
  }
@@ -786,11 +895,11 @@ function V(t, n) {
786
895
  return o;
787
896
  }
788
897
  function ke(t) {
789
- var n = this, e = V(t, { returnValues: !0 });
790
- return new k(function(r, o) {
898
+ var n = this, e = N(t, { returnValues: !0 });
899
+ return new R(function(r, o) {
791
900
  return G(n, void 0, void 0, function() {
792
- var i, u, l, a, s, f;
793
- return P(this, function(p) {
901
+ var i, a, c, l, s, f;
902
+ return j(this, function(p) {
794
903
  switch (p.label) {
795
904
  case 0:
796
905
  if (!e.length)
@@ -798,39 +907,39 @@ function ke(t) {
798
907
  2
799
908
  /*return*/
800
909
  ];
801
- u = !1, o.then(function() {
802
- i(), u = !0;
910
+ a = !1, o.then(function() {
911
+ i(), a = !0;
803
912
  }), p.label = 1;
804
913
  case 1:
805
- p.trys.push([1, , 5, 7]), a = void 0, s = 0, f = function() {
806
- var c, d, h, y, m, T;
807
- return P(this, function(q) {
808
- switch (q.label) {
914
+ p.trys.push([1, , 5, 7]), l = void 0, s = 0, f = function() {
915
+ var u, d, h, y, b, z;
916
+ return j(this, function(k) {
917
+ switch (k.label) {
809
918
  case 0:
810
- c = s;
919
+ u = s;
811
920
  try {
812
- for (d = (m = void 0, _(e)), h = d.next(); !h.done; h = d.next())
813
- y = h.value, Promise.resolve(y.next()).then(function(w) {
814
- w.done ? (o(), l === void 0 && (l = w)) : s === c && (s++, i(w));
815
- }, function(w) {
816
- return o(w);
921
+ for (d = (b = void 0, _(e)), h = d.next(); !h.done; h = d.next())
922
+ y = h.value, Promise.resolve(y.next()).then(function(g) {
923
+ g.done ? (o(), c === void 0 && (c = g)) : s === u && (s++, i(g));
924
+ }, function(g) {
925
+ return o(g);
817
926
  });
818
- } catch (w) {
819
- m = { error: w };
927
+ } catch (g) {
928
+ b = { error: g };
820
929
  } finally {
821
930
  try {
822
- h && !h.done && (T = d.return) && T.call(d);
931
+ h && !h.done && (z = d.return) && z.call(d);
823
932
  } finally {
824
- if (m) throw m.error;
933
+ if (b) throw b.error;
825
934
  }
826
935
  }
827
- return [4, new Promise(function(w) {
828
- return i = w;
936
+ return [4, new Promise(function(g) {
937
+ return i = g;
829
938
  })];
830
939
  case 1:
831
- return a = q.sent(), a === void 0 ? [3, 3] : [4, r(a.value)];
940
+ return l = k.sent(), l === void 0 ? [3, 3] : [4, r(l.value)];
832
941
  case 2:
833
- q.sent(), q.label = 3;
942
+ k.sent(), k.label = 3;
834
943
  case 3:
835
944
  return [
836
945
  2
@@ -840,14 +949,14 @@ function ke(t) {
840
949
  });
841
950
  }, p.label = 2;
842
951
  case 2:
843
- return u ? [3, 4] : [5, f()];
952
+ return a ? [3, 4] : [5, f()];
844
953
  case 3:
845
954
  return p.sent(), [3, 2];
846
955
  case 4:
847
- return [2, l && l.value];
956
+ return [2, c && c.value];
848
957
  case 5:
849
- return o(), [4, Promise.race(e.map(function(c) {
850
- return c.return && c.return();
958
+ return o(), [4, Promise.race(e.map(function(u) {
959
+ return u.return && u.return();
851
960
  }))];
852
961
  case 6:
853
962
  return p.sent(), [
@@ -864,12 +973,12 @@ function ke(t) {
864
973
  });
865
974
  });
866
975
  }
867
- function Te(t) {
868
- var n = this, e = V(t, { yieldValues: !0 });
869
- return new k(function(r, o) {
976
+ function Fe(t) {
977
+ var n = this, e = N(t, { yieldValues: !0 });
978
+ return new R(function(r, o) {
870
979
  return G(n, void 0, void 0, function() {
871
- var i, u, l, a = this;
872
- return P(this, function(s) {
980
+ var i, a, c, l = this;
981
+ return j(this, function(s) {
873
982
  switch (s.label) {
874
983
  case 0:
875
984
  if (!e.length)
@@ -877,11 +986,11 @@ function Te(t) {
877
986
  2
878
987
  /*return*/
879
988
  ];
880
- i = [], u = !1, o.then(function() {
989
+ i = [], a = !1, o.then(function() {
881
990
  var f, p;
882
- u = !0;
991
+ a = !0;
883
992
  try {
884
- for (var c = _(i), d = c.next(); !d.done; d = c.next()) {
993
+ for (var u = _(i), d = u.next(); !d.done; d = u.next()) {
885
994
  var h = d.value;
886
995
  h();
887
996
  }
@@ -889,7 +998,7 @@ function Te(t) {
889
998
  f = { error: y };
890
999
  } finally {
891
1000
  try {
892
- d && !d.done && (p = c.return) && p.call(c);
1001
+ d && !d.done && (p = u.return) && p.call(u);
893
1002
  } finally {
894
1003
  if (f) throw f.error;
895
1004
  }
@@ -897,14 +1006,14 @@ function Te(t) {
897
1006
  }), s.label = 1;
898
1007
  case 1:
899
1008
  return s.trys.push([1, , 3, 4]), [4, Promise.all(e.map(function(f, p) {
900
- return G(a, void 0, void 0, function() {
901
- var c, d;
902
- return P(this, function(h) {
1009
+ return G(l, void 0, void 0, function() {
1010
+ var u, d;
1011
+ return j(this, function(h) {
903
1012
  switch (h.label) {
904
1013
  case 0:
905
1014
  h.trys.push([0, , 6, 9]), h.label = 1;
906
1015
  case 1:
907
- return u ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
1016
+ return a ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
908
1017
  return i[p](y);
909
1018
  }, function(y) {
910
1019
  return o(y);
@@ -912,10 +1021,10 @@ function Te(t) {
912
1021
  i[p] = y;
913
1022
  })]);
914
1023
  case 2:
915
- return c = h.sent(), c === void 0 ? [3, 4] : c.done ? (l = c, [
1024
+ return u = h.sent(), u === void 0 ? [3, 4] : u.done ? (c = u, [
916
1025
  2
917
1026
  /*return*/
918
- ]) : [4, r(c.value)];
1027
+ ]) : [4, r(u.value)];
919
1028
  case 3:
920
1029
  h.sent(), h.label = 4;
921
1030
  case 4:
@@ -941,7 +1050,7 @@ function Te(t) {
941
1050
  });
942
1051
  }))];
943
1052
  case 2:
944
- return s.sent(), [2, l && l.value];
1053
+ return s.sent(), [2, c && c.value];
945
1054
  case 3:
946
1055
  return o(), [
947
1056
  7
@@ -958,22 +1067,22 @@ function Te(t) {
958
1067
  });
959
1068
  }
960
1069
  function qe(t) {
961
- var n = this, e = V(t, { returnValues: !0 });
962
- return new k(function(r, o) {
1070
+ var n = this, e = N(t, { returnValues: !0 });
1071
+ return new R(function(r, o) {
963
1072
  return G(n, void 0, void 0, function() {
964
- var i, u, l, a;
965
- return P(this, function(s) {
1073
+ var i, a, c, l;
1074
+ return j(this, function(s) {
966
1075
  switch (s.label) {
967
1076
  case 0:
968
1077
  if (!e.length)
969
1078
  return o(), [2, []];
970
- u = !1, o.then(function() {
971
- i(), u = !0;
1079
+ a = !1, o.then(function() {
1080
+ i(), a = !0;
972
1081
  }), s.label = 1;
973
1082
  case 1:
974
1083
  s.trys.push([1, , 6, 8]), s.label = 2;
975
1084
  case 2:
976
- return u ? [3, 5] : (Promise.all(e.map(function(f) {
1085
+ return a ? [3, 5] : (Promise.all(e.map(function(f) {
977
1086
  return f.next();
978
1087
  })).then(function(f) {
979
1088
  return i(f);
@@ -983,14 +1092,14 @@ function qe(t) {
983
1092
  return i = f;
984
1093
  })]);
985
1094
  case 3:
986
- return l = s.sent(), l === void 0 ? [
1095
+ return c = s.sent(), c === void 0 ? [
987
1096
  2
988
1097
  /*return*/
989
- ] : (a = l.map(function(f) {
1098
+ ] : (l = c.map(function(f) {
990
1099
  return f.value;
991
- }), l.some(function(f) {
1100
+ }), c.some(function(f) {
992
1101
  return f.done;
993
- }) ? [2, a] : [4, r(a)]);
1102
+ }) ? [2, l] : [4, r(l)]);
994
1103
  case 4:
995
1104
  return s.sent(), [3, 2];
996
1105
  case 5:
@@ -1015,76 +1124,76 @@ function qe(t) {
1015
1124
  });
1016
1125
  }
1017
1126
  function De(t) {
1018
- var n = this, e = V(t, {
1127
+ var n = this, e = N(t, {
1019
1128
  yieldValues: !0,
1020
1129
  returnValues: !0
1021
1130
  });
1022
- return new k(function(r, o) {
1131
+ return new R(function(r, o) {
1023
1132
  return G(n, void 0, void 0, function() {
1024
- var i, u, l, a, s, f = this;
1025
- return P(this, function(p) {
1133
+ var i, a, c, l, s, f = this;
1134
+ return j(this, function(p) {
1026
1135
  switch (p.label) {
1027
1136
  case 0:
1028
1137
  if (!e.length)
1029
1138
  return o(), [2, []];
1030
- u = [], l = !1, o.then(function() {
1031
- var c, d;
1139
+ a = [], c = !1, o.then(function() {
1140
+ var u, d;
1032
1141
  i();
1033
1142
  try {
1034
- for (var h = _(u), y = h.next(); !y.done; y = h.next()) {
1035
- var m = y.value;
1036
- m();
1143
+ for (var h = _(a), y = h.next(); !y.done; y = h.next()) {
1144
+ var b = y.value;
1145
+ b();
1037
1146
  }
1038
- } catch (T) {
1039
- c = { error: T };
1147
+ } catch (z) {
1148
+ u = { error: z };
1040
1149
  } finally {
1041
1150
  try {
1042
1151
  y && !y.done && (d = h.return) && d.call(h);
1043
1152
  } finally {
1044
- if (c) throw c.error;
1153
+ if (u) throw u.error;
1045
1154
  }
1046
1155
  }
1047
- l = !0;
1156
+ c = !0;
1048
1157
  }), p.label = 1;
1049
1158
  case 1:
1050
- return p.trys.push([1, , 5, 7]), Promise.all(e.map(function(c) {
1051
- return c.next();
1052
- })).then(function(c) {
1053
- return i(c);
1054
- }, function(c) {
1055
- return o(c);
1056
- }), [4, new Promise(function(c) {
1057
- return i = c;
1159
+ return p.trys.push([1, , 5, 7]), Promise.all(e.map(function(u) {
1160
+ return u.next();
1161
+ })).then(function(u) {
1162
+ return i(u);
1163
+ }, function(u) {
1164
+ return o(u);
1165
+ }), [4, new Promise(function(u) {
1166
+ return i = u;
1058
1167
  })];
1059
1168
  case 2:
1060
- return a = p.sent(), a === void 0 ? [
1169
+ return l = p.sent(), l === void 0 ? [
1061
1170
  2
1062
1171
  /*return*/
1063
- ] : (s = a.map(function(c) {
1064
- return c.value;
1065
- }), a.every(function(c) {
1066
- return c.done;
1172
+ ] : (s = l.map(function(u) {
1173
+ return u.value;
1174
+ }), l.every(function(u) {
1175
+ return u.done;
1067
1176
  }) ? [2, s] : [4, r(s.slice())]);
1068
1177
  case 3:
1069
- return p.sent(), [4, Promise.all(e.map(function(c, d) {
1178
+ return p.sent(), [4, Promise.all(e.map(function(u, d) {
1070
1179
  return G(f, void 0, void 0, function() {
1071
1180
  var h;
1072
- return P(this, function(y) {
1181
+ return j(this, function(y) {
1073
1182
  switch (y.label) {
1074
1183
  case 0:
1075
- if (a[d].done)
1076
- return [2, a[d].value];
1184
+ if (l[d].done)
1185
+ return [2, l[d].value];
1077
1186
  y.label = 1;
1078
1187
  case 1:
1079
- return l ? [3, 4] : (Promise.resolve(c.next()).then(function(m) {
1080
- return u[d](m);
1081
- }, function(m) {
1082
- return o(m);
1083
- }), [4, new Promise(function(m) {
1084
- return u[d] = m;
1188
+ return c ? [3, 4] : (Promise.resolve(u.next()).then(function(b) {
1189
+ return a[d](b);
1190
+ }, function(b) {
1191
+ return o(b);
1192
+ }), [4, new Promise(function(b) {
1193
+ return a[d] = b;
1085
1194
  })]);
1086
1195
  case 2:
1087
- return h = y.sent(), h === void 0 ? [2, a[d].value] : h.done ? [2, h.value] : (s[d] = h.value, [4, r(s.slice())]);
1196
+ return h = y.sent(), h === void 0 ? [2, l[d].value] : h.done ? [2, h.value] : (s[d] = h.value, [4, r(s.slice())]);
1088
1197
  case 3:
1089
1198
  return y.sent(), [3, 1];
1090
1199
  case 4:
@@ -1099,8 +1208,8 @@ function De(t) {
1099
1208
  case 4:
1100
1209
  return [2, p.sent()];
1101
1210
  case 5:
1102
- return o(), [4, Promise.all(e.map(function(c) {
1103
- return c.return && c.return();
1211
+ return o(), [4, Promise.all(e.map(function(u) {
1212
+ return u.return && u.return();
1104
1213
  }))];
1105
1214
  case 6:
1106
1215
  return p.sent(), [
@@ -1117,36 +1226,36 @@ function De(t) {
1117
1226
  });
1118
1227
  });
1119
1228
  }
1120
- function Fe(t) {
1229
+ function Ae(t) {
1121
1230
  return typeof t == "string" ? t : t.url;
1122
1231
  }
1123
- function Ie(t, n, e, r) {
1232
+ function Ue(t, n, e, r) {
1124
1233
  const o = e[n];
1125
1234
  if (!(!o || !o.length))
1126
1235
  try {
1127
1236
  r[n] = t(r[n], o, !0, !1).newDocument;
1128
1237
  } catch (i) {
1129
- 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 be(i.message) : new ge(i.name + ": " + i.message) : i;
1238
+ 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 Pe(i.message) : new je(i.name + ": " + i.message) : i;
1130
1239
  }
1131
1240
  }
1132
- function Ae(t, n) {
1241
+ function Be(t, n) {
1133
1242
  try {
1134
1243
  return t.compile(n);
1135
1244
  } catch (e) {
1136
- throw new we(
1245
+ throw new ge(
1137
1246
  e instanceof Error ? e.message : void 0
1138
1247
  );
1139
1248
  }
1140
1249
  }
1141
- function Me(t, n, e) {
1250
+ function Ne(t, n, e) {
1142
1251
  t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
1143
1252
  (r) => n.includes(r)
1144
1253
  ));
1145
1254
  }
1146
- function Ne(t, n) {
1255
+ function Me(t, n) {
1147
1256
  return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
1148
1257
  }
1149
- class Ve extends me {
1258
+ class Ve extends be {
1150
1259
  /**
1151
1260
  * Wraps a Graffiti API instance to provide the synchronize methods.
1152
1261
  * The GraffitiSyncrhonize class rather than the Graffiti class
@@ -1188,7 +1297,7 @@ class Ve extends me {
1188
1297
  v(this, "patch", async (...e) => {
1189
1298
  const r = await this.graffiti.patch(...e), o = { ...r };
1190
1299
  for (const i of ["value", "channels", "allowed"])
1191
- Ie(await this.applyPatch, i, e[0], o);
1300
+ Ue(await this.applyPatch, i, e[0], o);
1192
1301
  return await this.synchronizeDispatch(
1193
1302
  {
1194
1303
  tombstone: !0,
@@ -1235,17 +1344,17 @@ class Ve extends me {
1235
1344
  })()), this.applyPatch_;
1236
1345
  }
1237
1346
  synchronize(e, r, o, i) {
1238
- const u = /* @__PURE__ */ new Set();
1239
- return new k(
1240
- async (a, s) => {
1241
- const f = Ae(await this.ajv, o), p = (c, d) => {
1242
- for (const h of [d, c])
1347
+ const a = /* @__PURE__ */ new Set();
1348
+ return new R(
1349
+ async (l, s) => {
1350
+ const f = Be(await this.ajv, o), p = (u, d) => {
1351
+ for (const h of [d, u])
1243
1352
  if (h != null && h.tombstone)
1244
- u.has(h.object.url) && a(h);
1245
- else if (h && e(h.object) && (this.options.omniscient || Ne(h.object, i))) {
1353
+ a.has(h.object.url) && l(h);
1354
+ else if (h && e(h.object) && (this.options.omniscient || Me(h.object, i))) {
1246
1355
  const y = { ...h.object };
1247
- if (this.options.omniscient || Me(y, r, i), f(y)) {
1248
- a({ object: y }), u.add(y.url);
1356
+ if (this.options.omniscient || Ne(y, r, i), f(y)) {
1357
+ l({ object: y }), a.add(y.url);
1249
1358
  break;
1250
1359
  }
1251
1360
  }
@@ -1269,10 +1378,10 @@ class Ve extends me {
1269
1378
  */
1270
1379
  synchronizeDiscover(...e) {
1271
1380
  const [r, o, i] = e;
1272
- function u(l) {
1273
- return l.channels.some((a) => r.includes(a));
1381
+ function a(c) {
1382
+ return c.channels.some((l) => r.includes(l));
1274
1383
  }
1275
- return this.synchronize(u, r, o, i);
1384
+ return this.synchronize(a, r, o, i);
1276
1385
  }
1277
1386
  /**
1278
1387
  * This method has the same signature as {@link get} but
@@ -1287,11 +1396,11 @@ class Ve extends me {
1287
1396
  * @group Synchronize Methods
1288
1397
  */
1289
1398
  synchronizeGet(...e) {
1290
- const [r, o, i] = e, u = Fe(r);
1291
- function l(a) {
1292
- return a.url === u;
1399
+ const [r, o, i] = e, a = Ae(r);
1400
+ function c(l) {
1401
+ return l.url === a;
1293
1402
  }
1294
- return this.synchronize(l, [], o, i);
1403
+ return this.synchronize(c, [], o, i);
1295
1404
  }
1296
1405
  /**
1297
1406
  * This method has the same signature as {@link recoverOrphans} but
@@ -1308,8 +1417,8 @@ class Ve extends me {
1308
1417
  */
1309
1418
  synchronizeRecoverOrphans(...e) {
1310
1419
  const [r, o] = e;
1311
- function i(u) {
1312
- return u.actor === o.actor && u.channels.length === 0;
1420
+ function i(a) {
1421
+ return a.actor === o.actor && a.channels.length === 0;
1313
1422
  }
1314
1423
  return this.synchronize(i, [], r, o);
1315
1424
  }
@@ -1337,10 +1446,10 @@ class Ve extends me {
1337
1446
  for (; ; ) {
1338
1447
  const o = await e.next();
1339
1448
  if (o.done) {
1340
- const { continue: i, cursor: u } = o.value;
1449
+ const { continue: i, cursor: a } = o.value;
1341
1450
  return {
1342
1451
  continue: () => r.objectStreamContinue(i()),
1343
- cursor: u
1452
+ cursor: a
1344
1453
  };
1345
1454
  }
1346
1455
  o.value.error || r.synchronizeDispatch(
@@ -1360,42 +1469,42 @@ class Ve extends me {
1360
1469
  }();
1361
1470
  }
1362
1471
  }
1363
- const Ue = {
1472
+ const We = {
1364
1473
  install(t, n) {
1365
- const e = n.graffiti, r = new Ve(e), o = M(void 0);
1474
+ const e = n.graffiti, r = new Ve(e), o = U(void 0);
1366
1475
  r.sessionEvents.addEventListener("initialized", async (i) => {
1367
- const u = i.detail;
1368
- if (u && u.error && console.error(u.error), u && u.href) {
1369
- const l = t.config.globalProperties.$router;
1370
- if (l) {
1371
- const a = l.options.history.base, s = new URL(u.href);
1372
- s.pathname.startsWith(a) && (s.pathname = s.pathname.slice(a.length)), await l.replace(s.pathname + s.search + s.hash);
1476
+ const a = i.detail;
1477
+ if (a && a.error && console.error(a.error), a && a.href) {
1478
+ const c = t.config.globalProperties.$router;
1479
+ if (c) {
1480
+ const l = c.options.history.base, s = new URL(a.href);
1481
+ s.pathname.startsWith(l) && (s.pathname = s.pathname.slice(l.length)), await c.replace(s.pathname + s.search + s.hash);
1373
1482
  }
1374
1483
  }
1375
1484
  o.value || (o.value = null);
1376
1485
  }), r.sessionEvents.addEventListener("login", (i) => {
1377
- const u = i.detail;
1378
- if (u.error) {
1379
- console.error("Error logging in:"), console.error(u.error);
1486
+ const a = i.detail;
1487
+ if (a.error) {
1488
+ console.error("Error logging in:"), console.error(a.error);
1380
1489
  return;
1381
1490
  } else
1382
- o.value = u.session;
1491
+ o.value = a.session;
1383
1492
  }), r.sessionEvents.addEventListener("logout", (i) => {
1384
- const u = i.detail;
1385
- u.error ? (console.error("Error logging out:"), console.error(u.error)) : o.value = null;
1386
- }), t.provide(Y, r), t.provide(Z, o), t.component("GraffitiDiscover", ae), t.component("GraffitiGet", ce), t.component("GraffitiRecoverOrphans", le), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
1493
+ const a = i.detail;
1494
+ a.error ? (console.error("Error logging out:"), console.error(a.error)) : o.value = null;
1495
+ }), t.provide(Y, r), t.provide(Z, o), t.component("GraffitiDiscover", ce), t.component("GraffitiGet", le), t.component("GraffitiRecoverOrphans", fe), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
1387
1496
  }
1388
- }, Le = ae, We = ce, Je = le;
1497
+ }, Je = ce, Ke = le, He = fe;
1389
1498
  export {
1390
- Le as GraffitiDiscover,
1391
- We as GraffitiGet,
1392
- Ue as GraffitiPlugin,
1393
- Je as GraffitiRecoverOrphans,
1394
- $e as useGraffiti,
1395
- je as useGraffitiDiscover,
1396
- Oe as useGraffitiGet,
1397
- Se as useGraffitiRecoverOrphans,
1499
+ Je as GraffitiDiscover,
1500
+ Ke as GraffitiGet,
1501
+ We as GraffitiPlugin,
1502
+ He as GraffitiRecoverOrphans,
1503
+ Le as useGraffiti,
1504
+ Ee as useGraffitiDiscover,
1505
+ Se as useGraffitiGet,
1506
+ Ge as useGraffitiRecoverOrphans,
1398
1507
  ee as useGraffitiSession,
1399
- N as useGraffitiSynchronize
1508
+ B as useGraffitiSynchronize
1400
1509
  };
1401
1510
  //# sourceMappingURL=plugin.mjs.map