@graffiti-garden/wrapper-vue 1.0.4 → 1.0.8

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,158 +1,823 @@
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 {
1
+ import { ref as S, onScopeDispose as _e, watch as H, toValue as j, defineComponent as R, toRef as k, renderSlot as X, unref as v, createElementVNode as m, toDisplayString as E, createElementBlock as b, openBlock as g, createCommentVNode as Ee, createTextVNode as Se, createVNode as F, Fragment as ve, renderList as ye } from "vue";
2
+ class T extends Error {
3
3
  constructor(n) {
4
- super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, pe.prototype);
4
+ super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, T.prototype);
5
5
  }
6
- }, Se = class ve extends Error {
6
+ }
7
+ class ze extends Error {
7
8
  constructor(n) {
8
- super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ve.prototype);
9
+ super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ze.prototype);
9
10
  }
10
- };
11
- function te(e) {
11
+ }
12
+ class Pe extends Error {
13
+ constructor(n) {
14
+ super(n), this.name = "GraffitiErrorCursorExpired", Object.setPrototypeOf(this, Pe.prototype);
15
+ }
16
+ }
17
+ function he(e) {
12
18
  return typeof e == "string" ? e : e.url;
13
19
  }
14
- function Ge(e, n) {
15
- return !Array.isArray(e.allowed) || typeof n?.actor == "string" && (e.actor === n.actor || e.allowed.includes(n.actor));
20
+ function Je(e, n) {
21
+ return (
22
+ // If there is no allowed list, the actor is allowed.
23
+ !Array.isArray(e.allowed) || // Otherwise...
24
+ typeof n?.actor == "string" && // The actor must be the creator of the object
25
+ (e.actor === n.actor || // Or be on the allowed list
26
+ e.allowed.includes(n.actor))
27
+ );
16
28
  }
17
- function ke(e, n, t) {
29
+ function Ke(e, n, t) {
18
30
  if (t === e.actor) return e;
19
- let o = e.allowed && t ? [t] : void 0, i = e.channels.filter((r) => n.includes(r));
20
- return { ...e, allowed: o, channels: i };
31
+ const r = e.allowed && t ? [t] : void 0, i = e.channels.filter((o) => n.includes(o));
32
+ return {
33
+ ...e,
34
+ allowed: r,
35
+ channels: i
36
+ };
37
+ }
38
+ let pe;
39
+ async function Qe(e) {
40
+ if (!pe) {
41
+ const { default: n } = await import("./ajv-D_HICdxS.mjs").then((t) => t.a);
42
+ pe = new n({ strict: !1 });
43
+ }
44
+ try {
45
+ return pe.compile(e);
46
+ } catch (n) {
47
+ throw new ze(
48
+ n instanceof Error ? n.message : String(n)
49
+ );
50
+ }
51
+ }
52
+ function w(e, n, t) {
53
+ function r(u, c) {
54
+ if (u._zod || Object.defineProperty(u, "_zod", {
55
+ value: {
56
+ def: c,
57
+ constr: s,
58
+ traits: /* @__PURE__ */ new Set()
59
+ },
60
+ enumerable: !1
61
+ }), u._zod.traits.has(e))
62
+ return;
63
+ u._zod.traits.add(e), n(u, c);
64
+ const a = s.prototype, f = Object.keys(a);
65
+ for (let d = 0; d < f.length; d++) {
66
+ const l = f[d];
67
+ l in u || (u[l] = a[l].bind(u));
68
+ }
69
+ }
70
+ const i = t?.Parent ?? Object;
71
+ class o extends i {
72
+ }
73
+ Object.defineProperty(o, "name", { value: e });
74
+ function s(u) {
75
+ var c;
76
+ const a = t?.Parent ? new o() : this;
77
+ r(a, u), (c = a._zod).deferred ?? (c.deferred = []);
78
+ for (const f of a._zod.deferred)
79
+ f();
80
+ return a;
81
+ }
82
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
83
+ value: (u) => t?.Parent && u instanceof t.Parent ? !0 : u?._zod?.traits?.has(e)
84
+ }), Object.defineProperty(s, "name", { value: e }), s;
85
+ }
86
+ class L extends Error {
87
+ constructor() {
88
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
89
+ }
90
+ }
91
+ const Ye = {};
92
+ function se(e) {
93
+ return Ye;
21
94
  }
