@roudanio/maze 0.0.3 → 0.0.5
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/maze.css +1 -1
- package/dist/maze.iife.js +9 -9
- package/dist/maze.js +904 -688
- package/dist/maze.umd.js +9 -9
- package/package.json +6 -5
package/dist/maze.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
1
|
+
var ne, y, qe, O, we, Xe, Ye, Je, de, ae, ce, Ke, B = {}, Ze = [], St = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, X = Array.isArray;
|
|
2
|
+
function I(e, t) {
|
|
3
3
|
for (var o in t) e[o] = t[o];
|
|
4
4
|
return e;
|
|
5
5
|
}
|
|
@@ -7,100 +7,99 @@ function he(e) {
|
|
|
7
7
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
8
8
|
}
|
|
9
9
|
function D(e, t, o) {
|
|
10
|
-
var n,
|
|
11
|
-
for (
|
|
12
|
-
if (arguments.length > 2 && (s.children = arguments.length > 3 ?
|
|
13
|
-
return
|
|
10
|
+
var n, i, r, s = {};
|
|
11
|
+
for (r in t) r == "key" ? n = t[r] : r == "ref" ? i = t[r] : s[r] = t[r];
|
|
12
|
+
if (arguments.length > 2 && (s.children = arguments.length > 3 ? ne.call(arguments, 2) : o), typeof e == "function" && e.defaultProps != null) for (r in e.defaultProps) s[r] == null && (s[r] = e.defaultProps[r]);
|
|
13
|
+
return Z(e, s, n, i, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
return
|
|
15
|
+
function Z(e, t, o, n, i) {
|
|
16
|
+
var r = { type: e, props: t, key: o, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++qe, __i: -1, __u: 0 };
|
|
17
|
+
return i == null && y.vnode != null && y.vnode(r), r;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function W(e) {
|
|
20
20
|
return e.children;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function R(e, t) {
|
|
23
23
|
this.props = e, this.context = t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (t == null) return e.__ ?
|
|
25
|
+
function j(e, t) {
|
|
26
|
+
if (t == null) return e.__ ? j(e.__, e.__i + 1) : null;
|
|
27
27
|
for (var o; t < e.__k.length; t++) if ((o = e.__k[t]) != null && o.__e != null) return o.__e;
|
|
28
|
-
return typeof e.type == "function" ?
|
|
28
|
+
return typeof e.type == "function" ? j(e) : null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Qe(e) {
|
|
31
31
|
var t, o;
|
|
32
32
|
if ((e = e.__) != null && e.__c != null) {
|
|
33
33
|
for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((o = e.__k[t]) != null && o.__e != null) {
|
|
34
34
|
e.__e = e.__c.base = o.__e;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return Qe(e);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
(!e.__d && (e.__d = !0) &&
|
|
42
|
-
}
|
|
43
|
-
function
|
|
44
|
-
var e, t, o, n, r, i, s,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (_) for (i = 0; i < u; i++) (l = o[i]) != null && !(2 & l.__u) && (l.__e == n && (n = O(l)), Ye(l, l));
|
|
40
|
+
function ue(e) {
|
|
41
|
+
(!e.__d && (e.__d = !0) && O.push(e) && !te.__r++ || we != y.debounceRendering) && ((we = y.debounceRendering) || Xe)(te);
|
|
42
|
+
}
|
|
43
|
+
function te() {
|
|
44
|
+
for (var e, t, o, n, i, r, s, l = 1; O.length; ) O.length > l && O.sort(Ye), e = O.shift(), l = O.length, e.__d && (o = void 0, i = (n = (t = e).__v).__e, r = [], s = [], t.__P && ((o = I({}, n)).__v = n.__v + 1, y.vnode && y.vnode(o), fe(t.__P, o, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [i] : null, r, i ?? j(n), !!(32 & n.__u), s), o.__v = n.__v, o.__.__k[o.__i] = o, ot(r, o, s), o.__e != i && Qe(o)));
|
|
45
|
+
te.__r = 0;
|
|
46
|
+
}
|
|
47
|
+
function et(e, t, o, n, i, r, s, l, a, c, _) {
|
|
48
|
+
var u, h, d, v, m, C, g = n && n.__k || Ze, p = t.length;
|
|
49
|
+
for (a = Lt(o, t, g, a, p), u = 0; u < p; u++) (d = o.__k[u]) != null && (h = d.__i == -1 ? B : g[d.__i] || B, d.__i = u, C = fe(e, d, h, i, r, s, l, a, c, _), v = d.__e, d.ref && h.ref != d.ref && (h.ref && me(h.ref, null, d), _.push(d.ref, d.__c || v, d)), m == null && v != null && (m = v), 4 & d.__u || h.__k === d.__k ? a = tt(d, a, e) : typeof d.type == "function" && C !== void 0 ? a = C : v && (a = v.nextSibling), d.__u &= -7);
|
|
50
|
+
return o.__e = m, a;
|
|
51
|
+
}
|
|
52
|
+
function Lt(e, t, o, n, i) {
|
|
53
|
+
var r, s, l, a, c, _ = o.length, u = _, h = 0;
|
|
54
|
+
for (e.__k = new Array(i), r = 0; r < i; r++) (s = t[r]) != null && typeof s != "boolean" && typeof s != "function" ? (a = r + h, (s = e.__k[r] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? Z(null, s, null, null, null) : X(s) ? Z(W, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? Z(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = e, s.__b = e.__b + 1, l = null, (c = s.__i = xt(s, o, a, u)) != -1 && (u--, (l = o[c]) && (l.__u |= 2)), l == null || l.__v == null ? (c == -1 && (i > _ ? h-- : i < _ && h++), typeof s.type != "function" && (s.__u |= 4)) : c != a && (c == a - 1 ? h-- : c == a + 1 ? h++ : (c > a ? h-- : h++, s.__u |= 4))) : e.__k[r] = null;
|
|
55
|
+
if (u) for (r = 0; r < _; r++) (l = o[r]) != null && (2 & l.__u) == 0 && (l.__e == n && (n = j(l)), it(l, l));
|
|
57
56
|
return n;
|
|
58
57
|
}
|
|
59
|
-
function
|
|
60
|
-
var n,
|
|
58
|
+
function tt(e, t, o) {
|
|
59
|
+
var n, i;
|
|
61
60
|
if (typeof e.type == "function") {
|
|
62
|
-
for (n = e.__k,
|
|
61
|
+
for (n = e.__k, i = 0; n && i < n.length; i++) n[i] && (n[i].__ = e, t = tt(n[i], t, o));
|
|
63
62
|
return t;
|
|
64
63
|
}
|
|
65
|
-
e.__e != t && (t && e.type && !o.contains(t) && (t =
|
|
64
|
+
e.__e != t && (t && e.type && !o.contains(t) && (t = j(e)), o.insertBefore(e.__e, t || null), t = e.__e);
|
|
66
65
|
do
|
|
67
66
|
t = t && t.nextSibling;
|
|
68
67
|
while (t != null && t.nodeType == 8);
|
|
69
68
|
return t;
|
|
70
69
|
}
|
|
71
|
-
function
|
|
72
|
-
return t = t || [], e == null || typeof e == "boolean" || (
|
|
73
|
-
|
|
70
|
+
function oe(e, t) {
|
|
71
|
+
return t = t || [], e == null || typeof e == "boolean" || (X(e) ? e.some(function(o) {
|
|
72
|
+
oe(o, t);
|
|
74
73
|
}) : t.push(e)), t;
|
|
75
74
|
}
|
|
76
|
-
function
|
|
77
|
-
var
|
|
78
|
-
if (a === null || a && s == a.key && l
|
|
79
|
-
if (n > (a != null &&
|
|
80
|
-
if (
|
|
81
|
-
if ((a = t[
|
|
82
|
-
|
|
75
|
+
function xt(e, t, o, n) {
|
|
76
|
+
var i, r, s = e.key, l = e.type, a = t[o];
|
|
77
|
+
if (a === null && e.key == null || a && s == a.key && l == a.type && (2 & a.__u) == 0) return o;
|
|
78
|
+
if (n > (a != null && (2 & a.__u) == 0 ? 1 : 0)) for (i = o - 1, r = o + 1; i >= 0 || r < t.length; ) {
|
|
79
|
+
if (i >= 0) {
|
|
80
|
+
if ((a = t[i]) && (2 & a.__u) == 0 && s == a.key && l == a.type) return i;
|
|
81
|
+
i--;
|
|
83
82
|
}
|
|
84
|
-
if (
|
|
85
|
-
if ((a = t[
|
|
86
|
-
|
|
83
|
+
if (r < t.length) {
|
|
84
|
+
if ((a = t[r]) && (2 & a.__u) == 0 && s == a.key && l == a.type) return r;
|
|
85
|
+
r++;
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
return -1;
|
|
90
89
|
}
|
|
91
|
-
function
|
|
92
|
-
t[0] == "-" ? e.setProperty(t, o ?? "") : e[t] = o == null ? "" : typeof o != "number" ||
|
|
90
|
+
function be(e, t, o) {
|
|
91
|
+
t[0] == "-" ? e.setProperty(t, o ?? "") : e[t] = o == null ? "" : typeof o != "number" || St.test(t) ? o : o + "px";
|
|
93
92
|
}
|
|
94
|
-
function
|
|
95
|
-
var
|
|
93
|
+
function J(e, t, o, n, i) {
|
|
94
|
+
var r;
|
|
96
95
|
e: if (t == "style") if (typeof o == "string") e.style.cssText = o;
|
|
97
96
|
else {
|
|
98
|
-
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) o && t in o ||
|
|
99
|
-
if (o) for (t in o) n && o[t]
|
|
97
|
+
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) o && t in o || be(e.style, t, "");
|
|
98
|
+
if (o) for (t in o) n && o[t] == n[t] || be(e.style, t, o[t]);
|
|
100
99
|
}
|
|
101
|
-
else if (t[0] == "o" && t[1] == "n")
|
|
100
|
+
else if (t[0] == "o" && t[1] == "n") r = t != (t = t.replace(Je, "$1")), t = t.toLowerCase() in e || t == "onFocusOut" || t == "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + r] = o, o ? n ? o.u = n.u : (o.u = de, e.addEventListener(t, r ? ce : ae, r)) : e.removeEventListener(t, r ? ce : ae, r);
|
|
102
101
|
else {
|
|
103
|
-
if (
|
|
102
|
+
if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
104
103
|
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
105
104
|
e[t] = o ?? "";
|
|
106
105
|
break e;
|
|
@@ -109,90 +108,93 @@ function K(e, t, o, n, r) {
|
|
|
109
108
|
typeof o == "function" || (o == null || o === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && o == 1 ? "" : o));
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
|
-
function
|
|
111
|
+
function ke(e) {
|
|
113
112
|
return function(t) {
|
|
114
113
|
if (this.l) {
|
|
115
114
|
var o = this.l[t.type + e];
|
|
116
115
|
if (t.t == null) t.t = de++;
|
|
117
116
|
else if (t.t < o.u) return;
|
|
118
|
-
return o(
|
|
117
|
+
return o(y.event ? y.event(t) : t);
|
|
119
118
|
}
|
|
120
119
|
};
|
|
121
120
|
}
|
|
122
|
-
function fe(e, t, o, n,
|
|
123
|
-
var
|
|
124
|
-
if (t.constructor
|
|
125
|
-
128 & o.__u && (a = !!(32 & o.__u),
|
|
126
|
-
e: if (typeof
|
|
127
|
-
if (
|
|
121
|
+
function fe(e, t, o, n, i, r, s, l, a, c) {
|
|
122
|
+
var _, u, h, d, v, m, C, g, p, T, k, E, P, F, M, N, S, z = t.type;
|
|
123
|
+
if (t.constructor != null) return null;
|
|
124
|
+
128 & o.__u && (a = !!(32 & o.__u), r = [l = t.__e = o.__e]), (_ = y.__b) && _(t);
|
|
125
|
+
e: if (typeof z == "function") try {
|
|
126
|
+
if (g = t.props, p = "prototype" in z && z.prototype.render, T = (_ = z.contextType) && n[_.__c], k = _ ? T ? T.props.value : _.__ : n, o.__c ? C = (u = t.__c = o.__c).__ = u.__E : (p ? t.__c = u = new z(g, k) : (t.__c = u = new R(g, k), u.constructor = z, u.render = Et), T && T.sub(u), u.props = g, u.state || (u.state = {}), u.context = k, u.__n = n, h = u.__d = !0, u.__h = [], u._sb = []), p && u.__s == null && (u.__s = u.state), p && z.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = I({}, u.__s)), I(u.__s, z.getDerivedStateFromProps(g, u.__s))), d = u.props, v = u.state, u.__v = t, h) p && z.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), p && u.componentDidMount != null && u.__h.push(u.componentDidMount);
|
|
128
127
|
else {
|
|
129
|
-
if (p &&
|
|
130
|
-
for (t.__v != o.__v && (
|
|
131
|
-
|
|
132
|
-
}),
|
|
133
|
-
|
|
128
|
+
if (p && z.getDerivedStateFromProps == null && g !== d && u.componentWillReceiveProps != null && u.componentWillReceiveProps(g, k), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(g, u.__s, k) === !1 || t.__v == o.__v) {
|
|
129
|
+
for (t.__v != o.__v && (u.props = g, u.state = u.__s, u.__d = !1), t.__e = o.__e, t.__k = o.__k, t.__k.some(function(U) {
|
|
130
|
+
U && (U.__ = t);
|
|
131
|
+
}), E = 0; E < u._sb.length; E++) u.__h.push(u._sb[E]);
|
|
132
|
+
u._sb = [], u.__h.length && s.push(u);
|
|
134
133
|
break e;
|
|
135
134
|
}
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
u.componentWillUpdate != null && u.componentWillUpdate(g, u.__s, k), p && u.componentDidUpdate != null && u.__h.push(function() {
|
|
136
|
+
u.componentDidUpdate(d, v, m);
|
|
138
137
|
});
|
|
139
138
|
}
|
|
140
|
-
if (
|
|
141
|
-
for (
|
|
142
|
-
|
|
139
|
+
if (u.context = k, u.props = g, u.__P = e, u.__e = !1, P = y.__r, F = 0, p) {
|
|
140
|
+
for (u.state = u.__s, u.__d = !1, P && P(t), _ = u.render(u.props, u.state, u.context), M = 0; M < u._sb.length; M++) u.__h.push(u._sb[M]);
|
|
141
|
+
u._sb = [];
|
|
143
142
|
} else do
|
|
144
|
-
|
|
145
|
-
while (
|
|
146
|
-
|
|
147
|
-
} catch (
|
|
148
|
-
if (t.__v = null, a ||
|
|
143
|
+
u.__d = !1, P && P(t), _ = u.render(u.props, u.state, u.context), u.state = u.__s;
|
|
144
|
+
while (u.__d && ++F < 25);
|
|
145
|
+
u.state = u.__s, u.getChildContext != null && (n = I(I({}, n), u.getChildContext())), p && !h && u.getSnapshotBeforeUpdate != null && (m = u.getSnapshotBeforeUpdate(d, v)), N = _, _ != null && _.type === W && _.key == null && (N = nt(_.props.children)), l = et(e, X(N) ? N : [N], t, o, n, i, r, s, l, a, c), u.base = t.__e, t.__u &= -161, u.__h.length && s.push(u), C && (u.__E = u.__ = null);
|
|
146
|
+
} catch (U) {
|
|
147
|
+
if (t.__v = null, a || r != null) if (U.then) {
|
|
149
148
|
for (t.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
150
|
-
|
|
151
|
-
} else for (
|
|
149
|
+
r[r.indexOf(l)] = null, t.__e = l;
|
|
150
|
+
} else for (S = r.length; S--; ) he(r[S]);
|
|
152
151
|
else t.__e = o.__e, t.__k = o.__k;
|
|
153
|
-
|
|
152
|
+
y.__e(U, t, o);
|
|
154
153
|
}
|
|
155
|
-
else
|
|
156
|
-
return (
|
|
154
|
+
else r == null && t.__v == o.__v ? (t.__k = o.__k, t.__e = o.__e) : l = t.__e = At(o.__e, t, o, n, i, r, s, a, c);
|
|
155
|
+
return (_ = y.diffed) && _(t), 128 & t.__u ? void 0 : l;
|
|
157
156
|
}
|
|
158
|
-
function
|
|
157
|
+
function ot(e, t, o) {
|
|
159
158
|
for (var n = 0; n < o.length; n++) me(o[n], o[++n], o[++n]);
|
|
160
|
-
|
|
159
|
+
y.__c && y.__c(t, e), e.some(function(i) {
|
|
161
160
|
try {
|
|
162
|
-
e =
|
|
163
|
-
|
|
161
|
+
e = i.__h, i.__h = [], e.some(function(r) {
|
|
162
|
+
r.call(i);
|
|
164
163
|
});
|
|
165
|
-
} catch (
|
|
166
|
-
|
|
164
|
+
} catch (r) {
|
|
165
|
+
y.__e(r, i.__v);
|
|
167
166
|
}
|
|
168
167
|
});
|
|
169
168
|
}
|
|
170
|
-
function
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
function nt(e) {
|
|
170
|
+
return typeof e != "object" || e == null || e.__b && e.__b > 0 ? e : X(e) ? e.map(nt) : I({}, e);
|
|
171
|
+
}
|
|
172
|
+
function At(e, t, o, n, i, r, s, l, a) {
|
|
173
|
+
var c, _, u, h, d, v, m, C = o.props, g = t.props, p = t.type;
|
|
174
|
+
if (p == "svg" ? i = "http://www.w3.org/2000/svg" : p == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), r != null) {
|
|
175
|
+
for (c = 0; c < r.length; c++) if ((d = r[c]) && "setAttribute" in d == !!p && (p ? d.localName == p : d.nodeType == 3)) {
|
|
176
|
+
e = d, r[c] = null;
|
|
175
177
|
break;
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
if (e == null) {
|
|
179
|
-
if (p == null) return document.createTextNode(
|
|
180
|
-
e = document.createElementNS(
|
|
181
|
+
if (p == null) return document.createTextNode(g);
|
|
182
|
+
e = document.createElementNS(i, p, g.is && g), l && (y.__m && y.__m(t, r), l = !1), r = null;
|
|
181
183
|
}
|
|
182
|
-
if (p
|
|
184
|
+
if (p == null) C === g || l && e.data == g || (e.data = g);
|
|
183
185
|
else {
|
|
184
|
-
if (
|
|
185
|
-
for (c in
|
|
186
|
-
if (c == "dangerouslySetInnerHTML")
|
|
187
|
-
else if (!(c in
|
|
188
|
-
if (c == "value" && "defaultValue" in
|
|
189
|
-
|
|
186
|
+
if (r = r && ne.call(e.childNodes), C = o.props || B, !l && r != null) for (C = {}, c = 0; c < e.attributes.length; c++) C[(d = e.attributes[c]).name] = d.value;
|
|
187
|
+
for (c in C) if (d = C[c], c != "children") {
|
|
188
|
+
if (c == "dangerouslySetInnerHTML") u = d;
|
|
189
|
+
else if (!(c in g)) {
|
|
190
|
+
if (c == "value" && "defaultValue" in g || c == "checked" && "defaultChecked" in g) continue;
|
|
191
|
+
J(e, c, null, d, i);
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
|
-
for (c in
|
|
193
|
-
if (
|
|
194
|
-
else if (
|
|
195
|
-
l || (c = "value", p == "progress" &&
|
|
194
|
+
for (c in g) d = g[c], c == "children" ? h = d : c == "dangerouslySetInnerHTML" ? _ = d : c == "value" ? v = d : c == "checked" ? m = d : l && typeof d != "function" || C[c] === d || J(e, c, d, C[c], i);
|
|
195
|
+
if (_) l || u && (_.__html == u.__html || _.__html == e.innerHTML) || (e.innerHTML = _.__html), t.__k = [];
|
|
196
|
+
else if (u && (e.innerHTML = ""), et(t.type == "template" ? e.content : e, X(h) ? h : [h], t, o, n, p == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, r, s, r ? r[0] : o.__k && j(o, 0), l, a), r != null) for (c = r.length; c--; ) he(r[c]);
|
|
197
|
+
l || (c = "value", p == "progress" && v == null ? e.removeAttribute("value") : v != null && (v !== e[c] || p == "progress" && !v || p == "option" && v != C[c]) && J(e, c, v, C[c], i), c = "checked", m != null && m != e[c] && J(e, c, m, C[c], i));
|
|
196
198
|
}
|
|
197
199
|
return e;
|
|
198
200
|
}
|
|
@@ -202,212 +204,212 @@ function me(e, t, o) {
|
|
|
202
204
|
var n = typeof e.__u == "function";
|
|
203
205
|
n && e.__u(), n && t == null || (e.__u = e(t));
|
|
204
206
|
} else e.current = t;
|
|
205
|
-
} catch (
|
|
206
|
-
|
|
207
|
+
} catch (i) {
|
|
208
|
+
y.__e(i, o);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
|
-
function
|
|
210
|
-
var n,
|
|
211
|
-
if (
|
|
211
|
+
function it(e, t, o) {
|
|
212
|
+
var n, i;
|
|
213
|
+
if (y.unmount && y.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || me(n, null, t)), (n = e.__c) != null) {
|
|
212
214
|
if (n.componentWillUnmount) try {
|
|
213
215
|
n.componentWillUnmount();
|
|
214
|
-
} catch (
|
|
215
|
-
|
|
216
|
+
} catch (r) {
|
|
217
|
+
y.__e(r, t);
|
|
216
218
|
}
|
|
217
219
|
n.base = n.__P = null;
|
|
218
220
|
}
|
|
219
|
-
if (n = e.__k) for (
|
|
221
|
+
if (n = e.__k) for (i = 0; i < n.length; i++) n[i] && it(n[i], t, o || typeof e.type != "function");
|
|
220
222
|
o || he(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
221
223
|
}
|
|
222
|
-
function
|
|
224
|
+
function Et(e, t, o) {
|
|
223
225
|
return this.constructor(e, o);
|
|
224
226
|
}
|
|
225
|
-
function
|
|
226
|
-
var n,
|
|
227
|
-
t == document && (t = document.documentElement),
|
|
227
|
+
function Mt(e, t, o) {
|
|
228
|
+
var n, i, r, s;
|
|
229
|
+
t == document && (t = document.documentElement), y.__ && y.__(e, t), i = (n = !1) ? null : t.__k, r = [], s = [], fe(t, e = t.__k = D(W, null, [e]), i || B, B, t.namespaceURI, i ? null : t.firstChild ? ne.call(t.childNodes) : null, r, i ? i.__e : t.firstChild, n, s), ot(r, e, s);
|
|
228
230
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
var r, i;
|
|
234
|
-
return this.getChildContext || (r = /* @__PURE__ */ new Set(), (i = {})[t] = this, this.getChildContext = function() {
|
|
231
|
+
function rt(e) {
|
|
232
|
+
function t(o) {
|
|
233
|
+
var n, i;
|
|
234
|
+
return this.getChildContext || (n = /* @__PURE__ */ new Set(), (i = {})[t.__c] = this, this.getChildContext = function() {
|
|
235
235
|
return i;
|
|
236
236
|
}, this.componentWillUnmount = function() {
|
|
237
|
-
|
|
238
|
-
}, this.shouldComponentUpdate = function(
|
|
239
|
-
this.props.value
|
|
240
|
-
|
|
237
|
+
n = null;
|
|
238
|
+
}, this.shouldComponentUpdate = function(r) {
|
|
239
|
+
this.props.value != r.value && n.forEach(function(s) {
|
|
240
|
+
s.__e = !0, ue(s);
|
|
241
241
|
});
|
|
242
|
-
}, this.sub = function(
|
|
243
|
-
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
}, this.sub = function(r) {
|
|
243
|
+
n.add(r);
|
|
244
|
+
var s = r.componentWillUnmount;
|
|
245
|
+
r.componentWillUnmount = function() {
|
|
246
|
+
n && n.delete(r), s && s.call(r);
|
|
247
247
|
};
|
|
248
|
-
}),
|
|
249
|
-
}
|
|
250
|
-
return
|
|
248
|
+
}), o.children;
|
|
249
|
+
}
|
|
250
|
+
return t.__c = "__cC" + Ke++, t.__ = e, t.Provider = t.__l = (t.Consumer = function(o, n) {
|
|
251
|
+
return o.children(n);
|
|
252
|
+
}).contextType = t, t;
|
|
251
253
|
}
|
|
252
|
-
|
|
253
|
-
for (var
|
|
254
|
-
if ((
|
|
254
|
+
ne = Ze.slice, y = { __e: function(e, t, o, n) {
|
|
255
|
+
for (var i, r, s; t = t.__; ) if ((i = t.__c) && !i.__) try {
|
|
256
|
+
if ((r = i.constructor) && r.getDerivedStateFromError != null && (i.setState(r.getDerivedStateFromError(e)), s = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, n || {}), s = i.__d), s) return i.__E = i;
|
|
255
257
|
} catch (l) {
|
|
256
258
|
e = l;
|
|
257
259
|
}
|
|
258
260
|
throw e;
|
|
259
|
-
} },
|
|
261
|
+
} }, qe = 0, R.prototype.setState = function(e, t) {
|
|
260
262
|
var o;
|
|
261
|
-
o = this.__s != null && this.__s
|
|
262
|
-
},
|
|
263
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
264
|
-
},
|
|
263
|
+
o = this.__s != null && this.__s != this.state ? this.__s : this.__s = I({}, this.state), typeof e == "function" && (e = e(I({}, o), this.props)), e && I(o, e), e != null && this.__v && (t && this._sb.push(t), ue(this));
|
|
264
|
+
}, R.prototype.forceUpdate = function(e) {
|
|
265
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));
|
|
266
|
+
}, R.prototype.render = W, O = [], Xe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ye = function(e, t) {
|
|
265
267
|
return e.__v.__b - t.__v.__b;
|
|
266
|
-
},
|
|
267
|
-
var
|
|
268
|
-
function f(e, t, o, n,
|
|
268
|
+
}, te.__r = 0, Je = /(PointerCapture)$|Capture$/i, de = 0, ae = ke(!1), ce = ke(!0), Ke = 0;
|
|
269
|
+
var It = 0;
|
|
270
|
+
function f(e, t, o, n, i, r) {
|
|
269
271
|
t || (t = {});
|
|
270
272
|
var s, l, a = t;
|
|
271
273
|
if ("ref" in a) for (l in a = {}, t) l == "ref" ? s = t[l] : a[l] = t[l];
|
|
272
|
-
var c = { type: e, props: a, key: o, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
274
|
+
var c = { type: e, props: a, key: o, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --It, __i: -1, __u: 0, __source: i, __self: r };
|
|
273
275
|
if (typeof e == "function" && (s = e.defaultProps)) for (l in s) a[l] === void 0 && (a[l] = s[l]);
|
|
274
|
-
return
|
|
276
|
+
return y.vnode && y.vnode(c), c;
|
|
275
277
|
}
|
|
276
|
-
var
|
|
277
|
-
function
|
|
278
|
-
|
|
279
|
-
var o =
|
|
278
|
+
var H, w, re, Te, V = 0, st = [], b = y, ze = b.__b, Pe = b.__r, Ne = b.diffed, Se = b.__c, Le = b.unmount, xe = b.__;
|
|
279
|
+
function ie(e, t) {
|
|
280
|
+
b.__h && b.__h(w, e, V || t), V = 0;
|
|
281
|
+
var o = w.__H || (w.__H = { __: [], __h: [] });
|
|
280
282
|
return e >= o.__.length && o.__.push({}), o.__[e];
|
|
281
283
|
}
|
|
282
|
-
function
|
|
283
|
-
return
|
|
284
|
+
function $(e) {
|
|
285
|
+
return V = 1, $t(ct, e);
|
|
284
286
|
}
|
|
285
|
-
function
|
|
286
|
-
var n =
|
|
287
|
-
if (n.t = e, !n.__c && (n.__ = [o ? o(t) :
|
|
287
|
+
function $t(e, t, o) {
|
|
288
|
+
var n = ie(H++, 2);
|
|
289
|
+
if (n.t = e, !n.__c && (n.__ = [o ? o(t) : ct(void 0, t), function(l) {
|
|
288
290
|
var a = n.__N ? n.__N[0] : n.__[0], c = n.t(a, l);
|
|
289
291
|
a !== c && (n.__N = [c, n.__[1]], n.__c.setState({}));
|
|
290
|
-
}], n.__c =
|
|
291
|
-
var
|
|
292
|
+
}], n.__c = w, !w.__f)) {
|
|
293
|
+
var i = function(l, a, c) {
|
|
292
294
|
if (!n.__c.__H) return !0;
|
|
293
|
-
var
|
|
295
|
+
var _ = n.__c.__H.__.filter(function(h) {
|
|
294
296
|
return !!h.__c;
|
|
295
297
|
});
|
|
296
|
-
if (
|
|
298
|
+
if (_.every(function(h) {
|
|
297
299
|
return !h.__N;
|
|
298
|
-
})) return !
|
|
299
|
-
var
|
|
300
|
-
return
|
|
300
|
+
})) return !r || r.call(this, l, a, c);
|
|
301
|
+
var u = n.__c.props !== l;
|
|
302
|
+
return _.forEach(function(h) {
|
|
301
303
|
if (h.__N) {
|
|
302
304
|
var d = h.__[0];
|
|
303
|
-
h.__ = h.__N, h.__N = void 0, d !== h.__[0] && (
|
|
305
|
+
h.__ = h.__N, h.__N = void 0, d !== h.__[0] && (u = !0);
|
|
304
306
|
}
|
|
305
|
-
}),
|
|
307
|
+
}), r && r.call(this, l, a, c) || u;
|
|
306
308
|
};
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
|
|
309
|
+
w.__f = !0;
|
|
310
|
+
var r = w.shouldComponentUpdate, s = w.componentWillUpdate;
|
|
311
|
+
w.componentWillUpdate = function(l, a, c) {
|
|
310
312
|
if (this.__e) {
|
|
311
|
-
var
|
|
312
|
-
|
|
313
|
+
var _ = r;
|
|
314
|
+
r = void 0, i(l, a, c), r = _;
|
|
313
315
|
}
|
|
314
316
|
s && s.call(this, l, a, c);
|
|
315
|
-
},
|
|
317
|
+
}, w.shouldComponentUpdate = i;
|
|
316
318
|
}
|
|
317
319
|
return n.__N || n.__;
|
|
318
320
|
}
|
|
319
|
-
function
|
|
320
|
-
var o =
|
|
321
|
-
!
|
|
321
|
+
function A(e, t) {
|
|
322
|
+
var o = ie(H++, 3);
|
|
323
|
+
!b.__s && at(o.__H, t) && (o.__ = e, o.u = t, w.__H.__h.push(o));
|
|
322
324
|
}
|
|
323
|
-
function
|
|
324
|
-
return
|
|
325
|
+
function G(e) {
|
|
326
|
+
return V = 5, ve(function() {
|
|
325
327
|
return { current: e };
|
|
326
328
|
}, []);
|
|
327
329
|
}
|
|
328
|
-
function
|
|
329
|
-
var o =
|
|
330
|
-
return
|
|
330
|
+
function ve(e, t) {
|
|
331
|
+
var o = ie(H++, 7);
|
|
332
|
+
return at(o.__H, t) && (o.__ = e(), o.__H = t, o.__h = e), o.__;
|
|
331
333
|
}
|
|
332
|
-
function
|
|
333
|
-
return
|
|
334
|
+
function Ae(e, t) {
|
|
335
|
+
return V = 8, ve(function() {
|
|
334
336
|
return e;
|
|
335
337
|
}, t);
|
|
336
338
|
}
|
|
337
|
-
function
|
|
338
|
-
var t =
|
|
339
|
-
return o.c = e, t ? (o.__ == null && (o.__ = !0, t.sub(
|
|
339
|
+
function lt(e) {
|
|
340
|
+
var t = w.context[e.__c], o = ie(H++, 9);
|
|
341
|
+
return o.c = e, t ? (o.__ == null && (o.__ = !0, t.sub(w)), t.props.value) : e.__;
|
|
340
342
|
}
|
|
341
|
-
function
|
|
342
|
-
for (var e; e =
|
|
343
|
-
e.__H.__h.forEach(
|
|
343
|
+
function Rt() {
|
|
344
|
+
for (var e; e = st.shift(); ) if (e.__P && e.__H) try {
|
|
345
|
+
e.__H.__h.forEach(Q), e.__H.__h.forEach(_e), e.__H.__h = [];
|
|
344
346
|
} catch (t) {
|
|
345
|
-
e.__H.__h = [],
|
|
347
|
+
e.__H.__h = [], b.__e(t, e.__v);
|
|
346
348
|
}
|
|
347
349
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
},
|
|
350
|
+
b.__b = function(e) {
|
|
351
|
+
w = null, ze && ze(e);
|
|
352
|
+
}, b.__ = function(e, t) {
|
|
351
353
|
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), xe && xe(e, t);
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
var t = (
|
|
355
|
-
t && (
|
|
356
|
-
o.__N && (o.__ = o.__N), o.
|
|
357
|
-
})) : (t.__h.forEach(
|
|
358
|
-
},
|
|
359
|
-
|
|
354
|
+
}, b.__r = function(e) {
|
|
355
|
+
Pe && Pe(e), H = 0;
|
|
356
|
+
var t = (w = e.__c).__H;
|
|
357
|
+
t && (re === w ? (t.__h = [], w.__h = [], t.__.forEach(function(o) {
|
|
358
|
+
o.__N && (o.__ = o.__N), o.u = o.__N = void 0;
|
|
359
|
+
})) : (t.__h.forEach(Q), t.__h.forEach(_e), t.__h = [], H = 0)), re = w;
|
|
360
|
+
}, b.diffed = function(e) {
|
|
361
|
+
Ne && Ne(e);
|
|
360
362
|
var t = e.__c;
|
|
361
|
-
t && t.__H && (t.__H.__h.length && (
|
|
362
|
-
o.
|
|
363
|
-
})),
|
|
364
|
-
},
|
|
363
|
+
t && t.__H && (t.__H.__h.length && (st.push(t) !== 1 && Te === b.requestAnimationFrame || ((Te = b.requestAnimationFrame) || Ft)(Rt)), t.__H.__.forEach(function(o) {
|
|
364
|
+
o.u && (o.__H = o.u), o.u = void 0;
|
|
365
|
+
})), re = w = null;
|
|
366
|
+
}, b.__c = function(e, t) {
|
|
365
367
|
t.some(function(o) {
|
|
366
368
|
try {
|
|
367
|
-
o.__h.forEach(
|
|
368
|
-
return !n.__ ||
|
|
369
|
+
o.__h.forEach(Q), o.__h = o.__h.filter(function(n) {
|
|
370
|
+
return !n.__ || _e(n);
|
|
369
371
|
});
|
|
370
372
|
} catch (n) {
|
|
371
|
-
t.some(function(
|
|
372
|
-
|
|
373
|
-
}), t = [],
|
|
373
|
+
t.some(function(i) {
|
|
374
|
+
i.__h && (i.__h = []);
|
|
375
|
+
}), t = [], b.__e(n, o.__v);
|
|
374
376
|
}
|
|
375
|
-
}),
|
|
376
|
-
},
|
|
377
|
-
|
|
377
|
+
}), Se && Se(e, t);
|
|
378
|
+
}, b.unmount = function(e) {
|
|
379
|
+
Le && Le(e);
|
|
378
380
|
var t, o = e.__c;
|
|
379
381
|
o && o.__H && (o.__H.__.forEach(function(n) {
|
|
380
382
|
try {
|
|
381
|
-
|
|
382
|
-
} catch (
|
|
383
|
-
t =
|
|
383
|
+
Q(n);
|
|
384
|
+
} catch (i) {
|
|
385
|
+
t = i;
|
|
384
386
|
}
|
|
385
|
-
}), o.__H = void 0, t &&
|
|
387
|
+
}), o.__H = void 0, t && b.__e(t, o.__v));
|
|
386
388
|
};
|
|
387
|
-
var
|
|
388
|
-
function
|
|
389
|
+
var Ee = typeof requestAnimationFrame == "function";
|
|
390
|
+
function Ft(e) {
|
|
389
391
|
var t, o = function() {
|
|
390
|
-
clearTimeout(n),
|
|
392
|
+
clearTimeout(n), Ee && cancelAnimationFrame(t), setTimeout(e);
|
|
391
393
|
}, n = setTimeout(o, 100);
|
|
392
|
-
|
|
394
|
+
Ee && (t = requestAnimationFrame(o));
|
|
393
395
|
}
|
|
394
|
-
function
|
|
395
|
-
var t =
|
|
396
|
-
typeof o == "function" && (e.__c = void 0, o()),
|
|
396
|
+
function Q(e) {
|
|
397
|
+
var t = w, o = e.__c;
|
|
398
|
+
typeof o == "function" && (e.__c = void 0, o()), w = t;
|
|
397
399
|
}
|
|
398
|
-
function
|
|
399
|
-
var t =
|
|
400
|
-
e.__c = e.__(),
|
|
400
|
+
function _e(e) {
|
|
401
|
+
var t = w;
|
|
402
|
+
e.__c = e.__(), w = t;
|
|
401
403
|
}
|
|
402
|
-
function
|
|
404
|
+
function at(e, t) {
|
|
403
405
|
return !e || e.length !== t.length || t.some(function(o, n) {
|
|
404
406
|
return o !== e[n];
|
|
405
407
|
});
|
|
406
408
|
}
|
|
407
|
-
function
|
|
409
|
+
function ct(e, t) {
|
|
408
410
|
return typeof t == "function" ? t(e) : t;
|
|
409
411
|
}
|
|
410
|
-
const
|
|
412
|
+
const Ut = (e) => ({
|
|
411
413
|
saveGameData(t) {
|
|
412
414
|
try {
|
|
413
415
|
const o = {
|
|
@@ -445,8 +447,8 @@ const St = (e) => ({
|
|
|
445
447
|
console.error("Failed to reset game state:", t);
|
|
446
448
|
}
|
|
447
449
|
}
|
|
448
|
-
}),
|
|
449
|
-
const o =
|
|
450
|
+
}), ut = rt(void 0), Ot = ({ children: e, config: t }) => {
|
|
451
|
+
const o = G(t), n = Ut(t.lcPrefix + "score"), i = n.loadGameData(), [r, s] = $({
|
|
450
452
|
currentLevel: 1,
|
|
451
453
|
highestUnlockedLevel: 1,
|
|
452
454
|
currentTier: 1,
|
|
@@ -467,15 +469,15 @@ const St = (e) => ({
|
|
|
467
469
|
foodCollected: 0,
|
|
468
470
|
totalFoodCount: 0,
|
|
469
471
|
showClue: !1,
|
|
470
|
-
...
|
|
472
|
+
...i || {}
|
|
471
473
|
});
|
|
472
|
-
|
|
473
|
-
n.saveGameData(
|
|
474
|
+
A(() => {
|
|
475
|
+
n.saveGameData(r);
|
|
474
476
|
}, [
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
r.highestUnlockedLevel,
|
|
478
|
+
r.levelScores,
|
|
479
|
+
r.totalScore,
|
|
480
|
+
r.currentLevel
|
|
479
481
|
]);
|
|
480
482
|
const l = () => {
|
|
481
483
|
n.resetGameData(), s((a) => ({
|
|
@@ -497,10 +499,10 @@ const St = (e) => ({
|
|
|
497
499
|
}));
|
|
498
500
|
};
|
|
499
501
|
return /* @__PURE__ */ f(
|
|
500
|
-
|
|
502
|
+
ut.Provider,
|
|
501
503
|
{
|
|
502
504
|
value: {
|
|
503
|
-
gameState:
|
|
505
|
+
gameState: r,
|
|
504
506
|
setGameState: s,
|
|
505
507
|
config: o,
|
|
506
508
|
resetGame: l
|
|
@@ -508,179 +510,367 @@ const St = (e) => ({
|
|
|
508
510
|
children: e
|
|
509
511
|
}
|
|
510
512
|
);
|
|
511
|
-
},
|
|
512
|
-
const e =
|
|
513
|
+
}, _t = () => {
|
|
514
|
+
const e = lt(ut);
|
|
513
515
|
if (!e)
|
|
514
516
|
throw new Error("useGameContext must be used within a GameProvider");
|
|
515
517
|
return e;
|
|
516
518
|
};
|
|
517
|
-
function
|
|
519
|
+
function pe(e, t) {
|
|
520
|
+
if (!(e instanceof t))
|
|
521
|
+
throw new TypeError("Cannot call a class as a function");
|
|
522
|
+
}
|
|
523
|
+
function Dt(e, t) {
|
|
524
|
+
for (var o = 0; o < t.length; o++) {
|
|
525
|
+
var n = t[o];
|
|
526
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function ge(e, t, o) {
|
|
530
|
+
return t && Dt(e.prototype, t), e;
|
|
531
|
+
}
|
|
532
|
+
function Me(e) {
|
|
533
|
+
return +e.replace(/px/, "");
|
|
534
|
+
}
|
|
535
|
+
function Wt(e) {
|
|
536
|
+
var t = window.devicePixelRatio, o = getComputedStyle(e), n = Me(o.getPropertyValue("width")), i = Me(o.getPropertyValue("height"));
|
|
537
|
+
e.setAttribute("width", (n * t).toString()), e.setAttribute("height", (i * t).toString());
|
|
538
|
+
}
|
|
539
|
+
function x(e, t) {
|
|
540
|
+
var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, n = Math.random() * (t - e) + e;
|
|
541
|
+
return Math.floor(n * Math.pow(10, o)) / Math.pow(10, o);
|
|
542
|
+
}
|
|
543
|
+
function Ie(e) {
|
|
544
|
+
return e[x(0, e.length)];
|
|
545
|
+
}
|
|
546
|
+
var jt = 125e-5, Ht = 5e-4, Gt = 9e-4, Bt = 1e-5, Vt = 6, qt = 80, Xt = 0.9, Yt = 1.7, Jt = 0.2, Kt = 0.6, Zt = 0.03, Qt = 0.07, eo = 15, to = 82, oo = 100, no = 250, io = 40, ro = ["#fcf403", "#62fc03", "#f4fc03", "#03e7fc", "#03fca5", "#a503fc", "#fc03ad", "#fc03c2"];
|
|
547
|
+
function $e(e) {
|
|
548
|
+
var t = 1920;
|
|
549
|
+
return Math.log(e) / Math.log(t);
|
|
550
|
+
}
|
|
551
|
+
var Re = /* @__PURE__ */ function() {
|
|
552
|
+
function e(t) {
|
|
553
|
+
pe(this, e);
|
|
554
|
+
var o = t.initialPosition, n = t.direction, i = t.confettiRadius, r = t.confettiColors, s = t.emojis, l = t.emojiSize, a = t.canvasWidth, c = x(Xt, Yt, 3), _ = c * $e(a);
|
|
555
|
+
this.confettiSpeed = {
|
|
556
|
+
x: _,
|
|
557
|
+
y: _
|
|
558
|
+
}, this.finalConfettiSpeedX = x(Jt, Kt, 3), this.rotationSpeed = s.length ? 0.01 : x(Zt, Qt, 3) * $e(a), this.dragForceCoefficient = x(Ht, Gt, 6), this.radius = {
|
|
559
|
+
x: i,
|
|
560
|
+
y: i
|
|
561
|
+
}, this.initialRadius = i, this.rotationAngle = n === "left" ? x(0, 0.2, 3) : x(-0.2, 0, 3), this.emojiSize = l, this.emojiRotationAngle = x(0, 2 * Math.PI), this.radiusYUpdateDirection = "down";
|
|
562
|
+
var u = n === "left" ? x(to, eo) * Math.PI / 180 : x(-15, -82) * Math.PI / 180;
|
|
563
|
+
this.absCos = Math.abs(Math.cos(u)), this.absSin = Math.abs(Math.sin(u));
|
|
564
|
+
var h = x(-150, 0), d = {
|
|
565
|
+
x: o.x + (n === "left" ? -h : h) * this.absCos,
|
|
566
|
+
y: o.y - h * this.absSin
|
|
567
|
+
};
|
|
568
|
+
this.currentPosition = Object.assign({}, d), this.initialPosition = Object.assign({}, d), this.color = s.length ? null : Ie(r), this.emoji = s.length ? Ie(s) : null, this.createdAt = (/* @__PURE__ */ new Date()).getTime(), this.direction = n;
|
|
569
|
+
}
|
|
570
|
+
return ge(e, [{
|
|
571
|
+
key: "draw",
|
|
572
|
+
value: function(o) {
|
|
573
|
+
var n = this.currentPosition, i = this.radius, r = this.color, s = this.emoji, l = this.rotationAngle, a = this.emojiRotationAngle, c = this.emojiSize, _ = window.devicePixelRatio;
|
|
574
|
+
r ? (o.fillStyle = r, o.beginPath(), o.ellipse(n.x * _, n.y * _, i.x * _, i.y * _, l, 0, 2 * Math.PI), o.fill()) : s && (o.font = "".concat(c, "px serif"), o.save(), o.translate(_ * n.x, _ * n.y), o.rotate(a), o.textAlign = "center", o.fillText(s, 0, 0), o.restore());
|
|
575
|
+
}
|
|
576
|
+
}, {
|
|
577
|
+
key: "updatePosition",
|
|
578
|
+
value: function(o, n) {
|
|
579
|
+
var i = this.confettiSpeed, r = this.dragForceCoefficient, s = this.finalConfettiSpeedX, l = this.radiusYUpdateDirection, a = this.rotationSpeed, c = this.createdAt, _ = this.direction, u = n - c;
|
|
580
|
+
if (i.x > s && (this.confettiSpeed.x -= r * o), this.currentPosition.x += i.x * (_ === "left" ? -this.absCos : this.absCos) * o, this.currentPosition.y = this.initialPosition.y - i.y * this.absSin * u + jt * Math.pow(u, 2) / 2, this.rotationSpeed -= this.emoji ? 1e-4 : Bt * o, this.rotationSpeed < 0 && (this.rotationSpeed = 0), this.emoji) {
|
|
581
|
+
this.emojiRotationAngle += this.rotationSpeed * o % (2 * Math.PI);
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
l === "down" ? (this.radius.y -= o * a, this.radius.y <= 0 && (this.radius.y = 0, this.radiusYUpdateDirection = "up")) : (this.radius.y += o * a, this.radius.y >= this.initialRadius && (this.radius.y = this.initialRadius, this.radiusYUpdateDirection = "down"));
|
|
585
|
+
}
|
|
586
|
+
}, {
|
|
587
|
+
key: "getIsVisibleOnCanvas",
|
|
588
|
+
value: function(o) {
|
|
589
|
+
return this.currentPosition.y < o + oo;
|
|
590
|
+
}
|
|
591
|
+
}]), e;
|
|
592
|
+
}();
|
|
593
|
+
function so() {
|
|
594
|
+
var e = document.createElement("canvas");
|
|
595
|
+
return e.style.position = "fixed", e.style.width = "100%", e.style.height = "100%", e.style.top = "0", e.style.left = "0", e.style.zIndex = "1000", e.style.pointerEvents = "none", document.body.appendChild(e), e;
|
|
596
|
+
}
|
|
597
|
+
function lo(e) {
|
|
598
|
+
var t = e.confettiRadius, o = t === void 0 ? Vt : t, n = e.confettiNumber, i = n === void 0 ? e.confettiesNumber || (e.emojis ? io : no) : n, r = e.confettiColors, s = r === void 0 ? ro : r, l = e.emojis, a = l === void 0 ? e.emojies || [] : l, c = e.emojiSize, _ = c === void 0 ? qt : c;
|
|
599
|
+
return e.emojies && console.error("emojies argument is deprecated, please use emojis instead"), e.confettiesNumber && console.error("confettiesNumber argument is deprecated, please use confettiNumber instead"), {
|
|
600
|
+
confettiRadius: o,
|
|
601
|
+
confettiNumber: i,
|
|
602
|
+
confettiColors: s,
|
|
603
|
+
emojis: a,
|
|
604
|
+
emojiSize: _
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
var ao = /* @__PURE__ */ function() {
|
|
608
|
+
function e(t) {
|
|
609
|
+
var o = this;
|
|
610
|
+
pe(this, e), this.canvasContext = t, this.shapes = [], this.promise = new Promise(function(n) {
|
|
611
|
+
return o.resolvePromise = n;
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
return ge(e, [{
|
|
615
|
+
key: "getBatchCompletePromise",
|
|
616
|
+
value: function() {
|
|
617
|
+
return this.promise;
|
|
618
|
+
}
|
|
619
|
+
}, {
|
|
620
|
+
key: "addShapes",
|
|
621
|
+
value: function() {
|
|
622
|
+
var o;
|
|
623
|
+
(o = this.shapes).push.apply(o, arguments);
|
|
624
|
+
}
|
|
625
|
+
}, {
|
|
626
|
+
key: "complete",
|
|
627
|
+
value: function() {
|
|
628
|
+
var o;
|
|
629
|
+
return this.shapes.length ? !1 : ((o = this.resolvePromise) === null || o === void 0 || o.call(this), !0);
|
|
630
|
+
}
|
|
631
|
+
}, {
|
|
632
|
+
key: "processShapes",
|
|
633
|
+
value: function(o, n, i) {
|
|
634
|
+
var r = this, s = o.timeDelta, l = o.currentTime;
|
|
635
|
+
this.shapes = this.shapes.filter(function(a) {
|
|
636
|
+
return a.updatePosition(s, l), a.draw(r.canvasContext), i ? a.getIsVisibleOnCanvas(n) : !0;
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}]), e;
|
|
640
|
+
}(), co = /* @__PURE__ */ function() {
|
|
641
|
+
function e() {
|
|
642
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
643
|
+
pe(this, e), this.activeConfettiBatches = [], this.canvas = t.canvas || so(), this.canvasContext = this.canvas.getContext("2d"), this.requestAnimationFrameRequested = !1, this.lastUpdated = (/* @__PURE__ */ new Date()).getTime(), this.iterationIndex = 0, this.loop = this.loop.bind(this), requestAnimationFrame(this.loop);
|
|
644
|
+
}
|
|
645
|
+
return ge(e, [{
|
|
646
|
+
key: "loop",
|
|
647
|
+
value: function() {
|
|
648
|
+
this.requestAnimationFrameRequested = !1, Wt(this.canvas);
|
|
649
|
+
var o = (/* @__PURE__ */ new Date()).getTime(), n = o - this.lastUpdated, i = this.canvas.offsetHeight, r = this.iterationIndex % 10 === 0;
|
|
650
|
+
this.activeConfettiBatches = this.activeConfettiBatches.filter(function(s) {
|
|
651
|
+
return s.processShapes({
|
|
652
|
+
timeDelta: n,
|
|
653
|
+
currentTime: o
|
|
654
|
+
}, i, r), r ? !s.complete() : !0;
|
|
655
|
+
}), this.iterationIndex++, this.queueAnimationFrameIfNeeded(o);
|
|
656
|
+
}
|
|
657
|
+
}, {
|
|
658
|
+
key: "queueAnimationFrameIfNeeded",
|
|
659
|
+
value: function(o) {
|
|
660
|
+
this.requestAnimationFrameRequested || this.activeConfettiBatches.length < 1 || (this.requestAnimationFrameRequested = !0, this.lastUpdated = o || (/* @__PURE__ */ new Date()).getTime(), requestAnimationFrame(this.loop));
|
|
661
|
+
}
|
|
662
|
+
}, {
|
|
663
|
+
key: "addConfetti",
|
|
664
|
+
value: function() {
|
|
665
|
+
for (var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = lo(o), i = n.confettiRadius, r = n.confettiNumber, s = n.confettiColors, l = n.emojis, a = n.emojiSize, c = this.canvas.getBoundingClientRect(), _ = c.width, u = c.height, h = u * 5 / 7, d = {
|
|
666
|
+
x: 0,
|
|
667
|
+
y: h
|
|
668
|
+
}, v = {
|
|
669
|
+
x: _,
|
|
670
|
+
y: h
|
|
671
|
+
}, m = new ao(this.canvasContext), C = 0; C < r / 2; C++) {
|
|
672
|
+
var g = new Re({
|
|
673
|
+
initialPosition: d,
|
|
674
|
+
direction: "right",
|
|
675
|
+
confettiRadius: i,
|
|
676
|
+
confettiColors: s,
|
|
677
|
+
confettiNumber: r,
|
|
678
|
+
emojis: l,
|
|
679
|
+
emojiSize: a,
|
|
680
|
+
canvasWidth: _
|
|
681
|
+
}), p = new Re({
|
|
682
|
+
initialPosition: v,
|
|
683
|
+
direction: "left",
|
|
684
|
+
confettiRadius: i,
|
|
685
|
+
confettiColors: s,
|
|
686
|
+
confettiNumber: r,
|
|
687
|
+
emojis: l,
|
|
688
|
+
emojiSize: a,
|
|
689
|
+
canvasWidth: _
|
|
690
|
+
});
|
|
691
|
+
m.addShapes(g, p);
|
|
692
|
+
}
|
|
693
|
+
return this.activeConfettiBatches.push(m), this.queueAnimationFrameIfNeeded(), m.getBatchCompletePromise();
|
|
694
|
+
}
|
|
695
|
+
}, {
|
|
696
|
+
key: "clearCanvas",
|
|
697
|
+
value: function() {
|
|
698
|
+
this.activeConfettiBatches = [];
|
|
699
|
+
}
|
|
700
|
+
}, {
|
|
701
|
+
key: "destroyCanvas",
|
|
702
|
+
value: function() {
|
|
703
|
+
this.canvas.remove();
|
|
704
|
+
}
|
|
705
|
+
}]), e;
|
|
706
|
+
}();
|
|
707
|
+
function dt(e, t) {
|
|
518
708
|
for (var o in t) e[o] = t[o];
|
|
519
709
|
return e;
|
|
520
710
|
}
|
|
521
|
-
function
|
|
711
|
+
function Fe(e, t) {
|
|
522
712
|
for (var o in e) if (o !== "__source" && !(o in t)) return !0;
|
|
523
713
|
for (var n in t) if (n !== "__source" && e[n] !== t[n]) return !0;
|
|
524
714
|
return !1;
|
|
525
715
|
}
|
|
526
|
-
function
|
|
716
|
+
function Ue(e, t) {
|
|
527
717
|
this.props = e, this.context = t;
|
|
528
718
|
}
|
|
529
|
-
(
|
|
530
|
-
return
|
|
719
|
+
(Ue.prototype = new R()).isPureReactComponent = !0, Ue.prototype.shouldComponentUpdate = function(e, t) {
|
|
720
|
+
return Fe(this.props, e) || Fe(this.state, t);
|
|
531
721
|
};
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null),
|
|
722
|
+
var Oe = y.__b;
|
|
723
|
+
y.__b = function(e) {
|
|
724
|
+
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Oe && Oe(e);
|
|
535
725
|
};
|
|
536
|
-
var
|
|
537
|
-
function
|
|
726
|
+
var uo = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
|
|
727
|
+
function ht(e) {
|
|
538
728
|
function t(o) {
|
|
539
|
-
var n =
|
|
729
|
+
var n = dt({}, o);
|
|
540
730
|
return delete n.ref, e(n, o.ref || null);
|
|
541
731
|
}
|
|
542
|
-
return t.$$typeof =
|
|
732
|
+
return t.$$typeof = uo, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
|
|
543
733
|
}
|
|
544
|
-
var
|
|
545
|
-
|
|
734
|
+
var _o = y.__e;
|
|
735
|
+
y.__e = function(e, t, o, n) {
|
|
546
736
|
if (e.then) {
|
|
547
|
-
for (var
|
|
737
|
+
for (var i, r = t; r = r.__; ) if ((i = r.__c) && i.__c) return t.__e == null && (t.__e = o.__e, t.__k = o.__k), i.__c(e, t);
|
|
548
738
|
}
|
|
549
|
-
|
|
739
|
+
_o(e, t, o, n);
|
|
550
740
|
};
|
|
551
|
-
var
|
|
552
|
-
function
|
|
741
|
+
var De = y.unmount;
|
|
742
|
+
function ft(e, t, o) {
|
|
553
743
|
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
|
|
554
744
|
typeof n.__c == "function" && n.__c();
|
|
555
|
-
}), e.__c.__H = null), (e =
|
|
556
|
-
return
|
|
745
|
+
}), e.__c.__H = null), (e = dt({}, e)).__c != null && (e.__c.__P === o && (e.__c.__P = t), e.__c.__e = !0, e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
|
|
746
|
+
return ft(n, t, o);
|
|
557
747
|
})), e;
|
|
558
748
|
}
|
|
559
|
-
function
|
|
749
|
+
function mt(e, t, o) {
|
|
560
750
|
return e && o && (e.__v = null, e.__k = e.__k && e.__k.map(function(n) {
|
|
561
|
-
return
|
|
751
|
+
return mt(n, t, o);
|
|
562
752
|
}), e.__c && e.__c.__P === t && (e.__e && o.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = o)), e;
|
|
563
753
|
}
|
|
564
|
-
function
|
|
754
|
+
function se() {
|
|
565
755
|
this.__u = 0, this.o = null, this.__b = null;
|
|
566
756
|
}
|
|
567
|
-
function
|
|
757
|
+
function vt(e) {
|
|
568
758
|
var t = e.__.__c;
|
|
569
759
|
return t && t.__a && t.__a(e);
|
|
570
760
|
}
|
|
571
|
-
function
|
|
761
|
+
function K() {
|
|
572
762
|
this.i = null, this.l = null;
|
|
573
763
|
}
|
|
574
|
-
|
|
764
|
+
y.unmount = function(e) {
|
|
575
765
|
var t = e.__c;
|
|
576
|
-
t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null),
|
|
577
|
-
}, (
|
|
766
|
+
t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), De && De(e);
|
|
767
|
+
}, (se.prototype = new R()).__c = function(e, t) {
|
|
578
768
|
var o = t.__c, n = this;
|
|
579
769
|
n.o == null && (n.o = []), n.o.push(o);
|
|
580
|
-
var
|
|
581
|
-
|
|
770
|
+
var i = vt(n.__v), r = !1, s = function() {
|
|
771
|
+
r || (r = !0, o.__R = null, i ? i(l) : l());
|
|
582
772
|
};
|
|
583
773
|
o.__R = s;
|
|
584
774
|
var l = function() {
|
|
585
775
|
if (!--n.__u) {
|
|
586
776
|
if (n.state.__a) {
|
|
587
777
|
var a = n.state.__a;
|
|
588
|
-
n.__v.__k[0] =
|
|
778
|
+
n.__v.__k[0] = mt(a, a.__c.__P, a.__c.__O);
|
|
589
779
|
}
|
|
590
780
|
var c;
|
|
591
781
|
for (n.setState({ __a: n.__b = null }); c = n.o.pop(); ) c.forceUpdate();
|
|
592
782
|
}
|
|
593
783
|
};
|
|
594
784
|
n.__u++ || 32 & t.__u || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(s, s);
|
|
595
|
-
},
|
|
785
|
+
}, se.prototype.componentWillUnmount = function() {
|
|
596
786
|
this.o = [];
|
|
597
|
-
},
|
|
787
|
+
}, se.prototype.render = function(e, t) {
|
|
598
788
|
if (this.__b) {
|
|
599
789
|
if (this.__v.__k) {
|
|
600
790
|
var o = document.createElement("div"), n = this.__v.__k[0].__c;
|
|
601
|
-
this.__v.__k[0] =
|
|
791
|
+
this.__v.__k[0] = ft(this.__b, o, n.__O = n.__P);
|
|
602
792
|
}
|
|
603
793
|
this.__b = null;
|
|
604
794
|
}
|
|
605
|
-
var
|
|
606
|
-
return
|
|
795
|
+
var i = t.__a && D(W, null, e.fallback);
|
|
796
|
+
return i && (i.__u &= -33), [D(W, null, t.__a ? null : e.children), i];
|
|
607
797
|
};
|
|
608
|
-
var
|
|
798
|
+
var We = function(e, t, o) {
|
|
609
799
|
if (++o[1] === o[0] && e.l.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (o = e.i; o; ) {
|
|
610
800
|
for (; o.length > 3; ) o.pop()();
|
|
611
801
|
if (o[1] < o[0]) break;
|
|
612
802
|
e.i = o = o[2];
|
|
613
803
|
}
|
|
614
804
|
};
|
|
615
|
-
(
|
|
616
|
-
var t = this, o =
|
|
617
|
-
return n[0]++, function(
|
|
618
|
-
var
|
|
619
|
-
t.props.revealOrder ? (n.push(
|
|
805
|
+
(K.prototype = new R()).__a = function(e) {
|
|
806
|
+
var t = this, o = vt(t.__v), n = t.l.get(e);
|
|
807
|
+
return n[0]++, function(i) {
|
|
808
|
+
var r = function() {
|
|
809
|
+
t.props.revealOrder ? (n.push(i), We(t, e, n)) : i();
|
|
620
810
|
};
|
|
621
|
-
o ? o(
|
|
811
|
+
o ? o(r) : r();
|
|
622
812
|
};
|
|
623
|
-
},
|
|
813
|
+
}, K.prototype.render = function(e) {
|
|
624
814
|
this.i = null, this.l = /* @__PURE__ */ new Map();
|
|
625
|
-
var t =
|
|
815
|
+
var t = oe(e.children);
|
|
626
816
|
e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
|
|
627
817
|
for (var o = t.length; o--; ) this.l.set(t[o], this.i = [1, 0, this.i]);
|
|
628
818
|
return e.children;
|
|
629
|
-
},
|
|
819
|
+
}, K.prototype.componentDidUpdate = K.prototype.componentDidMount = function() {
|
|
630
820
|
var e = this;
|
|
631
821
|
this.l.forEach(function(t, o) {
|
|
632
|
-
|
|
822
|
+
We(e, o, t);
|
|
633
823
|
});
|
|
634
824
|
};
|
|
635
|
-
var
|
|
825
|
+
var ho = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, fo = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, mo = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, vo = /[A-Z0-9]/g, po = typeof document < "u", go = function(e) {
|
|
636
826
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
|
|
637
827
|
};
|
|
638
|
-
|
|
639
|
-
Object.defineProperty(
|
|
828
|
+
R.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
|
|
829
|
+
Object.defineProperty(R.prototype, e, { configurable: !0, get: function() {
|
|
640
830
|
return this["UNSAFE_" + e];
|
|
641
831
|
}, set: function(t) {
|
|
642
832
|
Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
|
|
643
833
|
} });
|
|
644
834
|
});
|
|
645
|
-
var
|
|
646
|
-
function
|
|
835
|
+
var je = y.event;
|
|
836
|
+
function Co() {
|
|
647
837
|
}
|
|
648
|
-
function
|
|
838
|
+
function yo() {
|
|
649
839
|
return this.cancelBubble;
|
|
650
840
|
}
|
|
651
|
-
function
|
|
841
|
+
function wo() {
|
|
652
842
|
return this.defaultPrevented;
|
|
653
843
|
}
|
|
654
|
-
|
|
655
|
-
return
|
|
844
|
+
y.event = function(e) {
|
|
845
|
+
return je && (e = je(e)), e.persist = Co, e.isPropagationStopped = yo, e.isDefaultPrevented = wo, e.nativeEvent = e;
|
|
656
846
|
};
|
|
657
|
-
var
|
|
847
|
+
var bo = { enumerable: !1, configurable: !0, get: function() {
|
|
658
848
|
return this.class;
|
|
659
|
-
} },
|
|
660
|
-
|
|
849
|
+
} }, He = y.vnode;
|
|
850
|
+
y.vnode = function(e) {
|
|
661
851
|
typeof e.type == "string" && function(t) {
|
|
662
|
-
var o = t.props, n = t.type,
|
|
852
|
+
var o = t.props, n = t.type, i = {}, r = n.indexOf("-") === -1;
|
|
663
853
|
for (var s in o) {
|
|
664
854
|
var l = o[s];
|
|
665
|
-
if (!(s === "value" && "defaultValue" in o && l == null ||
|
|
855
|
+
if (!(s === "value" && "defaultValue" in o && l == null || po && s === "children" && n === "noscript" || s === "class" || s === "className")) {
|
|
666
856
|
var a = s.toLowerCase();
|
|
667
|
-
s === "defaultValue" && "value" in o && o.value == null ? s = "value" : s === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? s = "ondblclick" : a !== "onchange" || n !== "input" && n !== "textarea" ||
|
|
857
|
+
s === "defaultValue" && "value" in o && o.value == null ? s = "value" : s === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? s = "ondblclick" : a !== "onchange" || n !== "input" && n !== "textarea" || go(o.type) ? a === "onfocus" ? s = "onfocusin" : a === "onblur" ? s = "onfocusout" : mo.test(s) && (s = a) : a = s = "oninput" : r && fo.test(s) ? s = s.replace(vo, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[s = a] && (s = "oninputCapture"), i[s] = l;
|
|
668
858
|
}
|
|
669
859
|
}
|
|
670
|
-
n == "select" &&
|
|
671
|
-
c.props.selected =
|
|
672
|
-
})), n == "select" &&
|
|
673
|
-
c.props.selected =
|
|
674
|
-
})), o.class && !o.className ? (
|
|
675
|
-
}(e), e.$$typeof =
|
|
860
|
+
n == "select" && i.multiple && Array.isArray(i.value) && (i.value = oe(o.children).forEach(function(c) {
|
|
861
|
+
c.props.selected = i.value.indexOf(c.props.value) != -1;
|
|
862
|
+
})), n == "select" && i.defaultValue != null && (i.value = oe(o.children).forEach(function(c) {
|
|
863
|
+
c.props.selected = i.multiple ? i.defaultValue.indexOf(c.props.value) != -1 : i.defaultValue == c.props.value;
|
|
864
|
+
})), o.class && !o.className ? (i.class = o.class, Object.defineProperty(i, "className", bo)) : (o.className && !o.class || o.class && o.className) && (i.class = i.className = o.className), t.props = i;
|
|
865
|
+
}(e), e.$$typeof = ho, He && He(e);
|
|
676
866
|
};
|
|
677
|
-
var
|
|
678
|
-
|
|
679
|
-
|
|
867
|
+
var Ge = y.__r;
|
|
868
|
+
y.__r = function(e) {
|
|
869
|
+
Ge && Ge(e), e.__c;
|
|
680
870
|
};
|
|
681
|
-
var
|
|
682
|
-
|
|
683
|
-
|
|
871
|
+
var Be = y.diffed;
|
|
872
|
+
y.diffed = function(e) {
|
|
873
|
+
Be && Be(e);
|
|
684
874
|
var t = e.props, o = e.__e;
|
|
685
875
|
o != null && e.type === "textarea" && "value" in t && t.value !== o.value && (o.value = t.value == null ? "" : t.value);
|
|
686
876
|
};
|
|
@@ -690,14 +880,14 @@ g.diffed = function(e) {
|
|
|
690
880
|
* This source code is licensed under the ISC license.
|
|
691
881
|
* See the LICENSE file in the root directory of this source tree.
|
|
692
882
|
*/
|
|
693
|
-
const
|
|
883
|
+
const ko = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), pt = (...e) => e.filter((t, o, n) => !!t && t.trim() !== "" && n.indexOf(t) === o).join(" ").trim();
|
|
694
884
|
/**
|
|
695
885
|
* @license lucide-react v0.473.0 - ISC
|
|
696
886
|
*
|
|
697
887
|
* This source code is licensed under the ISC license.
|
|
698
888
|
* See the LICENSE file in the root directory of this source tree.
|
|
699
889
|
*/
|
|
700
|
-
var
|
|
890
|
+
var To = {
|
|
701
891
|
xmlns: "http://www.w3.org/2000/svg",
|
|
702
892
|
width: 24,
|
|
703
893
|
height: 24,
|
|
@@ -714,31 +904,31 @@ var Bt = {
|
|
|
714
904
|
* This source code is licensed under the ISC license.
|
|
715
905
|
* See the LICENSE file in the root directory of this source tree.
|
|
716
906
|
*/
|
|
717
|
-
const
|
|
907
|
+
const zo = ht(
|
|
718
908
|
({
|
|
719
909
|
color: e = "currentColor",
|
|
720
910
|
size: t = 24,
|
|
721
911
|
strokeWidth: o = 2,
|
|
722
912
|
absoluteStrokeWidth: n,
|
|
723
|
-
className:
|
|
724
|
-
children:
|
|
913
|
+
className: i = "",
|
|
914
|
+
children: r,
|
|
725
915
|
iconNode: s,
|
|
726
916
|
...l
|
|
727
917
|
}, a) => D(
|
|
728
918
|
"svg",
|
|
729
919
|
{
|
|
730
920
|
ref: a,
|
|
731
|
-
...
|
|
921
|
+
...To,
|
|
732
922
|
width: t,
|
|
733
923
|
height: t,
|
|
734
924
|
stroke: e,
|
|
735
925
|
strokeWidth: n ? Number(o) * 24 / Number(t) : o,
|
|
736
|
-
className:
|
|
926
|
+
className: pt("lucide", i),
|
|
737
927
|
...l
|
|
738
928
|
},
|
|
739
929
|
[
|
|
740
|
-
...s.map(([c,
|
|
741
|
-
...Array.isArray(
|
|
930
|
+
...s.map(([c, _]) => D(c, _)),
|
|
931
|
+
...Array.isArray(r) ? r : [r]
|
|
742
932
|
]
|
|
743
933
|
)
|
|
744
934
|
);
|
|
@@ -748,13 +938,13 @@ const jt = it(
|
|
|
748
938
|
* This source code is licensed under the ISC license.
|
|
749
939
|
* See the LICENSE file in the root directory of this source tree.
|
|
750
940
|
*/
|
|
751
|
-
const
|
|
752
|
-
const o =
|
|
753
|
-
({ className: n, ...
|
|
754
|
-
ref:
|
|
941
|
+
const Po = (e, t) => {
|
|
942
|
+
const o = ht(
|
|
943
|
+
({ className: n, ...i }, r) => D(zo, {
|
|
944
|
+
ref: r,
|
|
755
945
|
iconNode: t,
|
|
756
|
-
className:
|
|
757
|
-
...
|
|
946
|
+
className: pt(`lucide-${ko(e)}`, n),
|
|
947
|
+
...i
|
|
758
948
|
})
|
|
759
949
|
);
|
|
760
950
|
return o.displayName = `${e}`, o;
|
|
@@ -765,7 +955,7 @@ const qt = (e, t) => {
|
|
|
765
955
|
* This source code is licensed under the ISC license.
|
|
766
956
|
* See the LICENSE file in the root directory of this source tree.
|
|
767
957
|
*/
|
|
768
|
-
const
|
|
958
|
+
const No = [
|
|
769
959
|
[
|
|
770
960
|
"path",
|
|
771
961
|
{
|
|
@@ -774,49 +964,49 @@ const Kt = [
|
|
|
774
964
|
}
|
|
775
965
|
],
|
|
776
966
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
777
|
-
],
|
|
778
|
-
const [t, o] =
|
|
967
|
+
], So = Po("Settings", No), gt = rt(void 0), Lo = ({ children: e }) => {
|
|
968
|
+
const [t, o] = $(null), [n, i] = $(!1), [r, s] = $(
|
|
779
969
|
"info"
|
|
780
|
-
), [l, a] =
|
|
781
|
-
|
|
782
|
-
}, [l]),
|
|
783
|
-
(
|
|
784
|
-
if (n && c(), o(
|
|
785
|
-
const
|
|
786
|
-
|
|
970
|
+
), [l, a] = $(null), c = Ae(() => {
|
|
971
|
+
i(!1), l && (clearTimeout(l), a(null));
|
|
972
|
+
}, [l]), _ = Ae(
|
|
973
|
+
(u, h = "info", d = 3e3) => {
|
|
974
|
+
if (n && c(), o(u), s(h), i(!0), d > 0) {
|
|
975
|
+
const v = setTimeout(() => {
|
|
976
|
+
i(!1);
|
|
787
977
|
}, d);
|
|
788
|
-
a(
|
|
978
|
+
a(v);
|
|
789
979
|
}
|
|
790
980
|
},
|
|
791
981
|
[n, c]
|
|
792
982
|
);
|
|
793
983
|
return /* @__PURE__ */ f(
|
|
794
|
-
|
|
984
|
+
gt.Provider,
|
|
795
985
|
{
|
|
796
|
-
value: { message: t, visible: n, type:
|
|
986
|
+
value: { message: t, visible: n, type: r, showToast: _, hideToast: c },
|
|
797
987
|
children: e
|
|
798
988
|
}
|
|
799
989
|
);
|
|
800
|
-
},
|
|
801
|
-
const e =
|
|
990
|
+
}, Ce = () => {
|
|
991
|
+
const e = lt(gt);
|
|
802
992
|
if (!e)
|
|
803
993
|
throw new Error("useToast must be used within a ToastProvider");
|
|
804
994
|
return e;
|
|
805
|
-
},
|
|
995
|
+
}, xo = ({
|
|
806
996
|
i18n: e,
|
|
807
997
|
totalTiers: t,
|
|
808
998
|
currentTier: o,
|
|
809
999
|
highestUnlockedTier: n,
|
|
810
|
-
onTierChange:
|
|
811
|
-
disabled:
|
|
1000
|
+
onTierChange: i,
|
|
1001
|
+
disabled: r
|
|
812
1002
|
}) => /* @__PURE__ */ f("div", { className: "tier-selector", children: /* @__PURE__ */ f(
|
|
813
1003
|
"select",
|
|
814
1004
|
{
|
|
815
1005
|
value: o,
|
|
816
1006
|
onChange: (s) => {
|
|
817
|
-
s.target && s.target.value &&
|
|
1007
|
+
s.target && s.target.value && i(Number(s.target.value));
|
|
818
1008
|
},
|
|
819
|
-
disabled:
|
|
1009
|
+
disabled: r,
|
|
820
1010
|
className: "tier-dropdown",
|
|
821
1011
|
children: Array.from({ length: t }, (s, l) => l + 1).map((s) => /* @__PURE__ */ f(
|
|
822
1012
|
"option",
|
|
@@ -832,23 +1022,23 @@ const Kt = [
|
|
|
832
1022
|
`tier-${s}`
|
|
833
1023
|
))
|
|
834
1024
|
}
|
|
835
|
-
) }),
|
|
1025
|
+
) }), Ao = ([e, t]) => Array.from({ length: t - e + 1 }, (o, n) => e + n), Eo = ({
|
|
836
1026
|
i18n: e,
|
|
837
1027
|
levelsRange: t,
|
|
838
1028
|
currentLevel: o,
|
|
839
1029
|
highestUnlockedLevel: n,
|
|
840
|
-
onLevelChange:
|
|
841
|
-
disabled:
|
|
1030
|
+
onLevelChange: i,
|
|
1031
|
+
disabled: r
|
|
842
1032
|
}) => {
|
|
843
|
-
const s =
|
|
1033
|
+
const s = Ao(t);
|
|
844
1034
|
return /* @__PURE__ */ f("div", { className: "level-selector", children: /* @__PURE__ */ f(
|
|
845
1035
|
"select",
|
|
846
1036
|
{
|
|
847
1037
|
value: o,
|
|
848
1038
|
onChange: (l) => {
|
|
849
|
-
l.target && l.target.value &&
|
|
1039
|
+
l.target && l.target.value && i(Number(l.target.value));
|
|
850
1040
|
},
|
|
851
|
-
disabled:
|
|
1041
|
+
disabled: r,
|
|
852
1042
|
className: "level-dropdown",
|
|
853
1043
|
children: s.map((l) => /* @__PURE__ */ f(
|
|
854
1044
|
"option",
|
|
@@ -865,48 +1055,48 @@ const Kt = [
|
|
|
865
1055
|
))
|
|
866
1056
|
}
|
|
867
1057
|
) });
|
|
868
|
-
},
|
|
1058
|
+
}, le = ({
|
|
869
1059
|
isOpen: e,
|
|
870
1060
|
title: t,
|
|
871
1061
|
message: o,
|
|
872
1062
|
children: n,
|
|
873
|
-
noConfirm:
|
|
874
|
-
noCancel:
|
|
1063
|
+
noConfirm: i = !1,
|
|
1064
|
+
noCancel: r = !1,
|
|
875
1065
|
confirmText: s = "OK",
|
|
876
1066
|
cancelText: l = "Cancel",
|
|
877
1067
|
onConfirm: a,
|
|
878
1068
|
onCancel: c
|
|
879
1069
|
}) => {
|
|
880
|
-
const
|
|
881
|
-
return
|
|
882
|
-
const
|
|
1070
|
+
const _ = G(null);
|
|
1071
|
+
return A(() => {
|
|
1072
|
+
const u = (h) => {
|
|
883
1073
|
h.key === "Escape" && c?.();
|
|
884
1074
|
};
|
|
885
|
-
return e && document.addEventListener("keydown",
|
|
886
|
-
document.removeEventListener("keydown",
|
|
1075
|
+
return e && document.addEventListener("keydown", u), () => {
|
|
1076
|
+
document.removeEventListener("keydown", u);
|
|
887
1077
|
};
|
|
888
1078
|
}, [e, c]), /* @__PURE__ */ f(
|
|
889
1079
|
"div",
|
|
890
1080
|
{
|
|
891
1081
|
className: `maze-dialog-overlay ${e ? "maze-dialog-visible" : ""}`,
|
|
892
|
-
children: /* @__PURE__ */ f("div", { className: "maze-dialog", ref:
|
|
1082
|
+
children: /* @__PURE__ */ f("div", { className: "maze-dialog", ref: _, children: [
|
|
893
1083
|
/* @__PURE__ */ f("div", { className: "maze-dialog-title", children: t }),
|
|
894
1084
|
/* @__PURE__ */ f("div", { className: "maze-dialog-content", children: n || /* @__PURE__ */ f("div", { className: "maze-dialog-message", children: o }) }),
|
|
895
1085
|
/* @__PURE__ */ f("div", { className: "maze-dialog-buttons", children: [
|
|
896
|
-
!
|
|
897
|
-
!
|
|
1086
|
+
!r && /* @__PURE__ */ f("button", { className: "maze-dialog-cancel", onClick: c, children: l }),
|
|
1087
|
+
!i && /* @__PURE__ */ f("button", { className: "maze-dialog-confirm", onClick: a, children: s })
|
|
898
1088
|
] })
|
|
899
1089
|
] })
|
|
900
1090
|
}
|
|
901
1091
|
);
|
|
902
1092
|
};
|
|
903
|
-
function
|
|
1093
|
+
function Mo(e) {
|
|
904
1094
|
return function() {
|
|
905
1095
|
let t = e += 1831565813;
|
|
906
1096
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
907
1097
|
};
|
|
908
1098
|
}
|
|
909
|
-
const
|
|
1099
|
+
const ye = [
|
|
910
1100
|
// Tier 1 (Levels 1-12) - Beginner
|
|
911
1101
|
[
|
|
912
1102
|
{ size: 8, seed: 12345, method: "backtracking" },
|
|
@@ -1042,7 +1232,7 @@ const ge = [
|
|
|
1042
1232
|
{ size: 68, seed: 33341, method: "backtracking" }
|
|
1043
1233
|
// Level 60 - Master
|
|
1044
1234
|
]
|
|
1045
|
-
],
|
|
1235
|
+
], ee = {
|
|
1046
1236
|
lcPrefix: "maze-",
|
|
1047
1237
|
i18n: {
|
|
1048
1238
|
reset: "Reset",
|
|
@@ -1078,6 +1268,7 @@ const ge = [
|
|
|
1078
1268
|
renderConfig: {
|
|
1079
1269
|
padding: 10,
|
|
1080
1270
|
wallWidth: 4,
|
|
1271
|
+
minWallWidth: 1,
|
|
1081
1272
|
wallColor: "#000000",
|
|
1082
1273
|
exitColor: "#F44336",
|
|
1083
1274
|
foodColor: "#4CAF50",
|
|
@@ -1086,10 +1277,10 @@ const ge = [
|
|
|
1086
1277
|
playerColor: "#4CAF50",
|
|
1087
1278
|
playerAtExitColor: "#FFD700"
|
|
1088
1279
|
},
|
|
1089
|
-
levelConfig:
|
|
1280
|
+
levelConfig: ye
|
|
1090
1281
|
// levelsPerTier: 12,
|
|
1091
|
-
},
|
|
1092
|
-
class
|
|
1282
|
+
}, Io = (e) => e === 1 ? 2 : e >= 2 && e <= 5 ? 3 : e >= 6 && e <= 11 ? 4 : e >= 12 && e <= 15 ? 5 : 6;
|
|
1283
|
+
class $o {
|
|
1093
1284
|
// initially all walls exit
|
|
1094
1285
|
constructor(t, o) {
|
|
1095
1286
|
this.row = t, this.col = o;
|
|
@@ -1097,14 +1288,14 @@ class oo {
|
|
|
1097
1288
|
visited = !1;
|
|
1098
1289
|
walls = { top: !0, right: !0, bottom: !0, left: !0 };
|
|
1099
1290
|
}
|
|
1100
|
-
class
|
|
1291
|
+
class Ro {
|
|
1101
1292
|
rows;
|
|
1102
1293
|
cols;
|
|
1103
1294
|
grid;
|
|
1104
1295
|
seed;
|
|
1105
1296
|
random;
|
|
1106
1297
|
constructor(t, o, n) {
|
|
1107
|
-
this.rows = t, this.cols = o, this.seed = n ?? Math.floor(Math.random() * 1e6), this.random =
|
|
1298
|
+
this.rows = t, this.cols = o, this.seed = n ?? Math.floor(Math.random() * 1e6), this.random = Mo(this.seed), this.grid = this.initializeGrid();
|
|
1108
1299
|
}
|
|
1109
1300
|
// Initialize the grid with new MazeCell objects
|
|
1110
1301
|
initializeGrid() {
|
|
@@ -1112,7 +1303,7 @@ class no {
|
|
|
1112
1303
|
for (let o = 0; o < this.rows; o++) {
|
|
1113
1304
|
t[o] = [];
|
|
1114
1305
|
for (let n = 0; n < this.cols; n++)
|
|
1115
|
-
t[o][n] = new
|
|
1306
|
+
t[o][n] = new $o(o, n);
|
|
1116
1307
|
}
|
|
1117
1308
|
return t;
|
|
1118
1309
|
}
|
|
@@ -1122,7 +1313,7 @@ class no {
|
|
|
1122
1313
|
}
|
|
1123
1314
|
// Get all valid neighbors (top, right, bottom, left)
|
|
1124
1315
|
getNeighbors(t, o) {
|
|
1125
|
-
const n = [],
|
|
1316
|
+
const n = [], i = [
|
|
1126
1317
|
{ r: -1, c: 0 },
|
|
1127
1318
|
// Top
|
|
1128
1319
|
{ r: 0, c: 1 },
|
|
@@ -1132,8 +1323,8 @@ class no {
|
|
|
1132
1323
|
{ r: 0, c: -1 }
|
|
1133
1324
|
// Left
|
|
1134
1325
|
];
|
|
1135
|
-
for (const
|
|
1136
|
-
const s = t +
|
|
1326
|
+
for (const r of i) {
|
|
1327
|
+
const s = t + r.r, l = o + r.c;
|
|
1137
1328
|
this.isValid(s, l) && n.push({ row: s, col: l });
|
|
1138
1329
|
}
|
|
1139
1330
|
return n;
|
|
@@ -1153,15 +1344,15 @@ class no {
|
|
|
1153
1344
|
);
|
|
1154
1345
|
}
|
|
1155
1346
|
// Remove the wall between two adjacent cells
|
|
1156
|
-
removeWall(t, o, n,
|
|
1157
|
-
const
|
|
1158
|
-
t === n + 1 ? (
|
|
1347
|
+
removeWall(t, o, n, i) {
|
|
1348
|
+
const r = this.grid[t][o], s = this.grid[n][i];
|
|
1349
|
+
t === n + 1 ? (r.walls.top = !1, s.walls.bottom = !1) : t === n - 1 ? (r.walls.bottom = !1, s.walls.top = !1) : o === i + 1 ? (r.walls.left = !1, s.walls.right = !1) : o === i - 1 && (r.walls.right = !1, s.walls.left = !1);
|
|
1159
1350
|
}
|
|
1160
1351
|
}
|
|
1161
|
-
class
|
|
1352
|
+
class Fo {
|
|
1162
1353
|
maze;
|
|
1163
|
-
constructor(t, o, n,
|
|
1164
|
-
switch (this.maze = new
|
|
1354
|
+
constructor(t, o, n, i, r = { row: 0, col: 0 }, s = { row: t - 1, col: o - 1 }) {
|
|
1355
|
+
switch (this.maze = new Ro(t, o, i), n) {
|
|
1165
1356
|
case "backtracking":
|
|
1166
1357
|
this.runBacktracking();
|
|
1167
1358
|
break;
|
|
@@ -1171,7 +1362,7 @@ class ro {
|
|
|
1171
1362
|
default:
|
|
1172
1363
|
throw new Error(`Unknown maze generation method: ${n}`);
|
|
1173
1364
|
}
|
|
1174
|
-
this.addOpenings(
|
|
1365
|
+
this.addOpenings(r, s);
|
|
1175
1366
|
}
|
|
1176
1367
|
/**
|
|
1177
1368
|
* Returns the generated Maze instance.
|
|
@@ -1182,33 +1373,33 @@ class ro {
|
|
|
1182
1373
|
// --- Backtracking Algorithm Implementation ---
|
|
1183
1374
|
runBacktracking() {
|
|
1184
1375
|
const t = [], o = this.randomNumber(this.maze.rows), n = this.randomNumber(this.maze.cols);
|
|
1185
|
-
let
|
|
1186
|
-
for (this.maze.grid[o][n].visited = !0, t.push(
|
|
1187
|
-
|
|
1188
|
-
const { row:
|
|
1376
|
+
let i = { row: o, col: n };
|
|
1377
|
+
for (this.maze.grid[o][n].visited = !0, t.push(i); t.length > 0; ) {
|
|
1378
|
+
i = t[t.length - 1];
|
|
1379
|
+
const { row: r, col: s } = i, l = this.maze.getUnvisitedNeighbors(r, s);
|
|
1189
1380
|
if (l.length > 0) {
|
|
1190
|
-
const a = this.randomPick(l), { row: c, col:
|
|
1191
|
-
this.maze.removeWall(
|
|
1381
|
+
const a = this.randomPick(l), { row: c, col: _ } = a;
|
|
1382
|
+
this.maze.removeWall(r, s, c, _), this.maze.grid[c][_].visited = !0, t.push(a);
|
|
1192
1383
|
} else
|
|
1193
1384
|
t.pop();
|
|
1194
1385
|
}
|
|
1195
1386
|
}
|
|
1196
1387
|
// --- Prim's Algorithm Implementation ---
|
|
1197
1388
|
runPrims() {
|
|
1198
|
-
const t = [], o = (
|
|
1199
|
-
const l = this.maze.getNeighbors(
|
|
1389
|
+
const t = [], o = (r, s) => {
|
|
1390
|
+
const l = this.maze.getNeighbors(r, s);
|
|
1200
1391
|
for (const a of l)
|
|
1201
1392
|
!this.maze.grid[a.row][a.col].visited && !t.some(
|
|
1202
1393
|
(c) => c.row === a.row && c.col === a.col
|
|
1203
1394
|
) && t.push(a);
|
|
1204
|
-
}, n = this.randomNumber(this.maze.rows),
|
|
1205
|
-
for (this.maze.grid[n][
|
|
1206
|
-
const
|
|
1395
|
+
}, n = this.randomNumber(this.maze.rows), i = this.randomNumber(this.maze.cols);
|
|
1396
|
+
for (this.maze.grid[n][i].visited = !0, o(n, i); t.length > 0; ) {
|
|
1397
|
+
const r = this.randomNumber(t.length), s = t[r], { row: l, col: a } = s, c = this.maze.getVisitedNeighbors(l, a);
|
|
1207
1398
|
if (c.length > 0) {
|
|
1208
|
-
const
|
|
1209
|
-
this.maze.removeWall(l, a,
|
|
1399
|
+
const _ = this.randomPick(c);
|
|
1400
|
+
this.maze.removeWall(l, a, _.row, _.col), this.maze.grid[l][a].visited = !0, o(l, a);
|
|
1210
1401
|
}
|
|
1211
|
-
t.splice(
|
|
1402
|
+
t.splice(r, 1);
|
|
1212
1403
|
}
|
|
1213
1404
|
}
|
|
1214
1405
|
// --- Helper ---
|
|
@@ -1224,181 +1415,182 @@ class ro {
|
|
|
1224
1415
|
return t[Math.floor(this.maze.random() * t.length)];
|
|
1225
1416
|
}
|
|
1226
1417
|
}
|
|
1227
|
-
function
|
|
1228
|
-
return new
|
|
1418
|
+
function Uo(e, t, o, n, i, r) {
|
|
1419
|
+
return new Fo(e, t, o, n, i, r).getMaze();
|
|
1229
1420
|
}
|
|
1230
|
-
const
|
|
1421
|
+
const Oo = (e, t, o) => {
|
|
1231
1422
|
if (!e.isValid(t, o)) return !1;
|
|
1232
1423
|
const n = e.grid[t][o];
|
|
1233
1424
|
return !n.walls.top || !n.walls.right || !n.walls.bottom || !n.walls.left;
|
|
1234
|
-
},
|
|
1425
|
+
}, Ct = (e, t = ye.flat()) => {
|
|
1235
1426
|
const o = e - 1, n = t[o];
|
|
1236
1427
|
if (!n)
|
|
1237
1428
|
return console.error(`Cannot find Level ${e}'s config.`), null;
|
|
1238
|
-
const
|
|
1239
|
-
row:
|
|
1429
|
+
const i = n.size, r = i, s = i, l = n.seed, a = n.method, c = n.entry || { row: 0, col: 0 }, _ = n.exit || {
|
|
1430
|
+
row: r - 1,
|
|
1240
1431
|
col: s - 1
|
|
1241
|
-
},
|
|
1242
|
-
for (let
|
|
1243
|
-
let
|
|
1432
|
+
}, u = Uo(r, s, a, l, c, _), h = Io(e), d = [];
|
|
1433
|
+
for (let v = 0; v < h; v++) {
|
|
1434
|
+
let m;
|
|
1244
1435
|
do
|
|
1245
|
-
|
|
1246
|
-
row: Math.floor(
|
|
1247
|
-
col: Math.floor(
|
|
1436
|
+
m = {
|
|
1437
|
+
row: Math.floor(u.random() * r),
|
|
1438
|
+
col: Math.floor(u.random() * s)
|
|
1248
1439
|
};
|
|
1249
|
-
while (
|
|
1250
|
-
(
|
|
1440
|
+
while (m.row === c.row && m.col === c.col || m.row === _.row && m.col === _.col || !Oo(u, m.row, m.col) || d.some(
|
|
1441
|
+
(C) => C.row === m.row && C.col === m.col
|
|
1251
1442
|
));
|
|
1252
|
-
d.push(
|
|
1443
|
+
d.push(m);
|
|
1253
1444
|
}
|
|
1254
1445
|
return {
|
|
1255
|
-
maze:
|
|
1446
|
+
maze: u,
|
|
1256
1447
|
playerPosition: c,
|
|
1257
|
-
exitPosition:
|
|
1448
|
+
exitPosition: _,
|
|
1258
1449
|
foodPositions: d,
|
|
1259
1450
|
totalFoodCount: h,
|
|
1260
1451
|
foodCollected: 0,
|
|
1261
1452
|
playerPath: [c],
|
|
1262
1453
|
visitCounts: { [`${c.row},${c.col}`]: 1 },
|
|
1263
1454
|
moveCount: 0,
|
|
1264
|
-
currentScore:
|
|
1455
|
+
currentScore: u.rows * u.cols * 5,
|
|
1265
1456
|
playerAtExit: !1,
|
|
1266
1457
|
isGameActive: !0,
|
|
1267
1458
|
levelTransitioning: !1
|
|
1268
1459
|
};
|
|
1269
|
-
},
|
|
1460
|
+
}, yt = ({
|
|
1270
1461
|
gameState: e,
|
|
1271
1462
|
setGameState: t,
|
|
1272
1463
|
config: o
|
|
1273
1464
|
}) => ({
|
|
1274
1465
|
generateCurrentLevelMaze: () => {
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1277
|
-
...
|
|
1278
|
-
...
|
|
1466
|
+
const i = Ct(e.currentLevel, o.current.levelConfig.flat());
|
|
1467
|
+
i && t((r) => ({
|
|
1468
|
+
...r,
|
|
1469
|
+
...i
|
|
1279
1470
|
}));
|
|
1280
1471
|
}
|
|
1281
|
-
}),
|
|
1282
|
-
const t = e.map((l) => l.length), o = t.reduce((l, a) => l + a, 0), n = e.length,
|
|
1472
|
+
}), wt = (e) => ve(() => {
|
|
1473
|
+
const t = e.map((l) => l.length), o = t.reduce((l, a) => l + a, 0), n = e.length, i = (l) => {
|
|
1283
1474
|
if (l < 1 || l > o) return 0;
|
|
1284
1475
|
let a = 0;
|
|
1285
1476
|
for (let c = 0; c < t.length; c++)
|
|
1286
1477
|
if (a += t[c], l <= a) return c + 1;
|
|
1287
1478
|
return 0;
|
|
1288
|
-
},
|
|
1479
|
+
}, r = (l) => l < 1 || l > n ? 0 : t.slice(0, l - 1).reduce((a, c) => a + c, 0) + 1, s = {
|
|
1289
1480
|
getTotalLevels: () => o,
|
|
1290
1481
|
getTotalTiers: () => n,
|
|
1291
1482
|
getTierLevelsRange: (l) => {
|
|
1292
1483
|
if (l < 1 || l > n) return [0, 0];
|
|
1293
|
-
const a =
|
|
1484
|
+
const a = r(l), c = a + t[l - 1] - 1;
|
|
1294
1485
|
return [a, c];
|
|
1295
1486
|
},
|
|
1296
|
-
getTierByLevel:
|
|
1297
|
-
getFirstLevelOfTier:
|
|
1487
|
+
getTierByLevel: i,
|
|
1488
|
+
getFirstLevelOfTier: r,
|
|
1298
1489
|
getLevelConfig: (l) => {
|
|
1299
1490
|
if (l < 1 || l > o) return null;
|
|
1300
|
-
const a =
|
|
1301
|
-
return e[a - 1][
|
|
1491
|
+
const a = i(l), c = r(a), _ = l - c;
|
|
1492
|
+
return e[a - 1][_];
|
|
1302
1493
|
},
|
|
1303
1494
|
getTierConfig: (l) => l < 1 || l > n ? null : e[l - 1],
|
|
1304
1495
|
isLevelUnlocked: (l, a) => l <= a,
|
|
1305
1496
|
isTierUnlocked: (l, a) => l <= a,
|
|
1306
1497
|
getNextLevelInfo: (l) => {
|
|
1307
1498
|
if (l >= o) return null;
|
|
1308
|
-
const a = l + 1, c =
|
|
1499
|
+
const a = l + 1, c = i(l), _ = i(a);
|
|
1309
1500
|
return {
|
|
1310
1501
|
nextLevel: a,
|
|
1311
|
-
nextTier:
|
|
1312
|
-
isTierChange:
|
|
1502
|
+
nextTier: _,
|
|
1503
|
+
isTierChange: _ > c
|
|
1313
1504
|
};
|
|
1314
1505
|
},
|
|
1315
1506
|
getCurrentTierProgress: (l, a) => {
|
|
1316
|
-
const [c,
|
|
1317
|
-
return { current:
|
|
1507
|
+
const [c, _] = s.getTierLevelsRange(a), u = l - c + 1, h = _ - c + 1;
|
|
1508
|
+
return { current: u, total: h };
|
|
1318
1509
|
},
|
|
1319
1510
|
isLastLevelInTier: (l) => {
|
|
1320
|
-
const a =
|
|
1511
|
+
const a = i(l), [, c] = s.getTierLevelsRange(a);
|
|
1321
1512
|
return l === c;
|
|
1322
1513
|
},
|
|
1323
1514
|
getPreviousLevelInfo: (l) => {
|
|
1324
1515
|
if (l <= 1) return null;
|
|
1325
|
-
const a = l - 1, c =
|
|
1516
|
+
const a = l - 1, c = i(l), _ = i(a);
|
|
1326
1517
|
return {
|
|
1327
1518
|
prevLevel: a,
|
|
1328
|
-
prevTier:
|
|
1329
|
-
isTierChange:
|
|
1519
|
+
prevTier: _,
|
|
1520
|
+
isTierChange: _ < c
|
|
1330
1521
|
};
|
|
1331
1522
|
}
|
|
1332
1523
|
};
|
|
1333
1524
|
return s;
|
|
1334
|
-
}, [e]),
|
|
1335
|
-
const { gameState: e, setGameState: t, resetGame: o, config: n } =
|
|
1336
|
-
s.getTierLevelsRange(1)
|
|
1337
|
-
), { generateCurrentLevelMaze: F } = dt({
|
|
1525
|
+
}, [e]), Do = () => {
|
|
1526
|
+
const { gameState: e, setGameState: t, resetGame: o, config: n } = _t(), i = n.current.i18n, r = n.current.levelConfig, s = wt(r), { showToast: l } = Ce(), { currentLevel: a, totalScore: c, levelScores: _, currentScore: u, showClue: h } = e, d = _[a] || 0, v = s.getTotalTiers(), [m, C] = $(!1), [g, p] = $(!1), [T, k] = $(!1), [E, P] = $(s.getTierLevelsRange(1)), { generateCurrentLevelMaze: F } = yt({
|
|
1338
1527
|
gameState: e,
|
|
1339
1528
|
setGameState: t,
|
|
1340
1529
|
config: n
|
|
1341
1530
|
});
|
|
1342
|
-
|
|
1343
|
-
|
|
1531
|
+
A(() => {
|
|
1532
|
+
P(
|
|
1344
1533
|
s.getTierLevelsRange(e.currentTier)
|
|
1345
1534
|
);
|
|
1346
1535
|
}, [e.currentTier]);
|
|
1347
|
-
const
|
|
1348
|
-
const
|
|
1349
|
-
s.isLevelUnlocked(
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1536
|
+
const M = (L) => {
|
|
1537
|
+
const Y = s.getFirstLevelOfTier(L);
|
|
1538
|
+
s.isLevelUnlocked(
|
|
1539
|
+
Y,
|
|
1540
|
+
e.highestUnlockedLevel
|
|
1541
|
+
) && (t((Nt) => ({ ...Nt, currentTier: L })), N(Y));
|
|
1542
|
+
}, N = (L) => {
|
|
1543
|
+
s.isLevelUnlocked(L, e.highestUnlockedLevel) && (t((Y) => ({
|
|
1544
|
+
...Y,
|
|
1545
|
+
currentLevel: L
|
|
1354
1546
|
})), F(), l(
|
|
1355
|
-
|
|
1547
|
+
i.levelGoToast.replace("%LEVEL%", L.toString()),
|
|
1356
1548
|
"success"
|
|
1357
1549
|
));
|
|
1358
|
-
},
|
|
1359
|
-
|
|
1360
|
-
},
|
|
1361
|
-
|
|
1362
|
-
},
|
|
1363
|
-
|
|
1364
|
-
},
|
|
1365
|
-
|
|
1366
|
-
},
|
|
1367
|
-
t((
|
|
1368
|
-
...
|
|
1369
|
-
showClue: !
|
|
1370
|
-
currentScore: Math.floor(
|
|
1550
|
+
}, S = () => {
|
|
1551
|
+
C(!0);
|
|
1552
|
+
}, z = () => {
|
|
1553
|
+
C(!1);
|
|
1554
|
+
}, U = () => {
|
|
1555
|
+
k(!0);
|
|
1556
|
+
}, bt = () => {
|
|
1557
|
+
k(!1);
|
|
1558
|
+
}, kt = () => {
|
|
1559
|
+
t((L) => (l(L.showClue ? i.cluePathDisabled : i.cluePathEnabled), {
|
|
1560
|
+
...L,
|
|
1561
|
+
showClue: !L.showClue,
|
|
1562
|
+
currentScore: Math.floor(L.currentScore / 2)
|
|
1371
1563
|
// half the current score
|
|
1372
|
-
})),
|
|
1373
|
-
},
|
|
1564
|
+
})), k(!1);
|
|
1565
|
+
}, Tt = () => {
|
|
1374
1566
|
p(!0);
|
|
1375
|
-
},
|
|
1376
|
-
o(), p(!1), l(
|
|
1377
|
-
},
|
|
1567
|
+
}, zt = () => {
|
|
1568
|
+
o(), p(!1), l(i.resetDoneToast);
|
|
1569
|
+
}, Pt = () => {
|
|
1378
1570
|
p(!1);
|
|
1379
1571
|
};
|
|
1380
1572
|
return /* @__PURE__ */ f("div", { class: "game-panel-container", children: [
|
|
1381
1573
|
/* @__PURE__ */ f("div", { className: "game-controls", children: [
|
|
1382
1574
|
/* @__PURE__ */ f("div", { className: "selectors-container", children: [
|
|
1383
1575
|
/* @__PURE__ */ f(
|
|
1384
|
-
|
|
1576
|
+
xo,
|
|
1385
1577
|
{
|
|
1386
|
-
i18n:
|
|
1387
|
-
totalTiers:
|
|
1578
|
+
i18n: i,
|
|
1579
|
+
totalTiers: v,
|
|
1388
1580
|
currentTier: e.currentTier,
|
|
1389
1581
|
highestUnlockedTier: e.highestUnlockedTier,
|
|
1390
|
-
onTierChange:
|
|
1582
|
+
onTierChange: M,
|
|
1391
1583
|
disabled: e.levelTransitioning
|
|
1392
1584
|
}
|
|
1393
1585
|
),
|
|
1394
1586
|
/* @__PURE__ */ f(
|
|
1395
|
-
|
|
1587
|
+
Eo,
|
|
1396
1588
|
{
|
|
1397
|
-
i18n:
|
|
1398
|
-
levelsRange:
|
|
1589
|
+
i18n: i,
|
|
1590
|
+
levelsRange: E,
|
|
1399
1591
|
currentLevel: e.currentLevel,
|
|
1400
1592
|
highestUnlockedLevel: e.highestUnlockedLevel,
|
|
1401
|
-
onLevelChange:
|
|
1593
|
+
onLevelChange: N,
|
|
1402
1594
|
disabled: e.levelTransitioning
|
|
1403
1595
|
}
|
|
1404
1596
|
)
|
|
@@ -1406,21 +1598,21 @@ const so = (e, t, o) => {
|
|
|
1406
1598
|
/* @__PURE__ */ f("div", { className: "score-container", children: [
|
|
1407
1599
|
/* @__PURE__ */ f("div", { className: "score-box currentscore", children: [
|
|
1408
1600
|
/* @__PURE__ */ f("span", { className: "score-label", children: [
|
|
1409
|
-
|
|
1601
|
+
i.levelScore,
|
|
1410
1602
|
":"
|
|
1411
1603
|
] }),
|
|
1412
|
-
/* @__PURE__ */ f("span", { className: "score-data", children:
|
|
1604
|
+
/* @__PURE__ */ f("span", { className: "score-data", children: u })
|
|
1413
1605
|
] }),
|
|
1414
1606
|
/* @__PURE__ */ f("div", { className: "score-box bestscore", children: [
|
|
1415
1607
|
/* @__PURE__ */ f("span", { className: "score-label", children: [
|
|
1416
|
-
|
|
1608
|
+
i.bestScore,
|
|
1417
1609
|
":"
|
|
1418
1610
|
] }),
|
|
1419
1611
|
/* @__PURE__ */ f("span", { className: "score-data", children: d })
|
|
1420
1612
|
] }),
|
|
1421
1613
|
/* @__PURE__ */ f("div", { className: "score-box totalscore", children: [
|
|
1422
1614
|
/* @__PURE__ */ f("span", { className: "score-label", children: [
|
|
1423
|
-
|
|
1615
|
+
i.total,
|
|
1424
1616
|
":"
|
|
1425
1617
|
] }),
|
|
1426
1618
|
/* @__PURE__ */ f("span", { className: "score-data", children: c })
|
|
@@ -1428,20 +1620,20 @@ const so = (e, t, o) => {
|
|
|
1428
1620
|
] })
|
|
1429
1621
|
] }),
|
|
1430
1622
|
/* @__PURE__ */ f("div", { className: "game-settings", children: /* @__PURE__ */ f(
|
|
1431
|
-
|
|
1623
|
+
So,
|
|
1432
1624
|
{
|
|
1433
|
-
onClick:
|
|
1625
|
+
onClick: S,
|
|
1434
1626
|
className: "game-settings-icon"
|
|
1435
1627
|
}
|
|
1436
1628
|
) }),
|
|
1437
1629
|
/* @__PURE__ */ f(
|
|
1438
|
-
|
|
1630
|
+
le,
|
|
1439
1631
|
{
|
|
1440
|
-
isOpen:
|
|
1441
|
-
title:
|
|
1632
|
+
isOpen: m,
|
|
1633
|
+
title: i.settings,
|
|
1442
1634
|
noConfirm: !0,
|
|
1443
|
-
cancelText:
|
|
1444
|
-
onCancel:
|
|
1635
|
+
cancelText: i.close,
|
|
1636
|
+
onCancel: z,
|
|
1445
1637
|
children: [
|
|
1446
1638
|
/* @__PURE__ */ f("div", { className: "settings-item-box", children: [
|
|
1447
1639
|
/* @__PURE__ */ f("div", {}),
|
|
@@ -1449,12 +1641,13 @@ const so = (e, t, o) => {
|
|
|
1449
1641
|
"button",
|
|
1450
1642
|
{
|
|
1451
1643
|
className: `settings-clue-button ${h ? "clue-on" : "clue-off"}`,
|
|
1644
|
+
disabled: h,
|
|
1452
1645
|
title: "Toggle Clue",
|
|
1453
|
-
onClick:
|
|
1454
|
-
children: h ?
|
|
1646
|
+
onClick: U,
|
|
1647
|
+
children: h ? i.clueOn : i.clueOff
|
|
1455
1648
|
}
|
|
1456
1649
|
),
|
|
1457
|
-
/* @__PURE__ */ f("div", { className: "settings-item-tip", children:
|
|
1650
|
+
/* @__PURE__ */ f("div", { className: "settings-item-tip", children: i.clueTip })
|
|
1458
1651
|
] }),
|
|
1459
1652
|
/* @__PURE__ */ f("div", { className: "settings-item-box", children: [
|
|
1460
1653
|
/* @__PURE__ */ f(
|
|
@@ -1462,124 +1655,124 @@ const so = (e, t, o) => {
|
|
|
1462
1655
|
{
|
|
1463
1656
|
className: "settings-reset-button",
|
|
1464
1657
|
title: "Reset Game",
|
|
1465
|
-
onClick:
|
|
1466
|
-
children:
|
|
1658
|
+
onClick: Tt,
|
|
1659
|
+
children: i.reset
|
|
1467
1660
|
}
|
|
1468
1661
|
),
|
|
1469
|
-
/* @__PURE__ */ f("div", { className: "settings-item-tip", children:
|
|
1662
|
+
/* @__PURE__ */ f("div", { className: "settings-item-tip", children: i.resetTip })
|
|
1470
1663
|
] })
|
|
1471
1664
|
]
|
|
1472
1665
|
}
|
|
1473
1666
|
),
|
|
1474
1667
|
/* @__PURE__ */ f(
|
|
1475
|
-
|
|
1668
|
+
le,
|
|
1476
1669
|
{
|
|
1477
|
-
isOpen:
|
|
1478
|
-
title:
|
|
1479
|
-
message:
|
|
1480
|
-
confirmText:
|
|
1481
|
-
cancelText:
|
|
1482
|
-
onConfirm:
|
|
1483
|
-
onCancel:
|
|
1670
|
+
isOpen: g,
|
|
1671
|
+
title: i.confirmReset,
|
|
1672
|
+
message: i.confirmResetMessage,
|
|
1673
|
+
confirmText: i.reset,
|
|
1674
|
+
cancelText: i.cancel,
|
|
1675
|
+
onConfirm: zt,
|
|
1676
|
+
onCancel: Pt
|
|
1484
1677
|
}
|
|
1485
1678
|
),
|
|
1486
1679
|
/* @__PURE__ */ f(
|
|
1487
|
-
|
|
1680
|
+
le,
|
|
1488
1681
|
{
|
|
1489
|
-
isOpen:
|
|
1490
|
-
title:
|
|
1491
|
-
message:
|
|
1492
|
-
confirmText:
|
|
1493
|
-
cancelText:
|
|
1494
|
-
onConfirm:
|
|
1495
|
-
onCancel:
|
|
1682
|
+
isOpen: T,
|
|
1683
|
+
title: i.confirmClue,
|
|
1684
|
+
message: i.confirmClueMessage,
|
|
1685
|
+
confirmText: i.confirm,
|
|
1686
|
+
cancelText: i.cancel,
|
|
1687
|
+
onConfirm: kt,
|
|
1688
|
+
onCancel: bt
|
|
1496
1689
|
}
|
|
1497
1690
|
)
|
|
1498
1691
|
] });
|
|
1499
|
-
},
|
|
1692
|
+
}, Wo = ({
|
|
1500
1693
|
message: e,
|
|
1501
1694
|
visible: t,
|
|
1502
1695
|
duration: o = 2e3,
|
|
1503
1696
|
onClose: n,
|
|
1504
|
-
position:
|
|
1505
|
-
type:
|
|
1506
|
-
}) => e ? (
|
|
1697
|
+
position: i = "center",
|
|
1698
|
+
type: r = "info"
|
|
1699
|
+
}) => e ? (A(() => {
|
|
1507
1700
|
let s;
|
|
1508
1701
|
return t && o > 0 && n && (s = setTimeout(() => {
|
|
1509
1702
|
n();
|
|
1510
1703
|
}, o)), () => {
|
|
1511
1704
|
s && clearTimeout(s);
|
|
1512
1705
|
};
|
|
1513
|
-
}, [t, o, n]), /* @__PURE__ */ f("div", { className: `toast-container position-${
|
|
1514
|
-
|
|
1706
|
+
}, [t, o, n]), /* @__PURE__ */ f("div", { className: `toast-container position-${i}`, children: /* @__PURE__ */ f("div", { className: `toast-message type-${r} ${t ? "toast-visible" : ""}`, children: e }) })) : null, jo = (e, t, o) => {
|
|
1707
|
+
A(() => {
|
|
1515
1708
|
const n = () => {
|
|
1516
|
-
const
|
|
1517
|
-
if (!r) return;
|
|
1518
|
-
const i = r.parentElement;
|
|
1709
|
+
const i = e.current;
|
|
1519
1710
|
if (!i) return;
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1711
|
+
const r = i.parentElement;
|
|
1712
|
+
if (!r) return;
|
|
1713
|
+
const s = r.clientWidth, l = window.devicePixelRatio || 1;
|
|
1714
|
+
i.style.width = `${s}px`, i.style.height = `${s}px`, i.width = s * l, i.height = s * l, t(e, o.current);
|
|
1522
1715
|
};
|
|
1523
1716
|
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
1524
1717
|
}, [e]);
|
|
1525
|
-
},
|
|
1718
|
+
}, Ve = {
|
|
1526
1719
|
ArrowUp: [-1, 0],
|
|
1527
1720
|
ArrowDown: [1, 0],
|
|
1528
1721
|
ArrowLeft: [0, -1],
|
|
1529
1722
|
ArrowRight: [0, 1]
|
|
1530
|
-
},
|
|
1723
|
+
}, Ho = ({
|
|
1531
1724
|
containerRef: e,
|
|
1532
1725
|
gameState: t,
|
|
1533
1726
|
setGameState: o,
|
|
1534
1727
|
onFoodCollected: n,
|
|
1535
|
-
onFoodNotAllCollected:
|
|
1728
|
+
onFoodNotAllCollected: i
|
|
1536
1729
|
}) => {
|
|
1537
|
-
|
|
1538
|
-
const
|
|
1730
|
+
A(() => {
|
|
1731
|
+
const r = (a) => {
|
|
1539
1732
|
if (!t.isGameActive || !t.maze) return;
|
|
1540
|
-
const [c,
|
|
1541
|
-
if (!t.maze.isValid(d,
|
|
1542
|
-
const
|
|
1543
|
-
if (c === -1 &&
|
|
1733
|
+
const [c, _] = Ve[a], { row: u, col: h } = t.playerPosition, d = u + c, v = h + _;
|
|
1734
|
+
if (!t.maze.isValid(d, v)) return;
|
|
1735
|
+
const m = t.maze.grid[u][h];
|
|
1736
|
+
if (c === -1 && m.walls.top || c === 1 && m.walls.bottom || _ === -1 && m.walls.left || _ === 1 && m.walls.right)
|
|
1544
1737
|
return;
|
|
1545
|
-
const
|
|
1738
|
+
const C = { row: d, col: v }, g = `${d},${v}`;
|
|
1546
1739
|
o((p) => {
|
|
1547
|
-
const
|
|
1548
|
-
(
|
|
1740
|
+
const T = p.foodPositions.some(
|
|
1741
|
+
(S) => S.row === d && S.col === v
|
|
1549
1742
|
);
|
|
1550
|
-
|
|
1551
|
-
const
|
|
1743
|
+
T && n();
|
|
1744
|
+
const k = Math.max(
|
|
1552
1745
|
0,
|
|
1553
1746
|
p.currentScore - 1
|
|
1554
|
-
),
|
|
1555
|
-
return
|
|
1747
|
+
), E = `${u},${h}-${d},${v}`, P = d === p.exitPosition.row && v === p.exitPosition.col, F = T ? p.foodCollected + 1 : p.foodCollected, M = F === p.totalFoodCount, N = P && M;
|
|
1748
|
+
return P && !M && i(), {
|
|
1556
1749
|
...p,
|
|
1557
|
-
playerPosition:
|
|
1558
|
-
playerPath: [...p.playerPath,
|
|
1750
|
+
playerPosition: C,
|
|
1751
|
+
playerPath: [...p.playerPath, C],
|
|
1559
1752
|
foodPositions: p.foodPositions.filter(
|
|
1560
|
-
(
|
|
1753
|
+
(S) => !(S.row === d && S.col === v)
|
|
1561
1754
|
),
|
|
1562
1755
|
foodCollected: F,
|
|
1563
|
-
currentScore:
|
|
1756
|
+
currentScore: k,
|
|
1564
1757
|
visitCounts: {
|
|
1565
1758
|
...p.visitCounts,
|
|
1566
|
-
[
|
|
1567
|
-
[
|
|
1759
|
+
[E]: (p.visitCounts[E] || 0) + 1,
|
|
1760
|
+
[g]: (p.visitCounts[g] || 0) + 1
|
|
1568
1761
|
},
|
|
1569
1762
|
moveCount: p.moveCount + 1,
|
|
1570
|
-
playerAtExit:
|
|
1571
|
-
isGameActive: !
|
|
1572
|
-
levelTransitioning:
|
|
1763
|
+
playerAtExit: P,
|
|
1764
|
+
isGameActive: !N,
|
|
1765
|
+
levelTransitioning: N
|
|
1573
1766
|
};
|
|
1574
1767
|
});
|
|
1575
1768
|
}, s = (a) => {
|
|
1576
1769
|
if (!t.isGameActive || !t.maze) return;
|
|
1577
1770
|
const c = a.key;
|
|
1578
|
-
c in
|
|
1771
|
+
c in Ve && (a.preventDefault(), r(c));
|
|
1579
1772
|
}, l = (a) => {
|
|
1580
1773
|
if (a.preventDefault(), !t.isGameActive || !t.maze) return;
|
|
1581
|
-
const c = a.touches[0],
|
|
1582
|
-
|
|
1774
|
+
const c = a.touches[0], _ = document.elementFromPoint(c.clientX, c.clientY);
|
|
1775
|
+
_ && (_.classList.contains("maze-up") ? r("ArrowUp") : _.classList.contains("maze-down") ? r("ArrowDown") : _.classList.contains("maze-left") ? r("ArrowLeft") : _.classList.contains("maze-right") && r("ArrowRight"));
|
|
1583
1776
|
};
|
|
1584
1777
|
return window.addEventListener("keydown", s), e.current?.addEventListener("touchstart", l, {
|
|
1585
1778
|
passive: !1
|
|
@@ -1592,14 +1785,14 @@ const so = (e, t, o) => {
|
|
|
1592
1785
|
t.playerPosition,
|
|
1593
1786
|
t.exitPosition
|
|
1594
1787
|
]);
|
|
1595
|
-
},
|
|
1788
|
+
}, Go = ({
|
|
1596
1789
|
gameState: e,
|
|
1597
1790
|
setGameState: t,
|
|
1598
1791
|
config: o,
|
|
1599
1792
|
onLevelComplete: n,
|
|
1600
|
-
onTierUnlocked:
|
|
1793
|
+
onTierUnlocked: i
|
|
1601
1794
|
}) => {
|
|
1602
|
-
|
|
1795
|
+
A(() => {
|
|
1603
1796
|
if (e.levelTransitioning) {
|
|
1604
1797
|
n();
|
|
1605
1798
|
const l = setTimeout(() => {
|
|
@@ -1611,27 +1804,27 @@ const so = (e, t, o) => {
|
|
|
1611
1804
|
return () => clearTimeout(l);
|
|
1612
1805
|
}
|
|
1613
1806
|
}, [e.levelTransitioning]);
|
|
1614
|
-
const
|
|
1615
|
-
const c =
|
|
1807
|
+
const r = wt(o.current.levelConfig), s = (l, a) => {
|
|
1808
|
+
const c = r.getNextLevelInfo(
|
|
1616
1809
|
e.currentLevel
|
|
1617
1810
|
);
|
|
1618
1811
|
if (!c) return;
|
|
1619
|
-
const { nextLevel:
|
|
1620
|
-
d && t((
|
|
1621
|
-
h &&
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1812
|
+
const { nextLevel: _, nextTier: u, isTierChange: h } = c, d = Ct(_, a.flat());
|
|
1813
|
+
d && t((v) => {
|
|
1814
|
+
h && i(u);
|
|
1815
|
+
const m = { ...v.levelScores };
|
|
1816
|
+
return m[v.currentLevel] = Math.max(
|
|
1624
1817
|
l,
|
|
1625
|
-
|
|
1818
|
+
m[v.currentLevel] || 0
|
|
1626
1819
|
), {
|
|
1627
|
-
...
|
|
1820
|
+
...v,
|
|
1628
1821
|
...d,
|
|
1629
|
-
currentLevel:
|
|
1630
|
-
currentTier:
|
|
1631
|
-
highestUnlockedLevel: Math.max(
|
|
1632
|
-
highestUnlockedTier: Math.max(
|
|
1633
|
-
levelScores:
|
|
1634
|
-
totalScore: Object.values(
|
|
1822
|
+
currentLevel: _,
|
|
1823
|
+
currentTier: u,
|
|
1824
|
+
highestUnlockedLevel: Math.max(v.highestUnlockedLevel, _),
|
|
1825
|
+
highestUnlockedTier: Math.max(v.highestUnlockedTier, u),
|
|
1826
|
+
levelScores: m,
|
|
1827
|
+
totalScore: Object.values(m).reduce((C, g) => C + g, 0),
|
|
1635
1828
|
showClue: !1,
|
|
1636
1829
|
// reset to false on new level
|
|
1637
1830
|
isGameActive: !0,
|
|
@@ -1643,128 +1836,140 @@ const so = (e, t, o) => {
|
|
|
1643
1836
|
handleLevelComplete: s
|
|
1644
1837
|
};
|
|
1645
1838
|
};
|
|
1646
|
-
function
|
|
1647
|
-
const { ctx: o, width: n, height:
|
|
1839
|
+
function Bo(e, t) {
|
|
1840
|
+
const { ctx: o, width: n, height: i, maze: r } = e;
|
|
1648
1841
|
t.playerColor = e.playerAtExit ? t.playerAtExitColor : t.playerColor;
|
|
1649
1842
|
const {
|
|
1650
1843
|
padding: s,
|
|
1651
1844
|
wallWidth: l,
|
|
1652
1845
|
wallColor: a,
|
|
1653
1846
|
playerColor: c,
|
|
1654
|
-
exitColor:
|
|
1655
|
-
foodColor:
|
|
1847
|
+
exitColor: _,
|
|
1848
|
+
foodColor: u,
|
|
1656
1849
|
clueColor: h,
|
|
1657
1850
|
backgroundColor: d
|
|
1658
|
-
} = t,
|
|
1659
|
-
o.clearRect(0, 0, n,
|
|
1660
|
-
cellWidth:
|
|
1661
|
-
cellHeight:
|
|
1851
|
+
} = t, v = r.cols, m = r.rows, C = (n - s * 2) / v, g = (i - s * 2) / m;
|
|
1852
|
+
o.clearRect(0, 0, n, i), o.save(), o.fillStyle = d, o.fillRect(0, 0, n, i), o.restore(), e.showClue && e.playerPath && e.playerPath.length > 0 && Ko(e, {
|
|
1853
|
+
cellWidth: C,
|
|
1854
|
+
cellHeight: g,
|
|
1662
1855
|
padding: s,
|
|
1663
1856
|
clueColor: h
|
|
1664
|
-
}),
|
|
1665
|
-
cellWidth:
|
|
1666
|
-
cellHeight:
|
|
1857
|
+
}), Vo(e, {
|
|
1858
|
+
cellWidth: C,
|
|
1859
|
+
cellHeight: g,
|
|
1667
1860
|
padding: s,
|
|
1668
1861
|
wallColor: a,
|
|
1669
1862
|
wallWidth: l
|
|
1670
|
-
}),
|
|
1671
|
-
cellWidth:
|
|
1672
|
-
cellHeight:
|
|
1863
|
+
}), Yo(e, {
|
|
1864
|
+
cellWidth: C,
|
|
1865
|
+
cellHeight: g,
|
|
1673
1866
|
padding: s,
|
|
1674
|
-
foodColor:
|
|
1675
|
-
}), e.playerAtExit ||
|
|
1676
|
-
cellWidth:
|
|
1677
|
-
cellHeight:
|
|
1867
|
+
foodColor: u
|
|
1868
|
+
}), e.playerAtExit || Xo(e, {
|
|
1869
|
+
cellWidth: C,
|
|
1870
|
+
cellHeight: g,
|
|
1678
1871
|
padding: s,
|
|
1679
|
-
exitColor:
|
|
1680
|
-
}),
|
|
1681
|
-
cellWidth:
|
|
1682
|
-
cellHeight:
|
|
1872
|
+
exitColor: _
|
|
1873
|
+
}), qo(e, {
|
|
1874
|
+
cellWidth: C,
|
|
1875
|
+
cellHeight: g,
|
|
1683
1876
|
padding: s,
|
|
1684
1877
|
playerColor: c
|
|
1685
1878
|
});
|
|
1686
1879
|
}
|
|
1687
|
-
function
|
|
1688
|
-
const { ctx: o, maze: n } = e, { cellWidth:
|
|
1880
|
+
function Vo(e, t) {
|
|
1881
|
+
const { ctx: o, maze: n } = e, { cellWidth: i, cellHeight: r, padding: s, wallColor: l, wallWidth: a } = t;
|
|
1689
1882
|
o.save(), o.strokeStyle = l, o.lineWidth = a, o.lineCap = "round", o.beginPath();
|
|
1690
1883
|
for (let c = 0; c < n.rows; c++)
|
|
1691
|
-
for (let
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1884
|
+
for (let _ = 0; _ < n.cols; _++) {
|
|
1885
|
+
const u = n.grid[c][_], h = s + _ * i, d = s + c * r;
|
|
1886
|
+
u.walls.top && (o.moveTo(h, d), o.lineTo(h + i, d)), u.walls.right && (o.moveTo(h + i, d), o.lineTo(h + i, d + r)), u.walls.bottom && (o.moveTo(h + i, d + r), o.lineTo(h, d + r)), u.walls.left && (o.moveTo(h, d + r), o.lineTo(h, d));
|
|
1694
1887
|
}
|
|
1695
1888
|
o.stroke(), o.restore();
|
|
1696
1889
|
}
|
|
1697
|
-
function
|
|
1698
|
-
const { ctx: o, playerPosition: n } = e, { cellWidth:
|
|
1890
|
+
function qo(e, t) {
|
|
1891
|
+
const { ctx: o, playerPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, playerColor: l } = t, { x: a, y: c } = q(
|
|
1699
1892
|
n.row,
|
|
1700
1893
|
n.col,
|
|
1701
|
-
r,
|
|
1702
1894
|
i,
|
|
1895
|
+
r,
|
|
1703
1896
|
s
|
|
1704
|
-
),
|
|
1705
|
-
o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c,
|
|
1897
|
+
), _ = Math.min(i, r) * 0.35;
|
|
1898
|
+
o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, _, 0, Math.PI * 2), o.fill(), o.restore();
|
|
1706
1899
|
}
|
|
1707
|
-
function
|
|
1708
|
-
const { ctx: o, exitPosition: n } = e, { cellWidth:
|
|
1900
|
+
function Xo(e, t) {
|
|
1901
|
+
const { ctx: o, exitPosition: n } = e, { cellWidth: i, cellHeight: r, padding: s, exitColor: l } = t, { x: a, y: c } = q(
|
|
1709
1902
|
n.row,
|
|
1710
1903
|
n.col,
|
|
1711
|
-
r,
|
|
1712
1904
|
i,
|
|
1905
|
+
r,
|
|
1713
1906
|
s
|
|
1714
|
-
),
|
|
1715
|
-
o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c,
|
|
1907
|
+
), _ = Math.min(i, r) * 0.35;
|
|
1908
|
+
o.save(), o.fillStyle = l, o.beginPath(), o.arc(a, c, _, 0, Math.PI * 2), o.fill(), o.restore();
|
|
1716
1909
|
}
|
|
1717
|
-
function
|
|
1718
|
-
const { ctx: o, foodPositions: n } = e, { cellWidth:
|
|
1910
|
+
function Yo(e, t) {
|
|
1911
|
+
const { ctx: o, foodPositions: n } = e, { cellWidth: i, cellHeight: r, padding: s, foodColor: l } = t;
|
|
1719
1912
|
o.fillStyle = l;
|
|
1720
|
-
const a = Math.min(
|
|
1913
|
+
const a = Math.min(i, r) * 0.25;
|
|
1721
1914
|
n.forEach((c) => {
|
|
1722
|
-
const { x:
|
|
1915
|
+
const { x: _, y: u } = q(
|
|
1723
1916
|
c.row,
|
|
1724
1917
|
c.col,
|
|
1725
|
-
r,
|
|
1726
1918
|
i,
|
|
1919
|
+
r,
|
|
1727
1920
|
s
|
|
1728
1921
|
);
|
|
1729
|
-
|
|
1922
|
+
Jo(o, _, u, a * 1.2, 5, a * 0.6);
|
|
1730
1923
|
});
|
|
1731
1924
|
}
|
|
1732
|
-
function
|
|
1925
|
+
function Jo(e, t, o, n, i, r) {
|
|
1733
1926
|
e.save(), e.beginPath();
|
|
1734
|
-
for (let s = 0; s <
|
|
1735
|
-
const l = s % 2 === 0 ? n :
|
|
1927
|
+
for (let s = 0; s < i * 2; s++) {
|
|
1928
|
+
const l = s % 2 === 0 ? n : r, a = Math.PI * s / i;
|
|
1736
1929
|
e.lineTo(t + l * Math.sin(a), o + l * Math.cos(a));
|
|
1737
1930
|
}
|
|
1738
1931
|
e.closePath(), e.fill(), e.restore();
|
|
1739
1932
|
}
|
|
1740
|
-
function
|
|
1741
|
-
const { ctx: o, playerPath: n, visitCounts:
|
|
1742
|
-
if (!(!n || n.length < 2 || !
|
|
1933
|
+
function Ko(e, t) {
|
|
1934
|
+
const { ctx: o, playerPath: n, visitCounts: i } = e, { cellWidth: r, cellHeight: s, padding: l, clueColor: a } = t;
|
|
1935
|
+
if (!(!n || n.length < 2 || !i)) {
|
|
1743
1936
|
o.save();
|
|
1744
1937
|
for (let c = 1; c < n.length; c++) {
|
|
1745
|
-
const
|
|
1938
|
+
const _ = n[c - 1], u = n[c], h = `${_.row},${_.col}-${u.row},${u.col}`, d = `${u.row},${u.col}-${_.row},${_.col}`, v = (i[h] || 0) + (i[d] || 0), m = Math.min(0.2 + v * 0.1, 0.9), C = Math.max(3, r * 0.1) + v * 0.5;
|
|
1746
1939
|
try {
|
|
1747
|
-
o.strokeStyle = a.replace(")", `, ${
|
|
1940
|
+
o.strokeStyle = a.replace(")", `, ${m})`).replace("rgb(", "rgba(");
|
|
1748
1941
|
} catch {
|
|
1749
|
-
o.strokeStyle = `rgba(255, 0, 0, ${
|
|
1942
|
+
o.strokeStyle = `rgba(255, 0, 0, ${m})`;
|
|
1750
1943
|
}
|
|
1751
|
-
o.lineWidth =
|
|
1752
|
-
const { x:
|
|
1753
|
-
|
|
1944
|
+
o.lineWidth = C, o.lineCap = "round", o.lineJoin = "round";
|
|
1945
|
+
const { x: g, y: p } = q(
|
|
1946
|
+
_.row,
|
|
1947
|
+
_.col,
|
|
1948
|
+
r,
|
|
1949
|
+
s,
|
|
1950
|
+
l
|
|
1951
|
+
), { x: T, y: k } = q(
|
|
1952
|
+
u.row,
|
|
1953
|
+
u.col,
|
|
1954
|
+
r,
|
|
1955
|
+
s,
|
|
1956
|
+
l
|
|
1957
|
+
);
|
|
1958
|
+
o.beginPath(), o.moveTo(g, p), o.lineTo(T, k), o.stroke();
|
|
1754
1959
|
}
|
|
1755
1960
|
o.restore();
|
|
1756
1961
|
}
|
|
1757
1962
|
}
|
|
1758
|
-
function
|
|
1963
|
+
function q(e, t, o, n, i) {
|
|
1759
1964
|
return {
|
|
1760
|
-
x:
|
|
1761
|
-
y:
|
|
1965
|
+
x: i + t * o + o / 2,
|
|
1966
|
+
y: i + e * n + n / 2
|
|
1762
1967
|
};
|
|
1763
1968
|
}
|
|
1764
|
-
const
|
|
1765
|
-
const { message: e, visible: t, type: o, hideToast: n } =
|
|
1969
|
+
const Zo = new co(), Qo = () => {
|
|
1970
|
+
const { message: e, visible: t, type: o, hideToast: n } = Ce();
|
|
1766
1971
|
return /* @__PURE__ */ f(
|
|
1767
|
-
|
|
1972
|
+
Wo,
|
|
1768
1973
|
{
|
|
1769
1974
|
message: e,
|
|
1770
1975
|
visible: t,
|
|
@@ -1773,10 +1978,10 @@ const wo = () => {
|
|
|
1773
1978
|
position: "top"
|
|
1774
1979
|
}
|
|
1775
1980
|
);
|
|
1776
|
-
},
|
|
1777
|
-
const { gameState: e, setGameState: t, config: o } =
|
|
1778
|
-
|
|
1779
|
-
|
|
1981
|
+
}, en = () => {
|
|
1982
|
+
const { gameState: e, setGameState: t, config: o } = _t(), n = G(null), i = G(null), r = G(e), s = o.current.i18n, { showToast: l } = Ce();
|
|
1983
|
+
A(() => {
|
|
1984
|
+
r.current = e;
|
|
1780
1985
|
}, [e]);
|
|
1781
1986
|
const a = () => {
|
|
1782
1987
|
const h = e.totalFoodCount - e.foodCollected - 1;
|
|
@@ -1794,45 +1999,51 @@ const wo = () => {
|
|
|
1794
1999
|
s.warnNotAllFoodCollectedToast.replace("%NUM%", h.toString()),
|
|
1795
2000
|
"warning"
|
|
1796
2001
|
);
|
|
1797
|
-
},
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
{
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
2002
|
+
}, _ = (h, d) => {
|
|
2003
|
+
const v = h.current?.getContext("2d");
|
|
2004
|
+
if (v && d.maze) {
|
|
2005
|
+
const m = o.current.renderConfig || {}, g = o.current.levelConfig.flat()[d.currentLevel - 1];
|
|
2006
|
+
g.wallWidth ? m.wallWidth = g.wallWidth : d.currentLevel > 40 && (m.wallWidth -= m.wallWidth * 0.05 * (d.currentLevel - 40), m.wallWidth = Math.max(
|
|
2007
|
+
m.wallWidth,
|
|
2008
|
+
m.minWallWidth
|
|
2009
|
+
)), Bo(
|
|
2010
|
+
{
|
|
2011
|
+
ctx: v,
|
|
2012
|
+
width: h.current.width,
|
|
2013
|
+
height: h.current.height,
|
|
2014
|
+
maze: d.maze,
|
|
2015
|
+
playerPosition: d.playerPosition,
|
|
2016
|
+
exitPosition: d.exitPosition,
|
|
2017
|
+
foodPositions: d.foodPositions,
|
|
2018
|
+
showClue: d.showClue,
|
|
2019
|
+
playerPath: d.playerPath,
|
|
2020
|
+
visitCounts: d.visitCounts,
|
|
2021
|
+
playerAtExit: d.playerAtExit
|
|
2022
|
+
},
|
|
2023
|
+
m
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
1815
2026
|
};
|
|
1816
|
-
|
|
2027
|
+
A(() => {
|
|
1817
2028
|
l(s.useArrowKeyTips, "info", 3e3);
|
|
1818
|
-
}, []),
|
|
1819
|
-
const { generateCurrentLevelMaze:
|
|
2029
|
+
}, []), jo(i, _, r);
|
|
2030
|
+
const { generateCurrentLevelMaze: u } = yt({
|
|
1820
2031
|
gameState: e,
|
|
1821
2032
|
setGameState: t,
|
|
1822
2033
|
config: o
|
|
1823
2034
|
});
|
|
1824
|
-
return
|
|
2035
|
+
return Ho({
|
|
1825
2036
|
containerRef: n,
|
|
1826
2037
|
gameState: e,
|
|
1827
2038
|
setGameState: t,
|
|
1828
2039
|
onFoodCollected: a,
|
|
1829
2040
|
onFoodNotAllCollected: c
|
|
1830
|
-
}),
|
|
2041
|
+
}), Go({
|
|
1831
2042
|
gameState: e,
|
|
1832
2043
|
setGameState: t,
|
|
1833
2044
|
config: o,
|
|
1834
2045
|
onLevelComplete: () => {
|
|
1835
|
-
l(s.levelCompleteToast, "success");
|
|
2046
|
+
Zo.addConfetti(), l(s.levelCompleteToast, "success");
|
|
1836
2047
|
},
|
|
1837
2048
|
onTierUnlocked: (h) => {
|
|
1838
2049
|
l(
|
|
@@ -1840,19 +2051,19 @@ const wo = () => {
|
|
|
1840
2051
|
"success"
|
|
1841
2052
|
);
|
|
1842
2053
|
}
|
|
1843
|
-
}),
|
|
1844
|
-
e.isGameActive && !e.levelTransitioning &&
|
|
2054
|
+
}), A(() => {
|
|
2055
|
+
e.isGameActive && !e.levelTransitioning && u();
|
|
1845
2056
|
}, [
|
|
1846
2057
|
e.currentLevel,
|
|
1847
2058
|
e.isGameActive,
|
|
1848
2059
|
e.levelTransitioning
|
|
1849
|
-
]),
|
|
1850
|
-
|
|
2060
|
+
]), A(() => {
|
|
2061
|
+
i.current && e.maze && _(i, e);
|
|
1851
2062
|
}, [e]), /* @__PURE__ */ f("div", { className: "maze-game-container", children: [
|
|
1852
|
-
/* @__PURE__ */ f(
|
|
1853
|
-
/* @__PURE__ */ f(
|
|
2063
|
+
/* @__PURE__ */ f(Qo, {}),
|
|
2064
|
+
/* @__PURE__ */ f(Do, {}),
|
|
1854
2065
|
/* @__PURE__ */ f("div", { className: "maze-canvas-container", ref: n, children: [
|
|
1855
|
-
/* @__PURE__ */ f("canvas", { ref:
|
|
2066
|
+
/* @__PURE__ */ f("canvas", { ref: i, className: "maze-game-canvas" }),
|
|
1856
2067
|
/* @__PURE__ */ f("div", { className: "maze-touch-area maze-up" }),
|
|
1857
2068
|
/* @__PURE__ */ f("div", { className: "maze-touch-area maze-down" }),
|
|
1858
2069
|
/* @__PURE__ */ f("div", { className: "maze-touch-area maze-left" }),
|
|
@@ -1860,20 +2071,25 @@ const wo = () => {
|
|
|
1860
2071
|
] })
|
|
1861
2072
|
] });
|
|
1862
2073
|
};
|
|
1863
|
-
function
|
|
1864
|
-
return /* @__PURE__ */ f(
|
|
2074
|
+
function tn() {
|
|
2075
|
+
return /* @__PURE__ */ f(Lo, { children: /* @__PURE__ */ f(en, {}) });
|
|
1865
2076
|
}
|
|
1866
|
-
function
|
|
1867
|
-
const t = { ...
|
|
2077
|
+
function on({ config: e = {} }) {
|
|
2078
|
+
const t = { ...ee.i18n, ...e.i18n || {} }, o = { ...ee.renderConfig, ...e.renderConfig || {} }, n = e.levelConfig || ye;
|
|
1868
2079
|
return e = {
|
|
1869
|
-
...
|
|
2080
|
+
...ee,
|
|
1870
2081
|
...e,
|
|
1871
2082
|
i18n: t,
|
|
1872
2083
|
levelConfig: n,
|
|
1873
2084
|
renderConfig: o
|
|
1874
|
-
}, /* @__PURE__ */ f(
|
|
2085
|
+
}, /* @__PURE__ */ f(Ot, { config: e, children: /* @__PURE__ */ f(tn, {}) });
|
|
1875
2086
|
}
|
|
1876
|
-
const
|
|
2087
|
+
const nn = {
|
|
2088
|
+
root: "https://unpkg.com/@roudanio/maze@0.0.5/dist/",
|
|
2089
|
+
...ee
|
|
2090
|
+
};
|
|
2091
|
+
`${JSON.stringify(nn, null, 2)}`;
|
|
2092
|
+
const rn = {
|
|
1877
2093
|
async init(e, t) {
|
|
1878
2094
|
const o = typeof e == "string" ? document.querySelector(e) : e;
|
|
1879
2095
|
if (!o) {
|
|
@@ -1884,31 +2100,31 @@ const zo = {
|
|
|
1884
2100
|
}
|
|
1885
2101
|
let { root: n = location.origin } = t;
|
|
1886
2102
|
n.at(-1) !== "/" && (n += "/");
|
|
1887
|
-
const
|
|
1888
|
-
|
|
2103
|
+
const i = document.createElement("div"), r = document.createElement("div");
|
|
2104
|
+
i.style.cssText = `
|
|
1889
2105
|
height: 30px;
|
|
1890
2106
|
width: 100%;
|
|
1891
2107
|
border: solid 2px #999;
|
|
1892
2108
|
margin: 20% auto;
|
|
1893
|
-
`,
|
|
2109
|
+
`, r.style.cssText = `
|
|
1894
2110
|
width: 99%;
|
|
1895
2111
|
height: 100%;
|
|
1896
2112
|
background: #999;
|
|
1897
2113
|
animation: loading 1.5s ease-in-out;
|
|
1898
2114
|
transition: width 1.5s ease-in-out;
|
|
1899
2115
|
transition: width 1.5s ease-in-out;
|
|
1900
|
-
`,
|
|
2116
|
+
`, i.append(r), o.append(i);
|
|
1901
2117
|
const s = document.createElement("style");
|
|
1902
2118
|
s.innerHTML = `
|
|
1903
2119
|
@keyframes loading {
|
|
1904
2120
|
0% { width: 0%; }
|
|
1905
2121
|
100% { width: 99%; }
|
|
1906
|
-
}`, document.head.appendChild(s), await (async (a) => new Promise((c,
|
|
1907
|
-
const
|
|
1908
|
-
|
|
1909
|
-
}))(n + "maze.css"),
|
|
2122
|
+
}`, document.head.appendChild(s), await (async (a) => new Promise((c, _) => {
|
|
2123
|
+
const u = document.createElement("link");
|
|
2124
|
+
u.rel = "stylesheet", u.type = "text/css", u.href = a, u.onload = c, u.onerror = _, document.head.appendChild(u);
|
|
2125
|
+
}))(n + "maze.css"), Mt(/* @__PURE__ */ f(on, { config: t }), o);
|
|
1910
2126
|
}
|
|
1911
2127
|
};
|
|
1912
2128
|
export {
|
|
1913
|
-
|
|
2129
|
+
rn as default
|
|
1914
2130
|
};
|