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