@streamlayer/sdk-web 1.5.5 → 1.6.0
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/lib/cjs/index.js +9 -9
- package/lib/es/index.js +213 -208
- package/lib/index.d.ts +1 -0
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pino as bi } from "pino";
|
|
2
|
-
import { QuestionType as
|
|
2
|
+
import { QuestionType as C, QuestionStatus as J, PromotionType as re, NotificationEnabled as Rr, SilenceSetting as vi } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
|
|
3
3
|
import { PickHistoryStatus as ct } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
|
|
4
4
|
import { SdkOverlayType as D } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
|
|
5
5
|
import { InvitationCategory as Vr, InvitationFrom as $r } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
|
|
@@ -22,7 +22,7 @@ import { NotificationKind as pe, NotificationType as Gr } from "@streamlayer/sl-
|
|
|
22
22
|
function Ii(t) {
|
|
23
23
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
24
24
|
}
|
|
25
|
-
var On = { exports: {} },
|
|
25
|
+
var On = { exports: {} }, V = On.exports = {}, ae, ue;
|
|
26
26
|
function ir() {
|
|
27
27
|
throw new Error("setTimeout has not been defined");
|
|
28
28
|
}
|
|
@@ -87,7 +87,7 @@ function Cn() {
|
|
|
87
87
|
_e = null, xe = !1, Ti(t);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
V.nextTick = function(t) {
|
|
91
91
|
var e = new Array(arguments.length - 1);
|
|
92
92
|
if (arguments.length > 1)
|
|
93
93
|
for (var r = 1; r < arguments.length; r++)
|
|
@@ -100,36 +100,36 @@ function Ln(t, e) {
|
|
|
100
100
|
Ln.prototype.run = function() {
|
|
101
101
|
this.fun.apply(null, this.array);
|
|
102
102
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
V.title = "browser";
|
|
104
|
+
V.browser = !0;
|
|
105
|
+
V.env = {};
|
|
106
|
+
V.argv = [];
|
|
107
|
+
V.version = "";
|
|
108
|
+
V.versions = {};
|
|
109
109
|
function ve() {
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
V.on = ve;
|
|
112
|
+
V.addListener = ve;
|
|
113
|
+
V.once = ve;
|
|
114
|
+
V.off = ve;
|
|
115
|
+
V.removeListener = ve;
|
|
116
|
+
V.removeAllListeners = ve;
|
|
117
|
+
V.emit = ve;
|
|
118
|
+
V.prependListener = ve;
|
|
119
|
+
V.prependOnceListener = ve;
|
|
120
|
+
V.listeners = function(t) {
|
|
121
121
|
return [];
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
V.binding = function(t) {
|
|
124
124
|
throw new Error("process.binding is not supported");
|
|
125
125
|
};
|
|
126
|
-
|
|
126
|
+
V.cwd = function() {
|
|
127
127
|
return "/";
|
|
128
128
|
};
|
|
129
|
-
|
|
129
|
+
V.chdir = function(t) {
|
|
130
130
|
throw new Error("process.chdir is not supported");
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
V.umask = function() {
|
|
133
133
|
return 0;
|
|
134
134
|
};
|
|
135
135
|
var _i = On.exports;
|
|
@@ -203,7 +203,7 @@ class Ce extends kt {
|
|
|
203
203
|
subscribe = (...e) => this.getStore().subscribe(...e);
|
|
204
204
|
unsubscribe = () => this.getStore().off();
|
|
205
205
|
}
|
|
206
|
-
const
|
|
206
|
+
const W = (t) => wi(t);
|
|
207
207
|
var ye;
|
|
208
208
|
(function(t) {
|
|
209
209
|
t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
|
|
@@ -226,7 +226,7 @@ class kn {
|
|
|
226
226
|
listeners = /* @__PURE__ */ new Set();
|
|
227
227
|
settingsKey;
|
|
228
228
|
constructor({ settings: e, ...r }, n) {
|
|
229
|
-
this.settingsKey = Di[r.type], this.status = Lt(Xe.Suspended), this.config = new Ce(
|
|
229
|
+
this.settingsKey = Di[r.type], this.status = Lt(Xe.Suspended), this.config = new Ce(W(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(W(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(W({}), `feature:settings:${this.settingsKey}`), this.source = n;
|
|
230
230
|
}
|
|
231
231
|
get featureConfig() {
|
|
232
232
|
return this.config.getStore();
|
|
@@ -283,7 +283,7 @@ class X extends kt {
|
|
|
283
283
|
return this.getStore().get();
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const j = (t) => Lt(t);
|
|
287
287
|
class le extends kt {
|
|
288
288
|
atomStore;
|
|
289
289
|
constructor(e, r, n) {
|
|
@@ -438,13 +438,13 @@ class $i {
|
|
|
438
438
|
ts: /* @__PURE__ */ new Date(),
|
|
439
439
|
log: []
|
|
440
440
|
};
|
|
441
|
-
this.state = new Ce(
|
|
441
|
+
this.state = new Ce(W(o), `subscription:${i.name}:state`), this.options = {
|
|
442
442
|
...i,
|
|
443
443
|
reconnectDelay: i.reconnectDelay ?? 1e3,
|
|
444
444
|
reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
|
|
445
445
|
reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
|
|
446
446
|
withStore: i.withStore ?? !1
|
|
447
|
-
}, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new X(
|
|
447
|
+
}, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new X(j(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
|
|
448
448
|
this.state.getValue("status") === te.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
|
|
449
449
|
})), this.updateState(te.Ready);
|
|
450
450
|
}
|
|
@@ -580,7 +580,7 @@ class zr {
|
|
|
580
580
|
subscriptions;
|
|
581
581
|
opts;
|
|
582
582
|
constructor(e, r) {
|
|
583
|
-
this.host = e, this.opts = r, this.$headers = new Ce(
|
|
583
|
+
this.host = e, this.opts = r, this.$headers = new Ce(W({
|
|
584
584
|
"sl-device-id": Bi(),
|
|
585
585
|
"sl-device-os": Ui()
|
|
586
586
|
}), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
|
|
@@ -793,7 +793,7 @@ var me;
|
|
|
793
793
|
t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
|
|
794
794
|
})(me || (me = {}));
|
|
795
795
|
const Ji = (t) => {
|
|
796
|
-
const e = new Be(), r = new X(
|
|
796
|
+
const e = new Be(), r = new X(j(e.getExternalToken()), "userKey"), n = new X(j(e.getToken()), "userToken"), i = new le(Gi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, l) => {
|
|
797
797
|
if (!a)
|
|
798
798
|
return s?.data?.id ? s.data.id : u === !1 ? void 0 : l;
|
|
799
799
|
}), o = new le(zi(n.getStore(), t), "userSettings");
|
|
@@ -804,7 +804,7 @@ const Ji = (t) => {
|
|
|
804
804
|
userSettings: o
|
|
805
805
|
};
|
|
806
806
|
}, Xi = (t) => {
|
|
807
|
-
const e = new X(
|
|
807
|
+
const e = new X(j(void 0), "providerStreamId"), r = new le(qi(e.getStore(), t), "slStreamId", (o) => o?.data), n = new le(xi(r.getAtomStore(), t), "streamSettings"), i = new le(Qi(r.getAtomStore(), t), "streamSettings");
|
|
808
808
|
return r.getAtomStore().listen((o) => {
|
|
809
809
|
(o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
|
|
810
810
|
}), {
|
|
@@ -814,7 +814,7 @@ const Ji = (t) => {
|
|
|
814
814
|
streamSummary: i
|
|
815
815
|
};
|
|
816
816
|
}, Zi = (t) => {
|
|
817
|
-
const e = new X(
|
|
817
|
+
const e = new X(j(void 0), "enabled"), r = new X(j(me.DISABLED), "status"), n = new le(Hi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new le(Wi(n.getAtomStore(), t), "organizationAdvertising"), o = Ji(t), s = Xi(t);
|
|
818
818
|
return {
|
|
819
819
|
enabled: e,
|
|
820
820
|
status: r,
|
|
@@ -900,7 +900,7 @@ const to = (t, e, r) => {
|
|
|
900
900
|
eventId: s
|
|
901
901
|
}
|
|
902
902
|
});
|
|
903
|
-
if (a.data?.attributes?.question?.type !==
|
|
903
|
+
if (a.data?.attributes?.question?.type !== C.PROMOTION)
|
|
904
904
|
return a.data?.attributes;
|
|
905
905
|
},
|
|
906
906
|
dedupeTime: 1e3 * 60 * 10,
|
|
@@ -952,8 +952,8 @@ const to = (t, e, r) => {
|
|
|
952
952
|
fetcher: async (o, s, a, u) => a ? (await n.list({
|
|
953
953
|
eventId: a,
|
|
954
954
|
filter: {
|
|
955
|
-
types: u === Le.ALLOWED ? [] : [
|
|
956
|
-
statuses: [
|
|
955
|
+
types: u === Le.ALLOWED ? [] : [C.FACTOID, C.PROMOTION, C.TWEET],
|
|
956
|
+
statuses: [J.ACTIVE, J.RESOLVED]
|
|
957
957
|
}
|
|
958
958
|
})).data : [],
|
|
959
959
|
dedupeTime: 0,
|
|
@@ -971,8 +971,8 @@ const to = (t, e, r) => {
|
|
|
971
971
|
const u = (await r.list({
|
|
972
972
|
eventId: s,
|
|
973
973
|
filter: {
|
|
974
|
-
types: [
|
|
975
|
-
statuses: [
|
|
974
|
+
types: [C.PROMOTION],
|
|
975
|
+
statuses: [J.ACTIVE]
|
|
976
976
|
},
|
|
977
977
|
pagination: {
|
|
978
978
|
page: 0,
|
|
@@ -1058,7 +1058,7 @@ const yo = (t) => {
|
|
|
1058
1058
|
return r + n.join("&");
|
|
1059
1059
|
}, go = (t, e, r) => {
|
|
1060
1060
|
let n = !1;
|
|
1061
|
-
const i = r.transport, o = Se("advertisement"), s = new ho(), a =
|
|
1061
|
+
const i = r.transport, o = Se("advertisement"), s = new ho(), a = W({}), u = fo(t, i), l = () => {
|
|
1062
1062
|
a.setKey("hasNotification", !1);
|
|
1063
1063
|
const g = a.get(), b = g.data?.question.id, S = g.data?.promotion?.type;
|
|
1064
1064
|
b && G.emit("advertisement", {
|
|
@@ -1069,8 +1069,8 @@ const yo = (t) => {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
});
|
|
1071
1071
|
}, c = () => {
|
|
1072
|
-
const g = a.get(), b = g.data?.question.id, S = g.data?.promotion?.type,
|
|
1073
|
-
b && !
|
|
1072
|
+
const g = a.get(), b = g.data?.question.id, S = g.data?.promotion?.type, O = a.get()?.isOpened;
|
|
1073
|
+
b && !O && (o.debug({ id: b }, "markAsViewed: %o"), s.setShowed(b), a.setKey("isOpened", !0), G.emit("advertisement", {
|
|
1074
1074
|
action: "opened",
|
|
1075
1075
|
payload: {
|
|
1076
1076
|
id: b,
|
|
@@ -1131,11 +1131,11 @@ const yo = (t) => {
|
|
|
1131
1131
|
}), e.addListener("promotion", (g) => {
|
|
1132
1132
|
const b = yo(g);
|
|
1133
1133
|
if (b) {
|
|
1134
|
-
if (b.question.status ===
|
|
1134
|
+
if (b.question.status === J.RESOLVED) {
|
|
1135
1135
|
p(b.question.id), o.debug({ promotion: b }, "resolved: %o");
|
|
1136
1136
|
return;
|
|
1137
1137
|
}
|
|
1138
|
-
if (b.question.status ===
|
|
1138
|
+
if (b.question.status === J.ACTIVE) {
|
|
1139
1139
|
o.debug({ promotion: b }, "active: %o"), f(b.question.id, b);
|
|
1140
1140
|
return;
|
|
1141
1141
|
}
|
|
@@ -1181,14 +1181,14 @@ class bo {
|
|
|
1181
1181
|
transport;
|
|
1182
1182
|
cancels = /* @__PURE__ */ new Set();
|
|
1183
1183
|
constructor(e) {
|
|
1184
|
-
this.transport = e.transport, this.log = Se("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new X(
|
|
1184
|
+
this.transport = e.transport, this.log = Se("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new X(j(void 0), "moderationId").getStore(), this.interactiveAllowed = new X(j(Le.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new X(j(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new le(io(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new le(lo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = oo(this.slStreamId, e.transport), this.openedQuestion = po(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
|
|
1185
1185
|
this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = uo(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
|
|
1186
1186
|
this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
|
|
1187
1187
|
}), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
|
|
1188
1188
|
})), this.feedSubscription = ao(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
|
|
1189
1189
|
const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
|
|
1190
|
-
if (!(!i || i.type ===
|
|
1191
|
-
if (i.status ===
|
|
1190
|
+
if (!(!i || i.type === C.PROMOTION)) {
|
|
1191
|
+
if (i.status === J.RESOLVED) {
|
|
1192
1192
|
n === i.id && this.activeQuestionId.mutate(void 0);
|
|
1193
1193
|
return;
|
|
1194
1194
|
}
|
|
@@ -1267,7 +1267,7 @@ class vo {
|
|
|
1267
1267
|
options;
|
|
1268
1268
|
logger;
|
|
1269
1269
|
constructor(e) {
|
|
1270
|
-
this.options = e, this.logger = Se("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList =
|
|
1270
|
+
this.options = e, this.logger = Se("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = j(/* @__PURE__ */ new Map());
|
|
1271
1271
|
}
|
|
1272
1272
|
addToQueue = (e) => {
|
|
1273
1273
|
if (this.store.has(e.id)) {
|
|
@@ -1464,7 +1464,7 @@ const Oo = {
|
|
|
1464
1464
|
pageSize: 10
|
|
1465
1465
|
}, _o = (t, e, r, n, i) => {
|
|
1466
1466
|
let o = 0;
|
|
1467
|
-
const s =
|
|
1467
|
+
const s = j({ pageSize: Oo.pageSize, page: 0 }), a = W({
|
|
1468
1468
|
data: [],
|
|
1469
1469
|
key: Date.now(),
|
|
1470
1470
|
hasMore: !0,
|
|
@@ -1480,9 +1480,9 @@ const Oo = {
|
|
|
1480
1480
|
usersIds: v
|
|
1481
1481
|
});
|
|
1482
1482
|
a.set({
|
|
1483
|
-
data: S.data.map((
|
|
1484
|
-
...
|
|
1485
|
-
friendsRank:
|
|
1483
|
+
data: S.data.map((O, $) => ({
|
|
1484
|
+
...O.attributes,
|
|
1485
|
+
friendsRank: $ + 1
|
|
1486
1486
|
})),
|
|
1487
1487
|
hasMore: !1,
|
|
1488
1488
|
key: Date.now(),
|
|
@@ -1564,7 +1564,7 @@ const Hr = "sldl", Pt = "sldl_uid", Vn = "sldl_eid", $n = "sldl_e_eid", Lo = /*
|
|
|
1564
1564
|
ce.debug(a);
|
|
1565
1565
|
}
|
|
1566
1566
|
t.deepLink = {
|
|
1567
|
-
$store: new Ce(
|
|
1567
|
+
$store: new Ce(W(o), "deep-link-context"),
|
|
1568
1568
|
getDeepLinkData: () => {
|
|
1569
1569
|
const { data: a, used: u } = t.deepLink.$store.getValues();
|
|
1570
1570
|
return { data: a, used: u };
|
|
@@ -1721,13 +1721,13 @@ const Je = new Be(), Ro = (t, e, r) => {
|
|
|
1721
1721
|
}
|
|
1722
1722
|
}, r();
|
|
1723
1723
|
}, $o = {
|
|
1724
|
-
[
|
|
1725
|
-
[
|
|
1726
|
-
[
|
|
1727
|
-
[
|
|
1728
|
-
[
|
|
1724
|
+
[C.FACTOID]: "insight",
|
|
1725
|
+
[C.POLL]: "poll",
|
|
1726
|
+
[C.TRIVIA]: "trivia",
|
|
1727
|
+
[C.PREDICTION]: "prediction",
|
|
1728
|
+
[C.TWEET]: "tweet"
|
|
1729
1729
|
}, Mo = (t, e, r) => {
|
|
1730
|
-
t.sdk.uiState =
|
|
1730
|
+
t.sdk.uiState = W({}), t.ui = {
|
|
1731
1731
|
enableAppNotification: function() {
|
|
1732
1732
|
t.sdk.uiState.setKey("appNotification", !0);
|
|
1733
1733
|
},
|
|
@@ -1829,7 +1829,7 @@ const Je = new Be(), Ro = (t, e, r) => {
|
|
|
1829
1829
|
}), r();
|
|
1830
1830
|
}, jo = (t, e, r) => {
|
|
1831
1831
|
const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1832
|
-
t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
|
|
1832
|
+
t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = W(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
|
|
1833
1833
|
if (i.has(s)) {
|
|
1834
1834
|
const l = o.get(s);
|
|
1835
1835
|
l && l(), i.delete(s), o.delete(s);
|
|
@@ -1884,22 +1884,22 @@ const Je = new Be(), Ro = (t, e, r) => {
|
|
|
1884
1884
|
r.append(n, i);
|
|
1885
1885
|
return r.toString();
|
|
1886
1886
|
}, qo = (t, e, r, n) => {
|
|
1887
|
-
const i =
|
|
1888
|
-
return br(i, () => Bo(t, [e, r]).subscribe(async ({ data: a,
|
|
1889
|
-
const
|
|
1890
|
-
[Pt]:
|
|
1891
|
-
[Vn]:
|
|
1892
|
-
[$n]:
|
|
1887
|
+
const i = W({});
|
|
1888
|
+
return br(i, () => Bo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
|
|
1889
|
+
const l = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
|
|
1890
|
+
[Pt]: c,
|
|
1891
|
+
[Vn]: f,
|
|
1892
|
+
[$n]: p
|
|
1893
1893
|
};
|
|
1894
|
-
if (!
|
|
1894
|
+
if (!u && l) {
|
|
1895
1895
|
i.setKey("loading", !0);
|
|
1896
|
-
let
|
|
1897
|
-
|
|
1898
|
-
const
|
|
1896
|
+
let g = window.location.search, b = window.location.hash;
|
|
1897
|
+
g && b || b ? g = `?${Xr(g, v)}` : b = `#${Xr("", v)}`;
|
|
1898
|
+
const S = window.location.origin + window.location.pathname + g + b;
|
|
1899
1899
|
try {
|
|
1900
|
-
const
|
|
1900
|
+
const O = await Uo(t, { web: S, mobile: l });
|
|
1901
1901
|
i.set({
|
|
1902
|
-
data:
|
|
1902
|
+
data: O.data?.link,
|
|
1903
1903
|
loading: !1
|
|
1904
1904
|
});
|
|
1905
1905
|
} catch {
|
|
@@ -1930,7 +1930,7 @@ const xo = (t, e, r, n) => {
|
|
|
1930
1930
|
autoHideDuration: 1e6,
|
|
1931
1931
|
data: {
|
|
1932
1932
|
questionId: "onboarding",
|
|
1933
|
-
questionType:
|
|
1933
|
+
questionType: C.UNSET,
|
|
1934
1934
|
onboarding: {
|
|
1935
1935
|
...i,
|
|
1936
1936
|
instantOpen: !n.getOnboardingInstantOpen({
|
|
@@ -1966,7 +1966,7 @@ const xo = (t, e, r, n) => {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
}, Qo = (t, e, r, n) => {
|
|
1968
1968
|
let i = !1;
|
|
1969
|
-
const o = new Rn(), s =
|
|
1969
|
+
const o = new Rn(), s = j(M.Unset);
|
|
1970
1970
|
s.subscribe((l) => {
|
|
1971
1971
|
l !== M.Unset && (l === M.Optional || l === M.Required ? i === !1 && (xo(t, e, n, o), i = !0) : t.onboardingProcessed.set(!0), l === M.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
|
|
1972
1972
|
userId: e.userId.get() || "",
|
|
@@ -1997,7 +1997,7 @@ const xo = (t, e, r, n) => {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
} };
|
|
1999
1999
|
}, Go = (t, e, r, n) => {
|
|
2000
|
-
const i =
|
|
2000
|
+
const i = W(void 0), o = Fn(n), s = async () => {
|
|
2001
2001
|
const u = t.get(), l = e.get(), c = r.getStore().get().data?.map((v) => v.slId);
|
|
2002
2002
|
if (!c)
|
|
2003
2003
|
return;
|
|
@@ -2023,7 +2023,7 @@ const xo = (t, e, r, n) => {
|
|
|
2023
2023
|
usersIds: [...u, a]
|
|
2024
2024
|
};
|
|
2025
2025
|
return (await o(l)).data?.attributes?.summary;
|
|
2026
|
-
}, zo = /* @__PURE__ */ new Set([
|
|
2026
|
+
}, zo = /* @__PURE__ */ new Set([C.POLL, C.PREDICTION, C.TRIVIA]);
|
|
2027
2027
|
class Ho extends kn {
|
|
2028
2028
|
/** user statistics (leaderboard panel) */
|
|
2029
2029
|
userSummary;
|
|
@@ -2051,6 +2051,7 @@ class Ho extends kn {
|
|
|
2051
2051
|
openedQuestionId;
|
|
2052
2052
|
advertisement;
|
|
2053
2053
|
onboardingProcessed;
|
|
2054
|
+
friendsTabEnabled;
|
|
2054
2055
|
notifications;
|
|
2055
2056
|
transport;
|
|
2056
2057
|
/** gamification background class, handle subscriptions and notifications for closed overlay */
|
|
@@ -2061,11 +2062,15 @@ class Ho extends kn {
|
|
|
2061
2062
|
cancels = /* @__PURE__ */ new Set();
|
|
2062
2063
|
onQuestionActivate;
|
|
2063
2064
|
constructor(e, r, n) {
|
|
2064
|
-
super(e, r), this.background = new bo(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Rn(), this.feedList = this.background.feedList, this.friends = new le(no(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser =
|
|
2065
|
+
super(e, r), this.background = new bo(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Rn(), this.feedList = this.background.feedList, this.friends = new le(no(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = j(void 0), this.onboardingProcessed = j(!n.sdk.withAuth), this.leaderboardId = new X(j(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Qo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(D.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = qo(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Go(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = _o(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
|
|
2065
2066
|
o?.summary && i?.summary && this.leaderboardList.invalidate();
|
|
2066
2067
|
})), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), this.cancels.add(this.onboardingStatus.$store.listen((i, o) => {
|
|
2067
2068
|
(o === void 0 || i !== M.Unset) && this.background.activeQuestionId.invalidate();
|
|
2068
|
-
})), this.background.activeQuestionId.listen(this.showInApp),
|
|
2069
|
+
})), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = j(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
|
|
2070
|
+
i.friendsTab === "disabled" ? this.friendsTabEnabled.set(!1) : i.friendsTab === "enabled" && this.friendsTabEnabled.set(!0);
|
|
2071
|
+
})), this.cancels.add(this.settings.subscribe((i) => {
|
|
2072
|
+
n.sdk.options.get().friendsTab === "activatedGame" && this.friendsTabEnabled.set(!!i.inplayGame?.titleCard?.optIn);
|
|
2073
|
+
})), n.sdk.onMount({ name: "gamification", clear: !0 }, () => () => {
|
|
2069
2074
|
for (const i of this.cancels)
|
|
2070
2075
|
i(), this.cancels.delete(i);
|
|
2071
2076
|
});
|
|
@@ -2087,7 +2092,7 @@ class Ho extends kn {
|
|
|
2087
2092
|
if (!r || !n?.attributes)
|
|
2088
2093
|
return;
|
|
2089
2094
|
const { status: i, type: o, id: s, answers: a } = r;
|
|
2090
|
-
if (i ===
|
|
2095
|
+
if (i === J.RESOLVED && o === C.PREDICTION) {
|
|
2091
2096
|
const u = this.background.getCurrentSessionId({
|
|
2092
2097
|
prefix: `notification-id:${s}`
|
|
2093
2098
|
}), l = [...this.feedList.getValues().data || []], c = l.findIndex((K) => K.id === s), f = l[c];
|
|
@@ -2099,35 +2104,35 @@ class Ho extends kn {
|
|
|
2099
2104
|
b || (b = await co(s, this.transport)), g(), window.requestAnimationFrame(() => {
|
|
2100
2105
|
v.invalidate();
|
|
2101
2106
|
}), p || (p = b?.answers.find(({ youVoted: K }) => K)?.id);
|
|
2102
|
-
const S = a.find(({ correct: K }) => K),
|
|
2107
|
+
const S = a.find(({ correct: K }) => K), O = p ? a.find(({ id: K }) => K === p) : void 0, $ = !!O?.correct;
|
|
2103
2108
|
if (f && l[c]?.attributes?.attributes.case === "question") {
|
|
2104
2109
|
try {
|
|
2105
|
-
l[c].attributes.attributes.value.answerId = p, l[c].attributes.attributes.value.openForVoting = !1, p && (l[c].attributes.attributes.value.status =
|
|
2110
|
+
l[c].attributes.attributes.value.answerId = p, l[c].attributes.attributes.value.openForVoting = !1, p && (l[c].attributes.attributes.value.status = $ ? ct.WON : ct.LOST);
|
|
2106
2111
|
} catch {
|
|
2107
2112
|
}
|
|
2108
2113
|
this.feedList.getStore().mutate(l);
|
|
2109
2114
|
}
|
|
2110
|
-
if (!
|
|
2115
|
+
if (!O || !S)
|
|
2111
2116
|
return;
|
|
2112
2117
|
this.openedQuestionId.get()?.questionId !== r.id && this.notifications.add({
|
|
2113
2118
|
type: Ee.QUESTION_RESOLVED,
|
|
2114
2119
|
action: () => this.openQuestion(r.id, n),
|
|
2115
2120
|
close: () => this.closeQuestion(s),
|
|
2116
|
-
autoHideDuration:
|
|
2121
|
+
autoHideDuration: $ ? 15e3 : 12e3,
|
|
2117
2122
|
id: u,
|
|
2118
2123
|
emitEvent: !1,
|
|
2119
2124
|
data: {
|
|
2120
2125
|
questionId: s,
|
|
2121
|
-
questionType:
|
|
2126
|
+
questionType: C.PREDICTION,
|
|
2122
2127
|
question: {
|
|
2123
|
-
title:
|
|
2128
|
+
title: $ ? `Congratulations! You answered correctly! You won ${S.points} pts!` : `Better luck next time! Correct: ${S?.text}!`,
|
|
2124
2129
|
votedAnswer: {
|
|
2125
|
-
title:
|
|
2126
|
-
points:
|
|
2130
|
+
title: O?.text,
|
|
2131
|
+
points: O?.points
|
|
2127
2132
|
},
|
|
2128
2133
|
correctAnswerTitle: S?.text,
|
|
2129
|
-
correct:
|
|
2130
|
-
predictionResult: i ===
|
|
2134
|
+
correct: !!$,
|
|
2135
|
+
predictionResult: i === J.RESOLVED,
|
|
2131
2136
|
questionTitle: r?.subject
|
|
2132
2137
|
}
|
|
2133
2138
|
}
|
|
@@ -2135,7 +2140,7 @@ class Ho extends kn {
|
|
|
2135
2140
|
}
|
|
2136
2141
|
})), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
|
|
2137
2142
|
const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
|
|
2138
|
-
if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !==
|
|
2143
|
+
if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== J.ACTIVE && n.attributes.status !== J.RESOLVED)) {
|
|
2139
2144
|
if (i !== -1)
|
|
2140
2145
|
if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
|
|
2141
2146
|
const o = r[i];
|
|
@@ -2212,10 +2217,10 @@ class Ho extends kn {
|
|
|
2212
2217
|
});
|
|
2213
2218
|
const f = n.get().data;
|
|
2214
2219
|
if (i(), f) {
|
|
2215
|
-
const p = f.answers.find((S) => S.correct === !0), v = f.answers.findIndex((S) => S.id === r), g = f.answers[v], b = f.answers.every(({ percentageDecimal: S },
|
|
2220
|
+
const p = f.answers.find((S) => S.correct === !0), v = f.answers.findIndex((S) => S.id === r), g = f.answers[v], b = f.answers.every(({ percentageDecimal: S }, O) => S === o?.answers[O].percentageDecimal);
|
|
2216
2221
|
a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = g?.text || "", p && (a[u].attributes.attributes.value.status = p.id === r ? ct.WON : ct.LOST), this.feedList.getStore().mutate([...a]), f.answers[v].correct = p?.id === r, f.answers[v].youVoted = !0, b && f.answers.forEach((S) => {
|
|
2217
2222
|
S.percentageDecimal = 0;
|
|
2218
|
-
}), p?.id === r && (f.answers[v].pointsEarned = f.status ===
|
|
2223
|
+
}), p?.id === r && (f.answers[v].pointsEarned = f.status === J.RESOLVED ? 0 : p.points), n.mutate({ ...f });
|
|
2219
2224
|
}
|
|
2220
2225
|
this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
|
|
2221
2226
|
this.userSummary.invalidate();
|
|
@@ -2294,7 +2299,7 @@ class Ho extends kn {
|
|
|
2294
2299
|
*/
|
|
2295
2300
|
showInApp = (e) => {
|
|
2296
2301
|
const r = this.onboardingStatus.$store.get();
|
|
2297
|
-
if (e && e.data && r && r !== M.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== vi.ON && e.data.question.status ===
|
|
2302
|
+
if (e && e.data && r && r !== M.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== vi.ON && e.data.question.status === J.ACTIVE && !e.data.question.marketClosed) {
|
|
2298
2303
|
if (zo.has(e.data.question.type))
|
|
2299
2304
|
this.isInteractiveAllowed && this.notifications.add({
|
|
2300
2305
|
type: Ee.QUESTION,
|
|
@@ -2314,7 +2319,7 @@ class Ho extends kn {
|
|
|
2314
2319
|
}
|
|
2315
2320
|
}
|
|
2316
2321
|
});
|
|
2317
|
-
else if (e.data.question.type ===
|
|
2322
|
+
else if (e.data.question.type === C.FACTOID) {
|
|
2318
2323
|
const n = e.data.question.options?.options.value, i = {
|
|
2319
2324
|
heading: e.data.question.notification.title,
|
|
2320
2325
|
body: e.data.question.notification.body,
|
|
@@ -2343,7 +2348,7 @@ class Ho extends kn {
|
|
|
2343
2348
|
insight: i
|
|
2344
2349
|
}
|
|
2345
2350
|
});
|
|
2346
|
-
} else if (e.data.question.type ===
|
|
2351
|
+
} else if (e.data.question.type === C.TWEET) {
|
|
2347
2352
|
const n = e.data.question.options?.options.value, i = {
|
|
2348
2353
|
title: e.data.question.notification?.title,
|
|
2349
2354
|
body: e.data.question.notification?.body,
|
|
@@ -2379,7 +2384,7 @@ class Yo extends kn {
|
|
|
2379
2384
|
}
|
|
2380
2385
|
}
|
|
2381
2386
|
const Jo = (t, e, r) => t.type === D.GAMES ? new Ho(t, e, r) : new Yo(t, e), Xo = (t, e, r) => {
|
|
2382
|
-
t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new X(
|
|
2387
|
+
t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new X(j(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new X(j(D.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
|
|
2383
2388
|
t.activeFeature.setValue(n);
|
|
2384
2389
|
}, t.sdk.closeFeature = (n = !1) => {
|
|
2385
2390
|
const i = t.activeFeature.getValue();
|
|
@@ -2616,15 +2621,15 @@ class rs {
|
|
|
2616
2621
|
};
|
|
2617
2622
|
}
|
|
2618
2623
|
const Ze = {
|
|
2619
|
-
[
|
|
2620
|
-
[
|
|
2621
|
-
[
|
|
2622
|
-
[
|
|
2623
|
-
[
|
|
2624
|
-
[
|
|
2625
|
-
[
|
|
2624
|
+
[C.UNSET]: x.UNSET,
|
|
2625
|
+
[C.FACTOID]: x.POLLS_INSIGHT,
|
|
2626
|
+
[C.POLL]: x.POLLS_POLL,
|
|
2627
|
+
[C.PREDICTION]: x.POLLS_PREDICTION,
|
|
2628
|
+
[C.PROMOTION]: x.POLLS_PROMOTION,
|
|
2629
|
+
[C.TRIVIA]: x.POLLS_TRIVIA,
|
|
2630
|
+
[C.TWEET]: x.POLLS_TWITTER
|
|
2626
2631
|
};
|
|
2627
|
-
|
|
2632
|
+
C.UNSET + "", pe.UNSET, C.FACTOID + "", pe.POLLS, C.POLL + "", pe.POLLS, C.PREDICTION + "", pe.POLLS, C.PROMOTION + "", pe.POLLS, C.TRIVIA + "", pe.POLLS, C.TWEET + "", pe.POLLS;
|
|
2628
2633
|
const ns = {
|
|
2629
2634
|
[D.UNSET]: z.UNSET,
|
|
2630
2635
|
[D.INPLAY]: z.INPLAY,
|
|
@@ -2774,7 +2779,7 @@ class os {
|
|
|
2774
2779
|
}
|
|
2775
2780
|
const ss = ({ transport: t, $commonStore: e }) => {
|
|
2776
2781
|
let r;
|
|
2777
|
-
const n =
|
|
2782
|
+
const n = j(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(Tn, {
|
|
2778
2783
|
method: "send",
|
|
2779
2784
|
params: [n]
|
|
2780
2785
|
}), a = t.nanoquery.createFetcherStore(s, {
|
|
@@ -2823,7 +2828,7 @@ class as {
|
|
|
2823
2828
|
listenersCancels;
|
|
2824
2829
|
connected = !1;
|
|
2825
2830
|
constructor(e) {
|
|
2826
|
-
this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ce(
|
|
2831
|
+
this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ce(W({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ss({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new is(this), this.polls = new os(this), this.invitation = new Zo(this), this.interactions = new es(this), this.advertisement = new rs(this);
|
|
2827
2832
|
const { client: r } = e.analyticsTransport.createPromiseClient(Tn, {
|
|
2828
2833
|
method: "send"
|
|
2829
2834
|
});
|
|
@@ -2896,8 +2901,8 @@ function Mn(t, e, r) {
|
|
|
2896
2901
|
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
2897
2902
|
var n = fs(ps), i = null, o = null, s = 0, a = null, u = {
|
|
2898
2903
|
push: b,
|
|
2899
|
-
drain:
|
|
2900
|
-
saturated:
|
|
2904
|
+
drain: Y,
|
|
2905
|
+
saturated: Y,
|
|
2901
2906
|
pause: c,
|
|
2902
2907
|
paused: !1,
|
|
2903
2908
|
get concurrency() {
|
|
@@ -2908,7 +2913,7 @@ function Mn(t, e, r) {
|
|
|
2908
2913
|
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
2909
2914
|
if (r = P, !u.paused)
|
|
2910
2915
|
for (; i && s < r; )
|
|
2911
|
-
s++,
|
|
2916
|
+
s++, O();
|
|
2912
2917
|
},
|
|
2913
2918
|
running: l,
|
|
2914
2919
|
resume: v,
|
|
@@ -2916,8 +2921,8 @@ function Mn(t, e, r) {
|
|
|
2916
2921
|
length: f,
|
|
2917
2922
|
getQueue: p,
|
|
2918
2923
|
unshift: S,
|
|
2919
|
-
empty:
|
|
2920
|
-
kill:
|
|
2924
|
+
empty: Y,
|
|
2925
|
+
kill: $,
|
|
2921
2926
|
killAndDrain: K,
|
|
2922
2927
|
error: ee
|
|
2923
2928
|
};
|
|
@@ -2929,59 +2934,59 @@ function Mn(t, e, r) {
|
|
|
2929
2934
|
u.paused = !0;
|
|
2930
2935
|
}
|
|
2931
2936
|
function f() {
|
|
2932
|
-
for (var P = i,
|
|
2933
|
-
P = P.next,
|
|
2934
|
-
return
|
|
2937
|
+
for (var P = i, R = 0; P; )
|
|
2938
|
+
P = P.next, R++;
|
|
2939
|
+
return R;
|
|
2935
2940
|
}
|
|
2936
2941
|
function p() {
|
|
2937
|
-
for (var P = i,
|
|
2938
|
-
|
|
2939
|
-
return
|
|
2942
|
+
for (var P = i, R = []; P; )
|
|
2943
|
+
R.push(P.value), P = P.next;
|
|
2944
|
+
return R;
|
|
2940
2945
|
}
|
|
2941
2946
|
function v() {
|
|
2942
2947
|
if (u.paused) {
|
|
2943
2948
|
if (u.paused = !1, i === null) {
|
|
2944
|
-
s++,
|
|
2949
|
+
s++, O();
|
|
2945
2950
|
return;
|
|
2946
2951
|
}
|
|
2947
2952
|
for (; i && s < r; )
|
|
2948
|
-
s++,
|
|
2953
|
+
s++, O();
|
|
2949
2954
|
}
|
|
2950
2955
|
}
|
|
2951
2956
|
function g() {
|
|
2952
2957
|
return s === 0 && u.length() === 0;
|
|
2953
2958
|
}
|
|
2954
|
-
function b(P,
|
|
2959
|
+
function b(P, R) {
|
|
2955
2960
|
var T = n.get();
|
|
2956
|
-
T.context = t, T.release =
|
|
2961
|
+
T.context = t, T.release = O, T.value = P, T.callback = R || Y, T.errorHandler = a, s >= r || u.paused ? o ? (o.next = T, o = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
|
|
2957
2962
|
}
|
|
2958
|
-
function S(P,
|
|
2963
|
+
function S(P, R) {
|
|
2959
2964
|
var T = n.get();
|
|
2960
|
-
T.context = t, T.release =
|
|
2965
|
+
T.context = t, T.release = O, T.value = P, T.callback = R || Y, T.errorHandler = a, s >= r || u.paused ? i ? (T.next = i, i = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
|
|
2961
2966
|
}
|
|
2962
|
-
function
|
|
2967
|
+
function O(P) {
|
|
2963
2968
|
P && n.release(P);
|
|
2964
|
-
var
|
|
2965
|
-
|
|
2969
|
+
var R = i;
|
|
2970
|
+
R && s <= r ? u.paused ? s-- : (o === i && (o = null), i = R.next, R.next = null, e.call(t, R.value, R.worked), o === null && u.empty()) : --s === 0 && u.drain();
|
|
2966
2971
|
}
|
|
2967
|
-
function
|
|
2968
|
-
i = null, o = null, u.drain =
|
|
2972
|
+
function $() {
|
|
2973
|
+
i = null, o = null, u.drain = Y;
|
|
2969
2974
|
}
|
|
2970
2975
|
function K() {
|
|
2971
|
-
i = null, o = null, u.drain(), u.drain =
|
|
2976
|
+
i = null, o = null, u.drain(), u.drain = Y;
|
|
2972
2977
|
}
|
|
2973
2978
|
function ee(P) {
|
|
2974
2979
|
a = P;
|
|
2975
2980
|
}
|
|
2976
2981
|
}
|
|
2977
|
-
function
|
|
2982
|
+
function Y() {
|
|
2978
2983
|
}
|
|
2979
2984
|
function ps() {
|
|
2980
|
-
this.value = null, this.callback =
|
|
2985
|
+
this.value = null, this.callback = Y, this.next = null, this.release = Y, this.context = null, this.errorHandler = null;
|
|
2981
2986
|
var t = this;
|
|
2982
2987
|
this.worked = function(r, n) {
|
|
2983
2988
|
var i = t.callback, o = t.errorHandler, s = t.value;
|
|
2984
|
-
t.value = null, t.callback =
|
|
2989
|
+
t.value = null, t.callback = Y, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
|
|
2985
2990
|
};
|
|
2986
2991
|
}
|
|
2987
2992
|
function hs(t, e, r) {
|
|
@@ -3003,7 +3008,7 @@ function hs(t, e, r) {
|
|
|
3003
3008
|
p(b);
|
|
3004
3009
|
});
|
|
3005
3010
|
});
|
|
3006
|
-
return f.catch(
|
|
3011
|
+
return f.catch(Y), f;
|
|
3007
3012
|
}
|
|
3008
3013
|
function u(c) {
|
|
3009
3014
|
var f = new Promise(function(p, v) {
|
|
@@ -3015,7 +3020,7 @@ function hs(t, e, r) {
|
|
|
3015
3020
|
p(b);
|
|
3016
3021
|
});
|
|
3017
3022
|
});
|
|
3018
|
-
return f.catch(
|
|
3023
|
+
return f.catch(Y), f;
|
|
3019
3024
|
}
|
|
3020
3025
|
function l() {
|
|
3021
3026
|
if (i.idle())
|
|
@@ -3349,14 +3354,14 @@ var qt = function() {
|
|
|
3349
3354
|
return qt;
|
|
3350
3355
|
}
|
|
3351
3356
|
}
|
|
3352
|
-
}() : qt, $e = Cs(), Ws = ks(),
|
|
3357
|
+
}() : qt, $e = Cs(), Ws = ks(), B = Object.getPrototypeOf || (Ws ? function(t) {
|
|
3353
3358
|
return t.__proto__;
|
|
3354
|
-
} : null), je = {}, Ys = typeof Uint8Array > "u" || !
|
|
3359
|
+
} : null), je = {}, Ys = typeof Uint8Array > "u" || !B ? I : B(Uint8Array), Pe = {
|
|
3355
3360
|
__proto__: null,
|
|
3356
3361
|
"%AggregateError%": typeof AggregateError > "u" ? I : AggregateError,
|
|
3357
3362
|
"%Array%": Array,
|
|
3358
3363
|
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? I : ArrayBuffer,
|
|
3359
|
-
"%ArrayIteratorPrototype%": $e &&
|
|
3364
|
+
"%ArrayIteratorPrototype%": $e && B ? B([][Symbol.iterator]()) : I,
|
|
3360
3365
|
"%AsyncFromSyncIteratorPrototype%": I,
|
|
3361
3366
|
"%AsyncFunction%": je,
|
|
3362
3367
|
"%AsyncGenerator%": je,
|
|
@@ -3387,10 +3392,10 @@ var qt = function() {
|
|
|
3387
3392
|
"%Int32Array%": typeof Int32Array > "u" ? I : Int32Array,
|
|
3388
3393
|
"%isFinite%": isFinite,
|
|
3389
3394
|
"%isNaN%": isNaN,
|
|
3390
|
-
"%IteratorPrototype%": $e &&
|
|
3395
|
+
"%IteratorPrototype%": $e && B ? B(B([][Symbol.iterator]())) : I,
|
|
3391
3396
|
"%JSON%": typeof JSON == "object" ? JSON : I,
|
|
3392
3397
|
"%Map%": typeof Map > "u" ? I : Map,
|
|
3393
|
-
"%MapIteratorPrototype%": typeof Map > "u" || !$e || !
|
|
3398
|
+
"%MapIteratorPrototype%": typeof Map > "u" || !$e || !B ? I : B((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
3394
3399
|
"%Math%": Math,
|
|
3395
3400
|
"%Number%": Number,
|
|
3396
3401
|
"%Object%": Object,
|
|
@@ -3403,10 +3408,10 @@ var qt = function() {
|
|
|
3403
3408
|
"%Reflect%": typeof Reflect > "u" ? I : Reflect,
|
|
3404
3409
|
"%RegExp%": RegExp,
|
|
3405
3410
|
"%Set%": typeof Set > "u" ? I : Set,
|
|
3406
|
-
"%SetIteratorPrototype%": typeof Set > "u" || !$e || !
|
|
3411
|
+
"%SetIteratorPrototype%": typeof Set > "u" || !$e || !B ? I : B((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
3407
3412
|
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? I : SharedArrayBuffer,
|
|
3408
3413
|
"%String%": String,
|
|
3409
|
-
"%StringIteratorPrototype%": $e &&
|
|
3414
|
+
"%StringIteratorPrototype%": $e && B ? B(""[Symbol.iterator]()) : I,
|
|
3410
3415
|
"%Symbol%": $e ? Symbol : I,
|
|
3411
3416
|
"%SyntaxError%": Ke,
|
|
3412
3417
|
"%ThrowTypeError%": Hs,
|
|
@@ -3421,11 +3426,11 @@ var qt = function() {
|
|
|
3421
3426
|
"%WeakRef%": typeof WeakRef > "u" ? I : WeakRef,
|
|
3422
3427
|
"%WeakSet%": typeof WeakSet > "u" ? I : WeakSet
|
|
3423
3428
|
};
|
|
3424
|
-
if (
|
|
3429
|
+
if (B)
|
|
3425
3430
|
try {
|
|
3426
3431
|
null.error;
|
|
3427
3432
|
} catch (t) {
|
|
3428
|
-
var Js =
|
|
3433
|
+
var Js = B(B(t));
|
|
3429
3434
|
Pe["%Error.prototype%"] = Js;
|
|
3430
3435
|
}
|
|
3431
3436
|
var Xs = function t(e) {
|
|
@@ -3441,7 +3446,7 @@ var Xs = function t(e) {
|
|
|
3441
3446
|
n && (r = n.prototype);
|
|
3442
3447
|
} else if (e === "%AsyncIteratorPrototype%") {
|
|
3443
3448
|
var i = t("%AsyncGenerator%");
|
|
3444
|
-
i &&
|
|
3449
|
+
i && B && (r = B(i.prototype));
|
|
3445
3450
|
}
|
|
3446
3451
|
return Pe[e] = r, r;
|
|
3447
3452
|
}, nn = {
|
|
@@ -3915,14 +3920,14 @@ var Xa = function(e) {
|
|
|
3915
3920
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || h(y);
|
|
3916
3921
|
}
|
|
3917
3922
|
t.isArrayBufferView = S;
|
|
3918
|
-
function
|
|
3923
|
+
function O(y) {
|
|
3919
3924
|
return n(y) === "Uint8Array";
|
|
3920
3925
|
}
|
|
3921
|
-
t.isUint8Array =
|
|
3922
|
-
function
|
|
3926
|
+
t.isUint8Array = O;
|
|
3927
|
+
function $(y) {
|
|
3923
3928
|
return n(y) === "Uint8ClampedArray";
|
|
3924
3929
|
}
|
|
3925
|
-
t.isUint8ClampedArray =
|
|
3930
|
+
t.isUint8ClampedArray = $;
|
|
3926
3931
|
function K(y) {
|
|
3927
3932
|
return n(y) === "Uint16Array";
|
|
3928
3933
|
}
|
|
@@ -3935,10 +3940,10 @@ var Xa = function(e) {
|
|
|
3935
3940
|
return n(y) === "Int8Array";
|
|
3936
3941
|
}
|
|
3937
3942
|
t.isInt8Array = P;
|
|
3938
|
-
function
|
|
3943
|
+
function R(y) {
|
|
3939
3944
|
return n(y) === "Int16Array";
|
|
3940
3945
|
}
|
|
3941
|
-
t.isInt16Array =
|
|
3946
|
+
t.isInt16Array = R;
|
|
3942
3947
|
function T(y) {
|
|
3943
3948
|
return n(y) === "Int32Array";
|
|
3944
3949
|
}
|
|
@@ -4023,10 +4028,10 @@ var Xa = function(e) {
|
|
|
4023
4028
|
return u(y) === "[object Map Iterator]";
|
|
4024
4029
|
}
|
|
4025
4030
|
t.isMapIterator = E;
|
|
4026
|
-
function
|
|
4031
|
+
function _(y) {
|
|
4027
4032
|
return u(y) === "[object Set Iterator]";
|
|
4028
4033
|
}
|
|
4029
|
-
t.isSetIterator =
|
|
4034
|
+
t.isSetIterator = _;
|
|
4030
4035
|
function F(y) {
|
|
4031
4036
|
return u(y) === "[object Generator]";
|
|
4032
4037
|
}
|
|
@@ -4104,10 +4109,10 @@ var iu = yr.exports;
|
|
|
4104
4109
|
h.push(s(arguments[m]));
|
|
4105
4110
|
return h.join(" ");
|
|
4106
4111
|
}
|
|
4107
|
-
for (var m = 1, w = arguments, L = w.length, k = String(d).replace(r, function(
|
|
4108
|
-
if (
|
|
4109
|
-
if (m >= L) return
|
|
4110
|
-
switch (
|
|
4112
|
+
for (var m = 1, w = arguments, L = w.length, k = String(d).replace(r, function(_) {
|
|
4113
|
+
if (_ === "%%") return "%";
|
|
4114
|
+
if (m >= L) return _;
|
|
4115
|
+
switch (_) {
|
|
4111
4116
|
case "%s":
|
|
4112
4117
|
return String(w[m++]);
|
|
4113
4118
|
case "%d":
|
|
@@ -4119,10 +4124,10 @@ var iu = yr.exports;
|
|
|
4119
4124
|
return "[Circular]";
|
|
4120
4125
|
}
|
|
4121
4126
|
default:
|
|
4122
|
-
return
|
|
4127
|
+
return _;
|
|
4123
4128
|
}
|
|
4124
4129
|
}), E = w[m]; m < L; E = w[++m])
|
|
4125
|
-
|
|
4130
|
+
$(E) || !oe(E) ? k += " " + E : k += " " + s(E);
|
|
4126
4131
|
return k;
|
|
4127
4132
|
}, t.deprecate = function(d, h) {
|
|
4128
4133
|
if (typeof A < "u" && A.noDeprecation === !0)
|
|
@@ -4165,7 +4170,7 @@ var iu = yr.exports;
|
|
|
4165
4170
|
seen: [],
|
|
4166
4171
|
stylize: u
|
|
4167
4172
|
};
|
|
4168
|
-
return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]),
|
|
4173
|
+
return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]), O(h) ? m.showHidden = h : h && t._extend(m, h), T(m.showHidden) && (m.showHidden = !1), T(m.depth) && (m.depth = 2), T(m.colors) && (m.colors = !1), T(m.customInspect) && (m.customInspect = !0), m.colors && (m.stylize = a), c(m, d, m.depth);
|
|
4169
4174
|
}
|
|
4170
4175
|
t.inspect = s, s.colors = {
|
|
4171
4176
|
bold: [1, 22],
|
|
@@ -4220,8 +4225,8 @@ var iu = yr.exports;
|
|
|
4220
4225
|
return p(h);
|
|
4221
4226
|
if (k.length === 0) {
|
|
4222
4227
|
if (de(h)) {
|
|
4223
|
-
var
|
|
4224
|
-
return d.stylize("[Function" +
|
|
4228
|
+
var _ = h.name ? ": " + h.name : "";
|
|
4229
|
+
return d.stylize("[Function" + _ + "]", "special");
|
|
4225
4230
|
}
|
|
4226
4231
|
if (ie(h))
|
|
4227
4232
|
return d.stylize(RegExp.prototype.toString.call(h), "regexp");
|
|
@@ -4254,16 +4259,16 @@ var iu = yr.exports;
|
|
|
4254
4259
|
}
|
|
4255
4260
|
if (ee(h))
|
|
4256
4261
|
return d.stylize("" + h, "number");
|
|
4257
|
-
if (
|
|
4262
|
+
if (O(h))
|
|
4258
4263
|
return d.stylize("" + h, "boolean");
|
|
4259
|
-
if (
|
|
4264
|
+
if ($(h))
|
|
4260
4265
|
return d.stylize("null", "null");
|
|
4261
4266
|
}
|
|
4262
4267
|
function p(d) {
|
|
4263
4268
|
return "[" + Error.prototype.toString.call(d) + "]";
|
|
4264
4269
|
}
|
|
4265
4270
|
function v(d, h, m, w, L) {
|
|
4266
|
-
for (var k = [], E = 0,
|
|
4271
|
+
for (var k = [], E = 0, _ = h.length; E < _; ++E)
|
|
4267
4272
|
De(h, String(E)) ? k.push(g(
|
|
4268
4273
|
d,
|
|
4269
4274
|
h,
|
|
@@ -4284,23 +4289,23 @@ var iu = yr.exports;
|
|
|
4284
4289
|
}), k;
|
|
4285
4290
|
}
|
|
4286
4291
|
function g(d, h, m, w, L, k) {
|
|
4287
|
-
var E,
|
|
4288
|
-
if (F = Object.getOwnPropertyDescriptor(h, L) || { value: h[L] }, F.get ? F.set ?
|
|
4289
|
-
`) > -1 && (k ?
|
|
4292
|
+
var E, _, F;
|
|
4293
|
+
if (F = Object.getOwnPropertyDescriptor(h, L) || { value: h[L] }, F.get ? F.set ? _ = d.stylize("[Getter/Setter]", "special") : _ = d.stylize("[Getter]", "special") : F.set && (_ = d.stylize("[Setter]", "special")), De(w, L) || (E = "[" + L + "]"), _ || (d.seen.indexOf(F.value) < 0 ? ($(m) ? _ = c(d, F.value, null) : _ = c(d, F.value, m - 1), _.indexOf(`
|
|
4294
|
+
`) > -1 && (k ? _ = _.split(`
|
|
4290
4295
|
`).map(function(H) {
|
|
4291
4296
|
return " " + H;
|
|
4292
4297
|
}).join(`
|
|
4293
|
-
`).slice(2) :
|
|
4294
|
-
` +
|
|
4298
|
+
`).slice(2) : _ = `
|
|
4299
|
+
` + _.split(`
|
|
4295
4300
|
`).map(function(H) {
|
|
4296
4301
|
return " " + H;
|
|
4297
4302
|
}).join(`
|
|
4298
|
-
`))) :
|
|
4303
|
+
`))) : _ = d.stylize("[Circular]", "special")), T(E)) {
|
|
4299
4304
|
if (k && L.match(/^\d+$/))
|
|
4300
|
-
return
|
|
4305
|
+
return _;
|
|
4301
4306
|
E = JSON.stringify("" + L), E.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (E = E.slice(1, -1), E = d.stylize(E, "name")) : (E = E.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), E = d.stylize(E, "string"));
|
|
4302
4307
|
}
|
|
4303
|
-
return E + ": " +
|
|
4308
|
+
return E + ": " + _;
|
|
4304
4309
|
}
|
|
4305
4310
|
function b(d, h, m) {
|
|
4306
4311
|
var w = d.reduce(function(L, k) {
|
|
@@ -4316,14 +4321,14 @@ var iu = yr.exports;
|
|
|
4316
4321
|
return Array.isArray(d);
|
|
4317
4322
|
}
|
|
4318
4323
|
t.isArray = S;
|
|
4319
|
-
function
|
|
4324
|
+
function O(d) {
|
|
4320
4325
|
return typeof d == "boolean";
|
|
4321
4326
|
}
|
|
4322
|
-
t.isBoolean =
|
|
4323
|
-
function
|
|
4327
|
+
t.isBoolean = O;
|
|
4328
|
+
function $(d) {
|
|
4324
4329
|
return d === null;
|
|
4325
4330
|
}
|
|
4326
|
-
t.isNull =
|
|
4331
|
+
t.isNull = $;
|
|
4327
4332
|
function K(d) {
|
|
4328
4333
|
return d == null;
|
|
4329
4334
|
}
|
|
@@ -4336,10 +4341,10 @@ var iu = yr.exports;
|
|
|
4336
4341
|
return typeof d == "string";
|
|
4337
4342
|
}
|
|
4338
4343
|
t.isString = P;
|
|
4339
|
-
function
|
|
4344
|
+
function R(d) {
|
|
4340
4345
|
return typeof d == "symbol";
|
|
4341
4346
|
}
|
|
4342
|
-
t.isSymbol =
|
|
4347
|
+
t.isSymbol = R;
|
|
4343
4348
|
function T(d) {
|
|
4344
4349
|
return d === void 0;
|
|
4345
4350
|
}
|
|
@@ -4426,8 +4431,8 @@ var iu = yr.exports;
|
|
|
4426
4431
|
function m() {
|
|
4427
4432
|
for (var w, L, k = new Promise(function(F, H) {
|
|
4428
4433
|
w = F, L = H;
|
|
4429
|
-
}), E = [],
|
|
4430
|
-
E.push(arguments[
|
|
4434
|
+
}), E = [], _ = 0; _ < arguments.length; _++)
|
|
4435
|
+
E.push(arguments[_]);
|
|
4431
4436
|
E.push(function(F, H) {
|
|
4432
4437
|
F ? L(F) : w(H);
|
|
4433
4438
|
});
|
|
@@ -4468,11 +4473,11 @@ var iu = yr.exports;
|
|
|
4468
4473
|
return L.apply(k, arguments);
|
|
4469
4474
|
};
|
|
4470
4475
|
d.apply(this, m).then(
|
|
4471
|
-
function(
|
|
4472
|
-
A.nextTick(E.bind(null, null,
|
|
4476
|
+
function(_) {
|
|
4477
|
+
A.nextTick(E.bind(null, null, _));
|
|
4473
4478
|
},
|
|
4474
|
-
function(
|
|
4475
|
-
A.nextTick(Re.bind(null,
|
|
4479
|
+
function(_) {
|
|
4480
|
+
A.nextTick(Re.bind(null, _, E));
|
|
4476
4481
|
}
|
|
4477
4482
|
);
|
|
4478
4483
|
}
|
|
@@ -4700,20 +4705,20 @@ function du(t) {
|
|
|
4700
4705
|
function b(...S) {
|
|
4701
4706
|
if (!b.enabled)
|
|
4702
4707
|
return;
|
|
4703
|
-
const
|
|
4704
|
-
|
|
4708
|
+
const O = b, $ = Number(/* @__PURE__ */ new Date()), K = $ - (f || $);
|
|
4709
|
+
O.diff = K, O.prev = f, O.curr = $, f = $, S[0] = r.coerce(S[0]), typeof S[0] != "string" && S.unshift("%O");
|
|
4705
4710
|
let ee = 0;
|
|
4706
|
-
S[0] = S[0].replace(/%([a-zA-Z%])/g, (
|
|
4707
|
-
if (
|
|
4711
|
+
S[0] = S[0].replace(/%([a-zA-Z%])/g, (R, T) => {
|
|
4712
|
+
if (R === "%%")
|
|
4708
4713
|
return "%";
|
|
4709
4714
|
ee++;
|
|
4710
4715
|
const ie = r.formatters[T];
|
|
4711
4716
|
if (typeof ie == "function") {
|
|
4712
4717
|
const oe = S[ee];
|
|
4713
|
-
|
|
4718
|
+
R = ie.call(O, oe), S.splice(ee, 1), ee--;
|
|
4714
4719
|
}
|
|
4715
|
-
return
|
|
4716
|
-
}), r.formatArgs.call(
|
|
4720
|
+
return R;
|
|
4721
|
+
}), r.formatArgs.call(O, S), (O.log || r.log).apply(O, S);
|
|
4717
4722
|
}
|
|
4718
4723
|
return b.namespace = c, b.useColors = r.useColors(), b.color = r.selectColor(c), b.extend = n, b.destroy = r.destroy, Object.defineProperty(b, "enabled", {
|
|
4719
4724
|
enumerable: !0,
|
|
@@ -4900,7 +4905,7 @@ var fu = du;
|
|
|
4900
4905
|
};
|
|
4901
4906
|
})(mr, mr.exports);
|
|
4902
4907
|
var fi = mr.exports;
|
|
4903
|
-
const pu = jn, hu = Hn.EventEmitter, yu = Ft.inherits,
|
|
4908
|
+
const pu = jn, hu = Hn.EventEmitter, yu = Ft.inherits, U = fi("avvio"), { AVV_ERR_READY_TIMEOUT: mu } = di, Zt = Symbol.for("plugin-meta");
|
|
4904
4909
|
function gu(t, e) {
|
|
4905
4910
|
return t[Zt] && t[Zt].name ? t[Zt].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
|
|
4906
4911
|
`).slice(0, 2).map((r) => r.trim()).join(" -- ");
|
|
@@ -4920,7 +4925,7 @@ We.prototype.exec = function(t, e) {
|
|
|
4920
4925
|
let n = !1;
|
|
4921
4926
|
const i = this.name;
|
|
4922
4927
|
if (this.parent._error && !this.isAfter) {
|
|
4923
|
-
|
|
4928
|
+
U("skipping loading of plugin as parent errored and it is not an after", i), A.nextTick(e);
|
|
4924
4929
|
return;
|
|
4925
4930
|
}
|
|
4926
4931
|
if (this.isAfter)
|
|
@@ -4929,24 +4934,24 @@ We.prototype.exec = function(t, e) {
|
|
|
4929
4934
|
try {
|
|
4930
4935
|
this.server = this.parent.override(t, r, this.opts);
|
|
4931
4936
|
} catch (u) {
|
|
4932
|
-
return
|
|
4937
|
+
return U("override errored", i), e(u);
|
|
4933
4938
|
}
|
|
4934
|
-
this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts,
|
|
4939
|
+
this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, U("exec", i);
|
|
4935
4940
|
let o;
|
|
4936
4941
|
const s = (u) => {
|
|
4937
4942
|
if (n) {
|
|
4938
|
-
|
|
4943
|
+
U("loading complete", i);
|
|
4939
4944
|
return;
|
|
4940
4945
|
}
|
|
4941
|
-
this._error = u,
|
|
4946
|
+
this._error = u, U(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
|
|
4942
4947
|
};
|
|
4943
|
-
this.timeout > 0 && (
|
|
4944
|
-
|
|
4948
|
+
this.timeout > 0 && (U("setting up timeout", i, this.timeout), o = setTimeout(function() {
|
|
4949
|
+
U("timed out", i), o = null;
|
|
4945
4950
|
const u = new mu(i);
|
|
4946
4951
|
u.fn = r, s(u);
|
|
4947
4952
|
}, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
|
|
4948
4953
|
const a = r(this.server, this.opts, s);
|
|
4949
|
-
a && typeof a.then == "function" && (
|
|
4954
|
+
a && typeof a.then == "function" && (U("exec: resolving promise", i), a.then(
|
|
4950
4955
|
() => A.nextTick(s),
|
|
4951
4956
|
(u) => A.nextTick(s, u)
|
|
4952
4957
|
));
|
|
@@ -4956,36 +4961,36 @@ We.prototype.loadedSoFar = function() {
|
|
|
4956
4961
|
return Promise.resolve();
|
|
4957
4962
|
const t = () => {
|
|
4958
4963
|
this.server.after((r, n) => {
|
|
4959
|
-
this._error = r, this.q.pause(), r ? (
|
|
4964
|
+
this._error = r, this.q.pause(), r ? (U("rejecting promise", this.name, r), this._promise.reject(r)) : (U("resolving promise", this.name), this._promise.resolve()), this._promise = null, A.nextTick(n, r);
|
|
4960
4965
|
}), this.q.resume();
|
|
4961
4966
|
};
|
|
4962
4967
|
let e;
|
|
4963
4968
|
return this._promise ? e = Promise.resolve() : (this._promise = bu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
|
|
4964
4969
|
};
|
|
4965
4970
|
We.prototype.enqueue = function(t, e) {
|
|
4966
|
-
|
|
4971
|
+
U("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
|
|
4967
4972
|
};
|
|
4968
4973
|
We.prototype.finish = function(t, e) {
|
|
4969
|
-
|
|
4974
|
+
U("finish", this.name, t);
|
|
4970
4975
|
const r = () => {
|
|
4971
|
-
this.loaded || (
|
|
4976
|
+
this.loaded || (U("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
|
|
4972
4977
|
};
|
|
4973
4978
|
if (t) {
|
|
4974
4979
|
this._promise && (this._promise.reject(t), this._promise = null), r();
|
|
4975
4980
|
return;
|
|
4976
4981
|
}
|
|
4977
4982
|
const n = () => {
|
|
4978
|
-
if (
|
|
4983
|
+
if (U("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
|
|
4979
4984
|
if (this._promise) {
|
|
4980
4985
|
const i = () => {
|
|
4981
|
-
|
|
4986
|
+
U("wrap"), queueMicrotask(n);
|
|
4982
4987
|
};
|
|
4983
4988
|
this._promise.resolve(), this._promise.promise.then(i, i), this._promise = null;
|
|
4984
4989
|
} else
|
|
4985
4990
|
r();
|
|
4986
4991
|
else
|
|
4987
|
-
|
|
4988
|
-
|
|
4992
|
+
U("delayed", this.name), this.q.drain = () => {
|
|
4993
|
+
U("drain", this.name), this.q.drain = Su, queueMicrotask(n);
|
|
4989
4994
|
};
|
|
4990
4995
|
};
|
|
4991
4996
|
queueMicrotask(n), this.q.resume();
|
|
@@ -5270,9 +5275,9 @@ const Ru = /* @__PURE__ */ cs(Du);
|
|
|
5270
5275
|
}, window.cancelAnimationFrame = clearTimeout;
|
|
5271
5276
|
}
|
|
5272
5277
|
})();
|
|
5273
|
-
function oc(t, e = !0, r = !0, n) {
|
|
5278
|
+
function oc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
|
|
5274
5279
|
const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = Ru(/* @__PURE__ */ Object.create({}), { autostart: !1 });
|
|
5275
|
-
return s.use(jo), s.use(No, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Vo, { videoPlayerController: n?.videoPlayerController }), s.use(Mo, {
|
|
5280
|
+
return s.use(jo, { friendsTab: n.friendsTab }), s.use(No, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Vo, { videoPlayerController: n?.videoPlayerController }), s.use(Mo, {
|
|
5276
5281
|
onContentActivate: n?.onContentActivate,
|
|
5277
5282
|
withAd: n?.withAd,
|
|
5278
5283
|
withAdNotification: n?.withAdNotification
|