speakid-build-a-sentence 1.0.15 → 1.0.16

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.
@@ -1,283 +1,6 @@
1
- import on, { useState as g, useCallback as Ee, useRef as je, useEffect as ue, Component as sn } from "react";
2
- var ve = { exports: {} }, pe = {};
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.js
6
- *
7
- * Copyright (c) Meta Platforms, Inc. and affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var Pe;
13
- function an() {
14
- if (Pe) return pe;
15
- Pe = 1;
16
- var p = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
17
- function S(j, W, w) {
18
- var P = null;
19
- if (w !== void 0 && (P = "" + w), W.key !== void 0 && (P = "" + W.key), "key" in W) {
20
- w = {};
21
- for (var R in W)
22
- R !== "key" && (w[R] = W[R]);
23
- } else w = W;
24
- return W = w.ref, {
25
- $$typeof: p,
26
- type: j,
27
- key: P,
28
- ref: W !== void 0 ? W : null,
29
- props: w
30
- };
31
- }
32
- return pe.Fragment = d, pe.jsx = S, pe.jsxs = S, pe;
33
- }
34
- var fe = {};
35
- /**
36
- * @license React
37
- * react-jsx-runtime.development.js
38
- *
39
- * Copyright (c) Meta Platforms, Inc. and affiliates.
40
- *
41
- * This source code is licensed under the MIT license found in the
42
- * LICENSE file in the root directory of this source tree.
43
- */
44
- var He;
45
- function ln() {
46
- return He || (He = 1, process.env.NODE_ENV !== "production" && (function() {
47
- function p(e) {
48
- if (e == null) return null;
49
- if (typeof e == "function")
50
- return e.$$typeof === V ? null : e.displayName || e.name || null;
51
- if (typeof e == "string") return e;
52
- switch (e) {
53
- case E:
54
- return "Fragment";
55
- case _:
56
- return "Profiler";
57
- case U:
58
- return "StrictMode";
59
- case I:
60
- return "Suspense";
61
- case ae:
62
- return "SuspenseList";
63
- case $:
64
- return "Activity";
65
- }
66
- if (typeof e == "object")
67
- switch (typeof e.tag == "number" && console.error(
68
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
- ), e.$$typeof) {
70
- case ge:
71
- return "Portal";
72
- case se:
73
- return e.displayName || "Context";
74
- case he:
75
- return (e._context.displayName || "Context") + ".Consumer";
76
- case me:
77
- var a = e.render;
78
- return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case z:
80
- return a = e.displayName || null, a !== null ? a : p(e.type) || "Memo";
81
- case J:
82
- a = e._payload, e = e._init;
83
- try {
84
- return p(e(a));
85
- } catch {
86
- }
87
- }
88
- return null;
89
- }
90
- function d(e) {
91
- return "" + e;
92
- }
93
- function S(e) {
94
- try {
95
- d(e);
96
- var a = !1;
97
- } catch {
98
- a = !0;
99
- }
100
- if (a) {
101
- a = console;
102
- var r = a.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return r.call(
104
- a,
105
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- b
107
- ), d(e);
108
- }
109
- }
110
- function j(e) {
111
- if (e === E) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === J)
113
- return "<...>";
114
- try {
115
- var a = p(e);
116
- return a ? "<" + a + ">" : "<...>";
117
- } catch {
118
- return "<...>";
119
- }
120
- }
121
- function W() {
122
- var e = we.A;
123
- return e === null ? null : e.getOwner();
124
- }
125
- function w() {
126
- return Error("react-stack-top-frame");
127
- }
128
- function P(e) {
129
- if (le.call(e, "key")) {
130
- var a = Object.getOwnPropertyDescriptor(e, "key").get;
131
- if (a && a.isReactWarning) return !1;
132
- }
133
- return e.key !== void 0;
134
- }
135
- function R(e, a) {
136
- function r() {
137
- c || (c = !0, console.error(
138
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- a
140
- ));
141
- }
142
- r.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: r,
144
- configurable: !0
145
- });
146
- }
147
- function f() {
148
- var e = p(this.type);
149
- return F[e] || (F[e] = !0, console.error(
150
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
- )), e = this.props.ref, e !== void 0 ? e : null;
152
- }
153
- function D(e, a, r, b, de, G) {
154
- var x = r.ref;
155
- return e = {
156
- $$typeof: oe,
157
- type: e,
158
- key: a,
159
- props: r,
160
- _owner: b
161
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(e, "ref", {
162
- enumerable: !1,
163
- get: f
164
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
165
- configurable: !1,
166
- enumerable: !1,
167
- writable: !0,
168
- value: 0
169
- }), Object.defineProperty(e, "_debugInfo", {
170
- configurable: !1,
171
- enumerable: !1,
172
- writable: !0,
173
- value: null
174
- }), Object.defineProperty(e, "_debugStack", {
175
- configurable: !1,
176
- enumerable: !1,
177
- writable: !0,
178
- value: de
179
- }), Object.defineProperty(e, "_debugTask", {
180
- configurable: !1,
181
- enumerable: !1,
182
- writable: !0,
183
- value: G
184
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
- }
186
- function y(e, a, r, b, de, G) {
187
- var x = a.children;
188
- if (x !== void 0)
189
- if (b)
190
- if (M(x)) {
191
- for (b = 0; b < x.length; b++)
192
- T(x[b]);
193
- Object.freeze && Object.freeze(x);
194
- } else
195
- console.error(
196
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
- );
198
- else T(x);
199
- if (le.call(a, "key")) {
200
- x = p(e);
201
- var O = Object.keys(a).filter(function(Se) {
202
- return Se !== "key";
203
- });
204
- b = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", L[x + b] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
205
- `A props object containing a "key" prop is being spread into JSX:
206
- let props = %s;
207
- <%s {...props} />
208
- React keys must be passed directly to JSX without using spread:
209
- let props = %s;
210
- <%s key={someKey} {...props} />`,
211
- b,
212
- x,
213
- O,
214
- x
215
- ), L[x + b] = !0);
216
- }
217
- if (x = null, r !== void 0 && (S(r), x = "" + r), P(a) && (S(a.key), x = "" + a.key), "key" in a) {
218
- r = {};
219
- for (var ce in a)
220
- ce !== "key" && (r[ce] = a[ce]);
221
- } else r = a;
222
- return x && R(
223
- r,
224
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
- ), D(
226
- e,
227
- x,
228
- r,
229
- W(),
230
- de,
231
- G
232
- );
233
- }
234
- function T(e) {
235
- H(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === J && (e._payload.status === "fulfilled" ? H(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
236
- }
237
- function H(e) {
238
- return typeof e == "object" && e !== null && e.$$typeof === oe;
239
- }
240
- var B = on, oe = Symbol.for("react.transitional.element"), ge = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), he = Symbol.for("react.consumer"), se = Symbol.for("react.context"), me = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), we = B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, M = Array.isArray, A = console.createTask ? console.createTask : function() {
241
- return null;
242
- };
243
- B = {
244
- react_stack_bottom_frame: function(e) {
245
- return e();
246
- }
247
- };
248
- var c, F = {}, X = B.react_stack_bottom_frame.bind(
249
- B,
250
- w
251
- )(), xe = A(j(w)), L = {};
252
- fe.Fragment = E, fe.jsx = function(e, a, r) {
253
- var b = 1e4 > we.recentlyCreatedOwnerStacks++;
254
- return y(
255
- e,
256
- a,
257
- r,
258
- !1,
259
- b ? Error("react-stack-top-frame") : X,
260
- b ? A(j(e)) : xe
261
- );
262
- }, fe.jsxs = function(e, a, r) {
263
- var b = 1e4 > we.recentlyCreatedOwnerStacks++;
264
- return y(
265
- e,
266
- a,
267
- r,
268
- !0,
269
- b ? Error("react-stack-top-frame") : X,
270
- b ? A(j(e)) : xe
271
- );
272
- };
273
- })()), fe;
274
- }
275
- var Ce;
276
- function dn() {
277
- return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? ve.exports = an() : ve.exports = ln()), ve.exports;
278
- }
279
- var s = dn();
280
- const cn = `
1
+ import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
+ import { useState as p, useCallback as ce, useRef as We, useEffect as V, Component as Ye } from "react";
3
+ const Ke = `
281
4
  @keyframes magic-sentence-spin {
282
5
  from { transform: rotate(0deg); }
283
6
  to { transform: rotate(360deg); }
@@ -312,10 +35,10 @@ const cn = `
312
35
  }
313
36
  `;
314
37
  if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
315
- const p = document.createElement("style");
316
- p.id = "magic-sentence-keyframes", p.innerHTML = cn, document.head.appendChild(p);
38
+ const w = document.createElement("style");
39
+ w.id = "magic-sentence-keyframes", w.innerHTML = Ke, document.head.appendChild(w);
317
40
  }
