fansunited-data-layer 0.8.5 → 0.8.6
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/api/sportal365-sports/basketball/games/transformers/game.d.ts.map +1 -1
- package/api/sportal365-sports/basketball/games/types.d.ts +2 -1
- package/api/sportal365-sports/basketball/games/types.d.ts.map +1 -1
- package/api/sportal365-sports/football/matches/transformers/odds.d.ts.map +1 -1
- package/api/sportal365-sports/football/matches/types/odds.types.d.ts +2 -76
- package/api/sportal365-sports/football/matches/types/odds.types.d.ts.map +1 -1
- package/api/sportal365-sports/shared/index.d.ts +2 -0
- package/api/sportal365-sports/shared/index.d.ts.map +1 -1
- package/api/sportal365-sports/shared/odds.transformer.d.ts +12 -0
- package/api/sportal365-sports/shared/odds.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/shared/odds.types.d.ts +81 -0
- package/api/sportal365-sports/shared/odds.types.d.ts.map +1 -0
- package/api/sportal365-sports/tennis/matches/transformers/match.d.ts.map +1 -1
- package/api/sportal365-sports/tennis/matches/types.d.ts +2 -1
- package/api/sportal365-sports/tennis/matches/types.d.ts.map +1 -1
- package/client.cjs +1 -1
- package/client.js +2 -2
- package/fansunited-data-layer.cjs +1 -1
- package/fansunited-data-layer.js +375 -375
- package/{matches-B8E7KjZU.js → matches-BefXoB5p.js} +171 -167
- package/matches-CiVDiSIz.cjs +1 -0
- package/package.json +1 -1
- package/types/canonical/match.types.d.ts +2 -0
- package/types/canonical/match.types.d.ts.map +1 -1
- package/matches-B-ZxR-B9.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const E = "__FANSUNITED_DATA_LAYER_CONFIG__";
|
|
2
|
-
function
|
|
2
|
+
function be(e) {
|
|
3
3
|
globalThis[E] = e;
|
|
4
4
|
}
|
|
5
5
|
function m() {
|
|
@@ -8,7 +8,7 @@ function m() {
|
|
|
8
8
|
throw new Error("Data layer config not initialized. Call setConfig() in your root layout.");
|
|
9
9
|
return e;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Oe() {
|
|
12
12
|
return globalThis[E] !== void 0;
|
|
13
13
|
}
|
|
14
14
|
function M(e) {
|
|
@@ -51,7 +51,7 @@ function M(e) {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
const U = "https://football.api.sportal365.com",
|
|
54
|
+
const U = "https://football.api.sportal365.com", Re = "https://basketball.api.sportal365.com", Le = "https://tennis.api.sportal365.com", ke = "https://sports-statistics.api.sportal365.com", De = "https://sports-search.api.sportal365.com", g = M(U);
|
|
55
55
|
function O(e) {
|
|
56
56
|
if (e)
|
|
57
57
|
return {
|
|
@@ -113,10 +113,10 @@ function i(e, t = "sportal365") {
|
|
|
113
113
|
}
|
|
114
114
|
];
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Ne(e, t) {
|
|
117
117
|
return e ? e.find((o) => o.provider === t)?.id : void 0;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Fe(e, t, n) {
|
|
120
120
|
const o = e ?? [], a = o.findIndex((s) => s.provider === t);
|
|
121
121
|
if (a >= 0) {
|
|
122
122
|
const s = [...o];
|
|
@@ -125,6 +125,59 @@ function Ne(e, t, n) {
|
|
|
125
125
|
return [...o, { provider: t, id: n }];
|
|
126
126
|
}
|
|
127
127
|
function $(e) {
|
|
128
|
+
const t = e.urls?.find((n) => n.app_type === "desktop")?.url;
|
|
129
|
+
return {
|
|
130
|
+
id: e.id,
|
|
131
|
+
name: e.name,
|
|
132
|
+
code: e.code,
|
|
133
|
+
value: e.value ?? void 0,
|
|
134
|
+
odds: e.odds,
|
|
135
|
+
oddsOld: e.odds_old,
|
|
136
|
+
movement: e.movement === "STABLE" ? "NONE" : e.movement,
|
|
137
|
+
url: t
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function Y(e) {
|
|
141
|
+
return {
|
|
142
|
+
type: {
|
|
143
|
+
id: e.type.id,
|
|
144
|
+
code: e.type.code,
|
|
145
|
+
name: e.type.name
|
|
146
|
+
},
|
|
147
|
+
period: {
|
|
148
|
+
id: e.scope.id,
|
|
149
|
+
type: e.scope.type,
|
|
150
|
+
name: e.scope.name
|
|
151
|
+
},
|
|
152
|
+
selections: e.selections.map($)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function B(e) {
|
|
156
|
+
if (!e) return !0;
|
|
157
|
+
const t = e.replace("#", ""), n = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16);
|
|
158
|
+
return (0.2126 * n + 0.7152 * o + 0.0722 * a) / 255 < 0.5;
|
|
159
|
+
}
|
|
160
|
+
function G(e) {
|
|
161
|
+
const t = e.bookmaker.assets?.[0], n = e.bookmaker.branding || t, o = e.bookmaker.branding?.background_color || t?.background_color, a = e.bookmaker.branding?.text_color || (B(o) ? "#FFFFFF" : "#000000");
|
|
162
|
+
return {
|
|
163
|
+
operator: {
|
|
164
|
+
id: e.bookmaker.id,
|
|
165
|
+
name: e.bookmaker.name,
|
|
166
|
+
url: e.bookmaker.url,
|
|
167
|
+
branding: n ? {
|
|
168
|
+
backgroundColor: o,
|
|
169
|
+
textColor: a,
|
|
170
|
+
logo: t?.logo
|
|
171
|
+
} : void 0
|
|
172
|
+
},
|
|
173
|
+
type: e.type,
|
|
174
|
+
markets: e.markets.map(Y)
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function V(e) {
|
|
178
|
+
return e.map(G);
|
|
179
|
+
}
|
|
180
|
+
function W(e) {
|
|
128
181
|
const t = {
|
|
129
182
|
finished_ap: "finished_after_penalties",
|
|
130
183
|
// finished after penalties
|
|
@@ -181,7 +234,7 @@ function R(e) {
|
|
|
181
234
|
providerRef: i(e.uuid)
|
|
182
235
|
};
|
|
183
236
|
}
|
|
184
|
-
function
|
|
237
|
+
function K(e) {
|
|
185
238
|
return {
|
|
186
239
|
kickoffTime: new Date(e.kickoff_time),
|
|
187
240
|
currentMinute: e.minute?.regular_time,
|
|
@@ -193,7 +246,7 @@ function Y(e) {
|
|
|
193
246
|
extraTimeSecondHalfStartedAt: e.extra_time_second_half_started_at ? new Date(e.extra_time_second_half_started_at) : void 0
|
|
194
247
|
};
|
|
195
248
|
}
|
|
196
|
-
function
|
|
249
|
+
function j(e) {
|
|
197
250
|
if (!e) return;
|
|
198
251
|
const t = (o) => o ? { competitorOne: String(o.home), competitorTwo: String(o.away) } : void 0, n = e.after_extra_time ?? e.regular_time;
|
|
199
252
|
return {
|
|
@@ -209,7 +262,7 @@ function B(e) {
|
|
|
209
262
|
}
|
|
210
263
|
};
|
|
211
264
|
}
|
|
212
|
-
function
|
|
265
|
+
function q(e) {
|
|
213
266
|
if (e)
|
|
214
267
|
return {
|
|
215
268
|
id: e.id,
|
|
@@ -219,7 +272,7 @@ function G(e) {
|
|
|
219
272
|
providerRef: i(e.uuid)
|
|
220
273
|
};
|
|
221
274
|
}
|
|
222
|
-
function
|
|
275
|
+
function X(e) {
|
|
223
276
|
if (e?.length)
|
|
224
277
|
return e.map((t) => ({
|
|
225
278
|
id: t.id,
|
|
@@ -229,7 +282,7 @@ function V(e) {
|
|
|
229
282
|
gender: t.gender
|
|
230
283
|
}));
|
|
231
284
|
}
|
|
232
|
-
function
|
|
285
|
+
function z(e) {
|
|
233
286
|
if (!e.season?.tournament) return;
|
|
234
287
|
const { tournament: t, ...n } = e.season;
|
|
235
288
|
return {
|
|
@@ -259,7 +312,7 @@ function W(e) {
|
|
|
259
312
|
providerRef: i(t.uuid)
|
|
260
313
|
};
|
|
261
314
|
}
|
|
262
|
-
function
|
|
315
|
+
function J(e) {
|
|
263
316
|
if (!e.winner?.match?.id) return;
|
|
264
317
|
const t = {
|
|
265
318
|
"Regular Time": "REGULAR_TIME",
|
|
@@ -276,11 +329,11 @@ function A(e) {
|
|
|
276
329
|
return {
|
|
277
330
|
id: e.id,
|
|
278
331
|
slug: e.slug,
|
|
279
|
-
status:
|
|
280
|
-
timing:
|
|
332
|
+
status: W(e.status),
|
|
333
|
+
timing: K(e),
|
|
281
334
|
competitorOne: R(e.home_team),
|
|
282
335
|
competitorTwo: R(e.away_team),
|
|
283
|
-
competition:
|
|
336
|
+
competition: z(e),
|
|
284
337
|
round: e.round ? {
|
|
285
338
|
id: e.round.id ?? e.round.key,
|
|
286
339
|
key: e.round.key,
|
|
@@ -293,19 +346,19 @@ function A(e) {
|
|
|
293
346
|
name: e.group.name,
|
|
294
347
|
providerRef: i(e.group.uuid)
|
|
295
348
|
} : void 0,
|
|
296
|
-
venue:
|
|
297
|
-
officials:
|
|
349
|
+
venue: q(e.venue),
|
|
350
|
+
officials: X(e.referees),
|
|
298
351
|
spectators: e.spectators ?? void 0,
|
|
299
|
-
score:
|
|
352
|
+
score: j(e.score),
|
|
300
353
|
mainEvents: e.main_events?.map(T).filter((t) => t !== null),
|
|
301
354
|
penaltyShootoutEvents: e.penalty_shootout_events?.map(T).filter((t) => t !== null),
|
|
302
|
-
winner:
|
|
355
|
+
winner: J(e),
|
|
303
356
|
coverage: e.coverage === "NOT_LIVE" ? "UNKNOWN" : e.coverage,
|
|
304
357
|
lineupStatus: e.lineup_status === "UNCONFIRMED" ? "EXPECTED" : e.lineup_status,
|
|
305
358
|
providerRef: i(e.uuid)
|
|
306
359
|
};
|
|
307
360
|
}
|
|
308
|
-
function
|
|
361
|
+
function Q(e) {
|
|
309
362
|
const t = e.player;
|
|
310
363
|
return {
|
|
311
364
|
id: t.id,
|
|
@@ -337,7 +390,7 @@ function j(e) {
|
|
|
337
390
|
function L(e) {
|
|
338
391
|
const t = [], n = [];
|
|
339
392
|
for (const o of e.players) {
|
|
340
|
-
const a =
|
|
393
|
+
const a = Q(o);
|
|
341
394
|
o.type.category === "start" ? t.push(a) : o.type.category === "sub" && n.push(a);
|
|
342
395
|
}
|
|
343
396
|
return {
|
|
@@ -360,7 +413,7 @@ function L(e) {
|
|
|
360
413
|
substitutes: n
|
|
361
414
|
};
|
|
362
415
|
}
|
|
363
|
-
function
|
|
416
|
+
function Z(e) {
|
|
364
417
|
return {
|
|
365
418
|
matchId: e.match_id,
|
|
366
419
|
confirmed: e.status === "CONFIRMED",
|
|
@@ -392,7 +445,7 @@ function k(e, t) {
|
|
|
392
445
|
statistics: o.filter((a) => a !== null)
|
|
393
446
|
};
|
|
394
447
|
}
|
|
395
|
-
function
|
|
448
|
+
function w(e) {
|
|
396
449
|
const t = e.find((o) => o.home_team), n = e.find((o) => !o.home_team);
|
|
397
450
|
if (!t || !n)
|
|
398
451
|
throw new Error("Missing competitor statistics");
|
|
@@ -401,60 +454,10 @@ function X(e) {
|
|
|
401
454
|
competitorTwo: k(String(n.team.id), n.statistics)
|
|
402
455
|
};
|
|
403
456
|
}
|
|
404
|
-
function
|
|
405
|
-
const t = e.urls?.find((n) => n.app_type === "desktop")?.url;
|
|
406
|
-
return {
|
|
407
|
-
id: e.id,
|
|
408
|
-
name: e.name,
|
|
409
|
-
code: e.code,
|
|
410
|
-
value: e.value ?? void 0,
|
|
411
|
-
odds: e.odds,
|
|
412
|
-
oddsOld: e.odds_old,
|
|
413
|
-
movement: e.movement === "STABLE" ? "NONE" : e.movement,
|
|
414
|
-
url: t
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
function J(e) {
|
|
418
|
-
return {
|
|
419
|
-
type: {
|
|
420
|
-
id: e.type.id,
|
|
421
|
-
code: e.type.code,
|
|
422
|
-
name: e.type.name
|
|
423
|
-
},
|
|
424
|
-
period: {
|
|
425
|
-
id: e.scope.id,
|
|
426
|
-
type: e.scope.type,
|
|
427
|
-
name: e.scope.name
|
|
428
|
-
},
|
|
429
|
-
selections: e.selections.map(z)
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
function Q(e) {
|
|
433
|
-
if (!e) return !0;
|
|
434
|
-
const t = e.replace("#", ""), n = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16);
|
|
435
|
-
return (0.2126 * n + 0.7152 * o + 0.0722 * a) / 255 < 0.5;
|
|
436
|
-
}
|
|
437
|
-
function Z(e) {
|
|
438
|
-
const t = e.bookmaker.assets?.[0], n = e.bookmaker.branding || t, o = e.bookmaker.branding?.background_color || t?.background_color, a = e.bookmaker.branding?.text_color || (Q(o) ? "#FFFFFF" : "#000000");
|
|
439
|
-
return {
|
|
440
|
-
operator: {
|
|
441
|
-
id: e.bookmaker.id,
|
|
442
|
-
name: e.bookmaker.name,
|
|
443
|
-
url: e.bookmaker.url,
|
|
444
|
-
branding: n ? {
|
|
445
|
-
backgroundColor: o,
|
|
446
|
-
textColor: a,
|
|
447
|
-
logo: t?.logo
|
|
448
|
-
} : void 0
|
|
449
|
-
},
|
|
450
|
-
type: e.type,
|
|
451
|
-
markets: e.markets.map(J)
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
function w(e, t) {
|
|
457
|
+
function ee(e, t) {
|
|
455
458
|
return {
|
|
456
459
|
matchId: e,
|
|
457
|
-
operators: t
|
|
460
|
+
operators: V(t)
|
|
458
461
|
};
|
|
459
462
|
}
|
|
460
463
|
function D(e) {
|
|
@@ -463,7 +466,7 @@ function D(e) {
|
|
|
463
466
|
const t = typeof e == "number" ? e : parseInt(e, 10);
|
|
464
467
|
return isNaN(t) ? void 0 : t;
|
|
465
468
|
}
|
|
466
|
-
function
|
|
469
|
+
function te(e) {
|
|
467
470
|
return {
|
|
468
471
|
externalId: e.external_id,
|
|
469
472
|
minute: D(e.elapsed),
|
|
@@ -479,7 +482,7 @@ function ee(e) {
|
|
|
479
482
|
}
|
|
480
483
|
};
|
|
481
484
|
}
|
|
482
|
-
async function
|
|
485
|
+
async function xe(e, t, n) {
|
|
483
486
|
const o = n || m(), { sportal365Sports: a } = o, s = await g.get({
|
|
484
487
|
path: `/v2/matches/${e}`,
|
|
485
488
|
params: {
|
|
@@ -500,7 +503,7 @@ async function Fe(e, t, n) {
|
|
|
500
503
|
});
|
|
501
504
|
return A(s);
|
|
502
505
|
}
|
|
503
|
-
async function
|
|
506
|
+
async function Pe(e, t, n) {
|
|
504
507
|
const o = n || m(), { sportal365Sports: a } = o;
|
|
505
508
|
return (await g.get({
|
|
506
509
|
path: `/v2/matches/${e}/events`,
|
|
@@ -514,7 +517,7 @@ async function xe(e, t, n) {
|
|
|
514
517
|
config: o
|
|
515
518
|
})).events.map(T).filter((u) => u !== null);
|
|
516
519
|
}
|
|
517
|
-
async function
|
|
520
|
+
async function Me(e, t, n) {
|
|
518
521
|
const o = n || m(), { sportal365Sports: a } = o, s = await g.get({
|
|
519
522
|
path: `/v2/matches/${e}/lineups`,
|
|
520
523
|
params: {
|
|
@@ -526,9 +529,9 @@ async function Pe(e, t, n) {
|
|
|
526
529
|
next: t?.next,
|
|
527
530
|
config: o
|
|
528
531
|
});
|
|
529
|
-
return
|
|
532
|
+
return Z(s);
|
|
530
533
|
}
|
|
531
|
-
async function
|
|
534
|
+
async function Ue(e, t, n) {
|
|
532
535
|
const o = n || m(), { sportal365Sports: a } = o, s = await g.get({
|
|
533
536
|
path: `/v2/matches/${e}`,
|
|
534
537
|
params: {
|
|
@@ -546,9 +549,9 @@ async function Me(e, t, n) {
|
|
|
546
549
|
next: t?.next,
|
|
547
550
|
config: o
|
|
548
551
|
});
|
|
549
|
-
return
|
|
552
|
+
return ee(e, s.odds ?? []);
|
|
550
553
|
}
|
|
551
|
-
async function
|
|
554
|
+
async function He(e, t, n) {
|
|
552
555
|
const o = n || m(), { sportal365Sports: a } = o, s = await g.get({
|
|
553
556
|
path: `/events/${e}/teamstats`,
|
|
554
557
|
params: {
|
|
@@ -560,9 +563,9 @@ async function Ue(e, t, n) {
|
|
|
560
563
|
next: t?.next,
|
|
561
564
|
config: o
|
|
562
565
|
});
|
|
563
|
-
return
|
|
566
|
+
return w(s);
|
|
564
567
|
}
|
|
565
|
-
async function
|
|
568
|
+
async function $e(e, t, n) {
|
|
566
569
|
const o = n || m(), { sportal365Sports: a } = o;
|
|
567
570
|
return (await g.get({
|
|
568
571
|
path: `/matches/${e}/commentary`,
|
|
@@ -574,9 +577,9 @@ async function He(e, t, n) {
|
|
|
574
577
|
},
|
|
575
578
|
next: t?.next,
|
|
576
579
|
config: o
|
|
577
|
-
})).map(
|
|
580
|
+
})).map(te);
|
|
578
581
|
}
|
|
579
|
-
async function
|
|
582
|
+
async function Ye(e, t) {
|
|
580
583
|
const n = t || m(), { sportal365Sports: o } = n;
|
|
581
584
|
return (await g.get({
|
|
582
585
|
path: "/v2/matches",
|
|
@@ -621,7 +624,7 @@ async function $e(e, t) {
|
|
|
621
624
|
config: n
|
|
622
625
|
})).matches.map(A);
|
|
623
626
|
}
|
|
624
|
-
async function
|
|
627
|
+
async function Be(e, t) {
|
|
625
628
|
const n = t || m(), { sportal365Sports: o } = n;
|
|
626
629
|
return (await g.get({
|
|
627
630
|
path: "/v2/matches/livescore",
|
|
@@ -650,7 +653,7 @@ async function Ye(e, t) {
|
|
|
650
653
|
config: n
|
|
651
654
|
})).matches.map(A);
|
|
652
655
|
}
|
|
653
|
-
function
|
|
656
|
+
function oe(e) {
|
|
654
657
|
return {
|
|
655
658
|
id: e.id,
|
|
656
659
|
name: e.name,
|
|
@@ -777,7 +780,7 @@ function te(e) {
|
|
|
777
780
|
providerRef: i(e.uuid)
|
|
778
781
|
};
|
|
779
782
|
}
|
|
780
|
-
function
|
|
783
|
+
function ne(e) {
|
|
781
784
|
const t = e.player;
|
|
782
785
|
return {
|
|
783
786
|
id: t.id,
|
|
@@ -810,7 +813,7 @@ function oe(e) {
|
|
|
810
813
|
// Using player.id as provider reference
|
|
811
814
|
};
|
|
812
815
|
}
|
|
813
|
-
function
|
|
816
|
+
function ae(e) {
|
|
814
817
|
return {
|
|
815
818
|
id: e.id,
|
|
816
819
|
name: e.name,
|
|
@@ -826,23 +829,23 @@ function ne(e) {
|
|
|
826
829
|
providerRef: i(e.uuid)
|
|
827
830
|
};
|
|
828
831
|
}
|
|
829
|
-
function
|
|
832
|
+
function se(e) {
|
|
830
833
|
return {
|
|
831
834
|
teamId: e.team.id,
|
|
832
835
|
teamName: e.team.name,
|
|
833
|
-
coach: e.coach ?
|
|
834
|
-
players: e.players.map(
|
|
836
|
+
coach: e.coach ? ae(e.coach) : void 0,
|
|
837
|
+
players: e.players.map(ne)
|
|
835
838
|
};
|
|
836
839
|
}
|
|
837
|
-
function
|
|
840
|
+
function ie(e) {
|
|
838
841
|
const t = parseInt(e, 10);
|
|
839
842
|
return isNaN(t) ? void 0 : t;
|
|
840
843
|
}
|
|
841
844
|
function c(e, t) {
|
|
842
845
|
const n = e.find((o) => o.name === t);
|
|
843
|
-
return n ?
|
|
846
|
+
return n ? ie(n.value) : void 0;
|
|
844
847
|
}
|
|
845
|
-
function
|
|
848
|
+
function re(e, t) {
|
|
846
849
|
const n = e.statistics;
|
|
847
850
|
return {
|
|
848
851
|
playerId: e.player.id,
|
|
@@ -887,7 +890,7 @@ function ie(e, t) {
|
|
|
887
890
|
}))
|
|
888
891
|
};
|
|
889
892
|
}
|
|
890
|
-
async function
|
|
893
|
+
async function de(e, t) {
|
|
891
894
|
const n = t || m(), { sportal365Sports: o } = n, { seasonIds: a, teamId: s, languageCode: u, next: r } = e, d = r ?? { revalidate: 0 }, f = {
|
|
892
895
|
season_ids: a.join(","),
|
|
893
896
|
team_id: s,
|
|
@@ -918,11 +921,11 @@ async function re(e, t) {
|
|
|
918
921
|
const h = {};
|
|
919
922
|
for (const v of l.statistics) {
|
|
920
923
|
const C = v.player.id;
|
|
921
|
-
h[C] =
|
|
924
|
+
h[C] = re(v, s);
|
|
922
925
|
}
|
|
923
926
|
return h;
|
|
924
927
|
}
|
|
925
|
-
async function
|
|
928
|
+
async function Ge(e, t, n) {
|
|
926
929
|
const o = n || m(), { sportal365Sports: a } = o, s = await g.get({
|
|
927
930
|
path: `/v2/teams/${e}`,
|
|
928
931
|
params: {
|
|
@@ -935,9 +938,9 @@ async function Be(e, t, n) {
|
|
|
935
938
|
next: t?.next,
|
|
936
939
|
config: o
|
|
937
940
|
});
|
|
938
|
-
return
|
|
941
|
+
return oe(s);
|
|
939
942
|
}
|
|
940
|
-
async function
|
|
943
|
+
async function Ve(e, t, n) {
|
|
941
944
|
const o = n || m(), { sportal365Sports: a } = o, s = t?.seasonIds && t.seasonIds.length > 0 ? { revalidate: 0 } : t?.next, u = await g.get({
|
|
942
945
|
path: `/v2/teams/${e}/squad`,
|
|
943
946
|
params: {
|
|
@@ -949,10 +952,10 @@ async function Ge(e, t, n) {
|
|
|
949
952
|
},
|
|
950
953
|
next: s,
|
|
951
954
|
config: o
|
|
952
|
-
}), r =
|
|
955
|
+
}), r = se(u);
|
|
953
956
|
if (t?.seasonIds && t.seasonIds.length > 0)
|
|
954
957
|
try {
|
|
955
|
-
const d = await
|
|
958
|
+
const d = await de(
|
|
956
959
|
{
|
|
957
960
|
seasonIds: t.seasonIds,
|
|
958
961
|
teamId: e,
|
|
@@ -974,10 +977,10 @@ async function Ge(e, t, n) {
|
|
|
974
977
|
});
|
|
975
978
|
}
|
|
976
979
|
else
|
|
977
|
-
console.
|
|
980
|
+
console.warn("[getFootballTeamSquad] No seasonIds provided, skipping stats fetch");
|
|
978
981
|
return r;
|
|
979
982
|
}
|
|
980
|
-
function
|
|
983
|
+
function ce(e) {
|
|
981
984
|
return {
|
|
982
985
|
id: String(e.id),
|
|
983
986
|
name: e.name,
|
|
@@ -1004,7 +1007,7 @@ function de(e) {
|
|
|
1004
1007
|
providerRef: i(e.uuid)
|
|
1005
1008
|
};
|
|
1006
1009
|
}
|
|
1007
|
-
function
|
|
1010
|
+
function ue(e) {
|
|
1008
1011
|
const t = e.rounds.map((n) => ({
|
|
1009
1012
|
id: n.id,
|
|
1010
1013
|
name: n.name,
|
|
@@ -1030,7 +1033,7 @@ function ce(e) {
|
|
|
1030
1033
|
providerRef: i(e.stage.uuid)
|
|
1031
1034
|
};
|
|
1032
1035
|
}
|
|
1033
|
-
function
|
|
1036
|
+
function le(e) {
|
|
1034
1037
|
const { season: t, stages: n } = e, { tournament: o } = t, a = {
|
|
1035
1038
|
id: o.id,
|
|
1036
1039
|
name: o.name,
|
|
@@ -1057,11 +1060,11 @@ function ue(e) {
|
|
|
1057
1060
|
active: t.status === "ACTIVE",
|
|
1058
1061
|
status: t.status === "ACTIVE" ? "ACTIVE" : "INACTIVE",
|
|
1059
1062
|
competition: a,
|
|
1060
|
-
stages: n.map(
|
|
1063
|
+
stages: n.map(ue),
|
|
1061
1064
|
providerRef: i(t.uuid)
|
|
1062
1065
|
};
|
|
1063
1066
|
}
|
|
1064
|
-
async function
|
|
1067
|
+
async function We(e, t, n) {
|
|
1065
1068
|
const o = n || m(), { sportal365Sports: a } = o, s = await g.get({
|
|
1066
1069
|
path: `/tournaments/${e}`,
|
|
1067
1070
|
params: {
|
|
@@ -1073,9 +1076,9 @@ async function Ve(e, t, n) {
|
|
|
1073
1076
|
next: t?.next,
|
|
1074
1077
|
config: o
|
|
1075
1078
|
});
|
|
1076
|
-
return
|
|
1079
|
+
return ce(s);
|
|
1077
1080
|
}
|
|
1078
|
-
async function
|
|
1081
|
+
async function Ke(e, t) {
|
|
1079
1082
|
const n = t || m(), { sportal365Sports: o } = n;
|
|
1080
1083
|
if (!e?.seasonId && !e?.competitionId)
|
|
1081
1084
|
throw new Error("Either seasonId or competitionId must be provided");
|
|
@@ -1092,7 +1095,7 @@ async function We(e, t) {
|
|
|
1092
1095
|
next: e?.next,
|
|
1093
1096
|
config: n
|
|
1094
1097
|
});
|
|
1095
|
-
return
|
|
1098
|
+
return le(s);
|
|
1096
1099
|
}
|
|
1097
1100
|
function I(e) {
|
|
1098
1101
|
return {
|
|
@@ -1104,11 +1107,11 @@ function I(e) {
|
|
|
1104
1107
|
promotion: "promotion"
|
|
1105
1108
|
}[e.toLowerCase()] ?? e.toLowerCase().replace(/_/g, "");
|
|
1106
1109
|
}
|
|
1107
|
-
function
|
|
1110
|
+
function me(e) {
|
|
1108
1111
|
const t = e.toLowerCase();
|
|
1109
1112
|
return t === "relegation" ? "BOTTOM" : t === "playoff" ? "MIDDLE" : "TOP";
|
|
1110
1113
|
}
|
|
1111
|
-
function
|
|
1114
|
+
function ge(e, t) {
|
|
1112
1115
|
if (!t || t.length === 0)
|
|
1113
1116
|
return;
|
|
1114
1117
|
const n = t.map((a) => {
|
|
@@ -1134,14 +1137,14 @@ function me(e, t) {
|
|
|
1134
1137
|
formString: o
|
|
1135
1138
|
};
|
|
1136
1139
|
}
|
|
1137
|
-
function
|
|
1140
|
+
function pe(e) {
|
|
1138
1141
|
return {
|
|
1139
1142
|
key: I(e.code),
|
|
1140
1143
|
name: e.name,
|
|
1141
|
-
position:
|
|
1144
|
+
position: me(e.type)
|
|
1142
1145
|
};
|
|
1143
1146
|
}
|
|
1144
|
-
function
|
|
1147
|
+
function fe(e) {
|
|
1145
1148
|
const t = {
|
|
1146
1149
|
played: e.played,
|
|
1147
1150
|
won: e.wins,
|
|
@@ -1151,7 +1154,7 @@ function pe(e) {
|
|
|
1151
1154
|
goalsAgainst: e.goals_against,
|
|
1152
1155
|
goalDifference: e.goals_for - e.goals_against,
|
|
1153
1156
|
points: e.points
|
|
1154
|
-
}, n = e.rules?.length > 0 ? e.rules.map((a) => I(a.code)) : void 0, o =
|
|
1157
|
+
}, n = e.rules?.length > 0 ? e.rules.map((a) => I(a.code)) : void 0, o = ge(e.team.id, e.team.form ?? []);
|
|
1155
1158
|
return {
|
|
1156
1159
|
rank: e.rank,
|
|
1157
1160
|
competitor: {
|
|
@@ -1165,13 +1168,13 @@ function pe(e) {
|
|
|
1165
1168
|
rules: n
|
|
1166
1169
|
};
|
|
1167
1170
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const t = e.map(
|
|
1171
|
+
function _e(e) {
|
|
1172
|
+
const t = e.map(fe), n = /* @__PURE__ */ new Map();
|
|
1170
1173
|
for (const o of e)
|
|
1171
1174
|
if (o.rules)
|
|
1172
1175
|
for (const a of o.rules) {
|
|
1173
1176
|
const s = I(a.code);
|
|
1174
|
-
n.has(s) || n.set(s,
|
|
1177
|
+
n.has(s) || n.set(s, pe(a));
|
|
1175
1178
|
}
|
|
1176
1179
|
return {
|
|
1177
1180
|
entries: t,
|
|
@@ -1180,7 +1183,7 @@ function fe(e) {
|
|
|
1180
1183
|
}
|
|
1181
1184
|
};
|
|
1182
1185
|
}
|
|
1183
|
-
async function
|
|
1186
|
+
async function je(e, t) {
|
|
1184
1187
|
const n = t || m(), { sportal365Sports: o } = n, a = e.expand?.join(","), s = await g.get({
|
|
1185
1188
|
path: `/tournaments/seasons/stages/${e.stageId}/standing`,
|
|
1186
1189
|
params: {
|
|
@@ -1193,7 +1196,7 @@ async function Ke(e, t) {
|
|
|
1193
1196
|
next: e.next,
|
|
1194
1197
|
config: n
|
|
1195
1198
|
});
|
|
1196
|
-
return !s || s.length === 0 ? { entries: [], metadata: { legend: [] } } :
|
|
1199
|
+
return !s || s.length === 0 ? { entries: [], metadata: { legend: [] } } : _e(s);
|
|
1197
1200
|
}
|
|
1198
1201
|
function F(e) {
|
|
1199
1202
|
return {
|
|
@@ -1211,7 +1214,7 @@ function F(e) {
|
|
|
1211
1214
|
]
|
|
1212
1215
|
};
|
|
1213
1216
|
}
|
|
1214
|
-
function
|
|
1217
|
+
function ye(e) {
|
|
1215
1218
|
return {
|
|
1216
1219
|
id: e.id,
|
|
1217
1220
|
name: e.name,
|
|
@@ -1229,7 +1232,7 @@ function _e(e) {
|
|
|
1229
1232
|
]
|
|
1230
1233
|
};
|
|
1231
1234
|
}
|
|
1232
|
-
function
|
|
1235
|
+
function he(e) {
|
|
1233
1236
|
if (e.status) {
|
|
1234
1237
|
const s = {
|
|
1235
1238
|
notstarted: { code: "not_started", type: "NOT_STARTED", name: "Not Started" },
|
|
@@ -1249,7 +1252,7 @@ function ye(e) {
|
|
|
1249
1252
|
type: n
|
|
1250
1253
|
};
|
|
1251
1254
|
}
|
|
1252
|
-
function
|
|
1255
|
+
function ve(e) {
|
|
1253
1256
|
return {
|
|
1254
1257
|
kickoffTime: new Date(e.kickoff_at),
|
|
1255
1258
|
currentMinute: e.minute ?? void 0,
|
|
@@ -1277,7 +1280,7 @@ function N(e) {
|
|
|
1277
1280
|
]
|
|
1278
1281
|
};
|
|
1279
1282
|
}
|
|
1280
|
-
function
|
|
1283
|
+
function Te(e) {
|
|
1281
1284
|
if (!e) return;
|
|
1282
1285
|
const t = (o) => o ? {
|
|
1283
1286
|
competitorOne: o.home_goals !== null ? String(o.home_goals) : "0",
|
|
@@ -1299,12 +1302,12 @@ function ve(e) {
|
|
|
1299
1302
|
function b(e) {
|
|
1300
1303
|
return {
|
|
1301
1304
|
id: e.id,
|
|
1302
|
-
status:
|
|
1303
|
-
timing:
|
|
1305
|
+
status: he(e),
|
|
1306
|
+
timing: ve(e),
|
|
1304
1307
|
competitorOne: N(e.home_team),
|
|
1305
1308
|
competitorTwo: N(e.away_team),
|
|
1306
|
-
score:
|
|
1307
|
-
competition: e.context?.competition ?
|
|
1309
|
+
score: Te(e.scores),
|
|
1310
|
+
competition: e.context?.competition ? ye(e.context.competition) : void 0,
|
|
1308
1311
|
lineupStatus: e.lineups_confirmed ? "CONFIRMED" : "NOT_AVAILABLE",
|
|
1309
1312
|
updatedAt: e.updated_at ? new Date(e.updated_at) : void 0,
|
|
1310
1313
|
isUndecided: e.undecided ?? void 0,
|
|
@@ -1316,27 +1319,27 @@ function b(e) {
|
|
|
1316
1319
|
]
|
|
1317
1320
|
};
|
|
1318
1321
|
}
|
|
1319
|
-
function
|
|
1322
|
+
function qe(e) {
|
|
1320
1323
|
return b(e.data);
|
|
1321
1324
|
}
|
|
1322
|
-
function
|
|
1325
|
+
function Xe(e) {
|
|
1323
1326
|
return e.data.map(b);
|
|
1324
1327
|
}
|
|
1325
|
-
function
|
|
1328
|
+
function Ce(e) {
|
|
1326
1329
|
return e.map(b);
|
|
1327
1330
|
}
|
|
1328
|
-
async function
|
|
1331
|
+
async function Se(e, t, n) {
|
|
1329
1332
|
const o = await e.loyalty.getTemplateMatches(
|
|
1330
1333
|
t,
|
|
1331
1334
|
n?.groupId,
|
|
1332
1335
|
n?.disableCache
|
|
1333
1336
|
);
|
|
1334
|
-
return
|
|
1337
|
+
return Ce(o);
|
|
1335
1338
|
}
|
|
1336
|
-
async function
|
|
1337
|
-
return (await
|
|
1339
|
+
async function ze(e, t, n, o) {
|
|
1340
|
+
return (await Se(e, t, o)).filter((s) => s.competitorOne.id === n || s.competitorTwo.id === n);
|
|
1338
1341
|
}
|
|
1339
|
-
async function
|
|
1342
|
+
async function Je(e, t, n) {
|
|
1340
1343
|
const o = await e.loyalty.getTemplateById(t, n?.disableCache);
|
|
1341
1344
|
return {
|
|
1342
1345
|
id: o.id,
|
|
@@ -1383,7 +1386,7 @@ async function ze(e, t, n) {
|
|
|
1383
1386
|
adContent: o.adContent || ""
|
|
1384
1387
|
};
|
|
1385
1388
|
}
|
|
1386
|
-
function
|
|
1389
|
+
function Ee(e) {
|
|
1387
1390
|
return {
|
|
1388
1391
|
"1x2": "1X2",
|
|
1389
1392
|
12: "12",
|
|
@@ -1400,13 +1403,13 @@ function Se(e) {
|
|
|
1400
1403
|
FIRST_HALF_AND_FINAL_RESULT: "FIRST_HALF_AND_FINAL_RESULT"
|
|
1401
1404
|
}[e] || e.toUpperCase();
|
|
1402
1405
|
}
|
|
1403
|
-
function
|
|
1406
|
+
function Ae(e, t) {
|
|
1404
1407
|
const n = /* @__PURE__ */ new Map();
|
|
1405
1408
|
return e.forEach((o, a) => {
|
|
1406
1409
|
if (!o || o.length === 0)
|
|
1407
1410
|
return;
|
|
1408
1411
|
const u = (t ? o.filter((r) => r.bookmaker && t.includes(r.bookmaker.id)) : o).filter((r) => r.bookmaker && r.markets && r.markets.length > 0).map((r) => {
|
|
1409
|
-
const d = r.bookmaker, f = d.assets?.[0], l = d.branding?.backgroundColor || f?.backgroundColor, h = d.branding?.textColor || (
|
|
1412
|
+
const d = r.bookmaker, f = d.assets?.[0], l = d.branding?.backgroundColor || f?.backgroundColor, h = d.branding?.textColor || (Ie(l) ? "#FFFFFF" : "#000000"), v = f?.transparentBackgroundUrl || f?.logo, C = d.eventUrls?.find((_) => _.appType === "desktop")?.url || d.links?.find((_) => _.appType === "desktop")?.homepageUrl || d.url || "";
|
|
1410
1413
|
return {
|
|
1411
1414
|
operator: {
|
|
1412
1415
|
id: d.id,
|
|
@@ -1452,12 +1455,12 @@ function Ee(e, t) {
|
|
|
1452
1455
|
n.set(a, u);
|
|
1453
1456
|
}), n;
|
|
1454
1457
|
}
|
|
1455
|
-
function
|
|
1458
|
+
function Ie(e) {
|
|
1456
1459
|
if (!e) return !0;
|
|
1457
1460
|
const t = e.replace("#", ""), n = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16);
|
|
1458
1461
|
return (0.2126 * n + 0.7152 * o + 0.0722 * a) / 255 < 0.5;
|
|
1459
1462
|
}
|
|
1460
|
-
async function
|
|
1463
|
+
async function Qe(e, t, n) {
|
|
1461
1464
|
if (!t || t.length === 0)
|
|
1462
1465
|
return /* @__PURE__ */ new Map();
|
|
1463
1466
|
const o = {
|
|
@@ -1465,41 +1468,42 @@ async function Je(e, t, n) {
|
|
|
1465
1468
|
scopeType: n?.scopeType || "ORDINARY_TIME",
|
|
1466
1469
|
oddFormat: n?.oddFormat || "DECIMAL"
|
|
1467
1470
|
};
|
|
1468
|
-
n?.marketTypes && n.marketTypes.length > 0 && (o.marketTypes = n.marketTypes.map((s) =>
|
|
1471
|
+
n?.marketTypes && n.marketTypes.length > 0 && (o.marketTypes = n.marketTypes.map((s) => Ee(s)));
|
|
1469
1472
|
const a = await e.odds.getByMatchIds(t, o);
|
|
1470
|
-
return
|
|
1473
|
+
return Ae(a, n?.bookmakerIds);
|
|
1471
1474
|
}
|
|
1472
1475
|
export {
|
|
1473
|
-
|
|
1476
|
+
Se as A,
|
|
1474
1477
|
ze as B,
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
Re as
|
|
1480
|
-
|
|
1478
|
+
Je as C,
|
|
1479
|
+
Ne as D,
|
|
1480
|
+
Oe as E,
|
|
1481
|
+
be as F,
|
|
1482
|
+
Re as S,
|
|
1483
|
+
V as a,
|
|
1484
|
+
Le as b,
|
|
1481
1485
|
M as c,
|
|
1482
|
-
|
|
1483
|
-
|
|
1486
|
+
De as d,
|
|
1487
|
+
ke as e,
|
|
1484
1488
|
g as f,
|
|
1485
1489
|
m as g,
|
|
1486
1490
|
qe as h,
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1491
|
+
Xe as i,
|
|
1492
|
+
Fe as j,
|
|
1493
|
+
Qe as k,
|
|
1494
|
+
We as l,
|
|
1495
|
+
Be as m,
|
|
1496
|
+
xe as n,
|
|
1497
|
+
$e as o,
|
|
1494
1498
|
Pe as p,
|
|
1495
1499
|
Me as q,
|
|
1496
1500
|
Ue as r,
|
|
1497
|
-
|
|
1501
|
+
He as s,
|
|
1498
1502
|
i as t,
|
|
1499
|
-
|
|
1500
|
-
|
|
1503
|
+
Ye as u,
|
|
1504
|
+
de as v,
|
|
1501
1505
|
Ke as w,
|
|
1502
|
-
|
|
1506
|
+
je as x,
|
|
1503
1507
|
Ge as y,
|
|
1504
|
-
|
|
1508
|
+
Ve as z
|
|
1505
1509
|
};
|