liveroom-client-element 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var je = Object.defineProperty;
|
|
2
2
|
var xe = (s, n, t) => n in s ? je(s, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[n] = t;
|
|
3
3
|
var f = (s, n, t) => (xe(s, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
|
-
function
|
|
4
|
+
function pt() {
|
|
5
5
|
}
|
|
6
6
|
function oe(s) {
|
|
7
7
|
return s();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function Yt() {
|
|
10
10
|
return /* @__PURE__ */ Object.create(null);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function gt(s) {
|
|
13
13
|
s.forEach(oe);
|
|
14
14
|
}
|
|
15
15
|
function ae(s) {
|
|
@@ -51,13 +51,13 @@ function Re(s, n) {
|
|
|
51
51
|
function Ct(s, n, t) {
|
|
52
52
|
s.insertBefore(n, t || null);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function vt(s) {
|
|
55
55
|
s.parentNode && s.parentNode.removeChild(s);
|
|
56
56
|
}
|
|
57
57
|
function Q(s) {
|
|
58
58
|
return document.createElement(s);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Zt(s) {
|
|
61
61
|
return document.createElementNS("http://www.w3.org/2000/svg", s);
|
|
62
62
|
}
|
|
63
63
|
function he(s) {
|
|
@@ -88,14 +88,14 @@ function Ie(s) {
|
|
|
88
88
|
}
|
|
89
89
|
), n;
|
|
90
90
|
}
|
|
91
|
-
let
|
|
91
|
+
let ft;
|
|
92
92
|
function ht(s) {
|
|
93
|
-
|
|
93
|
+
ft = s;
|
|
94
94
|
}
|
|
95
95
|
function ce() {
|
|
96
|
-
if (!
|
|
96
|
+
if (!ft)
|
|
97
97
|
throw new Error("Function called outside component initialization");
|
|
98
|
-
return
|
|
98
|
+
return ft;
|
|
99
99
|
}
|
|
100
100
|
function De(s) {
|
|
101
101
|
ce().$$.on_mount.push(s);
|
|
@@ -103,33 +103,33 @@ function De(s) {
|
|
|
103
103
|
function Ue(s) {
|
|
104
104
|
ce().$$.on_destroy.push(s);
|
|
105
105
|
}
|
|
106
|
-
const rt = [],
|
|
106
|
+
const rt = [], Qt = [];
|
|
107
107
|
let it = [];
|
|
108
|
-
const Kt = [],
|
|
109
|
-
let
|
|
110
|
-
function
|
|
111
|
-
|
|
108
|
+
const Kt = [], Je = /* @__PURE__ */ Promise.resolve();
|
|
109
|
+
let Mt = !1;
|
|
110
|
+
function Ve() {
|
|
111
|
+
Mt || (Mt = !0, Je.then(ct));
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Lt(s) {
|
|
114
114
|
it.push(s);
|
|
115
115
|
}
|
|
116
116
|
const xt = /* @__PURE__ */ new Set();
|
|
117
117
|
let nt = 0;
|
|
118
|
-
function
|
|
118
|
+
function ct() {
|
|
119
119
|
if (nt !== 0)
|
|
120
120
|
return;
|
|
121
|
-
const s =
|
|
121
|
+
const s = ft;
|
|
122
122
|
do {
|
|
123
123
|
try {
|
|
124
124
|
for (; nt < rt.length; ) {
|
|
125
125
|
const n = rt[nt];
|
|
126
|
-
nt++, ht(n),
|
|
126
|
+
nt++, ht(n), Be(n.$$);
|
|
127
127
|
}
|
|
128
128
|
} catch (n) {
|
|
129
129
|
throw rt.length = 0, nt = 0, n;
|
|
130
130
|
}
|
|
131
|
-
for (ht(null), rt.length = 0, nt = 0;
|
|
132
|
-
|
|
131
|
+
for (ht(null), rt.length = 0, nt = 0; Qt.length; )
|
|
132
|
+
Qt.pop()();
|
|
133
133
|
for (let n = 0; n < it.length; n += 1) {
|
|
134
134
|
const t = it[n];
|
|
135
135
|
xt.has(t) || (xt.add(t), t());
|
|
@@ -138,16 +138,16 @@ function bt() {
|
|
|
138
138
|
} while (rt.length);
|
|
139
139
|
for (; Kt.length; )
|
|
140
140
|
Kt.pop()();
|
|
141
|
-
|
|
141
|
+
Mt = !1, xt.clear(), ht(s);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Be(s) {
|
|
144
144
|
if (s.fragment !== null) {
|
|
145
|
-
s.update(),
|
|
145
|
+
s.update(), gt(s.before_update);
|
|
146
146
|
const n = s.dirty;
|
|
147
|
-
s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, n), s.after_update.forEach(
|
|
147
|
+
s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, n), s.after_update.forEach(Lt);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function ze(s) {
|
|
151
151
|
const n = [], t = [];
|
|
152
152
|
it.forEach((e) => s.indexOf(e) === -1 ? n.push(e) : t.push(e)), t.forEach((e) => e()), it = n;
|
|
153
153
|
}
|
|
@@ -166,53 +166,53 @@ function Ge(s, n, t, e, r, i, o, h, p, d, b, _) {
|
|
|
166
166
|
const R = {};
|
|
167
167
|
for (; j--; )
|
|
168
168
|
R[s[j].key] = j;
|
|
169
|
-
const M = [], X = /* @__PURE__ */ new Map(),
|
|
169
|
+
const M = [], X = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), k = [];
|
|
170
170
|
for (j = T; j--; ) {
|
|
171
|
-
const x = _(r, i, j),
|
|
172
|
-
let
|
|
173
|
-
|
|
171
|
+
const x = _(r, i, j), P = t(x);
|
|
172
|
+
let V = o.get(P);
|
|
173
|
+
V ? e && k.push(() => V.p(x, n)) : (V = d(P, x), V.c()), X.set(P, M[j] = V), P in R && q.set(P, Math.abs(j - R[P]));
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
175
|
+
const z = /* @__PURE__ */ new Set(), J = /* @__PURE__ */ new Set();
|
|
176
|
+
function Y(x) {
|
|
177
177
|
le(x, 1), x.m(h, b), o.set(x.key, x), b = x.first, T--;
|
|
178
178
|
}
|
|
179
179
|
for (; A && T; ) {
|
|
180
|
-
const x = M[T - 1],
|
|
181
|
-
x ===
|
|
180
|
+
const x = M[T - 1], P = s[A - 1], V = x.key, K = P.key;
|
|
181
|
+
x === P ? (b = x.first, A--, T--) : X.has(K) ? !o.has(V) || z.has(V) ? Y(x) : J.has(K) ? A-- : q.get(V) > q.get(K) ? (J.add(V), Y(x)) : (z.add(K), A--) : (p(P, o), A--);
|
|
182
182
|
}
|
|
183
183
|
for (; A--; ) {
|
|
184
184
|
const x = s[A];
|
|
185
185
|
X.has(x.key) || p(x, o);
|
|
186
186
|
}
|
|
187
187
|
for (; T; )
|
|
188
|
-
|
|
189
|
-
return
|
|
188
|
+
Y(M[T - 1]);
|
|
189
|
+
return gt(k), M;
|
|
190
190
|
}
|
|
191
191
|
function Xe(s, n, t) {
|
|
192
192
|
const { fragment: e, after_update: r } = s.$$;
|
|
193
|
-
e && e.m(n, t),
|
|
193
|
+
e && e.m(n, t), Lt(() => {
|
|
194
194
|
const i = s.$$.on_mount.map(oe).filter(ae);
|
|
195
|
-
s.$$.on_destroy ? s.$$.on_destroy.push(...i) :
|
|
196
|
-
}), r.forEach(
|
|
195
|
+
s.$$.on_destroy ? s.$$.on_destroy.push(...i) : gt(i), s.$$.on_mount = [];
|
|
196
|
+
}), r.forEach(Lt);
|
|
197
197
|
}
|
|
198
198
|
function qe(s, n) {
|
|
199
199
|
const t = s.$$;
|
|
200
|
-
t.fragment !== null && (
|
|
200
|
+
t.fragment !== null && (ze(t.after_update), gt(t.on_destroy), t.fragment && t.fragment.d(n), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
201
201
|
}
|
|
202
202
|
function Ye(s, n) {
|
|
203
|
-
s.$$.dirty[0] === -1 && (rt.push(s),
|
|
203
|
+
s.$$.dirty[0] === -1 && (rt.push(s), Ve(), s.$$.dirty.fill(0)), s.$$.dirty[n / 31 | 0] |= 1 << n % 31;
|
|
204
204
|
}
|
|
205
205
|
function Ze(s, n, t, e, r, i, o, h = [-1]) {
|
|
206
|
-
const p =
|
|
206
|
+
const p = ft;
|
|
207
207
|
ht(s);
|
|
208
208
|
const d = s.$$ = {
|
|
209
209
|
fragment: null,
|
|
210
210
|
ctx: [],
|
|
211
211
|
// state
|
|
212
212
|
props: i,
|
|
213
|
-
update:
|
|
213
|
+
update: pt,
|
|
214
214
|
not_equal: r,
|
|
215
|
-
bound:
|
|
215
|
+
bound: Yt(),
|
|
216
216
|
// lifecycle
|
|
217
217
|
on_mount: [],
|
|
218
218
|
on_destroy: [],
|
|
@@ -221,7 +221,7 @@ function Ze(s, n, t, e, r, i, o, h = [-1]) {
|
|
|
221
221
|
after_update: [],
|
|
222
222
|
context: new Map(n.context || (p ? p.$$.context : [])),
|
|
223
223
|
// everything else
|
|
224
|
-
callbacks:
|
|
224
|
+
callbacks: Yt(),
|
|
225
225
|
dirty: h,
|
|
226
226
|
skip_bound: !1,
|
|
227
227
|
root: n.target || p.$$.root
|
|
@@ -231,13 +231,13 @@ function Ze(s, n, t, e, r, i, o, h = [-1]) {
|
|
|
231
231
|
if (d.ctx = t ? t(s, n.props || {}, (_, A, ...T) => {
|
|
232
232
|
const j = T.length ? T[0] : A;
|
|
233
233
|
return d.ctx && r(d.ctx[_], d.ctx[_] = j) && (!d.skip_bound && d.bound[_] && d.bound[_](j), b && Ye(s, _)), A;
|
|
234
|
-
}) : [], d.update(), b = !0,
|
|
234
|
+
}) : [], d.update(), b = !0, gt(d.before_update), d.fragment = e ? e(d.ctx) : !1, n.target) {
|
|
235
235
|
if (n.hydrate) {
|
|
236
236
|
const _ = He(n.target);
|
|
237
|
-
d.fragment && d.fragment.l(_), _.forEach(
|
|
237
|
+
d.fragment && d.fragment.l(_), _.forEach(vt);
|
|
238
238
|
} else
|
|
239
239
|
d.fragment && d.fragment.c();
|
|
240
|
-
n.intro && le(s.$$.fragment), Xe(s, n.target, n.anchor),
|
|
240
|
+
n.intro && le(s.$$.fragment), Xe(s, n.target, n.anchor), ct();
|
|
241
241
|
}
|
|
242
242
|
ht(p);
|
|
243
243
|
}
|
|
@@ -295,7 +295,7 @@ typeof HTMLElement == "function" && (ue = class extends HTMLElement {
|
|
|
295
295
|
Ct(d, o, b);
|
|
296
296
|
},
|
|
297
297
|
d: function(d) {
|
|
298
|
-
d &&
|
|
298
|
+
d && vt(o);
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
301
|
};
|
|
@@ -307,7 +307,7 @@ typeof HTMLElement == "function" && (ue = class extends HTMLElement {
|
|
|
307
307
|
i in e && (t[i] = [n(i)]);
|
|
308
308
|
for (const i of this.attributes) {
|
|
309
309
|
const o = this.$$g_p(i.name);
|
|
310
|
-
o in this.$$d || (this.$$d[o] =
|
|
310
|
+
o in this.$$d || (this.$$d[o] = _t(o, i.value, this.$$p_d, "toProp"));
|
|
311
311
|
}
|
|
312
312
|
this.$$c = new this.$$ctor({
|
|
313
313
|
target: this.shadowRoot || this,
|
|
@@ -323,7 +323,7 @@ typeof HTMLElement == "function" && (ue = class extends HTMLElement {
|
|
|
323
323
|
this.$$r = !0;
|
|
324
324
|
for (const i in this.$$p_d)
|
|
325
325
|
if (this.$$d[i] = this.$$c.$$.ctx[this.$$c.$$.props[i]], this.$$p_d[i].reflect) {
|
|
326
|
-
const o =
|
|
326
|
+
const o = _t(
|
|
327
327
|
i,
|
|
328
328
|
this.$$d[i],
|
|
329
329
|
this.$$p_d,
|
|
@@ -346,7 +346,7 @@ typeof HTMLElement == "function" && (ue = class extends HTMLElement {
|
|
|
346
346
|
// and setting attributes through setAttribute etc, this is helpful
|
|
347
347
|
attributeChangedCallback(n, t, e) {
|
|
348
348
|
var r;
|
|
349
|
-
this.$$r || (n = this.$$g_p(n), this.$$d[n] =
|
|
349
|
+
this.$$r || (n = this.$$g_p(n), this.$$d[n] = _t(n, e, this.$$p_d, "toProp"), (r = this.$$c) == null || r.$set({ [n]: this.$$d[n] }));
|
|
350
350
|
}
|
|
351
351
|
disconnectedCallback() {
|
|
352
352
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
@@ -359,7 +359,7 @@ typeof HTMLElement == "function" && (ue = class extends HTMLElement {
|
|
|
359
359
|
) || n;
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
|
-
function
|
|
362
|
+
function _t(s, n, t, e) {
|
|
363
363
|
var i;
|
|
364
364
|
const r = (i = t[s]) == null ? void 0 : i.type;
|
|
365
365
|
if (n = r === "Boolean" && typeof n != "boolean" ? n != null : n, !e || !t[s])
|
|
@@ -407,7 +407,7 @@ function Qe(s, n, t, e, r, i) {
|
|
|
407
407
|
},
|
|
408
408
|
set(p) {
|
|
409
409
|
var d;
|
|
410
|
-
p =
|
|
410
|
+
p = _t(h, p, n), this.$$d[h] = p, (d = this.$$c) == null || d.$set({ [h]: p });
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
413
|
}), e.forEach((h) => {
|
|
@@ -441,7 +441,7 @@ class Ke {
|
|
|
441
441
|
}
|
|
442
442
|
/** @returns {void} */
|
|
443
443
|
$destroy() {
|
|
444
|
-
qe(this, 1), this.$destroy =
|
|
444
|
+
qe(this, 1), this.$destroy = pt;
|
|
445
445
|
}
|
|
446
446
|
/**
|
|
447
447
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -451,7 +451,7 @@ class Ke {
|
|
|
451
451
|
*/
|
|
452
452
|
$on(n, t) {
|
|
453
453
|
if (!ae(t))
|
|
454
|
-
return
|
|
454
|
+
return pt;
|
|
455
455
|
const e = this.$$.callbacks[n] || (this.$$.callbacks[n] = []);
|
|
456
456
|
return e.push(t), () => {
|
|
457
457
|
const r = e.indexOf(t);
|
|
@@ -468,25 +468,25 @@ class Ke {
|
|
|
468
468
|
}
|
|
469
469
|
const ts = "4";
|
|
470
470
|
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ts);
|
|
471
|
-
const { isArray: es } = Array, ss = Object.keys,
|
|
471
|
+
const { isArray: es } = Array, ss = Object.keys, dt = (s) => {
|
|
472
472
|
if (!s)
|
|
473
473
|
return s;
|
|
474
474
|
if (es(s)) {
|
|
475
475
|
const n = [], t = s.length;
|
|
476
476
|
for (let e = 0; e < t; e++)
|
|
477
|
-
n.push(
|
|
477
|
+
n.push(dt(s[e]));
|
|
478
478
|
return n;
|
|
479
479
|
} else if (typeof s == "object") {
|
|
480
480
|
const n = ss(s), t = n.length, e = {};
|
|
481
481
|
for (let r = 0; r < t; r++) {
|
|
482
482
|
const i = n[r];
|
|
483
|
-
e[i] =
|
|
483
|
+
e[i] = dt(s[i]);
|
|
484
484
|
}
|
|
485
485
|
return e;
|
|
486
486
|
}
|
|
487
487
|
return s;
|
|
488
488
|
};
|
|
489
|
-
class
|
|
489
|
+
class U {
|
|
490
490
|
constructor(n) {
|
|
491
491
|
f(this, "path");
|
|
492
492
|
f(this, "from");
|
|
@@ -533,8 +533,8 @@ const { isArray: pe } = Array, O = (s, n) => {
|
|
|
533
533
|
else
|
|
534
534
|
throw new Error("NOT_FOUND");
|
|
535
535
|
return { val: s, obj: e, key: r };
|
|
536
|
-
},
|
|
537
|
-
class
|
|
536
|
+
}, yt = (s) => pe(s.obj) && typeof s.key == "number", kt = (s) => typeof s.obj == "object" && typeof s.key == "string";
|
|
537
|
+
class Pt extends U {
|
|
538
538
|
constructor(t, e) {
|
|
539
539
|
super(t);
|
|
540
540
|
f(this, "value");
|
|
@@ -547,7 +547,7 @@ class It extends D {
|
|
|
547
547
|
return 0;
|
|
548
548
|
}
|
|
549
549
|
apply(t) {
|
|
550
|
-
const { val: e, key: r, obj: i } = O(t, this.path), o =
|
|
550
|
+
const { val: e, key: r, obj: i } = O(t, this.path), o = dt(this.value);
|
|
551
551
|
if (!i)
|
|
552
552
|
t = o;
|
|
553
553
|
else if (typeof r == "string")
|
|
@@ -578,7 +578,7 @@ class It extends D {
|
|
|
578
578
|
t.encodeArrayHeader(3), t.writer.u8(0), t.encodeArray(this.path), t.encodeAny(this.value);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
class fe extends
|
|
581
|
+
class fe extends U {
|
|
582
582
|
constructor(t, e) {
|
|
583
583
|
super(t);
|
|
584
584
|
f(this, "oldValue");
|
|
@@ -594,7 +594,7 @@ class fe extends D {
|
|
|
594
594
|
const e = O(t, this.path);
|
|
595
595
|
if (e.val === void 0)
|
|
596
596
|
throw new Error("NOT_FOUND");
|
|
597
|
-
return kt(e) ? delete e.obj[e.key] :
|
|
597
|
+
return kt(e) ? delete e.obj[e.key] : yt(e) ? e.val !== void 0 && e.obj.splice(e.key, 1) : t = null, { doc: t, old: e.val };
|
|
598
598
|
}
|
|
599
599
|
toJson(t) {
|
|
600
600
|
const e = {
|
|
@@ -612,7 +612,7 @@ class fe extends D {
|
|
|
612
612
|
t.encodeArrayHeader(r ? 3 : 2), t.writer.u8(1), t.encodeArray(this.path), r && t.encodeAny(this.oldValue);
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
class fs extends
|
|
615
|
+
class fs extends U {
|
|
616
616
|
constructor(t, e, r) {
|
|
617
617
|
super(t);
|
|
618
618
|
f(this, "value");
|
|
@@ -629,7 +629,7 @@ class fs extends D {
|
|
|
629
629
|
const e = O(t, this.path);
|
|
630
630
|
if (e.val === void 0)
|
|
631
631
|
throw new Error("NOT_FOUND");
|
|
632
|
-
return kt(e) ? e.obj[e.key] = this.value :
|
|
632
|
+
return kt(e) ? e.obj[e.key] = this.value : yt(e) ? e.obj[e.key] = this.value : t = this.value, { doc: t, old: e.val };
|
|
633
633
|
}
|
|
634
634
|
toJson(t) {
|
|
635
635
|
const e = {
|
|
@@ -648,7 +648,7 @@ class fs extends D {
|
|
|
648
648
|
t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(2), t.encodeArray(this.path), t.encodeAny(this.value), r && t.encodeAny(this.oldValue);
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
|
-
class ds extends
|
|
651
|
+
class ds extends U {
|
|
652
652
|
constructor(t, e) {
|
|
653
653
|
super(t);
|
|
654
654
|
f(this, "from");
|
|
@@ -662,7 +662,7 @@ class ds extends D {
|
|
|
662
662
|
}
|
|
663
663
|
apply(t) {
|
|
664
664
|
const e = new fe(w(this.from), void 0).apply(t);
|
|
665
|
-
return new
|
|
665
|
+
return new Pt(this.path, e.old).apply(e.doc);
|
|
666
666
|
}
|
|
667
667
|
toJson(t) {
|
|
668
668
|
return {
|
|
@@ -678,7 +678,7 @@ class ds extends D {
|
|
|
678
678
|
t.encodeArrayHeader(3), t.writer.u8(4), t.encodeArray(this.path), t.encodeArray(this.from);
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
class gs extends
|
|
681
|
+
class gs extends U {
|
|
682
682
|
constructor(t, e) {
|
|
683
683
|
super(t);
|
|
684
684
|
f(this, "from");
|
|
@@ -694,7 +694,7 @@ class gs extends D {
|
|
|
694
694
|
const { val: e } = O(t, this.from);
|
|
695
695
|
if (e === void 0)
|
|
696
696
|
throw new Error("NOT_FOUND");
|
|
697
|
-
return new
|
|
697
|
+
return new Pt(this.path, dt(e)).apply(t);
|
|
698
698
|
}
|
|
699
699
|
toJson(t) {
|
|
700
700
|
return {
|
|
@@ -710,7 +710,7 @@ class gs extends D {
|
|
|
710
710
|
t.encodeArrayHeader(3), t.writer.u8(3), t.encodeArray(this.path), t.encodeArray(this.from);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
class
|
|
713
|
+
class I extends U {
|
|
714
714
|
apply(n) {
|
|
715
715
|
if (!this.test(n))
|
|
716
716
|
throw new Error("TEST");
|
|
@@ -743,7 +743,7 @@ const Et = (s, n) => {
|
|
|
743
743
|
}
|
|
744
744
|
return !1;
|
|
745
745
|
};
|
|
746
|
-
class vs extends
|
|
746
|
+
class vs extends I {
|
|
747
747
|
constructor(t, e, r) {
|
|
748
748
|
super(t);
|
|
749
749
|
f(this, "value");
|
|
@@ -779,7 +779,7 @@ class vs extends P {
|
|
|
779
779
|
t.encodeArrayHeader(this.not ? 4 : 3), t.writer.u8(5), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeAny(this.value), this.not && t.writer.u8(1);
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
class ys extends
|
|
782
|
+
class ys extends U {
|
|
783
783
|
constructor(n) {
|
|
784
784
|
super(n);
|
|
785
785
|
}
|
|
@@ -806,7 +806,7 @@ class ys extends D {
|
|
|
806
806
|
n.encodeArrayHeader(2), n.writer.u8(8), n.encodeArray(this.path);
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
|
-
class ms extends
|
|
809
|
+
class ms extends U {
|
|
810
810
|
constructor(t, e) {
|
|
811
811
|
super(t);
|
|
812
812
|
f(this, "inc");
|
|
@@ -836,7 +836,7 @@ class ms extends D {
|
|
|
836
836
|
t.encodeArrayHeader(3), t.writer.u8(9), t.encodeArray(this.path), t.encodeNumber(this.inc);
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
class ws extends
|
|
839
|
+
class ws extends U {
|
|
840
840
|
constructor(t, e, r) {
|
|
841
841
|
super(t);
|
|
842
842
|
f(this, "pos");
|
|
@@ -875,7 +875,7 @@ class ws extends D {
|
|
|
875
875
|
t.encodeArrayHeader(4), t.writer.u8(6), t.encodeArray(this.path), t.encodeNumber(this.pos), t.encodeString(this.str);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
class _s extends
|
|
878
|
+
class _s extends U {
|
|
879
879
|
constructor(t, e, r, i) {
|
|
880
880
|
super(t);
|
|
881
881
|
f(this, "pos");
|
|
@@ -921,11 +921,11 @@ class _s extends D {
|
|
|
921
921
|
t.encodeArrayHeader(r ? 4 : 5), t.writer.u8(7), t.encodeArray(this.path), t.encodeNumber(this.pos), r ? t.encodeString(this.str) : (t.writer.u8(0), t.encodeNumber(this.len));
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
const { isArray: bs } = Array,
|
|
924
|
+
const { isArray: bs } = Array, Nt = (s) => !!s && typeof s == "object" && typeof s.text == "string", Rt = (s) => !!s && typeof s == "object" && bs(s.children), Es = (s, n) => {
|
|
925
925
|
const t = new RegExp(s, n ? "i" : void 0);
|
|
926
926
|
return (e) => t.test(e);
|
|
927
927
|
};
|
|
928
|
-
class $s extends
|
|
928
|
+
class $s extends U {
|
|
929
929
|
constructor(t, e, r) {
|
|
930
930
|
super(t);
|
|
931
931
|
f(this, "pos");
|
|
@@ -943,7 +943,7 @@ class $s extends D {
|
|
|
943
943
|
if (e.val === void 0)
|
|
944
944
|
throw new Error("NOT_FOUND");
|
|
945
945
|
const r = this.split(e.val);
|
|
946
|
-
return kt(e) ? e.obj[e.key] = r :
|
|
946
|
+
return kt(e) ? e.obj[e.key] = r : yt(e) ? (e.obj[e.key] = r[0], e.obj.splice(e.key + 1, 0, r[1])) : t = r, { doc: t, old: e.val };
|
|
947
947
|
}
|
|
948
948
|
split(t) {
|
|
949
949
|
if (typeof t == "string") {
|
|
@@ -958,7 +958,7 @@ class $s extends D {
|
|
|
958
958
|
text: o
|
|
959
959
|
}
|
|
960
960
|
] : [i, o];
|
|
961
|
-
} else if (
|
|
961
|
+
} else if (Nt(t)) {
|
|
962
962
|
const { pos: e, props: r } = this, i = t.text.slice(0, e), o = t.text.slice(e);
|
|
963
963
|
return [
|
|
964
964
|
{
|
|
@@ -972,7 +972,7 @@ class $s extends D {
|
|
|
972
972
|
text: o
|
|
973
973
|
}
|
|
974
974
|
];
|
|
975
|
-
} else if (
|
|
975
|
+
} else if (Rt(t)) {
|
|
976
976
|
const { pos: e, props: r } = this, i = t.children.slice(0, e), o = t.children.slice(e);
|
|
977
977
|
return [
|
|
978
978
|
{
|
|
@@ -1008,7 +1008,7 @@ class $s extends D {
|
|
|
1008
1008
|
t.encodeArrayHeader(this.props ? 4 : 3), t.writer.u8(10), t.encodeArray(this.path), t.encodeNumber(this.pos), this.props && t.encodeObject(this.props);
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
class Cs extends
|
|
1011
|
+
class Cs extends U {
|
|
1012
1012
|
constructor(t, e, r) {
|
|
1013
1013
|
super(t);
|
|
1014
1014
|
f(this, "pos");
|
|
@@ -1023,7 +1023,7 @@ class Cs extends D {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
apply(t) {
|
|
1025
1025
|
const e = O(t, this.path);
|
|
1026
|
-
if (!
|
|
1026
|
+
if (!yt(e))
|
|
1027
1027
|
throw new Error("INVALID_TARGET");
|
|
1028
1028
|
if (e.key <= 0)
|
|
1029
1029
|
throw new Error("INVALID_KEY");
|
|
@@ -1031,7 +1031,7 @@ class Cs extends D {
|
|
|
1031
1031
|
return e.obj[e.key - 1] = o, e.obj.splice(e.key, 1), { doc: t, old: [r, i] };
|
|
1032
1032
|
}
|
|
1033
1033
|
merge(t, e) {
|
|
1034
|
-
return typeof t == "string" && typeof e == "string" || typeof t == "number" && typeof e == "number" ? t + e :
|
|
1034
|
+
return typeof t == "string" && typeof e == "string" || typeof t == "number" && typeof e == "number" ? t + e : Nt(t) && Nt(e) ? { ...t, ...e, text: t.text + e.text } : Rt(t) && Rt(e) ? { ...t, ...e, children: [...t.children, ...e.children] } : [t, e];
|
|
1035
1035
|
}
|
|
1036
1036
|
toJson(t) {
|
|
1037
1037
|
const e = {
|
|
@@ -1050,7 +1050,7 @@ class Cs extends D {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
const { isArray: ks } = Array;
|
|
1053
|
-
class As extends
|
|
1053
|
+
class As extends U {
|
|
1054
1054
|
constructor(t, e, r) {
|
|
1055
1055
|
super(t);
|
|
1056
1056
|
f(this, "props");
|
|
@@ -1065,7 +1065,7 @@ class As extends D {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
apply(t) {
|
|
1067
1067
|
const e = O(t, this.path);
|
|
1068
|
-
return
|
|
1068
|
+
return yt(e) ? e.val !== void 0 && (e.obj[e.key] = this.extend(e.val)) : kt(e) ? e.obj[e.key] = this.extend(e.val) : t = this.extend(t), { doc: t };
|
|
1069
1069
|
}
|
|
1070
1070
|
extend(t) {
|
|
1071
1071
|
if (ks(t) || typeof t != "object" || !t)
|
|
@@ -1098,7 +1098,7 @@ class As extends D {
|
|
|
1098
1098
|
t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(12), t.encodeArray(this.path), t.encodeObject(this.props), r && t.writer.u8(1);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
class Ts extends
|
|
1101
|
+
class Ts extends I {
|
|
1102
1102
|
constructor(n) {
|
|
1103
1103
|
super(n);
|
|
1104
1104
|
}
|
|
@@ -1125,7 +1125,7 @@ class Ts extends P {
|
|
|
1125
1125
|
n.encodeArrayHeader(2), n.writer.u8(31), n.encodeArray(t ? this.path.slice(t.path.length) : this.path);
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
class Os extends
|
|
1128
|
+
class Os extends I {
|
|
1129
1129
|
constructor(n) {
|
|
1130
1130
|
super(n);
|
|
1131
1131
|
}
|
|
@@ -1159,7 +1159,7 @@ class Os extends P {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
1161
|
const { isArray: js } = Array;
|
|
1162
|
-
class xs extends
|
|
1162
|
+
class xs extends I {
|
|
1163
1163
|
constructor(t, e) {
|
|
1164
1164
|
super(t);
|
|
1165
1165
|
f(this, "type");
|
|
@@ -1189,7 +1189,7 @@ class xs extends P {
|
|
|
1189
1189
|
t.encodeArrayHeader(3), t.writer.u8(39), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeArray(this.type);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
-
class Ss extends
|
|
1192
|
+
class Ss extends I {
|
|
1193
1193
|
constructor(t, e, r, i) {
|
|
1194
1194
|
super(t);
|
|
1195
1195
|
f(this, "pos");
|
|
@@ -1227,7 +1227,7 @@ class Ss extends P {
|
|
|
1227
1227
|
t.encodeArrayHeader(this.not ? 5 : 4), t.writer.u8(40), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.pos), t.encodeString(this.str), this.not && t.writer.u8(1);
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
|
-
class Ms extends
|
|
1230
|
+
class Ms extends I {
|
|
1231
1231
|
constructor(t, e, r) {
|
|
1232
1232
|
super(t);
|
|
1233
1233
|
f(this, "len");
|
|
@@ -1263,7 +1263,7 @@ class Ms extends P {
|
|
|
1263
1263
|
t.encodeArrayHeader(this.not ? 4 : 3), t.writer.u8(41), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.len), this.not && t.writer.u8(1);
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
class Ls extends
|
|
1266
|
+
class Ls extends I {
|
|
1267
1267
|
constructor(t, e, r) {
|
|
1268
1268
|
super(t);
|
|
1269
1269
|
f(this, "value");
|
|
@@ -1300,7 +1300,7 @@ class Ls extends P {
|
|
|
1300
1300
|
t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(30), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
|
-
class Ns extends
|
|
1303
|
+
class Ns extends I {
|
|
1304
1304
|
constructor(t, e, r) {
|
|
1305
1305
|
super(t);
|
|
1306
1306
|
f(this, "value");
|
|
@@ -1337,7 +1337,7 @@ class Ns extends P {
|
|
|
1337
1337
|
t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(32), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
|
-
class Rs extends
|
|
1340
|
+
class Rs extends I {
|
|
1341
1341
|
constructor(t, e, r) {
|
|
1342
1342
|
super(t);
|
|
1343
1343
|
f(this, "value");
|
|
@@ -1374,7 +1374,7 @@ class Rs extends P {
|
|
|
1374
1374
|
t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(37), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
|
|
1375
1375
|
}
|
|
1376
1376
|
}
|
|
1377
|
-
class Hs extends
|
|
1377
|
+
class Hs extends I {
|
|
1378
1378
|
constructor(t, e) {
|
|
1379
1379
|
super(t);
|
|
1380
1380
|
f(this, "value");
|
|
@@ -1407,7 +1407,7 @@ class Hs extends P {
|
|
|
1407
1407
|
t.encodeArrayHeader(3), t.writer.u8(33), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeArray(this.value);
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
|
-
class Ps extends
|
|
1410
|
+
class Ps extends I {
|
|
1411
1411
|
constructor(t, e) {
|
|
1412
1412
|
super(t);
|
|
1413
1413
|
f(this, "value");
|
|
@@ -1437,7 +1437,7 @@ class Ps extends P {
|
|
|
1437
1437
|
t.encodeArrayHeader(3), t.writer.u8(34), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.value);
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
|
-
class Is extends
|
|
1440
|
+
class Is extends I {
|
|
1441
1441
|
constructor(t, e) {
|
|
1442
1442
|
super(t);
|
|
1443
1443
|
f(this, "value");
|
|
@@ -1467,14 +1467,14 @@ class Is extends P {
|
|
|
1467
1467
|
t.encodeArrayHeader(3), t.writer.u8(36), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.value);
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
|
-
class
|
|
1470
|
+
class It extends I {
|
|
1471
1471
|
constructor(t, e) {
|
|
1472
1472
|
super(t);
|
|
1473
1473
|
f(this, "ops");
|
|
1474
1474
|
this.ops = e;
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
|
-
class Ds extends
|
|
1477
|
+
class Ds extends It {
|
|
1478
1478
|
constructor(t, e) {
|
|
1479
1479
|
super(t, e);
|
|
1480
1480
|
f(this, "ops");
|
|
@@ -1515,7 +1515,7 @@ class Ds extends Dt {
|
|
|
1515
1515
|
this.ops[o].encode(t, this);
|
|
1516
1516
|
}
|
|
1517
1517
|
}
|
|
1518
|
-
class Us extends
|
|
1518
|
+
class Us extends It {
|
|
1519
1519
|
constructor(t, e) {
|
|
1520
1520
|
super(t, e);
|
|
1521
1521
|
f(this, "ops");
|
|
@@ -1555,7 +1555,7 @@ class Us extends Dt {
|
|
|
1555
1555
|
this.ops[i].encode(t, this);
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
|
-
class
|
|
1558
|
+
class Js extends It {
|
|
1559
1559
|
constructor(t, e) {
|
|
1560
1560
|
super(t, e);
|
|
1561
1561
|
f(this, "ops");
|
|
@@ -1595,7 +1595,7 @@ class zs extends Dt {
|
|
|
1595
1595
|
this.ops[i].encode(t, this);
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
class
|
|
1598
|
+
class Vs extends I {
|
|
1599
1599
|
constructor(t, e, r, i) {
|
|
1600
1600
|
super(t);
|
|
1601
1601
|
f(this, "value");
|
|
@@ -1630,8 +1630,8 @@ class Js extends P {
|
|
|
1630
1630
|
t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(35), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
|
-
const { isArray:
|
|
1634
|
-
class
|
|
1633
|
+
const { isArray: Bs } = Array;
|
|
1634
|
+
class zs extends I {
|
|
1635
1635
|
constructor(t, e) {
|
|
1636
1636
|
super(t);
|
|
1637
1637
|
f(this, "value");
|
|
@@ -1645,7 +1645,7 @@ class Bs extends P {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
test(t) {
|
|
1647
1647
|
const { val: e } = O(t, this.path);
|
|
1648
|
-
return e === null ? this.value === "null" :
|
|
1648
|
+
return e === null ? this.value === "null" : Bs(e) ? this.value === "array" : typeof e === this.value || typeof e == "number" && e === Math.round(e) && this.value === "integer";
|
|
1649
1649
|
}
|
|
1650
1650
|
toJson(t) {
|
|
1651
1651
|
return {
|
|
@@ -1664,7 +1664,7 @@ class Bs extends P {
|
|
|
1664
1664
|
const Fs = (s, n) => {
|
|
1665
1665
|
switch (s.op) {
|
|
1666
1666
|
case "add":
|
|
1667
|
-
return new
|
|
1667
|
+
return new Pt(w(s.path), s.value);
|
|
1668
1668
|
case "remove":
|
|
1669
1669
|
return new fe(w(s.path), s.oldValue);
|
|
1670
1670
|
case "replace":
|
|
@@ -1688,9 +1688,9 @@ const Fs = (s, n) => {
|
|
|
1688
1688
|
case "extend":
|
|
1689
1689
|
return new As(w(s.path), s.props, !!s.deleteNull);
|
|
1690
1690
|
default:
|
|
1691
|
-
return
|
|
1691
|
+
return bt(s, n);
|
|
1692
1692
|
}
|
|
1693
|
-
},
|
|
1693
|
+
}, bt = (s, n) => {
|
|
1694
1694
|
switch (s.op) {
|
|
1695
1695
|
case "test":
|
|
1696
1696
|
return new vs(w(s.path), s.value, !!s.not);
|
|
@@ -1699,7 +1699,7 @@ const Fs = (s, n) => {
|
|
|
1699
1699
|
case "undefined":
|
|
1700
1700
|
return new Os(w(s.path));
|
|
1701
1701
|
case "type":
|
|
1702
|
-
return new
|
|
1702
|
+
return new zs(w(s.path), s.value);
|
|
1703
1703
|
case "test_type":
|
|
1704
1704
|
return new xs(w(s.path), s.type);
|
|
1705
1705
|
case "test_string":
|
|
@@ -1713,7 +1713,7 @@ const Fs = (s, n) => {
|
|
|
1713
1713
|
case "starts":
|
|
1714
1714
|
return new Rs(w(s.path), s.value, !!s.ignore_case);
|
|
1715
1715
|
case "matches":
|
|
1716
|
-
return new
|
|
1716
|
+
return new Vs(w(s.path), s.value, !!s.ignore_case, n.createMatcher || Es);
|
|
1717
1717
|
case "in":
|
|
1718
1718
|
return new Hs(w(s.path), s.value);
|
|
1719
1719
|
case "less":
|
|
@@ -1722,22 +1722,22 @@ const Fs = (s, n) => {
|
|
|
1722
1722
|
return new Is(w(s.path), s.value);
|
|
1723
1723
|
case "and": {
|
|
1724
1724
|
const t = w(s.path);
|
|
1725
|
-
return new Ds(t, s.apply.map((e) =>
|
|
1725
|
+
return new Ds(t, s.apply.map((e) => bt({ ...e, path: [...t, ...w(e.path)] }, n)));
|
|
1726
1726
|
}
|
|
1727
1727
|
case "or": {
|
|
1728
1728
|
const t = w(s.path);
|
|
1729
|
-
return new Us(t, s.apply.map((e) =>
|
|
1729
|
+
return new Us(t, s.apply.map((e) => bt({ ...e, path: [...t, ...w(e.path)] }, n)));
|
|
1730
1730
|
}
|
|
1731
1731
|
case "not": {
|
|
1732
1732
|
const t = w(s.path);
|
|
1733
|
-
return new
|
|
1733
|
+
return new Js(t, s.apply.map((e) => bt({ ...e, path: [...t, ...w(e.path)] }, n)));
|
|
1734
1734
|
}
|
|
1735
1735
|
default:
|
|
1736
1736
|
throw new Error("OP_UNKNOWN");
|
|
1737
1737
|
}
|
|
1738
1738
|
};
|
|
1739
1739
|
function Ws(s, n, t) {
|
|
1740
|
-
t.mutate || (s =
|
|
1740
|
+
t.mutate || (s = dt(s));
|
|
1741
1741
|
const e = [], r = n.length;
|
|
1742
1742
|
for (let i = 0; i < r; i++) {
|
|
1743
1743
|
const h = Fs(n[i], t).apply(s);
|
|
@@ -1745,9 +1745,9 @@ function Ws(s, n, t) {
|
|
|
1745
1745
|
}
|
|
1746
1746
|
return { doc: s, res: e };
|
|
1747
1747
|
}
|
|
1748
|
-
var
|
|
1748
|
+
var lt = (s) => typeof s == "function" ? s : function() {
|
|
1749
1749
|
return s;
|
|
1750
|
-
}, Gs = typeof self < "u" ? self : null, at = typeof window < "u" ? window : null,
|
|
1750
|
+
}, Gs = typeof self < "u" ? self : null, at = typeof window < "u" ? window : null, ut = Gs || at || ut, Xs = "2.0.0", B = { connecting: 0, open: 1, closing: 2, closed: 3 }, qs = 1e4, Ys = 1e3, D = {
|
|
1751
1751
|
closed: "closed",
|
|
1752
1752
|
errored: "errored",
|
|
1753
1753
|
joined: "joined",
|
|
@@ -1759,12 +1759,12 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
1759
1759
|
join: "phx_join",
|
|
1760
1760
|
reply: "phx_reply",
|
|
1761
1761
|
leave: "phx_leave"
|
|
1762
|
-
},
|
|
1762
|
+
}, Ht = {
|
|
1763
1763
|
longpoll: "longpoll",
|
|
1764
1764
|
websocket: "websocket"
|
|
1765
1765
|
}, Zs = {
|
|
1766
1766
|
complete: 4
|
|
1767
|
-
},
|
|
1767
|
+
}, mt = class {
|
|
1768
1768
|
constructor(s, n, t, e) {
|
|
1769
1769
|
this.channel = s, this.event = n, this.payload = t || function() {
|
|
1770
1770
|
return {};
|
|
@@ -1824,20 +1824,20 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
}, Qs = class {
|
|
1826
1826
|
constructor(s, n, t) {
|
|
1827
|
-
this.state =
|
|
1827
|
+
this.state = D.closed, this.topic = s, this.params = lt(n || {}), this.socket = t, this.bindings = [], this.bindingRef = 0, this.timeout = this.socket.timeout, this.joinedOnce = !1, this.joinPush = new mt(this, G.join, this.params, this.timeout), this.pushBuffer = [], this.stateChangeRefs = [], this.rejoinTimer = new de(() => {
|
|
1828
1828
|
this.socket.isConnected() && this.rejoin();
|
|
1829
1829
|
}, this.socket.rejoinAfterMs), this.stateChangeRefs.push(this.socket.onError(() => this.rejoinTimer.reset())), this.stateChangeRefs.push(this.socket.onOpen(() => {
|
|
1830
1830
|
this.rejoinTimer.reset(), this.isErrored() && this.rejoin();
|
|
1831
1831
|
})), this.joinPush.receive("ok", () => {
|
|
1832
|
-
this.state =
|
|
1832
|
+
this.state = D.joined, this.rejoinTimer.reset(), this.pushBuffer.forEach((e) => e.send()), this.pushBuffer = [];
|
|
1833
1833
|
}), this.joinPush.receive("error", () => {
|
|
1834
|
-
this.state =
|
|
1834
|
+
this.state = D.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
|
|
1835
1835
|
}), this.onClose(() => {
|
|
1836
|
-
this.rejoinTimer.reset(), this.socket.hasLogger() && this.socket.log("channel", `close ${this.topic} ${this.joinRef()}`), this.state =
|
|
1836
|
+
this.rejoinTimer.reset(), this.socket.hasLogger() && this.socket.log("channel", `close ${this.topic} ${this.joinRef()}`), this.state = D.closed, this.socket.remove(this);
|
|
1837
1837
|
}), this.onError((e) => {
|
|
1838
|
-
this.socket.hasLogger() && this.socket.log("channel", `error ${this.topic}`, e), this.isJoining() && this.joinPush.reset(), this.state =
|
|
1838
|
+
this.socket.hasLogger() && this.socket.log("channel", `error ${this.topic}`, e), this.isJoining() && this.joinPush.reset(), this.state = D.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
|
|
1839
1839
|
}), this.joinPush.receive("timeout", () => {
|
|
1840
|
-
this.socket.hasLogger() && this.socket.log("channel", `timeout ${this.topic} (${this.joinRef()})`, this.joinPush.timeout), new
|
|
1840
|
+
this.socket.hasLogger() && this.socket.log("channel", `timeout ${this.topic} (${this.joinRef()})`, this.joinPush.timeout), new mt(this, G.leave, lt({}), this.timeout).send(), this.state = D.errored, this.joinPush.reset(), this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
|
|
1841
1841
|
}), this.on(G.reply, (e, r) => {
|
|
1842
1842
|
this.trigger(this.replyEventName(r), e);
|
|
1843
1843
|
});
|
|
@@ -1866,16 +1866,16 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
1866
1866
|
push(s, n, t = this.timeout) {
|
|
1867
1867
|
if (n = n || {}, !this.joinedOnce)
|
|
1868
1868
|
throw new Error(`tried to push '${s}' to '${this.topic}' before joining. Use channel.join() before pushing events`);
|
|
1869
|
-
let e = new
|
|
1869
|
+
let e = new mt(this, s, function() {
|
|
1870
1870
|
return n;
|
|
1871
1871
|
}, t);
|
|
1872
1872
|
return this.canPush() ? e.send() : (e.startTimeout(), this.pushBuffer.push(e)), e;
|
|
1873
1873
|
}
|
|
1874
1874
|
leave(s = this.timeout) {
|
|
1875
|
-
this.rejoinTimer.reset(), this.joinPush.cancelTimeout(), this.state =
|
|
1875
|
+
this.rejoinTimer.reset(), this.joinPush.cancelTimeout(), this.state = D.leaving;
|
|
1876
1876
|
let n = () => {
|
|
1877
1877
|
this.socket.hasLogger() && this.socket.log("channel", `leave ${this.topic}`), this.trigger(G.close, "leave");
|
|
1878
|
-
}, t = new
|
|
1878
|
+
}, t = new mt(this, G.leave, lt({}), s);
|
|
1879
1879
|
return t.receive("ok", () => n()).receive("timeout", () => n()), t.send(), this.canPush() || t.trigger("ok", {}), t;
|
|
1880
1880
|
}
|
|
1881
1881
|
onMessage(s, n, t) {
|
|
@@ -1888,7 +1888,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
1888
1888
|
return this.joinPush.ref;
|
|
1889
1889
|
}
|
|
1890
1890
|
rejoin(s = this.timeout) {
|
|
1891
|
-
this.isLeaving() || (this.socket.leaveOpenTopic(this.topic), this.state =
|
|
1891
|
+
this.isLeaving() || (this.socket.leaveOpenTopic(this.topic), this.state = D.joining, this.joinPush.resend(s));
|
|
1892
1892
|
}
|
|
1893
1893
|
trigger(s, n, t, e) {
|
|
1894
1894
|
let r = this.onMessage(s, n, t, e);
|
|
@@ -1902,27 +1902,27 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
1902
1902
|
return `chan_reply_${s}`;
|
|
1903
1903
|
}
|
|
1904
1904
|
isClosed() {
|
|
1905
|
-
return this.state ===
|
|
1905
|
+
return this.state === D.closed;
|
|
1906
1906
|
}
|
|
1907
1907
|
isErrored() {
|
|
1908
|
-
return this.state ===
|
|
1908
|
+
return this.state === D.errored;
|
|
1909
1909
|
}
|
|
1910
1910
|
isJoined() {
|
|
1911
|
-
return this.state ===
|
|
1911
|
+
return this.state === D.joined;
|
|
1912
1912
|
}
|
|
1913
1913
|
isJoining() {
|
|
1914
|
-
return this.state ===
|
|
1914
|
+
return this.state === D.joining;
|
|
1915
1915
|
}
|
|
1916
1916
|
isLeaving() {
|
|
1917
|
-
return this.state ===
|
|
1917
|
+
return this.state === D.leaving;
|
|
1918
1918
|
}
|
|
1919
1919
|
}, $t = class {
|
|
1920
1920
|
static request(s, n, t, e, r, i, o) {
|
|
1921
|
-
if (
|
|
1922
|
-
let h = new
|
|
1921
|
+
if (ut.XDomainRequest) {
|
|
1922
|
+
let h = new ut.XDomainRequest();
|
|
1923
1923
|
return this.xdomainRequest(h, s, n, e, r, i, o);
|
|
1924
1924
|
} else {
|
|
1925
|
-
let h = new
|
|
1925
|
+
let h = new ut.XMLHttpRequest();
|
|
1926
1926
|
return this.xhrRequest(h, s, n, t, e, r, i, o);
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
@@ -1972,22 +1972,22 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
1972
1972
|
}, this.onerror = function() {
|
|
1973
1973
|
}, this.onmessage = function() {
|
|
1974
1974
|
}, this.onclose = function() {
|
|
1975
|
-
}, this.pollEndpoint = this.normalizeEndpoint(s), this.readyState =
|
|
1975
|
+
}, this.pollEndpoint = this.normalizeEndpoint(s), this.readyState = B.connecting, this.poll();
|
|
1976
1976
|
}
|
|
1977
1977
|
normalizeEndpoint(s) {
|
|
1978
|
-
return s.replace("ws://", "http://").replace("wss://", "https://").replace(new RegExp("(.*)/" +
|
|
1978
|
+
return s.replace("ws://", "http://").replace("wss://", "https://").replace(new RegExp("(.*)/" + Ht.websocket), "$1/" + Ht.longpoll);
|
|
1979
1979
|
}
|
|
1980
1980
|
endpointURL() {
|
|
1981
1981
|
return $t.appendParams(this.pollEndpoint, { token: this.token });
|
|
1982
1982
|
}
|
|
1983
1983
|
closeAndRetry(s, n, t) {
|
|
1984
|
-
this.close(s, n, t), this.readyState =
|
|
1984
|
+
this.close(s, n, t), this.readyState = B.connecting;
|
|
1985
1985
|
}
|
|
1986
1986
|
ontimeout() {
|
|
1987
1987
|
this.onerror("timeout"), this.closeAndRetry(1005, "timeout", !1);
|
|
1988
1988
|
}
|
|
1989
1989
|
isActive() {
|
|
1990
|
-
return this.readyState ===
|
|
1990
|
+
return this.readyState === B.open || this.readyState === B.connecting;
|
|
1991
1991
|
}
|
|
1992
1992
|
poll() {
|
|
1993
1993
|
this.ajax("GET", null, () => this.ontimeout(), (s) => {
|
|
@@ -2006,7 +2006,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2006
2006
|
this.poll();
|
|
2007
2007
|
break;
|
|
2008
2008
|
case 410:
|
|
2009
|
-
this.readyState =
|
|
2009
|
+
this.readyState = B.open, this.onopen({}), this.poll();
|
|
2010
2010
|
break;
|
|
2011
2011
|
case 403:
|
|
2012
2012
|
this.onerror(403), this.close(1008, "forbidden", !1);
|
|
@@ -2028,7 +2028,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2028
2028
|
close(s, n, t) {
|
|
2029
2029
|
for (let r of this.reqs)
|
|
2030
2030
|
r.abort();
|
|
2031
|
-
this.readyState =
|
|
2031
|
+
this.readyState = B.closed;
|
|
2032
2032
|
let e = Object.assign({ code: 1e3, reason: void 0, wasClean: !0 }, { code: s, reason: n, wasClean: t });
|
|
2033
2033
|
typeof CloseEvent < "u" ? this.onclose(new CloseEvent("close", e)) : this.onclose(e);
|
|
2034
2034
|
}
|
|
@@ -2040,7 +2040,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2040
2040
|
this.reqs.delete(r), this.isActive() && e(o);
|
|
2041
2041
|
}), this.reqs.add(r);
|
|
2042
2042
|
}
|
|
2043
|
-
},
|
|
2043
|
+
}, wt = {
|
|
2044
2044
|
HEADER_LENGTH: 1,
|
|
2045
2045
|
META_LENGTH: 4,
|
|
2046
2046
|
KINDS: { push: 0, reply: 1, broadcast: 2 },
|
|
@@ -2109,13 +2109,13 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
}, Ks = class {
|
|
2111
2111
|
constructor(s, n = {}) {
|
|
2112
|
-
this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] }, this.channels = [], this.sendBuffer = [], this.ref = 0, this.timeout = n.timeout || qs, this.transport = n.transport ||
|
|
2112
|
+
this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] }, this.channels = [], this.sendBuffer = [], this.ref = 0, this.timeout = n.timeout || qs, this.transport = n.transport || ut.WebSocket || St, this.establishedConnections = 0, this.defaultEncoder = wt.encode.bind(wt), this.defaultDecoder = wt.decode.bind(wt), this.closeWasClean = !1, this.binaryType = n.binaryType || "arraybuffer", this.connectClock = 1, this.transport !== St ? (this.encode = n.encode || this.defaultEncoder, this.decode = n.decode || this.defaultDecoder) : (this.encode = this.defaultEncoder, this.decode = this.defaultDecoder);
|
|
2113
2113
|
let t = null;
|
|
2114
2114
|
at && at.addEventListener && (at.addEventListener("pagehide", (e) => {
|
|
2115
2115
|
this.conn && (this.disconnect(), t = this.connectClock);
|
|
2116
2116
|
}), at.addEventListener("pageshow", (e) => {
|
|
2117
2117
|
t === this.connectClock && (t = null, this.connect());
|
|
2118
|
-
})), this.heartbeatIntervalMs = n.heartbeatIntervalMs || 3e4, this.rejoinAfterMs = (e) => n.rejoinAfterMs ? n.rejoinAfterMs(e) : [1e3, 2e3, 5e3][e - 1] || 1e4, this.reconnectAfterMs = (e) => n.reconnectAfterMs ? n.reconnectAfterMs(e) : [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][e - 1] || 5e3, this.logger = n.logger || null, this.longpollerTimeout = n.longpollerTimeout || 2e4, this.params =
|
|
2118
|
+
})), this.heartbeatIntervalMs = n.heartbeatIntervalMs || 3e4, this.rejoinAfterMs = (e) => n.rejoinAfterMs ? n.rejoinAfterMs(e) : [1e3, 2e3, 5e3][e - 1] || 1e4, this.reconnectAfterMs = (e) => n.reconnectAfterMs ? n.reconnectAfterMs(e) : [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][e - 1] || 5e3, this.logger = n.logger || null, this.longpollerTimeout = n.longpollerTimeout || 2e4, this.params = lt(n.params || {}), this.endPoint = `${s}/${Ht.websocket}`, this.vsn = n.vsn || Xs, this.heartbeatTimeoutTimer = null, this.heartbeatTimer = null, this.pendingHeartbeatRef = null, this.reconnectTimer = new de(() => {
|
|
2119
2119
|
this.teardown(() => this.connect());
|
|
2120
2120
|
}, this.reconnectAfterMs);
|
|
2121
2121
|
}
|
|
@@ -2136,7 +2136,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2136
2136
|
this.connectClock++, this.closeWasClean = !0, this.reconnectTimer.reset(), this.teardown(s, n, t);
|
|
2137
2137
|
}
|
|
2138
2138
|
connect(s) {
|
|
2139
|
-
s && (console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"), this.params =
|
|
2139
|
+
s && (console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"), this.params = lt(s)), !this.conn && (this.connectClock++, this.closeWasClean = !1, this.conn = new this.transport(this.endPointURL()), this.conn.binaryType = this.binaryType, this.conn.timeout = this.longpollerTimeout, this.conn.onopen = () => this.onConnOpen(), this.conn.onerror = (n) => this.onConnError(n), this.conn.onmessage = (n) => this.onConnMessage(n), this.conn.onclose = (n) => this.onConnClose(n));
|
|
2140
2140
|
}
|
|
2141
2141
|
log(s, n, t) {
|
|
2142
2142
|
this.logger(s, n, t);
|
|
@@ -2205,7 +2205,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2205
2205
|
}, 150 * n);
|
|
2206
2206
|
}
|
|
2207
2207
|
waitForSocketClosed(s, n = 1) {
|
|
2208
|
-
if (n === 5 || !this.conn || this.conn.readyState ===
|
|
2208
|
+
if (n === 5 || !this.conn || this.conn.readyState === B.closed) {
|
|
2209
2209
|
s();
|
|
2210
2210
|
return;
|
|
2211
2211
|
}
|
|
@@ -2231,11 +2231,11 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2231
2231
|
}
|
|
2232
2232
|
connectionState() {
|
|
2233
2233
|
switch (this.conn && this.conn.readyState) {
|
|
2234
|
-
case
|
|
2234
|
+
case B.connecting:
|
|
2235
2235
|
return "connecting";
|
|
2236
|
-
case
|
|
2236
|
+
case B.open:
|
|
2237
2237
|
return "open";
|
|
2238
|
-
case
|
|
2238
|
+
case B.closing:
|
|
2239
2239
|
return "closing";
|
|
2240
2240
|
default:
|
|
2241
2241
|
return "closed";
|
|
@@ -2293,7 +2293,7 @@ var ct = (s) => typeof s == "function" ? s : function() {
|
|
|
2293
2293
|
};
|
|
2294
2294
|
class tn {
|
|
2295
2295
|
constructor(n) {
|
|
2296
|
-
this.connected = !1, this.config = n, this.socket = new Ks(this.config.url, { logger: (t, e, r) => {
|
|
2296
|
+
this.connected = !1, this.config = n, this.socket = new Ks(this.config.url, this.config.socketOptions || { logger: (t, e, r) => {
|
|
2297
2297
|
console.log(`${t}: ${e}`, r);
|
|
2298
2298
|
} }), this.channel = this.socket.channel(this.config.topic, this.config.params), this.eventTarget = new EventTarget();
|
|
2299
2299
|
}
|
|
@@ -2422,13 +2422,13 @@ var se;
|
|
|
2422
2422
|
}, b = Object.getPrototypeOf(Function), _ = typeof process == "object" && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === "true", A = !_ && typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Ae(), T = !_ && typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : Te(), j = !_ && typeof WeakMap == "function" ? WeakMap : Oe(), R = new j();
|
|
2423
2423
|
function M(a, c, l, u) {
|
|
2424
2424
|
if (L(l)) {
|
|
2425
|
-
if (!
|
|
2425
|
+
if (!Wt(a))
|
|
2426
2426
|
throw new TypeError();
|
|
2427
|
-
if (!
|
|
2427
|
+
if (!Gt(c))
|
|
2428
2428
|
throw new TypeError();
|
|
2429
2429
|
return K(a, c);
|
|
2430
2430
|
} else {
|
|
2431
|
-
if (!
|
|
2431
|
+
if (!Wt(a))
|
|
2432
2432
|
throw new TypeError();
|
|
2433
2433
|
if (!N(c))
|
|
2434
2434
|
throw new TypeError();
|
|
@@ -2449,49 +2449,49 @@ var se;
|
|
|
2449
2449
|
return l;
|
|
2450
2450
|
}
|
|
2451
2451
|
n("metadata", X);
|
|
2452
|
-
function
|
|
2452
|
+
function q(a, c, l, u) {
|
|
2453
2453
|
if (!N(l))
|
|
2454
2454
|
throw new TypeError();
|
|
2455
2455
|
return L(u) || (u = F(u)), Vt(a, c, l, u);
|
|
2456
2456
|
}
|
|
2457
|
-
n("defineMetadata",
|
|
2457
|
+
n("defineMetadata", q);
|
|
2458
2458
|
function k(a, c, l) {
|
|
2459
2459
|
if (!N(c))
|
|
2460
2460
|
throw new TypeError();
|
|
2461
|
-
return L(l) || (l = F(l)),
|
|
2461
|
+
return L(l) || (l = F(l)), Dt(a, c, l);
|
|
2462
2462
|
}
|
|
2463
2463
|
n("hasMetadata", k);
|
|
2464
|
-
function
|
|
2464
|
+
function z(a, c, l) {
|
|
2465
2465
|
if (!N(c))
|
|
2466
2466
|
throw new TypeError();
|
|
2467
2467
|
return L(l) || (l = F(l)), At(a, c, l);
|
|
2468
2468
|
}
|
|
2469
|
-
n("hasOwnMetadata",
|
|
2470
|
-
function
|
|
2469
|
+
n("hasOwnMetadata", z);
|
|
2470
|
+
function J(a, c, l) {
|
|
2471
2471
|
if (!N(c))
|
|
2472
2472
|
throw new TypeError();
|
|
2473
|
-
return L(l) || (l = F(l)),
|
|
2473
|
+
return L(l) || (l = F(l)), Ut(a, c, l);
|
|
2474
2474
|
}
|
|
2475
|
-
n("getMetadata",
|
|
2476
|
-
function
|
|
2475
|
+
n("getMetadata", J);
|
|
2476
|
+
function Y(a, c, l) {
|
|
2477
2477
|
if (!N(c))
|
|
2478
2478
|
throw new TypeError();
|
|
2479
2479
|
return L(l) || (l = F(l)), Jt(a, c, l);
|
|
2480
2480
|
}
|
|
2481
|
-
n("getOwnMetadata",
|
|
2481
|
+
n("getOwnMetadata", Y);
|
|
2482
2482
|
function x(a, c) {
|
|
2483
2483
|
if (!N(a))
|
|
2484
2484
|
throw new TypeError();
|
|
2485
2485
|
return L(c) || (c = F(c)), Bt(a, c);
|
|
2486
2486
|
}
|
|
2487
2487
|
n("getMetadataKeys", x);
|
|
2488
|
-
function
|
|
2488
|
+
function P(a, c) {
|
|
2489
2489
|
if (!N(a))
|
|
2490
2490
|
throw new TypeError();
|
|
2491
|
-
return L(c) || (c = F(c)),
|
|
2491
|
+
return L(c) || (c = F(c)), zt(a, c);
|
|
2492
2492
|
}
|
|
2493
|
-
n("getOwnMetadataKeys",
|
|
2494
|
-
function
|
|
2493
|
+
n("getOwnMetadataKeys", P);
|
|
2494
|
+
function V(a, c, l) {
|
|
2495
2495
|
if (!N(c))
|
|
2496
2496
|
throw new TypeError();
|
|
2497
2497
|
L(l) || (l = F(l));
|
|
@@ -2508,12 +2508,12 @@ var se;
|
|
|
2508
2508
|
var g = R.get(c);
|
|
2509
2509
|
return g.delete(l), g.size > 0 || R.delete(c), !0;
|
|
2510
2510
|
}
|
|
2511
|
-
n("deleteMetadata",
|
|
2511
|
+
n("deleteMetadata", V);
|
|
2512
2512
|
function K(a, c) {
|
|
2513
2513
|
for (var l = a.length - 1; l >= 0; --l) {
|
|
2514
2514
|
var u = a[l], g = u(c);
|
|
2515
2515
|
if (!L(g) && !tt(g)) {
|
|
2516
|
-
if (!
|
|
2516
|
+
if (!Gt(g))
|
|
2517
2517
|
throw new TypeError();
|
|
2518
2518
|
c = g;
|
|
2519
2519
|
}
|
|
@@ -2546,12 +2546,12 @@ var se;
|
|
|
2546
2546
|
}
|
|
2547
2547
|
return g;
|
|
2548
2548
|
}
|
|
2549
|
-
function
|
|
2549
|
+
function Dt(a, c, l) {
|
|
2550
2550
|
var u = At(a, c, l);
|
|
2551
2551
|
if (u)
|
|
2552
2552
|
return !0;
|
|
2553
2553
|
var g = Tt(c);
|
|
2554
|
-
return tt(g) ? !1 :
|
|
2554
|
+
return tt(g) ? !1 : Dt(a, g, l);
|
|
2555
2555
|
}
|
|
2556
2556
|
function At(a, c, l) {
|
|
2557
2557
|
var u = ot(
|
|
@@ -2562,13 +2562,13 @@ var se;
|
|
|
2562
2562
|
);
|
|
2563
2563
|
return L(u) ? !1 : we(u.has(a));
|
|
2564
2564
|
}
|
|
2565
|
-
function
|
|
2565
|
+
function Ut(a, c, l) {
|
|
2566
2566
|
var u = At(a, c, l);
|
|
2567
2567
|
if (u)
|
|
2568
2568
|
return Jt(a, c, l);
|
|
2569
2569
|
var g = Tt(c);
|
|
2570
2570
|
if (!tt(g))
|
|
2571
|
-
return
|
|
2571
|
+
return Ut(a, g, l);
|
|
2572
2572
|
}
|
|
2573
2573
|
function Jt(a, c, l) {
|
|
2574
2574
|
var u = ot(
|
|
@@ -2590,7 +2590,7 @@ var se;
|
|
|
2590
2590
|
g.set(a, c);
|
|
2591
2591
|
}
|
|
2592
2592
|
function Bt(a, c) {
|
|
2593
|
-
var l =
|
|
2593
|
+
var l = zt(a, c), u = Tt(a);
|
|
2594
2594
|
if (u === null)
|
|
2595
2595
|
return l;
|
|
2596
2596
|
var g = Bt(u, c);
|
|
@@ -2602,13 +2602,13 @@ var se;
|
|
|
2602
2602
|
var E = v[m], $ = H.has(E);
|
|
2603
2603
|
$ || (H.add(E), y.push(E));
|
|
2604
2604
|
}
|
|
2605
|
-
for (var
|
|
2606
|
-
var E =
|
|
2605
|
+
for (var Z = 0, qt = g; Z < qt.length; Z++) {
|
|
2606
|
+
var E = qt[Z], $ = H.has(E);
|
|
2607
2607
|
$ || (H.add(E), y.push(E));
|
|
2608
2608
|
}
|
|
2609
2609
|
return y;
|
|
2610
2610
|
}
|
|
2611
|
-
function
|
|
2611
|
+
function zt(a, c) {
|
|
2612
2612
|
var l = [], u = ot(
|
|
2613
2613
|
a,
|
|
2614
2614
|
c,
|
|
@@ -2634,7 +2634,7 @@ var se;
|
|
|
2634
2634
|
y++;
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
|
-
function
|
|
2637
|
+
function Ft(a) {
|
|
2638
2638
|
if (a === null)
|
|
2639
2639
|
return 1;
|
|
2640
2640
|
switch (typeof a) {
|
|
@@ -2667,7 +2667,7 @@ var se;
|
|
|
2667
2667
|
return typeof a == "object" ? a !== null : typeof a == "function";
|
|
2668
2668
|
}
|
|
2669
2669
|
function ye(a, c) {
|
|
2670
|
-
switch (
|
|
2670
|
+
switch (Ft(a)) {
|
|
2671
2671
|
case 0:
|
|
2672
2672
|
return a;
|
|
2673
2673
|
case 1:
|
|
@@ -2681,7 +2681,7 @@ var se;
|
|
|
2681
2681
|
case 5:
|
|
2682
2682
|
return a;
|
|
2683
2683
|
}
|
|
2684
|
-
var l = c === 3 ? "string" : c === 5 ? "number" : "default", u =
|
|
2684
|
+
var l = c === 3 ? "string" : c === 5 ? "number" : "default", u = Xt(a, r);
|
|
2685
2685
|
if (u !== void 0) {
|
|
2686
2686
|
var g = u.call(a, l);
|
|
2687
2687
|
if (N(g))
|
|
@@ -2734,17 +2734,17 @@ var se;
|
|
|
2734
2734
|
);
|
|
2735
2735
|
return ve(c) ? c : _e(c);
|
|
2736
2736
|
}
|
|
2737
|
-
function
|
|
2737
|
+
function Wt(a) {
|
|
2738
2738
|
return Array.isArray ? Array.isArray(a) : a instanceof Object ? a instanceof Array : Object.prototype.toString.call(a) === "[object Array]";
|
|
2739
2739
|
}
|
|
2740
2740
|
function et(a) {
|
|
2741
2741
|
return typeof a == "function";
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2743
|
+
function Gt(a) {
|
|
2744
2744
|
return typeof a == "function";
|
|
2745
2745
|
}
|
|
2746
2746
|
function be(a) {
|
|
2747
|
-
switch (
|
|
2747
|
+
switch (Ft(a)) {
|
|
2748
2748
|
case 3:
|
|
2749
2749
|
return !0;
|
|
2750
2750
|
case 4:
|
|
@@ -2753,7 +2753,7 @@ var se;
|
|
|
2753
2753
|
return !1;
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
|
-
function
|
|
2756
|
+
function Xt(a, c) {
|
|
2757
2757
|
var l = a[c];
|
|
2758
2758
|
if (l != null) {
|
|
2759
2759
|
if (!et(l))
|
|
@@ -2762,7 +2762,7 @@ var se;
|
|
|
2762
2762
|
}
|
|
2763
2763
|
}
|
|
2764
2764
|
function Ee(a) {
|
|
2765
|
-
var c =
|
|
2765
|
+
var c = Xt(a, i);
|
|
2766
2766
|
if (!et(c))
|
|
2767
2767
|
throw new TypeError();
|
|
2768
2768
|
var l = c.call(a);
|
|
@@ -2945,12 +2945,12 @@ var se;
|
|
|
2945
2945
|
);
|
|
2946
2946
|
return $ !== void 0 ? d.get($, this._key) : void 0;
|
|
2947
2947
|
}, v.prototype.set = function(E, $) {
|
|
2948
|
-
var
|
|
2948
|
+
var Z = g(
|
|
2949
2949
|
E,
|
|
2950
2950
|
/*create*/
|
|
2951
2951
|
!0
|
|
2952
2952
|
);
|
|
2953
|
-
return
|
|
2953
|
+
return Z[this._key] = $, this;
|
|
2954
2954
|
}, v.prototype.delete = function(E) {
|
|
2955
2955
|
var $ = g(
|
|
2956
2956
|
E,
|
|
@@ -2990,8 +2990,8 @@ var se;
|
|
|
2990
2990
|
var v = y(a);
|
|
2991
2991
|
v[6] = v[6] & 79 | 64, v[8] = v[8] & 191 | 128;
|
|
2992
2992
|
for (var E = "", $ = 0; $ < a; ++$) {
|
|
2993
|
-
var
|
|
2994
|
-
($ === 4 || $ === 6 || $ === 8) && (E += "-"),
|
|
2993
|
+
var Z = v[$];
|
|
2994
|
+
($ === 4 || $ === 6 || $ === 8) && (E += "-"), Z < 16 && (E += "0"), E += Z.toString(16).toLowerCase();
|
|
2995
2995
|
}
|
|
2996
2996
|
return E;
|
|
2997
2997
|
}
|
|
@@ -3002,7 +3002,7 @@ var se;
|
|
|
3002
3002
|
});
|
|
3003
3003
|
})(se || (se = {}));
|
|
3004
3004
|
function en(s) {
|
|
3005
|
-
Le(s, "svelte-
|
|
3005
|
+
Le(s, "svelte-1tmn7wo", '#liveroom-client-element.svelte-1tmn7wo.svelte-1tmn7wo{font-family:Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;line-height:1.5;font-weight:400;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}#users-container.svelte-1tmn7wo.svelte-1tmn7wo{z-index:99999;position:fixed;inset:0;overflow:hidden;pointer-events:none}.user.svelte-1tmn7wo.svelte-1tmn7wo{z-index:10;position:absolute;top:0;left:0;user-select:none;transform:translate(var(--x), var(--y))}.user.svelte-1tmn7wo .cursor.svelte-1tmn7wo{position:absolute;top:0;left:0;color:var(--color);transform-origin:top left;transform:rotate(6deg)}.user[data-isself="true"].svelte-1tmn7wo .cursor.svelte-1tmn7wo{display:none}.user-name.svelte-1tmn7wo.svelte-1tmn7wo{padding:4px 10px;font-size:14px;line-height:20px;font-weight:600;color:black;background-color:var(--color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:9999px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05)}.user.svelte-1tmn7wo .user-name.svelte-1tmn7wo{position:absolute;top:20px;left:16px}.user[data-isself="true"].svelte-1tmn7wo .user-name.svelte-1tmn7wo{display:none}.user.svelte-1tmn7wo .halo.svelte-1tmn7wo{transform:scale(0);z-index:-1;position:absolute;top:-60px;left:-60px;width:120px;height:120px;border-radius:9999px;background-color:var(--color);opacity:0.25;transition:transform 100ms ease-out;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05)}.user.svelte-1tmn7wo .halo[data-show="true"].svelte-1tmn7wo{transform:scale(1)}');
|
|
3006
3006
|
}
|
|
3007
3007
|
function ne(s, n, t) {
|
|
3008
3008
|
const e = s.slice();
|
|
@@ -3011,7 +3011,7 @@ function ne(s, n, t) {
|
|
|
3011
3011
|
function re(s) {
|
|
3012
3012
|
let n, t = [], e = /* @__PURE__ */ new Map(), r = te(Object.values(
|
|
3013
3013
|
/*users*/
|
|
3014
|
-
s[
|
|
3014
|
+
s[0]
|
|
3015
3015
|
));
|
|
3016
3016
|
const i = (o) => (
|
|
3017
3017
|
/*user*/
|
|
@@ -3026,7 +3026,7 @@ function re(s) {
|
|
|
3026
3026
|
n = Q("div");
|
|
3027
3027
|
for (let o = 0; o < t.length; o += 1)
|
|
3028
3028
|
t[o].c();
|
|
3029
|
-
S(n, "id", "users-container"), S(n, "class", "svelte-
|
|
3029
|
+
S(n, "id", "users-container"), S(n, "class", "svelte-1tmn7wo");
|
|
3030
3030
|
},
|
|
3031
3031
|
m(o, h) {
|
|
3032
3032
|
Ct(o, n, h);
|
|
@@ -3034,14 +3034,14 @@ function re(s) {
|
|
|
3034
3034
|
t[p] && t[p].m(n, null);
|
|
3035
3035
|
},
|
|
3036
3036
|
p(o, h) {
|
|
3037
|
-
h & /*Object, users, me, parseFloat*/
|
|
3038
|
-
|
|
3037
|
+
h & /*Object, users, me, parseFloat, users_count*/
|
|
3038
|
+
7 && (r = te(Object.values(
|
|
3039
3039
|
/*users*/
|
|
3040
|
-
o[
|
|
3040
|
+
o[0]
|
|
3041
3041
|
)), t = Ge(t, h, i, 1, o, r, e, n, We, ie, null, ne));
|
|
3042
3042
|
},
|
|
3043
3043
|
d(o) {
|
|
3044
|
-
o &&
|
|
3044
|
+
o && vt(n);
|
|
3045
3045
|
for (let h = 0; h < t.length; h += 1)
|
|
3046
3046
|
t[h].d();
|
|
3047
3047
|
}
|
|
@@ -3056,10 +3056,16 @@ function ie(s, n) {
|
|
|
3056
3056
|
key: s,
|
|
3057
3057
|
first: null,
|
|
3058
3058
|
c() {
|
|
3059
|
-
t = Q("div"), e =
|
|
3060
|
-
n[16].
|
|
3061
|
-
n[
|
|
3062
|
-
n[16].
|
|
3059
|
+
t = Q("div"), e = Zt("svg"), r = Zt("path"), i = jt(), o = Q("span"), p = he(h), d = jt(), b = Q("div"), A = jt(), S(r, "d", "M2.2706 0.0593359L25.4277 8.05957H25.45926C25.65896 8.13153 25.83096 8.25952 25.95221 8.42653C26.07357 8.59354 26.13851 8.79166 26.13851 8.99459C26.13851 9.19751 26.07357 9.39564 25.95221 9.56265C25.83096 9.72966 25.65896 9.85765 25.45926 9.92962L15.3543 13.7698L11.3124 23.37C11.2344 23.5561 11.0994 23.7156 10.9248 23.828C10.7503 23.9402 10.5443 24.0002 10.3335 24C10.1172 24 9.9061 23.9365 9.7291 23.8184C9.552 23.7004 9.4176 23.5332 9.344 23.34L0.9233 1.33937C0.8555 1.16076 0.8426 0.967504 0.8861 0.782189C0.9297 0.596873 1.0278 0.427163 1.1691 0.292901C1.3105 0.158639 1.4891 0.0653762 1.6841 0.0240151C1.8792 -0.0173461 2.0826 -0.00509504 2.2706 0.0593359Z"), S(e, "width", "23"), S(e, "viewBox", "0 0 27 24"), S(e, "fill", "currentColor"), S(e, "aria-hidden", "true"), S(e, "xmlns", "http://www.w3.org/2000/svg"), S(e, "class", "cursor svelte-1tmn7wo"), S(o, "class", "user-name svelte-1tmn7wo"), S(b, "class", "halo svelte-1tmn7wo"), S(b, "data-show", _ = /*user*/
|
|
3060
|
+
(n[16].id == /*me*/
|
|
3061
|
+
n[1].id && /*user*/
|
|
3062
|
+
n[16].is_shift_key_down || /*user*/
|
|
3063
|
+
n[16].id != /*me*/
|
|
3064
|
+
n[1].id && /*user*/
|
|
3065
|
+
(n[16].is_shift_key_down || /*user*/
|
|
3066
|
+
n[16].is_mouse_down)) && /*users_count*/
|
|
3067
|
+
n[2] > 1), S(t, "id", T = "user-" + /*user*/
|
|
3068
|
+
n[16].id), S(t, "class", "user svelte-1tmn7wo"), S(t, "data-isself", j = /*user*/
|
|
3063
3069
|
n[16].id == /*me*/
|
|
3064
3070
|
n[1].id), st(
|
|
3065
3071
|
t,
|
|
@@ -3079,33 +3085,39 @@ function ie(s, n) {
|
|
|
3079
3085
|
},
|
|
3080
3086
|
p(R, M) {
|
|
3081
3087
|
n = R, M & /*users*/
|
|
3082
|
-
|
|
3083
|
-
n[16].name + "") && Pe(p, h), M & /*users*/
|
|
3084
|
-
|
|
3085
|
-
n[16].
|
|
3086
|
-
n[
|
|
3087
|
-
|
|
3088
|
+
1 && h !== (h = /*user*/
|
|
3089
|
+
n[16].name + "") && Pe(p, h), M & /*users, me, users_count*/
|
|
3090
|
+
7 && _ !== (_ = /*user*/
|
|
3091
|
+
(n[16].id == /*me*/
|
|
3092
|
+
n[1].id && /*user*/
|
|
3093
|
+
n[16].is_shift_key_down || /*user*/
|
|
3094
|
+
n[16].id != /*me*/
|
|
3095
|
+
n[1].id && /*user*/
|
|
3096
|
+
(n[16].is_shift_key_down || /*user*/
|
|
3097
|
+
n[16].is_mouse_down)) && /*users_count*/
|
|
3098
|
+
n[2] > 1) && S(b, "data-show", _), M & /*users*/
|
|
3099
|
+
1 && T !== (T = "user-" + /*user*/
|
|
3088
3100
|
n[16].id) && S(t, "id", T), M & /*users, me*/
|
|
3089
|
-
|
|
3101
|
+
3 && j !== (j = /*user*/
|
|
3090
3102
|
n[16].id == /*me*/
|
|
3091
3103
|
n[1].id) && S(t, "data-isself", j), M & /*users*/
|
|
3092
|
-
|
|
3104
|
+
1 && st(
|
|
3093
3105
|
t,
|
|
3094
3106
|
"--color",
|
|
3095
3107
|
/*user*/
|
|
3096
3108
|
n[16].color
|
|
3097
3109
|
), M & /*users*/
|
|
3098
|
-
|
|
3110
|
+
1 && st(t, "--x", parseFloat(
|
|
3099
3111
|
/*user*/
|
|
3100
3112
|
n[16].x
|
|
3101
3113
|
) + "vw"), M & /*users*/
|
|
3102
|
-
|
|
3114
|
+
1 && st(t, "--y", parseFloat(
|
|
3103
3115
|
/*user*/
|
|
3104
3116
|
n[16].y
|
|
3105
3117
|
) + "vh");
|
|
3106
3118
|
},
|
|
3107
3119
|
d(R) {
|
|
3108
|
-
R &&
|
|
3120
|
+
R && vt(t);
|
|
3109
3121
|
}
|
|
3110
3122
|
};
|
|
3111
3123
|
}
|
|
@@ -3113,54 +3125,57 @@ function sn(s) {
|
|
|
3113
3125
|
let n, t = (
|
|
3114
3126
|
/*me*/
|
|
3115
3127
|
s[1] && /*users*/
|
|
3116
|
-
s[
|
|
3128
|
+
s[0] && re(s)
|
|
3117
3129
|
);
|
|
3118
3130
|
return {
|
|
3119
3131
|
c() {
|
|
3120
|
-
n = Q("div"), t && t.c(), S(n, "id", "liveroom-client-element"), S(n, "class", "svelte-
|
|
3132
|
+
n = Q("div"), t && t.c(), S(n, "id", "liveroom-client-element"), S(n, "class", "svelte-1tmn7wo");
|
|
3121
3133
|
},
|
|
3122
3134
|
m(e, r) {
|
|
3123
|
-
Ct(e, n, r), t && t.m(n, null)
|
|
3135
|
+
Ct(e, n, r), t && t.m(n, null);
|
|
3124
3136
|
},
|
|
3125
3137
|
p(e, [r]) {
|
|
3126
3138
|
/*me*/
|
|
3127
3139
|
e[1] && /*users*/
|
|
3128
|
-
e[
|
|
3140
|
+
e[0] ? t ? t.p(e, r) : (t = re(e), t.c(), t.m(n, null)) : t && (t.d(1), t = null);
|
|
3129
3141
|
},
|
|
3130
|
-
i:
|
|
3131
|
-
o:
|
|
3142
|
+
i: pt,
|
|
3143
|
+
o: pt,
|
|
3132
3144
|
d(e) {
|
|
3133
|
-
e &&
|
|
3145
|
+
e && vt(n), t && t.d();
|
|
3134
3146
|
}
|
|
3135
3147
|
};
|
|
3136
3148
|
}
|
|
3137
3149
|
function nn(s, n, t) {
|
|
3138
|
-
let { url: e } = n, { room_id: r } = n, i, o, h, p;
|
|
3150
|
+
let { url: e } = n, { room_id: r } = n, { user_name: i } = n, o, h, p, d;
|
|
3139
3151
|
De(async () => {
|
|
3140
|
-
const
|
|
3141
|
-
let
|
|
3142
|
-
!!(
|
|
3152
|
+
const k = new URLSearchParams(window.location.search), z = k.get("_liveroom"), J = z == null ? void 0 : z.split("https://meet.google.com/");
|
|
3153
|
+
let Y = J == null ? void 0 : J[0];
|
|
3154
|
+
!!(J != null && J[1]) && (Y = J[1].split("?")[0]), t(3, r = Y || r);
|
|
3155
|
+
const P = k.get("_liveroom_user_name");
|
|
3156
|
+
P && t(4, i = P), b();
|
|
3143
3157
|
}), Ue(() => {
|
|
3144
|
-
|
|
3158
|
+
_();
|
|
3145
3159
|
});
|
|
3146
|
-
function
|
|
3160
|
+
function b() {
|
|
3147
3161
|
o = new tn({
|
|
3148
3162
|
url: e,
|
|
3149
3163
|
topic: `liveroom-livestate:${r}`,
|
|
3150
3164
|
params: {
|
|
3151
3165
|
room_id: r,
|
|
3152
|
-
|
|
3166
|
+
user_name: i,
|
|
3167
|
+
current_url: window.location.href,
|
|
3153
3168
|
inner_width: window.innerWidth,
|
|
3154
3169
|
inner_height: window.innerHeight
|
|
3155
3170
|
}
|
|
3156
3171
|
}), o.connect(), o.addEventListener("livestate-change", ({ detail: { state: k } }) => {
|
|
3157
|
-
t(3, r = k.room_id), t(1, h = k.me), t(
|
|
3158
|
-
}), window.addEventListener("mousemove",
|
|
3172
|
+
t(3, r = k.room_id), t(1, h = k.me), t(0, p = k.users);
|
|
3173
|
+
}), window.addEventListener("mousemove", A), window.addEventListener("mousedown", T), window.addEventListener("mouseup", j), window.addEventListener("keydown", M), window.addEventListener("keyup", X), window.addEventListener("resize", q);
|
|
3159
3174
|
}
|
|
3160
|
-
function
|
|
3161
|
-
window.removeEventListener("resize",
|
|
3175
|
+
function _() {
|
|
3176
|
+
window.removeEventListener("resize", q), window.removeEventListener("keyup", X), window.removeEventListener("keydown", M), window.removeEventListener("mouseup", j), window.removeEventListener("mousedown", T), window.removeEventListener("mousemove", A), o == null || o.disconnect();
|
|
3162
3177
|
}
|
|
3163
|
-
function
|
|
3178
|
+
function A(k) {
|
|
3164
3179
|
o && (h != null && h.id) && o.dispatchEvent(new CustomEvent(
|
|
3165
3180
|
"mouse_move",
|
|
3166
3181
|
{
|
|
@@ -3174,20 +3189,20 @@ function nn(s, n, t) {
|
|
|
3174
3189
|
}
|
|
3175
3190
|
));
|
|
3176
3191
|
}
|
|
3177
|
-
function
|
|
3192
|
+
function T() {
|
|
3178
3193
|
o && (h != null && h.id) && o.dispatchEvent(new CustomEvent("mouse_down", { detail: { user_id: h.id } }));
|
|
3179
3194
|
}
|
|
3180
|
-
function
|
|
3195
|
+
function j() {
|
|
3181
3196
|
o && (h != null && h.id) && o.dispatchEvent(new CustomEvent("mouse_up", { detail: { user_id: h.id } }));
|
|
3182
3197
|
}
|
|
3183
|
-
const
|
|
3184
|
-
function R(k) {
|
|
3185
|
-
!k.repeat && j.includes(k.key) && o && (h != null && h.id) && o.dispatchEvent(new CustomEvent("key_down", { detail: { key: k.key, user_id: h.id } }));
|
|
3186
|
-
}
|
|
3198
|
+
const R = ["Shift"];
|
|
3187
3199
|
function M(k) {
|
|
3188
|
-
|
|
3200
|
+
!k.repeat && R.includes(k.key) && o && (h != null && h.id) && o.dispatchEvent(new CustomEvent("key_down", { detail: { key: k.key, user_id: h.id } }));
|
|
3189
3201
|
}
|
|
3190
|
-
function X() {
|
|
3202
|
+
function X(k) {
|
|
3203
|
+
R.includes(k.key) && o && (h != null && h.id) && o.dispatchEvent(new CustomEvent("key_up", { detail: { key: k.key, user_id: h.id } }));
|
|
3204
|
+
}
|
|
3205
|
+
function q() {
|
|
3191
3206
|
o && (h != null && h.id) && o.dispatchEvent(new CustomEvent(
|
|
3192
3207
|
"window_resize",
|
|
3193
3208
|
{
|
|
@@ -3199,33 +3214,37 @@ function nn(s, n, t) {
|
|
|
3199
3214
|
}
|
|
3200
3215
|
));
|
|
3201
3216
|
}
|
|
3202
|
-
function Z(k) {
|
|
3203
|
-
Mt[k ? "unshift" : "push"](() => {
|
|
3204
|
-
i = k, t(0, i);
|
|
3205
|
-
});
|
|
3206
|
-
}
|
|
3207
3217
|
return s.$$set = (k) => {
|
|
3208
|
-
"url" in k && t(
|
|
3209
|
-
},
|
|
3218
|
+
"url" in k && t(5, e = k.url), "room_id" in k && t(3, r = k.room_id), "user_name" in k && t(4, i = k.user_name);
|
|
3219
|
+
}, s.$$.update = () => {
|
|
3220
|
+
s.$$.dirty & /*users*/
|
|
3221
|
+
1 && t(2, d = Object.keys(p || {}).length);
|
|
3222
|
+
}, [p, h, d, r, i, e];
|
|
3210
3223
|
}
|
|
3211
3224
|
class rn extends Ke {
|
|
3212
3225
|
constructor(n) {
|
|
3213
|
-
super(), Ze(this, n, nn, sn, Se, { url:
|
|
3226
|
+
super(), Ze(this, n, nn, sn, Se, { url: 5, room_id: 3, user_name: 4 }, en);
|
|
3214
3227
|
}
|
|
3215
3228
|
get url() {
|
|
3216
|
-
return this.$$.ctx[
|
|
3229
|
+
return this.$$.ctx[5];
|
|
3217
3230
|
}
|
|
3218
3231
|
set url(n) {
|
|
3219
|
-
this.$$set({ url: n }),
|
|
3232
|
+
this.$$set({ url: n }), ct();
|
|
3220
3233
|
}
|
|
3221
3234
|
get room_id() {
|
|
3222
3235
|
return this.$$.ctx[3];
|
|
3223
3236
|
}
|
|
3224
3237
|
set room_id(n) {
|
|
3225
|
-
this.$$set({ room_id: n }),
|
|
3238
|
+
this.$$set({ room_id: n }), ct();
|
|
3239
|
+
}
|
|
3240
|
+
get user_name() {
|
|
3241
|
+
return this.$$.ctx[4];
|
|
3242
|
+
}
|
|
3243
|
+
set user_name(n) {
|
|
3244
|
+
this.$$set({ user_name: n }), ct();
|
|
3226
3245
|
}
|
|
3227
3246
|
}
|
|
3228
|
-
customElements.define("liveroom-client-element", Qe(rn, { url: {}, room_id: {} }, [], [], !0));
|
|
3247
|
+
customElements.define("liveroom-client-element", Qe(rn, { url: {}, room_id: {}, user_name: {} }, [], [], !0));
|
|
3229
3248
|
export {
|
|
3230
3249
|
rn as default
|
|
3231
3250
|
};
|