22
- const I = {};
23
- function Ee(e) {
24
- if (!I.graffitiSession)
25
- I.graffitiSession = e;
95
+ function et(e, n) {
96
+ return typeof n == "bigint" ? n.toString() : n;
97
+ }
98
+ function tt(e) {
99
+ return {
100
+ get value() {
101
+ {
102
+ const n = e();
103
+ return Object.defineProperty(this, "value", { value: n }), n;
104
+ }
105
+ }
106
+ };
107
+ }
108
+ function nt(e) {
109
+ const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
110
+ return e.slice(n, t);
111
+ }
112
+ const xe = /* @__PURE__ */ Symbol("evaluating");
113
+ function W(e, n, t) {
114
+ let r;
115
+ Object.defineProperty(e, n, {
116
+ get() {
117
+ if (r !== xe)
118
+ return r === void 0 && (r = xe, r = t()), r;
119
+ },
120
+ set(i) {
121
+ Object.defineProperty(e, n, {
122
+ value: i
123
+ // configurable: true,
124
+ });
125
+ },
126
+ configurable: !0
127
+ });
128
+ }
129
+ const Ze = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
130
+ };
131
+ function rt(e) {
132
+ return typeof e == "object" && e !== null && !Array.isArray(e);
133
+ }
134
+ function ot(e, n, t) {
135
+ const r = new e._zod.constr(n ?? e._zod.def);
136
+ return (!n || t?.parent) && (r._zod.parent = e), r;
137
+ }
138
+ function J(e) {
139
+ return {};
140
+ }
141
+ function it(e) {
142
+ return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
143
+ }
144
+ const st = {
145
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
146
+ int32: [-2147483648, 2147483647],
147
+ uint32: [0, 4294967295],
148
+ float32: [-34028234663852886e22, 34028234663852886e22],
149
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
150
+ };
151
+ function Y(e, n = 0) {
152
+ if (e.aborted === !0)
153
+ return !0;
154
+ for (let t = n; t < e.issues.length; t++)
155
+ if (e.issues[t]?.continue !== !0)
156
+ return !0;
157
+ return !1;
158
+ }
159
+ function Ie(e, n) {
160
+ return n.map((t) => {
161
+ var r;
162
+ return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
163
+ });
164
+ }
165
+ function ee(e) {
166
+ return typeof e == "string" ? e : e?.message;
167
+ }
168
+ function ue(e, n, t) {
169
+ const r = { ...e, path: e.path ?? [] };
170
+ if (!e.message) {
171
+ const i = ee(e.inst?._zod.def?.error?.(e)) ?? ee(n?.error?.(e)) ?? ee(t.customError?.(e)) ?? ee(t.localeError?.(e)) ?? "Invalid input";
172
+ r.message = i;
173
+ }
174
+ return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
175
+ }
176
+ const Re = (e, n) => {
177
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
178
+ value: e._zod,
179
+ enumerable: !1
180
+ }), Object.defineProperty(e, "issues", {
181
+ value: n,
182
+ enumerable: !1
183
+ }), e.message = JSON.stringify(n, et, 2), Object.defineProperty(e, "toString", {
184
+ value: () => e.message,
185
+ enumerable: !1
186
+ });
187
+ }, ut = w("$ZodError", Re), ae = w("$ZodError", Re, { Parent: Error }), at = (e) => (n, t, r, i) => {
188
+ const o = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
189
+ if (s instanceof Promise)
190
+ throw new L();
191
+ if (s.issues.length) {
192
+ const u = new (i?.Err ?? e)(s.issues.map((c) => ue(c, o, se())));
193
+ throw Ze(u, i?.callee), u;
194
+ }
195
+ return s.value;
196
+ }, ct = /* @__PURE__ */ at(ae), lt = (e) => async (n, t, r, i) => {
197
+ const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
198
+ let s = n._zod.run({ value: t, issues: [] }, o);
199
+ if (s instanceof Promise && (s = await s), s.issues.length) {
200
+ const u = new (i?.Err ?? e)(s.issues.map((c) => ue(c, o, se())));
201
+ throw Ze(u, i?.callee), u;
202
+ }
203
+ return s.value;
204
+ }, ft = /* @__PURE__ */ lt(ae), dt = (e) => (n, t, r) => {
205
+ const i = r ? { ...r, async: !1 } : { async: !1 }, o = n._zod.run({ value: t, issues: [] }, i);
206
+ if (o instanceof Promise)
207
+ throw new L();
208
+ return o.issues.length ? {
209
+ success: !1,
210
+ error: new (e ?? ut)(o.issues.map((s) => ue(s, i, se())))
211
+ } : { success: !0, data: o.value };
212
+ }, Ce = /* @__PURE__ */ dt(ae), ht = (e) => async (n, t, r) => {
213
+ const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
214
+ let o = n._zod.run({ value: t, issues: [] }, i);
215
+ return o instanceof Promise && (o = await o), o.issues.length ? {
216
+ success: !1,
217
+ error: new e(o.issues.map((s) => ue(s, i, se())))
218
+ } : { success: !0, data: o.value };
219
+ }, De = /* @__PURE__ */ ht(ae), pt = (e) => {
220
+ const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
221
+ return new RegExp(`^${n}$`);
222
+ }, mt = /^-?\d+$/, vt = /^-?\d+(?:\.\d+)?$/, Ue = /* @__PURE__ */ w("$ZodCheck", (e, n) => {
223
+ var t;
224
+ e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
225
+ }), yt = {
226
+ number: "number",
227
+ bigint: "bigint",
228
+ object: "date"
229
+ }, bt = /* @__PURE__ */ w("$ZodCheckGreaterThan", (e, n) => {
230
+ Ue.init(e, n);
231
+ const t = yt[typeof n.value];
232
+ e._zod.onattach.push((r) => {
233
+ const i = r._zod.bag, o = (n.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
234
+ n.value > o && (n.inclusive ? i.minimum = n.value : i.exclusiveMinimum = n.value);
235
+ }), e._zod.check = (r) => {
236
+ (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
237
+ origin: t,
238
+ code: "too_small",
239
+ minimum: typeof n.value == "object" ? n.value.getTime() : n.value,
240
+ input: r.value,
241
+ inclusive: n.inclusive,
242
+ inst: e,
243
+ continue: !n.abort
244
+ });
245
+ };
246
+ }), gt = /* @__PURE__ */ w("$ZodCheckNumberFormat", (e, n) => {
247
+ Ue.init(e, n), n.format = n.format || "float64";
248
+ const t = n.format?.includes("int"), r = t ? "int" : "number", [i, o] = st[n.format];
249
+ e._zod.onattach.push((s) => {
250
+ const u = s._zod.bag;
251
+ u.format = n.format, u.minimum = i, u.maximum = o, t && (u.pattern = mt);
252
+ }), e._zod.check = (s) => {
253
+ const u = s.value;
254
+ if (t) {
255
+ if (!Number.isInteger(u)) {
256
+ s.issues.push({
257
+ expected: r,
258
+ format: n.format,
259
+ code: "invalid_type",
260
+ continue: !1,
261
+ input: u,
262
+ inst: e
263
+ });
264
+ return;
265
+ }
266
+ if (!Number.isSafeInteger(u)) {
267
+ u > 0 ? s.issues.push({
268
+ input: u,
269
+ code: "too_big",
270
+ maximum: Number.MAX_SAFE_INTEGER,
271
+ note: "Integers must be within the safe integer range.",
272
+ inst: e,
273
+ origin: r,
274
+ inclusive: !0,
275
+ continue: !n.abort
276
+ }) : s.issues.push({
277
+ input: u,
278
+ code: "too_small",
279
+ minimum: Number.MIN_SAFE_INTEGER,
280
+ note: "Integers must be within the safe integer range.",
281
+ inst: e,
282
+ origin: r,
283
+ inclusive: !0,
284
+ continue: !n.abort
285
+ });
286
+ return;
287
+ }
288
+ }
289
+ u < i && s.issues.push({
290
+ origin: "number",
291
+ input: u,
292
+ code: "too_small",
293
+ minimum: i,
294
+ inclusive: !0,
295
+ inst: e,
296
+ continue: !n.abort
297
+ }), u > o && s.issues.push({
298
+ origin: "number",
299
+ input: u,
300
+ code: "too_big",
301
+ maximum: o,
302
+ inclusive: !0,
303
+ inst: e,
304
+ continue: !n.abort
305
+ });
306
+ };
307
+ }), wt = {
308
+ major: 4,
309
+ minor: 3,
310
+ patch: 5
311
+ }, M = /* @__PURE__ */ w("$ZodType", (e, n) => {
312
+ var t;
313
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = wt;
314
+ const r = [...e._zod.def.checks ?? []];
315
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
316
+ for (const i of r)
317
+ for (const o of i._zod.onattach)
318
+ o(e);
319
+ if (r.length === 0)
320
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
321
+ e._zod.run = e._zod.parse;
322
+ });
323
+ else {
324
+ const i = (s, u, c) => {
325
+ let a = Y(s), f;
326
+ for (const d of u) {
327
+ if (d._zod.def.when) {
328
+ if (!d._zod.def.when(s))
329
+ continue;
330
+ } else if (a)
331
+ continue;
332
+ const l = s.issues.length, p = d._zod.check(s);
333
+ if (p instanceof Promise && c?.async === !1)
334
+ throw new L();
335
+ if (f || p instanceof Promise)
336
+ f = (f ?? Promise.resolve()).then(async () => {
337
+ await p, s.issues.length !== l && (a || (a = Y(s, l)));
338
+ });
339
+ else {
340
+ if (s.issues.length === l)
341
+ continue;
342
+ a || (a = Y(s, l));
343
+ }
344
+ }
345
+ return f ? f.then(() => s) : s;
346
+ }, o = (s, u, c) => {
347
+ if (Y(s))
348
+ return s.aborted = !0, s;
349
+ const a = i(u, r, c);
350
+ if (a instanceof Promise) {
351
+ if (c.async === !1)
352
+ throw new L();
353
+ return a.then((f) => e._zod.parse(f, c));
354
+ }
355
+ return e._zod.parse(a, c);
356
+ };
357
+ e._zod.run = (s, u) => {
358
+ if (u.skipChecks)
359
+ return e._zod.parse(s, u);
360
+ if (u.direction === "backward") {
361
+ const a = e._zod.parse({ value: s.value, issues: [] }, { ...u, skipChecks: !0 });
362
+ return a instanceof Promise ? a.then((f) => o(f, s, u)) : o(a, s, u);
363
+ }
364
+ const c = e._zod.parse(s, u);
365
+ if (c instanceof Promise) {
366
+ if (u.async === !1)
367
+ throw new L();
368
+ return c.then((a) => i(a, r, u));
369
+ }
370
+ return i(c, r, u);
371
+ };
372
+ }
373
+ W(e, "~standard", () => ({
374
+ validate: (i) => {
375
+ try {
376
+ const o = Ce(e, i);
377
+ return o.success ? { value: o.data } : { issues: o.error?.issues };
378
+ } catch {
379
+ return De(e, i).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
380
+ }
381
+ },
382
+ vendor: "zod",
383
+ version: 1
384
+ }));
385
+ }), _t = /* @__PURE__ */ w("$ZodString", (e, n) => {
386
+ M.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? pt(e._zod.bag), e._zod.parse = (t, r) => {
387
+ if (n.coerce)
388
+ try {
389
+ t.value = String(t.value);
390
+ } catch {
391
+ }
392
+ return typeof t.value == "string" || t.issues.push({
393
+ expected: "string",
394
+ code: "invalid_type",
395
+ input: t.value,
396
+ inst: e
397
+ }), t;
398
+ };
399
+ }), Fe = /* @__PURE__ */ w("$ZodNumber", (e, n) => {
400
+ M.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? vt, e._zod.parse = (t, r) => {
401
+ if (n.coerce)
402
+ try {
403
+ t.value = Number(t.value);
404
+ } catch {
405
+ }
406
+ const i = t.value;
407
+ if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
408
+ return t;
409
+ const o = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
410
+ return t.issues.push({
411
+ expected: "number",
412
+ code: "invalid_type",
413
+ input: i,
414
+ inst: e,
415
+ ...o ? { received: o } : {}
416
+ }), t;
417
+ };
418
+ }), zt = /* @__PURE__ */ w("$ZodNumberFormat", (e, n) => {
419
+ gt.init(e, n), Fe.init(e, n);
420
+ }), Pt = /* @__PURE__ */ w("$ZodUnknown", (e, n) => {
421
+ M.init(e, n), e._zod.parse = (t) => t;
422
+ });
423
+ function $e(e, n, t) {
424
+ e.issues.length && n.issues.push(...Ie(t, e.issues)), n.value[t] = e.value;
425
+ }
426
+ const jt = /* @__PURE__ */ w("$ZodArray", (e, n) => {
427
+ M.init(e, n), e._zod.parse = (t, r) => {
428
+ const i = t.value;
429
+ if (!Array.isArray(i))
430
+ return t.issues.push({
431
+ expected: "array",
432
+ code: "invalid_type",
433
+ input: i,
434
+ inst: e
435
+ }), t;
436
+ t.value = Array(i.length);
437
+ const o = [];
438
+ for (let s = 0; s < i.length; s++) {
439
+ const u = i[s], c = n.element._zod.run({
440
+ value: u,
441
+ issues: []
442
+ }, r);
443
+ c instanceof Promise ? o.push(c.then((a) => $e(a, t, s))) : $e(c, t, s);
444
+ }
445
+ return o.length ? Promise.all(o).then(() => t) : t;
446
+ };
447
+ });
448
+ function ne(e, n, t, r, i) {
449
+ if (e.issues.length) {
450
+ if (i && !(t in r))
451
+ return;
452
+ n.issues.push(...Ie(t, e.issues));
453
+ }
454
+ e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
455
+ }
456
+ function kt(e) {
457
+ const n = Object.keys(e.shape);
458
+ for (const r of n)
459
+ if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
460
+ throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
461
+ const t = it(e.shape);
462
+ return {
463
+ ...e,
464
+ keys: n,
465
+ keySet: new Set(n),
466
+ numKeys: n.length,
467
+ optionalKeys: new Set(t)
468
+ };
469
+ }
470
+ function Ot(e, n, t, r, i, o) {
471
+ const s = [], u = i.keySet, c = i.catchall._zod, a = c.def.type, f = c.optout === "optional";
472
+ for (const d in n) {
473
+ if (u.has(d))
474
+ continue;
475
+ if (a === "never") {
476
+ s.push(d);
477
+ continue;
478
+ }
479
+ const l = c.run({ value: n[d], issues: [] }, r);
480
+ l instanceof Promise ? e.push(l.then((p) => ne(p, t, d, n, f))) : ne(l, t, d, n, f);
481
+ }
482
+ return s.length && t.issues.push({
483
+ code: "unrecognized_keys",
484
+ keys: s,
485
+ input: n,
486
+ inst: o
487
+ }), e.length ? Promise.all(e).then(() => t) : t;
488
+ }
489
+ const Et = /* @__PURE__ */ w("$ZodObject", (e, n) => {
490
+ if (M.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
491
+ const u = n.shape;
492
+ Object.defineProperty(n, "shape", {
493
+ get: () => {
494
+ const c = { ...u };
495
+ return Object.defineProperty(n, "shape", {
496
+ value: c
497
+ }), c;
498
+ }
499
+ });
500
+ }
501
+ const r = tt(() => kt(n));
502
+ W(e._zod, "propValues", () => {
503
+ const u = n.shape, c = {};
504
+ for (const a in u) {
505
+ const f = u[a]._zod;
506
+ if (f.values) {
507
+ c[a] ?? (c[a] = /* @__PURE__ */ new Set());
508
+ for (const d of f.values)
509
+ c[a].add(d);
510
+ }
511
+ }
512
+ return c;
513
+ });
514
+ const i = rt, o = n.catchall;
515
+ let s;
516
+ e._zod.parse = (u, c) => {
517
+ s ?? (s = r.value);
518
+ const a = u.value;
519
+ if (!i(a))
520
+ return u.issues.push({
521
+ expected: "object",
522
+ code: "invalid_type",
523
+ input: a,
524
+ inst: e
525
+ }), u;
526
+ u.value = {};
527
+ const f = [], d = s.shape;
528
+ for (const l of s.keys) {
529
+ const p = d[l], h = p._zod.optout === "optional", y = p._zod.run({ value: a[l], issues: [] }, c);
530
+ y instanceof Promise ? f.push(y.then((_) => ne(_, u, l, a, h))) : ne(y, u, l, a, h);
531
+ }
532
+ return o ? Ot(f, a, u, c, r.value, e) : f.length ? Promise.all(f).then(() => u) : u;
533
+ };
534
+ });
535
+ function Ae(e, n) {
536
+ return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
537
+ }
538
+ const St = /* @__PURE__ */ w("$ZodOptional", (e, n) => {
539
+ M.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", W(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), W(e._zod, "pattern", () => {
540
+ const t = n.innerType._zod.pattern;
541
+ return t ? new RegExp(`^(${nt(t.source)})?$`) : void 0;
542
+ }), e._zod.parse = (t, r) => {
543
+ if (n.innerType._zod.optin === "optional") {
544
+ const i = n.innerType._zod.run(t, r);
545
+ return i instanceof Promise ? i.then((o) => Ae(o, t.value)) : Ae(i, t.value);
546
+ }
547
+ return t.value === void 0 ? t : n.innerType._zod.run(t, r);
548
+ };
549
+ });
550
+ var Te;
551
+ class xt {
552
+ constructor() {
553
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
554
+ }
555
+ add(n, ...t) {
556
+ const r = t[0];
557
+ return this._map.set(n, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, n), this;
558
+ }
559
+ clear() {
560
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
561
+ }
562
+ remove(n) {
563
+ const t = this._map.get(n);
564
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
565
+ }
566
+ get(n) {
567
+ const t = n._zod.parent;
568
+ if (t) {
569
+ const r = { ...this.get(t) ?? {} };
570
+ delete r.id;
571
+ const i = { ...r, ...this._map.get(n) };
572
+ return Object.keys(i).length ? i : void 0;
573
+ }
574
+ return this._map.get(n);
575
+ }
576
+ has(n) {
577
+ return this._map.has(n);
578
+ }
579
+ }
580
+ function $t() {
581
+ return new xt();
582
+ }
583
+ (Te = globalThis).__zod_globalRegistry ?? (Te.__zod_globalRegistry = $t());
584
+ // @__NO_SIDE_EFFECTS__
585
+ function At(e, n) {
586
+ return new e({
587
+ type: "string",
588
+ ...J()
589
+ });
590
+ }
591
+ // @__NO_SIDE_EFFECTS__
592
+ function Tt(e, n) {
593
+ return new e({
594
+ type: "number",
595
+ check: "number_format",
596
+ abort: !1,
597
+ format: "safeint",
598
+ ...J()
599
+ });
600
+ }
601
+ // @__NO_SIDE_EFFECTS__
602
+ function Gt(e) {
603
+ return new e({
604
+ type: "unknown"
605
+ });
606
+ }
607
+ // @__NO_SIDE_EFFECTS__
608
+ function Mt(e, n) {
609
+ return new bt({
610
+ check: "greater_than",
611
+ ...J(),
612
+ value: e,
613
+ inclusive: !0
614
+ });
615
+ }
616
+ // @__NO_SIDE_EFFECTS__
617
+ function Nt(e) {
618
+ return /* @__PURE__ */ Mt(0);
619
+ }
620
+ const C = /* @__PURE__ */ w("ZodMiniType", (e, n) => {
621
+ if (!e._zod)
622
+ throw new Error("Uninitialized schema in ZodMiniType.");
623
+ M.init(e, n), e.def = n, e.type = n.type, e.parse = (t, r) => ct(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Ce(e, t, r), e.parseAsync = async (t, r) => ft(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => De(e, t, r), e.check = (...t) => e.clone({
624
+ ...n,
625
+ checks: [
626
+ ...n.checks ?? [],
627
+ ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
628
+ ]
629
+ }, { parent: !0 }), e.with = e.check, e.clone = (t, r) => ot(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.apply = (t) => t(e);
630
+ }), Zt = /* @__PURE__ */ w("ZodMiniString", (e, n) => {
631
+ _t.init(e, n), C.init(e, n);
632
+ });
633
+ // @__NO_SIDE_EFFECTS__
634
+ function It(e) {
635
+ return /* @__PURE__ */ At(Zt);
636
+ }
637
+ const Rt = /* @__PURE__ */ w("ZodMiniNumber", (e, n) => {
638
+ Fe.init(e, n), C.init(e, n);
639
+ }), Ct = /* @__PURE__ */ w("ZodMiniNumberFormat", (e, n) => {
640
+ zt.init(e, n), Rt.init(e, n);
641
+ });
642
+ // @__NO_SIDE_EFFECTS__
643
+ function Dt(e) {
644
+ return /* @__PURE__ */ Tt(Ct);
645
+ }
646
+ const Ut = /* @__PURE__ */ w("ZodMiniUnknown", (e, n) => {
647
+ Pt.init(e, n), C.init(e, n);
648
+ });
649
+ // @__NO_SIDE_EFFECTS__
650
+ function Ft() {
651
+ return /* @__PURE__ */ Gt(Ut);
652
+ }
653
+ const Lt = /* @__PURE__ */ w("ZodMiniArray", (e, n) => {
654
+ jt.init(e, n), C.init(e, n);
655
+ });
656
+ // @__NO_SIDE_EFFECTS__
657
+ function Vt(e, n) {
658
+ return new Lt({
659
+ type: "array",
660
+ element: e,
661
+ ...J()
662
+ });
663
+ }
664
+ const qt = /* @__PURE__ */ w("ZodMiniObject", (e, n) => {
665
+ Et.init(e, n), C.init(e, n), W(e, "shape", () => n.shape);
666
+ });
667
+ // @__NO_SIDE_EFFECTS__
668
+ function Ht(e, n) {
669
+ return new qt({
670
+ type: "object",
671
+ shape: e,
672
+ catchall: /* @__PURE__ */ Ft(),
673
+ ...J()
674
+ });
675
+ }
676
+ const Wt = /* @__PURE__ */ w("ZodMiniOptional", (e, n) => {
677
+ St.init(e, n), C.init(e, n);
678
+ });
679
+ // @__NO_SIDE_EFFECTS__
680
+ function Ge(e) {
681
+ return new Wt({
682
+ type: "optional",
683
+ innerType: e
684
+ });
685
+ }
686
+ (/* @__PURE__ */ Dt()).check(/* @__PURE__ */ Nt());
687
+ const Z = {};
688
+ function Bt(e) {
689
+ if (!Z.graffitiSession)
690
+ Z.graffitiSession = e;
26
691
  else
27
692
  throw new Error(
28
693
  "Graffiti session already set - plugin installed multiple times?"
29
694
  );
30
695
  }
31
- function Oe(e) {
32
- if (!I.graffitiSynchronize)
33
- I.graffitiSynchronize = e;
696
+ function Xt(e) {
697
+ if (!Z.graffitiSynchronize)
698
+ Z.graffitiSynchronize = e;
34
699
  else
35
700
  throw new Error(
36
701
  "Graffiti synchronize already set - plugin installed multiple times?"
37
702
  );
38
703
  }
39
- function X() {
40
- const e = I.graffitiSynchronize;
704
+ function ce() {
705
+ const e = Z.graffitiSynchronize;
41
706
  if (!e)
42
707
  throw new Error(
43
708
  "No Graffiti instance provided, did you forget to install the plugin?"
44
709
  );
45
710
  return e;
46
711
  }
47
- function ae() {
48
- return X();
712
+ function je() {
713
+ return ce();
49
714
  }
50
- function ct() {
51
- const e = I.graffitiSession;
715
+ function $n() {
716
+ const e = Z.graffitiSession;
52
717
  if (!e)
53
718
  throw new Error(
54
719
  "No Graffiti session provided, did you forget to install the plugin?"
55
720
  );
56
721
  return e;
57
722
  }
58
- function Ae(e, n, t, o = !1) {
59
- const i = X(), r = /* @__PURE__ */ new Map(), s = k([]);
60
- let a = async () => {
723
+ function Jt(e, n, t, r = !1) {
724
+ const i = ce(), o = /* @__PURE__ */ new Map(), s = S([]);
725
+ let u = async () => {
61
726
  };
62
- const c = async () => a(), u = k(!0);
63
- let f, h;
64
- le(() => {
65
- f?.return(null), h?.return({
66
- continue: () => h,
727
+ const c = async () => u(), a = S(!0);
728
+ let f, d;
729
+ _e(() => {
730
+ f?.return(null), d?.return({
731
+ continue: () => d,
67
732
  cursor: ""
68
733
  });
69
734
  });
70
- const l = k(0);
71
- function y(d = 0) {
735
+ const l = S(0);
736
+ function p(h = 0) {
72
737
  setTimeout(() => {
73
738
  l.value++;
74
- }, d);
739
+ }, h);
75
740
  }
76
741
  return H(
77
742
  () => ({
78
- args: [P(e), P(n), P(t)],
743
+ args: [j(e), j(n), j(t)],
79
744
  refresh: l.value
80
745
  }),
81
- ({ args: d }, m, j) => {
82
- r.clear(), s.value = [], u.value = !0;
83
- const E = i.synchronizeDiscover(...d);
84
- f = E;
85
- let G, g = !0;
86
- j(() => {
87
- g = !1, E.return(null), G?.return({
88
- continue: () => h,
746
+ ({ args: h }, y, _) => {
747
+ o.clear(), s.value = [], a.value = !0;
748
+ const x = i.synchronizeDiscover(...h);
749
+ f = x;
750
+ let O, z = !0;
751
+ _(() => {
752
+ z = !1, x.return(null), O?.return({
753
+ continue: () => d,
89
754
  cursor: ""
90
755
  });
91
756
  });
92
- let L;
757
+ let U;
93
758
  (async () => {
94
- for await (const x of E) {
95
- if (!g) break;
96
- x.tombstone ? r.delete(x.object.url) : r.set(x.object.url, x.object), L || (L = new Promise((ee) => {
759
+ for await (const P of x) {
760
+ if (!z) break;
761
+ P.tombstone ? o.delete(P.object.url) : o.set(P.object.url, P.object), U || (U = new Promise((Q) => {
97
762
  setTimeout(() => {
98
- g && (s.value = Array.from(r.values())), L = void 0, ee();
763
+ z && (s.value = Array.from(o.values())), U = void 0, Q();
99
764
  }, 50);
100
765
  }));
101
766
  }
102
767
  })();
103
- let Z = !1, fe = () => i.discover(...d);
104
- a = async () => {
105
- if (!(Z || !g)) {
106
- Z = !0;
768
+ let de = !1, Oe = () => i.discover(...h);
769
+ u = async () => {
770
+ if (!(de || !z)) {
771
+ de = !0;
107
772
  try {
108
- G = fe(d[2]);
773
+ O = Oe(h[2]);
109
774
  } catch {
110
- return y(5e3);
775
+ return p(5e3);
111
776
  }
112
- if (g) {
113
- for (h = G; ; ) {
114
- let x;
777
+ if (z) {
778
+ for (d = O; ; ) {
779
+ let P;
115
780
  try {
116
- x = await G.next();
117
- } catch (ee) {
118
- return ee instanceof D ? y() : y(5e3);
781
+ P = await O.next();
782
+ } catch (Q) {
783
+ return Q instanceof Pe ? p() : (console.error("Fatal error in discover"), console.error(Q), p(5e3));
119
784
  }
120
- if (!g) return;
121
- if (x.done) {
122
- fe = x.value.continue;
785
+ if (!z) return;
786
+ if (P.done) {
787
+ Oe = P.value.continue;
123
788
  break;
124
- } else x.value.error && console.error(x.value.error);
789
+ } else P.value.error && console.error(P.value.error);
125
790
  }
126
- await new Promise((x) => setTimeout(x, 0)), L && await L, g && (Z = !1, u.value = !1, P(o) && c());
791
+ await new Promise((P) => setTimeout(P, 0)), U && await U, z && (de = !1, a.value = !1, j(r) && c());
127
792
  }
128
793
  }
129
794
  }, c();
130
795
  },
131
796
  { immediate: !0 }
132
797
  ), H(
133
- () => P(o),
134
- (d) => d && c()
798
+ () => j(r),
799
+ (h) => h && c()
135
800
  ), {
136
801
  objects: s,
137
802
  poll: c,
138
- isFirstPoll: u
803
+ isFirstPoll: a
139
804
  };
140
805
  }
141
- function me(e, n) {
142
- const t = k(void 0);
806
+ function Le(e, n) {
807
+ const t = S(void 0);
143
808
  return H(
144
- () => P(e),
145
- async (o, i, r) => {
809
+ () => j(e),
810
+ async (r, i, o) => {
146
811
  let s = !0;
147
- r(() => {
812
+ o(() => {
148
813
  s = !1;
149
814
  }), t.value = void 0;
150
815
  try {
151
- const a = await n(o);
152
- s && (t.value = a);
153
- } catch (a) {
816
+ const u = await n(r);
817
+ s && (t.value = u);
818
+ } catch (u) {
154
819
  if (!s) return;
155
- a instanceof D ? t.value = null : console.error(a);
820
+ t.value = null, u instanceof T || console.error(u);
156
821
  }
157
822
  },
158
823
  { immediate: !0 }
@@ -160,127 +825,122 @@ function me(e, n) {
160
825
  output: t
161
826
  };
162
827
  }
163
- function be(e) {
828
+ function Ve(e) {
164
829
  return e === void 0 ? "Loading..." : e === null ? "Not found" : e;
165
830
  }
166
- function Te(e) {
167
- const n = ae(), { output: t } = me(
831
+ function Kt(e) {
832
+ const n = je(), { output: t } = Le(
168
833
  e,
169
834
  n.actorToHandle.bind(n)
170
835
  );
171
836
  return { handle: t };
172
837
  }
173
- const W = /* @__PURE__ */ _({
838
+ const V = /* @__PURE__ */ R({
174
839
  __name: "ActorToHandle",
175
840
  props: {
176
841
  actor: {}
177
842
  },
178
843
  setup(e) {
179
- const t = S(e, "actor"), { handle: o } = Te(t);
180
- return (i, r) => N(i.$slots, "default", { handle: v(o) }, () => [
181
- p("span", null, O(v(be)(v(o))), 1)
844
+ const t = k(e, "actor"), { handle: r } = Kt(t);
845
+ return (i, o) => X(i.$slots, "default", { handle: v(r) }, () => [
846
+ m("span", null, E(v(Ve)(v(r))), 1)
182
847
  ]);
183
848
  }
184
- }), $e = ["data-url"], ze = { key: 0 }, De = { key: 1 }, Ie = { key: 0 }, Me = { key: 1 }, _e = { key: 0 }, Re = ["disabled"], Le = { key: 1 }, qe = { key: 2 }, K = /* @__PURE__ */ _({
849
+ }), Qt = ["data-url"], Yt = { key: 0 }, en = { key: 1 }, tn = { key: 0 }, nn = { key: 1 }, rn = ["disabled"], on = { key: 1 }, sn = { key: 2 }, le = /* @__PURE__ */ R({
185
850
  __name: "ObjectInfo",
186
851
  props: {
187
852
  object: {}
188
853
  },
189
854
  setup(e) {
190
- const n = ae(), t = k(!1);
191
- async function o(i, r) {
855
+ const n = je(), t = S(!1);
856
+ async function r(i, o) {
192
857
  t.value = !0, await new Promise((s) => setTimeout(s, 0)), confirm(
193
858
  "Are you sure you want to delete this object? It cannot be undone."
194
- ) && await n.delete(i, r), t.value = !1;
859
+ ) && await n.delete(i, o), t.value = !1;
195
860
  }
196
- return (i, r) => e.object ? (w(), b("article", {
861
+ return (i, o) => e.object ? (g(), b("article", {
197
862
  key: 0,
198
863
  "data-url": e.object.url
199
864
  }, [
200
- p("header", null, [
201
- r[4] || (r[4] = p("h2", null, "Graffiti Object", -1)),
202
- p("dl", null, [
203
- r[1] || (r[1] = p("dt", null, "Object URL", -1)),
204
- p("dd", null, [
205
- p("code", null, O(e.object.url), 1)
865
+ m("p", null, [
866
+ o[1] || (o[1] = Se("@", -1)),
867
+ F(V, {
868
+ actor: e.object.actor
869
+ }, null, 8, ["actor"]),
870
+ o[2] || (o[2] = Se(" posted:", -1))
871
+ ]),
872
+ m("pre", null, E(e.object.value), 1),
873
+ m("details", null, [
874
+ o[14] || (o[14] = m("summary", null, "Show object properties", -1)),
875
+ m("dl", null, [
876
+ o[8] || (o[8] = m("dt", null, "Object URL", -1)),
877
+ m("dd", null, [
878
+ m("code", null, E(e.object.url), 1)
206
879
  ]),
207
- r[2] || (r[2] = p("dt", null, "Actor", -1)),
208
- p("dd", null, [
209
- p("code", null, O(e.object.actor), 1)
880
+ o[9] || (o[9] = m("dt", null, "Actor", -1)),
881
+ m("dd", null, [
882
+ m("code", null, E(e.object.actor), 1)
210
883
  ]),
211
- r[3] || (r[3] = p("dt", null, "Handle", -1)),
212
- p("dd", null, [
213
- V(W, {
884
+ o[10] || (o[10] = m("dt", null, "Handle", -1)),
885
+ m("dd", null, [
886
+ F(V, {
214
887
  actor: e.object.actor
215
888
  }, null, 8, ["actor"])
216
- ])
217
- ])
218
- ]),
219
- p("section", null, [
220
- r[5] || (r[5] = p("h3", null, "Content", -1)),
221
- p("pre", null, O(e.object.value), 1)
222
- ]),
223
- p("section", null, [
224
- r[10] || (r[10] = p("h3", null, "Allowed Actors", -1)),
225
- Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (w(), b("p", De, [...r[7] || (r[7] = [
226
- p("em", null, "Noone", -1)
227
- ])])) : de("", !0) : (w(), b("p", ze, [...r[6] || (r[6] = [
228
- p("em", null, "Public", -1)
229
- ])])),
230
- p("ul", null, [
231
- (w(!0), b(re, null, oe(e.object.allowed, (s) => (w(), b("li", { key: s }, [
232
- p("dl", null, [
233
- r[8] || (r[8] = p("dt", null, "Actor", -1)),
234
- p("dd", null, [
235
- p("code", null, O(s), 1)
236
- ]),
237
- r[9] || (r[9] = p("dt", null, "Handle", -1)),
238
- p("dd", null, [
239
- V(W, { actor: s }, null, 8, ["actor"])
240
- ])
889
+ ]),
890
+ o[11] || (o[11] = m("dt", null, "Content", -1)),
891
+ m("dd", null, [
892
+ m("pre", null, E(e.object.value), 1)
893
+ ]),
894
+ o[12] || (o[12] = m("dt", null, "Allowed actors", -1)),
895
+ m("dd", null, [
896
+ Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (g(), b("p", en, [...o[4] || (o[4] = [
897
+ m("em", null, "No one is allowed (except you)", -1)
898
+ ])])) : Ee("", !0) : (g(), b("p", Yt, [...o[3] || (o[3] = [
899
+ m("em", null, "Public", -1)
900
+ ])])),
901
+ m("ul", null, [
902
+ (g(!0), b(ve, null, ye(e.object.allowed, (s) => (g(), b("li", { key: s }, [
903
+ m("dl", null, [
904
+ o[5] || (o[5] = m("dt", null, "Actor", -1)),
905
+ m("dd", null, [
906
+ m("code", null, E(s), 1)
907
+ ]),
908
+ o[6] || (o[6] = m("dt", null, "Handle", -1)),
909
+ m("dd", null, [
910
+ F(V, { actor: s }, null, 8, ["actor"])
911
+ ])
912
+ ])
913
+ ]))), 128))
241
914
  ])
242
- ]))), 128))
243
- ])
244
- ]),
245
- p("section", null, [
246
- r[12] || (r[12] = p("h3", null, "Channels", -1)),
247
- e.object.channels?.length ? (w(), b("ul", Ie, [
248
- (w(!0), b(re, null, oe(e.object.channels, (s) => (w(), b("li", { key: s }, [
249
- p("code", null, O(s), 1)
250
- ]))), 128))
251
- ])) : (w(), b("p", Me, [...r[11] || (r[11] = [
252
- p("em", null, "No channels", -1)
253
- ])]))
254
- ]),
255
- p("footer", null, [
256
- p("nav", null, [
257
- p("ul", null, [
258
- i.$graffitiSession.value?.actor === e.object.actor ? (w(), b("li", _e, [
259
- p("button", {
260
- disabled: t.value,
261
- onClick: r[0] || (r[0] = (s) => o(e.object, i.$graffitiSession.value))
262
- }, O(t.value ? "Deleting..." : "Delete"), 9, Re)
263
- ])) : de("", !0)
915
+ ]),
916
+ o[13] || (o[13] = m("dt", null, "Channels", -1)),
917
+ m("dd", null, [
918
+ e.object.channels?.length ? (g(), b("ul", tn, [
919
+ (g(!0), b(ve, null, ye(e.object.channels, (s) => (g(), b("li", { key: s }, [
920
+ m("code", null, E(s), 1)
921
+ ]))), 128))
922
+ ])) : (g(), b("p", nn, [...o[7] || (o[7] = [
923
+ m("em", null, "No channels", -1)
924
+ ])]))
264
925
  ])
265
926
  ])
266
- ])
267
- ], 8, $e)) : e.object === null ? (w(), b("article", Le, [...r[13] || (r[13] = [
268
- p("header", null, [
269
- p("h2", null, "Graffiti Object")
270
- ], -1),
271
- p("p", null, [
272
- p("em", null, "Object not found")
927
+ ]),
928
+ i.$graffitiSession.value?.actor === e.object.actor ? (g(), b("button", {
929
+ key: 0,
930
+ disabled: t.value,
931
+ onClick: o[0] || (o[0] = (s) => r(e.object, i.$graffitiSession.value))
932
+ }, E(t.value ? "Deleting..." : "Delete"), 9, rn)) : Ee("", !0)
933
+ ], 8, Qt)) : e.object === null ? (g(), b("article", on, [...o[15] || (o[15] = [
934
+ m("p", null, [
935
+ m("em", null, "Graffiti object not found")
273
936
  ], -1)
274
- ])])) : (w(), b("article", qe, [...r[14] || (r[14] = [
275
- p("header", null, [
276
- p("h2", null, "Graffiti Object")
277
- ], -1),
278
- p("p", null, [
279
- p("em", null, "Loading...")
937
+ ])])) : (g(), b("article", sn, [...o[16] || (o[16] = [
938
+ m("p", null, [
939
+ m("em", null, "Graffiti object loading...")
280
940
  ], -1)
281
941
  ])]));
282
942
  }
283
- }), He = { key: 0 }, Ce = { key: 1 }, we = /* @__PURE__ */ _({
943
+ }), un = { key: 0 }, an = { key: 1 }, qe = /* @__PURE__ */ R({
284
944
  __name: "Discover",
285
945
  props: {
286
946
  channels: {},
@@ -289,62 +949,62 @@ const W = /* @__PURE__ */ _({
289
949
  autopoll: { type: Boolean }
290
950
  },
291
951
  setup(e) {
292
- const n = e, { objects: t, poll: o, isFirstPoll: i } = Ae(
293
- S(n, "channels"),
294
- S(n, "schema"),
295
- S(n, "session"),
296
- S(n, "autopoll")
952
+ const n = e, { objects: t, poll: r, isFirstPoll: i } = Jt(
953
+ k(n, "channels"),
954
+ k(n, "schema"),
955
+ k(n, "session"),
956
+ k(n, "autopoll")
297
957
  );
298
- return (r, s) => N(r.$slots, "default", {
958
+ return (o, s) => X(o.$slots, "default", {
299
959
  objects: v(t),
300
- poll: v(o),
960
+ poll: v(r),
301
961
  isFirstPoll: v(i)
302
962
  }, () => [
303
- v(i) ? (w(), b("p", Ce, [...s[0] || (s[0] = [
304
- p("em", null, " Loading... ", -1)
305
- ])])) : (w(), b("ul", He, [
306
- (w(!0), b(re, null, oe(v(t), (a) => (w(), b("li", {
307
- key: a.url
963
+ v(i) ? (g(), b("p", an, [...s[0] || (s[0] = [
964
+ m("em", null, " Graffiti discover loading... ", -1)
965
+ ])])) : (g(), b("ul", un, [
966
+ (g(!0), b(ve, null, ye(v(t), (u) => (g(), b("li", {
967
+ key: u.url
308
968
  }, [
309
- V(K, { object: a }, null, 8, ["object"])
969
+ F(le, { object: u }, null, 8, ["object"])
310
970
  ]))), 128))
311
971
  ]))
312
972
  ]);
313
973
  }
314
974
  });
315
- function Ne(e, n, t) {
316
- const o = X(), i = k(void 0);
317
- let r = async () => {
975
+ function cn(e, n, t) {
976
+ const r = ce(), i = S(void 0);
977
+ let o = async () => {
318
978
  };
319
- const s = async () => r();
320
- let a;
321
- return le(() => {
322
- a?.return(null);
979
+ const s = async () => o();
980
+ let u;
981
+ return _e(() => {
982
+ u?.return(null);
323
983
  }), H(
324
- () => [P(e), P(n), P(t)],
325
- (c, u, f) => {
984
+ () => [j(e), j(n), j(t)],
985
+ (c, a, f) => {
326
986
  i.value = void 0;
327
- const h = o.synchronizeGet(...c);
328
- a = h;
987
+ const d = r.synchronizeGet(...c);
988
+ u = d;
329
989
  let l = !0;
330
990
  f(() => {
331
- l = !1, h.return(null);
991
+ l = !1, d.return(null);
332
992
  }), (async () => {
333
- for await (const d of h) {
993
+ for await (const h of d) {
334
994
  if (!l) return;
335
- d.tombstone ? i.value = null : i.value = d.object;
995
+ h.tombstone ? i.value = null : i.value = h.object;
336
996
  }
337
997
  })();
338
- let y = !1;
339
- r = async () => {
340
- if (!(y || !l)) {
341
- y = !0;
998
+ let p = !1;
999
+ o = async () => {
1000
+ if (!(p || !l)) {
1001
+ p = !0;
342
1002
  try {
343
- await o.get(...c);
344
- } catch (d) {
345
- d instanceof D || console.error(d);
1003
+ await r.get(...c);
1004
+ } catch (h) {
1005
+ h instanceof T || console.error(h);
346
1006
  }
347
- await new Promise((d) => setTimeout(d, 0)), y = !1;
1007
+ await new Promise((h) => setTimeout(h, 0)), p = !1;
348
1008
  }
349
1009
  }, s();
350
1010
  },
@@ -354,7 +1014,7 @@ function Ne(e, n, t) {
354
1014
  poll: s
355
1015
  };
356
1016
  }
357
- const ge = /* @__PURE__ */ _({
1017
+ const He = /* @__PURE__ */ R({
358
1018
  __name: "Get",
359
1019
  props: {
360
1020
  url: {},
@@ -362,69 +1022,69 @@ const ge = /* @__PURE__ */ _({
362
1022
  session: {}
363
1023
  },
364
1024
  setup(e) {
365
- const n = e, { object: t, poll: o } = Ne(
366
- S(n, "url"),
367
- S(n, "schema"),
368
- S(n, "session")
1025
+ const n = e, { object: t, poll: r } = cn(
1026
+ k(n, "url"),
1027
+ k(n, "schema"),
1028
+ k(n, "session")
369
1029
  );
370
- return (i, r) => N(i.$slots, "default", {
1030
+ return (i, o) => X(i.$slots, "default", {
371
1031
  object: v(t),
372
- poll: v(o)
1032
+ poll: v(r)
373
1033
  }, () => [
374
- V(K, { object: v(t) }, null, 8, ["object"])
1034
+ F(le, { object: v(t) }, null, 8, ["object"])
375
1035
  ]);
376
1036
  }
377
1037
  });
378
- function Ue(e, n, t) {
379
- const o = X(), i = k(
1038
+ function ln(e, n, t) {
1039
+ const r = ce(), i = S(
380
1040
  void 0
381
- ), r = k(0);
382
- let s = null, a = () => {
1041
+ ), o = S(0);
1042
+ let s = null, u = () => {
383
1043
  };
384
1044
  function c() {
385
- return s || (r.value++, s = new Promise((u) => {
386
- a = () => {
387
- s = null, u();
1045
+ return s || (o.value++, s = new Promise((a) => {
1046
+ u = () => {
1047
+ s = null, a();
388
1048
  };
389
1049
  }), s);
390
1050
  }
391
1051
  return H(
392
1052
  () => ({
393
- args: [P(e), P(n), P(t)],
394
- pollCounter: r.value
1053
+ args: [j(e), j(n), j(t)],
1054
+ pollCounter: o.value
395
1055
  }),
396
- async ({ args: u }, f, h) => {
1056
+ async ({ args: a }, f, d) => {
397
1057
  i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl), i.value = void 0;
398
1058
  let l = !0;
399
- h(() => {
1059
+ d(() => {
400
1060
  l = !1;
401
1061
  });
402
1062
  try {
403
- const { data: y, actor: d, allowed: m } = await o.getMedia(...u);
1063
+ const { data: p, actor: h, allowed: y } = await r.getMedia(...a);
404
1064
  if (!l) return;
405
- const j = URL.createObjectURL(y);
1065
+ const _ = URL.createObjectURL(p);
406
1066
  i.value = {
407
- data: y,
408
- dataUrl: j,
409
- actor: d,
410
- allowed: m
1067
+ data: p,
1068
+ dataUrl: _,
1069
+ actor: h,
1070
+ allowed: y
411
1071
  };
412
- } catch (y) {
1072
+ } catch (p) {
413
1073
  if (!l) return;
414
- y instanceof D ? i.value = null : console.error(y);
1074
+ p instanceof T ? i.value = null : console.error(p);
415
1075
  } finally {
416
- a();
1076
+ u();
417
1077
  }
418
1078
  },
419
1079
  { immediate: !0 }
420
- ), le(() => {
421
- a(), i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl);
1080
+ ), _e(() => {
1081
+ u(), i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl);
422
1082
  }), {
423
1083
  media: i,
424
1084
  poll: c
425
1085
  };
426
1086
  }
427
- const Be = ["src", "alt"], Ve = ["src", "alt"], We = ["src", "alt"], Fe = ["src", "alt"], Je = ["data", "alt"], Qe = { key: 6 }, Xe = { key: 7 }, je = /* @__PURE__ */ _({
1087
+ const fn = ["src", "alt"], dn = ["src", "alt"], hn = ["src", "alt"], pn = ["src", "alt"], mn = ["data", "alt"], vn = { key: 6 }, yn = { key: 7 }, We = /* @__PURE__ */ R({
428
1088
  __name: "GetMedia",
429
1089
  props: {
430
1090
  url: {},
@@ -432,229 +1092,229 @@ const Be = ["src", "alt"], Ve = ["src", "alt"], We = ["src", "alt"], Fe = ["src"
432
1092
  session: {}
433
1093
  },
434
1094
  setup(e) {
435
- const n = e, { media: t, poll: o } = Ue(
436
- S(n, "url"),
437
- S(n, "accept"),
438
- S(n, "session")
1095
+ const n = e, { media: t, poll: r } = ln(
1096
+ k(n, "url"),
1097
+ k(n, "accept"),
1098
+ k(n, "session")
439
1099
  );
440
1100
  function i() {
441
1101
  t.value && (window.location.href = t.value.dataUrl);
442
1102
  }
443
- return (r, s) => N(r.$slots, "default", {
1103
+ return (o, s) => X(o.$slots, "default", {
444
1104
  media: v(t),
445
- poll: v(o)
1105
+ poll: v(r)
446
1106
  }, () => [
447
- v(t)?.data.type.startsWith("image/") ? (w(), b("img", {
1107
+ v(t)?.data.type.startsWith("image/") ? (g(), b("img", {
448
1108
  key: 0,
449
1109
  src: v(t).dataUrl,
450
1110
  alt: `An image by ${v(t).actor}`
451
- }, null, 8, Be)) : v(t)?.data.type.startsWith("video/") ? (w(), b("video", {
1111
+ }, null, 8, fn)) : v(t)?.data.type.startsWith("video/") ? (g(), b("video", {
452
1112
  key: 1,
453
1113
  controls: "",
454
1114
  src: v(t).dataUrl,
455
1115
  alt: `A video by ${v(t).actor}`
456
- }, null, 8, Ve)) : v(t)?.data.type.startsWith("audio/") ? (w(), b("audio", {
1116
+ }, null, 8, dn)) : v(t)?.data.type.startsWith("audio/") ? (g(), b("audio", {
457
1117
  key: 2,
458
1118
  controls: "",
459
1119
  src: v(t).dataUrl,
460
1120
  alt: `Audio by ${v(t).actor}`
461
- }, null, 8, We)) : v(t)?.data.type === "text/html" ? (w(), b("iframe", {
1121
+ }, null, 8, hn)) : v(t)?.data.type === "text/html" ? (g(), b("iframe", {
462
1122
  key: 3,
463
1123
  src: v(t).dataUrl,
464
1124
  alt: `HTML by ${v(t).actor}`,
465
1125
  sandbox: ""
466
- }, null, 8, Fe)) : v(t)?.data.type.startsWith("application/pdf") ? (w(), b("object", {
1126
+ }, null, 8, pn)) : v(t)?.data.type.startsWith("application/pdf") ? (g(), b("object", {
467
1127
  key: 4,
468
1128
  data: v(t).dataUrl,
469
1129
  type: "application/pdf",
470
1130
  alt: `PDF by ${v(t).actor}`
471
- }, null, 8, Je)) : v(t) ? (w(), b("button", {
1131
+ }, null, 8, mn)) : v(t) ? (g(), b("button", {
472
1132
  key: 5,
473
1133
  onClick: i
474
- }, "Download")) : v(t) === null ? (w(), b("p", Qe, [...s[0] || (s[0] = [
475
- p("em", null, "Media not found", -1)
476
- ])])) : (w(), b("p", Xe, [...s[1] || (s[1] = [
477
- p("em", null, " Loading... ", -1)
1134
+ }, "Download media")) : v(t) === null ? (g(), b("p", vn, [...s[0] || (s[0] = [
1135
+ m("em", null, "Media not found", -1)
1136
+ ])])) : (g(), b("p", yn, [...s[1] || (s[1] = [
1137
+ m("em", null, " Media loading... ", -1)
478
1138
  ])]))
479
1139
  ]);
480
1140
  }
481
1141
  });
482
- function Ke(e) {
483
- const n = ae(), { output: t } = me(
1142
+ function bn(e) {
1143
+ const n = je(), { output: t } = Le(
484
1144
  e,
485
1145
  n.handleToActor.bind(n)
486
1146
  );
487
1147
  return { actor: t };
488
1148
  }
489
- const xe = /* @__PURE__ */ _({
1149
+ const Be = /* @__PURE__ */ R({
490
1150
  __name: "HandleToActor",
491
1151
  props: {
492
1152
  handle: {}
493
1153
  },
494
1154
  setup(e) {
495
- const t = S(e, "handle"), { actor: o } = Ke(t);
496
- return (i, r) => N(i.$slots, "default", { actor: v(o) }, () => [
497
- p("span", null, O(v(be)(v(o))), 1)
1155
+ const t = k(e, "handle"), { actor: r } = bn(t);
1156
+ return (i, o) => X(i.$slots, "default", { actor: v(r) }, () => [
1157
+ m("span", null, E(v(Ve)(v(r))), 1)
498
1158
  ]);
499
1159
  }
500
1160
  });
501
- var ie = function(e, n) {
502
- return ie = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, o) {
503
- t.__proto__ = o;
504
- } || function(t, o) {
505
- for (var i in o) o.hasOwnProperty(i) && (t[i] = o[i]);
506
- }, ie(e, n);
1161
+ var be = function(e, n) {
1162
+ return be = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
1163
+ t.__proto__ = r;
1164
+ } || function(t, r) {
1165
+ for (var i in r) r.hasOwnProperty(i) && (t[i] = r[i]);
1166
+ }, be(e, n);
507
1167
  };
508
- function Ye(e, n) {
509
- ie(e, n);
1168
+ function gn(e, n) {
1169
+ be(e, n);
510
1170
  function t() {
511
1171
  this.constructor = e;
512
1172
  }
513
1173
  e.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
514
1174
  }
515
- function M(e, n, t, o) {
516
- function i(r) {
517
- return r instanceof t ? r : new t(function(s) {
518
- s(r);
1175
+ function I(e, n, t, r) {
1176
+ function i(o) {
1177
+ return o instanceof t ? o : new t(function(s) {
1178
+ s(o);
519
1179
  });
520
1180
  }
521
- return new (t || (t = Promise))(function(r, s) {
522
- function a(f) {
1181
+ return new (t || (t = Promise))(function(o, s) {
1182
+ function u(f) {
523
1183
  try {
524
- u(o.next(f));
525
- } catch (h) {
526
- s(h);
1184
+ a(r.next(f));
1185
+ } catch (d) {
1186
+ s(d);
527
1187
  }
528
1188
  }
529
1189
  function c(f) {
530
1190
  try {
531
- u(o.throw(f));
532
- } catch (h) {
533
- s(h);
1191
+ a(r.throw(f));
1192
+ } catch (d) {
1193
+ s(d);
534
1194
  }
535
1195
  }
536
- function u(f) {
537
- f.done ? r(f.value) : i(f.value).then(a, c);
1196
+ function a(f) {
1197
+ f.done ? o(f.value) : i(f.value).then(u, c);
538
1198
  }
539
- u((o = o.apply(e, [])).next());
1199
+ a((r = r.apply(e, [])).next());
540
1200
  });
541
1201
  }
542
- function A(e, n) {
1202
+ function $(e, n) {
543
1203
  var t = { label: 0, sent: function() {
544
- if (r[0] & 1) throw r[1];
545
- return r[1];
546
- }, trys: [], ops: [] }, o, i, r, s;
547
- return s = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
1204
+ if (o[0] & 1) throw o[1];
1205
+ return o[1];
1206
+ }, trys: [], ops: [] }, r, i, o, s;
1207
+ return s = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
548
1208
  return this;
549
1209
  }), s;
550
- function a(u) {
1210
+ function u(a) {
551
1211
  return function(f) {
552
- return c([u, f]);
1212
+ return c([a, f]);
553
1213
  };
554
1214
  }
555
- function c(u) {
556
- if (o) throw new TypeError("Generator is already executing.");
1215
+ function c(a) {
1216
+ if (r) throw new TypeError("Generator is already executing.");
557
1217
  for (; t; ) try {
558
- 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;
559
- switch (i = 0, r && (u = [u[0] & 2, r.value]), u[0]) {
1218
+ if (r = 1, i && (o = a[0] & 2 ? i.return : a[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, a[1])).done) return o;
1219
+ switch (i = 0, o && (a = [a[0] & 2, o.value]), a[0]) {
560
1220
  case 0:
561
1221
  case 1:
562
- r = u;
1222
+ o = a;
563
1223
  break;
564
1224
  case 4:
565
- return t.label++, { value: u[1], done: !1 };
1225
+ return t.label++, { value: a[1], done: !1 };
566
1226
  case 5:
567
- t.label++, i = u[1], u = [0];
1227
+ t.label++, i = a[1], a = [0];
568
1228
  continue;
569
1229
  case 7:
570
- u = t.ops.pop(), t.trys.pop();
1230
+ a = t.ops.pop(), t.trys.pop();
571
1231
  continue;
572
1232
  default:
573
- if (r = t.trys, !(r = r.length > 0 && r[r.length - 1]) && (u[0] === 6 || u[0] === 2)) {
1233
+ if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (a[0] === 6 || a[0] === 2)) {
574
1234
  t = 0;
575
1235
  continue;
576
1236
  }
577
- if (u[0] === 3 && (!r || u[1] > r[0] && u[1] < r[3])) {
578
- t.label = u[1];
1237
+ if (a[0] === 3 && (!o || a[1] > o[0] && a[1] < o[3])) {
1238
+ t.label = a[1];
579
1239
  break;
580
1240
  }
581
- if (u[0] === 6 && t.label < r[1]) {
582
- t.label = r[1], r = u;
1241
+ if (a[0] === 6 && t.label < o[1]) {
1242
+ t.label = o[1], o = a;
583
1243
  break;
584
1244
  }
585
- if (r && t.label < r[2]) {
586
- t.label = r[2], t.ops.push(u);
1245
+ if (o && t.label < o[2]) {
1246
+ t.label = o[2], t.ops.push(a);
587
1247
  break;
588
1248
  }
589
- r[2] && t.ops.pop(), t.trys.pop();
1249
+ o[2] && t.ops.pop(), t.trys.pop();
590
1250
  continue;
591
1251
  }
592
- u = n.call(e, t);
1252
+ a = n.call(e, t);
593
1253
  } catch (f) {
594
- u = [6, f], i = 0;
1254
+ a = [6, f], i = 0;
595
1255
  } finally {
596
- o = r = 0;
1256
+ r = o = 0;
597
1257
  }
598
- if (u[0] & 5) throw u[1];
599
- return { value: u[0] ? u[1] : void 0, done: !0 };
1258
+ if (a[0] & 5) throw a[1];
1259
+ return { value: a[0] ? a[1] : void 0, done: !0 };
600
1260
  }
601
1261
  }
602
- function R(e) {
603
- var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n], o = 0;
1262
+ function D(e) {
1263
+ var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n], r = 0;
604
1264
  if (t) return t.call(e);
605
1265
  if (e && typeof e.length == "number") return {
606
1266
  next: function() {
607
- return e && o >= e.length && (e = void 0), { value: e && e[o++], done: !e };
1267
+ return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e };
608
1268
  }
609
1269
  };
610
1270
  throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
611
1271
  }
612
- function C(e) {
613
- return this instanceof C ? (this.v = e, this) : new C(e);
1272
+ function B(e) {
1273
+ return this instanceof B ? (this.v = e, this) : new B(e);
614
1274
  }
615
- function Ze(e, n, t) {
1275
+ function wn(e, n, t) {
616
1276
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
617
- var o = t.apply(e, n || []), i, r = [];
1277
+ var r = t.apply(e, n || []), i, o = [];
618
1278
  return i = {}, s("next"), s("throw"), s("return"), i[Symbol.asyncIterator] = function() {
619
1279
  return this;
620
1280
  }, i;
621
1281
  function s(l) {
622
- o[l] && (i[l] = function(y) {
623
- return new Promise(function(d, m) {
624
- r.push([l, y, d, m]) > 1 || a(l, y);
1282
+ r[l] && (i[l] = function(p) {
1283
+ return new Promise(function(h, y) {
1284
+ o.push([l, p, h, y]) > 1 || u(l, p);
625
1285
  });
626
1286
  });
627
1287
  }
628
- function a(l, y) {
1288
+ function u(l, p) {
629
1289
  try {
630
- c(o[l](y));
631
- } catch (d) {
632
- h(r[0][3], d);
1290
+ c(r[l](p));
1291
+ } catch (h) {
1292
+ d(o[0][3], h);
633
1293
  }
634
1294
  }
635
1295
  function c(l) {
636
- l.value instanceof C ? Promise.resolve(l.value.v).then(u, f) : h(r[0][2], l);
1296
+ l.value instanceof B ? Promise.resolve(l.value.v).then(a, f) : d(o[0][2], l);
637
1297
  }
638
- function u(l) {
639
- a("next", l);
1298
+ function a(l) {
1299
+ u("next", l);
640
1300
  }
641
1301
  function f(l) {
642
- a("throw", l);
1302
+ u("throw", l);
643
1303
  }
644
- function h(l, y) {
645
- l(y), r.shift(), r.length && a(r[0][0], r[0][1]);
1304
+ function d(l, p) {
1305
+ l(p), o.shift(), o.length && u(o[0][0], o[0][1]);
646
1306
  }
647
1307
  }
648
- var Pe = (
1308
+ var Xe = (
649
1309
  /** @class */
650
1310
  (function(e) {
651
- Ye(n, e);
1311
+ gn(n, e);
652
1312
  function n(t) {
653
- var o = e.call(this, t) || this;
654
- return Object.defineProperty(o, "name", {
1313
+ var r = e.call(this, t) || this;
1314
+ return Object.defineProperty(r, "name", {
655
1315
  value: "RepeaterOverflowError",
656
1316
  enumerable: !1
657
- }), 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;
1317
+ }), 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;
658
1318
  }
659
1319
  return n;
660
1320
  })(Error)
@@ -741,16 +1401,16 @@ var Pe = (
741
1401
  return this._q.shift();
742
1402
  }, e;
743
1403
  })();
744
- function se(e) {
745
- e != null && typeof e.then == "function" && e.then(Q, Q);
1404
+ function ge(e) {
1405
+ e != null && typeof e.then == "function" && e.then(ie, ie);
746
1406
  }
747
- var ne = 0, he = 1, $ = 2, F = 3, ue = 4, J = 1024, Q = function() {
1407
+ var me = 0, Me = 1, G = 2, re = 3, we = 4, oe = 1024, ie = function() {
748
1408
  };
749
- function z(e) {
750
- var n = e.err, t = Promise.resolve(e.execution).then(function(o) {
1409
+ function N(e) {
1410
+ var n = e.err, t = Promise.resolve(e.execution).then(function(r) {
751
1411
  if (n != null)
752
1412
  throw n;
753
- return o;
1413
+ return r;
754
1414
  });
755
1415
  return e.err = void 0, e.execution = t.then(function() {
756
1416
  }, function() {
@@ -758,33 +1418,33 @@ function z(e) {
758
1418
  return t;
759
1419
  });
760
1420
  }
761
- function T(e, n) {
762
- var t = e.state >= F;
763
- return Promise.resolve(n).then(function(o) {
764
- return !t && e.state >= ue ? z(e).then(function(i) {
1421
+ function A(e, n) {
1422
+ var t = e.state >= re;
1423
+ return Promise.resolve(n).then(function(r) {
1424
+ return !t && e.state >= we ? N(e).then(function(i) {
765
1425
  return {
766
1426
  value: i,
767
1427
  done: !0
768
1428
  };
769
- }) : { value: o, done: t };
1429
+ }) : { value: r, done: t };
770
1430
  });
771
1431
  }
772
- function ce(e, n) {
773
- var t, o;
774
- if (!(e.state >= $))
775
- if (e.state = $, e.onnext(), e.onstop(), e.err == null && (e.err = n), e.pushes.length === 0 && (typeof e.buffer > "u" || e.buffer.empty))
1432
+ function ke(e, n) {
1433
+ var t, r;
1434
+ if (!(e.state >= G))
1435
+ if (e.state = G, e.onnext(), e.onstop(), e.err == null && (e.err = n), e.pushes.length === 0 && (typeof e.buffer > "u" || e.buffer.empty))
776
1436
  q(e);
777
1437
  else
778
1438
  try {
779
- for (var i = R(e.pushes), r = i.next(); !r.done; r = i.next()) {
780
- var s = r.value;
1439
+ for (var i = D(e.pushes), o = i.next(); !o.done; o = i.next()) {
1440
+ var s = o.value;
781
1441
  s.resolve();
782
1442
  }
783
- } catch (a) {
784
- t = { error: a };
1443
+ } catch (u) {
1444
+ t = { error: u };
785
1445
  } finally {
786
1446
  try {
787
- r && !r.done && (o = i.return) && o.call(i);
1447
+ o && !o.done && (r = i.return) && r.call(i);
788
1448
  } finally {
789
1449
  if (t) throw t.error;
790
1450
  }
@@ -792,20 +1452,20 @@ function ce(e, n) {
792
1452
  }
793
1453
  function q(e) {
794
1454
  var n, t;
795
- if (!(e.state >= F)) {
796
- e.state < $ && ce(e), e.state = F, e.buffer = void 0;
1455
+ if (!(e.state >= re)) {
1456
+ e.state < G && ke(e), e.state = re, e.buffer = void 0;
797
1457
  try {
798
- for (var o = R(e.nexts), i = o.next(); !i.done; i = o.next()) {
799
- var r = i.value, s = e.pending === void 0 ? z(e) : e.pending.then(function() {
800
- return z(e);
1458
+ for (var r = D(e.nexts), i = r.next(); !i.done; i = r.next()) {
1459
+ var o = i.value, s = e.pending === void 0 ? N(e) : e.pending.then(function() {
1460
+ return N(e);
801
1461
  });
802
- r.resolve(T(e, s));
1462
+ o.resolve(A(e, s));
803
1463
  }
804
- } catch (a) {
805
- n = { error: a };
1464
+ } catch (u) {
1465
+ n = { error: u };
806
1466
  } finally {
807
1467
  try {
808
- i && !i.done && (t = o.return) && t.call(o);
1468
+ i && !i.done && (t = r.return) && t.call(r);
809
1469
  } finally {
810
1470
  if (n) throw n.error;
811
1471
  }
@@ -813,131 +1473,131 @@ function q(e) {
813
1473
  e.pushes = [], e.nexts = [];
814
1474
  }
815
1475
  }
816
- function ye(e) {
817
- e.state >= ue || (e.state < F && q(e), e.state = ue);
1476
+ function Ne(e) {
1477
+ e.state >= we || (e.state < re && q(e), e.state = we);
818
1478
  }
819
- function et(e, n) {
820
- if (se(n), e.pushes.length >= J)
821
- throw new Pe("No more than " + J + " pending calls to push are allowed on a single repeater.");
822
- if (e.state >= $)
1479
+ function _n(e, n) {
1480
+ if (ge(n), e.pushes.length >= oe)
1481
+ throw new Xe("No more than " + oe + " pending calls to push are allowed on a single repeater.");
1482
+ if (e.state >= G)
823
1483
  return Promise.resolve(void 0);
824
1484
  var t = e.pending === void 0 ? Promise.resolve(n) : e.pending.then(function() {
825
1485
  return n;
826
1486
  });
827
1487
  t = t.catch(function(c) {
828
- e.state < $ && (e.err = c), ye(e);
1488
+ e.state < G && (e.err = c), Ne(e);
829
1489
  });
830
- var o;
1490
+ var r;
831
1491
  if (e.nexts.length) {
832
1492
  var i = e.nexts.shift();
833
- 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) {
1493
+ i.resolve(A(e, t)), e.nexts.length ? r = Promise.resolve(e.nexts[0].value) : typeof e.buffer < "u" && !e.buffer.full ? r = Promise.resolve(void 0) : r = new Promise(function(c) {
834
1494
  return e.onnext = c;
835
1495
  });
836
- } else typeof e.buffer < "u" && !e.buffer.full ? (e.buffer.add(t), o = Promise.resolve(void 0)) : o = new Promise(function(c) {
1496
+ } else typeof e.buffer < "u" && !e.buffer.full ? (e.buffer.add(t), r = Promise.resolve(void 0)) : r = new Promise(function(c) {
837
1497
  return e.pushes.push({ resolve: c, value: t });
838
1498
  });
839
- var r = !0, s = {}, a = o.catch(function(c) {
840
- if (r)
1499
+ var o = !0, s = {}, u = r.catch(function(c) {
1500
+ if (o)
841
1501
  throw c;
842
1502
  });
843
- return s.then = function(c, u) {
844
- return r = !1, Promise.prototype.then.call(o, c, u);
1503
+ return s.then = function(c, a) {
1504
+ return o = !1, Promise.prototype.then.call(r, c, a);
845
1505
  }, s.catch = function(c) {
846
- return r = !1, Promise.prototype.catch.call(o, c);
847
- }, s.finally = o.finally.bind(o), e.pending = t.then(function() {
848
- return a;
1506
+ return o = !1, Promise.prototype.catch.call(r, c);
1507
+ }, s.finally = r.finally.bind(r), e.pending = t.then(function() {
1508
+ return u;
849
1509
  }).catch(function(c) {
850
- e.err = c, ye(e);
1510
+ e.err = c, Ne(e);
851
1511
  }), s;
852
1512
  }
853
- function tt(e) {
854
- var n = ce.bind(null, e), t = new Promise(function(o) {
855
- return e.onstop = o;
1513
+ function zn(e) {
1514
+ var n = ke.bind(null, e), t = new Promise(function(r) {
1515
+ return e.onstop = r;
856
1516
  });
857
1517
  return n.then = t.then.bind(t), n.catch = t.catch.bind(t), n.finally = t.finally.bind(t), n;
858
1518
  }
859
- function nt(e) {
860
- if (!(e.state >= he)) {
861
- e.state = he;
862
- var n = et.bind(null, e), t = tt(e);
863
- e.execution = new Promise(function(o) {
864
- return o(e.executor(n, t));
1519
+ function Pn(e) {
1520
+ if (!(e.state >= Me)) {
1521
+ e.state = Me;
1522
+ var n = _n.bind(null, e), t = zn(e);
1523
+ e.execution = new Promise(function(r) {
1524
+ return r(e.executor(n, t));
865
1525
  }), e.execution.catch(function() {
866
- return ce(e);
1526
+ return ke(e);
867
1527
  });
868
1528
  }
869
1529
  }
870
- var B = /* @__PURE__ */ new WeakMap(), U = (
1530
+ var te = /* @__PURE__ */ new WeakMap(), K = (
871
1531
  /** @class */
872
1532
  (function() {
873
1533
  function e(n, t) {
874
- B.set(this, {
1534
+ te.set(this, {
875
1535
  executor: n,
876
1536
  buffer: t,
877
1537
  err: void 0,
878
- state: ne,
1538
+ state: me,
879
1539
  pushes: [],
880
1540
  nexts: [],
881
1541
  pending: void 0,
882
1542
  execution: void 0,
883
- onnext: Q,
884
- onstop: Q
1543
+ onnext: ie,
1544
+ onstop: ie
885
1545
  });
886
1546
  }
887
1547
  return e.prototype.next = function(n) {
888
- se(n);
889
- var t = B.get(this);
1548
+ ge(n);
1549
+ var t = te.get(this);
890
1550
  if (t === void 0)
891
1551
  throw new Error("WeakMap error");
892
- if (t.nexts.length >= J)
893
- throw new Pe("No more than " + J + " pending calls to next are allowed on a single repeater.");
894
- if (t.state <= ne && nt(t), t.onnext(n), typeof t.buffer < "u" && !t.buffer.empty) {
895
- var o = T(t, t.buffer.remove());
1552
+ if (t.nexts.length >= oe)
1553
+ throw new Xe("No more than " + oe + " pending calls to next are allowed on a single repeater.");
1554
+ if (t.state <= me && Pn(t), t.onnext(n), typeof t.buffer < "u" && !t.buffer.empty) {
1555
+ var r = A(t, t.buffer.remove());
896
1556
  if (t.pushes.length) {
897
1557
  var i = t.pushes.shift();
898
1558
  t.buffer.add(i.value), t.onnext = i.resolve;
899
1559
  }
900
- return o;
1560
+ return r;
901
1561
  } else if (t.pushes.length) {
902
- var r = t.pushes.shift();
903
- return t.onnext = r.resolve, T(t, r.value);
904
- } else if (t.state >= $)
905
- return q(t), T(t, z(t));
1562
+ var o = t.pushes.shift();
1563
+ return t.onnext = o.resolve, A(t, o.value);
1564
+ } else if (t.state >= G)
1565
+ return q(t), A(t, N(t));
906
1566
  return new Promise(function(s) {
907
1567
  return t.nexts.push({ resolve: s, value: n });
908
1568
  });
909
1569
  }, e.prototype.return = function(n) {
910
- se(n);
911
- var t = B.get(this);
1570
+ ge(n);
1571
+ var t = te.get(this);
912
1572
  if (t === void 0)
913
1573
  throw new Error("WeakMap error");
914
1574
  return q(t), t.execution = Promise.resolve(t.execution).then(function() {
915
1575
  return n;
916
- }), T(t, z(t));
1576
+ }), A(t, N(t));
917
1577
  }, e.prototype.throw = function(n) {
918
- var t = B.get(this);
1578
+ var t = te.get(this);
919
1579
  if (t === void 0)
920
1580
  throw new Error("WeakMap error");
921
- return t.state <= ne || t.state >= $ || typeof t.buffer < "u" && !t.buffer.empty ? (q(t), t.err == null && (t.err = n), T(t, z(t))) : this.next(Promise.reject(n));
1581
+ return t.state <= me || t.state >= G || typeof t.buffer < "u" && !t.buffer.empty ? (q(t), t.err == null && (t.err = n), A(t, N(t))) : this.next(Promise.reject(n));
922
1582
  }, e.prototype[Symbol.asyncIterator] = function() {
923
1583
  return this;
924
- }, e.race = rt, e.merge = ot, e.zip = it, e.latest = st, e;
1584
+ }, e.race = jn, e.merge = kn, e.zip = On, e.latest = En, e;
925
1585
  })()
926
1586
  );
927
- function Y(e, n) {
928
- var t, o, i = [], r = function(u) {
929
- 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() {
930
- return Ze(this, arguments, function() {
931
- return A(this, function(l) {
1587
+ function fe(e, n) {
1588
+ var t, r, i = [], o = function(a) {
1589
+ a != null && typeof a[Symbol.asyncIterator] == "function" ? i.push(a[Symbol.asyncIterator]()) : a != null && typeof a[Symbol.iterator] == "function" ? i.push(a[Symbol.iterator]()) : i.push((function() {
1590
+ return wn(this, arguments, function() {
1591
+ return $(this, function(l) {
932
1592
  switch (l.label) {
933
1593
  case 0:
934
- return n.yieldValues ? [4, C(u)] : [3, 3];
1594
+ return n.yieldValues ? [4, B(a)] : [3, 3];
935
1595
  case 1:
936
1596
  return [4, l.sent()];
937
1597
  case 2:
938
1598
  l.sent(), l.label = 3;
939
1599
  case 3:
940
- return n.returnValues ? [4, C(u)] : [3, 5];
1600
+ return n.returnValues ? [4, B(a)] : [3, 5];
941
1601
  case 4:
942
1602
  return [2, l.sent()];
943
1603
  case 5:
@@ -951,28 +1611,28 @@ function Y(e, n) {
951
1611
  })());
952
1612
  };
953
1613
  try {
954
- for (var s = R(e), a = s.next(); !a.done; a = s.next()) {
955
- var c = a.value;
956
- r(c);
1614
+ for (var s = D(e), u = s.next(); !u.done; u = s.next()) {
1615
+ var c = u.value;
1616
+ o(c);
957
1617
  }
958
- } catch (u) {
959
- t = { error: u };
1618
+ } catch (a) {
1619
+ t = { error: a };
960
1620
  } finally {
961
1621
  try {
962
- a && !a.done && (o = s.return) && o.call(s);
1622
+ u && !u.done && (r = s.return) && r.call(s);
963
1623
  } finally {
964
1624
  if (t) throw t.error;
965
1625
  }
966
1626
  }
967
1627
  return i;
968
1628
  }
969
- function rt(e) {
970
- var n = this, t = Y(e, { returnValues: !0 });
971
- return new U(function(o, i) {
972
- return M(n, void 0, void 0, function() {
973
- var r, s, a, c, u, f;
974
- return A(this, function(h) {
975
- switch (h.label) {
1629
+ function jn(e) {
1630
+ var n = this, t = fe(e, { returnValues: !0 });
1631
+ return new K(function(r, i) {
1632
+ return I(n, void 0, void 0, function() {
1633
+ var o, s, u, c, a, f;
1634
+ return $(this, function(d) {
1635
+ switch (d.label) {
976
1636
  case 0:
977
1637
  if (!t.length)
978
1638
  return i(), [
@@ -980,38 +1640,38 @@ function rt(e) {
980
1640
  /*return*/
981
1641
  ];
982
1642
  s = !1, i.then(function() {
983
- r(), s = !0;
984
- }), h.label = 1;
1643
+ o(), s = !0;
1644
+ }), d.label = 1;
985
1645
  case 1:
986
- h.trys.push([1, , 5, 7]), c = void 0, u = 0, f = function() {
987
- var l, y, d, m, j, E;
988
- return A(this, function(G) {
989
- switch (G.label) {
1646
+ d.trys.push([1, , 5, 7]), c = void 0, a = 0, f = function() {
1647
+ var l, p, h, y, _, x;
1648
+ return $(this, function(O) {
1649
+ switch (O.label) {
990
1650
  case 0:
991
- l = u;
1651
+ l = a;
992
1652
  try {
993
- for (y = (j = void 0, R(t)), d = y.next(); !d.done; d = y.next())
994
- m = d.value, Promise.resolve(m.next()).then(function(g) {
995
- g.done ? (i(), a === void 0 && (a = g)) : u === l && (u++, r(g));
996
- }, function(g) {
997
- return i(g);
1653
+ for (p = (_ = void 0, D(t)), h = p.next(); !h.done; h = p.next())
1654
+ y = h.value, Promise.resolve(y.next()).then(function(z) {
1655
+ z.done ? (i(), u === void 0 && (u = z)) : a === l && (a++, o(z));
1656
+ }, function(z) {
1657
+ return i(z);
998
1658
  });
999
- } catch (g) {
1000
- j = { error: g };
1659
+ } catch (z) {
1660
+ _ = { error: z };
1001
1661
  } finally {
1002
1662
  try {
1003
- d && !d.done && (E = y.return) && E.call(y);
1663
+ h && !h.done && (x = p.return) && x.call(p);
1004
1664
  } finally {
1005
- if (j) throw j.error;
1665
+ if (_) throw _.error;
1006
1666
  }
1007
1667
  }
1008
- return [4, new Promise(function(g) {
1009
- return r = g;
1668
+ return [4, new Promise(function(z) {
1669
+ return o = z;
1010
1670
  })];
1011
1671
  case 1:
1012
- return c = G.sent(), c === void 0 ? [3, 3] : [4, o(c.value)];
1672
+ return c = O.sent(), c === void 0 ? [3, 3] : [4, r(c.value)];
1013
1673
  case 2:
1014
- G.sent(), G.label = 3;
1674
+ O.sent(), O.label = 3;
1015
1675
  case 3:
1016
1676
  return [
1017
1677
  2
@@ -1019,19 +1679,19 @@ function rt(e) {
1019
1679
  ];
1020
1680
  }
1021
1681
  });
1022
- }, h.label = 2;
1682
+ }, d.label = 2;
1023
1683
  case 2:
1024
1684
  return s ? [3, 4] : [5, f()];
1025
1685
  case 3:
1026
- return h.sent(), [3, 2];
1686
+ return d.sent(), [3, 2];
1027
1687
  case 4:
1028
- return [2, a && a.value];
1688
+ return [2, u && u.value];
1029
1689
  case 5:
1030
1690
  return i(), [4, Promise.race(t.map(function(l) {
1031
1691
  return l.return && l.return();
1032
1692
  }))];
1033
1693
  case 6:
1034
- return h.sent(), [
1694
+ return d.sent(), [
1035
1695
  7
1036
1696
  /*endfinally*/
1037
1697
  ];
@@ -1045,68 +1705,68 @@ function rt(e) {
1045
1705
  });
1046
1706
  });
1047
1707
  }
1048
- function ot(e) {
1049
- var n = this, t = Y(e, { yieldValues: !0 });
1050
- return new U(function(o, i) {
1051
- return M(n, void 0, void 0, function() {
1052
- var r, s, a, c = this;
1053
- return A(this, function(u) {
1054
- switch (u.label) {
1708
+ function kn(e) {
1709
+ var n = this, t = fe(e, { yieldValues: !0 });
1710
+ return new K(function(r, i) {
1711
+ return I(n, void 0, void 0, function() {
1712
+ var o, s, u, c = this;
1713
+ return $(this, function(a) {
1714
+ switch (a.label) {
1055
1715
  case 0:
1056
1716
  if (!t.length)
1057
1717
  return i(), [
1058
1718
  2
1059
1719
  /*return*/
1060
1720
  ];
1061
- r = [], s = !1, i.then(function() {
1062
- var f, h;
1721
+ o = [], s = !1, i.then(function() {
1722
+ var f, d;
1063
1723
  s = !0;
1064
1724
  try {
1065
- for (var l = R(r), y = l.next(); !y.done; y = l.next()) {
1066
- var d = y.value;
1067
- d();
1725
+ for (var l = D(o), p = l.next(); !p.done; p = l.next()) {
1726
+ var h = p.value;
1727
+ h();
1068
1728
  }
1069
- } catch (m) {
1070
- f = { error: m };
1729
+ } catch (y) {
1730
+ f = { error: y };
1071
1731
  } finally {
1072
1732
  try {
1073
- y && !y.done && (h = l.return) && h.call(l);
1733
+ p && !p.done && (d = l.return) && d.call(l);
1074
1734
  } finally {
1075
1735
  if (f) throw f.error;
1076
1736
  }
1077
1737
  }
1078
- }), u.label = 1;
1738
+ }), a.label = 1;
1079
1739
  case 1:
1080
- return u.trys.push([1, , 3, 4]), [4, Promise.all(t.map(function(f, h) {
1081
- return M(c, void 0, void 0, function() {
1082
- var l, y;
1083
- return A(this, function(d) {
1084
- switch (d.label) {
1740
+ return a.trys.push([1, , 3, 4]), [4, Promise.all(t.map(function(f, d) {
1741
+ return I(c, void 0, void 0, function() {
1742
+ var l, p;
1743
+ return $(this, function(h) {
1744
+ switch (h.label) {
1085
1745
  case 0:
1086
- d.trys.push([0, , 6, 9]), d.label = 1;
1746
+ h.trys.push([0, , 6, 9]), h.label = 1;
1087
1747
  case 1:
1088
- return s ? [3, 5] : (Promise.resolve(f.next()).then(function(m) {
1089
- return r[h](m);
1090
- }, function(m) {
1091
- return i(m);
1092
- }), [4, new Promise(function(m) {
1093
- r[h] = m;
1748
+ return s ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
1749
+ return o[d](y);
1750
+ }, function(y) {
1751
+ return i(y);
1752
+ }), [4, new Promise(function(y) {
1753
+ o[d] = y;
1094
1754
  })]);
1095
1755
  case 2:
1096
- return l = d.sent(), l === void 0 ? [3, 4] : l.done ? (a = l, [
1756
+ return l = h.sent(), l === void 0 ? [3, 4] : l.done ? (u = l, [
1097
1757
  2
1098
1758
  /*return*/
1099
- ]) : [4, o(l.value)];
1759
+ ]) : [4, r(l.value)];
1100
1760
  case 3:
1101
- d.sent(), d.label = 4;
1761
+ h.sent(), h.label = 4;
1102
1762
  case 4:
1103
1763
  return [3, 1];
1104
1764
  case 5:
1105
1765
  return [3, 9];
1106
1766
  case 6:
1107
- return y = f.return, y ? [4, f.return()] : [3, 8];
1767
+ return p = f.return, p ? [4, f.return()] : [3, 8];
1108
1768
  case 7:
1109
- y = d.sent(), d.label = 8;
1769
+ p = h.sent(), h.label = 8;
1110
1770
  case 8:
1111
1771
  return [
1112
1772
  7
@@ -1122,7 +1782,7 @@ function ot(e) {
1122
1782
  });
1123
1783
  }))];
1124
1784
  case 2:
1125
- return u.sent(), [2, a && a.value];
1785
+ return a.sent(), [2, u && u.value];
1126
1786
  case 3:
1127
1787
  return i(), [
1128
1788
  7
@@ -1138,42 +1798,42 @@ function ot(e) {
1138
1798
  });
1139
1799
  });
1140
1800
  }
1141
- function it(e) {
1142
- var n = this, t = Y(e, { returnValues: !0 });
1143
- return new U(function(o, i) {
1144
- return M(n, void 0, void 0, function() {
1145
- var r, s, a, c;
1146
- return A(this, function(u) {
1147
- switch (u.label) {
1801
+ function On(e) {
1802
+ var n = this, t = fe(e, { returnValues: !0 });
1803
+ return new K(function(r, i) {
1804
+ return I(n, void 0, void 0, function() {
1805
+ var o, s, u, c;
1806
+ return $(this, function(a) {
1807
+ switch (a.label) {
1148
1808
  case 0:
1149
1809
  if (!t.length)
1150
1810
  return i(), [2, []];
1151
1811
  s = !1, i.then(function() {
1152
- r(), s = !0;
1153
- }), u.label = 1;
1812
+ o(), s = !0;
1813
+ }), a.label = 1;
1154
1814
  case 1:
1155
- u.trys.push([1, , 6, 8]), u.label = 2;
1815
+ a.trys.push([1, , 6, 8]), a.label = 2;
1156
1816
  case 2:
1157
1817
  return s ? [3, 5] : (Promise.all(t.map(function(f) {
1158
1818
  return f.next();
1159
1819
  })).then(function(f) {
1160
- return r(f);
1820
+ return o(f);
1161
1821
  }, function(f) {
1162
1822
  return i(f);
1163
1823
  }), [4, new Promise(function(f) {
1164
- return r = f;
1824
+ return o = f;
1165
1825
  })]);
1166
1826
  case 3:
1167
- return a = u.sent(), a === void 0 ? [
1827
+ return u = a.sent(), u === void 0 ? [
1168
1828
  2
1169
1829
  /*return*/
1170
- ] : (c = a.map(function(f) {
1830
+ ] : (c = u.map(function(f) {
1171
1831
  return f.value;
1172
- }), a.some(function(f) {
1832
+ }), u.some(function(f) {
1173
1833
  return f.done;
1174
- }) ? [2, c] : [4, o(c)]);
1834
+ }) ? [2, c] : [4, r(c)]);
1175
1835
  case 4:
1176
- return u.sent(), [3, 2];
1836
+ return a.sent(), [3, 2];
1177
1837
  case 5:
1178
1838
  return [3, 8];
1179
1839
  case 6:
@@ -1181,7 +1841,7 @@ function it(e) {
1181
1841
  return f.return && f.return();
1182
1842
  }))];
1183
1843
  case 7:
1184
- return u.sent(), [
1844
+ return a.sent(), [
1185
1845
  7
1186
1846
  /*endfinally*/
1187
1847
  ];
@@ -1195,79 +1855,79 @@ function it(e) {
1195
1855
  });
1196
1856
  });
1197
1857
  }
1198
- function st(e) {
1199
- var n = this, t = Y(e, {
1858
+ function En(e) {
1859
+ var n = this, t = fe(e, {
1200
1860
  yieldValues: !0,
1201
1861
  returnValues: !0
1202
1862
  });
1203
- return new U(function(o, i) {
1204
- return M(n, void 0, void 0, function() {
1205
- var r, s, a, c, u, f = this;
1206
- return A(this, function(h) {
1207
- switch (h.label) {
1863
+ return new K(function(r, i) {
1864
+ return I(n, void 0, void 0, function() {
1865
+ var o, s, u, c, a, f = this;
1866
+ return $(this, function(d) {
1867
+ switch (d.label) {
1208
1868
  case 0:
1209
1869
  if (!t.length)
1210
1870
  return i(), [2, []];
1211
- s = [], a = !1, i.then(function() {
1212
- var l, y;
1213
- r();
1871
+ s = [], u = !1, i.then(function() {
1872
+ var l, p;
1873
+ o();
1214
1874
  try {
1215
- for (var d = R(s), m = d.next(); !m.done; m = d.next()) {
1216
- var j = m.value;
1217
- j();
1875
+ for (var h = D(s), y = h.next(); !y.done; y = h.next()) {
1876
+ var _ = y.value;
1877
+ _();
1218
1878
  }
1219
- } catch (E) {
1220
- l = { error: E };
1879
+ } catch (x) {
1880
+ l = { error: x };
1221
1881
  } finally {
1222
1882
  try {
1223
- m && !m.done && (y = d.return) && y.call(d);
1883
+ y && !y.done && (p = h.return) && p.call(h);
1224
1884
  } finally {
1225
1885
  if (l) throw l.error;
1226
1886
  }
1227
1887
  }
1228
- a = !0;
1229
- }), h.label = 1;
1888
+ u = !0;
1889
+ }), d.label = 1;
1230
1890
  case 1:
1231
- return h.trys.push([1, , 5, 7]), Promise.all(t.map(function(l) {
1891
+ return d.trys.push([1, , 5, 7]), Promise.all(t.map(function(l) {
1232
1892
  return l.next();
1233
1893
  })).then(function(l) {
1234
- return r(l);
1894
+ return o(l);
1235
1895
  }, function(l) {
1236
1896
  return i(l);
1237
1897
  }), [4, new Promise(function(l) {
1238
- return r = l;
1898
+ return o = l;
1239
1899
  })];
1240
1900
  case 2:
1241
- return c = h.sent(), c === void 0 ? [
1901
+ return c = d.sent(), c === void 0 ? [
1242
1902
  2
1243
1903
  /*return*/
1244
- ] : (u = c.map(function(l) {
1904
+ ] : (a = c.map(function(l) {
1245
1905
  return l.value;
1246
1906
  }), c.every(function(l) {
1247
1907
  return l.done;
1248
- }) ? [2, u] : [4, o(u.slice())]);
1908
+ }) ? [2, a] : [4, r(a.slice())]);
1249
1909
  case 3:
1250
- return h.sent(), [4, Promise.all(t.map(function(l, y) {
1251
- return M(f, void 0, void 0, function() {
1252
- var d;
1253
- return A(this, function(m) {
1254
- switch (m.label) {
1910
+ return d.sent(), [4, Promise.all(t.map(function(l, p) {
1911
+ return I(f, void 0, void 0, function() {
1912
+ var h;
1913
+ return $(this, function(y) {
1914
+ switch (y.label) {
1255
1915
  case 0:
1256
- if (c[y].done)
1257
- return [2, c[y].value];
1258
- m.label = 1;
1916
+ if (c[p].done)
1917
+ return [2, c[p].value];
1918
+ y.label = 1;
1259
1919
  case 1:
1260
- return a ? [3, 4] : (Promise.resolve(l.next()).then(function(j) {
1261
- return s[y](j);
1262
- }, function(j) {
1263
- return i(j);
1264
- }), [4, new Promise(function(j) {
1265
- return s[y] = j;
1920
+ return u ? [3, 4] : (Promise.resolve(l.next()).then(function(_) {
1921
+ return s[p](_);
1922
+ }, function(_) {
1923
+ return i(_);
1924
+ }), [4, new Promise(function(_) {
1925
+ return s[p] = _;
1266
1926
  })]);
1267
1927
  case 2:
1268
- return d = m.sent(), d === void 0 ? [2, c[y].value] : d.done ? [2, d.value] : (u[y] = d.value, [4, o(u.slice())]);
1928
+ return h = y.sent(), h === void 0 ? [2, c[p].value] : h.done ? [2, h.value] : (a[p] = h.value, [4, r(a.slice())]);
1269
1929
  case 3:
1270
- return m.sent(), [3, 1];
1930
+ return y.sent(), [3, 1];
1271
1931
  case 4:
1272
1932
  return [
1273
1933
  2
@@ -1278,13 +1938,13 @@ function st(e) {
1278
1938
  });
1279
1939
  }))];
1280
1940
  case 4:
1281
- return [2, h.sent()];
1941
+ return [2, d.sent()];
1282
1942
  case 5:
1283
1943
  return i(), [4, Promise.all(t.map(function(l) {
1284
1944
  return l.return && l.return();
1285
1945
  }))];
1286
1946
  case 6:
1287
- return h.sent(), [
1947
+ return d.sent(), [
1288
1948
  7
1289
1949
  /*endfinally*/
1290
1950
  ];
@@ -1298,8 +1958,7 @@ function st(e) {
1298
1958
  });
1299
1959
  });
1300
1960
  }
1301
- class ut {
1302
- ajv_;
1961
+ class Sn {
1303
1962
  graffiti;
1304
1963
  callbacks = /* @__PURE__ */ new Set();
1305
1964
  options;
@@ -1311,12 +1970,6 @@ class ut {
1311
1970
  deleteMedia;
1312
1971
  actorToHandle;
1313
1972
  handleToActor;
1314
- get ajv() {
1315
- return this.ajv_ || (this.ajv_ = (async () => {
1316
- const { default: n } = await import("./ajv-D_HICdxS.mjs").then((t) => t.a);
1317
- return new n({ strict: !1 });
1318
- })()), this.ajv_;
1319
- }
1320
1973
  /**
1321
1974
  * Wraps a Graffiti API instance to provide the synchronize methods.
1322
1975
  * The GraffitiSyncrhonize class rather than the Graffiti class
@@ -1325,24 +1978,24 @@ class ut {
1325
1978
  constructor(n, t) {
1326
1979
  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);
1327
1980
  }
1328
- synchronize(n, t, o, i, r = /* @__PURE__ */ new Set()) {
1329
- const s = new U(
1330
- async (a, c) => {
1331
- const u = lt(await this.ajv, o), f = (h) => {
1332
- if (h?.tombstone)
1333
- r.has(h.object.url) && a(h);
1334
- else if (h && n(h.object) && (this.options.omniscient || Ge(h.object, i))) {
1981
+ synchronize(n, t, r, i, o = /* @__PURE__ */ new Set()) {
1982
+ const s = new K(
1983
+ async (u, c) => {
1984
+ const a = await Qe(r), f = (d) => {
1985
+ if (d?.tombstone)
1986
+ o.has(d.object.url) && u(d);
1987
+ else if (d && n(d.object) && (this.options.omniscient || Je(d.object, i))) {
1335
1988
  let l = JSON.parse(
1336
- JSON.stringify(h.object)
1989
+ JSON.stringify(d.object)
1337
1990
  );
1338
- this.options.omniscient || (l = ke(l, t, i?.actor)), u(l) && (a({ object: l }), r.add(l.url));
1991
+ this.options.omniscient || (l = Ke(l, t, i?.actor)), a(l) && (u({ object: l }), o.add(l.url));
1339
1992
  }
1340
1993
  };
1341
1994
  this.callbacks.add(f), await c, this.callbacks.delete(f);
1342
1995
  }
1343
1996
  );
1344
1997
  return (async function* () {
1345
- for await (const a of s) yield a;
1998
+ for await (const u of s) yield u;
1346
1999
  })();
1347
2000
  }
1348
2001
  /**
@@ -1358,11 +2011,11 @@ class ut {
1358
2011
  *
1359
2012
  * @group 0 - Synchronize Methods
1360
2013
  */
1361
- synchronizeDiscover(n, t, o) {
1362
- function i(r) {
1363
- return r.channels.some((s) => n.includes(s));
2014
+ synchronizeDiscover(n, t, r) {
2015
+ function i(o) {
2016
+ return o.channels.some((s) => n.includes(s));
1364
2017
  }
1365
- return this.synchronize(i, n, t, o);
2018
+ return this.synchronize(i, n, t, r);
1366
2019
  }
1367
2020
  /**
1368
2021
  * This method has the same signature as {@link get} but
@@ -1376,16 +2029,16 @@ class ut {
1376
2029
  *
1377
2030
  * @group 0 - Synchronize Methods
1378
2031
  */
1379
- synchronizeGet(n, t, o) {
1380
- const i = te(n);
1381
- function r(s) {
2032
+ synchronizeGet(n, t, r) {
2033
+ const i = he(n);
2034
+ function o(s) {
1382
2035
  return s.url === i;
1383
2036
  }
1384
2037
  return this.synchronize(
1385
- r,
2038
+ o,
1386
2039
  [],
1387
2040
  t,
1388
- o,
2041
+ r,
1389
2042
  /* @__PURE__ */ new Set([i])
1390
2043
  );
1391
2044
  }
@@ -1405,18 +2058,18 @@ class ut {
1405
2058
  return this.synchronize(() => !0, [], n, t);
1406
2059
  }
1407
2060
  async synchronizeDispatch(n, t = !1) {
1408
- for (const o of this.callbacks)
1409
- o(n);
1410
- t && await new Promise((o) => setTimeout(o, 0));
2061
+ for (const r of this.callbacks)
2062
+ r(n);
2063
+ t && await new Promise((r) => setTimeout(r, 0));
1411
2064
  }
1412
2065
  get = async (...n) => {
1413
2066
  try {
1414
2067
  const t = await this.graffiti.get(...n);
1415
2068
  return this.synchronizeDispatch({ object: t }), t;
1416
2069
  } catch (t) {
1417
- throw t instanceof D && this.synchronizeDispatch({
2070
+ throw t instanceof T && this.synchronizeDispatch({
1418
2071
  tombstone: !0,
1419
- object: { url: te(n[0]) }
2072
+ object: { url: he(n[0]) }
1420
2073
  }), t;
1421
2074
  }
1422
2075
  };
@@ -1427,28 +2080,28 @@ class ut {
1427
2080
  delete = async (...n) => {
1428
2081
  const t = {
1429
2082
  tombstone: !0,
1430
- object: { url: te(n[0]) }
2083
+ object: { url: he(n[0]) }
1431
2084
  };
1432
2085
  try {
1433
- const o = await this.graffiti.delete(...n);
1434
- return await this.synchronizeDispatch(t, !0), o;
1435
- } catch (o) {
1436
- throw o instanceof D && await this.synchronizeDispatch(t, !0), o;
2086
+ const r = await this.graffiti.delete(...n);
2087
+ return await this.synchronizeDispatch(t, !0), r;
2088
+ } catch (r) {
2089
+ throw r instanceof T && await this.synchronizeDispatch(t, !0), r;
1437
2090
  }
1438
2091
  };
1439
2092
  objectStreamContinue(n) {
1440
2093
  const t = this;
1441
2094
  return (async function* () {
1442
2095
  for (; ; ) {
1443
- const o = await n.next();
1444
- if (o.done) {
1445
- const { continue: i, cursor: r } = o.value;
2096
+ const r = await n.next();
2097
+ if (r.done) {
2098
+ const { continue: i, cursor: o } = r.value;
1446
2099
  return {
1447
2100
  continue: (s) => t.objectStreamContinue(i(s)),
1448
- cursor: r
2101
+ cursor: o
1449
2102
  };
1450
2103
  }
1451
- o.value.error || t.synchronizeDispatch(o.value), yield o.value;
2104
+ r.value.error || t.synchronizeDispatch(r.value), yield r.value;
1452
2105
  }
1453
2106
  })();
1454
2107
  }
@@ -1456,9 +2109,9 @@ class ut {
1456
2109
  const t = this.objectStreamContinue(n);
1457
2110
  return (async function* () {
1458
2111
  for (; ; ) {
1459
- const o = await t.next();
1460
- if (o.done) return o.value;
1461
- (o.value.error || !o.value.tombstone) && (yield o.value);
2112
+ const r = await t.next();
2113
+ if (r.done) return r.value;
2114
+ (r.value.error || !r.value.tombstone) && (yield r.value);
1462
2115
  }
1463
2116
  })();
1464
2117
  }
@@ -1471,56 +2124,47 @@ class ut {
1471
2124
  return this.objectStreamContinue(t);
1472
2125
  };
1473
2126
  }
1474
- function lt(e, n) {
1475
- try {
1476
- return e.compile(n);
1477
- } catch (t) {
1478
- throw new Se(
1479
- t instanceof Error ? t.message : String(t)
1480
- );
1481
- }
1482
- }
1483
- const ft = {
2127
+ const An = {
1484
2128
  install(e, n) {
1485
- const t = n.graffiti, o = new ut(t), i = k(void 0);
1486
- o.sessionEvents.addEventListener("initialized", async (r) => {
1487
- const s = r.detail;
2129
+ const t = n.graffiti, r = new Sn(t), i = S(void 0);
2130
+ r.sessionEvents.addEventListener("initialized", async (o) => {
2131
+ const s = o.detail;
1488
2132
  if (s && s.error && console.error(s.error), s && s.href) {
1489
- const a = e.config.globalProperties.$router;
1490
- if (a) {
1491
- const c = a.options.history.base, u = new URL(s.href);
1492
- u.pathname.startsWith(c) && (u.pathname = u.pathname.slice(c.length)), await a.replace(u.pathname + u.search + u.hash);
2133
+ const u = e.config.globalProperties.$router;
2134
+ if (u) {
2135
+ const c = u.options.history.base, a = new URL(s.href);
2136
+ a.pathname.startsWith(c) && (a.pathname = a.pathname.slice(c.length)), await u.replace(a.pathname + a.search + a.hash);
1493
2137
  }
1494
2138
  }
1495
2139
  i.value || (i.value = null);
1496
- }), o.sessionEvents.addEventListener("login", (r) => {
1497
- const s = r.detail;
2140
+ }), r.sessionEvents.addEventListener("login", (o) => {
2141
+ const s = o.detail;
1498
2142
  if (s.error) {
1499
2143
  console.error("Error logging in:"), console.error(s.error);
1500
2144
  return;
1501
2145
  } else
1502
2146
  i.value = s.session;
1503
- }), o.sessionEvents.addEventListener("logout", (r) => {
1504
- const s = r.detail;
2147
+ }), r.sessionEvents.addEventListener("logout", (o) => {
2148
+ const s = o.detail;
1505
2149
  s.error ? (console.error("Error logging out:"), console.error(s.error)) : i.value = null;
1506
- }), Oe(o), Ee(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;
2150
+ }), Xt(r), Bt(i), e.component("GraffitiDiscover", qe), e.component("GraffitiGet", He), e.component("GraffitiGetMedia", We), e.component("GraffitiActorToHandle", V), e.component("GraffitiHandleToActor", Be), e.component("GraffitiObjectInfo", le), e.config.globalProperties.$graffiti = r, e.config.globalProperties.$graffitiSession = i;
1507
2151
  }
1508
- }, dt = we, ht = ge, yt = je, pt = W, vt = xe, mt = K;
2152
+ }, Tn = qe, Gn = He, Mn = We, Nn = V, Zn = Be, In = le;
1509
2153
  export {
1510
- pt as GraffitiActorToHandle,
1511
- dt as GraffitiDiscover,
1512
- ht as GraffitiGet,
1513
- yt as GraffitiGetMedia,
1514
- vt as GraffitiHandleToActor,
1515
- mt as GraffitiObjectInfo,
1516
- ft as GraffitiPlugin,
1517
- ae as useGraffiti,
1518
- Te as useGraffitiActorToHandle,
1519
- Ae as useGraffitiDiscover,
1520
- Ne as useGraffitiGet,
1521
- Ue as useGraffitiGetMedia,
1522
- Ke as useGraffitiHandleToActor,
1523
- ct as useGraffitiSession,
1524
- X as useGraffitiSynchronize
2154
+ Nn as GraffitiActorToHandle,
2155
+ Tn as GraffitiDiscover,
2156
+ Gn as GraffitiGet,
2157
+ Mn as GraffitiGetMedia,
2158
+ Zn as GraffitiHandleToActor,
2159
+ In as GraffitiObjectInfo,
2160
+ An as GraffitiPlugin,
2161
+ je as useGraffiti,
2162
+ Kt as useGraffitiActorToHandle,
2163
+ Jt as useGraffitiDiscover,
2164
+ cn as useGraffitiGet,
2165
+ ln as useGraffitiGetMedia,
2166
+ bn as useGraffitiHandleToActor,
2167
+ $n as useGraffitiSession,
2168
+ ce as useGraffitiSynchronize
1525
2169
  };
1526
2170
  //# sourceMappingURL=plugin.mjs.map