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