@golstats/gsc-positions-and-connections 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/favicon.ico +0 -0
- package/dist/field.svg +13 -0
- package/dist/fonts/Montserrat-Black.otf +0 -0
- package/dist/fonts/Montserrat-BlackItalic.otf +0 -0
- package/dist/fonts/Montserrat-Bold.otf +0 -0
- package/dist/fonts/Montserrat-BoldItalic.otf +0 -0
- package/dist/fonts/Montserrat-ExtraBold.otf +0 -0
- package/dist/fonts/Montserrat-ExtraBoldItalic.otf +0 -0
- package/dist/fonts/Montserrat-ExtraLight.otf +0 -0
- package/dist/fonts/Montserrat-ExtraLightItalic.otf +0 -0
- package/dist/fonts/Montserrat-Italic.otf +0 -0
- package/dist/fonts/Montserrat-Light.otf +0 -0
- package/dist/fonts/Montserrat-LightItalic.otf +0 -0
- package/dist/fonts/Montserrat-Medium.otf +0 -0
- package/dist/fonts/Montserrat-MediumItalic.otf +0 -0
- package/dist/fonts/Montserrat-Regular.otf +0 -0
- package/dist/fonts/Montserrat-SemiBold.otf +0 -0
- package/dist/fonts/Montserrat-SemiBoldItalic.otf +0 -0
- package/dist/fonts/Montserrat-Thin.otf +0 -0
- package/dist/fonts/Montserrat-ThinItalic.otf +0 -0
- package/dist/fonts/Poppins-Black.otf +0 -0
- package/dist/fonts/Poppins-BlackItalic.otf +0 -0
- package/dist/fonts/Poppins-Bold.otf +0 -0
- package/dist/fonts/Poppins-BoldItalic.otf +0 -0
- package/dist/fonts/Poppins-ExtraBold.otf +0 -0
- package/dist/fonts/Poppins-ExtraBoldItalic.otf +0 -0
- package/dist/fonts/Poppins-ExtraLight.otf +0 -0
- package/dist/fonts/Poppins-ExtraLightItalic.otf +0 -0
- package/dist/fonts/Poppins-Italic.otf +0 -0
- package/dist/fonts/Poppins-Light.otf +0 -0
- package/dist/fonts/Poppins-LightItalic.otf +0 -0
- package/dist/fonts/Poppins-Medium.otf +0 -0
- package/dist/fonts/Poppins-MediumItalic.otf +0 -0
- package/dist/fonts/Poppins-Regular.otf +0 -0
- package/dist/fonts/Poppins-SemiBold.otf +0 -0
- package/dist/fonts/Poppins-SemiBoldItalic.otf +0 -0
- package/dist/fonts/Poppins-Thin.otf +0 -0
- package/dist/fonts/Poppins-ThinItalic.otf +0 -0
- package/dist/gsc-positions-and-connections.css +1 -0
- package/dist/gsc-positions-and-connections.js +3026 -0
- package/dist/gsc-positions-and-connections.umd.cjs +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,3026 @@
|
|
|
1
|
+
var Ve = Object.defineProperty;
|
|
2
|
+
var $e = (a, e, t) => e in a ? Ve(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var se = (a, e, t) => $e(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { useCssVars as le, ref as x, computed as D, watch as Q, createElementBlock as h, openBlock as g, normalizeClass as O, createElementVNode as s, createCommentVNode as q, normalizeStyle as W, Fragment as z, toDisplayString as E, createVNode as R, unref as N, withModifiers as K, onMounted as ce, nextTick as Pe, renderSlot as ue, Transition as Be, withCtx as ne, withDirectives as U, vShow as Le, resolveComponent as Ce, renderList as X, reactive as oe, createTextVNode as J, vModelCheckbox as H, isRef as ge, vModelRadio as re, vModelText as de } from "vue";
|
|
5
|
+
const Re = (a, e) => {
|
|
6
|
+
const t = a.__vccOpts || a;
|
|
7
|
+
for (const [n, l] of e)
|
|
8
|
+
t[n] = l;
|
|
9
|
+
return t;
|
|
10
|
+
}, De = { key: 1 }, Fe = {
|
|
11
|
+
width: "10",
|
|
12
|
+
height: "8",
|
|
13
|
+
viewBox: "0 0 10 8",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, Ae = ["fill"], ze = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "checkbox__teams"
|
|
19
|
+
}, Ne = { class: "checkbox__teams__logo" }, Xe = ["src"], Ue = { class: "checkbox__teams__logo" }, Oe = ["src"], We = {
|
|
20
|
+
__name: "GSC-Checkbox",
|
|
21
|
+
props: {
|
|
22
|
+
width: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "fit-content"
|
|
25
|
+
},
|
|
26
|
+
height: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "fit-content"
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
labelWhiteSpace: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "normal"
|
|
37
|
+
},
|
|
38
|
+
labelColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "white"
|
|
41
|
+
},
|
|
42
|
+
fontFamily: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "sans-serif"
|
|
45
|
+
},
|
|
46
|
+
labelFontSize: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "12px"
|
|
49
|
+
},
|
|
50
|
+
modelValue: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
justifyContent: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "flex-start"
|
|
57
|
+
},
|
|
58
|
+
alignItems: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "center"
|
|
61
|
+
},
|
|
62
|
+
boxBackgroundColor: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: "#CBEE6B"
|
|
65
|
+
},
|
|
66
|
+
boxValueColor: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "#0d1d29"
|
|
69
|
+
},
|
|
70
|
+
boxValue: {
|
|
71
|
+
type: [String, Number],
|
|
72
|
+
default: ""
|
|
73
|
+
},
|
|
74
|
+
boxPosition: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "left",
|
|
77
|
+
// values can be 'left', 'right', 'top', 'bottom'
|
|
78
|
+
validator(a) {
|
|
79
|
+
return ["left", "right", "top", "bottom"].includes(a);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
boxMarginTop: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "0.2em"
|
|
85
|
+
},
|
|
86
|
+
boxWidthAndHeight: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: "16px"
|
|
89
|
+
},
|
|
90
|
+
boxBorderColor: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: "#969da2"
|
|
93
|
+
},
|
|
94
|
+
boxBorderWidth: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "2px"
|
|
97
|
+
},
|
|
98
|
+
boxBorderRadius: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "4px"
|
|
101
|
+
},
|
|
102
|
+
boxValueFontSize: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: "10px"
|
|
105
|
+
},
|
|
106
|
+
boxValueFontFamily: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: "sans-serif"
|
|
109
|
+
},
|
|
110
|
+
avoidInteraction: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: !1
|
|
113
|
+
},
|
|
114
|
+
avoidToCheck: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: !1
|
|
117
|
+
},
|
|
118
|
+
isBoxOnly: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: !1
|
|
121
|
+
},
|
|
122
|
+
teamsIds: {
|
|
123
|
+
type: Array,
|
|
124
|
+
default: () => null
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
emits: ["update:modelValue"],
|
|
128
|
+
setup(a, { emit: e }) {
|
|
129
|
+
const t = a;
|
|
130
|
+
le((w) => ({
|
|
131
|
+
"7bd9d47b": a.width,
|
|
132
|
+
"34dc7ddc": a.height
|
|
133
|
+
}));
|
|
134
|
+
const n = x(!1), l = D(() => {
|
|
135
|
+
const w = {
|
|
136
|
+
color: t.boxValueColor,
|
|
137
|
+
"font-family": t.fontFamily,
|
|
138
|
+
height: t.boxWidthAndHeight,
|
|
139
|
+
width: t.boxWidthAndHeight,
|
|
140
|
+
minWidth: t.boxWidthAndHeight,
|
|
141
|
+
"border-radius": t.boxBorderRadius,
|
|
142
|
+
"margin-top": t.boxMarginTop
|
|
143
|
+
};
|
|
144
|
+
return n.value ? (w["background-color"] = t.boxBackgroundColor, w.border = `solid ${t.boxBorderWidth} ${t.boxBackgroundColor}`) : w.border = `solid ${t.boxBorderWidth} ${t.boxBorderColor}`, w;
|
|
145
|
+
}), i = D(() => ({
|
|
146
|
+
"font-family": t.boxValueFontFamily,
|
|
147
|
+
"font-size": t.boxValueFontSize,
|
|
148
|
+
color: t.boxValueColor,
|
|
149
|
+
"line-height": 1
|
|
150
|
+
})), o = D(() => {
|
|
151
|
+
const w = {
|
|
152
|
+
color: t.labelColor,
|
|
153
|
+
"font-family": t.fontFamily,
|
|
154
|
+
"font-size": t.labelFontSize,
|
|
155
|
+
"white-space": t.labelWhiteSpace,
|
|
156
|
+
"text-align": t.boxPosition === "top" || t.boxPosition === "bottom" ? "center" : t.boxPosition
|
|
157
|
+
};
|
|
158
|
+
return (t.boxPosition === "left" || t.boxPosition === "right") && (w[`margin-${t.boxPosition}`] = t.isBoxOnly ? "0" : t.teamsIds ? "8px" : "10px"), w;
|
|
159
|
+
});
|
|
160
|
+
Q(
|
|
161
|
+
() => t.modelValue,
|
|
162
|
+
(w) => {
|
|
163
|
+
w !== n.value && (n.value = w);
|
|
164
|
+
},
|
|
165
|
+
{ immediate: !0 }
|
|
166
|
+
);
|
|
167
|
+
function d() {
|
|
168
|
+
t.avoidInteraction || !n.value && t.avoidToCheck || (n.value = !n.value, e("update:modelValue", n.value));
|
|
169
|
+
}
|
|
170
|
+
function C(w) {
|
|
171
|
+
return `${{}.TEAM_LOGOS_URL || "https://golstatsimages.blob.core.windows.net/teams-80/"}${w}.png`;
|
|
172
|
+
}
|
|
173
|
+
return (w, I) => (g(), h("div", {
|
|
174
|
+
class: O(["checkbox", `box-${a.boxPosition}`]),
|
|
175
|
+
onClick: d
|
|
176
|
+
}, [
|
|
177
|
+
s("div", {
|
|
178
|
+
class: "checkbox__box",
|
|
179
|
+
style: W(l.value)
|
|
180
|
+
}, [
|
|
181
|
+
n.value ? (g(), h(z, { key: 0 }, [
|
|
182
|
+
t.boxValue ? (g(), h("div", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "checkbox__box__value",
|
|
185
|
+
style: W(i.value)
|
|
186
|
+
}, E(a.boxValue), 5)) : (g(), h("div", De, [
|
|
187
|
+
(g(), h("svg", Fe, [
|
|
188
|
+
s("path", {
|
|
189
|
+
d: "M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",
|
|
190
|
+
fill: a.boxValueColor
|
|
191
|
+
}, null, 8, Ae)
|
|
192
|
+
]))
|
|
193
|
+
]))
|
|
194
|
+
], 64)) : q("", !0)
|
|
195
|
+
], 4),
|
|
196
|
+
a.teamsIds && a.teamsIds.length ? (g(), h("div", ze, [
|
|
197
|
+
s("div", Ne, [
|
|
198
|
+
s("img", {
|
|
199
|
+
src: C(a.teamsIds[0]),
|
|
200
|
+
alt: ""
|
|
201
|
+
}, null, 8, Xe)
|
|
202
|
+
]),
|
|
203
|
+
s("div", Ue, [
|
|
204
|
+
s("img", {
|
|
205
|
+
src: C(a.teamsIds[1]),
|
|
206
|
+
alt: ""
|
|
207
|
+
}, null, 8, Oe)
|
|
208
|
+
])
|
|
209
|
+
])) : q("", !0),
|
|
210
|
+
s("div", {
|
|
211
|
+
class: "checkbox__label",
|
|
212
|
+
style: W(o.value)
|
|
213
|
+
}, E(a.label), 5)
|
|
214
|
+
], 2));
|
|
215
|
+
}
|
|
216
|
+
}, ie = /* @__PURE__ */ Re(We, [["__scopeId", "data-v-b6f124d8"]]), G = (a, e) => {
|
|
217
|
+
const t = a.__vccOpts || a;
|
|
218
|
+
for (const [n, l] of e)
|
|
219
|
+
t[n] = l;
|
|
220
|
+
return t;
|
|
221
|
+
}, qe = { class: "button__checkbox" }, Ye = { class: "button__text" }, Ge = {
|
|
222
|
+
__name: "FilterButton",
|
|
223
|
+
props: {
|
|
224
|
+
isArrowVisible: {
|
|
225
|
+
type: Boolean,
|
|
226
|
+
default: !0
|
|
227
|
+
},
|
|
228
|
+
text: {
|
|
229
|
+
type: String,
|
|
230
|
+
default: "text"
|
|
231
|
+
},
|
|
232
|
+
arrowColor: {
|
|
233
|
+
type: String,
|
|
234
|
+
default: "white"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
emits: ["click", "expand"],
|
|
238
|
+
setup(a, { emit: e }) {
|
|
239
|
+
const t = e, n = x(!1), l = x(!1);
|
|
240
|
+
function i() {
|
|
241
|
+
n.value = !n.value, t("change-selected", n.value);
|
|
242
|
+
}
|
|
243
|
+
function o() {
|
|
244
|
+
l.value = !l.value, t("expand", l.value);
|
|
245
|
+
}
|
|
246
|
+
return (d, C) => (g(), h("div", {
|
|
247
|
+
class: "button",
|
|
248
|
+
onClick: i
|
|
249
|
+
}, [
|
|
250
|
+
s("div", qe, [
|
|
251
|
+
R(N(ie), {
|
|
252
|
+
"model-value": n.value,
|
|
253
|
+
width: "100%",
|
|
254
|
+
"avoid-interaction": ""
|
|
255
|
+
}, null, 8, ["model-value"])
|
|
256
|
+
]),
|
|
257
|
+
s("div", Ye, E(a.text), 1),
|
|
258
|
+
a.isArrowVisible ? (g(), h("div", {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: O(["button__arrow", { "rotated-180": l.value }]),
|
|
261
|
+
onClick: K(o, ["stop"])
|
|
262
|
+
}, C[0] || (C[0] = [
|
|
263
|
+
s("svg", {
|
|
264
|
+
width: "12",
|
|
265
|
+
height: "8",
|
|
266
|
+
viewBox: "0 0 12 8",
|
|
267
|
+
fill: "none",
|
|
268
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
269
|
+
}, [
|
|
270
|
+
s("path", {
|
|
271
|
+
d: "M1.70727 0.792892C1.31674 0.402368 0.683727 0.402368 0.293203 0.792892C-0.0973215 1.18342 -0.0973215 1.81643 0.293203 2.20695L5.2932 7.20696C5.68373 7.59748 6.31674 7.59748 6.70727 7.20696L11.7073 2.20696L11.7756 2.13078C12.096 1.73801 12.0734 1.15901 11.7073 0.792893C11.3411 0.426777 10.7621 0.404183 10.3694 0.724534L10.2932 0.792893L6.00023 5.08586L1.70727 0.792892Z",
|
|
272
|
+
fill: "#9CA3AF"
|
|
273
|
+
})
|
|
274
|
+
], -1)
|
|
275
|
+
]), 2)) : q("", !0)
|
|
276
|
+
]));
|
|
277
|
+
}
|
|
278
|
+
}, Se = /* @__PURE__ */ G(Ge, [["__scopeId", "data-v-9206d69d"]]), je = (a, e) => {
|
|
279
|
+
const t = a.__vccOpts || a;
|
|
280
|
+
for (const [n, l] of e)
|
|
281
|
+
t[n] = l;
|
|
282
|
+
return t;
|
|
283
|
+
}, Ze = {
|
|
284
|
+
__name: "GSC-Menu",
|
|
285
|
+
props: {
|
|
286
|
+
menuMarginTop: {
|
|
287
|
+
type: Number,
|
|
288
|
+
default: 0,
|
|
289
|
+
validator(a) {
|
|
290
|
+
return !Number.isNaN(a);
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
modelValue: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: !1
|
|
296
|
+
},
|
|
297
|
+
width: {
|
|
298
|
+
type: String,
|
|
299
|
+
default: "fit-content"
|
|
300
|
+
},
|
|
301
|
+
menuWidth: {
|
|
302
|
+
type: String,
|
|
303
|
+
default: "fit-content"
|
|
304
|
+
},
|
|
305
|
+
zIndexOpen: {
|
|
306
|
+
type: Number,
|
|
307
|
+
default: 3
|
|
308
|
+
},
|
|
309
|
+
leftMenu: {
|
|
310
|
+
type: String,
|
|
311
|
+
default: "unset"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
emits: ["update:modelValue"],
|
|
315
|
+
setup(a, { emit: e }) {
|
|
316
|
+
const t = a;
|
|
317
|
+
le((_) => ({
|
|
318
|
+
"398d9242": a.width,
|
|
319
|
+
f164e302: C.value,
|
|
320
|
+
"4bb88040": a.menuWidth
|
|
321
|
+
}));
|
|
322
|
+
const n = x(null), l = x(!1), i = x(null), o = x({}), d = D(() => {
|
|
323
|
+
const _ = {
|
|
324
|
+
top: "0px",
|
|
325
|
+
"--left-menu": t.leftMenu
|
|
326
|
+
};
|
|
327
|
+
if (n.value) {
|
|
328
|
+
const T = n.value.getBoundingClientRect();
|
|
329
|
+
_.top = `${T.height + t.menuMarginTop}px`;
|
|
330
|
+
}
|
|
331
|
+
return _;
|
|
332
|
+
}), C = D(() => l.value ? t.zIndexOpen : 1);
|
|
333
|
+
Q(
|
|
334
|
+
() => t.modelValue,
|
|
335
|
+
(_) => {
|
|
336
|
+
_ !== l.value && (l.value = _);
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
immediate: !0
|
|
340
|
+
}
|
|
341
|
+
), Q(l, (_) => {
|
|
342
|
+
_ || setTimeout(() => {
|
|
343
|
+
o.value["--translate-x"] = "0px";
|
|
344
|
+
}, 500);
|
|
345
|
+
});
|
|
346
|
+
function w(_) {
|
|
347
|
+
const T = window.innerWidth, p = _.boundingClientRect.x, f = _.boundingClientRect.x + _.boundingClientRect.width, b = p <= 0 ? Math.abs(p) + 4 : f >= T ? T - (f + 10) : 0;
|
|
348
|
+
o.value["--translate-x"] = `${b}px`;
|
|
349
|
+
}
|
|
350
|
+
function I() {
|
|
351
|
+
new IntersectionObserver((_) => {
|
|
352
|
+
_[0].intersectionRatio > 0 && w(_[0]);
|
|
353
|
+
}).observe(i.value);
|
|
354
|
+
}
|
|
355
|
+
function V() {
|
|
356
|
+
l.value = !l.value, e("update:modelValue", l.value);
|
|
357
|
+
}
|
|
358
|
+
function M() {
|
|
359
|
+
l.value = !1, e("update:modelValue", l.value);
|
|
360
|
+
}
|
|
361
|
+
return ce(() => {
|
|
362
|
+
Pe(() => {
|
|
363
|
+
I();
|
|
364
|
+
});
|
|
365
|
+
}), (_, T) => (g(), h(z, null, [
|
|
366
|
+
l.value ? (g(), h("div", {
|
|
367
|
+
key: 0,
|
|
368
|
+
id: "menu-overlay",
|
|
369
|
+
onClick: M
|
|
370
|
+
})) : q("", !0),
|
|
371
|
+
s("div", {
|
|
372
|
+
class: "menu-container",
|
|
373
|
+
style: W(o.value)
|
|
374
|
+
}, [
|
|
375
|
+
s("div", {
|
|
376
|
+
ref_key: "trigger",
|
|
377
|
+
ref: n,
|
|
378
|
+
class: "menu-container__trigger",
|
|
379
|
+
onClick: V
|
|
380
|
+
}, [
|
|
381
|
+
ue(_.$slots, "trigger", {}, void 0, !0)
|
|
382
|
+
], 512),
|
|
383
|
+
R(Be, null, {
|
|
384
|
+
default: ne(() => [
|
|
385
|
+
U(s("div", {
|
|
386
|
+
ref_key: "menu",
|
|
387
|
+
ref: i,
|
|
388
|
+
class: "menu-container__menu",
|
|
389
|
+
style: W(d.value)
|
|
390
|
+
}, [
|
|
391
|
+
ue(_.$slots, "menu", {}, void 0, !0)
|
|
392
|
+
], 4), [
|
|
393
|
+
[Le, l.value]
|
|
394
|
+
])
|
|
395
|
+
]),
|
|
396
|
+
_: 3
|
|
397
|
+
})
|
|
398
|
+
], 4)
|
|
399
|
+
], 64));
|
|
400
|
+
}
|
|
401
|
+
}, Qe = /* @__PURE__ */ je(Ze, [["__scopeId", "data-v-18c0df61"]]), Me = (a, e) => {
|
|
402
|
+
const t = a.__vccOpts || a;
|
|
403
|
+
for (const [n, l] of e)
|
|
404
|
+
t[n] = l;
|
|
405
|
+
return t;
|
|
406
|
+
}, Je = {
|
|
407
|
+
name: "MultiRangeSlider",
|
|
408
|
+
props: {
|
|
409
|
+
baseClassName: {
|
|
410
|
+
type: String,
|
|
411
|
+
default: "multi-range-slider"
|
|
412
|
+
},
|
|
413
|
+
min: { type: Number },
|
|
414
|
+
max: { type: Number },
|
|
415
|
+
minValue: { type: Number },
|
|
416
|
+
maxValue: { type: Number },
|
|
417
|
+
step: { type: Number, default: 1 },
|
|
418
|
+
preventWheel: { type: Boolean, default: !1 },
|
|
419
|
+
ruler: { type: Boolean, default: !0 },
|
|
420
|
+
label: { type: Boolean, default: !0 },
|
|
421
|
+
labels: { type: Array },
|
|
422
|
+
minCaption: { type: String },
|
|
423
|
+
maxCaption: { type: String },
|
|
424
|
+
rangeMargin: { type: Number }
|
|
425
|
+
},
|
|
426
|
+
data() {
|
|
427
|
+
let a = this.labels || [], e = this.min === void 0 ? 0 : this.min, t = a.length ? a.length - 1 : 100, n = this.max === void 0 ? t : this.max, l = this.minValue === void 0 ? 25 : this.minValue;
|
|
428
|
+
a.length && this.minValue === void 0 && (l = 1);
|
|
429
|
+
let i = this.maxValue || 75;
|
|
430
|
+
if (a.length && this.maxValue === void 0 && (i = a.length - 2), n <= e)
|
|
431
|
+
throw new Error("Invalid props min or max");
|
|
432
|
+
if (l > i)
|
|
433
|
+
throw new Error("Invalid props minValue or maxValue");
|
|
434
|
+
let o = this.rangeMargin === void 0 ? this.step : this.rangeMargin, d = o % this.step;
|
|
435
|
+
return d && (o = o + this.step - d), {
|
|
436
|
+
valueMin: l < e ? e : l,
|
|
437
|
+
valueMax: i > n ? n : i,
|
|
438
|
+
interVal: null,
|
|
439
|
+
startX: null,
|
|
440
|
+
mouseMoveCounter: null,
|
|
441
|
+
barBox: null,
|
|
442
|
+
barValue: 0,
|
|
443
|
+
rangeMarginValue: o
|
|
444
|
+
};
|
|
445
|
+
},
|
|
446
|
+
methods: {
|
|
447
|
+
onBarLeftClick() {
|
|
448
|
+
this.valueMin - this.step >= this.minimum ? this.valueMin -= this.step : this.valueMin = this.minimum;
|
|
449
|
+
},
|
|
450
|
+
onInnerBarLeftClick() {
|
|
451
|
+
this.valueMin + this.rangeMarginValue < this.valueMax && (this.valueMin += this.step);
|
|
452
|
+
},
|
|
453
|
+
onBarRightClick() {
|
|
454
|
+
this.valueMax + this.step <= this.maximum ? this.valueMax += this.step : this.valueMax = this.maximum;
|
|
455
|
+
},
|
|
456
|
+
onInnerBarRightClick() {
|
|
457
|
+
this.valueMax - this.rangeMarginValue > this.valueMin && (this.valueMax -= this.step);
|
|
458
|
+
},
|
|
459
|
+
onInputMinChange(a) {
|
|
460
|
+
let e = parseFloat(a.target.value);
|
|
461
|
+
e <= this.valueMax - this.rangeMarginValue && e >= this.minimum ? this.valueMin = e : a.target.value = this.valueMin;
|
|
462
|
+
},
|
|
463
|
+
onInputMaxChange(a) {
|
|
464
|
+
let e = parseFloat(a.target.value);
|
|
465
|
+
e >= this.valueMin + this.rangeMarginValue && e <= this.maximum ? this.valueMax = e : a.target.value = this.valueMax;
|
|
466
|
+
},
|
|
467
|
+
onLeftThumbMousedown(a) {
|
|
468
|
+
if (a.preventDefault(), this.startX = a.clientX, a.type === "touchstart")
|
|
469
|
+
if (a.touches.length === 1)
|
|
470
|
+
this.startX = a.touches[0].clientX;
|
|
471
|
+
else
|
|
472
|
+
return;
|
|
473
|
+
this.mouseMoveCounter = 0, this.barValue = this.valueMin, this.barBox = a.target.parentNode.getBoundingClientRect(), document.addEventListener("mousemove", this.onLeftThumbMousemove), document.addEventListener("mouseup", this.onLeftThumbMouseup), document.addEventListener("touchmove", this.onLeftThumbMousemove), document.addEventListener("touchend", this.onLeftThumbMouseup);
|
|
474
|
+
},
|
|
475
|
+
onLeftThumbMousemove(a) {
|
|
476
|
+
this.mouseMoveCounter++;
|
|
477
|
+
let e = a.clientX;
|
|
478
|
+
a.type === "touchmove" && (e = a.touches[0].clientX);
|
|
479
|
+
let t = (e - this.startX) / this.barBox.width, n = this.barValue + (this.maximum - this.minimum) * t, l = n % this.step;
|
|
480
|
+
n -= l, n < this.minimum ? n = this.minimum : n > this.valueMax - this.rangeMarginValue && (n = this.valueMax - this.rangeMarginValue), this.valueMin = n;
|
|
481
|
+
},
|
|
482
|
+
onLeftThumbMouseup() {
|
|
483
|
+
document.removeEventListener("mousemove", this.onLeftThumbMousemove), document.removeEventListener("mouseup", this.onLeftThumbMouseup), document.removeEventListener("touchmove", this.onLeftThumbMousemove), document.removeEventListener("touchend", this.onLeftThumbMouseup);
|
|
484
|
+
},
|
|
485
|
+
onRightThumbMousedown(a) {
|
|
486
|
+
if (a.preventDefault(), this.startX = a.clientX, a.type === "touchstart")
|
|
487
|
+
if (a.touches.length === 1)
|
|
488
|
+
this.startX = a.touches[0].clientX;
|
|
489
|
+
else
|
|
490
|
+
return;
|
|
491
|
+
this.mouseMoveCounter = 0, this.barValue = this.valueMax, this.barBox = a.target.parentNode.getBoundingClientRect(), document.addEventListener("mousemove", this.onRightThumbMousemove), document.addEventListener("mouseup", this.onRightThumbMouseup), document.addEventListener("touchmove", this.onRightThumbMousemove), document.addEventListener("touchend", this.onRightThumbMouseup);
|
|
492
|
+
},
|
|
493
|
+
onRightThumbMousemove(a) {
|
|
494
|
+
this.mouseMoveCounter++;
|
|
495
|
+
let e = a.clientX;
|
|
496
|
+
a.type === "touchmove" && (e = a.touches[0].clientX);
|
|
497
|
+
let t = (e - this.startX) / this.barBox.width, n = this.barValue + (this.maximum - this.minimum) * t, l = n % this.step;
|
|
498
|
+
n -= l, n < this.valueMin + this.rangeMarginValue ? n = this.valueMin + this.rangeMarginValue : n > this.maximum && (n = this.maximum), this.valueMax = n;
|
|
499
|
+
},
|
|
500
|
+
onRightThumbMouseup() {
|
|
501
|
+
document.removeEventListener("mousemove", this.onRightThumbMousemove), document.removeEventListener("mouseup", this.onRightThumbMouseup), document.removeEventListener("touchmove", this.onRightThumbMousemove), document.removeEventListener("touchend", this.onRightThumbMouseup);
|
|
502
|
+
},
|
|
503
|
+
onMouseWheel(a) {
|
|
504
|
+
if (this.preventWheel === !0 || !a.shiftKey && !a.ctrlKey)
|
|
505
|
+
return;
|
|
506
|
+
let e = this.step;
|
|
507
|
+
a.deltaY < 0 && (e = -e), a.shiftKey && a.ctrlKey ? this.valueMin + e >= this.minimum && this.valueMax + e <= this.maximum && (this.valueMin = this.valueMin + e, this.valueMax = this.valueMax + e) : a.ctrlKey ? (e = this.valueMax + e, e < this.valueMin + this.rangeMarginValue ? e = this.valueMin + this.rangeMarginValue : e > this.maximum && (e = this.maximum), this.valueMax = e) : a.shiftKey && (e = this.valueMin + e, e < this.minimum ? e = this.minimum : e > this.valueMax - this.rangeMarginValue && (e = this.valueMax - this.rangeMarginValue), this.valueMin = e);
|
|
508
|
+
},
|
|
509
|
+
triggerInput() {
|
|
510
|
+
let a = 0;
|
|
511
|
+
this.step.toString().includes(".") && (a = 2);
|
|
512
|
+
let e = {
|
|
513
|
+
min: this.minimum,
|
|
514
|
+
max: this.maximum,
|
|
515
|
+
minValue: parseFloat(this.valueMin.toFixed(a)),
|
|
516
|
+
maxValue: parseFloat(this.valueMax.toFixed(a))
|
|
517
|
+
};
|
|
518
|
+
this.$emit("input", e);
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
computed: {
|
|
522
|
+
minimum() {
|
|
523
|
+
return this.min === void 0 ? 0 : this.min;
|
|
524
|
+
},
|
|
525
|
+
maximum() {
|
|
526
|
+
let a = this.labels || [], e = a.length ? a.length - 1 : 100;
|
|
527
|
+
return this.max === void 0 ? e : this.max;
|
|
528
|
+
},
|
|
529
|
+
stepCount() {
|
|
530
|
+
let a = this.labels || [];
|
|
531
|
+
return a.length ? a.length - 1 : Math.floor((this.maximum - this.minimum) / this.step);
|
|
532
|
+
},
|
|
533
|
+
subStepCount() {
|
|
534
|
+
return (this.labels || []).length && this.step > 1 ? (this.maximum - this.minimum) / this.step : 0;
|
|
535
|
+
},
|
|
536
|
+
barMin() {
|
|
537
|
+
return (this.valueMin - this.minimum) / (this.maximum - this.minimum) * 100;
|
|
538
|
+
},
|
|
539
|
+
barMax() {
|
|
540
|
+
return 100 - (this.valueMax - this.minimum) / (this.maximum - this.minimum) * 100;
|
|
541
|
+
},
|
|
542
|
+
barMinVal() {
|
|
543
|
+
let a = 0;
|
|
544
|
+
return this.step.toString().includes(".") && (a = 2), (this.valueMin || 0).toFixed(a);
|
|
545
|
+
},
|
|
546
|
+
barMaxVal() {
|
|
547
|
+
let a = 0;
|
|
548
|
+
return this.step.toString().includes(".") && (a = 2), (this.valueMax || 100).toFixed(a);
|
|
549
|
+
},
|
|
550
|
+
scaleLabels() {
|
|
551
|
+
let a = this.labels || [];
|
|
552
|
+
return a.length === 0 && (a = [], a.push(this.minimum), a.push(this.maximum)), a;
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
watch: {
|
|
556
|
+
valueMin() {
|
|
557
|
+
this.triggerInput();
|
|
558
|
+
},
|
|
559
|
+
valueMax() {
|
|
560
|
+
this.triggerInput();
|
|
561
|
+
},
|
|
562
|
+
minValue(a) {
|
|
563
|
+
this.valueMin = a < this.minimum ? this.minimum : a;
|
|
564
|
+
},
|
|
565
|
+
maxValue(a) {
|
|
566
|
+
this.valueMax = a > this.maximum ? this.maximum : a;
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
mounted() {
|
|
570
|
+
}
|
|
571
|
+
}, He = { class: "bar" }, Ke = ["min", "max", "step", "value"], et = { class: "caption" }, tt = { class: "min-caption" }, at = { class: "bar-inner" }, st = ["min", "max", "step", "value"], nt = { class: "caption" }, it = { class: "max-caption" }, lt = {
|
|
572
|
+
key: 0,
|
|
573
|
+
class: "ruler"
|
|
574
|
+
}, ot = {
|
|
575
|
+
key: 1,
|
|
576
|
+
class: "sub-ruler"
|
|
577
|
+
}, rt = {
|
|
578
|
+
key: 2,
|
|
579
|
+
class: "labels"
|
|
580
|
+
};
|
|
581
|
+
function dt(a, e, t, n, l, i) {
|
|
582
|
+
return g(), h("div", {
|
|
583
|
+
class: O([t.baseClassName, l.rangeMarginValue === 0 ? "zero-ranage-margin" : ""]),
|
|
584
|
+
onMousewheel: e[10] || (e[10] = K((...o) => i.onMouseWheel && i.onMouseWheel(...o), ["prevent", "stop"]))
|
|
585
|
+
}, [
|
|
586
|
+
s("div", He, [
|
|
587
|
+
s("div", {
|
|
588
|
+
class: "bar-left",
|
|
589
|
+
style: W({ width: i.barMin + "%" }),
|
|
590
|
+
onClick: e[0] || (e[0] = (...o) => i.onBarLeftClick && i.onBarLeftClick(...o))
|
|
591
|
+
}, null, 4),
|
|
592
|
+
s("input", {
|
|
593
|
+
class: "input-type-range input-type-range-min",
|
|
594
|
+
type: "range",
|
|
595
|
+
min: i.minimum,
|
|
596
|
+
max: i.maximum,
|
|
597
|
+
step: t.step,
|
|
598
|
+
value: l.valueMin,
|
|
599
|
+
onInput: e[1] || (e[1] = K((...o) => i.onInputMinChange && i.onInputMinChange(...o), ["stop", "prevent"]))
|
|
600
|
+
}, null, 40, Ke),
|
|
601
|
+
s("div", {
|
|
602
|
+
class: "thumb thumb-left",
|
|
603
|
+
onMousedown: e[2] || (e[2] = (...o) => i.onLeftThumbMousedown && i.onLeftThumbMousedown(...o)),
|
|
604
|
+
onTouchstart: e[3] || (e[3] = (...o) => i.onLeftThumbMousedown && i.onLeftThumbMousedown(...o))
|
|
605
|
+
}, [
|
|
606
|
+
s("div", et, [
|
|
607
|
+
s("span", tt, E(t.minCaption || i.barMinVal), 1)
|
|
608
|
+
])
|
|
609
|
+
], 32),
|
|
610
|
+
s("div", at, [
|
|
611
|
+
s("div", {
|
|
612
|
+
class: "bar-inner-left",
|
|
613
|
+
onClick: e[4] || (e[4] = (...o) => i.onInnerBarLeftClick && i.onInnerBarLeftClick(...o))
|
|
614
|
+
}),
|
|
615
|
+
s("div", {
|
|
616
|
+
class: "bar-inner-right",
|
|
617
|
+
onClick: e[5] || (e[5] = (...o) => i.onInnerBarRightClick && i.onInnerBarRightClick(...o))
|
|
618
|
+
})
|
|
619
|
+
]),
|
|
620
|
+
s("input", {
|
|
621
|
+
class: "input-type-range input-type-range-max",
|
|
622
|
+
type: "range",
|
|
623
|
+
min: i.minimum,
|
|
624
|
+
max: i.maximum,
|
|
625
|
+
step: t.step,
|
|
626
|
+
value: l.valueMax,
|
|
627
|
+
onInput: e[6] || (e[6] = K((...o) => i.onInputMaxChange && i.onInputMaxChange(...o), ["stop", "prevent"]))
|
|
628
|
+
}, null, 40, st),
|
|
629
|
+
s("div", {
|
|
630
|
+
class: "thumb thumb-right",
|
|
631
|
+
onMousedown: e[7] || (e[7] = (...o) => i.onRightThumbMousedown && i.onRightThumbMousedown(...o)),
|
|
632
|
+
onTouchstart: e[8] || (e[8] = (...o) => i.onRightThumbMousedown && i.onRightThumbMousedown(...o))
|
|
633
|
+
}, [
|
|
634
|
+
s("div", nt, [
|
|
635
|
+
s("span", it, E(t.maxCaption || i.barMaxVal), 1)
|
|
636
|
+
])
|
|
637
|
+
], 32),
|
|
638
|
+
s("div", {
|
|
639
|
+
class: "bar-right",
|
|
640
|
+
style: W({ width: i.barMax + "%" }),
|
|
641
|
+
onClick: e[9] || (e[9] = (...o) => i.onBarRightClick && i.onBarRightClick(...o))
|
|
642
|
+
}, null, 4)
|
|
643
|
+
]),
|
|
644
|
+
t.ruler ? (g(), h("div", lt, [
|
|
645
|
+
(g(!0), h(z, null, X(i.stepCount, (o) => (g(), h("div", {
|
|
646
|
+
key: o,
|
|
647
|
+
class: "ruler-rule"
|
|
648
|
+
}))), 128))
|
|
649
|
+
])) : q("", !0),
|
|
650
|
+
i.subStepCount ? (g(), h("div", ot, [
|
|
651
|
+
(g(!0), h(z, null, X(i.subStepCount, (o) => (g(), h("div", {
|
|
652
|
+
key: o,
|
|
653
|
+
class: "ruler-sub-rule"
|
|
654
|
+
}))), 128))
|
|
655
|
+
])) : q("", !0),
|
|
656
|
+
t.label ? (g(), h("div", rt, [
|
|
657
|
+
(g(!0), h(z, null, X(i.scaleLabels, (o) => (g(), h("div", {
|
|
658
|
+
class: "label",
|
|
659
|
+
key: o
|
|
660
|
+
}, E(o), 1))), 128))
|
|
661
|
+
])) : q("", !0)
|
|
662
|
+
], 34);
|
|
663
|
+
}
|
|
664
|
+
const ut = /* @__PURE__ */ Me(Je, [["render", dt]]), me = {
|
|
665
|
+
components: {
|
|
666
|
+
MultiRangeSlider: ut
|
|
667
|
+
},
|
|
668
|
+
props: {
|
|
669
|
+
minLimit: {
|
|
670
|
+
type: Number,
|
|
671
|
+
default: 10
|
|
672
|
+
},
|
|
673
|
+
maxLimit: {
|
|
674
|
+
type: Number,
|
|
675
|
+
default: 100
|
|
676
|
+
},
|
|
677
|
+
minValue: {
|
|
678
|
+
type: Number,
|
|
679
|
+
default: 10
|
|
680
|
+
},
|
|
681
|
+
maxValue: {
|
|
682
|
+
type: Number,
|
|
683
|
+
default: 100
|
|
684
|
+
},
|
|
685
|
+
height: {
|
|
686
|
+
type: String,
|
|
687
|
+
default: "150px"
|
|
688
|
+
},
|
|
689
|
+
borderRadius: {
|
|
690
|
+
type: String,
|
|
691
|
+
default: "6px"
|
|
692
|
+
},
|
|
693
|
+
borderType: {
|
|
694
|
+
type: String,
|
|
695
|
+
default: "solid"
|
|
696
|
+
},
|
|
697
|
+
borderWidth: {
|
|
698
|
+
type: Number,
|
|
699
|
+
default: 2
|
|
700
|
+
},
|
|
701
|
+
borderColor: {
|
|
702
|
+
type: String,
|
|
703
|
+
default: "#d9d9d9"
|
|
704
|
+
},
|
|
705
|
+
fontColor: {
|
|
706
|
+
type: String,
|
|
707
|
+
default: "#FFFFFF"
|
|
708
|
+
},
|
|
709
|
+
fontSize: {
|
|
710
|
+
type: String,
|
|
711
|
+
default: "16px"
|
|
712
|
+
},
|
|
713
|
+
fontFamily: {
|
|
714
|
+
type: String,
|
|
715
|
+
default: "Poppins-Regular"
|
|
716
|
+
},
|
|
717
|
+
fontFamilyValue: {
|
|
718
|
+
type: String,
|
|
719
|
+
default: "Poppins-Medium"
|
|
720
|
+
},
|
|
721
|
+
fontColorValue: {
|
|
722
|
+
type: String,
|
|
723
|
+
default: "#FFFFFF"
|
|
724
|
+
},
|
|
725
|
+
fontSizeValue: {
|
|
726
|
+
type: String,
|
|
727
|
+
default: "20px"
|
|
728
|
+
},
|
|
729
|
+
backgroundIndicador: {
|
|
730
|
+
type: String,
|
|
731
|
+
default: "rgb(22, 233, 40)"
|
|
732
|
+
},
|
|
733
|
+
heightIndicador: {
|
|
734
|
+
type: String,
|
|
735
|
+
default: "15px"
|
|
736
|
+
},
|
|
737
|
+
widthIndicador: {
|
|
738
|
+
type: String,
|
|
739
|
+
default: "15px"
|
|
740
|
+
},
|
|
741
|
+
marginTopIndicador: {
|
|
742
|
+
type: String,
|
|
743
|
+
default: "-8px"
|
|
744
|
+
},
|
|
745
|
+
borderColorIndicador: {
|
|
746
|
+
type: String,
|
|
747
|
+
default: "#FFFFFF"
|
|
748
|
+
},
|
|
749
|
+
borderWidthIndicador: {
|
|
750
|
+
type: String,
|
|
751
|
+
default: "3px"
|
|
752
|
+
},
|
|
753
|
+
lineInRangeColor: {
|
|
754
|
+
type: String,
|
|
755
|
+
default: "rgb(22, 233, 40)"
|
|
756
|
+
},
|
|
757
|
+
lineOutRangeColor: {
|
|
758
|
+
type: String,
|
|
759
|
+
default: "#c7c7c7"
|
|
760
|
+
},
|
|
761
|
+
minSuffix: {
|
|
762
|
+
type: String,
|
|
763
|
+
default: ""
|
|
764
|
+
},
|
|
765
|
+
maxSuffix: {
|
|
766
|
+
type: String,
|
|
767
|
+
default: ""
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
data() {
|
|
771
|
+
return {
|
|
772
|
+
minValueLocal: 0,
|
|
773
|
+
maxValueLocal: 0
|
|
774
|
+
};
|
|
775
|
+
},
|
|
776
|
+
computed: {
|
|
777
|
+
customStyle() {
|
|
778
|
+
return {
|
|
779
|
+
height: this.height,
|
|
780
|
+
borderRadius: this.borderRadius,
|
|
781
|
+
border: `${this.borderType} ${this.borderWidth}px ${this.borderColor}`
|
|
782
|
+
};
|
|
783
|
+
},
|
|
784
|
+
customStyleText() {
|
|
785
|
+
return {
|
|
786
|
+
color: this.fontColor,
|
|
787
|
+
fontSize: this.fontSize,
|
|
788
|
+
fontFamily: `${this.fontFamily} !important`
|
|
789
|
+
};
|
|
790
|
+
},
|
|
791
|
+
customStyleValue() {
|
|
792
|
+
return {
|
|
793
|
+
color: this.fontColorValue,
|
|
794
|
+
fontSize: this.fontSizeValue,
|
|
795
|
+
fontFamily: `${this.fontFamilyValue} !important`
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
watch: {
|
|
800
|
+
minValue: {
|
|
801
|
+
handler(a) {
|
|
802
|
+
this.minValueLocal = a;
|
|
803
|
+
},
|
|
804
|
+
immediate: !0
|
|
805
|
+
},
|
|
806
|
+
maxValue: {
|
|
807
|
+
handler(a) {
|
|
808
|
+
this.maxValueLocal = a;
|
|
809
|
+
},
|
|
810
|
+
immediate: !0
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
methods: {
|
|
814
|
+
onInput(a) {
|
|
815
|
+
this.minValueLocal = a.minValue, this.maxValueLocal = a.maxValue, this.$emit("input", a);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}, pe = () => {
|
|
819
|
+
le((a) => ({
|
|
820
|
+
"318dc560": a.lineOutRangeColor,
|
|
821
|
+
fcb35722: a.lineInRangeColor,
|
|
822
|
+
"3edd517e": a.backgroundIndicador,
|
|
823
|
+
"19ee7a09": a.widthIndicador,
|
|
824
|
+
"482e6b68": a.heightIndicador,
|
|
825
|
+
"48824d56": a.borderWidthIndicador,
|
|
826
|
+
a51d4f50: a.borderColorIndicador,
|
|
827
|
+
deb3b7b0: a.marginTopIndicador
|
|
828
|
+
}));
|
|
829
|
+
}, ve = me.setup;
|
|
830
|
+
me.setup = ve ? (a, e) => (pe(), ve(a, e)) : pe;
|
|
831
|
+
const ct = { class: "center" }, mt = { class: "bar-ref" }, ht = { class: "bar-ref-element-left" }, gt = { class: "bar-ref-element-right" };
|
|
832
|
+
function pt(a, e, t, n, l, i) {
|
|
833
|
+
const o = Ce("MultiRangeSlider");
|
|
834
|
+
return g(), h("div", {
|
|
835
|
+
class: "custom-range-slider",
|
|
836
|
+
style: W(i.customStyle)
|
|
837
|
+
}, [
|
|
838
|
+
s("div", ct, [
|
|
839
|
+
s("div", mt, [
|
|
840
|
+
s("div", ht, [
|
|
841
|
+
s("div", {
|
|
842
|
+
class: "text",
|
|
843
|
+
style: W(i.customStyleText)
|
|
844
|
+
}, "De:", 4),
|
|
845
|
+
s("div", {
|
|
846
|
+
class: "value",
|
|
847
|
+
style: W(i.customStyleValue)
|
|
848
|
+
}, E(l.minValueLocal) + E(t.minSuffix), 5)
|
|
849
|
+
]),
|
|
850
|
+
s("div", gt, [
|
|
851
|
+
s("div", {
|
|
852
|
+
class: "text",
|
|
853
|
+
style: W(i.customStyleText)
|
|
854
|
+
}, "A:", 4),
|
|
855
|
+
s("div", {
|
|
856
|
+
class: "value",
|
|
857
|
+
style: W(i.customStyleValue)
|
|
858
|
+
}, E(l.maxValueLocal) + E(t.maxSuffix), 5)
|
|
859
|
+
])
|
|
860
|
+
]),
|
|
861
|
+
R(o, {
|
|
862
|
+
baseClassName: "multi-range-slider",
|
|
863
|
+
min: t.minLimit,
|
|
864
|
+
max: t.maxLimit,
|
|
865
|
+
step: 1,
|
|
866
|
+
ruler: !1,
|
|
867
|
+
label: !1,
|
|
868
|
+
"min-value": l.minValueLocal,
|
|
869
|
+
"max-value": l.maxValueLocal,
|
|
870
|
+
"range-margin": 0,
|
|
871
|
+
onInput: i.onInput
|
|
872
|
+
}, null, 8, ["min", "max", "min-value", "max-value", "onInput"])
|
|
873
|
+
])
|
|
874
|
+
], 4);
|
|
875
|
+
}
|
|
876
|
+
const vt = /* @__PURE__ */ Me(me, [["render", pt]]), he = {
|
|
877
|
+
name: "FieldTemplatesElement",
|
|
878
|
+
components: { GSCCheckbox: ie },
|
|
879
|
+
props: {
|
|
880
|
+
fieldWidth: {
|
|
881
|
+
type: Number,
|
|
882
|
+
default: 302.5
|
|
883
|
+
},
|
|
884
|
+
fieldHeight: {
|
|
885
|
+
type: Number,
|
|
886
|
+
default: 254.5
|
|
887
|
+
},
|
|
888
|
+
initialSections: {
|
|
889
|
+
type: Array,
|
|
890
|
+
default: () => []
|
|
891
|
+
},
|
|
892
|
+
displayMode: {
|
|
893
|
+
type: Boolean,
|
|
894
|
+
default: !1
|
|
895
|
+
},
|
|
896
|
+
title: {
|
|
897
|
+
type: String,
|
|
898
|
+
default: "Zona de origen del balón:"
|
|
899
|
+
},
|
|
900
|
+
quarters: {
|
|
901
|
+
type: Array,
|
|
902
|
+
default: () => [1, 2, 3, 4]
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
data() {
|
|
906
|
+
return {
|
|
907
|
+
selectAll: !0,
|
|
908
|
+
selectedSections: /* @__PURE__ */ new Set(),
|
|
909
|
+
isDragging: !1,
|
|
910
|
+
dragSelectMode: null,
|
|
911
|
+
lastUpdateTime: 0,
|
|
912
|
+
lastSelectedSections: []
|
|
913
|
+
};
|
|
914
|
+
},
|
|
915
|
+
created() {
|
|
916
|
+
this.initializeSections();
|
|
917
|
+
},
|
|
918
|
+
computed: {
|
|
919
|
+
areAllSelected() {
|
|
920
|
+
return this.selectedSections.size === 16;
|
|
921
|
+
}
|
|
922
|
+
},
|
|
923
|
+
watch: {
|
|
924
|
+
initialSections: {
|
|
925
|
+
handler: "initializeSections",
|
|
926
|
+
immediate: !0
|
|
927
|
+
},
|
|
928
|
+
selectedSections: {
|
|
929
|
+
handler(a) {
|
|
930
|
+
const e = Array.from(a).map(Number).sort((t, n) => t - n);
|
|
931
|
+
e.length === this.lastSelectedSections.length && e.every((t) => this.lastSelectedSections.includes(t)) || (this.lastSelectedSections = [...e], this.$emit("sections-changed", e));
|
|
932
|
+
},
|
|
933
|
+
deep: !0
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
methods: {
|
|
937
|
+
onUpdateAllSelected(a) {
|
|
938
|
+
if (a)
|
|
939
|
+
for (let e = 1; e <= 16; e++) {
|
|
940
|
+
const t = Math.ceil(e / 4);
|
|
941
|
+
this.isQuarterEnabled(t) && this.selectedSections.add(e.toString());
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
initializeSections() {
|
|
945
|
+
if (this.selectedSections.clear(), this.initialSections && this.initialSections.length > 0)
|
|
946
|
+
this.initialSections.forEach((a) => {
|
|
947
|
+
const e = Math.ceil(a / 4);
|
|
948
|
+
this.isQuarterEnabled(e) && this.selectedSections.add(a.toString());
|
|
949
|
+
});
|
|
950
|
+
else
|
|
951
|
+
for (let a = 1; a <= 16; a++) {
|
|
952
|
+
const e = Math.ceil(a / 4);
|
|
953
|
+
this.isQuarterEnabled(e) && this.selectedSections.add(a.toString());
|
|
954
|
+
}
|
|
955
|
+
this.updateSelectAllState();
|
|
956
|
+
},
|
|
957
|
+
isSelected(a) {
|
|
958
|
+
return this.selectedSections.has(a.toString());
|
|
959
|
+
},
|
|
960
|
+
toggleSection(a) {
|
|
961
|
+
const e = Math.ceil(a / 4);
|
|
962
|
+
if (!this.isQuarterEnabled(e))
|
|
963
|
+
return;
|
|
964
|
+
const t = a.toString();
|
|
965
|
+
this.selectedSections.size === 1 && this.selectedSections.has(t) || (this.selectedSections.has(t) ? this.selectedSections.delete(t) : this.selectedSections.add(t), this.updateSelectAllState());
|
|
966
|
+
},
|
|
967
|
+
toggleAllSections() {
|
|
968
|
+
if (this.selectAll)
|
|
969
|
+
for (let a = 1; a <= 16; a++)
|
|
970
|
+
this.selectedSections.add(a.toString());
|
|
971
|
+
else
|
|
972
|
+
this.selectedSections.clear();
|
|
973
|
+
},
|
|
974
|
+
updateSelectAllState() {
|
|
975
|
+
requestAnimationFrame(() => {
|
|
976
|
+
this.selectAll = this.selectedSections.size === 16;
|
|
977
|
+
});
|
|
978
|
+
},
|
|
979
|
+
startDragging() {
|
|
980
|
+
this.displayMode || (this.isDragging = !0, event.preventDefault());
|
|
981
|
+
},
|
|
982
|
+
stopDragging() {
|
|
983
|
+
this.displayMode || (this.isDragging = !1, this.dragSelectMode = null);
|
|
984
|
+
},
|
|
985
|
+
handleDragSelect(a) {
|
|
986
|
+
if (this.displayMode) return;
|
|
987
|
+
const e = Date.now();
|
|
988
|
+
if (e - this.lastUpdateTime < 16) return;
|
|
989
|
+
this.lastUpdateTime = e;
|
|
990
|
+
const t = a.toString(), n = Math.ceil(a / 4);
|
|
991
|
+
if (this.isQuarterEnabled(n)) {
|
|
992
|
+
if (this.dragSelectMode === null && (this.dragSelectMode = !this.selectedSections.has(t)), this.dragSelectMode)
|
|
993
|
+
this.selectedSections.add(t);
|
|
994
|
+
else {
|
|
995
|
+
if (this.selectedSections.size === 1 && this.selectedSections.has(t))
|
|
996
|
+
return;
|
|
997
|
+
this.selectedSections.delete(t);
|
|
998
|
+
}
|
|
999
|
+
this.updateSelectAllState();
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
getSectionNumber(a, e) {
|
|
1003
|
+
return (a - 1) * 4 + e;
|
|
1004
|
+
},
|
|
1005
|
+
getSectionIndex(a, e) {
|
|
1006
|
+
return (a - 1) * 4 + e;
|
|
1007
|
+
},
|
|
1008
|
+
selectColumn(a) {
|
|
1009
|
+
if (!this.isQuarterEnabled(a))
|
|
1010
|
+
return;
|
|
1011
|
+
const e = (a - 1) * 4 + 1, t = a * 4;
|
|
1012
|
+
if (Array.from({ length: 4 }, (l, i) => (e + i).toString()).every((l) => this.selectedSections.has(l)) && this.selectedSections.size > 4)
|
|
1013
|
+
for (let l = e; l <= t; l++)
|
|
1014
|
+
this.selectedSections.delete(l.toString());
|
|
1015
|
+
else
|
|
1016
|
+
for (let l = e; l <= t; l++)
|
|
1017
|
+
this.selectedSections.add(l.toString());
|
|
1018
|
+
this.updateSelectAllState();
|
|
1019
|
+
},
|
|
1020
|
+
isQuarterSelected(a) {
|
|
1021
|
+
const e = (a - 1) * 4 + 1;
|
|
1022
|
+
return Array.from({ length: 4 }, (t, n) => (e + n).toString()).every((t) => this.selectedSections.has(t));
|
|
1023
|
+
},
|
|
1024
|
+
isQuarterEnabled(a) {
|
|
1025
|
+
return this.quarters.includes(a);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}, fe = () => {
|
|
1029
|
+
le((a) => ({
|
|
1030
|
+
c3597776: a.fieldWidth + "px",
|
|
1031
|
+
"76e1d148": a.fieldHeight + "px",
|
|
1032
|
+
"24d30082": a.displayMode ? "-28px" : "0"
|
|
1033
|
+
}));
|
|
1034
|
+
}, ye = he.setup;
|
|
1035
|
+
he.setup = ye ? (a, e) => (fe(), ye(a, e)) : fe;
|
|
1036
|
+
const ft = { class: "field-template-element" }, yt = { class: "field-container" }, bt = ["onMouseenter", "onMousedown"], _t = { class: "column-buttons" }, xt = ["onClick", "disabled"];
|
|
1037
|
+
function Ct(a, e, t, n, l, i) {
|
|
1038
|
+
const o = Ce("GSCCheckbox");
|
|
1039
|
+
return g(), h("div", ft, [
|
|
1040
|
+
s("div", yt, [
|
|
1041
|
+
s("div", {
|
|
1042
|
+
class: O(["field-title", { "hidden-title": t.displayMode }])
|
|
1043
|
+
}, [
|
|
1044
|
+
s("span", null, E(t.title), 1),
|
|
1045
|
+
R(o, {
|
|
1046
|
+
"model-value": i.areAllSelected,
|
|
1047
|
+
width: "100%",
|
|
1048
|
+
"avoid-interaction": i.areAllSelected,
|
|
1049
|
+
label: "Todas las zonas",
|
|
1050
|
+
"box-position": "right",
|
|
1051
|
+
"onUpdate:modelValue": i.onUpdateAllSelected
|
|
1052
|
+
}, null, 8, ["model-value", "avoid-interaction", "onUpdate:modelValue"])
|
|
1053
|
+
], 2),
|
|
1054
|
+
s("div", {
|
|
1055
|
+
class: "soccer-field",
|
|
1056
|
+
onMousedown: e[0] || (e[0] = (...d) => i.startDragging && i.startDragging(...d)),
|
|
1057
|
+
onMouseup: e[1] || (e[1] = (...d) => i.stopDragging && i.stopDragging(...d)),
|
|
1058
|
+
onMouseleave: e[2] || (e[2] = (...d) => i.stopDragging && i.stopDragging(...d))
|
|
1059
|
+
}, [
|
|
1060
|
+
(g(), h(z, null, X(4, (d) => s("div", {
|
|
1061
|
+
key: d,
|
|
1062
|
+
class: "field-column"
|
|
1063
|
+
}, [
|
|
1064
|
+
(g(), h(z, null, X(4, (C) => s("div", {
|
|
1065
|
+
key: `${d}-${C}`,
|
|
1066
|
+
class: O(["field-section", {
|
|
1067
|
+
selected: i.isSelected(i.getSectionIndex(d, C)),
|
|
1068
|
+
"display-mode": t.displayMode
|
|
1069
|
+
}]),
|
|
1070
|
+
onMouseenter: (w) => l.isDragging && i.handleDragSelect(i.getSectionIndex(d, C)),
|
|
1071
|
+
onMousedown: K((w) => !t.displayMode && i.toggleSection(i.getSectionIndex(d, C)), ["prevent"])
|
|
1072
|
+
}, null, 42, bt)), 64))
|
|
1073
|
+
])), 64))
|
|
1074
|
+
], 32),
|
|
1075
|
+
s("div", _t, [
|
|
1076
|
+
t.displayMode ? (g(), h(z, { key: 1 }, X(4, (d) => s("div", {
|
|
1077
|
+
key: d,
|
|
1078
|
+
class: "column-label"
|
|
1079
|
+
}, E(d) + "/4 tos ", 1)), 64)) : (g(), h(z, { key: 0 }, X(4, (d) => s("button", {
|
|
1080
|
+
key: d,
|
|
1081
|
+
class: O(["column-button", {
|
|
1082
|
+
selected: i.isQuarterSelected(d),
|
|
1083
|
+
disabled: !i.isQuarterEnabled(d)
|
|
1084
|
+
}]),
|
|
1085
|
+
onClick: (C) => i.selectColumn(d),
|
|
1086
|
+
disabled: !i.isQuarterEnabled(d)
|
|
1087
|
+
}, E(d) + "/4 tos ", 11, xt)), 64))
|
|
1088
|
+
])
|
|
1089
|
+
])
|
|
1090
|
+
]);
|
|
1091
|
+
}
|
|
1092
|
+
const be = /* @__PURE__ */ G(he, [["render", Ct], ["__scopeId", "data-v-bb2f356f"]]), St = { class: "connections" }, Mt = { class: "content" }, wt = { class: "field" }, It = { class: "field" }, Tt = {
|
|
1093
|
+
__name: "FilterConnections",
|
|
1094
|
+
emits: ["apply"],
|
|
1095
|
+
setup(a, { emit: e }) {
|
|
1096
|
+
function t() {
|
|
1097
|
+
return Array.from({ length: 16 }, (p, f) => f + 1);
|
|
1098
|
+
}
|
|
1099
|
+
const n = e, l = x(!1), i = x(t()), o = x(t()), d = x({
|
|
1100
|
+
minValue: 5,
|
|
1101
|
+
maxValue: 30
|
|
1102
|
+
}), C = x(!1);
|
|
1103
|
+
function w(p) {
|
|
1104
|
+
l.value = p, console.log("Menu expanded:", p);
|
|
1105
|
+
}
|
|
1106
|
+
function I(p) {
|
|
1107
|
+
console.log("Selected range:", p), d.value = { ...p };
|
|
1108
|
+
}
|
|
1109
|
+
function V(p) {
|
|
1110
|
+
console.log("Origin sections changed:", p), i.value = p;
|
|
1111
|
+
}
|
|
1112
|
+
function M(p) {
|
|
1113
|
+
console.log("Destination sections changed:", p), o.value = p;
|
|
1114
|
+
}
|
|
1115
|
+
function _(p) {
|
|
1116
|
+
console.log("Selected:", p), C.value = p, T();
|
|
1117
|
+
}
|
|
1118
|
+
function T() {
|
|
1119
|
+
l.value = !1, n("apply", {
|
|
1120
|
+
originSections: i.value,
|
|
1121
|
+
destinationSections: o.value,
|
|
1122
|
+
distanceRange: d.value,
|
|
1123
|
+
isSelected: C.value
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
return ce(() => {
|
|
1127
|
+
T();
|
|
1128
|
+
}), (p, f) => (g(), h("div", St, [
|
|
1129
|
+
R(N(Qe), {
|
|
1130
|
+
modelValue: l.value,
|
|
1131
|
+
"onUpdate:modelValue": f[0] || (f[0] = (b) => l.value = b),
|
|
1132
|
+
width: "fit-content",
|
|
1133
|
+
"left-menu": "unset",
|
|
1134
|
+
"menu-margin-top": 8
|
|
1135
|
+
}, {
|
|
1136
|
+
trigger: ne(() => [
|
|
1137
|
+
R(Se, {
|
|
1138
|
+
text: "Conexiones",
|
|
1139
|
+
onExpand: w,
|
|
1140
|
+
onChangeSelected: _
|
|
1141
|
+
})
|
|
1142
|
+
]),
|
|
1143
|
+
menu: ne(() => [
|
|
1144
|
+
s("div", Mt, [
|
|
1145
|
+
f[1] || (f[1] = s("div", { class: "pass-text" }, " Distancia del pase: ", -1)),
|
|
1146
|
+
R(N(vt), {
|
|
1147
|
+
"border-width": "0",
|
|
1148
|
+
"background-color": "#0D1D29",
|
|
1149
|
+
height: "30px",
|
|
1150
|
+
"font-size-value": "14px",
|
|
1151
|
+
"font-size": "12px",
|
|
1152
|
+
"border-width-indicador": "2px",
|
|
1153
|
+
"line-in-range-color": "white",
|
|
1154
|
+
"background-indicador": "#CBEE6B",
|
|
1155
|
+
"min-limit": 5,
|
|
1156
|
+
"max-limit": 30,
|
|
1157
|
+
"min-value": 5,
|
|
1158
|
+
"max-value": 30,
|
|
1159
|
+
onInput: I
|
|
1160
|
+
}),
|
|
1161
|
+
f[2] || (f[2] = s("div", { class: "separator" }, null, -1)),
|
|
1162
|
+
s("div", wt, [
|
|
1163
|
+
R(be, {
|
|
1164
|
+
title: "Origen del pase",
|
|
1165
|
+
"initial-sections": t(),
|
|
1166
|
+
onSectionsChanged: V
|
|
1167
|
+
}, null, 8, ["initial-sections"])
|
|
1168
|
+
]),
|
|
1169
|
+
f[3] || (f[3] = s("div", { class: "separator" }, null, -1)),
|
|
1170
|
+
s("div", It, [
|
|
1171
|
+
R(be, {
|
|
1172
|
+
title: "Destino del pase",
|
|
1173
|
+
"initial-sections": t(),
|
|
1174
|
+
onSectionsChanged: M
|
|
1175
|
+
}, null, 8, ["initial-sections"])
|
|
1176
|
+
]),
|
|
1177
|
+
f[4] || (f[4] = s("div", { class: "separator" }, null, -1)),
|
|
1178
|
+
s("button", {
|
|
1179
|
+
class: "btn-ready",
|
|
1180
|
+
onClick: T
|
|
1181
|
+
}, " Listo ")
|
|
1182
|
+
])
|
|
1183
|
+
]),
|
|
1184
|
+
_: 1
|
|
1185
|
+
}, 8, ["modelValue"])
|
|
1186
|
+
]));
|
|
1187
|
+
}
|
|
1188
|
+
}, kt = /* @__PURE__ */ G(Tt, [["__scopeId", "data-v-288a5e39"]]), Et = { class: "filters" }, Vt = {
|
|
1189
|
+
__name: "Filters",
|
|
1190
|
+
emits: ["change-connections"],
|
|
1191
|
+
setup(a, { emit: e }) {
|
|
1192
|
+
const t = e;
|
|
1193
|
+
function n(l) {
|
|
1194
|
+
t("change-connections", l);
|
|
1195
|
+
}
|
|
1196
|
+
return (l, i) => (g(), h("div", Et, [
|
|
1197
|
+
i[0] || (i[0] = s("div", { class: "filters__text" }, " Mostrar: ", -1)),
|
|
1198
|
+
R(kt, { onApply: n }),
|
|
1199
|
+
R(Se, {
|
|
1200
|
+
text: "Distancia entre jugadores",
|
|
1201
|
+
"is-arrow-visible": !1
|
|
1202
|
+
})
|
|
1203
|
+
]));
|
|
1204
|
+
}
|
|
1205
|
+
}, $t = /* @__PURE__ */ G(Vt, [["__scopeId", "data-v-ced20b8a"]]), Pt = { class: "page-header" }, Bt = { class: "page-header__time" }, Lt = { class: "value" }, Rt = {
|
|
1206
|
+
__name: "SectionHeader",
|
|
1207
|
+
props: {
|
|
1208
|
+
time: {
|
|
1209
|
+
type: String,
|
|
1210
|
+
required: !0
|
|
1211
|
+
},
|
|
1212
|
+
selectedTeam: {
|
|
1213
|
+
type: String,
|
|
1214
|
+
required: !0
|
|
1215
|
+
},
|
|
1216
|
+
totalChains: {
|
|
1217
|
+
type: Object,
|
|
1218
|
+
default: null
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
emits: ["update:selectedTeam"],
|
|
1222
|
+
setup(a) {
|
|
1223
|
+
return (e, t) => (g(), h("header", Pt, [
|
|
1224
|
+
t[1] || (t[1] = s("div", { class: "page-header__title" }, [
|
|
1225
|
+
s("span", { class: "label" }, "Posicionamiento y conexiones")
|
|
1226
|
+
], -1)),
|
|
1227
|
+
s("div", Bt, [
|
|
1228
|
+
t[0] || (t[0] = s("span", { class: "label" }, "Estas viendo:", -1)),
|
|
1229
|
+
s("span", Lt, E(a.totalChains) + " posesiones", 1)
|
|
1230
|
+
])
|
|
1231
|
+
]));
|
|
1232
|
+
}
|
|
1233
|
+
}, Dt = /* @__PURE__ */ G(Rt, [["__scopeId", "data-v-0591c04c"]]);
|
|
1234
|
+
class Ft {
|
|
1235
|
+
constructor() {
|
|
1236
|
+
this.dataByTimePoint = /* @__PURE__ */ new Map(), this.playerPositions = /* @__PURE__ */ new Map(), this.ballPositions = /* @__PURE__ */ new Map(), this.matchlapseIndex = /* @__PURE__ */ new Map(), this.secondIndex = /* @__PURE__ */ new Map();
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Transforma y estructura los datos para acceso ultra-rápido
|
|
1240
|
+
* @param {Object} rawData - Endpoint info_by_second
|
|
1241
|
+
*/
|
|
1242
|
+
processRawData(e) {
|
|
1243
|
+
return this.dataByTimePoint.clear(), this.playerPositions.clear(), this.ballPositions.clear(), this.matchlapseIndex.clear(), this.secondIndex.clear(), !e.info_by_second || !Array.isArray(e.info_by_second) ? (console.error("No se encontraron datos válidos en info_by_second"), this) : (e.info_by_second.forEach((t) => {
|
|
1244
|
+
const [n, l, i, o] = t, [d, C, w] = i, I = `${l}:${n}`;
|
|
1245
|
+
this.dataByTimePoint.set(I, {
|
|
1246
|
+
second: n,
|
|
1247
|
+
matchLapse: l,
|
|
1248
|
+
timeKey: I,
|
|
1249
|
+
ball: { x: d, y: C, zone: w },
|
|
1250
|
+
players: /* @__PURE__ */ new Map()
|
|
1251
|
+
}), this.ballPositions.set(I, {
|
|
1252
|
+
x: d,
|
|
1253
|
+
y: C,
|
|
1254
|
+
zone: w,
|
|
1255
|
+
second: n,
|
|
1256
|
+
matchLapse: l
|
|
1257
|
+
}), this.matchlapseIndex.has(l) || this.matchlapseIndex.set(l, /* @__PURE__ */ new Set()), this.matchlapseIndex.get(l).add(n), this.secondIndex.has(n) || this.secondIndex.set(n, /* @__PURE__ */ new Set()), this.secondIndex.get(n).add(l), Array.isArray(o) && o.forEach((V) => {
|
|
1258
|
+
const [M, _, T, p, f] = V;
|
|
1259
|
+
this.dataByTimePoint.get(I).players.set(M, {
|
|
1260
|
+
playerId: M,
|
|
1261
|
+
teamId: _,
|
|
1262
|
+
x: T,
|
|
1263
|
+
y: p,
|
|
1264
|
+
zone: f,
|
|
1265
|
+
second: n,
|
|
1266
|
+
matchLapse: l,
|
|
1267
|
+
timeKey: I
|
|
1268
|
+
}), this.playerPositions.has(M) || this.playerPositions.set(M, []), this.playerPositions.get(M).push({
|
|
1269
|
+
second: n,
|
|
1270
|
+
matchLapse: l,
|
|
1271
|
+
timeKey: I,
|
|
1272
|
+
teamId: _,
|
|
1273
|
+
x: T,
|
|
1274
|
+
y: p,
|
|
1275
|
+
zone: f
|
|
1276
|
+
});
|
|
1277
|
+
});
|
|
1278
|
+
}), this);
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Filtrado ultra-rápido con múltiples criterios
|
|
1282
|
+
* @param {Object} filters - Criterios de filtrado
|
|
1283
|
+
*/
|
|
1284
|
+
filterData(e = {}) {
|
|
1285
|
+
const {
|
|
1286
|
+
seconds: t = null,
|
|
1287
|
+
// [inicio, fin] o número específico
|
|
1288
|
+
matchlapses: n = null,
|
|
1289
|
+
// array de matchlapses específicos o null para todos
|
|
1290
|
+
ballQuadrants: l = null,
|
|
1291
|
+
// array de cuadrantes válidos
|
|
1292
|
+
includePlayers: i = null,
|
|
1293
|
+
// array de player_ids a incluir
|
|
1294
|
+
excludePlayers: o = null,
|
|
1295
|
+
// array de player_ids a excluir
|
|
1296
|
+
includeTeams: d = null,
|
|
1297
|
+
// array de team_ids a incluir
|
|
1298
|
+
excludeTeams: C = null,
|
|
1299
|
+
// array de team_ids a excluir
|
|
1300
|
+
timeRanges: w = null
|
|
1301
|
+
// array de objetos {matchlapse, startSecond, endSecond}
|
|
1302
|
+
} = e, I = /* @__PURE__ */ new Map();
|
|
1303
|
+
let V = [];
|
|
1304
|
+
if (w && w.length > 0)
|
|
1305
|
+
w.forEach((M) => {
|
|
1306
|
+
const { match_lapse: _, start: T, end: p } = M;
|
|
1307
|
+
this.matchlapseIndex.has(_) ? Array.from(this.matchlapseIndex.get(_)).filter(
|
|
1308
|
+
(m) => m >= T && m <= p
|
|
1309
|
+
).forEach((m) => {
|
|
1310
|
+
V.push(`${_}:${m}`);
|
|
1311
|
+
}) : console.error(`Matchlapse ${_} no encontrado en índice`);
|
|
1312
|
+
});
|
|
1313
|
+
else {
|
|
1314
|
+
let M = Array.from(this.dataByTimePoint.keys());
|
|
1315
|
+
if (n && n.length > 0 && (M = M.filter((_) => {
|
|
1316
|
+
const T = parseInt(_.split(":")[0]);
|
|
1317
|
+
return n.includes(T);
|
|
1318
|
+
})), t !== null)
|
|
1319
|
+
if (Array.isArray(t)) {
|
|
1320
|
+
const [_, T] = t;
|
|
1321
|
+
M = M.filter((p) => {
|
|
1322
|
+
const f = parseInt(p.split(":")[1]);
|
|
1323
|
+
return f >= _ && f <= T;
|
|
1324
|
+
});
|
|
1325
|
+
} else
|
|
1326
|
+
M = M.filter((_) => parseInt(_.split(":")[1]) === t);
|
|
1327
|
+
V = M;
|
|
1328
|
+
}
|
|
1329
|
+
if (l) {
|
|
1330
|
+
const M = new Set(l);
|
|
1331
|
+
V = V.filter((_) => {
|
|
1332
|
+
const T = this.ballPositions.get(_);
|
|
1333
|
+
return T && M.has(T.quadrant);
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
return V.forEach((M) => {
|
|
1337
|
+
const _ = this.dataByTimePoint.get(M);
|
|
1338
|
+
if (!_) return;
|
|
1339
|
+
const T = /* @__PURE__ */ new Map();
|
|
1340
|
+
_.players.forEach((p, f) => {
|
|
1341
|
+
const { teamId: b } = p;
|
|
1342
|
+
i && !i.includes(f) || o && o.includes(f) || d && !d.includes(b) || C && C.includes(b) || T.set(f, p);
|
|
1343
|
+
}), T.size > 0 && I.set(M, {
|
|
1344
|
+
..._,
|
|
1345
|
+
players: T
|
|
1346
|
+
});
|
|
1347
|
+
}), I;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* Calcula promedios por jugador de forma ultra-eficiente
|
|
1351
|
+
*/
|
|
1352
|
+
calculatePlayerAverages(e) {
|
|
1353
|
+
const t = /* @__PURE__ */ new Map();
|
|
1354
|
+
e.forEach((l) => {
|
|
1355
|
+
l.players.forEach((i, o) => {
|
|
1356
|
+
t.has(o) || t.set(o, {
|
|
1357
|
+
playerId: o,
|
|
1358
|
+
teamId: i.teamId,
|
|
1359
|
+
totalX: 0,
|
|
1360
|
+
totalY: 0,
|
|
1361
|
+
count: 0,
|
|
1362
|
+
positions: [],
|
|
1363
|
+
matchlapses: /* @__PURE__ */ new Set()
|
|
1364
|
+
});
|
|
1365
|
+
const d = t.get(o);
|
|
1366
|
+
d.totalX += i.x, d.totalY += i.y, d.count++, d.matchlapses.add(i.matchLapse), d.positions.push({
|
|
1367
|
+
second: i.second,
|
|
1368
|
+
matchLapse: i.matchLapse,
|
|
1369
|
+
timeKey: i.timeKey,
|
|
1370
|
+
x: i.x,
|
|
1371
|
+
y: i.y,
|
|
1372
|
+
quadrant: i.quadrant
|
|
1373
|
+
});
|
|
1374
|
+
});
|
|
1375
|
+
});
|
|
1376
|
+
const n = /* @__PURE__ */ new Map();
|
|
1377
|
+
return t.forEach((l, i) => {
|
|
1378
|
+
n.set(i, {
|
|
1379
|
+
playerId: l.playerId,
|
|
1380
|
+
teamId: l.teamId,
|
|
1381
|
+
avgX: l.totalX / l.count,
|
|
1382
|
+
avgY: l.totalY / l.count,
|
|
1383
|
+
dataPoints: l.count,
|
|
1384
|
+
matchlapses: Array.from(l.matchlapses),
|
|
1385
|
+
positions: l.positions,
|
|
1386
|
+
// Datos adicionales para Vue
|
|
1387
|
+
id: l.playerId,
|
|
1388
|
+
name: `Jugador #${l.playerId}`,
|
|
1389
|
+
selected: !1,
|
|
1390
|
+
photo: null
|
|
1391
|
+
});
|
|
1392
|
+
}), n;
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Método principal que combina filtrado y cálculo de promedios
|
|
1396
|
+
*/
|
|
1397
|
+
getPlayerAverages(e = {}) {
|
|
1398
|
+
const t = this.filterData(e);
|
|
1399
|
+
return this.calculatePlayerAverages(t);
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Obtener posiciones para visualización en el campo
|
|
1403
|
+
*/
|
|
1404
|
+
getPositionsForVisualization(e = {}) {
|
|
1405
|
+
const t = this.filterData(e), n = [];
|
|
1406
|
+
return t.forEach((l) => {
|
|
1407
|
+
l.players.forEach((i) => {
|
|
1408
|
+
n.push({
|
|
1409
|
+
id: `player-${i.playerId}-${i.timeKey}`,
|
|
1410
|
+
number: i.playerId,
|
|
1411
|
+
top: `${(1 - i.y) * 100}%`,
|
|
1412
|
+
// Invertir Y para coincidir con el campo
|
|
1413
|
+
left: `${i.x * 100}%`,
|
|
1414
|
+
team_id: i.teamId
|
|
1415
|
+
});
|
|
1416
|
+
});
|
|
1417
|
+
}), n.slice(0, 15);
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Utilidades para análisis rápido
|
|
1421
|
+
*/
|
|
1422
|
+
getDataSummary() {
|
|
1423
|
+
const e = /* @__PURE__ */ new Map();
|
|
1424
|
+
this.matchlapseIndex.forEach((n, l) => {
|
|
1425
|
+
e.set(l, {
|
|
1426
|
+
matchlapse: l,
|
|
1427
|
+
secondCount: n.size,
|
|
1428
|
+
secondRange: {
|
|
1429
|
+
min: Math.min(...n),
|
|
1430
|
+
max: Math.max(...n)
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
});
|
|
1434
|
+
const t = Array.from(this.dataByTimePoint.values()).reduce((n, l) => n + l.players.size, 0);
|
|
1435
|
+
return {
|
|
1436
|
+
totalTimePoints: this.dataByTimePoint.size,
|
|
1437
|
+
totalPlayers: this.playerPositions.size,
|
|
1438
|
+
matchlapses: Array.from(e.values()),
|
|
1439
|
+
uniqueSeconds: this.secondIndex.size,
|
|
1440
|
+
avgPlayersPerTimePoint: t / this.dataByTimePoint.size,
|
|
1441
|
+
totalPlayerFrames: t
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Obtener datos específicos de un momento
|
|
1446
|
+
*/
|
|
1447
|
+
getTimePointData(e, t) {
|
|
1448
|
+
const n = `${e}:${t}`;
|
|
1449
|
+
return this.dataByTimePoint.get(n);
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Obtener todos los segundos de un matchlapse específico
|
|
1453
|
+
*/
|
|
1454
|
+
getSecondsInMatchlapse(e) {
|
|
1455
|
+
return this.matchlapseIndex.get(e) || /* @__PURE__ */ new Set();
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* Obtener todos los matchlapses donde aparece un segundo específico
|
|
1459
|
+
*/
|
|
1460
|
+
getMatchlapsesForSecond(e) {
|
|
1461
|
+
return this.secondIndex.get(e) || /* @__PURE__ */ new Set();
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Obtener equipos únicos
|
|
1465
|
+
*/
|
|
1466
|
+
getUniqueTeams() {
|
|
1467
|
+
const e = /* @__PURE__ */ new Set();
|
|
1468
|
+
return this.playerPositions.forEach((t) => {
|
|
1469
|
+
t.forEach((n) => e.add(n.teamId));
|
|
1470
|
+
}), Array.from(e);
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Obtener jugadores únicos por equipo
|
|
1474
|
+
*/
|
|
1475
|
+
getPlayersByTeam() {
|
|
1476
|
+
const e = /* @__PURE__ */ new Map();
|
|
1477
|
+
return this.playerPositions.forEach((t, n) => {
|
|
1478
|
+
if (t.length > 0) {
|
|
1479
|
+
const l = t[0].teamId;
|
|
1480
|
+
e.has(l) || e.set(l, /* @__PURE__ */ new Set()), e.get(l).add(n);
|
|
1481
|
+
}
|
|
1482
|
+
}), e;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
class At {
|
|
1486
|
+
constructor() {
|
|
1487
|
+
this.chains = [], this.indexedByInitialCategories = /* @__PURE__ */ new Map(), this.indexedByEndingCategories = /* @__PURE__ */ new Map(), this.indexedByTeam = /* @__PURE__ */ new Map(), this.indexedByMatchLapse = /* @__PURE__ */ new Map(), this.indexedByDuration = /* @__PURE__ */ new Map(), this.indexedByQuadrant = /* @__PURE__ */ new Map();
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Procesar datos de cadenas y crear índices para filtrado rápido
|
|
1491
|
+
*/
|
|
1492
|
+
processChains(e) {
|
|
1493
|
+
return this.chains = Array.isArray(e) ? e : [], this.createIndexes(), this.chains;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* Crear índices para filtrado rápido
|
|
1497
|
+
*/
|
|
1498
|
+
createIndexes() {
|
|
1499
|
+
this.chains.forEach((e) => {
|
|
1500
|
+
if (e.initial_category_ids && Array.isArray(e.initial_category_ids) && e.initial_category_ids.forEach((t) => {
|
|
1501
|
+
this.indexedByInitialCategories.has(t) || this.indexedByInitialCategories.set(t, /* @__PURE__ */ new Set()), this.indexedByInitialCategories.get(t).add(e.id);
|
|
1502
|
+
}), e.ending_category_ids && Array.isArray(e.ending_category_ids) && e.ending_category_ids.forEach((t) => {
|
|
1503
|
+
this.indexedByEndingCategories.has(t) || this.indexedByEndingCategories.set(t, /* @__PURE__ */ new Set()), this.indexedByEndingCategories.get(t).add(e.id);
|
|
1504
|
+
}), e.team_id && (this.indexedByTeam.has(e.team_id) || this.indexedByTeam.set(e.team_id, /* @__PURE__ */ new Set()), this.indexedByTeam.get(e.team_id).add(e.id)), e.match_lapse && (this.indexedByMatchLapse.has(e.match_lapse) || this.indexedByMatchLapse.set(e.match_lapse, /* @__PURE__ */ new Set()), this.indexedByMatchLapse.get(e.match_lapse).add(e.id)), e.duration) {
|
|
1505
|
+
const t = this.getDurationRange(e.duration);
|
|
1506
|
+
this.indexedByDuration.has(t) || this.indexedByDuration.set(t, /* @__PURE__ */ new Set()), this.indexedByDuration.get(t).add(e.id);
|
|
1507
|
+
}
|
|
1508
|
+
e.quadrant_ids && Array.isArray(e.quadrant_ids) && e.quadrant_ids.forEach((t) => {
|
|
1509
|
+
this.indexedByQuadrant.has(t) || this.indexedByQuadrant.set(t, /* @__PURE__ */ new Set()), this.indexedByQuadrant.get(t).add(e.id);
|
|
1510
|
+
});
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* Obtener rango de duración para indexación
|
|
1515
|
+
*/
|
|
1516
|
+
getDurationRange(e) {
|
|
1517
|
+
return e <= 5 ? "short" : e <= 15 ? "medium" : e <= 30 ? "long" : "very_long";
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Filtrar cadenas basado en criterios específicos
|
|
1521
|
+
*/
|
|
1522
|
+
getFilteredChains(e = {}) {
|
|
1523
|
+
let t = new Set(this.chains.map((l) => l.id));
|
|
1524
|
+
if (e.startCategories && e.startCategories.length > 0) {
|
|
1525
|
+
const l = /* @__PURE__ */ new Set();
|
|
1526
|
+
e.startCategories.forEach((i) => {
|
|
1527
|
+
const o = this.indexedByInitialCategories.get(i);
|
|
1528
|
+
o && o.forEach((d) => l.add(d));
|
|
1529
|
+
}), t = new Set([...t].filter((i) => l.has(i)));
|
|
1530
|
+
}
|
|
1531
|
+
if (e.endCategories && e.endCategories.length > 0) {
|
|
1532
|
+
const l = /* @__PURE__ */ new Set();
|
|
1533
|
+
e.endCategories.forEach((i) => {
|
|
1534
|
+
const o = this.indexedByEndingCategories.get(i);
|
|
1535
|
+
o && o.forEach((d) => l.add(d));
|
|
1536
|
+
}), t = new Set([...t].filter((i) => l.has(i)));
|
|
1537
|
+
}
|
|
1538
|
+
if (e.teamId) {
|
|
1539
|
+
const l = this.indexedByTeam.get(e.teamId);
|
|
1540
|
+
l ? t = new Set([...t].filter((i) => l.has(i))) : t = /* @__PURE__ */ new Set();
|
|
1541
|
+
}
|
|
1542
|
+
if (e.matchLapse) {
|
|
1543
|
+
const l = this.indexedByMatchLapse.get(e.matchLapse);
|
|
1544
|
+
l ? t = new Set([...t].filter((i) => l.has(i))) : t = /* @__PURE__ */ new Set();
|
|
1545
|
+
}
|
|
1546
|
+
if (e.quadrants && e.quadrants.length > 0) {
|
|
1547
|
+
const l = /* @__PURE__ */ new Set();
|
|
1548
|
+
e.quadrants.forEach((i) => {
|
|
1549
|
+
const o = this.indexedByQuadrant.get(i);
|
|
1550
|
+
o && o.forEach((d) => l.add(d));
|
|
1551
|
+
}), t = new Set([...t].filter((i) => l.has(i)));
|
|
1552
|
+
}
|
|
1553
|
+
let n = this.chains.filter((l) => t.has(l.id));
|
|
1554
|
+
return e.minDuration !== void 0 && (n = n.filter((l) => l.duration >= e.minDuration)), e.maxDuration !== void 0 && (n = n.filter((l) => l.duration <= e.maxDuration)), e.startTime !== void 0 && e.endTime !== void 0 && (n = n.filter(
|
|
1555
|
+
(l) => l.starting_second >= e.startTime && l.ending_second <= e.endTime
|
|
1556
|
+
)), n;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Obtener estadísticas de las cadenas filtradas
|
|
1560
|
+
*/
|
|
1561
|
+
getChainStats(e = {}) {
|
|
1562
|
+
const t = this.getFilteredChains(e);
|
|
1563
|
+
return t.length === 0 ? {
|
|
1564
|
+
totalChains: 0,
|
|
1565
|
+
averageDuration: 0,
|
|
1566
|
+
teamDistribution: {},
|
|
1567
|
+
durationRange: { min: 0, max: 0 },
|
|
1568
|
+
timeRange: { earliest: 0, latest: 0 },
|
|
1569
|
+
categoryStats: { initial: {}, ending: {} }
|
|
1570
|
+
} : {
|
|
1571
|
+
totalChains: t.length,
|
|
1572
|
+
averageDuration: t.reduce((n, l) => n + l.duration, 0) / t.length,
|
|
1573
|
+
teamDistribution: this.getTeamDistribution(t),
|
|
1574
|
+
durationRange: {
|
|
1575
|
+
min: Math.min(...t.map((n) => n.duration)),
|
|
1576
|
+
max: Math.max(...t.map((n) => n.duration))
|
|
1577
|
+
},
|
|
1578
|
+
timeRange: {
|
|
1579
|
+
earliest: Math.min(...t.map((n) => n.starting_second)),
|
|
1580
|
+
latest: Math.max(...t.map((n) => n.ending_second))
|
|
1581
|
+
},
|
|
1582
|
+
categoryStats: this.getCategoryStats(t)
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Obtener distribución por equipos
|
|
1587
|
+
*/
|
|
1588
|
+
getTeamDistribution(e) {
|
|
1589
|
+
const t = {};
|
|
1590
|
+
return e.forEach((n) => {
|
|
1591
|
+
t[n.team_id] = (t[n.team_id] || 0) + 1;
|
|
1592
|
+
}), t;
|
|
1593
|
+
}
|
|
1594
|
+
/**
|
|
1595
|
+
* Obtener estadísticas de categorías
|
|
1596
|
+
*/
|
|
1597
|
+
getCategoryStats(e) {
|
|
1598
|
+
const t = {}, n = {};
|
|
1599
|
+
return e.forEach((l) => {
|
|
1600
|
+
l.initial_category_ids && l.initial_category_ids.forEach((i) => {
|
|
1601
|
+
t[i] = (t[i] || 0) + 1;
|
|
1602
|
+
}), l.ending_category_ids && l.ending_category_ids.forEach((i) => {
|
|
1603
|
+
n[i] = (n[i] || 0) + 1;
|
|
1604
|
+
});
|
|
1605
|
+
}), {
|
|
1606
|
+
initial: t,
|
|
1607
|
+
ending: n
|
|
1608
|
+
};
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Mapear categorías de filtro a IDs de categorías reales
|
|
1612
|
+
*/
|
|
1613
|
+
mapFilterCategoriesToIds(e, t) {
|
|
1614
|
+
const n = [];
|
|
1615
|
+
return e.forEach((l) => {
|
|
1616
|
+
const i = t.find((o) => o.id === l);
|
|
1617
|
+
i && i.category_ids && n.push(...i.category_ids);
|
|
1618
|
+
}), n;
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Obtener cadenas por ID específico
|
|
1622
|
+
*/
|
|
1623
|
+
getChainById(e) {
|
|
1624
|
+
return this.chains.find((t) => t.id === e);
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Obtener cadenas por rango de tiempo
|
|
1628
|
+
*/
|
|
1629
|
+
getChainsByTimeRange(e, t) {
|
|
1630
|
+
return this.chains.filter(
|
|
1631
|
+
(n) => n.starting_second >= e && n.ending_second <= t
|
|
1632
|
+
);
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Obtener todas las categorías únicas
|
|
1636
|
+
*/
|
|
1637
|
+
getUniqueCategories() {
|
|
1638
|
+
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
1639
|
+
return this.chains.forEach((n) => {
|
|
1640
|
+
n.initial_category_ids && n.initial_category_ids.forEach((l) => e.add(l)), n.ending_category_ids && n.ending_category_ids.forEach((l) => t.add(l));
|
|
1641
|
+
}), {
|
|
1642
|
+
initial: Array.from(e),
|
|
1643
|
+
ending: Array.from(t)
|
|
1644
|
+
};
|
|
1645
|
+
}
|
|
1646
|
+
/**
|
|
1647
|
+
* Obtener información general de las cadenas
|
|
1648
|
+
*/
|
|
1649
|
+
getChainsSummary() {
|
|
1650
|
+
return {
|
|
1651
|
+
totalChains: this.chains.length,
|
|
1652
|
+
teams: Array.from(this.indexedByTeam.keys()),
|
|
1653
|
+
matchLapses: Array.from(this.indexedByMatchLapse.keys()).sort(),
|
|
1654
|
+
durationRange: this.chains.length > 0 ? {
|
|
1655
|
+
min: Math.min(...this.chains.map((e) => e.duration)),
|
|
1656
|
+
max: Math.max(...this.chains.map((e) => e.duration))
|
|
1657
|
+
} : { min: 0, max: 0 },
|
|
1658
|
+
uniqueCategories: this.getUniqueCategories()
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
const zt = "https://ocqgqyysi5ffgdxnm6xgrurj6y0yonfv.lambda-url.us-west-2.on.aws", Nt = "https://golstats-complete-videos.s3.us-west-2.amazonaws.com/positions_by_second_88247.json ";
|
|
1663
|
+
class A {
|
|
1664
|
+
/**
|
|
1665
|
+
* Obtener eventos del juego (goles, tarjetas, etc.)
|
|
1666
|
+
*/
|
|
1667
|
+
static async _loadChainsData(e) {
|
|
1668
|
+
if (this._chainsRawData)
|
|
1669
|
+
return this._chainsRawData;
|
|
1670
|
+
try {
|
|
1671
|
+
const t = await fetch(`${zt}?game_id=${e}`);
|
|
1672
|
+
if (!t.ok)
|
|
1673
|
+
throw new Error(`Error fetching game events: ${t.status}`);
|
|
1674
|
+
const n = await t.json();
|
|
1675
|
+
return this._chainsRawData = n, n;
|
|
1676
|
+
} catch (t) {
|
|
1677
|
+
throw console.error("Error fetching game events:", t), t;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Cargar datos de posiciones
|
|
1682
|
+
*/
|
|
1683
|
+
static async _loadPlayersData() {
|
|
1684
|
+
if (this._playersRawData)
|
|
1685
|
+
return this._playersProcessedData;
|
|
1686
|
+
try {
|
|
1687
|
+
const e = await fetch(Nt);
|
|
1688
|
+
if (!e.ok)
|
|
1689
|
+
throw new Error(`Error fetching game players: ${e.status}`);
|
|
1690
|
+
const t = await e.json(), n = new Ft();
|
|
1691
|
+
return n.processRawData(t), this._playersRawData = t, this._playersProcessedData = n, n;
|
|
1692
|
+
} catch (e) {
|
|
1693
|
+
throw console.error("Error loading players data:", e), e;
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Get positions with filtering
|
|
1698
|
+
*/
|
|
1699
|
+
static async getPositions(e) {
|
|
1700
|
+
try {
|
|
1701
|
+
return (await this._loadPlayersData()).getPlayerAverages(e);
|
|
1702
|
+
} catch (t) {
|
|
1703
|
+
return console.error("Error getting positions:", t), /* @__PURE__ */ new Map();
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Get started categories
|
|
1708
|
+
*/
|
|
1709
|
+
static getStartedCategories() {
|
|
1710
|
+
return [
|
|
1711
|
+
{
|
|
1712
|
+
id: 1,
|
|
1713
|
+
category_ids: [28, 264],
|
|
1714
|
+
name: "Saque de meta"
|
|
1715
|
+
},
|
|
1716
|
+
{
|
|
1717
|
+
id: 2,
|
|
1718
|
+
category_ids: [30, 355],
|
|
1719
|
+
name: "Tiro libre"
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
id: 3,
|
|
1723
|
+
category_ids: [6, 312],
|
|
1724
|
+
name: "Balón recuperado"
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
id: 4,
|
|
1728
|
+
category_ids: [210, 212, 854],
|
|
1729
|
+
name: "Saque de banda"
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
id: 5,
|
|
1733
|
+
category_ids: [493],
|
|
1734
|
+
name: "Balones perdidos"
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
id: 6,
|
|
1738
|
+
category_ids: [36, 462],
|
|
1739
|
+
name: "Otras jugadas"
|
|
1740
|
+
}
|
|
1741
|
+
];
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Obtener categorías de eventos finales
|
|
1745
|
+
*/
|
|
1746
|
+
static getEndedCategories() {
|
|
1747
|
+
return [
|
|
1748
|
+
{
|
|
1749
|
+
id: 1,
|
|
1750
|
+
category_ids: [12, 55, 40, 35, 54],
|
|
1751
|
+
name: "Gol"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
id: 2,
|
|
1755
|
+
category_ids: [13, 25],
|
|
1756
|
+
name: "Centros"
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
id: 3,
|
|
1760
|
+
category_ids: [607, 608],
|
|
1761
|
+
name: "Oportunidades de gol"
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
id: 4,
|
|
1765
|
+
category_ids: [36, 462],
|
|
1766
|
+
name: "Otras jugadas"
|
|
1767
|
+
}
|
|
1768
|
+
];
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Get processed chains with optimized filtering
|
|
1772
|
+
*/
|
|
1773
|
+
static async getProcessedChains(e, t = {}) {
|
|
1774
|
+
try {
|
|
1775
|
+
const n = await this._loadChainsData(e), l = new At();
|
|
1776
|
+
l.processChains(n);
|
|
1777
|
+
const i = { ...t };
|
|
1778
|
+
return t.startCategories && t.startCategories.length > 0 && (i.startCategories = l.mapFilterCategoriesToIds(
|
|
1779
|
+
t.startCategories,
|
|
1780
|
+
this.getStartedCategories()
|
|
1781
|
+
)), t.endCategories && t.endCategories.length > 0 && (i.endCategories = l.mapFilterCategoriesToIds(
|
|
1782
|
+
t.endCategories,
|
|
1783
|
+
this.getEndedCategories()
|
|
1784
|
+
)), {
|
|
1785
|
+
chains: l.getFilteredChains(i),
|
|
1786
|
+
stats: l.getChainStats(i),
|
|
1787
|
+
totalChains: n.length,
|
|
1788
|
+
processor: l
|
|
1789
|
+
// Devolver el procesador para consultas adicionales
|
|
1790
|
+
};
|
|
1791
|
+
} catch (n) {
|
|
1792
|
+
throw console.error("Error processing chains:", n), n;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Obtener solo las cadenas filtradas (método más rápido para filtrados simples)
|
|
1797
|
+
*/
|
|
1798
|
+
static async getFilteredChains(e, t = {}) {
|
|
1799
|
+
try {
|
|
1800
|
+
return (await this.getProcessedChains(e, t)).chains;
|
|
1801
|
+
} catch (n) {
|
|
1802
|
+
throw console.error("Error getting filtered chains:", n), n;
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Obtener estadísticas de cadenas sin devolver las cadenas completas
|
|
1807
|
+
*/
|
|
1808
|
+
static async getChainStats(e, t = {}) {
|
|
1809
|
+
try {
|
|
1810
|
+
return (await this.getProcessedChains(e, t)).stats;
|
|
1811
|
+
} catch (n) {
|
|
1812
|
+
throw console.error("Error getting chain stats:", n), n;
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
// 🗄️ Cache estático para evitar recargas
|
|
1817
|
+
se(A, "_playersRawData", null), se(A, "_playersProcessedData", null), se(A, "_chainsRawData", null);
|
|
1818
|
+
function we() {
|
|
1819
|
+
const a = x("88247"), e = x(!1), t = x(null), n = x([]), l = oe({
|
|
1820
|
+
startEvents: [],
|
|
1821
|
+
endEvents: [],
|
|
1822
|
+
eventCounts: {},
|
|
1823
|
+
totalEvents: 0
|
|
1824
|
+
}), i = oe({
|
|
1825
|
+
titulares: [],
|
|
1826
|
+
suplentes: []
|
|
1827
|
+
}), o = oe({
|
|
1828
|
+
start: 9,
|
|
1829
|
+
end: 22
|
|
1830
|
+
}), d = D(() => {
|
|
1831
|
+
if (!i.playersMap) return [];
|
|
1832
|
+
const c = [
|
|
1833
|
+
...i.titulares.filter((u) => u.selected).map((u) => u.id),
|
|
1834
|
+
...i.suplentes.filter((u) => u.selected).map((u) => u.id)
|
|
1835
|
+
];
|
|
1836
|
+
return A.getPlayersAveragePositions(i, c, o);
|
|
1837
|
+
}), C = D(() => i.playersMap ? {
|
|
1838
|
+
team1: A.getTeamStats(i, 1, o),
|
|
1839
|
+
team5: A.getTeamStats(i, 5, o)
|
|
1840
|
+
} : { team1: null, team5: null }), w = D(() => {
|
|
1841
|
+
if (n.value.length === 0) return { events: 0, teams: {} };
|
|
1842
|
+
const c = n.value.filter((v) => {
|
|
1843
|
+
const k = Math.floor(v.starting_second / 60);
|
|
1844
|
+
return k >= o.start && k <= o.end;
|
|
1845
|
+
}), u = {};
|
|
1846
|
+
return c.forEach((v) => {
|
|
1847
|
+
u[v.team_id] = (u[v.team_id] || 0) + 1;
|
|
1848
|
+
}), {
|
|
1849
|
+
events: c.length,
|
|
1850
|
+
teams: u
|
|
1851
|
+
};
|
|
1852
|
+
});
|
|
1853
|
+
async function I(c = a.value) {
|
|
1854
|
+
e.value = !1, t.value = null;
|
|
1855
|
+
try {
|
|
1856
|
+
const [u, v] = await Promise.all([
|
|
1857
|
+
A._loadChainsData(c),
|
|
1858
|
+
A._loadPlayersData()
|
|
1859
|
+
]);
|
|
1860
|
+
n.value = u || [], Object.assign(i, v);
|
|
1861
|
+
} catch (u) {
|
|
1862
|
+
t.value = u.message, console.error("Error cargando datos del juego:", u);
|
|
1863
|
+
} finally {
|
|
1864
|
+
e.value = !0;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
async function V(c) {
|
|
1868
|
+
return await A.getPositions(c);
|
|
1869
|
+
}
|
|
1870
|
+
function M(c, u) {
|
|
1871
|
+
o.start = Math.max(0, Math.min(90, c)), o.end = Math.max(o.start, Math.min(90, u));
|
|
1872
|
+
}
|
|
1873
|
+
function _(c) {
|
|
1874
|
+
a.value = c, I(c);
|
|
1875
|
+
}
|
|
1876
|
+
function T() {
|
|
1877
|
+
I();
|
|
1878
|
+
}
|
|
1879
|
+
function p(c = {}) {
|
|
1880
|
+
let u = [...n.value];
|
|
1881
|
+
return u = u.filter((v) => {
|
|
1882
|
+
const k = Math.floor(v.starting_second / 60);
|
|
1883
|
+
return k >= o.start && k <= o.end;
|
|
1884
|
+
}), c.teamId && (u = u.filter((v) => v.team_id === c.teamId)), u;
|
|
1885
|
+
}
|
|
1886
|
+
function f(c) {
|
|
1887
|
+
const u = n.value.filter((k) => k.team_id === c), v = u.reduce((k, F) => k + (F.duration || 0), 0);
|
|
1888
|
+
return {
|
|
1889
|
+
totalEvents: u.length,
|
|
1890
|
+
totalDuration: v,
|
|
1891
|
+
averageDuration: u.length > 0 ? v / u.length : 0,
|
|
1892
|
+
eventsByCategory: u.reduce((k, F) => {
|
|
1893
|
+
var $;
|
|
1894
|
+
return ($ = F.initial_category_ids) == null || $.forEach((B) => {
|
|
1895
|
+
k[B] = (k[B] || 0) + 1;
|
|
1896
|
+
}), k;
|
|
1897
|
+
}, {})
|
|
1898
|
+
};
|
|
1899
|
+
}
|
|
1900
|
+
function b(c = null, u = null) {
|
|
1901
|
+
if (!i.playersMap) return [];
|
|
1902
|
+
const v = u || o;
|
|
1903
|
+
return A.getPlayersAveragePositions(i, c, v);
|
|
1904
|
+
}
|
|
1905
|
+
function m(c = {}) {
|
|
1906
|
+
if (!i.playersMap) return [];
|
|
1907
|
+
const u = {
|
|
1908
|
+
...c,
|
|
1909
|
+
timeRange: c.timeRange || o
|
|
1910
|
+
};
|
|
1911
|
+
return A.filterPlayers(i, u);
|
|
1912
|
+
}
|
|
1913
|
+
function L(c, u, v = null) {
|
|
1914
|
+
if (!i.playersMap) return null;
|
|
1915
|
+
const k = v || o;
|
|
1916
|
+
return A.getPlayersDistance(i, c, u, k);
|
|
1917
|
+
}
|
|
1918
|
+
function Y() {
|
|
1919
|
+
if (!i.playersMap) return null;
|
|
1920
|
+
const c = A.getTeamStats(i, 1, o), u = A.getTeamStats(i, 5, o);
|
|
1921
|
+
return !c || !u ? null : {
|
|
1922
|
+
team1: c,
|
|
1923
|
+
team5: u,
|
|
1924
|
+
comparison: {
|
|
1925
|
+
avgDistanceX: Math.abs(c.avgX - u.avgX),
|
|
1926
|
+
avgDistanceY: Math.abs(c.avgY - u.avgY),
|
|
1927
|
+
coverageDifferenceX: Math.abs(
|
|
1928
|
+
c.coverage.maxX - c.coverage.minX - (u.coverage.maxX - u.coverage.minX)
|
|
1929
|
+
),
|
|
1930
|
+
coverageDifferenceY: Math.abs(
|
|
1931
|
+
c.coverage.maxY - c.coverage.minY - (u.coverage.maxY - u.coverage.minY)
|
|
1932
|
+
)
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
function P(c, u = null) {
|
|
1937
|
+
const v = { quadrant: c, timeRange: o };
|
|
1938
|
+
return u && (v.team_id = u), m(v);
|
|
1939
|
+
}
|
|
1940
|
+
function y(c, u, v = null) {
|
|
1941
|
+
if (!i.playersMap) return null;
|
|
1942
|
+
const k = b(v, c), F = b(v, u);
|
|
1943
|
+
return {
|
|
1944
|
+
timeRange1: { range: c, positions: k },
|
|
1945
|
+
timeRange2: { range: u, positions: F },
|
|
1946
|
+
movements: k.map(($) => {
|
|
1947
|
+
const B = F.find((ee) => ee.playerId === $.playerId);
|
|
1948
|
+
return B ? {
|
|
1949
|
+
playerId: $.playerId,
|
|
1950
|
+
movement: {
|
|
1951
|
+
deltaX: B.avgX - $.avgX,
|
|
1952
|
+
deltaY: B.avgY - $.avgY,
|
|
1953
|
+
distance: Math.sqrt(
|
|
1954
|
+
Math.pow(B.avgX - $.avgX, 2) + Math.pow(B.avgY - $.avgY, 2)
|
|
1955
|
+
)
|
|
1956
|
+
}
|
|
1957
|
+
} : null;
|
|
1958
|
+
}).filter(Boolean)
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
return Q(a, (c) => {
|
|
1962
|
+
c && I(c);
|
|
1963
|
+
}), {
|
|
1964
|
+
// Estados
|
|
1965
|
+
gameId: a,
|
|
1966
|
+
isDataLoaded: e,
|
|
1967
|
+
error: t,
|
|
1968
|
+
gameEvents: n,
|
|
1969
|
+
gameEventStats: l,
|
|
1970
|
+
players: i,
|
|
1971
|
+
timeRange: o,
|
|
1972
|
+
// Computed
|
|
1973
|
+
selectedPlayersAverages: d,
|
|
1974
|
+
teamStats: C,
|
|
1975
|
+
timeRangeStats: w,
|
|
1976
|
+
// Métodos
|
|
1977
|
+
startedCategories: A.getStartedCategories(),
|
|
1978
|
+
endedCategories: A.getEndedCategories(),
|
|
1979
|
+
loadGameData: I,
|
|
1980
|
+
getPositions: V,
|
|
1981
|
+
updateTimeRange: M,
|
|
1982
|
+
changeGameId: _,
|
|
1983
|
+
refreshData: T,
|
|
1984
|
+
getFilteredEvents: p,
|
|
1985
|
+
getTeamStats: f,
|
|
1986
|
+
getPlayersAveragePositions: b,
|
|
1987
|
+
filterPlayers: m,
|
|
1988
|
+
getPlayersDistance: L,
|
|
1989
|
+
getComparativeStats: Y,
|
|
1990
|
+
getPlayersByQuadrant: P,
|
|
1991
|
+
compareTimeRanges: y
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
const Xt = { class: "soccer-field" }, Ut = { class: "soccer-field__container" }, Ot = { class: "field" }, Wt = {
|
|
1995
|
+
key: 0,
|
|
1996
|
+
class: "loading-positions"
|
|
1997
|
+
}, qt = { class: "players-container" }, Yt = { class: "player-number" }, Gt = { class: "soccer-field__container" }, jt = { class: "field" }, Zt = {
|
|
1998
|
+
key: 0,
|
|
1999
|
+
class: "loading-positions"
|
|
2000
|
+
}, Qt = { class: "players-container" }, Jt = {
|
|
2001
|
+
width: "611",
|
|
2002
|
+
height: "407",
|
|
2003
|
+
viewBox: "0 0 611 407",
|
|
2004
|
+
fill: "none",
|
|
2005
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2006
|
+
}, Ht = ["id", "d"], Kt = ["id", "d"], ea = { style: { fill: "#CBEE6B", "font-size": "8px", "dominant-baseline": "central" } }, ta = ["xlink:href"], aa = { style: { fill: "#83B500", "font-size": "8px", "dominant-baseline": "central" } }, sa = ["xlink:href"], na = ["x", "y"], ia = ["x", "y"], la = { class: "rival-toggle" }, _e = 3, oa = {
|
|
2007
|
+
__name: "SoccerField",
|
|
2008
|
+
props: {
|
|
2009
|
+
playersSelected: {
|
|
2010
|
+
type: Array,
|
|
2011
|
+
default: () => []
|
|
2012
|
+
},
|
|
2013
|
+
homeTeamId: {
|
|
2014
|
+
type: Number,
|
|
2015
|
+
default: 1
|
|
2016
|
+
},
|
|
2017
|
+
awayTeamId: {
|
|
2018
|
+
type: Number,
|
|
2019
|
+
default: 5
|
|
2020
|
+
},
|
|
2021
|
+
filteredChains: {
|
|
2022
|
+
type: Array,
|
|
2023
|
+
default: () => []
|
|
2024
|
+
},
|
|
2025
|
+
isDataLoaded: {
|
|
2026
|
+
type: Boolean,
|
|
2027
|
+
default: !1
|
|
2028
|
+
},
|
|
2029
|
+
areConnectionsVisible: {
|
|
2030
|
+
type: Boolean,
|
|
2031
|
+
default: !1
|
|
2032
|
+
}
|
|
2033
|
+
},
|
|
2034
|
+
setup(a, { expose: e }) {
|
|
2035
|
+
const t = x(!1), n = x([]), l = x([]), i = D(() => n.value.length === 0 ? [] : t.value ? n.value : n.value.filter((f) => f.is_home)), o = D(() => new Map(i.value.map((f) => [f.id, f]))), d = we(), C = a;
|
|
2036
|
+
function w(f) {
|
|
2037
|
+
if (!f || f.length === 0)
|
|
2038
|
+
return [];
|
|
2039
|
+
const b = [];
|
|
2040
|
+
return f.forEach((m) => {
|
|
2041
|
+
m.starting_second !== void 0 && m.ending_second !== void 0 && b.push({
|
|
2042
|
+
match_lapse: m.match_lapse,
|
|
2043
|
+
start: m.starting_second,
|
|
2044
|
+
end: m.ending_second
|
|
2045
|
+
});
|
|
2046
|
+
}), b;
|
|
2047
|
+
}
|
|
2048
|
+
const I = /* @__PURE__ */ new Map();
|
|
2049
|
+
async function V() {
|
|
2050
|
+
try {
|
|
2051
|
+
const b = {
|
|
2052
|
+
timeRanges: w(C.filteredChains),
|
|
2053
|
+
// Rangos de tiempo específicos
|
|
2054
|
+
teams: [C.homeTeamId, C.awayTeamId]
|
|
2055
|
+
};
|
|
2056
|
+
console.log("Calculando posiciones con filtros:", b);
|
|
2057
|
+
const m = await d.getPositions(b), L = [];
|
|
2058
|
+
let Y = 1, P = 1;
|
|
2059
|
+
m && m.size > 0 && (I.clear(), m.forEach((y) => {
|
|
2060
|
+
const c = y.teamId === C.homeTeamId, u = c ? Y++ : P++, v = {
|
|
2061
|
+
id: y.playerId,
|
|
2062
|
+
team: y.teamId,
|
|
2063
|
+
is_home: c,
|
|
2064
|
+
number: u,
|
|
2065
|
+
top: `${(1 - y.avgY) * 100}%`,
|
|
2066
|
+
left: `${y.avgX * 100}%`,
|
|
2067
|
+
topRaw: (1 - y.avgY) * 407,
|
|
2068
|
+
leftRaw: y.avgX * 611
|
|
2069
|
+
};
|
|
2070
|
+
L.push(v), I.set(y.playerId, v);
|
|
2071
|
+
})), n.value = L, console.log("playersPositions:", n.value), console.log(`Posiciones actualizadas: ${L.length} jugadores`);
|
|
2072
|
+
} catch (f) {
|
|
2073
|
+
console.error("Error calculando posiciones filtradas:", f);
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
Q(
|
|
2077
|
+
() => [C.filteredChains, t.value, C.isDataLoaded],
|
|
2078
|
+
() => {
|
|
2079
|
+
C.isDataLoaded && V();
|
|
2080
|
+
},
|
|
2081
|
+
{ immediate: !0, deep: !0 }
|
|
2082
|
+
);
|
|
2083
|
+
function M(f, b, m, L, Y = !1) {
|
|
2084
|
+
let P = 0;
|
|
2085
|
+
const y = m - f, c = L - b, u = Math.atan(c / y) / (Math.PI / 180), v = Math.abs(u);
|
|
2086
|
+
return y < 0 ? c < 0 ? P = v : P = 360 - v : c < 0 ? P = 180 - v : P = 180 + v, y >= 0 ? c >= 0 ? P = 180 - v : P = 180 + v : c < 0 ? P = 360 - v : P = v, Y ? (P + 90) % 360 : P;
|
|
2087
|
+
}
|
|
2088
|
+
function _(f) {
|
|
2089
|
+
return f * (Math.PI / 180);
|
|
2090
|
+
}
|
|
2091
|
+
const T = D(() => {
|
|
2092
|
+
if (!C.areConnectionsVisible || l.value.length === 0 || !o.value.size)
|
|
2093
|
+
return [];
|
|
2094
|
+
const f = l.value.reduce((b, m) => {
|
|
2095
|
+
if (o.value.has(m.to) && o.value.has(m.from)) {
|
|
2096
|
+
const L = `${m.from}-${m.to}`, Y = `${m.to}-${m.from}`, P = b.get(L) || b.get(Y), y = o.value.get(m.from).leftRaw, c = o.value.get(m.from).topRaw, u = o.value.get(m.to).leftRaw, v = o.value.get(m.to).topRaw, k = M(
|
|
2097
|
+
y,
|
|
2098
|
+
c,
|
|
2099
|
+
u,
|
|
2100
|
+
v,
|
|
2101
|
+
!0
|
|
2102
|
+
), F = _(k), $ = Math.cos(F) * _e, B = Math.sin(F) * _e;
|
|
2103
|
+
P ? P.left ? P.right = {
|
|
2104
|
+
...m,
|
|
2105
|
+
playerFrom: o.value.get(m.from),
|
|
2106
|
+
playerTo: o.value.get(m.to),
|
|
2107
|
+
x1: y + $,
|
|
2108
|
+
y1: c + B,
|
|
2109
|
+
x2: u + $,
|
|
2110
|
+
y2: v + B
|
|
2111
|
+
} : P.left = {
|
|
2112
|
+
...m,
|
|
2113
|
+
playerFrom: o.value.get(m.from),
|
|
2114
|
+
playerTo: o.value.get(m.to),
|
|
2115
|
+
x1: y + $,
|
|
2116
|
+
y1: c + B,
|
|
2117
|
+
x2: u + $,
|
|
2118
|
+
y2: v + B
|
|
2119
|
+
} : b.set(L, {
|
|
2120
|
+
left: {
|
|
2121
|
+
...m,
|
|
2122
|
+
playerFrom: o.value.get(m.from),
|
|
2123
|
+
playerTo: o.value.get(m.to),
|
|
2124
|
+
x1: y + $,
|
|
2125
|
+
y1: c + B,
|
|
2126
|
+
x2: u + $,
|
|
2127
|
+
y2: v + B
|
|
2128
|
+
},
|
|
2129
|
+
right: null
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
return b;
|
|
2133
|
+
}, /* @__PURE__ */ new Map());
|
|
2134
|
+
return console.log("setUpConnections connectionsCouples:", T), Array.from(f.values()).filter((b) => b.left && b.right);
|
|
2135
|
+
});
|
|
2136
|
+
D(() => T.value);
|
|
2137
|
+
function p(f) {
|
|
2138
|
+
console.log("setConnections connections:", f), l.value = f;
|
|
2139
|
+
}
|
|
2140
|
+
return e({
|
|
2141
|
+
setConnections: p
|
|
2142
|
+
}), (f, b) => (g(), h("div", Xt, [
|
|
2143
|
+
s("div", Ut, [
|
|
2144
|
+
s("div", Ot, [
|
|
2145
|
+
C.isDataLoaded ? q("", !0) : (g(), h("div", Wt, b[1] || (b[1] = [
|
|
2146
|
+
s("div", { class: "loading-spinner-small" }, "⚡", -1),
|
|
2147
|
+
s("span", null, "Calculando posiciones...", -1)
|
|
2148
|
+
]))),
|
|
2149
|
+
s("div", qt, [
|
|
2150
|
+
(g(!0), h(z, null, X(i.value, (m) => (g(), h("div", {
|
|
2151
|
+
key: m.id,
|
|
2152
|
+
class: O(["player-marker", { "player-marker__local": m.is_home, "player-marker__rival": !m.is_home, "player-marker__hidden": !C.playersSelected.includes(m.id) }]),
|
|
2153
|
+
style: W({ top: m.top, left: m.left })
|
|
2154
|
+
}, [
|
|
2155
|
+
s("span", Yt, E(m.number), 1)
|
|
2156
|
+
], 6))), 128))
|
|
2157
|
+
])
|
|
2158
|
+
])
|
|
2159
|
+
]),
|
|
2160
|
+
b[7] || (b[7] = s("br", null, null, -1)),
|
|
2161
|
+
s("div", Gt, [
|
|
2162
|
+
s("div", jt, [
|
|
2163
|
+
C.isDataLoaded ? q("", !0) : (g(), h("div", Zt, b[2] || (b[2] = [
|
|
2164
|
+
s("div", { class: "loading-spinner-small" }, "⚡", -1),
|
|
2165
|
+
s("span", null, "Calculando posiciones...", -1)
|
|
2166
|
+
]))),
|
|
2167
|
+
s("div", Qt, [
|
|
2168
|
+
(g(), h("svg", Jt, [
|
|
2169
|
+
b[3] || (b[3] = s("defs", null, [
|
|
2170
|
+
s("marker", {
|
|
2171
|
+
id: "arrow-left",
|
|
2172
|
+
markerWidth: "10",
|
|
2173
|
+
markerHeight: "10",
|
|
2174
|
+
refX: "0",
|
|
2175
|
+
refY: "3",
|
|
2176
|
+
orient: "auto",
|
|
2177
|
+
markerUnits: "strokeWidth",
|
|
2178
|
+
style: { opacity: "1" }
|
|
2179
|
+
}, [
|
|
2180
|
+
s("path", {
|
|
2181
|
+
d: "M0,0 L0,6 L9,3 z",
|
|
2182
|
+
fill: "#cbee6b"
|
|
2183
|
+
})
|
|
2184
|
+
])
|
|
2185
|
+
], -1)),
|
|
2186
|
+
(g(!0), h(z, null, X(T.value, (m, L) => (g(), h("g", {
|
|
2187
|
+
key: `cc-${L}`
|
|
2188
|
+
}, [
|
|
2189
|
+
s("path", {
|
|
2190
|
+
id: `pl-${L}`,
|
|
2191
|
+
d: `M ${m.left.x1} ${m.left.y1} L ${m.left.x2} ${m.left.y2}`,
|
|
2192
|
+
style: { stroke: "#cbee6b", "stroke-width": 2, opacity: "1" }
|
|
2193
|
+
}, null, 8, Ht),
|
|
2194
|
+
s("path", {
|
|
2195
|
+
id: `pr-${L}`,
|
|
2196
|
+
d: `M ${m.right.x1} ${m.right.y1} L ${m.right.x2} ${m.right.y2}`,
|
|
2197
|
+
style: { stroke: "#83B500", "stroke-width": 2, opacity: "1" }
|
|
2198
|
+
}, null, 8, Kt),
|
|
2199
|
+
s("text", ea, [
|
|
2200
|
+
s("textPath", {
|
|
2201
|
+
"xlink:href": `#pl-${L}`,
|
|
2202
|
+
startOffset: "40%"
|
|
2203
|
+
}, "➤", 8, ta)
|
|
2204
|
+
]),
|
|
2205
|
+
s("text", aa, [
|
|
2206
|
+
s("textPath", {
|
|
2207
|
+
"xlink:href": `#pr-${L}`,
|
|
2208
|
+
startOffset: "40%"
|
|
2209
|
+
}, "➤", 8, sa)
|
|
2210
|
+
])
|
|
2211
|
+
]))), 128)),
|
|
2212
|
+
(g(!0), h(z, null, X(i.value, (m) => (g(), h("g", {
|
|
2213
|
+
key: m.id
|
|
2214
|
+
}, [
|
|
2215
|
+
s("rect", {
|
|
2216
|
+
x: m.leftRaw,
|
|
2217
|
+
y: m.topRaw,
|
|
2218
|
+
transform: "translate(-14, -14)",
|
|
2219
|
+
height: "28",
|
|
2220
|
+
width: "28",
|
|
2221
|
+
"stroke-width": "1",
|
|
2222
|
+
fill: "orange",
|
|
2223
|
+
stroke: "#fff",
|
|
2224
|
+
rx: "14",
|
|
2225
|
+
ry: "14"
|
|
2226
|
+
}, null, 8, na),
|
|
2227
|
+
s("text", {
|
|
2228
|
+
x: m.leftRaw,
|
|
2229
|
+
y: m.topRaw,
|
|
2230
|
+
"text-anchor": "middle",
|
|
2231
|
+
"dominant-baseline": "middle",
|
|
2232
|
+
dy: "1",
|
|
2233
|
+
"font-size": "15",
|
|
2234
|
+
fill: "#fff",
|
|
2235
|
+
"font-family": "'Poppins-SemiBold', sans-serif"
|
|
2236
|
+
}, E(m.number), 9, ia)
|
|
2237
|
+
]))), 128)),
|
|
2238
|
+
b[4] || (b[4] = s("g", null, [
|
|
2239
|
+
s("rect", {
|
|
2240
|
+
width: "200",
|
|
2241
|
+
height: "24",
|
|
2242
|
+
x: "5",
|
|
2243
|
+
y: "5",
|
|
2244
|
+
rx: "0",
|
|
2245
|
+
ry: "0",
|
|
2246
|
+
fill: "#20539F"
|
|
2247
|
+
})
|
|
2248
|
+
], -1))
|
|
2249
|
+
]))
|
|
2250
|
+
])
|
|
2251
|
+
])
|
|
2252
|
+
]),
|
|
2253
|
+
s("label", la, [
|
|
2254
|
+
U(s("input", {
|
|
2255
|
+
type: "checkbox",
|
|
2256
|
+
"onUpdate:modelValue": b[0] || (b[0] = (m) => t.value = m)
|
|
2257
|
+
}, null, 512), [
|
|
2258
|
+
[H, t.value]
|
|
2259
|
+
]),
|
|
2260
|
+
b[5] || (b[5] = s("span", { class: "checkmark-custom" }, null, -1)),
|
|
2261
|
+
b[6] || (b[6] = J(" Mostrar posicionamiento del rival "))
|
|
2262
|
+
])
|
|
2263
|
+
]));
|
|
2264
|
+
}
|
|
2265
|
+
}, ra = /* @__PURE__ */ G(oa, [["__scopeId", "data-v-a2c554d3"]]);
|
|
2266
|
+
function da(a) {
|
|
2267
|
+
const e = x(!1), t = x(null), n = x([]), l = x(null), i = x(null), o = x(!1), d = x([]), C = x([]), w = x(null), I = x({ min: null, max: null }), V = async () => {
|
|
2268
|
+
if (!(o.value || !a)) {
|
|
2269
|
+
e.value = !0, t.value = null;
|
|
2270
|
+
try {
|
|
2271
|
+
const p = await A.getProcessedChains(a, {});
|
|
2272
|
+
i.value = p.processor, o.value = !0, n.value = p.chains, l.value = p.stats;
|
|
2273
|
+
} catch (p) {
|
|
2274
|
+
t.value = p.message, console.error("Error loading data:", p);
|
|
2275
|
+
} finally {
|
|
2276
|
+
e.value = !1;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
}, M = () => {
|
|
2280
|
+
if (!(!i.value || !o.value))
|
|
2281
|
+
try {
|
|
2282
|
+
const p = {};
|
|
2283
|
+
d.value.length > 0 && (p.startCategories = i.value.mapFilterCategoriesToIds(
|
|
2284
|
+
d.value,
|
|
2285
|
+
A.getStartedCategories()
|
|
2286
|
+
)), C.value.length > 0 && (p.endCategories = i.value.mapFilterCategoriesToIds(
|
|
2287
|
+
C.value,
|
|
2288
|
+
A.getEndedCategories()
|
|
2289
|
+
)), w.value && (p.teamId = w.value), I.value.min !== null && (p.minDuration = I.value.min), I.value.max !== null && (p.maxDuration = I.value.max), n.value = i.value.getFilteredChains(p), l.value = i.value.getChainStats(p);
|
|
2290
|
+
} catch (p) {
|
|
2291
|
+
console.error("Error aplicando filtros:", p);
|
|
2292
|
+
}
|
|
2293
|
+
}, _ = () => {
|
|
2294
|
+
d.value = [], C.value = [], w.value = null, I.value = { min: null, max: null }, i.value && o.value && (n.value = i.value.chains || [], l.value = i.value.getChainStats({}));
|
|
2295
|
+
};
|
|
2296
|
+
return {
|
|
2297
|
+
// Estados
|
|
2298
|
+
isLoading: e,
|
|
2299
|
+
error: t,
|
|
2300
|
+
chains: n,
|
|
2301
|
+
stats: l,
|
|
2302
|
+
// Filtros
|
|
2303
|
+
selectedStartCategories: d,
|
|
2304
|
+
selectedEndCategories: C,
|
|
2305
|
+
selectedTeam: w,
|
|
2306
|
+
durationRange: I,
|
|
2307
|
+
// Métodos
|
|
2308
|
+
loadInitialData: V,
|
|
2309
|
+
applyFilters: M,
|
|
2310
|
+
resetFilters: _,
|
|
2311
|
+
refreshData: () => {
|
|
2312
|
+
_();
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
}
|
|
2316
|
+
const ua = { class: "exp-container" }, ca = { class: "exp-container__header__text" }, ma = {
|
|
2317
|
+
key: 0,
|
|
2318
|
+
class: "exp-container__body"
|
|
2319
|
+
}, ha = {
|
|
2320
|
+
key: 0,
|
|
2321
|
+
class: "separator"
|
|
2322
|
+
}, ga = {
|
|
2323
|
+
__name: "ExpandibleContainer",
|
|
2324
|
+
props: {
|
|
2325
|
+
headerText: {
|
|
2326
|
+
type: String,
|
|
2327
|
+
default: "Expandible Container"
|
|
2328
|
+
},
|
|
2329
|
+
isSeparatorVisible: {
|
|
2330
|
+
type: Boolean,
|
|
2331
|
+
default: !0
|
|
2332
|
+
},
|
|
2333
|
+
players: {
|
|
2334
|
+
type: Array,
|
|
2335
|
+
default: () => []
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
emits: ["toggle"],
|
|
2339
|
+
setup(a, { emit: e }) {
|
|
2340
|
+
const t = x(!1), n = e;
|
|
2341
|
+
function l() {
|
|
2342
|
+
t.value = !t.value, n("toggle", t.value);
|
|
2343
|
+
}
|
|
2344
|
+
return (i, o) => (g(), h("div", ua, [
|
|
2345
|
+
s("div", {
|
|
2346
|
+
class: "exp-container__header",
|
|
2347
|
+
onClick: l
|
|
2348
|
+
}, [
|
|
2349
|
+
s("div", ca, E(a.headerText), 1),
|
|
2350
|
+
s("div", {
|
|
2351
|
+
class: O(["exp-container__header__arrow", { "is-expanded": t.value }])
|
|
2352
|
+
}, o[0] || (o[0] = [
|
|
2353
|
+
s("svg", {
|
|
2354
|
+
width: "12",
|
|
2355
|
+
height: "8",
|
|
2356
|
+
viewBox: "0 0 12 8",
|
|
2357
|
+
fill: "none",
|
|
2358
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2359
|
+
}, [
|
|
2360
|
+
s("path", {
|
|
2361
|
+
d: "M1.70727 0.792892C1.31674 0.402368 0.683727 0.402368 0.293203 0.792892C-0.0973215 1.18342 -0.0973215 1.81643 0.293203 2.20695L5.2932 7.20696C5.68373 7.59748 6.31674 7.59748 6.70727 7.20696L11.7073 2.20696L11.7756 2.13078C12.096 1.73801 12.0734 1.15901 11.7073 0.792893C11.3411 0.426777 10.7621 0.404183 10.3694 0.724534L10.2932 0.792893L6.00023 5.08586L1.70727 0.792892Z",
|
|
2362
|
+
fill: "#9CA3AF"
|
|
2363
|
+
})
|
|
2364
|
+
], -1)
|
|
2365
|
+
]), 2)
|
|
2366
|
+
]),
|
|
2367
|
+
t.value ? (g(), h("div", ma, [
|
|
2368
|
+
a.isSeparatorVisible ? (g(), h("div", ha)) : q("", !0),
|
|
2369
|
+
ue(i.$slots, "default", {}, void 0, !0)
|
|
2370
|
+
])) : q("", !0)
|
|
2371
|
+
]));
|
|
2372
|
+
}
|
|
2373
|
+
}, pa = /* @__PURE__ */ G(ga, [["__scopeId", "data-v-5fa87853"]]), va = { class: "expandible-players" }, fa = { class: "expandible-players__list" }, ya = { class: "all-players list-item" }, ba = { class: "player-item__checkbox" }, _a = { class: "player-item__photo" }, xa = ["src"], Ca = { class: "player-item__info" }, Sa = { class: "player-item__info__name" }, Ma = { class: "player-item__info__secondary-info" }, wa = { class: "player-item__info__secondary-info__nationality" }, Ia = ["src"], Ta = { class: "player-item__info__secondary-info__position" }, ka = {
|
|
2374
|
+
__name: "ExpandiblePlayers",
|
|
2375
|
+
props: {
|
|
2376
|
+
players: {
|
|
2377
|
+
type: Array,
|
|
2378
|
+
default: () => []
|
|
2379
|
+
},
|
|
2380
|
+
arePlayersTitular: {
|
|
2381
|
+
type: Boolean,
|
|
2382
|
+
default: !1
|
|
2383
|
+
}
|
|
2384
|
+
},
|
|
2385
|
+
setup(a) {
|
|
2386
|
+
const e = a, t = D(() => e.arePlayersTitular ? "Titulares:" : "Cambios:"), n = D(() => `Todos los ${t.value.toLowerCase()}`);
|
|
2387
|
+
function l(i) {
|
|
2388
|
+
i ? e.players.forEach((o) => {
|
|
2389
|
+
o.isSelected = !0;
|
|
2390
|
+
}) : e.players.forEach((o, d) => {
|
|
2391
|
+
o.isSelected = d === 0;
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2394
|
+
return (i, o) => (g(), h("div", va, [
|
|
2395
|
+
R(pa, {
|
|
2396
|
+
"header-text": t.value,
|
|
2397
|
+
onToggle: o[0] || (o[0] = (d) => i.$emit("toggle"))
|
|
2398
|
+
}, {
|
|
2399
|
+
default: ne(() => [
|
|
2400
|
+
s("div", fa, [
|
|
2401
|
+
s("div", ya, [
|
|
2402
|
+
R(N(ie), {
|
|
2403
|
+
"model-value": e.players.every((d) => d.isSelected),
|
|
2404
|
+
label: n.value,
|
|
2405
|
+
"onUpdate:modelValue": l
|
|
2406
|
+
}, null, 8, ["model-value", "label"])
|
|
2407
|
+
]),
|
|
2408
|
+
(g(!0), h(z, null, X(e.players, (d) => (g(), h("div", {
|
|
2409
|
+
key: d.player_id,
|
|
2410
|
+
class: "list-item player-item"
|
|
2411
|
+
}, [
|
|
2412
|
+
s("div", ba, [
|
|
2413
|
+
R(N(ie), {
|
|
2414
|
+
modelValue: d.isSelected,
|
|
2415
|
+
"onUpdate:modelValue": (C) => d.isSelected = C
|
|
2416
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
2417
|
+
]),
|
|
2418
|
+
s("div", _a, [
|
|
2419
|
+
s("img", {
|
|
2420
|
+
src: d.player_photo || d.photo
|
|
2421
|
+
}, null, 8, xa)
|
|
2422
|
+
]),
|
|
2423
|
+
s("div", Ca, [
|
|
2424
|
+
s("div", Sa, E(d.short_name || d.name || d.player_name), 1),
|
|
2425
|
+
s("div", Ma, [
|
|
2426
|
+
s("div", wa, [
|
|
2427
|
+
s("img", {
|
|
2428
|
+
src: d.player_country_flag || d.nationality_photo || d.countryFlag
|
|
2429
|
+
}, null, 8, Ia)
|
|
2430
|
+
]),
|
|
2431
|
+
s("div", Ta, E(d.positionName || d.position_name || d.position), 1)
|
|
2432
|
+
])
|
|
2433
|
+
])
|
|
2434
|
+
]))), 128))
|
|
2435
|
+
])
|
|
2436
|
+
]),
|
|
2437
|
+
_: 1
|
|
2438
|
+
}, 8, ["header-text"])
|
|
2439
|
+
]));
|
|
2440
|
+
}
|
|
2441
|
+
}, xe = /* @__PURE__ */ G(ka, [["__scopeId", "data-v-1667d1ec"]]), Ea = { class: "filter-players" }, Va = {
|
|
2442
|
+
__name: "FilterPlayers",
|
|
2443
|
+
props: {
|
|
2444
|
+
players: {
|
|
2445
|
+
type: Array,
|
|
2446
|
+
default: () => []
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
setup(a) {
|
|
2450
|
+
const e = a, t = D(() => e.players.filter((l) => l.is_titular)), n = D(() => e.players.filter((l) => !l.is_titular));
|
|
2451
|
+
return (l, i) => (g(), h("div", Ea, [
|
|
2452
|
+
R(xe, {
|
|
2453
|
+
players: t.value,
|
|
2454
|
+
"are-players-titular": ""
|
|
2455
|
+
}, null, 8, ["players"]),
|
|
2456
|
+
R(xe, {
|
|
2457
|
+
players: n.value,
|
|
2458
|
+
"are-players-titular": !1
|
|
2459
|
+
}, null, 8, ["players"])
|
|
2460
|
+
]));
|
|
2461
|
+
}
|
|
2462
|
+
}, $a = /* @__PURE__ */ G(Va, [["__scopeId", "data-v-44980c4e"]]), Pa = { class: "side-filters" }, Ba = { class: "side-filters__tabs" }, La = { class: "tabs-container" }, Ra = { class: "side-filters__content" }, Da = { key: 0 }, Fa = { class: "events-section" }, Aa = { class: "section-header" }, za = { class: "all-toggle" }, Na = { class: "events-list" }, Xa = ["categories", "value"], Ua = { class: "event-label" }, Oa = { class: "events-section" }, Wa = { class: "section-header" }, qa = { class: "all-toggle" }, Ya = { class: "events-list" }, Ga = ["categories", "value"], ja = { class: "event-label" }, Za = { key: 1 }, Qa = {
|
|
2463
|
+
key: 0,
|
|
2464
|
+
class: "loading-indicator"
|
|
2465
|
+
}, Ja = {
|
|
2466
|
+
key: 1,
|
|
2467
|
+
class: "stats-summary"
|
|
2468
|
+
}, Ha = { class: "radio-group" }, Ka = { class: "radio-item" }, es = { class: "radio-item" }, ts = { class: "radio-item" }, as = { class: "toggle-buttons" }, ss = { class: "chain-duration" }, ns = { class: "duration-label" }, is = { class: "duration-label__highlight" }, ls = { class: "duration-input" }, os = { class: "time-filter" }, rs = { class: "time-input" }, ds = { class: "time-filter" }, us = { class: "time-input" }, cs = { class: "zone-filter" }, ms = { class: "zone-checkboxes" }, hs = ["value"], gs = { class: "zone-label" }, ps = { class: "zone-checkboxes" }, vs = ["value"], fs = { class: "zone-label" }, ys = { class: "zone-filter" }, bs = { class: "zone-checkboxes" }, _s = ["value"], xs = { class: "zone-label" }, Cs = { key: 2 }, Ss = {
|
|
2469
|
+
__name: "SideFilters",
|
|
2470
|
+
props: {
|
|
2471
|
+
startedCategories: {
|
|
2472
|
+
type: Array,
|
|
2473
|
+
default: () => []
|
|
2474
|
+
},
|
|
2475
|
+
endedCategories: {
|
|
2476
|
+
type: Array,
|
|
2477
|
+
default: () => []
|
|
2478
|
+
},
|
|
2479
|
+
homeTeamId: {
|
|
2480
|
+
type: Number,
|
|
2481
|
+
default: 1
|
|
2482
|
+
},
|
|
2483
|
+
awayTeamId: {
|
|
2484
|
+
type: Number,
|
|
2485
|
+
default: 5
|
|
2486
|
+
},
|
|
2487
|
+
gameId: {
|
|
2488
|
+
type: Number,
|
|
2489
|
+
default: 88247
|
|
2490
|
+
},
|
|
2491
|
+
isDataLoaded: {
|
|
2492
|
+
type: Boolean,
|
|
2493
|
+
default: !1
|
|
2494
|
+
},
|
|
2495
|
+
players: {
|
|
2496
|
+
type: Array,
|
|
2497
|
+
default: () => []
|
|
2498
|
+
}
|
|
2499
|
+
},
|
|
2500
|
+
emits: ["chains-filtered", "stats-updated"],
|
|
2501
|
+
setup(a, { emit: e }) {
|
|
2502
|
+
const t = a, n = x("cadenas"), {
|
|
2503
|
+
chains: l,
|
|
2504
|
+
stats: i,
|
|
2505
|
+
isLoading: o,
|
|
2506
|
+
selectedStartCategories: d,
|
|
2507
|
+
selectedEndCategories: C,
|
|
2508
|
+
selectedTeam: w,
|
|
2509
|
+
durationRange: I,
|
|
2510
|
+
applyFilters: V,
|
|
2511
|
+
refreshData: M,
|
|
2512
|
+
loadInitialData: _
|
|
2513
|
+
} = da(t.gameId), T = e;
|
|
2514
|
+
Q([l, i], ([j, r]) => {
|
|
2515
|
+
T("chains-filtered", j), T("stats-updated", r);
|
|
2516
|
+
}, { deep: !0 }), Q(
|
|
2517
|
+
() => [t.isDataLoaded],
|
|
2518
|
+
() => {
|
|
2519
|
+
t.isDataLoaded && _();
|
|
2520
|
+
},
|
|
2521
|
+
{ immediate: !0, deep: !0 }
|
|
2522
|
+
);
|
|
2523
|
+
const p = x("ambos"), f = x("mayor"), b = x(5), m = x(5), L = x(5), Y = x([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]), P = x([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]), y = x([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]), c = x([
|
|
2524
|
+
{ value: "1", label: "1" },
|
|
2525
|
+
{ value: "5", label: "5" },
|
|
2526
|
+
{ value: "9", label: "9" },
|
|
2527
|
+
{ value: "13", label: "13" },
|
|
2528
|
+
{ value: "2", label: "2" },
|
|
2529
|
+
{ value: "6", label: "6" },
|
|
2530
|
+
{ value: "10", label: "10" },
|
|
2531
|
+
{ value: "14", label: "14" },
|
|
2532
|
+
{ value: "3", label: "3" },
|
|
2533
|
+
{ value: "7", label: "7" },
|
|
2534
|
+
{ value: "11", label: "11" },
|
|
2535
|
+
{ value: "15", label: "15" },
|
|
2536
|
+
{ value: "4", label: "4" },
|
|
2537
|
+
{ value: "8", label: "8" },
|
|
2538
|
+
{ value: "12", label: "12" },
|
|
2539
|
+
{ value: "16", label: "16" }
|
|
2540
|
+
]), u = d, v = C, k = x(!0), F = x(!0), $ = () => {
|
|
2541
|
+
switch (p.value) {
|
|
2542
|
+
case "local":
|
|
2543
|
+
w.value = t.homeTeamId;
|
|
2544
|
+
break;
|
|
2545
|
+
case "visitante":
|
|
2546
|
+
w.value = t.awayTeamId;
|
|
2547
|
+
break;
|
|
2548
|
+
case "ambos":
|
|
2549
|
+
w.value = null;
|
|
2550
|
+
break;
|
|
2551
|
+
}
|
|
2552
|
+
V();
|
|
2553
|
+
}, B = () => {
|
|
2554
|
+
f.value === "menor" ? I.value = { min: null, max: b.value } : I.value = { min: b.value, max: null }, V();
|
|
2555
|
+
}, ee = () => {
|
|
2556
|
+
V();
|
|
2557
|
+
}, Ie = () => {
|
|
2558
|
+
b.value < 90 && b.value++;
|
|
2559
|
+
}, Te = () => {
|
|
2560
|
+
b.value > 1 && b.value--;
|
|
2561
|
+
}, ke = () => {
|
|
2562
|
+
k.value ? u.value = te.value.map((j) => j.id) : u.value = [];
|
|
2563
|
+
}, Ee = () => {
|
|
2564
|
+
F.value ? v.value = ae.value.map((j) => j.id) : v.value = [];
|
|
2565
|
+
}, te = D(() => t.startedCategories.length > 0 ? t.startedCategories : []), ae = D(() => t.endedCategories.length > 0 ? t.endedCategories : []);
|
|
2566
|
+
return Q([te, ae], () => {
|
|
2567
|
+
u.value.length === 0 && (u.value = te.value.map((j) => j.id)), v.value.length === 0 && (v.value = ae.value.map((j) => j.id));
|
|
2568
|
+
}, { immediate: !0 }), (j, r) => (g(), h("div", Pa, [
|
|
2569
|
+
s("div", Ba, [
|
|
2570
|
+
s("div", La, [
|
|
2571
|
+
s("button", {
|
|
2572
|
+
class: O(["tab-button", { active: n.value === "cadenas" }]),
|
|
2573
|
+
onClick: r[0] || (r[0] = (S) => n.value = "cadenas")
|
|
2574
|
+
}, " Filtros ", 2),
|
|
2575
|
+
s("button", {
|
|
2576
|
+
class: O(["tab-button", { active: n.value === "eventos" }]),
|
|
2577
|
+
onClick: r[1] || (r[1] = (S) => n.value = "eventos")
|
|
2578
|
+
}, " Eventos ", 2),
|
|
2579
|
+
s("button", {
|
|
2580
|
+
class: O(["tab-button", { active: n.value === "players" }]),
|
|
2581
|
+
onClick: r[2] || (r[2] = (S) => n.value = "players")
|
|
2582
|
+
}, " Jugadores ", 2)
|
|
2583
|
+
])
|
|
2584
|
+
]),
|
|
2585
|
+
s("div", Ra, [
|
|
2586
|
+
n.value === "eventos" ? (g(), h("div", Da, [
|
|
2587
|
+
s("div", Fa, [
|
|
2588
|
+
s("div", Aa, [
|
|
2589
|
+
r[23] || (r[23] = s("span", { class: "section-title" }, "Jugadas que empiezan con:", -1)),
|
|
2590
|
+
s("label", za, [
|
|
2591
|
+
U(s("input", {
|
|
2592
|
+
type: "checkbox",
|
|
2593
|
+
"onUpdate:modelValue": r[3] || (r[3] = (S) => k.value = S),
|
|
2594
|
+
onChange: ke
|
|
2595
|
+
}, null, 544), [
|
|
2596
|
+
[H, k.value]
|
|
2597
|
+
]),
|
|
2598
|
+
r[21] || (r[21] = s("span", { class: "all-label" }, "Todas", -1)),
|
|
2599
|
+
r[22] || (r[22] = s("span", { class: "all-checkbox" }, null, -1))
|
|
2600
|
+
])
|
|
2601
|
+
]),
|
|
2602
|
+
s("div", Na, [
|
|
2603
|
+
(g(!0), h(z, null, X(t.startedCategories.length > 0 ? t.startedCategories : te.value, (S) => (g(), h("label", {
|
|
2604
|
+
key: S.id,
|
|
2605
|
+
class: "event-item"
|
|
2606
|
+
}, [
|
|
2607
|
+
U(s("input", {
|
|
2608
|
+
type: "checkbox",
|
|
2609
|
+
categories: S.category_ids,
|
|
2610
|
+
value: S.id,
|
|
2611
|
+
"onUpdate:modelValue": r[4] || (r[4] = (Z) => ge(u) ? u.value = Z : null),
|
|
2612
|
+
onChange: ee
|
|
2613
|
+
}, null, 40, Xa), [
|
|
2614
|
+
[H, N(u)]
|
|
2615
|
+
]),
|
|
2616
|
+
r[24] || (r[24] = s("span", { class: "event-checkbox" }, null, -1)),
|
|
2617
|
+
s("span", Ua, E(S.name), 1)
|
|
2618
|
+
]))), 128))
|
|
2619
|
+
])
|
|
2620
|
+
]),
|
|
2621
|
+
s("div", Oa, [
|
|
2622
|
+
s("div", Wa, [
|
|
2623
|
+
r[27] || (r[27] = s("span", { class: "section-title" }, "Jugadas que terminan con:", -1)),
|
|
2624
|
+
s("label", qa, [
|
|
2625
|
+
U(s("input", {
|
|
2626
|
+
type: "checkbox",
|
|
2627
|
+
"onUpdate:modelValue": r[5] || (r[5] = (S) => F.value = S),
|
|
2628
|
+
onChange: Ee
|
|
2629
|
+
}, null, 544), [
|
|
2630
|
+
[H, F.value]
|
|
2631
|
+
]),
|
|
2632
|
+
r[25] || (r[25] = s("span", { class: "all-label" }, "Todas", -1)),
|
|
2633
|
+
r[26] || (r[26] = s("span", { class: "all-checkbox" }, null, -1))
|
|
2634
|
+
])
|
|
2635
|
+
]),
|
|
2636
|
+
s("div", Ya, [
|
|
2637
|
+
(g(!0), h(z, null, X(ae.value, (S) => (g(), h("label", {
|
|
2638
|
+
key: S.id,
|
|
2639
|
+
class: "event-item"
|
|
2640
|
+
}, [
|
|
2641
|
+
U(s("input", {
|
|
2642
|
+
type: "checkbox",
|
|
2643
|
+
categories: S.category_ids,
|
|
2644
|
+
value: S.id,
|
|
2645
|
+
"onUpdate:modelValue": r[6] || (r[6] = (Z) => ge(v) ? v.value = Z : null),
|
|
2646
|
+
onChange: ee
|
|
2647
|
+
}, null, 40, Ga), [
|
|
2648
|
+
[H, N(v)]
|
|
2649
|
+
]),
|
|
2650
|
+
r[28] || (r[28] = s("span", { class: "event-checkbox" }, null, -1)),
|
|
2651
|
+
s("span", ja, E(S.name), 1)
|
|
2652
|
+
]))), 128))
|
|
2653
|
+
])
|
|
2654
|
+
])
|
|
2655
|
+
])) : n.value === "cadenas" ? (g(), h("div", Za, [
|
|
2656
|
+
N(o) ? (g(), h("div", Qa, " Cargando cadenas... ")) : N(i) ? (g(), h("div", Ja, [
|
|
2657
|
+
J(E(N(i).totalChains) + " cadenas encontradas ", 1),
|
|
2658
|
+
s("button", {
|
|
2659
|
+
class: "reset-btn",
|
|
2660
|
+
onClick: r[7] || (r[7] = (...S) => N(M) && N(M)(...S)),
|
|
2661
|
+
title: "Refrescar datos (resetear filtros)"
|
|
2662
|
+
}, " 🔄 ")
|
|
2663
|
+
])) : q("", !0),
|
|
2664
|
+
r[48] || (r[48] = s("div", { class: "section-title" }, "A quién pertenece la posesión:", -1)),
|
|
2665
|
+
s("div", Ha, [
|
|
2666
|
+
s("label", Ka, [
|
|
2667
|
+
U(s("input", {
|
|
2668
|
+
type: "radio",
|
|
2669
|
+
name: "possession",
|
|
2670
|
+
value: "local",
|
|
2671
|
+
"onUpdate:modelValue": r[8] || (r[8] = (S) => p.value = S),
|
|
2672
|
+
onChange: $
|
|
2673
|
+
}, null, 544), [
|
|
2674
|
+
[re, p.value]
|
|
2675
|
+
]),
|
|
2676
|
+
r[29] || (r[29] = s("span", { class: "radio-custom" }, null, -1)),
|
|
2677
|
+
r[30] || (r[30] = s("span", { class: "radio-label" }, "Equipo local", -1))
|
|
2678
|
+
]),
|
|
2679
|
+
s("label", es, [
|
|
2680
|
+
U(s("input", {
|
|
2681
|
+
type: "radio",
|
|
2682
|
+
name: "possession",
|
|
2683
|
+
value: "visitante",
|
|
2684
|
+
"onUpdate:modelValue": r[9] || (r[9] = (S) => p.value = S),
|
|
2685
|
+
onChange: $
|
|
2686
|
+
}, null, 544), [
|
|
2687
|
+
[re, p.value]
|
|
2688
|
+
]),
|
|
2689
|
+
r[31] || (r[31] = s("span", { class: "radio-custom" }, null, -1)),
|
|
2690
|
+
r[32] || (r[32] = s("span", { class: "radio-label" }, "Equipo visitante", -1))
|
|
2691
|
+
]),
|
|
2692
|
+
s("label", ts, [
|
|
2693
|
+
U(s("input", {
|
|
2694
|
+
type: "radio",
|
|
2695
|
+
name: "possession",
|
|
2696
|
+
value: "ambos",
|
|
2697
|
+
"onUpdate:modelValue": r[10] || (r[10] = (S) => p.value = S),
|
|
2698
|
+
onChange: $
|
|
2699
|
+
}, null, 544), [
|
|
2700
|
+
[re, p.value]
|
|
2701
|
+
]),
|
|
2702
|
+
r[33] || (r[33] = s("span", { class: "radio-custom" }, null, -1)),
|
|
2703
|
+
r[34] || (r[34] = s("span", { class: "radio-label" }, "Ambos", -1))
|
|
2704
|
+
])
|
|
2705
|
+
]),
|
|
2706
|
+
r[49] || (r[49] = s("div", { class: "section-title" }, "Cadenas de posesión", -1)),
|
|
2707
|
+
s("div", as, [
|
|
2708
|
+
s("button", {
|
|
2709
|
+
class: O(["toggle-btn", { active: f.value === "menor" }]),
|
|
2710
|
+
onClick: r[11] || (r[11] = (S) => {
|
|
2711
|
+
f.value = "menor", B();
|
|
2712
|
+
})
|
|
2713
|
+
}, " Menor ", 2),
|
|
2714
|
+
s("button", {
|
|
2715
|
+
class: O(["toggle-btn", { active: f.value === "mayor" }]),
|
|
2716
|
+
onClick: r[12] || (r[12] = (S) => {
|
|
2717
|
+
f.value = "mayor", B();
|
|
2718
|
+
})
|
|
2719
|
+
}, " Mayor ", 2)
|
|
2720
|
+
]),
|
|
2721
|
+
s("div", ss, [
|
|
2722
|
+
s("span", ns, [
|
|
2723
|
+
r[35] || (r[35] = J("Considerar solo cadenas igual o ")),
|
|
2724
|
+
s("span", is, E(f.value === "menor" ? "menor" : "mayor"), 1),
|
|
2725
|
+
r[36] || (r[36] = J(" a:"))
|
|
2726
|
+
]),
|
|
2727
|
+
s("div", ls, [
|
|
2728
|
+
s("button", {
|
|
2729
|
+
class: "btn-minus",
|
|
2730
|
+
onClick: r[13] || (r[13] = (S) => {
|
|
2731
|
+
Te(), B();
|
|
2732
|
+
})
|
|
2733
|
+
}, "-"),
|
|
2734
|
+
U(s("input", {
|
|
2735
|
+
"onUpdate:modelValue": r[14] || (r[14] = (S) => b.value = S),
|
|
2736
|
+
type: "number",
|
|
2737
|
+
min: "1",
|
|
2738
|
+
max: "90",
|
|
2739
|
+
onInput: B
|
|
2740
|
+
}, null, 544), [
|
|
2741
|
+
[de, b.value]
|
|
2742
|
+
]),
|
|
2743
|
+
s("button", {
|
|
2744
|
+
class: "btn-plus",
|
|
2745
|
+
onClick: r[15] || (r[15] = (S) => {
|
|
2746
|
+
Ie(), B();
|
|
2747
|
+
})
|
|
2748
|
+
}, "+"),
|
|
2749
|
+
r[37] || (r[37] = s("span", { class: "duration-unit" }, "segundos", -1))
|
|
2750
|
+
])
|
|
2751
|
+
]),
|
|
2752
|
+
s("div", os, [
|
|
2753
|
+
r[39] || (r[39] = s("span", { class: "filter-label" }, [
|
|
2754
|
+
s("span", { class: "filter-label__highlight" }, "Inicio"),
|
|
2755
|
+
J(" - Considerar a partir del: ")
|
|
2756
|
+
], -1)),
|
|
2757
|
+
s("div", rs, [
|
|
2758
|
+
U(s("input", {
|
|
2759
|
+
"onUpdate:modelValue": r[16] || (r[16] = (S) => m.value = S),
|
|
2760
|
+
type: "number",
|
|
2761
|
+
min: "1",
|
|
2762
|
+
max: "90"
|
|
2763
|
+
}, null, 512), [
|
|
2764
|
+
[de, m.value]
|
|
2765
|
+
]),
|
|
2766
|
+
r[38] || (r[38] = s("span", { class: "filter-suffix" }, "de la cadena", -1))
|
|
2767
|
+
])
|
|
2768
|
+
]),
|
|
2769
|
+
s("div", ds, [
|
|
2770
|
+
r[41] || (r[41] = s("span", { class: "filter-label" }, [
|
|
2771
|
+
s("span", { class: "filter-label__highlight" }, "Fin"),
|
|
2772
|
+
J(" - Excluir los últimos: ")
|
|
2773
|
+
], -1)),
|
|
2774
|
+
s("div", us, [
|
|
2775
|
+
U(s("input", {
|
|
2776
|
+
"onUpdate:modelValue": r[17] || (r[17] = (S) => L.value = S),
|
|
2777
|
+
type: "number",
|
|
2778
|
+
min: "1",
|
|
2779
|
+
max: "90"
|
|
2780
|
+
}, null, 512), [
|
|
2781
|
+
[de, L.value]
|
|
2782
|
+
]),
|
|
2783
|
+
r[40] || (r[40] = s("span", { class: "filter-suffix" }, "de la cadena", -1))
|
|
2784
|
+
])
|
|
2785
|
+
]),
|
|
2786
|
+
r[50] || (r[50] = s("div", { class: "section-title" }, "Zona inicial y final", -1)),
|
|
2787
|
+
s("div", cs, [
|
|
2788
|
+
r[44] || (r[44] = s("span", { class: "filter-label" }, [
|
|
2789
|
+
s("span", { class: "filter-label__highlight" }, "Inicio"),
|
|
2790
|
+
J(" Zona inicial de cadena: ")
|
|
2791
|
+
], -1)),
|
|
2792
|
+
s("div", ms, [
|
|
2793
|
+
(g(!0), h(z, null, X(c.value, (S) => (g(), h("label", {
|
|
2794
|
+
key: S.value,
|
|
2795
|
+
class: "zone-item"
|
|
2796
|
+
}, [
|
|
2797
|
+
U(s("input", {
|
|
2798
|
+
type: "checkbox",
|
|
2799
|
+
value: S.value,
|
|
2800
|
+
"onUpdate:modelValue": r[18] || (r[18] = (Z) => Y.value = Z)
|
|
2801
|
+
}, null, 8, hs), [
|
|
2802
|
+
[H, Y.value]
|
|
2803
|
+
]),
|
|
2804
|
+
r[42] || (r[42] = s("span", { class: "zone-checkbox" }, null, -1)),
|
|
2805
|
+
s("span", gs, E(S.label), 1)
|
|
2806
|
+
]))), 128))
|
|
2807
|
+
]),
|
|
2808
|
+
r[45] || (r[45] = s("span", {
|
|
2809
|
+
class: "filter-label",
|
|
2810
|
+
style: { "margin-top": "10px" }
|
|
2811
|
+
}, [
|
|
2812
|
+
s("span", { class: "filter-label__highlight" }, "Fin"),
|
|
2813
|
+
J(" Zona final de cadena: ")
|
|
2814
|
+
], -1)),
|
|
2815
|
+
s("div", ps, [
|
|
2816
|
+
(g(!0), h(z, null, X(c.value, (S) => (g(), h("label", {
|
|
2817
|
+
key: S.value,
|
|
2818
|
+
class: "zone-item"
|
|
2819
|
+
}, [
|
|
2820
|
+
U(s("input", {
|
|
2821
|
+
type: "checkbox",
|
|
2822
|
+
value: S.value,
|
|
2823
|
+
"onUpdate:modelValue": r[19] || (r[19] = (Z) => P.value = Z)
|
|
2824
|
+
}, null, 8, vs), [
|
|
2825
|
+
[H, P.value]
|
|
2826
|
+
]),
|
|
2827
|
+
r[43] || (r[43] = s("span", { class: "zone-checkbox" }, null, -1)),
|
|
2828
|
+
s("span", fs, E(S.label), 1)
|
|
2829
|
+
]))), 128))
|
|
2830
|
+
])
|
|
2831
|
+
]),
|
|
2832
|
+
r[51] || (r[51] = s("div", { class: "section-title" }, "Zona de interés", -1)),
|
|
2833
|
+
s("div", ys, [
|
|
2834
|
+
r[47] || (r[47] = s("span", { class: "filter-label" }, " Considerar solo cuando el balón estuvo en estas zonas: ", -1)),
|
|
2835
|
+
s("div", bs, [
|
|
2836
|
+
(g(!0), h(z, null, X(c.value, (S) => (g(), h("label", {
|
|
2837
|
+
key: S.value,
|
|
2838
|
+
class: "zone-item"
|
|
2839
|
+
}, [
|
|
2840
|
+
U(s("input", {
|
|
2841
|
+
type: "checkbox",
|
|
2842
|
+
value: S.value,
|
|
2843
|
+
"onUpdate:modelValue": r[20] || (r[20] = (Z) => y.value = Z)
|
|
2844
|
+
}, null, 8, _s), [
|
|
2845
|
+
[H, y.value]
|
|
2846
|
+
]),
|
|
2847
|
+
r[46] || (r[46] = s("span", { class: "zone-checkbox" }, null, -1)),
|
|
2848
|
+
s("span", xs, E(S.label), 1)
|
|
2849
|
+
]))), 128))
|
|
2850
|
+
])
|
|
2851
|
+
])
|
|
2852
|
+
])) : n.value === "players" ? (g(), h("div", Cs, [
|
|
2853
|
+
R($a, { players: a.players }, null, 8, ["players"])
|
|
2854
|
+
])) : q("", !0)
|
|
2855
|
+
])
|
|
2856
|
+
]));
|
|
2857
|
+
}
|
|
2858
|
+
}, Ms = /* @__PURE__ */ G(Ss, [["__scopeId", "data-v-d1f32d09"]]), ws = /* @__PURE__ */ new Map([
|
|
2859
|
+
[1, "Portero"],
|
|
2860
|
+
[2, "Defensa Central"],
|
|
2861
|
+
[3, "Lateral por izquierda"],
|
|
2862
|
+
[4, "Lateral por derecha"],
|
|
2863
|
+
[5, "Volante por izquierda"],
|
|
2864
|
+
[6, "Volante por derecha"],
|
|
2865
|
+
[7, "Volante defensivo"],
|
|
2866
|
+
[8, "Volante ofensivo"],
|
|
2867
|
+
[9, "Delantero"]
|
|
2868
|
+
]), Is = { class: "positions-container" }, Ts = { class: "positions-container__body" }, ks = { class: "positions-container__filters" }, Es = { class: "main-content" }, Vs = { class: "left-content" }, $s = { class: "right-content" }, Ps = {
|
|
2869
|
+
__name: "GSC-PositionsAndConnections",
|
|
2870
|
+
props: {
|
|
2871
|
+
game: {
|
|
2872
|
+
type: Object,
|
|
2873
|
+
default: () => ({
|
|
2874
|
+
gameId: 88247,
|
|
2875
|
+
homeTeam: {
|
|
2876
|
+
team_id: 1
|
|
2877
|
+
},
|
|
2878
|
+
awayTeam: {
|
|
2879
|
+
team_id: 5
|
|
2880
|
+
}
|
|
2881
|
+
})
|
|
2882
|
+
},
|
|
2883
|
+
token: {
|
|
2884
|
+
type: String,
|
|
2885
|
+
default: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"
|
|
2886
|
+
}
|
|
2887
|
+
},
|
|
2888
|
+
setup(a) {
|
|
2889
|
+
const e = a, {
|
|
2890
|
+
endedCategories: t,
|
|
2891
|
+
startedCategories: n,
|
|
2892
|
+
loadGameData: l,
|
|
2893
|
+
isDataLoaded: i
|
|
2894
|
+
} = we(), o = x(null), d = x([]), C = x([]);
|
|
2895
|
+
x([]);
|
|
2896
|
+
const w = x(0), I = x(/* @__PURE__ */ new Map()), V = x([]), M = x({
|
|
2897
|
+
originSections: [],
|
|
2898
|
+
destinationSections: [],
|
|
2899
|
+
distanceRange: { minValue: 5, maxValue: 30 },
|
|
2900
|
+
isSelected: !1
|
|
2901
|
+
}), _ = D(() => I.value.size ? I.value.get(w.value) || [] : []), T = D(() => _.value.filter((y) => y.isSelected).map((y) => y.player_id));
|
|
2902
|
+
ce(async () => {
|
|
2903
|
+
await l();
|
|
2904
|
+
}), Q(() => e.game.gameId, async (y) => {
|
|
2905
|
+
y && (await L(), await Y());
|
|
2906
|
+
}, { immediate: !0 });
|
|
2907
|
+
function p(y) {
|
|
2908
|
+
console.log("chains filtered:", y), d.value = y;
|
|
2909
|
+
}
|
|
2910
|
+
function f(y) {
|
|
2911
|
+
C.value = y;
|
|
2912
|
+
}
|
|
2913
|
+
async function b(y) {
|
|
2914
|
+
try {
|
|
2915
|
+
return (await (await fetch(
|
|
2916
|
+
`https://ts7thxzaik.execute-api.us-west-2.amazonaws.com/prod/v2/players/games/${y}`,
|
|
2917
|
+
{
|
|
2918
|
+
headers: {
|
|
2919
|
+
Authorization: e.token
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
)).json()).players || [];
|
|
2923
|
+
} catch (c) {
|
|
2924
|
+
console.error("Error fetching players:", c);
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
async function m(y) {
|
|
2928
|
+
try {
|
|
2929
|
+
const u = await (await fetch(
|
|
2930
|
+
`https://nckawv8v3b.execute-api.us-west-2.amazonaws.com/prod/connections/${y}`,
|
|
2931
|
+
{
|
|
2932
|
+
headers: {
|
|
2933
|
+
Authorization: e.token
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
)).json();
|
|
2937
|
+
return u.data && u.headers ? u.data.reduce((v, k) => (v.push(k.reduce((F, $, B) => (F[u.headers[B]] = $, F), {})), v), []) : [];
|
|
2938
|
+
} catch (c) {
|
|
2939
|
+
console.error("Error fetching game connections:", c);
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
async function L() {
|
|
2943
|
+
try {
|
|
2944
|
+
const y = await b(e.game.gameId);
|
|
2945
|
+
e.game.homeTeam && e.game.awayTeam && (w.value = e.game.homeTeam.team_id, I.value.clear(), I.value.set(e.game.homeTeam.team_id, []), I.value.set(e.game.awayTeam.team_id, []), y.forEach((c) => {
|
|
2946
|
+
if (c.positionName = ws.get(c.position_id), c.team_id === e.game.homeTeam.team_id) {
|
|
2947
|
+
const u = I.value.get(e.game.homeTeam.team_id);
|
|
2948
|
+
u && (c.isSelected = c.is_titular, u.push(c));
|
|
2949
|
+
} else if (c.team_id === e.game.awayTeam.team_id) {
|
|
2950
|
+
const u = I.value.get(e.game.awayTeam.team_id);
|
|
2951
|
+
u && (c.isSelected = c.is_titular, u.push(c));
|
|
2952
|
+
}
|
|
2953
|
+
}));
|
|
2954
|
+
} catch (y) {
|
|
2955
|
+
console.error("Error filling game players:", y);
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
async function Y() {
|
|
2959
|
+
try {
|
|
2960
|
+
const y = await m(e.game.gameId);
|
|
2961
|
+
console.log("connections:", y), y && y.length > 0 ? (console.log("Connections:", y), V.value = y) : V.value = [];
|
|
2962
|
+
} catch (y) {
|
|
2963
|
+
console.error("Error filling game passes:", y);
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
function P(y) {
|
|
2967
|
+
if (console.log("onChangeConnections:", y), y.isSelected) {
|
|
2968
|
+
if (M.value.isSelected = y.isSelected, JSON.stringify(y.originSections) !== JSON.stringify(M.value.originSections) && o.value) {
|
|
2969
|
+
M.value.originSections = [...y.originSections], M.value.destinationSections = [...y.destinationSections], M.value.distanceRange = { ...y.distanceRange };
|
|
2970
|
+
const u = V.value.filter((v) => M.value.originSections.includes(v.section_origin) && M.value.destinationSections.includes(v.section_destination) && v.distance >= M.value.distanceRange.minValue && v.distance <= M.value.distanceRange.maxValue).reduce((v, k) => {
|
|
2971
|
+
const F = `${k.player_id}-${k.receiver_id}`, $ = v.get(F);
|
|
2972
|
+
return $ ? $.count += 1 : v.set(F, {
|
|
2973
|
+
to: k.receiver_id,
|
|
2974
|
+
from: k.player_id,
|
|
2975
|
+
count: 1
|
|
2976
|
+
}), v;
|
|
2977
|
+
}, /* @__PURE__ */ new Map());
|
|
2978
|
+
console.log("----------------------------------------------------------"), console.log("groupedConnections:", u), o.value.setConnections(Array.from(u.values()));
|
|
2979
|
+
}
|
|
2980
|
+
} else
|
|
2981
|
+
M.value.isSelected = !1;
|
|
2982
|
+
}
|
|
2983
|
+
return (y, c) => (g(), h("div", Is, [
|
|
2984
|
+
R(Dt, {
|
|
2985
|
+
"selected-team": "",
|
|
2986
|
+
time: "",
|
|
2987
|
+
totalChains: C.value.totalChains
|
|
2988
|
+
}, null, 8, ["totalChains"]),
|
|
2989
|
+
s("div", Ts, [
|
|
2990
|
+
s("div", ks, [
|
|
2991
|
+
R($t, { onChangeConnections: P })
|
|
2992
|
+
]),
|
|
2993
|
+
s("main", Es, [
|
|
2994
|
+
s("div", Vs, [
|
|
2995
|
+
R(ra, {
|
|
2996
|
+
ref_key: "soccerField",
|
|
2997
|
+
ref: o,
|
|
2998
|
+
homeTeamId: a.game.homeTeamId,
|
|
2999
|
+
awayTeamId: a.game.awayTeamId,
|
|
3000
|
+
filteredChains: d.value,
|
|
3001
|
+
playersSelected: T.value,
|
|
3002
|
+
isDataLoaded: N(i),
|
|
3003
|
+
"are-connections-visible": M.value.isSelected
|
|
3004
|
+
}, null, 8, ["homeTeamId", "awayTeamId", "filteredChains", "playersSelected", "isDataLoaded", "are-connections-visible"])
|
|
3005
|
+
]),
|
|
3006
|
+
s("div", $s, [
|
|
3007
|
+
R(Ms, {
|
|
3008
|
+
players: _.value,
|
|
3009
|
+
startedCategories: N(n),
|
|
3010
|
+
endedCategories: N(t),
|
|
3011
|
+
homeTeamId: a.game.homeTeam.team_id,
|
|
3012
|
+
awayTeamId: a.game.awayTeam.team_id,
|
|
3013
|
+
gameId: a.game.gameId,
|
|
3014
|
+
isDataLoaded: N(i),
|
|
3015
|
+
onChainsFiltered: p,
|
|
3016
|
+
onStatsUpdated: f
|
|
3017
|
+
}, null, 8, ["players", "startedCategories", "endedCategories", "homeTeamId", "awayTeamId", "gameId", "isDataLoaded"])
|
|
3018
|
+
])
|
|
3019
|
+
])
|
|
3020
|
+
])
|
|
3021
|
+
]));
|
|
3022
|
+
}
|
|
3023
|
+
}, Rs = /* @__PURE__ */ G(Ps, [["__scopeId", "data-v-9b3cdfe1"]]);
|
|
3024
|
+
export {
|
|
3025
|
+
Rs as GSCPositionsAndConnections
|
|
3026
|
+
};
|