318
- const Ae = {
41
+ const Se = {
319
42
  spin: {
320
43
  animation: "magic-sentence-spin 1.4s linear infinite"
321
44
  },
@@ -334,7 +57,7 @@ const Ae = {
334
57
  glow: {
335
58
  animation: "magic-sentence-glow 1s ease-in-out infinite"
336
59
  }
337
- }, h = {
60
+ }, g = {
338
61
  gmCenterScreen: {
339
62
  position: "relative",
340
63
  zIndex: 1,
@@ -448,62 +171,62 @@ const Ae = {
448
171
  },
449
172
  gmHourglass: {
450
173
  fontSize: "42px",
451
- ...Ae.spin
174
+ ...Se.spin
452
175
  },
453
176
  // ===== Анимационные стили =====
454
- ...Ae
455
- }, un = () => {
456
- const [p, d] = g([]), S = Ee((w, P, R) => {
457
- const f = [];
458
- w.trim() || f.push({
177
+ ...Se
178
+ }, _e = () => {
179
+ const [w, r] = p([]), y = ce((S, M, C) => {
180
+ const c = [];
181
+ S.trim() || c.push({
459
182
  type: "empty",
460
183
  message: "Sentence cannot be empty"
461
- }), w.length > 41 && f.push({
184
+ }), S.length > 41 && c.push({
462
185
  type: "length",
463
- message: `Sentence is too long (${w.length}/41 characters)`
464
- }), w && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(w) && f.push({
186
+ message: `Sentence is too long (${S.length}/41 characters)`
187
+ }), S && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(S) && c.push({
465
188
  type: "characters",
466
189
  message: "Only Latin characters, numbers, spaces and punctuation are allowed"
467
190
  });
468
- const y = R.findIndex((T, H) => H !== P && T.toLowerCase().trim() === w.toLowerCase().trim());
469
- return y !== -1 && f.push({
191
+ const m = C.findIndex((k, I) => I !== M && k.toLowerCase().trim() === S.toLowerCase().trim());
192
+ return m !== -1 && c.push({
470
193
  type: "duplicate",
471
- message: `Duplicate sentence (same as sentence ${y + 1})`
472
- }), d(f), {
473
- isValid: f.length === 0,
474
- errors: f
194
+ message: `Duplicate sentence (same as sentence ${m + 1})`
195
+ }), r(c), {
196
+ isValid: c.length === 0,
197
+ errors: c
475
198
  };
476
- }, []), j = Ee((w) => {
477
- const P = [];
478
- return w.forEach((R, f) => {
479
- const D = S(R, f, w);
480
- P.push(...D.errors.map((y) => ({
481
- ...y,
482
- message: `Sentence ${f + 1}: ${y.message}`
199
+ }, []), B = ce((S) => {
200
+ const M = [];
201
+ return S.forEach((C, c) => {
202
+ const D = y(C, c, S);
203
+ M.push(...D.errors.map((m) => ({
204
+ ...m,
205
+ message: `Sentence ${c + 1}: ${m.message}`
483
206
  })));
484
207
  }), {
485
- isValid: P.length === 0,
486
- errors: P
208
+ isValid: M.length === 0,
209
+ errors: M
487
210
  };
488
- }, [S]), W = Ee(() => {
489
- d([]);
211
+ }, [y]), ne = ce(() => {
212
+ r([]);
490
213
  }, []);
491
214
  return {
492
- errors: p,
493
- validateSentence: S,
494
- validateAllSentences: j,
495
- clearErrors: W
215
+ errors: w,
216
+ validateSentence: y,
217
+ validateAllSentences: B,
218
+ clearErrors: ne
496
219
  };
497
- }, pn = (p, d, S) => d && S ? `${p} word "${d}" ${S}` : d ? `${p} word "${d}"` : p, fn = (p, d, S = ["Enter", " "]) => {
498
- S.includes(p.key) && (p.preventDefault(), d());
499
- }, Y = (p) => {
500
- const d = document.createElement("div");
501
- d.setAttribute("aria-live", "polite"), d.setAttribute("aria-atomic", "true"), d.style.position = "absolute", d.style.left = "-10000px", d.style.width = "1px", d.style.height = "1px", d.style.overflow = "hidden", document.body.appendChild(d), d.textContent = p, setTimeout(() => {
502
- document.body.removeChild(d);
220
+ }, en = (w, r, y) => r && y ? `${w} word "${r}" ${y}` : r ? `${w} word "${r}"` : w, nn = (w, r, y = ["Enter", " "]) => {
221
+ y.includes(w.key) && (w.preventDefault(), r());
222
+ }, E = (w) => {
223
+ const r = document.createElement("div");
224
+ r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.position = "absolute", r.style.left = "-10000px", r.style.width = "1px", r.style.height = "1px", r.style.overflow = "hidden", document.body.appendChild(r), r.textContent = w, setTimeout(() => {
225
+ document.body.removeChild(r);
503
226
  }, 1e3);
504
- }, gn = () => {
505
- const p = document.createElement("style");
506
- p.textContent = `
227
+ }, tn = () => {
228
+ const w = document.createElement("style");
229
+ w.textContent = `
507
230
  #magic-sentence-root, #magic-sentence-root * {
508
231
  box-sizing: border-box;
509
232
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
@@ -529,17 +252,17 @@ const Ae = {
529
252
  height: 100% !important;
530
253
  overflow: hidden !important;
531
254
  }
532
- `, document.head.appendChild(p);
533
- }, hn = (p) => [...p].sort(() => Math.random() - 0.5);
534
- function wn(p = {}) {
535
- const { logoUrl: d, showLogo: S = !0, baseURL: j } = p, W = je(null), { validateAllSentences: w, errors: P } = un(), R = () => r || window.innerWidth < 768, f = () => r || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (n = "medium") => {
536
- if (!f())
255
+ `, document.head.appendChild(w);
256
+ }, on = (w) => [...w].sort(() => Math.random() - 0.5);
257
+ function ln(w = {}) {
258
+ const { logoUrl: r, showLogo: y = !0, baseURL: B } = w, ne = We(null), { validateAllSentences: S, errors: M } = _e(), C = () => l || window.innerWidth < 768, c = () => l || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (e = "medium") => {
259
+ if (!c())
537
260
  return {
538
261
  padding: "12px 24px",
539
262
  fontSize: "16px",
540
263
  minWidth: "auto"
541
264
  };
542
- switch (n) {
265
+ switch (e) {
543
266
  case "small":
544
267
  return {
545
268
  padding: "4px 6px",
@@ -560,201 +283,201 @@ function wn(p = {}) {
560
283
  };
561
284
  }
562
285
  };
563
- ue(() => (gn(), () => {
286
+ V(() => (tn(), () => {
564
287
  document.body.style.overflow = "";
565
288
  }), []);
566
- const [y, T] = g("select"), [H, B] = g(null), [oe, ge] = g(null), [E, U] = g([]), [_, he] = g(0), [se, me] = g([]), [I, ae] = g([]), [z, J] = g(20), [$, V] = g(0), [we, le] = g(null), [M, A] = g(null), [c, F] = g(!1), [X, xe] = g(
289
+ const [m, k] = p("select"), [I, pe] = p(null), [ge, he] = p(null), [H, q] = p([]), [T, we] = p(0), [te, ue] = p([]), [v, ie] = p([]), [L, me] = p(20), [J, Y] = p(0), [rn, fe] = p(null), [A, z] = p(null), [d, K] = p(!1), [oe, ve] = p(
567
290
  Number(localStorage.getItem("magicSentenceBest")) || 0
568
- ), L = je(null), [e, a] = g({ list: null, index: null, side: null }), [r, b] = g(!1), [de, G] = g(1), [x, O] = g(null), [ce, Se] = g(!1), [q, De] = g(!1), [Z, _e] = g(!1), [Q, Oe] = g(!1), [K, ze] = g(!1), [ee, Me] = g(!1), [ne, Le] = g(!1), [te, Ne] = g(!1), [ie, Be] = g(!1);
569
- ue(() => {
570
- const n = () => {
571
- const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, l = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768, u = i === 820 && t === 1180, m = i === 1180 && t === 820, re = i === 540 && t === 720, C = i === 720 && t === 540, Re = i === 1024 && t === 1366, nn = i === 1366 && t === 1024, tn = i >= 1200 && t >= 600 && !o;
572
- if (Se(tn), De(v), _e(k), Oe(u), ze(m), Me(re), Le(C), Ne(Re), Be(nn), b(o), o)
573
- O(null), G(1);
574
- else if (l)
575
- O(null), G(1);
291
+ ), U = We(null), [b, P] = p({ list: null, index: null, side: null }), [l, ke] = p(!1), [sn, re] = p(1), [xe, se] = p(null), [He, Ie] = p(!1), [$, Ce] = p(!1), [G, De] = p(!1), [N, Te] = p(!1), [j, Pe] = p(!1), [O, Re] = p(!1), [F, ze] = p(!1), [Z, Ee] = p(!1), [Q, Be] = p(!1);
292
+ V(() => {
293
+ const e = () => {
294
+ const t = window.innerWidth, n = window.innerHeight, i = t < 768 || t === 926 && n === 428 || t === 932 && n === 430, o = n < 700, u = t === 768 && n === 1024, x = t === 1024 && n === 768, s = t === 820 && n === 1180, h = t === 1180 && n === 820, X = t === 540 && n === 720, W = t === 720 && n === 540, le = t === 1024 && n === 1366, Ue = t === 1366 && n === 1024, Ve = t >= 1200 && n >= 600 && !i;
295
+ if (Ie(Ve), Ce(u), De(x), Te(s), Pe(h), Re(X), ze(W), Ee(le), Be(Ue), ke(i), i)
296
+ se(null), re(1);
297
+ else if (o)
298
+ se(null), re(1);
576
299
  else {
577
- const rn = Math.min(1e3, Math.min(i, t) * 0.9);
578
- O(rn), G(1);
300
+ const qe = Math.min(1e3, Math.min(t, n) * 0.9);
301
+ se(qe), re(1);
579
302
  }
580
303
  };
581
- return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
304
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
582
305
  }, []);
583
- const ye = (n, i, t, o) => {
584
- if (c) return;
585
- let l = [...se], v = [...I];
586
- const k = n === "bank" ? l : v, u = i === "bank" ? l : v, m = k.findIndex((Re) => Re.id === t);
587
- if (m === -1) return;
588
- const [re] = k.splice(m, 1);
589
- let C = o;
590
- n === i && C !== null && C !== void 0 && C > m && (C = C - 1), C == null || C < 0 || C > u.length ? u.push(re) : u.splice(C, 0, re), n === "bank" ? l = k : v = k, i === "bank" ? l = u : v = u, me(l), ae(v);
591
- }, be = (n, i, t) => {
592
- if (n.preventDefault(), c) {
593
- a({ list: null, index: null, side: null });
306
+ const _ = (e, t, n, i) => {
307
+ if (d) return;
308
+ let o = [...te], u = [...v];
309
+ const x = e === "bank" ? o : u, s = t === "bank" ? o : u, h = x.findIndex((le) => le.id === n);
310
+ if (h === -1) return;
311
+ const [X] = x.splice(h, 1);
312
+ let W = i;
313
+ e === t && W !== null && W !== void 0 && W > h && (W = W - 1), W == null || W < 0 || W > s.length ? s.push(X) : s.splice(W, 0, X), e === "bank" ? o = x : u = x, t === "bank" ? o = s : u = s, ue(o), ie(u);
314
+ }, ee = (e, t, n) => {
315
+ if (e.preventDefault(), d) {
316
+ P({ list: null, index: null, side: null });
594
317
  return;
595
318
  }
596
- const o = n.dataTransfer.getData("application/x-token") || (() => {
597
- const l = n.dataTransfer.getData("text/plain");
598
- if (!l) return "";
599
- const v = se.some((m) => m.id === l), k = I.some((m) => m.id === l), u = v ? "bank" : k ? "selected" : null;
600
- return u ? JSON.stringify({ from: u, id: l }) : "";
319
+ const i = e.dataTransfer.getData("application/x-token") || (() => {
320
+ const o = e.dataTransfer.getData("text/plain");
321
+ if (!o) return "";
322
+ const u = te.some((h) => h.id === o), x = v.some((h) => h.id === o), s = u ? "bank" : x ? "selected" : null;
323
+ return s ? JSON.stringify({ from: s, id: o }) : "";
601
324
  })();
602
- if (o) {
325
+ if (i) {
603
326
  try {
604
- const l = JSON.parse(o);
605
- if (!l || !l.id || !l.from) return;
606
- ye(l.from, i, l.id, t);
327
+ const o = JSON.parse(i);
328
+ if (!o || !o.id || !o.from) return;
329
+ _(o.from, t, o.id, n);
607
330
  } catch {
608
331
  }
609
- a({ list: null, index: null, side: null });
332
+ P({ list: null, index: null, side: null });
610
333
  }
611
- }, $e = (n) => {
612
- B(n), U(Array(n).fill("")), T("time");
613
- }, Fe = (n) => {
614
- ge(n), T("type");
615
- }, Ge = (n, i) => {
616
- if (i.length > 41 || i && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(i))
334
+ }, Me = (e) => {
335
+ pe(e), q(Array(e).fill("")), k("time");
336
+ }, Le = (e) => {
337
+ he(e), k("type");
338
+ }, Ae = (e, t) => {
339
+ if (t.length > 41 || t && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(t))
617
340
  return;
618
- const o = [...E];
619
- o[n] = i, U(o);
620
- const l = w(o);
621
- l.isValid || console.warn("Validation errors:", l.errors);
622
- }, Ye = (n) => n.trim().replace(/\s+/g, " "), Te = (n) => n <= 3 ? 20 : n <= 5 ? 18 : n <= 7 ? 16 : n <= 9 ? 14 : 12, Ue = () => {
623
- E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) => Ye(t))), V(0), he(0), le(null), T("getready"));
341
+ const i = [...H];
342
+ i[e] = t, q(i);
343
+ const o = S(i);
344
+ o.isValid || console.warn("Validation errors:", o.errors);
345
+ }, $e = (e) => e.trim().replace(/\s+/g, " "), ye = (e) => e <= 3 ? 20 : e <= 5 ? 18 : e <= 7 ? 16 : e <= 9 ? 14 : 12, Ge = () => {
346
+ H.some((t) => t.trim().length === 0) || (q((t) => t.map((n) => $e(n))), Y(0), we(0), fe(null), k("getready"));
624
347
  };
625
- ue(() => {
626
- if (y === "getready") {
627
- const n = setTimeout(() => ke(0), 3e3);
628
- return () => clearTimeout(n);
348
+ V(() => {
349
+ if (m === "getready") {
350
+ const e = setTimeout(() => ae(0), 3e3);
351
+ return () => clearTimeout(e);
629
352
  }
630
- }, [y]);
631
- const ke = (n) => {
632
- const i = E[n];
633
- if (!i) return;
634
- const o = hn(
635
- i.trim().split(/\s+/).filter(Boolean)
636
- ).map((l, v) => ({
637
- id: `${Date.now()}-${n}-${v}-${Math.random().toString(36).slice(2)}`,
638
- text: l
353
+ }, [m]);
354
+ const ae = (e) => {
355
+ const t = H[e];
356
+ if (!t) return;
357
+ const i = on(
358
+ t.trim().split(/\s+/).filter(Boolean)
359
+ ).map((o, u) => ({
360
+ id: `${Date.now()}-${e}-${u}-${Math.random().toString(36).slice(2)}`,
361
+ text: o
639
362
  }));
640
- me(o), ae([]), he(n), J(oe || 20), A(null), F(!1), T("play");
363
+ ue(i), ie([]), we(e), me(ge || 20), z(null), K(!1), k("play");
641
364
  };
642
- ue(() => {
643
- if (y === "play" && !c)
644
- if (L.current !== null && window.clearTimeout(L.current), z > 0)
645
- L.current = window.setTimeout(() => J((n) => n - 1), 1e3);
365
+ V(() => {
366
+ if (m === "play" && !d)
367
+ if (U.current !== null && window.clearTimeout(U.current), L > 0)
368
+ U.current = window.setTimeout(() => me((e) => e - 1), 1e3);
646
369
  else {
647
- F(!0);
648
- const i = E[_].trim().split(/\s+/), t = I.map((u) => u.text), o = i.filter((u) => !t.includes(u)).length, l = t.filter((u) => !i.includes(u)).length, v = i.filter((u, m) => u !== t[m]).length, k = o + l + v;
649
- k === 0 ? (A("correct"), N("correct"), Y("Correct! Well done!")) : k === 1 ? (A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!"));
370
+ K(!0);
371
+ const t = H[T].trim().split(/\s+/), n = v.map((s) => s.text), i = t.filter((s) => !n.includes(s)).length, o = n.filter((s) => !t.includes(s)).length, u = t.filter((s, h) => s !== n[h]).length, x = i + o + u;
372
+ x === 0 ? (z("correct"), R("correct"), E("Correct! Well done!")) : x === 1 ? (z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!"));
650
373
  }
651
374
  return () => {
652
- L.current !== null && window.clearTimeout(L.current);
375
+ U.current !== null && window.clearTimeout(U.current);
653
376
  };
654
- }, [y, z, c, E, _, I]);
655
- const Je = (n = !0) => {
656
- if (c && n) {
657
- _ + 1 < (H || 0) ? ke(_ + 1) : (T("results"), setTimeout(() => We(), 600));
377
+ }, [m, L, d, H, T, v]);
378
+ const Ne = (e = !0) => {
379
+ if (d && e) {
380
+ T + 1 < (I || 0) ? ae(T + 1) : (k("results"), setTimeout(() => de(), 600));
658
381
  return;
659
382
  }
660
- if (n && !c) {
661
- const t = E[_].trim().split(/\s+/), o = I.map((m) => m.text), l = t.filter((m) => !o.includes(m)).length, v = o.filter((m) => !t.includes(m)).length, k = t.filter((m, re) => m !== o[re]).length, u = l + v + k;
662
- u === 0 && z > 0 ? (V((m) => m + 1), A("correct"), N("correct"), Y("Correct! Well done!")) : u === 1 ? (V((m) => m + 0.5), A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!")), _ + 1 < (H || 0) ? setTimeout(() => ke(_ + 1), 800) : (T("results"), setTimeout(() => We(), 600));
383
+ if (e && !d) {
384
+ const n = H[T].trim().split(/\s+/), i = v.map((h) => h.text), o = n.filter((h) => !i.includes(h)).length, u = i.filter((h) => !n.includes(h)).length, x = n.filter((h, X) => h !== i[X]).length, s = o + u + x;
385
+ s === 0 && L > 0 ? (Y((h) => h + 1), z("correct"), R("correct"), E("Correct! Well done!")) : s === 1 ? (Y((h) => h + 0.5), z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!")), T + 1 < (I || 0) ? setTimeout(() => ae(T + 1), 800) : (k("results"), setTimeout(() => de(), 600));
663
386
  }
664
387
  };
665
- ue(() => {
666
- y === "results" && $ > X && (xe($), localStorage.setItem("magicSentenceBest", String($)));
667
- }, [y, $, X]);
668
- const N = (n) => {
669
- const i = new (window.AudioContext || window.webkitAudioContext)(), t = i.createOscillator(), o = i.createGain();
670
- switch (t.connect(o), o.connect(i.destination), n) {
388
+ V(() => {
389
+ m === "results" && J > oe && (ve(J), localStorage.setItem("magicSentenceBest", String(J)));
390
+ }, [m, J, oe]);
391
+ const R = (e) => {
392
+ const t = new (window.AudioContext || window.webkitAudioContext)(), n = t.createOscillator(), i = t.createGain();
393
+ switch (n.connect(i), i.connect(t.destination), e) {
671
394
  case "start":
672
- t.frequency.value = 500;
395
+ n.frequency.value = 500;
673
396
  break;
674
397
  case "click":
675
- t.frequency.value = 800;
398
+ n.frequency.value = 800;
676
399
  break;
677
400
  case "correct":
678
- t.frequency.value = 1e3;
401
+ n.frequency.value = 1e3;
679
402
  break;
680
403
  case "half":
681
- t.frequency.value = 700;
404
+ n.frequency.value = 700;
682
405
  break;
683
406
  case "wrong":
684
- t.frequency.value = 200;
407
+ n.frequency.value = 200;
685
408
  break;
686
409
  }
687
- o.gain.setValueAtTime(0.1, i.currentTime), t.start(), t.stop(i.currentTime + 0.2);
688
- }, We = () => {
689
- const i = Date.now() + 2500, t = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], o = document.createElement("canvas"), l = o.getContext("2d");
690
- o.width = window.innerWidth, o.height = window.innerHeight, o.style.position = "fixed", o.style.top = "0", o.style.left = "0", o.style.pointerEvents = "none", document.body.appendChild(o);
691
- const v = Array.from({ length: 100 }).map(() => ({
692
- x: Math.random() * o.width,
693
- y: Math.random() * o.height - o.height,
410
+ i.gain.setValueAtTime(0.1, t.currentTime), n.start(), n.stop(t.currentTime + 0.2);
411
+ }, de = () => {
412
+ const t = Date.now() + 2500, n = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], i = document.createElement("canvas"), o = i.getContext("2d");
413
+ i.width = window.innerWidth, i.height = window.innerHeight, i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.pointerEvents = "none", document.body.appendChild(i);
414
+ const u = Array.from({ length: 100 }).map(() => ({
415
+ x: Math.random() * i.width,
416
+ y: Math.random() * i.height - i.height,
694
417
  size: 6 + Math.random() * 6,
695
- color: t[Math.floor(Math.random() * t.length)],
418
+ color: n[Math.floor(Math.random() * n.length)],
696
419
  speed: 2 + Math.random() * 4,
697
420
  tilt: Math.random() * 2 * Math.PI
698
- })), k = () => {
699
- l.clearRect(0, 0, o.width, o.height), v.forEach((u) => {
700
- l.fillStyle = u.color, l.beginPath(), l.ellipse(u.x, u.y, u.size, u.size / 2, u.tilt, 0, 2 * Math.PI), l.fill(), u.y += u.speed, u.x += Math.sin(u.tilt);
701
- }), Date.now() < i ? requestAnimationFrame(k) : document.body.removeChild(o);
421
+ })), x = () => {
422
+ o.clearRect(0, 0, i.width, i.height), u.forEach((s) => {
423
+ o.fillStyle = s.color, o.beginPath(), o.ellipse(s.x, s.y, s.size, s.size / 2, s.tilt, 0, 2 * Math.PI), o.fill(), s.y += s.speed, s.x += Math.sin(s.tilt);
424
+ }), Date.now() < t ? requestAnimationFrame(x) : document.body.removeChild(i);
702
425
  };
703
- k();
704
- }, Ve = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
705
- /* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
706
- /* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select number of rounds" }),
707
- /* @__PURE__ */ s.jsx("div", { style: {
426
+ x();
427
+ }, je = () => /* @__PURE__ */ f("div", { style: g.gmCenterScreen, children: [
428
+ /* @__PURE__ */ a("h1", { style: g.gmHeadline1, children: "MAGIC SENTENCE" }),
429
+ /* @__PURE__ */ a("p", { style: g.gmBodyM, children: "Select number of rounds" }),
430
+ /* @__PURE__ */ a("div", { style: {
708
431
  display: "flex",
709
- gap: f() ? "8px" : "16px",
432
+ gap: c() ? "8px" : "16px",
710
433
  justifyContent: "center"
711
- }, children: [3, 4, 5].map((n) => /* @__PURE__ */ s.jsxs(
434
+ }, children: [3, 4, 5].map((e) => /* @__PURE__ */ f(
712
435
  "button",
713
436
  {
714
- onClick: () => $e(n),
437
+ onClick: () => Me(e),
715
438
  style: {
716
- ...h.gmButton,
439
+ ...g.gmButton,
717
440
  ...D("medium")
718
441
  },
719
442
  children: [
720
- n,
443
+ e,
721
444
  " ROUNDS"
722
445
  ]
723
446
  },
724
- n
447
+ e
725
448
  )) })
726
- ] }), Xe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
727
- /* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
728
- /* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select time per round" }),
729
- /* @__PURE__ */ s.jsx("div", { style: {
449
+ ] }), Oe = () => /* @__PURE__ */ f("div", { style: g.gmCenterScreen, children: [
450
+ /* @__PURE__ */ a("h1", { style: g.gmHeadline1, children: "MAGIC SENTENCE" }),
451
+ /* @__PURE__ */ a("p", { style: g.gmBodyM, children: "Select time per round" }),
452
+ /* @__PURE__ */ a("div", { style: {
730
453
  display: "flex",
731
- gap: f() ? "8px" : "16px",
454
+ gap: c() ? "8px" : "16px",
732
455
  justifyContent: "center"
733
- }, children: [15, 20, 30].map((n) => /* @__PURE__ */ s.jsxs(
456
+ }, children: [15, 20, 30].map((e) => /* @__PURE__ */ f(
734
457
  "button",
735
458
  {
736
- onClick: () => Fe(n),
459
+ onClick: () => Le(e),
737
460
  style: {
738
- ...h.gmButton,
461
+ ...g.gmButton,
739
462
  ...D("medium")
740
463
  },
741
464
  children: [
742
- n,
465
+ e,
743
466
  "s"
744
467
  ]
745
468
  },
746
- n
469
+ e
747
470
  )) })
748
- ] }), qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
749
- /* @__PURE__ */ s.jsxs("h2", { style: { ...h.gmBodyM, marginBottom: "0px" }, children: [
471
+ ] }), Fe = () => /* @__PURE__ */ f("div", { style: g.gmCenterScreen, children: [
472
+ /* @__PURE__ */ f("h2", { style: { ...g.gmBodyM, marginBottom: "0px" }, children: [
750
473
  "Type down ",
751
- H,
474
+ I,
752
475
  " sentence",
753
- H && H > 1 ? "s" : "",
476
+ I && I > 1 ? "s" : "",
754
477
  " for your student"
755
478
  ] }),
756
- /* @__PURE__ */ s.jsx("p", { style: { ...h.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
757
- /* @__PURE__ */ s.jsx("div", { style: {
479
+ /* @__PURE__ */ a("p", { style: { ...g.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
480
+ /* @__PURE__ */ a("div", { style: {
758
481
  display: "flex",
759
482
  flexDirection: "column",
760
483
  gap: 12,
@@ -764,317 +487,317 @@ function wn(p = {}) {
764
487
  // Минимальная ширина по содержимому
765
488
  maxWidth: "600px"
766
489
  // Ограничиваем максимальную ширину
767
- }, children: E.map((n, i) => /* @__PURE__ */ s.jsx(
490
+ }, children: H.map((e, t) => /* @__PURE__ */ a(
768
491
  "input",
769
492
  {
770
- value: n,
771
- placeholder: `Sentence ${i + 1}`,
772
- onChange: (t) => Ge(i, t.target.value),
493
+ value: e,
494
+ placeholder: `Sentence ${t + 1}`,
495
+ onChange: (n) => Ae(t, n.target.value),
773
496
  style: {
774
- ...h.gmInput,
775
- padding: f() ? "8px 12px" : "12px 16px",
776
- fontSize: f() ? "14px" : "16px",
497
+ ...g.gmInput,
498
+ padding: c() ? "8px 12px" : "12px 16px",
499
+ fontSize: c() ? "14px" : "16px",
777
500
  width: "100%",
778
501
  // Поля теперь будут шире благодаря увеличенной ширине контейнера
779
502
  textAlign: "center"
780
503
  // Центрируем placeholder текст
781
504
  }
782
505
  },
783
- i
506
+ t
784
507
  )) }),
785
- /* @__PURE__ */ s.jsx(
508
+ /* @__PURE__ */ a(
786
509
  "button",
787
510
  {
788
- onClick: Ue,
789
- disabled: E.some((n) => n.trim().length === 0),
511
+ onClick: Ge,
512
+ disabled: H.some((e) => e.trim().length === 0),
790
513
  style: {
791
- ...h.gmButton,
514
+ ...g.gmButton,
792
515
  marginTop: 30,
793
- background: E.some((n) => n.trim().length === 0) ? "#ccc" : "#ec4c44",
794
- cursor: E.some((n) => n.trim().length === 0) ? "not-allowed" : "pointer",
516
+ background: H.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
517
+ cursor: H.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
795
518
  ...D("large")
796
519
  },
797
520
  children: "PLAY"
798
521
  }
799
522
  )
800
- ] }), Ze = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmReadyWrapper, children: [
801
- /* @__PURE__ */ s.jsx("h1", { style: {
802
- ...h.gmHeadline1,
803
- fontSize: f() ? "36px" : "72px",
523
+ ] }), Ze = () => /* @__PURE__ */ f("div", { style: g.gmReadyWrapper, children: [
524
+ /* @__PURE__ */ a("h1", { style: {
525
+ ...g.gmHeadline1,
526
+ fontSize: c() ? "36px" : "72px",
804
527
  color: "#ec4c44",
805
528
  marginBottom: "20px",
806
529
  animation: "pulse 1s ease-in-out infinite"
807
530
  }, children: "GET READY" }),
808
- /* @__PURE__ */ s.jsx("div", { style: h.gmHourglass, children: "⏳" })
809
- ] }), Qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmGameLayout, children: [
810
- /* @__PURE__ */ s.jsxs("h2", { style: {
811
- marginBottom: f() ? "5px" : "10px",
812
- fontSize: f() ? "16px" : "20px"
531
+ /* @__PURE__ */ a("div", { style: g.gmHourglass, children: "⏳" })
532
+ ] }), Qe = () => /* @__PURE__ */ f("div", { style: g.gmGameLayout, children: [
533
+ /* @__PURE__ */ f("h2", { style: {
534
+ marginBottom: c() ? "5px" : "10px",
535
+ fontSize: c() ? "16px" : "20px"
813
536
  }, children: [
814
537
  "Round ",
815
- _ + 1,
538
+ T + 1,
816
539
  "/",
817
- H,
540
+ I,
818
541
  " — ",
819
- c ? "TIME'S UP!" : `Time: ${z}s`
542
+ d ? "TIME'S UP!" : `Time: ${L}s`
820
543
  ] }),
821
- /* @__PURE__ */ s.jsx(
544
+ /* @__PURE__ */ a(
822
545
  "div",
823
546
  {
824
547
  style: {
825
548
  width: "60%",
826
- height: f() ? "8px" : "14px",
549
+ height: c() ? "8px" : "14px",
827
550
  borderRadius: 8,
828
551
  background: "#eee",
829
552
  overflow: "hidden",
830
- marginBottom: f() ? "10px" : "20px"
553
+ marginBottom: c() ? "10px" : "20px"
831
554
  },
832
- children: /* @__PURE__ */ s.jsx(
555
+ children: /* @__PURE__ */ a(
833
556
  "div",
834
557
  {
835
558
  style: {
836
559
  height: "100%",
837
- width: `${z / (oe || 20) * 100}%`,
838
- background: z <= 5 ? "#ec4c44" : "#4caf50",
560
+ width: `${L / (ge || 20) * 100}%`,
561
+ background: L <= 5 ? "#ec4c44" : "#4caf50",
839
562
  transition: "width 1s linear"
840
563
  }
841
564
  }
842
565
  )
843
566
  }
844
567
  ),
845
- /* @__PURE__ */ s.jsx(
568
+ /* @__PURE__ */ a(
846
569
  "div",
847
570
  {
848
- onDragOver: (n) => n.preventDefault(),
849
- onDrop: (n) => be(n, "bank", null),
571
+ onDragOver: (e) => e.preventDefault(),
572
+ onDrop: (e) => ee(e, "bank", null),
850
573
  style: {
851
574
  display: "flex",
852
- flexWrap: R() ? "wrap" : "nowrap",
853
- gap: r || window.innerWidth < 768 ? "6px" : "10px",
575
+ flexWrap: C() ? "wrap" : "nowrap",
576
+ gap: l || window.innerWidth < 768 ? "6px" : "10px",
854
577
  justifyContent: "center",
855
- marginBottom: r || window.innerWidth < 768 ? "15px" : "30px",
856
- padding: r || window.innerWidth < 768 ? "5px" : "10px",
578
+ marginBottom: l || window.innerWidth < 768 ? "15px" : "30px",
579
+ padding: l || window.innerWidth < 768 ? "5px" : "10px",
857
580
  width: "100%",
858
581
  boxSizing: "border-box"
859
582
  },
860
- children: se.map((n, i) => /* @__PURE__ */ s.jsx(
583
+ children: te.map((e, t) => /* @__PURE__ */ a(
861
584
  "div",
862
585
  {
863
- draggable: !c,
586
+ draggable: !d,
864
587
  role: "button",
865
- tabIndex: c ? -1 : 0,
866
- "aria-label": c ? `Word: ${n.text} (time expired)` : pn("Drag word", n.text, "to build sentence"),
867
- onDragStart: (t) => {
868
- if (c) {
869
- t.preventDefault();
588
+ tabIndex: d ? -1 : 0,
589
+ "aria-label": d ? `Word: ${e.text} (time expired)` : en("Drag word", e.text, "to build sentence"),
590
+ onDragStart: (n) => {
591
+ if (d) {
592
+ n.preventDefault();
870
593
  return;
871
594
  }
872
- t.dataTransfer.setData(
595
+ n.dataTransfer.setData(
873
596
  "application/x-token",
874
- JSON.stringify({ from: "bank", id: n.id })
875
- ), t.dataTransfer.setData("text/plain", n.id), Y(`Dragging word: ${n.text}`);
597
+ JSON.stringify({ from: "bank", id: e.id })
598
+ ), n.dataTransfer.setData("text/plain", e.id), E(`Dragging word: ${e.text}`);
876
599
  },
877
- onKeyDown: (t) => {
878
- c || fn(t, () => ye("bank", "selected", n.id, null));
600
+ onKeyDown: (n) => {
601
+ d || nn(n, () => _("bank", "selected", e.id, null));
879
602
  },
880
- onDragOver: (t) => t.preventDefault(),
881
- onDrop: (t) => {
882
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2, v = t.clientX > l ? i + 1 : i;
883
- a({ list: null, index: null, side: null }), t.stopPropagation(), be(t, "bank", v);
603
+ onDragOver: (n) => n.preventDefault(),
604
+ onDrop: (n) => {
605
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, u = n.clientX > o ? t + 1 : t;
606
+ P({ list: null, index: null, side: null }), n.stopPropagation(), ee(n, "bank", u);
884
607
  },
885
- onDragEnter: (t) => {
886
- if (c) return;
887
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2;
888
- a({ list: "bank", index: i, side: t.clientX > l ? "right" : "left" });
608
+ onDragEnter: (n) => {
609
+ if (d) return;
610
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
611
+ P({ list: "bank", index: t, side: n.clientX > o ? "right" : "left" });
889
612
  },
890
- onDragLeave: () => a({ list: null, index: null, side: null }),
613
+ onDragLeave: () => P({ list: null, index: null, side: null }),
891
614
  onClick: () => {
892
- c || ye("bank", "selected", n.id, null);
615
+ d || _("bank", "selected", e.id, null);
893
616
  },
894
617
  style: {
895
- padding: r || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
896
- borderRadius: r || window.innerWidth < 768 ? "6px" : "10px",
618
+ padding: l || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
619
+ borderRadius: l || window.innerWidth < 768 ? "6px" : "10px",
897
620
  border: "1px solid #ccc",
898
- background: c ? "#f0f0f0" : "#f9f9f9",
899
- cursor: c ? "not-allowed" : "pointer",
900
- fontSize: r || window.innerWidth < 768 ? "12px" : "18px",
901
- borderLeft: e.list === "bank" && e.index === i && e.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
902
- borderRight: e.list === "bank" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
621
+ background: d ? "#f0f0f0" : "#f9f9f9",
622
+ cursor: d ? "not-allowed" : "pointer",
623
+ fontSize: l || window.innerWidth < 768 ? "12px" : "18px",
624
+ borderLeft: b.list === "bank" && b.index === t && b.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
625
+ borderRight: b.list === "bank" && b.index === t && b.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
903
626
  flexShrink: 0,
904
627
  flexBasis: "auto",
905
- opacity: c ? 0.6 : 1,
628
+ opacity: d ? 0.6 : 1,
906
629
  transition: "opacity 0.3s ease"
907
630
  },
908
- children: n.text
631
+ children: e.text
909
632
  },
910
- n.id
633
+ e.id
911
634
  ))
912
635
  }
913
636
  ),
914
- /* @__PURE__ */ s.jsx(
637
+ /* @__PURE__ */ a(
915
638
  "div",
916
639
  {
917
- onDragOver: (n) => n.preventDefault(),
918
- onDrop: (n) => be(n, "selected", null),
640
+ onDragOver: (e) => e.preventDefault(),
641
+ onDrop: (e) => ee(e, "selected", null),
919
642
  style: {
920
- minHeight: r || window.innerWidth < 768 ? "50px" : "70px",
643
+ minHeight: l || window.innerWidth < 768 ? "50px" : "70px",
921
644
  width: "auto",
922
645
  // Автоматическая ширина в зависимости от содержимого
923
646
  maxWidth: "none",
924
647
  // Убираем ограничение максимальной ширины
925
648
  minWidth: "245px",
926
649
  // Минимальная ширина для растягивания
927
- border: M === "correct" ? "2px dashed #4caf50" : M === "almost" ? "2px dashed #ff9800" : M === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
928
- borderRadius: r || window.innerWidth < 768 ? "8px" : "12px",
929
- padding: r || window.innerWidth < 768 ? "8px" : "12px",
650
+ border: A === "correct" ? "2px dashed #4caf50" : A === "almost" ? "2px dashed #ff9800" : A === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
651
+ borderRadius: l || window.innerWidth < 768 ? "8px" : "12px",
652
+ padding: l || window.innerWidth < 768 ? "8px" : "12px",
930
653
  display: "flex",
931
- flexWrap: R() ? "wrap" : "nowrap",
654
+ flexWrap: C() ? "wrap" : "nowrap",
932
655
  alignItems: "center",
933
656
  justifyContent: "center",
934
- fontSize: `${Te(I.length)}px`,
935
- background: M === "correct" ? "#e8f5e8" : M === "almost" ? "#fff3e0" : M === "wrong" ? "#ffebee" : "#fafafa",
936
- overflowX: R() ? "hidden" : "auto",
937
- whiteSpace: R() ? "normal" : "nowrap"
657
+ fontSize: `${ye(v.length)}px`,
658
+ background: A === "correct" ? "#e8f5e8" : A === "almost" ? "#fff3e0" : A === "wrong" ? "#ffebee" : "#fafafa",
659
+ overflowX: C() ? "hidden" : "auto",
660
+ whiteSpace: C() ? "normal" : "nowrap"
938
661
  },
939
- children: I.map((n, i) => /* @__PURE__ */ s.jsx(
662
+ children: v.map((e, t) => /* @__PURE__ */ a(
940
663
  "span",
941
664
  {
942
- draggable: !c,
943
- onDragStart: (t) => {
944
- if (c) {
945
- t.preventDefault();
665
+ draggable: !d,
666
+ onDragStart: (n) => {
667
+ if (d) {
668
+ n.preventDefault();
946
669
  return;
947
670
  }
948
- t.dataTransfer.setData(
671
+ n.dataTransfer.setData(
949
672
  "application/x-token",
950
- JSON.stringify({ from: "selected", id: n.id })
951
- ), t.dataTransfer.setData("text/plain", n.id);
673
+ JSON.stringify({ from: "selected", id: e.id })
674
+ ), n.dataTransfer.setData("text/plain", e.id);
952
675
  },
953
- onDragOver: (t) => t.preventDefault(),
954
- onDrop: (t) => {
955
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2, v = t.clientX > l ? i + 1 : i;
956
- a({ list: null, index: null, side: null }), t.stopPropagation(), be(t, "selected", v);
676
+ onDragOver: (n) => n.preventDefault(),
677
+ onDrop: (n) => {
678
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, u = n.clientX > o ? t + 1 : t;
679
+ P({ list: null, index: null, side: null }), n.stopPropagation(), ee(n, "selected", u);
957
680
  },
958
- onDragEnter: (t) => {
959
- if (c) return;
960
- const o = t.currentTarget.getBoundingClientRect(), l = o.left + o.width / 2;
961
- a({ list: "selected", index: i, side: t.clientX > l ? "right" : "left" });
681
+ onDragEnter: (n) => {
682
+ if (d) return;
683
+ const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
684
+ P({ list: "selected", index: t, side: n.clientX > o ? "right" : "left" });
962
685
  },
963
- onDragLeave: () => a({ list: null, index: null, side: null }),
686
+ onDragLeave: () => P({ list: null, index: null, side: null }),
964
687
  onClick: () => {
965
- c || ye("selected", "bank", n.id, null);
688
+ d || _("selected", "bank", e.id, null);
966
689
  },
967
- title: c ? "Time expired" : "Click to remove back to bank",
690
+ title: d ? "Time expired" : "Click to remove back to bank",
968
691
  style: {
969
- padding: f() ? "4px 6px" : "6px 10px",
970
- margin: f() ? "2px" : "4px",
971
- borderRadius: f() ? "4px" : "8px",
972
- background: c ? "#f0f0f0" : "#ffe9e7",
973
- border: c ? "1px solid #ccc" : "1px solid #ec4c44",
974
- borderLeft: e.list === "selected" && e.index === i && e.side === "left" ? "3px solid #3b82f6" : void 0,
975
- borderRight: e.list === "selected" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : void 0,
976
- cursor: c ? "not-allowed" : "pointer",
692
+ padding: c() ? "4px 6px" : "6px 10px",
693
+ margin: c() ? "2px" : "4px",
694
+ borderRadius: c() ? "4px" : "8px",
695
+ background: d ? "#f0f0f0" : "#ffe9e7",
696
+ border: d ? "1px solid #ccc" : "1px solid #ec4c44",
697
+ borderLeft: b.list === "selected" && b.index === t && b.side === "left" ? "3px solid #3b82f6" : void 0,
698
+ borderRight: b.list === "selected" && b.index === t && b.side === "right" ? "3px solid #3b82f6" : void 0,
699
+ cursor: d ? "not-allowed" : "pointer",
977
700
  userSelect: "none",
978
- fontSize: `${Te(I.length)}px`,
701
+ fontSize: `${ye(v.length)}px`,
979
702
  // Адаптивный размер шрифта для слов
980
703
  fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
981
704
  // Более плотный шрифт
982
705
  whiteSpace: "nowrap",
983
706
  // Запрещаем перенос слов
984
- opacity: c ? 0.6 : 1,
707
+ opacity: d ? 0.6 : 1,
985
708
  transition: "opacity 0.3s ease"
986
709
  },
987
- children: n.text
710
+ children: e.text
988
711
  },
989
- n.id
712
+ e.id
990
713
  ))
991
714
  }
992
715
  ),
993
- /* @__PURE__ */ s.jsx(
716
+ /* @__PURE__ */ a(
994
717
  "button",
995
718
  {
996
- onClick: () => Je(!0),
997
- disabled: !c && I.length === 0,
719
+ onClick: () => Ne(!0),
720
+ disabled: !d && v.length === 0,
998
721
  style: {
999
- marginTop: f() ? "15px" : "30px",
1000
- fontSize: f() ? "14px" : "20px",
1001
- padding: f() ? "6px 12px" : "10px 24px",
1002
- borderRadius: f() ? "8px" : "12px",
1003
- background: c || I.length > 0 ? "#ec4c44" : "#ccc",
722
+ marginTop: c() ? "15px" : "30px",
723
+ fontSize: c() ? "14px" : "20px",
724
+ padding: c() ? "6px 12px" : "10px 24px",
725
+ borderRadius: c() ? "8px" : "12px",
726
+ background: d || v.length > 0 ? "#ec4c44" : "#ccc",
1004
727
  color: "white",
1005
728
  border: "none",
1006
- cursor: c || I.length > 0 ? "pointer" : "not-allowed"
729
+ cursor: d || v.length > 0 ? "pointer" : "not-allowed"
1007
730
  },
1008
731
  children: "NEXT"
1009
732
  }
1010
733
  )
1011
- ] }), Ke = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
1012
- /* @__PURE__ */ s.jsx("h1", { style: {
1013
- ...h.gmHeadline1,
1014
- marginTop: (r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie, "0px"),
1015
- marginBottom: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "10px",
1016
- fontSize: r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "32px" : "clamp(28px, 4vw, 40px)"
734
+ ] }), Xe = () => /* @__PURE__ */ f("div", { style: g.gmCenterScreen, children: [
735
+ /* @__PURE__ */ a("h1", { style: {
736
+ ...g.gmHeadline1,
737
+ marginTop: (l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q, "0px"),
738
+ marginBottom: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "10px",
739
+ fontSize: l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "32px" : "clamp(28px, 4vw, 40px)"
1017
740
  }, children: "Game Over 🎯" }),
1018
- /* @__PURE__ */ s.jsxs("h2", { style: {
1019
- ...h.gmHeadline2,
1020
- marginTop: (r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie, "0px"),
1021
- marginBottom: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "16px",
1022
- fontSize: r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "18px" : "24px"
741
+ /* @__PURE__ */ f("h2", { style: {
742
+ ...g.gmHeadline2,
743
+ marginTop: (l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q, "0px"),
744
+ marginBottom: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "16px",
745
+ fontSize: l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "18px" : "24px"
1023
746
  }, children: [
1024
747
  "Your score: ",
1025
- $,
748
+ J,
1026
749
  " out of ",
1027
- H
750
+ I
1028
751
  ] }),
1029
- /* @__PURE__ */ s.jsxs("p", { style: {
1030
- ...h.gmBodyM,
752
+ /* @__PURE__ */ f("p", { style: {
753
+ ...g.gmBodyM,
1031
754
  color: "#10b981",
1032
- marginTop: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "0px" : "12px",
1033
- marginBottom: r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "16px",
1034
- fontSize: r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px"
755
+ marginTop: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "0px" : "12px",
756
+ marginBottom: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "16px",
757
+ fontSize: l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px"
1035
758
  }, children: [
1036
759
  "Best score: ",
1037
- X
760
+ oe
1038
761
  ] }),
1039
- /* @__PURE__ */ s.jsxs("div", { style: {
762
+ /* @__PURE__ */ f("div", { style: {
1040
763
  display: "flex",
1041
- gap: r && window.innerWidth > window.innerHeight || r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
1042
- marginTop: r && window.innerWidth > window.innerHeight || r && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || ce ? "12px" : "24px"
764
+ gap: l && window.innerWidth > window.innerHeight || l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
765
+ marginTop: l && window.innerWidth > window.innerHeight || l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || He ? "12px" : "24px"
1043
766
  }, children: [
1044
- /* @__PURE__ */ s.jsx(
767
+ /* @__PURE__ */ a(
1045
768
  "button",
1046
769
  {
1047
770
  onClick: () => {
1048
- We(), N("start"), setTimeout(() => {
1049
- T("getready"), le(null), F(!1);
771
+ de(), R("start"), setTimeout(() => {
772
+ k("getready"), fe(null), K(!1);
1050
773
  }, 800);
1051
774
  },
1052
775
  style: {
1053
- ...h.gmButton,
776
+ ...g.gmButton,
1054
777
  ...D("medium")
1055
778
  },
1056
779
  children: "🔁 Play again"
1057
780
  }
1058
781
  ),
1059
- /* @__PURE__ */ s.jsx(
782
+ /* @__PURE__ */ a(
1060
783
  "button",
1061
784
  {
1062
785
  onClick: () => {
1063
- N("click"), T("select"), B(null), ge(null), U([]), V(0), ae([]), F(!1);
786
+ R("click"), k("select"), pe(null), he(null), q([]), Y(0), ie([]), K(!1);
1064
787
  },
1065
788
  style: {
1066
- ...h.gmButton,
789
+ ...g.gmButton,
1067
790
  ...D("medium")
1068
791
  },
1069
792
  children: "⬅️ Exit"
1070
793
  }
1071
794
  )
1072
795
  ] })
1073
- ] }), Ie = d || (j ? `${j.endsWith("/") ? j.slice(0, -1) : j}/logo.svg` : typeof window < "u" && window.origin ? `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg` : null), en = !r && S && !(window.innerWidth > window.innerHeight) && window.innerHeight >= 700;
1074
- return /* @__PURE__ */ s.jsx(
796
+ ] }), be = r || (B ? `${B.endsWith("/") ? B.slice(0, -1) : B}/logo.svg` : typeof window < "u" && window.origin ? `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg` : null), Je = !l && y && !(window.innerWidth > window.innerHeight) && window.innerHeight >= 700;
797
+ return /* @__PURE__ */ a(
1075
798
  "div",
1076
799
  {
1077
- ref: W,
800
+ ref: ne,
1078
801
  style: {
1079
802
  width: "100%",
1080
803
  height: "100%",
@@ -1090,23 +813,23 @@ function wn(p = {}) {
1090
813
  right: 0,
1091
814
  bottom: 0
1092
815
  },
1093
- children: /* @__PURE__ */ s.jsx(
816
+ children: /* @__PURE__ */ a(
1094
817
  "div",
1095
818
  {
1096
819
  style: {
1097
- width: r ? "100%" : x || 1e3,
1098
- height: r ? "100%" : x || 1e3,
820
+ width: l ? "100%" : xe || 1e3,
821
+ height: l ? "100%" : xe || 1e3,
1099
822
  display: "flex",
1100
823
  justifyContent: "center",
1101
824
  alignItems: "center",
1102
825
  overflow: "hidden",
1103
- borderRadius: r ? 0 : "20px",
826
+ borderRadius: l ? 0 : "20px",
1104
827
  background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
1105
- boxShadow: r ? "none" : "0 0 40px rgba(0,0,0,0.1)",
1106
- margin: r ? "0 auto" : "unset",
828
+ boxShadow: l ? "none" : "0 0 40px rgba(0,0,0,0.1)",
829
+ margin: l ? "0 auto" : "unset",
1107
830
  position: "relative"
1108
831
  },
1109
- children: /* @__PURE__ */ s.jsx(
832
+ children: /* @__PURE__ */ a(
1110
833
  "div",
1111
834
  {
1112
835
  style: {
@@ -1117,25 +840,25 @@ function wn(p = {}) {
1117
840
  justifyContent: "center",
1118
841
  alignItems: "center"
1119
842
  },
1120
- children: /* @__PURE__ */ s.jsxs("div", { id: "magic-sentence-root", children: [
1121
- en ? /* @__PURE__ */ s.jsx("div", { style: {
1122
- ...h.gmLogoFixed,
843
+ children: /* @__PURE__ */ f("div", { id: "magic-sentence-root", children: [
844
+ Je ? /* @__PURE__ */ a("div", { style: {
845
+ ...g.gmLogoFixed,
1123
846
  display: "block"
1124
- }, children: Ie ? /* @__PURE__ */ s.jsx(
847
+ }, children: be ? /* @__PURE__ */ a(
1125
848
  "img",
1126
849
  {
1127
- src: Ie,
850
+ src: be,
1128
851
  alt: "SPEAKID Logo",
1129
- style: h.gmLogoImg,
852
+ style: g.gmLogoImg,
1130
853
  loading: "lazy"
1131
854
  }
1132
- ) : /* @__PURE__ */ s.jsx("div", { style: h.gmLogoImg, children: "SPEAKID" }) }) : null,
1133
- y === "select" ? Ve() : null,
1134
- y === "time" ? Xe() : null,
1135
- y === "type" ? qe() : null,
1136
- y === "getready" ? Ze() : null,
1137
- y === "play" ? Qe() : null,
1138
- y === "results" ? Ke() : null
855
+ ) : /* @__PURE__ */ a("div", { style: g.gmLogoImg, children: "SPEAKID" }) }) : null,
856
+ m === "select" ? je() : null,
857
+ m === "time" ? Oe() : null,
858
+ m === "type" ? Fe() : null,
859
+ m === "getready" ? Ze() : null,
860
+ m === "play" ? Qe() : null,
861
+ m === "results" ? Xe() : null
1139
862
  ] })
1140
863
  }
1141
864
  )
@@ -1144,27 +867,27 @@ function wn(p = {}) {
1144
867
  }
1145
868
  );
1146
869
  }
1147
- class xn extends sn {
1148
- constructor(d) {
1149
- super(d), this.state = { hasError: !1 };
870
+ class cn extends Ye {
871
+ constructor(r) {
872
+ super(r), this.state = { hasError: !1 };
1150
873
  }
1151
- static getDerivedStateFromError(d) {
874
+ static getDerivedStateFromError(r) {
1152
875
  return {
1153
876
  hasError: !0,
1154
- error: d
877
+ error: r
1155
878
  };
1156
879
  }
1157
- componentDidCatch(d, S) {
1158
- console.error("Game Error:", d, S), this.setState({
1159
- error: d,
1160
- errorInfo: S
880
+ componentDidCatch(r, y) {
881
+ console.error("Game Error:", r, y), this.setState({
882
+ error: r,
883
+ errorInfo: y
1161
884
  });
1162
885
  }
1163
886
  handleReset = () => {
1164
887
  this.setState({ hasError: !1, error: void 0, errorInfo: void 0 });
1165
888
  };
1166
889
  render() {
1167
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ s.jsxs("div", { style: {
890
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ f("div", { style: {
1168
891
  display: "flex",
1169
892
  flexDirection: "column",
1170
893
  alignItems: "center",
@@ -1176,9 +899,9 @@ class xn extends sn {
1176
899
  color: "#dc2626",
1177
900
  fontFamily: "system-ui, sans-serif"
1178
901
  }, children: [
1179
- /* @__PURE__ */ s.jsx("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
1180
- /* @__PURE__ */ s.jsx("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
1181
- /* @__PURE__ */ s.jsx(
902
+ /* @__PURE__ */ a("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
903
+ /* @__PURE__ */ a("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
904
+ /* @__PURE__ */ a(
1182
905
  "button",
1183
906
  {
1184
907
  onClick: this.handleReset,
@@ -1192,14 +915,14 @@ class xn extends sn {
1192
915
  cursor: "pointer",
1193
916
  transition: "background-color 0.2s"
1194
917
  },
1195
- onMouseOver: (d) => d.currentTarget.style.backgroundColor = "#b91c1c",
1196
- onMouseOut: (d) => d.currentTarget.style.backgroundColor = "#dc2626",
918
+ onMouseOver: (r) => r.currentTarget.style.backgroundColor = "#b91c1c",
919
+ onMouseOut: (r) => r.currentTarget.style.backgroundColor = "#dc2626",
1197
920
  children: "🔄 Restart Game"
1198
921
  }
1199
922
  ),
1200
- typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ s.jsxs("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
1201
- /* @__PURE__ */ s.jsx("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
1202
- /* @__PURE__ */ s.jsxs("pre", { style: {
923
+ typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ f("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
924
+ /* @__PURE__ */ a("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
925
+ /* @__PURE__ */ f("pre", { style: {
1203
926
  backgroundColor: "#f3f4f6",
1204
927
  padding: "12px",
1205
928
  borderRadius: "4px",
@@ -1215,12 +938,12 @@ class xn extends sn {
1215
938
  }
1216
939
  }
1217
940
  export {
1218
- xn as ErrorBoundary,
1219
- wn as Game,
1220
- Y as announceToScreenReader,
1221
- pn as createAriaLabel,
1222
- wn as default,
1223
- fn as handleKeyDown,
1224
- un as useValidation
941
+ cn as ErrorBoundary,
942
+ ln as Game,
943
+ E as announceToScreenReader,
944
+ en as createAriaLabel,
945
+ ln as default,
946
+ nn as handleKeyDown,
947
+ _e as useValidation
1225
948
  };
1226
949
  //# sourceMappingURL=speakid-build-a-sentence.es.js.map