@mjsz-vbr-elements/core 2.7.2 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AdditionalStandingsText-QBTNWUHG.js → AdditionalStandingsText-BiRMcxjC.js} +88 -80
- package/dist/columns.js +2 -2
- package/dist/components.js +3 -3
- package/dist/composables.js +66 -59
- package/dist/constants.js +2 -2
- package/dist/{convert-DkesPGp4.js → convert-C_k4-oaF.js} +95 -83
- package/dist/datetime-BzdN4htO.js +2 -2
- package/dist/index.iife.js +5 -5
- package/dist/index.iife.js.br +0 -0
- package/dist/index.iife.js.gz +0 -0
- package/dist/index.js +96 -94
- package/dist/{useAdditionalText-D1LaWU-i.js → useAdditionalText-BCKSsRDN.js} +8 -7
- package/dist/utils.js +53 -52
- package/package.json +2 -2
package/dist/composables.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.
|
|
4
|
-
* (c)
|
|
3
|
+
* version: v2.9.0 - 09/01/2025, 14:35:52
|
|
4
|
+
* (c) 2025
|
|
5
5
|
* description: Data visualization for MJSZ VBR
|
|
6
6
|
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
7
|
*/
|
|
8
|
-
import { k as S, l as D, n as
|
|
9
|
-
import { c as
|
|
10
|
-
import { unref as u, ref as
|
|
11
|
-
import { VBR_API_BASE_URL as
|
|
12
|
-
import { Q as x, T as y, C as g, S as _, J as
|
|
13
|
-
var
|
|
8
|
+
import { k as S, l as I, m as D, n as l, p as E, q as T, r as b } from "./useAdditionalText-BCKSsRDN.js";
|
|
9
|
+
import { c as rt, i as it, h as st, u as at, b as ot, a as ut, d as ct, e as ft, f as dt, g as pt, v as lt } from "./useAdditionalText-BCKSsRDN.js";
|
|
10
|
+
import { unref as u, ref as P, watch as B, nextTick as C } from "vue";
|
|
11
|
+
import { VBR_API_BASE_URL as V } from "./constants.js";
|
|
12
|
+
import { Q as x, T as y, C as g, S as _, J as A, I as M, i as v, f as O } from "./datetime-BzdN4htO.js";
|
|
13
|
+
var R = /* @__PURE__ */ function() {
|
|
14
14
|
function e(t, n) {
|
|
15
15
|
this.xf = n, this.f = t, this.found = !1;
|
|
16
16
|
}
|
|
@@ -20,18 +20,18 @@ var O = /* @__PURE__ */ function() {
|
|
|
20
20
|
return this.f(n) && (this.found = !0, t = y(this.xf["@@transducer/step"](t, n))), t;
|
|
21
21
|
}, e;
|
|
22
22
|
}();
|
|
23
|
-
function
|
|
23
|
+
function F(e) {
|
|
24
24
|
return function(t) {
|
|
25
|
-
return new
|
|
25
|
+
return new R(e, t);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var X = /* @__PURE__ */ g(/* @__PURE__ */ _(["find"], F, function(t, n) {
|
|
29
29
|
for (var r = 0, i = n.length; r < i; ) {
|
|
30
30
|
if (t(n[r]))
|
|
31
31
|
return n[r];
|
|
32
32
|
r += 1;
|
|
33
33
|
}
|
|
34
|
-
})),
|
|
34
|
+
})), Y = /* @__PURE__ */ function() {
|
|
35
35
|
function e(t, n) {
|
|
36
36
|
this.xf = n, this.f = t, this.idx = -1, this.found = !1;
|
|
37
37
|
}
|
|
@@ -41,30 +41,30 @@ var F = /* @__PURE__ */ g(/* @__PURE__ */ _(["find"], R, function(t, n) {
|
|
|
41
41
|
return this.idx += 1, this.f(n) && (this.found = !0, t = y(this.xf["@@transducer/step"](t, this.idx))), t;
|
|
42
42
|
}, e;
|
|
43
43
|
}();
|
|
44
|
-
function
|
|
44
|
+
function $(e) {
|
|
45
45
|
return function(t) {
|
|
46
|
-
return new
|
|
46
|
+
return new Y(e, t);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
var G = /* @__PURE__ */ g(/* @__PURE__ */ _([],
|
|
49
|
+
var G = /* @__PURE__ */ g(/* @__PURE__ */ _([], $, function(t, n) {
|
|
50
50
|
for (var r = 0, i = n.length; r < i; ) {
|
|
51
51
|
if (t(n[r]))
|
|
52
52
|
return r;
|
|
53
53
|
r += 1;
|
|
54
54
|
}
|
|
55
55
|
return -1;
|
|
56
|
-
})), w = /* @__PURE__ */
|
|
57
|
-
return t(
|
|
56
|
+
})), w = /* @__PURE__ */ A(function(t, n, r) {
|
|
57
|
+
return t(M(n, r));
|
|
58
58
|
});
|
|
59
59
|
const K = async (e, t, n) => {
|
|
60
|
-
const r = `${
|
|
60
|
+
const r = `${V}${u(e)}${S(n) ? "" : `?${L(n)}`}`;
|
|
61
61
|
return new Promise((i, o) => {
|
|
62
62
|
fetch(r, {
|
|
63
63
|
method: "GET",
|
|
64
64
|
cache: "no-cache",
|
|
65
65
|
headers: {
|
|
66
66
|
"Content-Type": "application/json",
|
|
67
|
-
"X-API-KEY":
|
|
67
|
+
"X-API-KEY": j(t)
|
|
68
68
|
}
|
|
69
69
|
}).then((s) => s.json()).then((s) => {
|
|
70
70
|
if (s.error) return o(s);
|
|
@@ -73,12 +73,12 @@ const K = async (e, t, n) => {
|
|
|
73
73
|
o(s);
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
-
}, L = (e) => Object.keys(e).map((t) => t + "=" + e[t]).join("&"),
|
|
76
|
+
}, L = (e) => Object.keys(e).map((t) => t + "=" + e[t]).join("&"), j = (e) => {
|
|
77
77
|
var t;
|
|
78
78
|
return e || ((t = window.__MJSZ_VBR_WIDGET__) != null && t.apiKey ? window.__MJSZ_VBR_WIDGET__.apiKey : "");
|
|
79
|
-
},
|
|
80
|
-
const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o =
|
|
81
|
-
return
|
|
79
|
+
}, z = (e = {}) => {
|
|
80
|
+
const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o = P(u(t)), s = (a) => v(a, "day");
|
|
81
|
+
return I(n, () => {
|
|
82
82
|
if (!i) return;
|
|
83
83
|
const a = G(w(s, "gameDate"))(u(n));
|
|
84
84
|
o.value = a === -1 ? 1 : Math.floor(a / r) + 1;
|
|
@@ -88,43 +88,42 @@ const K = async (e, t, n) => {
|
|
|
88
88
|
o.value = a;
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
},
|
|
92
|
-
const { path: i, apiKey: o, params: s, resetOnExecute: d = !1, immediate: c = !1 } = e, {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
91
|
+
}, N = ({ options: e = {}, transform: t = (i) => i, onError: n = l, onSuccess: r = l }) => {
|
|
92
|
+
const { path: i, apiKey: o, params: s, resetOnExecute: d = !1, immediate: c = !1 } = e, { state: a, error: f, isLoading: h, execute: m } = D(
|
|
93
|
+
() => K(i, o, u(s)).then((p) => t(p)),
|
|
94
|
+
[],
|
|
95
|
+
{
|
|
96
|
+
immediate: c,
|
|
97
|
+
resetOnExecute: d,
|
|
98
|
+
onError: n,
|
|
99
|
+
onSuccess: r
|
|
100
|
+
}
|
|
101
|
+
);
|
|
103
102
|
return {
|
|
104
103
|
state: a,
|
|
105
104
|
error: f,
|
|
106
|
-
isLoading:
|
|
105
|
+
isLoading: h,
|
|
107
106
|
execute: m
|
|
108
107
|
};
|
|
109
108
|
};
|
|
110
|
-
function
|
|
111
|
-
const r =
|
|
112
|
-
|
|
109
|
+
function U(e = !1, t = l, n = l) {
|
|
110
|
+
const r = E();
|
|
111
|
+
B(r, (i) => {
|
|
113
112
|
if (u(e)) {
|
|
114
113
|
if (i === "visible") return t();
|
|
115
114
|
n();
|
|
116
115
|
}
|
|
117
116
|
});
|
|
118
117
|
}
|
|
119
|
-
const
|
|
118
|
+
const H = (e = {}) => {
|
|
120
119
|
const { items: t = [], element: n, offset: r = 0, enabled: i = !0 } = e, o = (c) => v(c, "day"), s = () => {
|
|
121
120
|
var p;
|
|
122
121
|
if (d(), !u(i)) return;
|
|
123
|
-
const c =
|
|
122
|
+
const c = X(w(o, "gameDate"))(u(t));
|
|
124
123
|
if (!c) return;
|
|
125
|
-
const a =
|
|
124
|
+
const a = O(c.gameDate, "YYYY-MM-DD"), f = b(n).querySelector(`div[data-gamedate="${a}"]`);
|
|
126
125
|
if (!f) return;
|
|
127
|
-
const
|
|
126
|
+
const h = getComputedStyle(f).getPropertyValue("--vbr-widget-sticky-top-offset") || 0, m = (((p = f.getBoundingClientRect()) == null ? void 0 : p.top) ?? 0) - u(r) - parseFloat(h);
|
|
128
127
|
window.scrollTo(0, m);
|
|
129
128
|
}, { stop: d } = T(
|
|
130
129
|
() => ({
|
|
@@ -132,25 +131,33 @@ const z = (e = {}) => {
|
|
|
132
131
|
element: u(n)
|
|
133
132
|
}),
|
|
134
133
|
async ({ items: c, element: a }) => {
|
|
135
|
-
c.length === 0 || !a || (await
|
|
134
|
+
c.length === 0 || !a || (await C(), s());
|
|
136
135
|
}
|
|
137
136
|
);
|
|
138
137
|
};
|
|
138
|
+
let k = 0;
|
|
139
|
+
function J() {
|
|
140
|
+
return ++k;
|
|
141
|
+
}
|
|
142
|
+
function tt() {
|
|
143
|
+
return J();
|
|
144
|
+
}
|
|
139
145
|
export {
|
|
140
|
-
|
|
146
|
+
rt as createI18n,
|
|
141
147
|
K as fetchVBRData,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
z as
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
it as i18n,
|
|
149
|
+
st as useAdditionalText,
|
|
150
|
+
at as useColumns,
|
|
151
|
+
ot as useError,
|
|
152
|
+
ut as useErrorProvider,
|
|
153
|
+
ct as useI18n,
|
|
154
|
+
tt as useId,
|
|
155
|
+
ft as useLazyLoadingState,
|
|
156
|
+
dt as useMainClass,
|
|
157
|
+
z as usePage,
|
|
158
|
+
H as useScrollToGameDate,
|
|
159
|
+
N as useServices,
|
|
160
|
+
pt as useSort,
|
|
161
|
+
U as useVisibilityChange,
|
|
162
|
+
lt as validateColumnsName
|
|
156
163
|
};
|
package/dist/constants.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @mjsz-vbr-elements/core
|
|
3
|
-
* version: v2.
|
|
4
|
-
* (c)
|
|
3
|
+
* version: v2.9.0 - 09/01/2025, 14:35:52
|
|
4
|
+
* (c) 2025
|
|
5
5
|
* description: Data visualization for MJSZ VBR
|
|
6
6
|
* author: Ákos Stegner <akos.stegner@gmail.com>
|
|
7
7
|
*/
|
|
8
|
-
import { SORT_STATE_ORIGINAL as
|
|
9
|
-
import { C as p, L as S, D as v, I as
|
|
8
|
+
import { SORT_STATE_ORIGINAL as F, SORT_STATE_ASCEND as U } from "./constants.js";
|
|
9
|
+
import { C as p, L as S, D as v, I as m, _ as f, w as g, x as R, M as b, J as c, N, O as M, K as T, P as j, Q as G, R as k, S as H, T as X, U as q, V as Y, B as I, F as K, H as J, f as h, c as $, b as Q, a as V } from "./datetime-BzdN4htO.js";
|
|
10
10
|
var Z = /* @__PURE__ */ p(function(e, r) {
|
|
11
11
|
if (e === r)
|
|
12
12
|
return r;
|
|
@@ -23,7 +23,7 @@ var Z = /* @__PURE__ */ p(function(e, r) {
|
|
|
23
23
|
var s = S(e), i = n(s, S(r));
|
|
24
24
|
return i !== void 0 && i === s ? e : r;
|
|
25
25
|
}), z = /* @__PURE__ */ p(function(e, r) {
|
|
26
|
-
return v(
|
|
26
|
+
return v(m(e), r);
|
|
27
27
|
}), w = /* @__PURE__ */ f(function(e) {
|
|
28
28
|
return g(e) ? !0 : !e || typeof e != "object" || R(e) ? !1 : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1;
|
|
29
29
|
}), D = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
|
|
@@ -55,7 +55,7 @@ function te(t, e, r) {
|
|
|
55
55
|
return t["@@transducer/result"](e);
|
|
56
56
|
}
|
|
57
57
|
var re = /* @__PURE__ */ p(function(e, r) {
|
|
58
|
-
return
|
|
58
|
+
return b(e.length, function() {
|
|
59
59
|
return e.apply(r, arguments);
|
|
60
60
|
});
|
|
61
61
|
});
|
|
@@ -72,7 +72,7 @@ function ne(t, e, r) {
|
|
|
72
72
|
function ae(t, e, r, n) {
|
|
73
73
|
return t["@@transducer/result"](r[n](re(t["@@transducer/step"], t), e));
|
|
74
74
|
}
|
|
75
|
-
var
|
|
75
|
+
var C = /* @__PURE__ */ ee(te, ae, ne), se = /* @__PURE__ */ function() {
|
|
76
76
|
function t(e) {
|
|
77
77
|
this.f = e;
|
|
78
78
|
}
|
|
@@ -84,17 +84,17 @@ var $ = /* @__PURE__ */ ee(te, ae, ne), se = /* @__PURE__ */ function() {
|
|
|
84
84
|
return this.f(e, r);
|
|
85
85
|
}, t;
|
|
86
86
|
}();
|
|
87
|
-
function
|
|
87
|
+
function E(t) {
|
|
88
88
|
return new se(t);
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
return
|
|
92
|
-
}),
|
|
90
|
+
var P = /* @__PURE__ */ c(function(t, e, r) {
|
|
91
|
+
return C(typeof t == "function" ? E(t) : t, e, r);
|
|
92
|
+
}), O = /* @__PURE__ */ f(function(e) {
|
|
93
93
|
return function() {
|
|
94
94
|
return e;
|
|
95
95
|
};
|
|
96
96
|
}), ue = /* @__PURE__ */ f(function(e) {
|
|
97
|
-
return N(
|
|
97
|
+
return N(P(Z, 0, z("length", e)), function() {
|
|
98
98
|
for (var r = 0, n = e.length; r < n; ) {
|
|
99
99
|
if (e[r].apply(this, arguments))
|
|
100
100
|
return !0;
|
|
@@ -135,8 +135,8 @@ var oe = /* @__PURE__ */ f(function(e) {
|
|
|
135
135
|
function fe(t) {
|
|
136
136
|
return new RegExp(t.source, t.flags ? t.flags : (t.global ? "g" : "") + (t.ignoreCase ? "i" : "") + (t.multiline ? "m" : "") + (t.sticky ? "y" : "") + (t.unicode ? "u" : "") + (t.dotAll ? "s" : ""));
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
if (r || (r = new
|
|
138
|
+
function L(t, e, r) {
|
|
139
|
+
if (r || (r = new he()), me(t))
|
|
140
140
|
return t;
|
|
141
141
|
var n = function(u) {
|
|
142
142
|
var s = r.get(t);
|
|
@@ -147,7 +147,7 @@ function B(t, e, r) {
|
|
|
147
147
|
Object.prototype.hasOwnProperty.call(t, i) && (u[i] = t[i]);
|
|
148
148
|
return u;
|
|
149
149
|
};
|
|
150
|
-
switch (
|
|
150
|
+
switch (j(t)) {
|
|
151
151
|
case "Object":
|
|
152
152
|
return n(Object.create(Object.getPrototypeOf(t)));
|
|
153
153
|
case "Array":
|
|
@@ -172,11 +172,11 @@ function B(t, e, r) {
|
|
|
172
172
|
return t;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function me(t) {
|
|
176
176
|
var e = typeof t;
|
|
177
177
|
return t == null || e != "object" && e != "function";
|
|
178
178
|
}
|
|
179
|
-
var
|
|
179
|
+
var he = /* @__PURE__ */ function() {
|
|
180
180
|
function t() {
|
|
181
181
|
this.map = {}, this.length = 0;
|
|
182
182
|
}
|
|
@@ -227,12 +227,12 @@ var ye = /* @__PURE__ */ c(/* @__PURE__ */ _("slice", function(e, r, n) {
|
|
|
227
227
|
function d() {
|
|
228
228
|
if (arguments.length === 0)
|
|
229
229
|
throw new Error("pipe requires at least one argument");
|
|
230
|
-
return
|
|
230
|
+
return b(arguments[0].length, P(de, arguments[0], ve(arguments)));
|
|
231
231
|
}
|
|
232
232
|
var ge = /* @__PURE__ */ f(function(e) {
|
|
233
233
|
return R(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
|
|
234
234
|
});
|
|
235
|
-
function
|
|
235
|
+
function x() {
|
|
236
236
|
if (arguments.length === 0)
|
|
237
237
|
throw new Error("compose requires at least one argument");
|
|
238
238
|
return d.apply(this, ge(arguments));
|
|
@@ -251,7 +251,7 @@ var Ne = /* @__PURE__ */ function() {
|
|
|
251
251
|
return this.inputs = null, this.xf["@@transducer/result"](e);
|
|
252
252
|
}, t.prototype["@@transducer/step"] = function(e, r) {
|
|
253
253
|
var n = this.keyFn(r);
|
|
254
|
-
return this.inputs[n] = this.inputs[n] || [n,
|
|
254
|
+
return this.inputs[n] = this.inputs[n] || [n, L(this.valueAcc)], this.inputs[n][1] = this.valueFn(this.inputs[n][1], r), e;
|
|
255
255
|
}, t;
|
|
256
256
|
}();
|
|
257
257
|
function Te(t, e, r) {
|
|
@@ -260,21 +260,21 @@ function Te(t, e, r) {
|
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a) {
|
|
263
|
-
var u =
|
|
264
|
-
var o = n(i), l = e(T(o, s) ? s[o] :
|
|
263
|
+
var u = E(function(s, i) {
|
|
264
|
+
var o = n(i), l = e(T(o, s) ? s[o] : L(r), i);
|
|
265
265
|
return l && l["@@transducer/reduced"] ? X(s) : (s[o] = l, s);
|
|
266
266
|
});
|
|
267
|
-
return
|
|
267
|
+
return C(u, {}, a);
|
|
268
268
|
})), Se = /* @__PURE__ */ c(function(e, r, n) {
|
|
269
269
|
var a = e(r), u = e(n);
|
|
270
270
|
return a > u ? -1 : a < u ? 1 : 0;
|
|
271
|
-
}),
|
|
271
|
+
}), Ie = /* @__PURE__ */ p(/* @__PURE__ */ _("groupBy", /* @__PURE__ */ _e(function(t, e) {
|
|
272
272
|
return t.push(e), t;
|
|
273
273
|
}, []))), De = /* @__PURE__ */ c(function(e, r, n) {
|
|
274
274
|
return N(Math.max(e.length, r.length, n.length), function() {
|
|
275
275
|
return e.apply(this, arguments) ? r.apply(this, arguments) : n.apply(this, arguments);
|
|
276
276
|
});
|
|
277
|
-
}),
|
|
277
|
+
}), Oe = /* @__PURE__ */ p(q), Ae = /* @__PURE__ */ p(function(e, r) {
|
|
278
278
|
return function(n) {
|
|
279
279
|
return function(a) {
|
|
280
280
|
return v(function(u) {
|
|
@@ -283,21 +283,21 @@ var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a)
|
|
|
283
283
|
};
|
|
284
284
|
};
|
|
285
285
|
}), Re = /* @__PURE__ */ f(function(e) {
|
|
286
|
-
return
|
|
287
|
-
}),
|
|
286
|
+
return Ae(m(e), pe(e));
|
|
287
|
+
}), B = function(t) {
|
|
288
288
|
return {
|
|
289
289
|
value: t,
|
|
290
290
|
map: function(e) {
|
|
291
|
-
return
|
|
291
|
+
return B(e(t));
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
},
|
|
294
|
+
}, be = /* @__PURE__ */ c(function(e, r, n) {
|
|
295
295
|
return e(function(a) {
|
|
296
|
-
return
|
|
296
|
+
return B(r(a));
|
|
297
297
|
})(n).value;
|
|
298
298
|
}), Me = /* @__PURE__ */ c(function(e, r, n) {
|
|
299
299
|
return n.replace(e, r);
|
|
300
|
-
}),
|
|
300
|
+
}), $e = /* @__PURE__ */ p(function(e, r) {
|
|
301
301
|
return Array.prototype.slice.call(r, 0).sort(e);
|
|
302
302
|
}), W = /* @__PURE__ */ p(function(e, r) {
|
|
303
303
|
return Array.prototype.slice.call(r, 0).sort(function(n, a) {
|
|
@@ -305,8 +305,8 @@ var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a)
|
|
|
305
305
|
u = e[s](n, a), s += 1;
|
|
306
306
|
return u;
|
|
307
307
|
});
|
|
308
|
-
}),
|
|
309
|
-
const
|
|
308
|
+
}), A = /* @__PURE__ */ Y(0, "toLowerCase");
|
|
309
|
+
const Fe = (t, e = "body") => {
|
|
310
310
|
if (!t) return;
|
|
311
311
|
if (typeof e != "string") {
|
|
312
312
|
e == null || e.append(t);
|
|
@@ -315,25 +315,33 @@ const je = (t, e = "body") => {
|
|
|
315
315
|
const r = document.querySelector(e);
|
|
316
316
|
r == null || r.append(t);
|
|
317
317
|
};
|
|
318
|
-
|
|
318
|
+
function Ue(t, e = () => ({})) {
|
|
319
|
+
return t.slice().sort((r, n) => {
|
|
320
|
+
let a = e(r), u = e(n);
|
|
321
|
+
if (a === null || u === null) return 0;
|
|
322
|
+
let s = a.compareDocumentPosition(u);
|
|
323
|
+
return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
class je extends Error {
|
|
319
327
|
constructor(e, r = {}) {
|
|
320
328
|
const { key: n, cause: a } = r;
|
|
321
329
|
super(e), this.name = "WidgetError", this.key = n, this.cause = a;
|
|
322
330
|
}
|
|
323
331
|
}
|
|
324
|
-
const
|
|
332
|
+
const Ge = {
|
|
325
333
|
message: "Undefined Column name Message",
|
|
326
334
|
options: {
|
|
327
335
|
key: "undefined-column",
|
|
328
336
|
cause: {}
|
|
329
337
|
}
|
|
330
|
-
},
|
|
338
|
+
}, ke = {
|
|
331
339
|
message: "Invalid season name",
|
|
332
340
|
options: {
|
|
333
341
|
key: "invalid-season-name",
|
|
334
342
|
cause: {}
|
|
335
343
|
}
|
|
336
|
-
},
|
|
344
|
+
}, He = (t = []) => ({
|
|
337
345
|
result: [...t],
|
|
338
346
|
filteredRowsLength: 0,
|
|
339
347
|
isFiltered: !1,
|
|
@@ -347,17 +355,17 @@ const Ue = {
|
|
|
347
355
|
filter(e, r = [], n = !1) {
|
|
348
356
|
if (e) {
|
|
349
357
|
const a = r.map(
|
|
350
|
-
(i) => n ? d(
|
|
351
|
-
), u = ie((i) => i.name ?
|
|
358
|
+
(i) => n ? d(K(i), I(e)) : d(m(i), A, Oe(A(e)))
|
|
359
|
+
), u = ie((i) => i.name ? be(Re("name"), Me(",", ""), i) : i), s = J(d(u, ue([...a])), this.result);
|
|
352
360
|
this.isFiltered = !0, this.filteredRowsLength = s.length, this.result = s;
|
|
353
361
|
}
|
|
354
362
|
return this;
|
|
355
363
|
},
|
|
356
364
|
sorted(e) {
|
|
357
365
|
if (!e.sortTarget) return this;
|
|
358
|
-
if (e.orders[0].direction ===
|
|
359
|
-
const r = De(
|
|
360
|
-
return this.result = W(e.orders.map((n) =>
|
|
366
|
+
if (e.orders[0].direction === F) return this;
|
|
367
|
+
const r = De(I(U), O(y), O(Se));
|
|
368
|
+
return this.result = W(e.orders.map((n) => x(r(n.direction), m)(n.target)))(this.result), this;
|
|
361
369
|
},
|
|
362
370
|
addIndex(e = null) {
|
|
363
371
|
return this.result.reduce((r, n, a) => {
|
|
@@ -396,20 +404,20 @@ const Ue = {
|
|
|
396
404
|
return this.result = this.result.map((n) => ({
|
|
397
405
|
...n,
|
|
398
406
|
gameResult: `${n.homeTeamScore}-${n.awayTeamScore}`,
|
|
399
|
-
gameDateDate:
|
|
400
|
-
gameDateTime:
|
|
407
|
+
gameDateDate: h(n.gameDate, "L dddd", e, r),
|
|
408
|
+
gameDateTime: h(n.gameDate, "HH:mm", e, r)
|
|
401
409
|
})), this;
|
|
402
410
|
},
|
|
403
411
|
gameDateFilter(e) {
|
|
404
412
|
return e === null ? this : (this.result = this.result.filter((r) => new Date(r.gameDate).getMonth() == e), this);
|
|
405
413
|
},
|
|
406
414
|
convertTimes(e = []) {
|
|
407
|
-
return this.result = this.result.map((r) => (e.map((n) => r[n] ? r[`${n}Sec`] =
|
|
415
|
+
return this.result = this.result.map((r) => (e.map((n) => r[n] ? r[`${n}Sec`] = $(r[n]) : r), r)), this;
|
|
408
416
|
},
|
|
409
417
|
groupByDays() {
|
|
410
|
-
return this.currentItems = this.result.length, this.result =
|
|
418
|
+
return this.currentItems = this.result.length, this.result = Ie((e) => h(e.gameDate, "YYYY-MM-DD"))(this.result), this;
|
|
411
419
|
}
|
|
412
|
-
}),
|
|
420
|
+
}), Xe = (t, ...e) => v(x(...e))(t), qe = (t) => {
|
|
413
421
|
var e, r, n, a;
|
|
414
422
|
return {
|
|
415
423
|
...t,
|
|
@@ -418,9 +426,12 @@ const Ue = {
|
|
|
418
426
|
...((r = t.player) == null ? void 0 : r.id) && { name: `${t.player.lastName} ${t.player.firstName}` },
|
|
419
427
|
...((n = t.player) == null ? void 0 : n.nationality) && {
|
|
420
428
|
name: (a = t.player) != null && a.nationality.includes("hu") ? `${t.player.lastName} ${t.player.firstName}` : `${t.player.lastName}, ${t.player.firstName}`
|
|
429
|
+
},
|
|
430
|
+
...t.nationality && {
|
|
431
|
+
name: t.nationality.includes("hu") ? `${t.lastName} ${t.firstName}` : `${t.lastName}, ${t.firstName}`
|
|
421
432
|
}
|
|
422
433
|
};
|
|
423
|
-
},
|
|
434
|
+
}, Ye = (t) => {
|
|
424
435
|
var e;
|
|
425
436
|
return {
|
|
426
437
|
...t,
|
|
@@ -428,46 +439,46 @@ const Ue = {
|
|
|
428
439
|
};
|
|
429
440
|
}, Ke = (t = "", e = "hu") => (r) => ({
|
|
430
441
|
...r,
|
|
431
|
-
gameDateDate:
|
|
432
|
-
gameDateTime:
|
|
433
|
-
}),
|
|
442
|
+
gameDateDate: h(r.gameDate, "L dddd", t, e),
|
|
443
|
+
gameDateTime: h(r.gameDate, "HH:mm", t, e)
|
|
444
|
+
}), Je = (t) => (e) => ({
|
|
434
445
|
...e,
|
|
435
|
-
gameResult:
|
|
436
|
-
}), Je = (t) => ({
|
|
437
|
-
...t,
|
|
438
|
-
opponent: Ee(t)
|
|
446
|
+
gameResult: Le(e)
|
|
439
447
|
}), Qe = (t) => ({
|
|
440
448
|
...t,
|
|
441
|
-
|
|
449
|
+
opponent: Pe(t)
|
|
442
450
|
}), Ve = (t) => ({
|
|
451
|
+
...t,
|
|
452
|
+
resultType: xe(t)
|
|
453
|
+
}), Ze = (t) => ({
|
|
443
454
|
...t,
|
|
444
455
|
rowClasses: t.optional ? "is-optional" : ""
|
|
445
|
-
}),
|
|
456
|
+
}), ze = (t = []) => (e) => {
|
|
446
457
|
var r;
|
|
447
458
|
return {
|
|
448
459
|
...e,
|
|
449
460
|
[t]: (r = e[t]) == null ? void 0 : r.toUpperCase()
|
|
450
461
|
};
|
|
451
|
-
},
|
|
462
|
+
}, we = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Sec`] = $(e[r]) : e), e), et = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Min`] = Q(e[r]) : e), e), tt = (t = []) => (e) => (t.map((r) => e[`${r}Min`] = V(e[r])), e), rt = (t) => {
|
|
452
463
|
var e, r;
|
|
453
464
|
return {
|
|
454
465
|
...t,
|
|
455
466
|
periodResults: ((r = (e = t.result) == null ? void 0 : e.match(/\(.*?\)/)) == null ? void 0 : r[0]) ?? ""
|
|
456
467
|
};
|
|
457
|
-
},
|
|
458
|
-
function
|
|
468
|
+
}, Ce = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), nt = W([Ce, y(m("id")), y(m("gameId"))]), Ee = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), at = $e(Ee("name"));
|
|
469
|
+
function Pe(t) {
|
|
459
470
|
var e;
|
|
460
471
|
return [t.isHomeGame ? null : "@", (e = t.opponent) == null ? void 0 : e.shortName].join(" ");
|
|
461
472
|
}
|
|
462
|
-
function
|
|
473
|
+
function Le(t, e) {
|
|
463
474
|
let r = t == null ? void 0 : t.homeTeamScore, n = t == null ? void 0 : t.awayTeamScore;
|
|
464
475
|
return t.isHomeGame || (r = t == null ? void 0 : t.awayTeamScore, n = t == null ? void 0 : t.homeTeamScore), [r, n].join(":");
|
|
465
476
|
}
|
|
466
|
-
function
|
|
477
|
+
function xe(t) {
|
|
467
478
|
const e = t.gameResult.split(":"), r = e[0] > e[1], n = e[0] < e[1];
|
|
468
479
|
return r && t.isOvertime ? "OTW" : r && t.isShootout ? "SOW" : r ? "W" : n && t.isOvertime ? "OTL" : n && t.isShootout ? "SOL" : n ? "L" : "D";
|
|
469
480
|
}
|
|
470
|
-
const
|
|
481
|
+
const st = (t) => t.map((e) => {
|
|
471
482
|
var r, n;
|
|
472
483
|
return {
|
|
473
484
|
phaseId: e.phaseId,
|
|
@@ -481,25 +492,26 @@ const at = (t) => t.map((e) => {
|
|
|
481
492
|
};
|
|
482
493
|
});
|
|
483
494
|
export {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
495
|
+
ke as I,
|
|
496
|
+
Ge as U,
|
|
497
|
+
je as W,
|
|
498
|
+
Je as a,
|
|
499
|
+
Qe as b,
|
|
500
|
+
He as c,
|
|
501
|
+
Ve as d,
|
|
502
|
+
we as e,
|
|
503
|
+
et as f,
|
|
493
504
|
Ke as g,
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
+
tt as h,
|
|
506
|
+
rt as i,
|
|
507
|
+
nt as j,
|
|
508
|
+
st as k,
|
|
509
|
+
at as l,
|
|
510
|
+
Fe as m,
|
|
511
|
+
Ue as n,
|
|
512
|
+
qe as p,
|
|
513
|
+
Xe as r,
|
|
514
|
+
Ze as s,
|
|
515
|
+
Ye as t,
|
|
516
|
+
ze as u
|
|
505
517
|
};
|