@oneb/ui-vue 0.4.0 → 0.4.2

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,11 +1,10 @@
1
- import { defineComponent as O, computed as x, resolveComponent as U, openBlock as a, createElementBlock as c, createElementVNode as s, toDisplayString as r, createCommentVNode as h, createTextVNode as C, createVNode as E, withCtx as z, useSlots as ae, normalizeClass as R, renderSlot as F, ref as _, onMounted as le, onUnmounted as ue, normalizeStyle as ie, Fragment as ce, renderList as de, createSlots as Y, createBlock as P, unref as I, onBeforeUnmount as Z, watch as ve } from "vue";
1
+ import { defineComponent as T, computed as b, resolveComponent as N, openBlock as n, createElementBlock as u, createElementVNode as t, toDisplayString as r, createCommentVNode as h, createTextVNode as C, createVNode as I, withCtx as q, useSlots as re, normalizeClass as G, renderSlot as z, createBlock as Q, ref as x, onMounted as ae, onUnmounted as ne, normalizeStyle as le, Fragment as ue, renderList as ie, createSlots as W, onBeforeUnmount as X, watch as ce, unref as de } from "vue";
2
2
  import { useOnebI18n as L } from "../i18n/index.js";
3
- import { _ as ee } from "../_plugin-vue_export-helper-dad06003.js";
4
- import { useRouter as fe } from "vue-router";
5
- import { OneButton as M } from "../button/index.js";
6
- import { c as me } from "../clipboard-733b79a1.js";
7
- import "../SpinnerIcon-516264ba.js";
8
- const ye = {
3
+ import { _ as Y } from "../_plugin-vue_export-helper-dad06003.js";
4
+ import { useRouter as me } from "vue-router";
5
+ import { L as ve } from "../LogoOneb-ddb388a4.js";
6
+ import { c as fe } from "../clipboard-733b79a1.js";
7
+ const ge = {
9
8
  statusMessage: {
10
9
  type: String,
11
10
  required: !1
@@ -26,69 +25,61 @@ const ye = {
26
25
  type: Function,
27
26
  default: void 0
28
27
  }
29
- }, ge = O({
28
+ }, ye = T({
30
29
  name: "ErrorPage",
31
- props: ye,
30
+ props: ge,
32
31
  setup(e) {
33
32
  const o = L();
34
- return { t: x(() => e.t ?? o) };
33
+ return { t: b(() => e.t ?? o) };
35
34
  }
36
35
  });
37
- const pe = { class: "error-container" }, _e = { class: "text-8xl text-secondary-content" }, he = { key: 0 }, xe = {
36
+ const pe = { class: "error-container" }, xe = { class: "text-8xl text-secondary-content" }, he = { key: 0 }, _e = {
38
37
  key: 1,
39
38
  class: "pt-5"
40
39
  }, be = { class: "request-info hidden" };
41
- function ke(e, o, y, t, f, d) {
42
- const l = U("router-link");
43
- return a(), c("div", pe, [
44
- s("h1", _e, r(e.statusCode), 1),
45
- e.statusMessage ? (a(), c("p", he, r(e.statusMessage), 1)) : h("", !0),
46
- o[3] || (o[3] = s("div", { class: "border-b border-secondary-stroke w-full pt-10" }, null, -1)),
47
- e.statusText ? (a(), c("p", xe, r(e.statusText), 1)) : h("", !0),
48
- s("div", be, [
49
- s("p", null, [
50
- o[0] || (o[0] = s("strong", null, "Request ID:", -1)),
40
+ function ke(e, o, g, s, v, f) {
41
+ const i = N("router-link");
42
+ return n(), u("div", pe, [
43
+ t("h1", xe, r(e.statusCode), 1),
44
+ e.statusMessage ? (n(), u("p", he, r(e.statusMessage), 1)) : h("", !0),
45
+ o[3] || (o[3] = t("div", { class: "border-b border-secondary-stroke w-full pt-10" }, null, -1)),
46
+ e.statusText ? (n(), u("p", _e, r(e.statusText), 1)) : h("", !0),
47
+ t("div", be, [
48
+ t("p", null, [
49
+ o[0] || (o[0] = t("strong", null, "Request ID:", -1)),
51
50
  C(" " + r(e.requestId), 1)
52
51
  ]),
53
- o[1] || (o[1] = s("button", { class: "copy-btn" }, "Скопіювати", -1)),
54
- o[2] || (o[2] = s("p", null, [
52
+ o[1] || (o[1] = t("button", { class: "copy-btn" }, "Скопіювати", -1)),
53
+ o[2] || (o[2] = t("p", null, [
55
54
  C(" Передайте цю інформацію розробнику або напишіть в "),
56
- s("a", {
55
+ t("a", {
57
56
  href: "https://t.me/telegram_bot",
58
57
  target: "_blank"
59
58
  }, "Telegram-бот")
60
59
  ], -1))
61
60
  ]),
62
- E(l, {
61
+ I(i, {
63
62
  to: "/",
64
63
  class: "home-link"
65
64
  }, {
66
- default: z(() => [
65
+ default: q(() => [
67
66
  C(r(e.t("ui.errors.go_home")), 1)
68
67
  ]),
69
68
  _: 1
70
69
  })
71
70
  ]);
72
71
  }
73
- const gt = /* @__PURE__ */ ee(ge, [["render", ke], ["__scopeId", "data-v-4ac01274"]]), we = { class: "flex items-center justify-center gap-2 sm:gap-4" }, Se = {
74
- key: 0,
75
- class: "relative"
76
- }, $e = { class: "one-error-logo-bounce" }, Ce = ["src"], Ee = {
72
+ const gt = /* @__PURE__ */ Y(ye, [["render", ke], ["__scopeId", "data-v-4ac01274"]]), we = { class: "flex items-center justify-center gap-2 sm:gap-4" }, Se = { class: "relative" }, $e = { class: "one-error-logo-bounce" }, Ce = ["src"], Ee = {
77
73
  key: 0,
78
74
  class: "absolute inset-0 animate-ping opacity-20",
79
75
  "aria-hidden": "true"
80
- }, Te = ["src"], D = "text-[100px] sm:text-[160px] font-bold text-secondary-stroke leading-none select-none", Oe = /* @__PURE__ */ O({
76
+ }, Te = ["src"], J = "text-[100px] sm:text-[160px] font-bold text-slate-200 leading-none select-none", Oe = /* @__PURE__ */ T({
81
77
  __name: "OneErrorHero",
82
78
  props: {
83
79
  left: {
84
80
  type: String,
85
81
  required: !0
86
82
  },
87
- /** Fallback digit shown when there is no logo (neither slot nor logoSrc). */
88
- middle: {
89
- type: String,
90
- required: !0
91
- },
92
83
  right: {
93
84
  type: String,
94
85
  required: !0
@@ -99,60 +90,61 @@ const gt = /* @__PURE__ */ ee(ge, [["render", ke], ["__scopeId", "data-v-4ac0127
99
90
  }
100
91
  },
101
92
  setup(e) {
102
- const o = e, y = ae(), t = x(() => !!y.default), f = x(() => t.value || !!o.logoSrc);
103
- return (d, l) => (a(), c("div", we, [
104
- s("span", {
105
- class: R(D)
93
+ const o = re(), g = b(() => !!o.default);
94
+ return (s, v) => (n(), u("div", we, [
95
+ t("span", {
96
+ class: G(J)
106
97
  }, r(e.left), 1),
107
- f.value ? (a(), c("div", Se, [
108
- s("div", $e, [
109
- F(d.$slots, "default", {}, () => [
110
- s("img", {
98
+ t("div", Se, [
99
+ t("div", $e, [
100
+ z(s.$slots, "default", {}, () => [
101
+ e.logoSrc ? (n(), u("img", {
102
+ key: 0,
111
103
  src: e.logoSrc,
112
- class: "w-20 h-20 sm:w-28 sm:h-28",
104
+ class: "w-24 h-24 sm:w-36 sm:h-36",
113
105
  alt: "Logo"
114
- }, null, 8, Ce)
106
+ }, null, 8, Ce)) : (n(), Q(ve, {
107
+ key: 1,
108
+ class: "w-24 h-24 sm:w-36 sm:h-36"
109
+ }))
115
110
  ], !0)
116
111
  ]),
117
- e.logoSrc && !t.value ? (a(), c("div", Ee, [
118
- s("img", {
112
+ e.logoSrc && !g.value ? (n(), u("div", Ee, [
113
+ t("img", {
119
114
  src: e.logoSrc,
120
- class: "w-20 h-20 sm:w-28 sm:h-28",
115
+ class: "w-24 h-24 sm:w-36 sm:h-36",
121
116
  alt: ""
122
117
  }, null, 8, Te)
123
118
  ])) : h("", !0)
124
- ])) : (a(), c("span", {
125
- key: 1,
126
- class: R(D)
127
- }, r(e.middle), 1)),
128
- s("span", {
129
- class: R(D)
119
+ ]),
120
+ t("span", {
121
+ class: G(J)
130
122
  }, r(e.right), 1)
131
123
  ]));
132
124
  }
133
125
  });
134
- const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { class: "w-full" }, Ie = { class: "flex items-center justify-between mb-4" }, ze = { class: "flex items-center gap-4" }, Fe = { class: "text-sm text-secondary-base" }, Le = {
135
- class: "text-success-content",
126
+ const Z = /* @__PURE__ */ Y(Oe, [["__scopeId", "data-v-957a8a83"]]), Ie = { class: "w-full" }, qe = { class: "flex items-center justify-between mb-4" }, ze = { class: "flex items-center gap-4" }, Le = { class: "text-sm text-slate-600" }, Fe = {
127
+ class: "text-emerald-700",
136
128
  "data-test": "snake-score"
137
129
  }, je = {
138
130
  key: 0,
139
- class: "text-sm text-danger-base font-medium",
131
+ class: "text-sm text-rose-600 font-medium",
140
132
  "data-test": "snake-status"
141
- }, Be = {
133
+ }, Re = {
142
134
  key: 1,
143
- class: "text-sm text-success-content",
135
+ class: "text-sm text-emerald-700",
144
136
  "data-test": "snake-status"
145
- }, Re = {
137
+ }, Me = {
146
138
  key: 2,
147
- class: "text-sm text-secondary-content",
139
+ class: "text-sm text-slate-500",
148
140
  "data-test": "snake-status"
149
- }, Me = { class: "flex gap-2" }, Ge = { class: "bg-secondary-body-active border border-secondary-stroke rounded-20 p-4 shadow-sm" }, Ne = ["data-snake"], De = {
141
+ }, Be = { class: "flex gap-2" }, Ge = { class: "bg-slate-50 border border-slate-200 rounded-2xl p-4 shadow-sm" }, Ne = ["data-snake"], De = {
150
142
  key: 0,
151
- class: "absolute inset-1 rounded-md border border-success-active/40"
143
+ class: "absolute inset-1 rounded-md border border-emerald-800/40"
152
144
  }, He = {
153
145
  key: 1,
154
- class: "absolute inset-2 rounded-sm bg-danger-base"
155
- }, Pe = { class: "text-xs text-secondary-content text-center mt-3" }, Ue = /* @__PURE__ */ O({
146
+ class: "absolute inset-2 rounded-sm bg-rose-600"
147
+ }, Pe = { class: "text-xs text-slate-500 text-center mt-3" }, Ue = /* @__PURE__ */ T({
156
148
  __name: "OneSnakeGame",
157
149
  props: {
158
150
  gridSize: {
@@ -169,62 +161,62 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
169
161
  }
170
162
  },
171
163
  emits: ["score", "game-over"],
172
- setup(e, { expose: o, emit: y }) {
173
- const t = e, f = y, d = L(), l = x(() => t.t ?? d), m = _([]), g = _({ x: 1, y: 0 }), k = _({ x: 1, y: 0 }), p = _({ x: 0, y: 0 }), w = _(0), b = _(!1), v = _(!1);
174
- let T = null;
175
- const oe = x(
176
- () => Array.from({ length: t.gridSize * t.gridSize }, (u, n) => ({
177
- x: n % t.gridSize,
178
- y: Math.floor(n / t.gridSize)
164
+ setup(e, { expose: o, emit: g }) {
165
+ const s = e, v = g, f = L(), i = b(() => s.t ?? f), m = x([]), y = x({ x: 1, y: 0 }), k = x({ x: 1, y: 0 }), p = x({ x: 0, y: 0 }), w = x(0), _ = x(!1), d = x(!1);
166
+ let E = null;
167
+ const te = b(
168
+ () => Array.from({ length: s.gridSize * s.gridSize }, (l, a) => ({
169
+ x: a % s.gridSize,
170
+ y: Math.floor(a / s.gridSize)
179
171
  }))
180
- ), G = (u) => {
181
- var n, i;
182
- return ((n = m.value[0]) == null ? void 0 : n.x) === u.x && ((i = m.value[0]) == null ? void 0 : i.y) === u.y;
183
- }, A = (u) => m.value.some((n, i) => i !== 0 && n.x === u.x && n.y === u.y), N = (u) => p.value.x === u.x && p.value.y === u.y, V = (u) => {
184
- const n = [];
185
- for (let S = 0; S < t.gridSize; S += 1)
186
- for (let $ = 0; $ < t.gridSize; $ += 1)
187
- u.some((X) => X.x === $ && X.y === S) || n.push({ x: $, y: S });
188
- if (n.length === 0)
172
+ ), R = (l) => {
173
+ var a, c;
174
+ return ((a = m.value[0]) == null ? void 0 : a.x) === l.x && ((c = m.value[0]) == null ? void 0 : c.y) === l.y;
175
+ }, D = (l) => m.value.some((a, c) => c !== 0 && a.x === l.x && a.y === l.y), M = (l) => p.value.x === l.x && p.value.y === l.y, H = (l) => {
176
+ const a = [];
177
+ for (let S = 0; S < s.gridSize; S += 1)
178
+ for (let $ = 0; $ < s.gridSize; $ += 1)
179
+ l.some((K) => K.x === $ && K.y === S) || a.push({ x: $, y: S });
180
+ if (a.length === 0)
189
181
  return { x: 0, y: 0 };
190
- const i = Math.floor(Math.random() * n.length);
191
- return n[i];
192
- }, j = () => {
193
- T != null && (clearInterval(T), T = null), b.value = !1;
194
- }, K = () => {
195
- j(), v.value = !0, f("game-over", w.value);
196
- }, q = () => {
197
- j(), m.value = [
182
+ const c = Math.floor(Math.random() * a.length);
183
+ return a[c];
184
+ }, F = () => {
185
+ E != null && (clearInterval(E), E = null), _.value = !1;
186
+ }, P = () => {
187
+ F(), d.value = !0, v("game-over", w.value);
188
+ }, O = () => {
189
+ F(), m.value = [
198
190
  {
199
- x: Math.floor(t.gridSize / 2),
200
- y: Math.floor(t.gridSize / 2)
191
+ x: Math.floor(s.gridSize / 2),
192
+ y: Math.floor(s.gridSize / 2)
201
193
  }
202
- ], g.value = { x: 1, y: 0 }, k.value = { x: 1, y: 0 }, p.value = V(m.value), w.value = 0, v.value = !1;
203
- }, ne = (u) => {
204
- g.value.x + u.x === 0 && g.value.y + u.y === 0 || (k.value = u);
205
- }, re = () => {
206
- g.value = k.value;
207
- const u = m.value[0], n = { x: u.x + g.value.x, y: u.y + g.value.y };
208
- if (n.x < 0 || n.x >= t.gridSize || n.y < 0 || n.y >= t.gridSize) {
209
- K();
194
+ ], y.value = { x: 1, y: 0 }, k.value = { x: 1, y: 0 }, p.value = H(m.value), w.value = 0, d.value = !1;
195
+ }, se = (l) => {
196
+ y.value.x + l.x === 0 && y.value.y + l.y === 0 || (k.value = l);
197
+ }, oe = () => {
198
+ y.value = k.value;
199
+ const l = m.value[0], a = { x: l.x + y.value.x, y: l.y + y.value.y };
200
+ if (a.x < 0 || a.x >= s.gridSize || a.y < 0 || a.y >= s.gridSize) {
201
+ P();
210
202
  return;
211
203
  }
212
- if (m.value.some(($) => $.x === n.x && $.y === n.y)) {
213
- K();
204
+ if (m.value.some(($) => $.x === a.x && $.y === a.y)) {
205
+ P();
214
206
  return;
215
207
  }
216
- const S = [n, ...m.value];
217
- n.x === p.value.x && n.y === p.value.y ? (w.value += 1, f("score", w.value), p.value = V(S)) : S.pop(), m.value = S;
218
- }, J = () => {
219
- T != null || v.value || (b.value = !0, T = setInterval(re, t.tickMs));
220
- }, Q = () => {
221
- if (v.value) {
222
- q();
208
+ const S = [a, ...m.value];
209
+ a.x === p.value.x && a.y === p.value.y ? (w.value += 1, v("score", w.value), p.value = H(S)) : S.pop(), m.value = S;
210
+ }, U = () => {
211
+ E != null || d.value || (_.value = !0, E = setInterval(oe, s.tickMs));
212
+ }, A = () => {
213
+ if (d.value) {
214
+ O();
223
215
  return;
224
216
  }
225
- b.value ? j() : J();
226
- }, W = (u) => {
227
- const n = u.key.toLowerCase(), i = {
217
+ _.value ? F() : U();
218
+ }, V = (l) => {
219
+ const a = l.key.toLowerCase(), c = {
228
220
  arrowup: { x: 0, y: -1 },
229
221
  w: { x: 0, y: -1 },
230
222
  arrowdown: { x: 0, y: 1 },
@@ -234,57 +226,57 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
234
226
  arrowright: { x: 1, y: 0 },
235
227
  d: { x: 1, y: 0 }
236
228
  };
237
- i[n] ? (ne(i[n]), !b.value && !v.value && J()) : n === " " ? (u.preventDefault(), v.value || Q()) : n === "enter" && v.value && q();
229
+ c[a] ? (se(c[a]), !_.value && !d.value && U()) : a === " " ? (l.preventDefault(), d.value || A()) : a === "enter" && d.value && O();
238
230
  };
239
- return le(() => {
240
- q(), window.addEventListener("keydown", W);
241
- }), ue(() => {
242
- j(), window.removeEventListener("keydown", W);
243
- }), o({ score: w, isRunning: b, isGameOver: v, resetGame: q }), (u, n) => (a(), c("div", qe, [
244
- s("div", Ie, [
245
- s("div", ze, [
246
- s("span", Fe, [
247
- C(r(l.value("ui.errors.snake_score")) + ": ", 1),
248
- s("strong", Le, r(w.value), 1)
231
+ return ae(() => {
232
+ O(), window.addEventListener("keydown", V);
233
+ }), ne(() => {
234
+ F(), window.removeEventListener("keydown", V);
235
+ }), o({ score: w, isRunning: _, isGameOver: d, resetGame: O }), (l, a) => (n(), u("div", Ie, [
236
+ t("div", qe, [
237
+ t("div", ze, [
238
+ t("span", Le, [
239
+ C(r(i.value("ui.errors.snake_score")) + ": ", 1),
240
+ t("strong", Fe, r(w.value), 1)
249
241
  ]),
250
- v.value ? (a(), c("span", je, r(l.value("ui.errors.snake_game_over")), 1)) : b.value ? (a(), c("span", Be, r(l.value("ui.errors.snake_running")), 1)) : (a(), c("span", Re, r(l.value("ui.errors.snake_paused")), 1))
242
+ d.value ? (n(), u("span", je, r(i.value("ui.errors.snake_game_over")), 1)) : _.value ? (n(), u("span", Re, r(i.value("ui.errors.snake_running")), 1)) : (n(), u("span", Me, r(i.value("ui.errors.snake_paused")), 1))
251
243
  ]),
252
- s("div", Me, [
253
- s("button", {
244
+ t("div", Be, [
245
+ t("button", {
254
246
  type: "button",
255
- class: "px-3 py-1.5 rounded-lg text-sm text-white bg-success-base hover:bg-success-hover transition",
247
+ class: "px-3 py-1.5 rounded-lg text-sm text-white bg-emerald-600 hover:bg-emerald-700 transition",
256
248
  "data-test": "snake-toggle",
257
- onClick: Q
258
- }, r(v.value ? l.value("ui.errors.snake_restart") : b.value ? l.value("ui.errors.snake_pause") : l.value("ui.errors.snake_start")), 1),
259
- s("button", {
249
+ onClick: A
250
+ }, r(d.value ? i.value("ui.errors.snake_restart") : _.value ? i.value("ui.errors.snake_pause") : i.value("ui.errors.snake_start")), 1),
251
+ t("button", {
260
252
  type: "button",
261
- class: "px-3 py-1.5 rounded-lg text-sm border border-secondary-stroke text-secondary-base hover:bg-secondary-body-hover transition",
253
+ class: "px-3 py-1.5 rounded-lg text-sm border border-slate-300 text-slate-700 hover:bg-slate-50 transition",
262
254
  "data-test": "snake-reset",
263
- onClick: q
264
- }, r(l.value("ui.errors.snake_reset")), 1)
255
+ onClick: O
256
+ }, r(i.value("ui.errors.snake_reset")), 1)
265
257
  ])
266
258
  ]),
267
- s("div", Ge, [
268
- s("div", {
259
+ t("div", Ge, [
260
+ t("div", {
269
261
  class: "w-full mx-auto",
270
- style: ie({ display: "grid", gridTemplateColumns: `repeat(${e.gridSize}, minmax(0, 1fr))` })
262
+ style: le({ display: "grid", gridTemplateColumns: `repeat(${e.gridSize}, minmax(0, 1fr))` })
271
263
  }, [
272
- (a(!0), c(ce, null, de(oe.value, (i) => (a(), c("div", {
273
- key: `${i.x}-${i.y}`,
274
- class: R(["relative aspect-square border border-secondary-stroke/60", [
275
- G(i) ? "bg-success-active shadow-inner" : A(i) ? "bg-success-25" : N(i) ? "bg-danger-glow" : "bg-white"
264
+ (n(!0), u(ue, null, ie(te.value, (c) => (n(), u("div", {
265
+ key: `${c.x}-${c.y}`,
266
+ class: G(["relative aspect-square border border-slate-200/60", [
267
+ R(c) ? "bg-emerald-600 shadow-inner" : D(c) ? "bg-emerald-300" : M(c) ? "bg-rose-400" : "bg-white"
276
268
  ]]),
277
269
  "data-test": "snake-cell",
278
- "data-snake": G(i) ? "head" : A(i) ? "body" : N(i) ? "food" : void 0
270
+ "data-snake": R(c) ? "head" : D(c) ? "body" : M(c) ? "food" : void 0
279
271
  }, [
280
- G(i) ? (a(), c("div", De)) : N(i) ? (a(), c("div", He)) : h("", !0)
272
+ R(c) ? (n(), u("div", De)) : M(c) ? (n(), u("div", He)) : h("", !0)
281
273
  ], 10, Ne))), 128))
282
274
  ], 4)
283
275
  ]),
284
- s("p", Pe, r(l.value("ui.errors.snake_instructions")), 1)
276
+ t("p", Pe, r(i.value("ui.errors.snake_instructions")), 1)
285
277
  ]));
286
278
  }
287
- }), Ae = { class: "flex flex-col items-center justify-center p-4" }, Ve = { class: "text-center mb-8" }, Ke = { class: "text-xl text-secondary-base mt-2" }, Je = { class: "flex gap-4 mt-4" }, pt = /* @__PURE__ */ O({
279
+ }), Ae = { class: "min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4" }, Ve = { class: "text-center mb-8" }, Ke = { class: "text-xl text-gray-600 mt-2" }, Je = { class: "flex gap-4 mt-4" }, yt = /* @__PURE__ */ T({
288
280
  __name: "OneNotFoundPage",
289
281
  props: {
290
282
  /** App logo shown between the digits; the #logo slot takes priority. */
@@ -306,68 +298,66 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
306
298
  }
307
299
  },
308
300
  setup(e) {
309
- const o = e, y = L(), t = x(() => o.t ?? y), f = fe(), d = _(!1), l = () => {
310
- f ? f.back() : typeof window < "u" && window.history.back();
301
+ const o = e, g = L(), s = b(() => o.t ?? g), v = me(), f = x(!1), i = () => {
302
+ v ? v.back() : typeof window < "u" && window.history.back();
311
303
  };
312
- return (m, g) => {
313
- const k = U("RouterLink");
314
- return a(), c("div", Ae, [
315
- s("div", Ve, [
316
- E(te, {
304
+ return (m, y) => {
305
+ const k = N("RouterLink");
306
+ return n(), u("div", Ae, [
307
+ t("div", Ve, [
308
+ I(Z, {
317
309
  left: "4",
318
- middle: "0",
319
310
  right: "4",
320
311
  "logo-src": e.logoSrc
321
- }, Y({ _: 2 }, [
312
+ }, W({ _: 2 }, [
322
313
  m.$slots.logo ? {
323
314
  name: "default",
324
- fn: z(() => [
325
- F(m.$slots, "logo")
315
+ fn: q(() => [
316
+ z(m.$slots, "logo")
326
317
  ]),
327
318
  key: "0"
328
319
  } : void 0
329
320
  ]), 1032, ["logo-src"]),
330
- s("p", Ke, r(t.value("ui.errors.page_not_found")), 1)
321
+ t("p", Ke, r(s.value("ui.errors.page_not_found")), 1)
331
322
  ]),
332
- e.withGame && !d.value ? (a(), P(I(M), {
323
+ e.withGame && !f.value ? (n(), u("button", {
333
324
  key: 0,
334
- variant: "success",
335
- size: "lg",
336
- label: t.value("ui.errors.play_snake"),
325
+ type: "button",
326
+ class: "px-6 py-2.5 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition font-medium shadow-lg",
337
327
  "data-test": "nf-play",
338
- onClick: g[0] || (g[0] = (p) => d.value = !0)
339
- }, null, 8, ["label"])) : h("", !0),
340
- d.value ? (a(), P(Ue, {
328
+ onClick: y[0] || (y[0] = (p) => f.value = !0)
329
+ }, r(s.value("ui.errors.play_snake")), 1)) : h("", !0),
330
+ f.value ? (n(), Q(Ue, {
341
331
  key: 1,
342
332
  class: "max-w-2xl",
343
- t: t.value
333
+ t: s.value
344
334
  }, null, 8, ["t"])) : h("", !0),
345
- s("div", Je, [
346
- E(k, {
335
+ t("div", Je, [
336
+ I(k, {
347
337
  to: e.homeTo,
348
- class: "text-info-base hover:text-info-active underline text-sm",
338
+ class: "text-blue-600 hover:text-blue-700 underline text-sm",
349
339
  "data-test": "nf-home"
350
340
  }, {
351
- default: z(() => [
352
- C(r(t.value("ui.errors.go_home")), 1)
341
+ default: q(() => [
342
+ C(r(s.value("ui.errors.go_home")), 1)
353
343
  ]),
354
344
  _: 1
355
345
  }, 8, ["to"]),
356
- s("button", {
346
+ t("button", {
357
347
  type: "button",
358
- class: "text-secondary-base hover:text-secondary-hover underline text-sm",
348
+ class: "text-gray-600 hover:text-gray-700 underline text-sm",
359
349
  "data-test": "nf-back",
360
- onClick: l
361
- }, r(t.value("ui.errors.go_back")), 1)
350
+ onClick: i
351
+ }, r(s.value("ui.errors.go_back")), 1)
362
352
  ])
363
353
  ]);
364
354
  };
365
355
  }
366
- }), Qe = { class: "flex flex-col items-center justify-center p-4" }, We = { class: "text-center mb-8" }, Xe = { class: "text-xl text-secondary-base mt-2" }, Ye = { class: "text-sm text-secondary-content mt-2 max-w-md mx-auto" }, Ze = {
356
+ }), Qe = { class: "min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4" }, We = { class: "text-center mb-8" }, Xe = { class: "text-xl text-gray-600 mt-2" }, Ye = { class: "text-sm text-gray-500 mt-2 max-w-md mx-auto" }, Ze = {
367
357
  key: 0,
368
- class: "mb-6 text-sm text-secondary-base text-center",
358
+ class: "mb-6 text-sm text-gray-600 text-center",
369
359
  "data-test": "se-request"
370
- }, et = { class: "flex flex-col items-center gap-4" }, _t = /* @__PURE__ */ O({
360
+ }, et = { class: "flex flex-col items-center gap-4" }, pt = /* @__PURE__ */ T({
371
361
  __name: "OneServerErrorPage",
372
362
  props: {
373
363
  /** App logo shown between the digits; the #logo slot takes priority. */
@@ -390,64 +380,62 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
390
380
  }
391
381
  },
392
382
  setup(e) {
393
- const o = e, y = L(), t = x(() => o.t ?? y), f = _(!1);
394
- let d = null;
395
- const l = async () => {
396
- !o.requestId || !await me(o.requestId) || (f.value = !0, d != null && clearTimeout(d), d = setTimeout(() => {
397
- f.value = !1, d = null;
383
+ const o = e, g = L(), s = b(() => o.t ?? g), v = x(!1);
384
+ let f = null;
385
+ const i = async () => {
386
+ !o.requestId || !await fe(o.requestId) || (v.value = !0, f != null && clearTimeout(f), f = setTimeout(() => {
387
+ v.value = !1, f = null;
398
388
  }, 2e3));
399
389
  }, m = () => {
400
390
  window.location.reload();
401
391
  };
402
- return Z(() => {
403
- d != null && clearTimeout(d);
404
- }), (g, k) => {
405
- const p = U("RouterLink");
406
- return a(), c("div", Qe, [
407
- s("div", We, [
408
- E(te, {
392
+ return X(() => {
393
+ f != null && clearTimeout(f);
394
+ }), (y, k) => {
395
+ const p = N("RouterLink");
396
+ return n(), u("div", Qe, [
397
+ t("div", We, [
398
+ I(Z, {
409
399
  left: "5",
410
- middle: "0",
411
400
  right: "0",
412
401
  "logo-src": e.logoSrc
413
- }, Y({ _: 2 }, [
414
- g.$slots.logo ? {
402
+ }, W({ _: 2 }, [
403
+ y.$slots.logo ? {
415
404
  name: "default",
416
- fn: z(() => [
417
- F(g.$slots, "logo")
405
+ fn: q(() => [
406
+ z(y.$slots, "logo")
418
407
  ]),
419
408
  key: "0"
420
409
  } : void 0
421
410
  ]), 1032, ["logo-src"]),
422
- s("p", Xe, r(t.value("ui.errors.server_error")), 1),
423
- s("p", Ye, r(t.value("ui.errors.server_error_hint")), 1)
411
+ t("p", Xe, r(s.value("ui.errors.server_error")), 1),
412
+ t("p", Ye, r(s.value("ui.errors.server_error_hint")), 1)
424
413
  ]),
425
- e.requestId ? (a(), c("div", Ze, [
426
- C(r(t.value("ui.errors.request_id")) + ": ", 1),
427
- s("strong", null, r(e.requestId), 1),
428
- s("button", {
414
+ e.requestId ? (n(), u("div", Ze, [
415
+ C(r(s.value("ui.errors.request_id")) + ": ", 1),
416
+ t("strong", null, r(e.requestId), 1),
417
+ t("button", {
429
418
  type: "button",
430
- class: "ml-2 text-info-base hover:text-info-active underline",
419
+ class: "ml-2 text-blue-600 hover:text-blue-700 underline",
431
420
  "data-test": "se-copy",
432
- onClick: l
433
- }, r(f.value ? t.value("ui.errors.copied") : t.value("ui.errors.copy")), 1)
421
+ onClick: i
422
+ }, r(v.value ? s.value("ui.errors.copied") : s.value("ui.errors.copy")), 1)
434
423
  ])) : h("", !0),
435
- s("div", et, [
436
- E(I(M), {
437
- variant: "primary",
438
- size: "lg",
439
- label: t.value("ui.errors.reload_page"),
424
+ t("div", et, [
425
+ t("button", {
426
+ type: "button",
427
+ class: "px-6 py-3 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition text-lg font-medium shadow-lg",
440
428
  "data-test": "se-reload",
441
429
  onClick: m
442
- }, null, 8, ["label"]),
443
- F(g.$slots, "support"),
444
- E(p, {
430
+ }, r(s.value("ui.errors.reload_page")), 1),
431
+ z(y.$slots, "support"),
432
+ I(p, {
445
433
  to: e.homeTo,
446
- class: "text-info-base hover:text-info-active underline text-sm",
434
+ class: "text-blue-600 hover:text-blue-700 underline text-sm",
447
435
  "data-test": "se-home"
448
436
  }, {
449
- default: z(() => [
450
- C(r(t.value("ui.errors.go_home")), 1)
437
+ default: q(() => [
438
+ C(r(s.value("ui.errors.go_home")), 1)
451
439
  ]),
452
440
  _: 1
453
441
  }, 8, ["to"])
@@ -455,31 +443,31 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
455
443
  ]);
456
444
  };
457
445
  }
458
- }), B = _(!1), H = _(null);
459
- function se() {
460
- return { show: B, error: H, trigger: (y) => {
461
- B.value || (H.value = y, B.value = !0);
446
+ }), j = x(!1), B = x(null);
447
+ function ee() {
448
+ return { show: j, error: B, trigger: (g) => {
449
+ j.value || (B.value = g, j.value = !0);
462
450
  }, dismiss: () => {
463
- B.value = !1, H.value = null;
451
+ j.value = !1, B.value = null;
464
452
  } };
465
453
  }
466
454
  const tt = {
467
455
  key: 0,
468
- class: "fixed inset-0 z-[10000] flex items-center justify-center bg-secondary-body p-6",
456
+ class: "fixed inset-0 z-[10000] flex items-center justify-center bg-[#f5f7fb] p-6",
469
457
  role: "alert",
470
458
  "aria-live": "assertive",
471
459
  "data-test": "crash-screen"
472
460
  }, st = { class: "flex w-full max-w-[480px] flex-col items-center text-center" }, ot = {
473
461
  key: 0,
474
462
  class: "mb-6"
475
- }, nt = ["src"], rt = { class: "mb-3 text-2xl font-semibold" }, at = {
476
- class: "mb-8 text-base text-secondary-base",
463
+ }, rt = ["src"], at = { class: "mb-3 text-2xl font-semibold text-gray-900" }, nt = {
464
+ class: "mb-8 text-base text-gray-600",
477
465
  "data-test": "crash-message"
478
466
  }, lt = {
479
467
  key: 2,
480
468
  "data-test": "crash-details",
481
- class: "mt-6 text-xs text-secondary-content"
482
- }, ht = /* @__PURE__ */ O({
469
+ class: "mt-6 text-xs text-gray-400"
470
+ }, xt = /* @__PURE__ */ T({
483
471
  __name: "OneCrashScreen",
484
472
  props: {
485
473
  /** App logo above the title; the #logo slot takes priority. */
@@ -515,78 +503,76 @@ const tt = {
515
503
  }
516
504
  },
517
505
  setup(e) {
518
- const o = e, y = L(), t = x(() => o.t ?? y), { show: f, error: d } = se(), l = _(o.autoReloadSeconds);
506
+ const o = e, g = L(), s = b(() => o.t ?? g), { show: v, error: f } = ee(), i = x(o.autoReloadSeconds);
519
507
  let m = null;
520
- const g = x(() => {
521
- const v = d.value;
522
- return v instanceof Error ? `${v.name}: ${v.message}` : String(v ?? "Unknown error");
523
- }), k = x(() => o.persistent ? t.value("ui.crash.persistent") : l.value > 0 ? t.value("ui.crash.countdown", { n: l.value }) : t.value("ui.crash.reloading")), p = () => {
508
+ const y = b(() => {
509
+ const d = f.value;
510
+ return d instanceof Error ? `${d.name}: ${d.message}` : String(d ?? "Unknown error");
511
+ }), k = b(() => o.persistent ? s.value("ui.crash.persistent") : i.value > 0 ? s.value("ui.crash.countdown", { n: i.value }) : s.value("ui.crash.reloading")), p = () => {
524
512
  m != null && (clearInterval(m), m = null);
525
513
  }, w = () => {
526
514
  p(), window.location.reload();
527
- }, b = () => {
515
+ }, _ = () => {
528
516
  o.accountUrl && (p(), window.location.href = o.accountUrl);
529
517
  };
530
- return ve(
531
- f,
532
- (v) => {
533
- p(), v && (l.value = o.autoReloadSeconds, !o.persistent && (m = setInterval(() => {
534
- l.value -= 1, l.value <= 0 && (p(), window.location.reload());
518
+ return ce(
519
+ v,
520
+ (d) => {
521
+ p(), d && (i.value = o.autoReloadSeconds, !o.persistent && (m = setInterval(() => {
522
+ i.value -= 1, i.value <= 0 && (p(), window.location.reload());
535
523
  }, 1e3)));
536
524
  },
537
525
  { immediate: !0 }
538
- ), Z(() => {
526
+ ), X(() => {
539
527
  p();
540
- }), (v, T) => I(f) ? (a(), c("div", tt, [
541
- s("div", st, [
542
- e.logoSrc || v.$slots.logo ? (a(), c("div", ot, [
543
- F(v.$slots, "logo", {}, () => [
544
- s("img", {
528
+ }), (d, E) => de(v) ? (n(), u("div", tt, [
529
+ t("div", st, [
530
+ e.logoSrc || d.$slots.logo ? (n(), u("div", ot, [
531
+ z(d.$slots, "logo", {}, () => [
532
+ t("img", {
545
533
  src: e.logoSrc,
546
534
  alt: "",
547
535
  class: "h-20 w-20"
548
- }, null, 8, nt)
536
+ }, null, 8, rt)
549
537
  ])
550
538
  ])) : h("", !0),
551
- s("h1", rt, r(t.value("ui.crash.title")), 1),
552
- s("p", at, r(k.value), 1),
553
- E(I(M), {
554
- class: "w-full mb-3",
555
- variant: "primary",
556
- label: t.value("ui.crash.reload_now"),
539
+ t("h1", at, r(s.value("ui.crash.title")), 1),
540
+ t("p", nt, r(k.value), 1),
541
+ t("button", {
542
+ type: "button",
543
+ class: "mb-3 w-full rounded-lg bg-gradient-to-r from-[#E1A508] to-[#E04040] px-6 py-3 text-base font-medium text-white transition hover:opacity-90",
557
544
  "data-test": "crash-reload",
558
545
  onClick: w
559
- }, null, 8, ["label"]),
560
- e.accountUrl ? (a(), P(I(M), {
546
+ }, r(s.value("ui.crash.reload_now")), 1),
547
+ e.accountUrl ? (n(), u("button", {
561
548
  key: 1,
562
- class: "w-full",
563
- variant: "secondary",
564
- label: t.value("ui.crash.open_account"),
549
+ type: "button",
550
+ class: "w-full rounded-lg border border-gray-300 bg-white px-6 py-3 text-base font-medium text-gray-700 transition hover:bg-gray-50",
565
551
  "data-test": "crash-account",
566
- onClick: b
567
- }, null, 8, ["label"])) : h("", !0),
568
- e.showDetails ? (a(), c("p", lt, r(g.value), 1)) : h("", !0)
552
+ onClick: _
553
+ }, r(s.value("ui.crash.open_account")), 1)) : h("", !0),
554
+ e.showDetails ? (n(), u("p", lt, r(y.value), 1)) : h("", !0)
569
555
  ])
570
556
  ])) : h("", !0);
571
557
  }
572
558
  });
573
- function xt(e = {}) {
559
+ function ht(e = {}) {
574
560
  const o = e.criticalInfos ?? ["setup function", "render function"];
575
- return (y, t, f) => {
576
- var d;
561
+ return (g, s, v) => {
562
+ var f;
577
563
  try {
578
- (d = e.onError) == null || d.call(e, y, f);
564
+ (f = e.onError) == null || f.call(e, g, v);
579
565
  } catch {
580
566
  }
581
- console.error("[Vue Error]", y, f), o.includes(f) && (e.onCritical ?? se().trigger)(y);
567
+ console.error("[Vue Error]", g, v), o.includes(v) && (e.onCritical ?? ee().trigger)(g);
582
568
  };
583
569
  }
584
570
  export {
585
- ht as OneCrashScreen,
571
+ xt as OneCrashScreen,
586
572
  gt as OneErrorPage,
587
- pt as OneNotFoundPage,
588
- _t as OneServerErrorPage,
573
+ yt as OneNotFoundPage,
574
+ pt as OneServerErrorPage,
589
575
  Ue as OneSnakeGame,
590
- xt as createAppErrorHandler,
591
- se as useCrashState
576
+ ht as createAppErrorHandler,
577
+ ee as useCrashState
592
578
  };