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