@pieai/swimmer-ui-kit 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -2
- package/README.md +3 -3
- package/dist/GameAvatar-Cs5KVYFf.js +923 -0
- package/dist/GameStageTile-BtBb8NEw.js +687 -0
- package/dist/{LiquidGroup-BXw1tv9H.js → LiquidGroup-RTK_Uvgw.js} +845 -376
- package/dist/index.d.ts +66 -1
- package/dist/index.js +520 -313
- package/dist/liquid-effects.js +36 -37
- package/dist/liquid-presence.d.ts +48 -0
- package/dist/liquid-presence.js +584 -413
- package/dist/preview.js +132 -132
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/GameStageTile-DwU_Vvi8.js +0 -1597
- package/dist/reducedMotion-B8kv-v64.js +0 -473
|
@@ -1,1597 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { _ as e, b as t, d as n, f as r, g as i, h as a, l as o, p as s, t as c, u as l, v as u, y as d } from "./LiquidGroup-BXw1tv9H.js";
|
|
3
|
-
import { g as f, h as p, r as m, t as h } from "./reducedMotion-B8kv-v64.js";
|
|
4
|
-
import { A as g, B as _, C as v, D as y, E as b, F as x, G as S, H as C, I as w, J as ee, K as te, L as ne, M as re, N as ie, O as ae, P as oe, R as se, S as ce, T as le, U as ue, V as de, W as fe, _ as pe, a as me, b as he, c as ge, d as _e, f as ve, g as ye, h as be, i as xe, j as Se, k as Ce, l as we, m as Te, n as Ee, o as De, p as Oe, q as ke, r as Ae, s as je, t as Me, u as Ne, v as Pe, w as Fe, x as Ie, y as Le, z as Re } from "./paths-B7D0h7Mh.js";
|
|
5
|
-
import { cloneElement as ze, createElement as Be, forwardRef as T, isValidElement as Ve, useCallback as He, useEffect as E, useId as D, useLayoutEffect as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
6
|
-
import { Fragment as Ue, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
7
|
-
//#region src/tokens/index.ts
|
|
8
|
-
var We = {
|
|
9
|
-
...e,
|
|
10
|
-
...t,
|
|
11
|
-
...u,
|
|
12
|
-
...a,
|
|
13
|
-
scrollbarSize: i.size,
|
|
14
|
-
scrollbarTrack: i.track,
|
|
15
|
-
scrollbarThumb: i.thumb,
|
|
16
|
-
scrollbarThumbHover: i.thumbHover,
|
|
17
|
-
...l,
|
|
18
|
-
...s,
|
|
19
|
-
...n,
|
|
20
|
-
...o,
|
|
21
|
-
...r
|
|
22
|
-
}, Ge = {
|
|
23
|
-
toneAttr: "data-game-ui-tone",
|
|
24
|
-
toneGlass: "glass",
|
|
25
|
-
densityAttr: "data-game-ui-density",
|
|
26
|
-
densityCompact: "compact",
|
|
27
|
-
scopeClass: "game-ui-overlay-scope"
|
|
28
|
-
}, Ke = d, qe = [
|
|
29
|
-
"--game-ui-bg",
|
|
30
|
-
"--game-ui-surface",
|
|
31
|
-
"--game-ui-surface-raised",
|
|
32
|
-
"--game-ui-surface-sunken",
|
|
33
|
-
"--game-ui-text",
|
|
34
|
-
"--game-ui-text-muted",
|
|
35
|
-
"--game-ui-accent",
|
|
36
|
-
"--game-ui-accent-bright",
|
|
37
|
-
"--game-ui-secondary",
|
|
38
|
-
"--game-ui-success",
|
|
39
|
-
"--game-ui-success-bright",
|
|
40
|
-
"--game-ui-danger",
|
|
41
|
-
"--game-ui-danger-bright",
|
|
42
|
-
"--game-ui-warning",
|
|
43
|
-
"--game-ui-focus-ring",
|
|
44
|
-
"--game-ui-border-subtle",
|
|
45
|
-
"--game-ui-border-strong",
|
|
46
|
-
"--game-ui-disabled",
|
|
47
|
-
"--game-ui-ink-deep",
|
|
48
|
-
"--game-ui-border-ink",
|
|
49
|
-
"--game-ui-wood",
|
|
50
|
-
"--game-ui-ink-title",
|
|
51
|
-
"--game-ui-ink-heading"
|
|
52
|
-
], P = {
|
|
53
|
-
set: {
|
|
54
|
-
kind: "body",
|
|
55
|
-
summary: "A liquid body firms up and stops being liquid.",
|
|
56
|
-
group: p,
|
|
57
|
-
groupEngaged: {
|
|
58
|
-
blur: 0,
|
|
59
|
-
blob: 0,
|
|
60
|
-
gloss: 0
|
|
61
|
-
},
|
|
62
|
-
item: {
|
|
63
|
-
effect: "morph",
|
|
64
|
-
morph: {
|
|
65
|
-
shape: !0,
|
|
66
|
-
speed: 1.2,
|
|
67
|
-
bounce: .12,
|
|
68
|
-
contentBlur: 0
|
|
69
|
-
},
|
|
70
|
-
transition: "snappy"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
press: {
|
|
74
|
-
kind: "body",
|
|
75
|
-
summary: "A control that squashes under a press and rebounds past its rest shape.",
|
|
76
|
-
group: p,
|
|
77
|
-
item: {
|
|
78
|
-
effect: "morph",
|
|
79
|
-
morph: {
|
|
80
|
-
shape: !0,
|
|
81
|
-
speed: 1,
|
|
82
|
-
bounce: .35,
|
|
83
|
-
contentBlur: 0
|
|
84
|
-
},
|
|
85
|
-
transition: "wobbly"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
swell: {
|
|
89
|
-
kind: "body",
|
|
90
|
-
summary: "A body grows to be noticed, without being touched.",
|
|
91
|
-
group: p,
|
|
92
|
-
item: {
|
|
93
|
-
effect: "morph",
|
|
94
|
-
morph: {
|
|
95
|
-
shape: !0,
|
|
96
|
-
speed: .7,
|
|
97
|
-
bounce: .4,
|
|
98
|
-
contentBlur: 0
|
|
99
|
-
},
|
|
100
|
-
transition: "wobbly"
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
settle: {
|
|
104
|
-
kind: "body",
|
|
105
|
-
summary: "Something arrives, overshoots, and comes to rest.",
|
|
106
|
-
group: p,
|
|
107
|
-
item: {
|
|
108
|
-
effect: "morph",
|
|
109
|
-
morph: {
|
|
110
|
-
shape: !0,
|
|
111
|
-
speed: .9,
|
|
112
|
-
bounce: .55,
|
|
113
|
-
contentBlur: 0
|
|
114
|
-
},
|
|
115
|
-
transition: "wobbly"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
fill: {
|
|
119
|
-
kind: "body",
|
|
120
|
-
summary: "A level rises and holds, the way a poured liquid settles.",
|
|
121
|
-
group: p,
|
|
122
|
-
item: {
|
|
123
|
-
effect: "morph",
|
|
124
|
-
morph: {
|
|
125
|
-
shape: !0,
|
|
126
|
-
speed: .9,
|
|
127
|
-
bounce: .08,
|
|
128
|
-
contentBlur: 0
|
|
129
|
-
},
|
|
130
|
-
transition: "smooth"
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
reach: {
|
|
134
|
-
kind: "body",
|
|
135
|
-
summary: "A body stretches toward something and thins as it goes.",
|
|
136
|
-
group: p,
|
|
137
|
-
item: {
|
|
138
|
-
effect: "morph",
|
|
139
|
-
morph: {
|
|
140
|
-
shape: !0,
|
|
141
|
-
speed: 1,
|
|
142
|
-
bounce: .15,
|
|
143
|
-
contentBlur: 0
|
|
144
|
-
},
|
|
145
|
-
transition: "smooth"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
ripple: {
|
|
149
|
-
kind: "body",
|
|
150
|
-
summary: "A shudder crosses the body and dies out, and nothing breaks.",
|
|
151
|
-
group: p,
|
|
152
|
-
item: {
|
|
153
|
-
effect: "morph",
|
|
154
|
-
morph: {
|
|
155
|
-
shape: !0,
|
|
156
|
-
speed: 1.6,
|
|
157
|
-
bounce: .5,
|
|
158
|
-
contentBlur: 0
|
|
159
|
-
},
|
|
160
|
-
transition: "wobbly"
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
drain: {
|
|
164
|
-
kind: "body",
|
|
165
|
-
summary: "A shape loses its boundary and goes.",
|
|
166
|
-
group: p,
|
|
167
|
-
item: { transition: "smooth" }
|
|
168
|
-
},
|
|
169
|
-
follow: {
|
|
170
|
-
kind: "group",
|
|
171
|
-
summary: "A single blob travels to whichever item is active.",
|
|
172
|
-
group: {
|
|
173
|
-
...p,
|
|
174
|
-
blur: 6
|
|
175
|
-
},
|
|
176
|
-
item: {
|
|
177
|
-
effect: "morph",
|
|
178
|
-
morph: {
|
|
179
|
-
shape: !0,
|
|
180
|
-
speed: 1.1,
|
|
181
|
-
bounce: .15,
|
|
182
|
-
contentBlur: 0
|
|
183
|
-
},
|
|
184
|
-
transition: "smooth"
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
merge: {
|
|
188
|
-
kind: "group",
|
|
189
|
-
summary: "Neighbouring shapes reach for each other and fuse into one body.",
|
|
190
|
-
group: {
|
|
191
|
-
...p,
|
|
192
|
-
blur: 10
|
|
193
|
-
},
|
|
194
|
-
item: {
|
|
195
|
-
effect: "morph",
|
|
196
|
-
morph: {
|
|
197
|
-
shape: !0,
|
|
198
|
-
speed: .8,
|
|
199
|
-
bounce: .2,
|
|
200
|
-
contentBlur: 0
|
|
201
|
-
},
|
|
202
|
-
transition: "smooth"
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
split: {
|
|
206
|
-
kind: "group",
|
|
207
|
-
summary: "One body pulls into two, and the neck between them thins and breaks.",
|
|
208
|
-
group: {
|
|
209
|
-
...p,
|
|
210
|
-
blur: 10
|
|
211
|
-
},
|
|
212
|
-
item: {
|
|
213
|
-
effect: "morph",
|
|
214
|
-
morph: {
|
|
215
|
-
shape: !0,
|
|
216
|
-
speed: .9,
|
|
217
|
-
bounce: .3,
|
|
218
|
-
contentBlur: 0
|
|
219
|
-
},
|
|
220
|
-
transition: "smooth"
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
bead: {
|
|
224
|
-
kind: "group",
|
|
225
|
-
summary: "A scatter of small droplets that can find each other.",
|
|
226
|
-
group: {
|
|
227
|
-
...p,
|
|
228
|
-
blur: 8
|
|
229
|
-
},
|
|
230
|
-
item: {
|
|
231
|
-
effect: "morph",
|
|
232
|
-
morph: {
|
|
233
|
-
shape: !0,
|
|
234
|
-
speed: 1,
|
|
235
|
-
bounce: .45,
|
|
236
|
-
contentBlur: 0
|
|
237
|
-
},
|
|
238
|
-
transition: "wobbly"
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}, Je = Object.keys(P);
|
|
242
|
-
function F(e, t) {
|
|
243
|
-
return {
|
|
244
|
-
...P[e].group,
|
|
245
|
-
...t
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
function Ye(e, t) {
|
|
249
|
-
let n = P[e].item;
|
|
250
|
-
return {
|
|
251
|
-
...n,
|
|
252
|
-
...t,
|
|
253
|
-
...n.morph || t?.morph ? { morph: {
|
|
254
|
-
...n.morph,
|
|
255
|
-
...t?.morph
|
|
256
|
-
} } : {}
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
//#endregion
|
|
260
|
-
//#region src/liquid/LiquidSurface/LiquidSurface.tsx
|
|
261
|
-
var Xe = {
|
|
262
|
-
set: {
|
|
263
|
-
scale: .99,
|
|
264
|
-
scaleY: .99,
|
|
265
|
-
y: 0
|
|
266
|
-
},
|
|
267
|
-
press: {
|
|
268
|
-
scale: 1.06,
|
|
269
|
-
scaleY: .87,
|
|
270
|
-
y: 3
|
|
271
|
-
},
|
|
272
|
-
swell: {
|
|
273
|
-
scale: 1.07,
|
|
274
|
-
scaleY: 1.07,
|
|
275
|
-
y: 0
|
|
276
|
-
},
|
|
277
|
-
settle: {
|
|
278
|
-
scale: 1,
|
|
279
|
-
scaleY: 1,
|
|
280
|
-
y: 0
|
|
281
|
-
},
|
|
282
|
-
fill: {
|
|
283
|
-
scale: 1,
|
|
284
|
-
scaleY: 1,
|
|
285
|
-
y: 0
|
|
286
|
-
},
|
|
287
|
-
reach: {
|
|
288
|
-
scale: 1.26,
|
|
289
|
-
scaleY: .88,
|
|
290
|
-
x: 12,
|
|
291
|
-
y: 0
|
|
292
|
-
},
|
|
293
|
-
ripple: {
|
|
294
|
-
scale: 1.04,
|
|
295
|
-
scaleY: .96,
|
|
296
|
-
y: 0
|
|
297
|
-
},
|
|
298
|
-
drain: {
|
|
299
|
-
scale: 1.08,
|
|
300
|
-
scaleY: .84,
|
|
301
|
-
y: 4
|
|
302
|
-
},
|
|
303
|
-
follow: {
|
|
304
|
-
scale: 1,
|
|
305
|
-
scaleY: 1,
|
|
306
|
-
y: 0
|
|
307
|
-
},
|
|
308
|
-
merge: {
|
|
309
|
-
scale: 1,
|
|
310
|
-
scaleY: 1,
|
|
311
|
-
y: 0
|
|
312
|
-
},
|
|
313
|
-
split: {
|
|
314
|
-
scale: 1,
|
|
315
|
-
scaleY: 1,
|
|
316
|
-
y: 0
|
|
317
|
-
},
|
|
318
|
-
bead: {
|
|
319
|
-
scale: 1,
|
|
320
|
-
scaleY: 1,
|
|
321
|
-
y: 0
|
|
322
|
-
}
|
|
323
|
-
}, Ze = { settle: {
|
|
324
|
-
scale: .94,
|
|
325
|
-
scaleY: 1.08,
|
|
326
|
-
y: -8
|
|
327
|
-
} }, Qe = {
|
|
328
|
-
scale: 1.04,
|
|
329
|
-
scaleY: 1.04,
|
|
330
|
-
y: 0
|
|
331
|
-
}, $e = 600, et = {
|
|
332
|
-
duration: $e,
|
|
333
|
-
ease: "ease-in-out"
|
|
334
|
-
};
|
|
335
|
-
function tt(e, t, n) {
|
|
336
|
-
let [r, i] = j(!1), [a, o] = j(t), [s, c] = j(!1);
|
|
337
|
-
return a !== t && (o(t), a && c(!0)), E(() => {
|
|
338
|
-
if (!e) return;
|
|
339
|
-
let t = window.setInterval(() => i((e) => !e), $e);
|
|
340
|
-
return () => window.clearInterval(t);
|
|
341
|
-
}, [e]), E(() => {
|
|
342
|
-
if (!s) return;
|
|
343
|
-
let e = window.setTimeout(() => c(!1), n);
|
|
344
|
-
return () => window.clearTimeout(e);
|
|
345
|
-
}, [s, n]), {
|
|
346
|
-
swollen: e && r,
|
|
347
|
-
rebounding: s
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
var nt = /* @__PURE__ */ new Set();
|
|
351
|
-
function rt(e) {
|
|
352
|
-
nt.has(e) || (nt.add(e), console.warn(`LiquidSurface cannot express the '${e}' form: it describes a relationship between sibling items, not one body. Arrange the items in a <LiquidGroup> with explicit group props instead; LiquidSurface will render a body that never moves.`));
|
|
353
|
-
}
|
|
354
|
-
function it({ children: e, form: t = "press", active: n = !1, breathing: r = !1, fill: i = "var(--game-ui-liquid-surface-fill, var(--game-ui-surface-raised))", stroke: a, shadow: o, gloss: s, outline: l, radius: u = 999, className: d, style: f }) {
|
|
355
|
-
let p = h(), g = n && !p, _ = k(() => F(t, g ? P[t].groupEngaged : void 0), [t, g]), v = k(() => Ye(t), [t]);
|
|
356
|
-
P[t].kind === "group" && rt(t);
|
|
357
|
-
let y = r && !g && !p, b = tt(y, g, m(v.transition).duration), x = g ? Xe[t] : b.swollen ? Qe : Ze[t] ?? {
|
|
358
|
-
scale: 1,
|
|
359
|
-
scaleY: 1,
|
|
360
|
-
y: 0
|
|
361
|
-
}, S = y && !b.rebounding ? et : v.transition, C = o ?? _.shadow, w = l ? {
|
|
362
|
-
amplitude: l.amplitude,
|
|
363
|
-
lobes: l.lobes ?? _.lobes
|
|
364
|
-
} : {
|
|
365
|
-
amplitude: _.blob,
|
|
366
|
-
lobes: _.lobes
|
|
367
|
-
};
|
|
368
|
-
return /* @__PURE__ */ N("span", {
|
|
369
|
-
className: ["game-ui-liquid-surface", d].filter(Boolean).join(" "),
|
|
370
|
-
"data-liquid-form": t,
|
|
371
|
-
"data-liquid-active": g ? "true" : "false",
|
|
372
|
-
"data-liquid-breathing": y ? "true" : void 0,
|
|
373
|
-
style: f,
|
|
374
|
-
children: [/* @__PURE__ */ M(c, {
|
|
375
|
-
"aria-hidden": "true",
|
|
376
|
-
blur: _.blur,
|
|
377
|
-
className: "game-ui-liquid-surface__body",
|
|
378
|
-
contrast: _.contrast,
|
|
379
|
-
gloss: s ?? _.gloss,
|
|
380
|
-
fill: i,
|
|
381
|
-
filterPadding: Math.max(_.filterPadding, Math.ceil(w.amplitude) + 8),
|
|
382
|
-
motion: p ? "reduced" : "auto",
|
|
383
|
-
...C === void 0 ? {} : { shadow: C },
|
|
384
|
-
...a === void 0 ? {} : { stroke: a },
|
|
385
|
-
children: /* @__PURE__ */ M(c.Item, {
|
|
386
|
-
...w.amplitude > 0 ? { blob: w } : {},
|
|
387
|
-
className: "game-ui-liquid-surface__shape",
|
|
388
|
-
...v.effect === void 0 ? {} : { effect: v.effect },
|
|
389
|
-
...v.morph === void 0 ? {} : { morph: v.morph },
|
|
390
|
-
radius: u,
|
|
391
|
-
scale: x.scale,
|
|
392
|
-
scaleY: x.scaleY,
|
|
393
|
-
...S === void 0 ? {} : { transition: S },
|
|
394
|
-
...x.x === void 0 ? {} : { x: x.x },
|
|
395
|
-
y: x.y,
|
|
396
|
-
children: /* @__PURE__ */ M("span", { className: "game-ui-liquid-surface__fill" })
|
|
397
|
-
})
|
|
398
|
-
}), /* @__PURE__ */ M("span", {
|
|
399
|
-
className: "game-ui-liquid-surface__content",
|
|
400
|
-
children: e
|
|
401
|
-
})]
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region src/feedback/sound/interactionSound.ts
|
|
406
|
-
var I = null, at = !1;
|
|
407
|
-
function L(e) {
|
|
408
|
-
return typeof e != "number" || !Number.isFinite(e) ? 1 : Math.min(1, Math.max(0, e));
|
|
409
|
-
}
|
|
410
|
-
function ot() {
|
|
411
|
-
at || typeof document > "u" || (document.addEventListener("visibilitychange", () => {
|
|
412
|
-
document.visibilityState === "hidden" && I?.state === "running" && I.suspend();
|
|
413
|
-
}), at = !0);
|
|
414
|
-
}
|
|
415
|
-
function st() {
|
|
416
|
-
return typeof window > "u" || window.AudioContext === void 0 ? null : (ot(), I ??= new window.AudioContext(), I);
|
|
417
|
-
}
|
|
418
|
-
function ct(e) {
|
|
419
|
-
let t = /* @__PURE__ */ new WeakMap();
|
|
420
|
-
return {
|
|
421
|
-
createGain: () => {
|
|
422
|
-
let n = e.createGain(), r = {
|
|
423
|
-
connect: (e) => {
|
|
424
|
-
e instanceof AudioNode && n.connect(e);
|
|
425
|
-
},
|
|
426
|
-
gain: n.gain
|
|
427
|
-
};
|
|
428
|
-
return t.set(r, n), r;
|
|
429
|
-
},
|
|
430
|
-
createOscillator: () => {
|
|
431
|
-
let n = e.createOscillator();
|
|
432
|
-
return {
|
|
433
|
-
connect: (e) => {
|
|
434
|
-
let r = t.get(e);
|
|
435
|
-
r && n.connect(r);
|
|
436
|
-
},
|
|
437
|
-
frequency: n.frequency,
|
|
438
|
-
start: (e) => n.start(e),
|
|
439
|
-
stop: (e) => n.stop(e),
|
|
440
|
-
get type() {
|
|
441
|
-
return n.type;
|
|
442
|
-
},
|
|
443
|
-
set type(e) {
|
|
444
|
-
n.type = e;
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
},
|
|
448
|
-
currentTime: e.currentTime,
|
|
449
|
-
destination: e.destination,
|
|
450
|
-
resume: () => e.resume(),
|
|
451
|
-
state: e.state,
|
|
452
|
-
suspend: () => e.suspend()
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
function lt(e, t = {}) {
|
|
456
|
-
if (t.enabled === !1) return !1;
|
|
457
|
-
let n = .06 * L(t.masterVolume) * L(t.sfxVolume);
|
|
458
|
-
if (n <= 0) return !1;
|
|
459
|
-
e.state === "suspended" && e.resume();
|
|
460
|
-
let r = e.currentTime, i = e.createOscillator(), a = e.createGain();
|
|
461
|
-
return i.type = "triangle", i.frequency.setValueAtTime(420, r), i.frequency.exponentialRampToValueAtTime(620, r + .045), a.gain.setValueAtTime(1e-4, r), a.gain.exponentialRampToValueAtTime(n, r + .008), a.gain.exponentialRampToValueAtTime(1e-4, r + .055), i.connect(a), a.connect(e.destination), i.start(r), i.stop(r + .055), !0;
|
|
462
|
-
}
|
|
463
|
-
function ut(e = {}) {
|
|
464
|
-
let t = st();
|
|
465
|
-
return t ? lt(ct(t), e) : !1;
|
|
466
|
-
}
|
|
467
|
-
function dt(e, t, n = {}) {
|
|
468
|
-
if (n.enabled === !1) return !1;
|
|
469
|
-
let r = .05 * L(n.masterVolume) * L(n.sfxVolume);
|
|
470
|
-
if (r <= 0) return !1;
|
|
471
|
-
e.state === "suspended" && e.resume();
|
|
472
|
-
let i = e.currentTime, a = (t, n, r, i, a, o) => {
|
|
473
|
-
let s = e.createOscillator(), c = e.createGain();
|
|
474
|
-
s.type = t, s.frequency.setValueAtTime(n, i), s.frequency.exponentialRampToValueAtTime(r, i + a), c.gain.setValueAtTime(1e-4, i), c.gain.exponentialRampToValueAtTime(o, i + .01), c.gain.exponentialRampToValueAtTime(1e-4, i + a), s.connect(c), c.connect(e.destination), s.start(i), s.stop(i + a);
|
|
475
|
-
};
|
|
476
|
-
return a("triangle", 900, 260, i, .09, r), (t === "legendary" ? [880, 1320] : t === "rare" ? [990] : []).forEach((e, t) => a("sine", e, e, i + .08 + t * .09, .35, r * .8)), !0;
|
|
477
|
-
}
|
|
478
|
-
function ft(e, t = {}) {
|
|
479
|
-
let n = st();
|
|
480
|
-
return n ? dt(ct(n), e, t) : !1;
|
|
481
|
-
}
|
|
482
|
-
function pt(e, t) {
|
|
483
|
-
let n = !1, r = null, i = null, a = !1, o = 0, s, c = !1, l = () => {}, u = () => e.matches(":disabled,[aria-disabled=\"true\"]") || !!e.querySelector(":scope > input:disabled"), d = () => {
|
|
484
|
-
o++, r = null, i = null, c = !1, clearTimeout(s), s = void 0, l(), l = () => {}, n && (n = !1, t(!1));
|
|
485
|
-
}, f = (e) => {
|
|
486
|
-
c || (r = null, i = null, l(), l = () => {}, e.defaultPrevented || s === void 0 ? d() : c = !0);
|
|
487
|
-
}, p = () => {
|
|
488
|
-
if (n) {
|
|
489
|
-
c = !1, m();
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
n = !0, t(!0), s = setTimeout(() => {
|
|
493
|
-
s = void 0, c && d();
|
|
494
|
-
}, 140), m();
|
|
495
|
-
}, m = () => {
|
|
496
|
-
l();
|
|
497
|
-
let t = (e) => {
|
|
498
|
-
(r === null || e.pointerId === r) && f(e);
|
|
499
|
-
}, n = (e) => {
|
|
500
|
-
(r === null || e.pointerId === r) && d();
|
|
501
|
-
}, a = (e) => {
|
|
502
|
-
e.key === i ? f(e) : e.key === "Escape" && d();
|
|
503
|
-
}, o = () => {
|
|
504
|
-
document.hidden && d();
|
|
505
|
-
}, s = new MutationObserver(() => {
|
|
506
|
-
u() && d();
|
|
507
|
-
});
|
|
508
|
-
for (let t = e; t; t = t.parentElement) (t === e || t.tagName === "FIELDSET") && s.observe(t, {
|
|
509
|
-
attributes: !0,
|
|
510
|
-
attributeFilter: ["disabled", "aria-disabled"]
|
|
511
|
-
});
|
|
512
|
-
window.addEventListener("pointerup", t), window.addEventListener("pointercancel", n), window.addEventListener("keyup", a), window.addEventListener("blur", d), document.addEventListener("visibilitychange", o), l = () => {
|
|
513
|
-
s.disconnect(), window.removeEventListener("pointerup", t), window.removeEventListener("pointercancel", n), window.removeEventListener("keyup", a), window.removeEventListener("blur", d), document.removeEventListener("visibilitychange", o);
|
|
514
|
-
};
|
|
515
|
-
}, h = (t) => {
|
|
516
|
-
if (t.button !== 0 || u()) return;
|
|
517
|
-
let n = ++o;
|
|
518
|
-
r = t.pointerId, queueMicrotask(() => {
|
|
519
|
-
!a && n === o && !t.defaultPrevented && !u() && e.isConnected ? p() : n === o && (r = null);
|
|
520
|
-
});
|
|
521
|
-
}, g = (e) => {
|
|
522
|
-
(r === null || e.pointerId === r) && f(e);
|
|
523
|
-
}, _ = (e) => {
|
|
524
|
-
(r === null || e.pointerId === r) && d();
|
|
525
|
-
}, v = () => {
|
|
526
|
-
c || d();
|
|
527
|
-
}, y = (t) => {
|
|
528
|
-
if (t.key === "Escape") {
|
|
529
|
-
d();
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
532
|
-
if (t.repeat || t.key !== " " && t.key !== "Enter" || u() || e.tagName === "LABEL" && t.key === "Enter" || e.tagName === "A" && t.key === " ") return;
|
|
533
|
-
let n = ++o;
|
|
534
|
-
queueMicrotask(() => {
|
|
535
|
-
!a && n === o && !t.defaultPrevented && !u() && e.isConnected && (i = t.key, p());
|
|
536
|
-
});
|
|
537
|
-
}, b = (e) => {
|
|
538
|
-
e.key === i ? f(e) : d();
|
|
539
|
-
}, x = (t) => {
|
|
540
|
-
c || (r === null || t.relatedTarget instanceof Node && !e.contains(t.relatedTarget)) && d();
|
|
541
|
-
};
|
|
542
|
-
return e.addEventListener("pointerdown", h), e.addEventListener("pointerup", g), e.addEventListener("pointercancel", _), e.addEventListener("pointerleave", v), e.addEventListener("lostpointercapture", v), e.addEventListener("keydown", y), e.addEventListener("keyup", b), e.addEventListener("blur", x, !0), () => {
|
|
543
|
-
a = !0, d(), e.removeEventListener("pointerdown", h), e.removeEventListener("pointerleave", v), e.removeEventListener("pointerup", g), e.removeEventListener("pointercancel", _), e.removeEventListener("lostpointercapture", v), e.removeEventListener("keydown", y), e.removeEventListener("keyup", b), e.removeEventListener("blur", x, !0);
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
//#endregion
|
|
547
|
-
//#region src/liquid/LiquidPressSurface/LiquidPressSurface.tsx
|
|
548
|
-
function mt({ children: e, control: t, controlIdentity: n, enabled: r, static: i = !1, fullWidth: a = !1, pending: o = !1 }) {
|
|
549
|
-
let [s, c] = j(!1);
|
|
550
|
-
return O(() => {
|
|
551
|
-
if (c(!1), !r || i || !t.current) return;
|
|
552
|
-
let e = !0, n = pt(t.current, (t) => {
|
|
553
|
-
e && c(t);
|
|
554
|
-
});
|
|
555
|
-
return () => {
|
|
556
|
-
e = !1, n();
|
|
557
|
-
};
|
|
558
|
-
}, [
|
|
559
|
-
t,
|
|
560
|
-
n,
|
|
561
|
-
r,
|
|
562
|
-
i
|
|
563
|
-
]), /* @__PURE__ */ N("span", {
|
|
564
|
-
className: "game-ui-button-frame",
|
|
565
|
-
"data-liquid": r ? "true" : void 0,
|
|
566
|
-
"data-full-width": a ? "true" : void 0,
|
|
567
|
-
children: [r ? /* @__PURE__ */ M(it, {
|
|
568
|
-
active: s && !i,
|
|
569
|
-
breathing: o && !i,
|
|
570
|
-
form: "press",
|
|
571
|
-
fill: f,
|
|
572
|
-
className: "game-ui-cta-decoration",
|
|
573
|
-
children: null
|
|
574
|
-
}, "decoration") : null, e]
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
//#endregion
|
|
578
|
-
//#region src/controls/DropletSurface/geometry.ts
|
|
579
|
-
var R = (e, t) => Number.isFinite(e) ? e : t, z = (e) => Math.round(e * 1e3) / 1e3, B = 1.4;
|
|
580
|
-
function V(e) {
|
|
581
|
-
let t = 2166136261;
|
|
582
|
-
for (let n of e) t = Math.imul(t ^ n.charCodeAt(0), 16777619);
|
|
583
|
-
return (t >>> 0) / 4294967296 * Math.PI * 2;
|
|
584
|
-
}
|
|
585
|
-
function H(e, t, n) {
|
|
586
|
-
let r = Math.max(1, R(e, 1)), i = Math.max(1, R(t, 1)), a = Math.max(.5, Math.min(R(n, i / 2), r / 2, i / 2)), o = Math.max(0, r - 2 * a), s = Math.max(0, i - 2 * a), c = Math.PI * a / 2, l = [
|
|
587
|
-
o,
|
|
588
|
-
c,
|
|
589
|
-
s,
|
|
590
|
-
c,
|
|
591
|
-
o,
|
|
592
|
-
c,
|
|
593
|
-
s,
|
|
594
|
-
c
|
|
595
|
-
], u = l.reduce((e, t) => e + t, 0), d = Math.min(224, Math.max(48, Math.ceil(u / 7))), f = [];
|
|
596
|
-
for (let e = 0; e < d; e++) {
|
|
597
|
-
let t = e / d, n = u * t, o = 0;
|
|
598
|
-
for (; o < 7 && n >= l[o];) n -= l[o++];
|
|
599
|
-
let s = 0, c = 0, p = 0, m = 0;
|
|
600
|
-
if (o === 0) s = a + n, c = 0, m = -1;
|
|
601
|
-
else if (o === 2) s = r, c = a + n, p = 1;
|
|
602
|
-
else if (o === 4) s = r - a - n, c = i, m = 1;
|
|
603
|
-
else if (o === 6) s = 0, c = i - a - n, p = -1;
|
|
604
|
-
else {
|
|
605
|
-
let e = (o - 3) * Math.PI / 4 + n / a, t = o < 4 ? r - a : a, l = o === 1 || o === 7 ? a : i - a;
|
|
606
|
-
p = Math.cos(e), m = Math.sin(e), s = t + a * p, c = l + a * m;
|
|
607
|
-
}
|
|
608
|
-
f.push({
|
|
609
|
-
x: s,
|
|
610
|
-
y: c,
|
|
611
|
-
nx: p,
|
|
612
|
-
ny: m,
|
|
613
|
-
u: t
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
return {
|
|
617
|
-
width: r,
|
|
618
|
-
height: i,
|
|
619
|
-
frequency: Math.max(2, Math.round(u / 110)),
|
|
620
|
-
points: f
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
function U(e, t, n = 0, r = 0, i = 0) {
|
|
624
|
-
let a = Math.max(0, Math.min(B, R(t, 0), Math.min(e.width, e.height) * .1)), o = R(n, 0), s = R(r, 0), c = R(i, 0), l = e.points.map((t) => {
|
|
625
|
-
let n = Math.PI * 2 * t.u, r = a * (.67 * Math.sin(n * e.frequency + s + o) + .33 * Math.sin(n * (e.frequency + 1) - s * .7 - o * .55));
|
|
626
|
-
return {
|
|
627
|
-
x: t.x + t.nx * r + c,
|
|
628
|
-
y: t.y + t.ny * r + c
|
|
629
|
-
};
|
|
630
|
-
}), u = (e) => l[(e + l.length) % l.length], d = u(0), f = `M${z(d.x)} ${z(d.y)}`;
|
|
631
|
-
for (let e = 0; e < l.length; e++) {
|
|
632
|
-
let t = u(e - 1), n = u(e), r = u(e + 1), i = u(e + 2);
|
|
633
|
-
f += `C${z(n.x + (r.x - t.x) / 6)} ${z(n.y + (r.y - t.y) / 6)} ${z(r.x - (i.x - n.x) / 6)} ${z(r.y - (i.y - n.y) / 6)} ${z(r.x)} ${z(r.y)}`;
|
|
634
|
-
}
|
|
635
|
-
return `${f}Z`;
|
|
636
|
-
}
|
|
637
|
-
//#endregion
|
|
638
|
-
//#region src/controls/DropletSurface/spring.ts
|
|
639
|
-
var ht = [
|
|
640
|
-
"x",
|
|
641
|
-
"y",
|
|
642
|
-
"amplitude",
|
|
643
|
-
"phase"
|
|
644
|
-
], gt = () => ({
|
|
645
|
-
x: 0,
|
|
646
|
-
y: 0,
|
|
647
|
-
amplitude: 0,
|
|
648
|
-
phase: 0
|
|
649
|
-
}), W = (e) => ({
|
|
650
|
-
x: 1,
|
|
651
|
-
y: 1,
|
|
652
|
-
amplitude: e,
|
|
653
|
-
phase: 0
|
|
654
|
-
}), _t = (e) => ({
|
|
655
|
-
x: 1.09,
|
|
656
|
-
y: .8,
|
|
657
|
-
amplitude: e * 1.75 + .65,
|
|
658
|
-
phase: .8
|
|
659
|
-
});
|
|
660
|
-
function vt(e) {
|
|
661
|
-
return {
|
|
662
|
-
value: W(e),
|
|
663
|
-
velocity: gt(),
|
|
664
|
-
target: W(e)
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
function G(e, t) {
|
|
668
|
-
e.value = { ...t }, e.target = { ...t }, e.velocity = gt();
|
|
669
|
-
}
|
|
670
|
-
function yt(e, t) {
|
|
671
|
-
let n = Math.min(.064, Math.max(0, Number.isFinite(t) ? t : 0));
|
|
672
|
-
for (; n > 0;) {
|
|
673
|
-
let t = Math.min(1 / 120, n);
|
|
674
|
-
for (let n of ht) e.velocity[n] += (320 * (e.target[n] - e.value[n]) - 14 * e.velocity[n]) * t, e.value[n] += e.velocity[n] * t;
|
|
675
|
-
n -= t;
|
|
676
|
-
}
|
|
677
|
-
let r = ht.some((t) => Math.abs(e.value[t] - e.target[t]) > 8e-4 || Math.abs(e.velocity[t]) > .008);
|
|
678
|
-
return r || G(e, e.target), r;
|
|
679
|
-
}
|
|
680
|
-
//#endregion
|
|
681
|
-
//#region src/controls/DropletSurface/controller.ts
|
|
682
|
-
var K = (e, t) => {
|
|
683
|
-
let n = Number.parseFloat(e);
|
|
684
|
-
return Number.isFinite(n) ? n : t;
|
|
685
|
-
};
|
|
686
|
-
function bt(e, t, n, r, i = t, a = B) {
|
|
687
|
-
let o = e.querySelector("path"), s = e.querySelector("g"), c = vt(1.4), l, u = 1.4, d = 10, f = 0, p, m = !1, h = !1, g = "", _ = () => {
|
|
688
|
-
if (h || !l) return;
|
|
689
|
-
let { x: e, y: t, phase: r, amplitude: i } = c.value;
|
|
690
|
-
o.setAttribute("d", U(l, i, r, n, d));
|
|
691
|
-
let a = d + l.width / 2, u = d + l.height / 2;
|
|
692
|
-
s.setAttribute("transform", `translate(${a} ${u}) scale(${e.toFixed(5)} ${t.toFixed(5)}) translate(${-a} ${-u})`);
|
|
693
|
-
}, v = () => {
|
|
694
|
-
p !== void 0 && cancelAnimationFrame(p), p = void 0;
|
|
695
|
-
}, y = () => {
|
|
696
|
-
let n = getComputedStyle(t), i = (e) => {
|
|
697
|
-
let r = e === "width" ? ["Left", "Right"] : ["Top", "Bottom"], i = n.boxSizing === "border-box" ? 0 : r.reduce((e, t) => e + K(n.getPropertyValue(`padding-${t.toLowerCase()}`), 0) + K(n.getPropertyValue(`border-${t.toLowerCase()}-width`), 0), 0);
|
|
698
|
-
return K(n[e], e === "width" ? t.offsetWidth : t.offsetHeight) + i;
|
|
699
|
-
}, o = i("width"), s = i("height");
|
|
700
|
-
if (o <= 0 || s <= 0) return;
|
|
701
|
-
let f = K(n.getPropertyValue("--game-ui-droplet-radius"), Math.min(o, s) / 2), p = Math.max(0, Math.min(B, Number.isFinite(a) ? Math.max(0, a) : B, K(n.getPropertyValue("--game-ui-droplet-wobble"), B))), h = `${o}|${s}|${f}|${p}`;
|
|
702
|
-
if (h === g) return;
|
|
703
|
-
g = h, u = p, l = H(o, s, f), d = Math.ceil(o * .025 + p * 3 + 6), e.setAttribute("width", String(o + 2 * d)), e.setAttribute("height", String(s + 2 * d)), e.setAttribute("viewBox", `0 0 ${o + 2 * d} ${s + 2 * d}`), e.style.left = `${-d}px`, e.style.top = `${-d}px`, e.style.width = `${o + d * 2}px`, e.style.height = `${s + d * 2}px`;
|
|
704
|
-
let v = m && r ? _t(u) : W(u);
|
|
705
|
-
G(c, v), e.dataset.ready = "true", _();
|
|
706
|
-
}, b = (e) => {
|
|
707
|
-
if (p = void 0, h || !t.isConnected) return;
|
|
708
|
-
if (document.hidden) {
|
|
709
|
-
G(c, W(u)), m = !1, _();
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
let n = yt(c, f ? (e - f) / 1e3 : 1 / 60);
|
|
713
|
-
f = e, _(), n && (p = requestAnimationFrame(b));
|
|
714
|
-
}, x = (t) => {
|
|
715
|
-
if (!h) {
|
|
716
|
-
if (y(), m = t && r, e.dataset.pressed = String(m), c.target = m ? _t(u) : W(u), !r || document.hidden || i.matches(":disabled,[aria-disabled=\"true\"]")) {
|
|
717
|
-
v(), G(c, W(u)), _();
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
p === void 0 && (f = 0, p = requestAnimationFrame(b));
|
|
721
|
-
}
|
|
722
|
-
};
|
|
723
|
-
y();
|
|
724
|
-
let S = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(y);
|
|
725
|
-
S?.observe(t);
|
|
726
|
-
let C = r ? pt(i, x) : () => {};
|
|
727
|
-
return () => {
|
|
728
|
-
h = !0, v(), C(), S?.disconnect(), delete e.dataset.ready, delete e.dataset.pressed;
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
//#endregion
|
|
732
|
-
//#region src/controls/DropletSurface/DropletSurface.tsx
|
|
733
|
-
function q({ static: e = !1, pressTarget: t, maxWobble: n = 1.4 }) {
|
|
734
|
-
let r = D(), i = A(null), a = h();
|
|
735
|
-
return O(() => {
|
|
736
|
-
let o = i.current, s = o?.parentElement;
|
|
737
|
-
if (!o || !(s instanceof HTMLElement)) return;
|
|
738
|
-
let c = !1, l, u = () => {
|
|
739
|
-
c || (l = bt(o, s, V(r), !a && !e, t?.current ?? s, n));
|
|
740
|
-
};
|
|
741
|
-
return t ? queueMicrotask(u) : u(), () => {
|
|
742
|
-
c = !0, l?.();
|
|
743
|
-
};
|
|
744
|
-
}, [
|
|
745
|
-
r,
|
|
746
|
-
a,
|
|
747
|
-
e,
|
|
748
|
-
t,
|
|
749
|
-
n
|
|
750
|
-
]), /* @__PURE__ */ M("svg", {
|
|
751
|
-
ref: i,
|
|
752
|
-
className: "game-ui-droplet",
|
|
753
|
-
"aria-hidden": "true",
|
|
754
|
-
focusable: "false",
|
|
755
|
-
children: /* @__PURE__ */ M("g", { children: /* @__PURE__ */ M("path", { vectorEffect: "non-scaling-stroke" }) })
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
function J() {
|
|
759
|
-
return /* @__PURE__ */ M("span", {
|
|
760
|
-
className: "game-ui-selection-mark",
|
|
761
|
-
"aria-hidden": "true",
|
|
762
|
-
children: "✓"
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
//#endregion
|
|
766
|
-
//#region src/tokens/hue.ts
|
|
767
|
-
function Y(e = "sky", t = !1) {
|
|
768
|
-
return t ? {
|
|
769
|
-
"--hue": "var(--game-ui-danger)",
|
|
770
|
-
"--game-ui-hue-ink": "var(--game-ui-control-danger-ink)"
|
|
771
|
-
} : { "--hue": `var(--game-ui-hue-${e})` };
|
|
772
|
-
}
|
|
773
|
-
//#endregion
|
|
774
|
-
//#region src/controls/NativeAction/NativeAction.tsx
|
|
775
|
-
function xt(e, t) {
|
|
776
|
-
return He((n) => {
|
|
777
|
-
t && (t.current = n);
|
|
778
|
-
let r = typeof e == "function" ? e(n) : void 0;
|
|
779
|
-
if (e && typeof e != "function" && (e.current = n), n) return () => {
|
|
780
|
-
t && (t.current = null), typeof r == "function" ? r() : typeof e == "function" ? e(null) : e && (e.current = null);
|
|
781
|
-
};
|
|
782
|
-
}, [e, t]);
|
|
783
|
-
}
|
|
784
|
-
var St = T(function(e, t) {
|
|
785
|
-
let n = xt(t);
|
|
786
|
-
if (e.href !== void 0) {
|
|
787
|
-
let { href: t, linkComponent: r, disabled: i = !1, target: a, rel: o, tabIndex: s, onClick: c, onKeyDown: l, onActivate: u, ...d } = e, f = {
|
|
788
|
-
...d,
|
|
789
|
-
target: a,
|
|
790
|
-
rel: a === "_blank" ? [...new Set(`${o ?? ""} noopener noreferrer`.trim().split(/\s+/))].join(" ") : o,
|
|
791
|
-
"aria-disabled": i ? !0 : d["aria-disabled"],
|
|
792
|
-
role: i ? "link" : d.role,
|
|
793
|
-
tabIndex: i ? void 0 : s,
|
|
794
|
-
onClick: (e) => {
|
|
795
|
-
if (i) {
|
|
796
|
-
e.preventDefault(), e.stopPropagation();
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
u?.(), c?.(e);
|
|
800
|
-
},
|
|
801
|
-
onKeyDown: (e) => {
|
|
802
|
-
if (i) {
|
|
803
|
-
e.preventDefault();
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
l?.(e);
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
return r && !i ? /* @__PURE__ */ M(r, {
|
|
810
|
-
...f,
|
|
811
|
-
href: t,
|
|
812
|
-
ref: n
|
|
813
|
-
}) : /* @__PURE__ */ M("a", {
|
|
814
|
-
...f,
|
|
815
|
-
href: i ? void 0 : t,
|
|
816
|
-
ref: n
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
let { href: r, linkComponent: i, onActivate: a, onClick: o, type: s = "button", ...c } = e;
|
|
820
|
-
return /* @__PURE__ */ M("button", {
|
|
821
|
-
...c,
|
|
822
|
-
type: s,
|
|
823
|
-
ref: n,
|
|
824
|
-
onClick: (e) => {
|
|
825
|
-
c.disabled || (a?.(), o?.(e));
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
}), X = T(function({ children: e, className: t, fullWidth: n = !1, hue: r, pending: i = !1, sound: a = !1, static: o = !1, variant: s = "secondary", size: c = "md", style: l, ...u }, d) {
|
|
829
|
-
let f = A(null), p = xt(d, f), m = u["data-game-ui-control"] === "liquid-presence", h = s === "primary" && !u.disabled && !m, g = [
|
|
830
|
-
"game-ui-button",
|
|
831
|
-
`game-ui-button--${s}`,
|
|
832
|
-
n && "game-ui-button--full-width",
|
|
833
|
-
o && "game-ui-button--static",
|
|
834
|
-
t
|
|
835
|
-
].filter(Boolean).join(" ");
|
|
836
|
-
return /* @__PURE__ */ M(mt, {
|
|
837
|
-
control: f,
|
|
838
|
-
controlIdentity: u.href === void 0 ? "button" : u.linkComponent ?? "a",
|
|
839
|
-
enabled: h,
|
|
840
|
-
static: o,
|
|
841
|
-
fullWidth: n,
|
|
842
|
-
pending: i,
|
|
843
|
-
children: /* @__PURE__ */ Be(St, {
|
|
844
|
-
...u,
|
|
845
|
-
key: "control",
|
|
846
|
-
ref: p,
|
|
847
|
-
className: g,
|
|
848
|
-
"aria-busy": i ? !0 : u["aria-busy"],
|
|
849
|
-
onActivate: () => {
|
|
850
|
-
a && ut(a);
|
|
851
|
-
},
|
|
852
|
-
"data-game-ui-size": c,
|
|
853
|
-
"data-game-ui-pending": i ? "true" : void 0,
|
|
854
|
-
"data-game-ui-paint": "",
|
|
855
|
-
"data-game-ui-cta": h ? "true" : void 0,
|
|
856
|
-
"data-game-ui-meaning": s === "danger" || s === "success" ? "true" : void 0,
|
|
857
|
-
"data-game-ui-danger": s === "danger" ? "true" : void 0,
|
|
858
|
-
style: {
|
|
859
|
-
...Y(r ?? (s === "success" ? "leaf" : "sky")),
|
|
860
|
-
...l
|
|
861
|
-
}
|
|
862
|
-
}, !h && !m ? /* @__PURE__ */ M(q, { static: o }) : null, e, u["aria-pressed"] === void 0 ? null : /* @__PURE__ */ M(J, {}))
|
|
863
|
-
});
|
|
864
|
-
});
|
|
865
|
-
//#endregion
|
|
866
|
-
//#region src/controls/GameCheckbox/GameCheckbox.tsx
|
|
867
|
-
function Ct({ className: e, label: t, hue: n, ...r }) {
|
|
868
|
-
return /* @__PURE__ */ N("label", {
|
|
869
|
-
className: ["game-ui-checkbox", e].filter(Boolean).join(" "),
|
|
870
|
-
"data-game-ui-paint": "",
|
|
871
|
-
style: Y(n),
|
|
872
|
-
children: [
|
|
873
|
-
/* @__PURE__ */ M(q, {}),
|
|
874
|
-
/* @__PURE__ */ M("input", {
|
|
875
|
-
className: "game-ui-checkbox-input",
|
|
876
|
-
type: "checkbox",
|
|
877
|
-
...r
|
|
878
|
-
}),
|
|
879
|
-
/* @__PURE__ */ M(J, {}),
|
|
880
|
-
/* @__PURE__ */ M("span", {
|
|
881
|
-
className: "game-ui-checkbox-label",
|
|
882
|
-
children: t
|
|
883
|
-
})
|
|
884
|
-
]
|
|
885
|
-
});
|
|
886
|
-
}
|
|
887
|
-
//#endregion
|
|
888
|
-
//#region src/controls/GameField/GameField.tsx
|
|
889
|
-
function wt({ children: e, className: t, error: n, hint: r, label: i, required: a }) {
|
|
890
|
-
return /* @__PURE__ */ N("label", {
|
|
891
|
-
className: ["game-ui-field", t].filter(Boolean).join(" "),
|
|
892
|
-
"data-invalid": n ? "true" : void 0,
|
|
893
|
-
children: [
|
|
894
|
-
/* @__PURE__ */ N("span", {
|
|
895
|
-
className: "game-ui-field-label",
|
|
896
|
-
children: [i, a ? /* @__PURE__ */ N("span", {
|
|
897
|
-
"aria-hidden": "true",
|
|
898
|
-
className: "game-ui-field-required",
|
|
899
|
-
children: [" ", "*"]
|
|
900
|
-
}) : null]
|
|
901
|
-
}),
|
|
902
|
-
e,
|
|
903
|
-
r && !n ? /* @__PURE__ */ M("span", {
|
|
904
|
-
className: "game-ui-field-hint",
|
|
905
|
-
children: r
|
|
906
|
-
}) : null,
|
|
907
|
-
n ? /* @__PURE__ */ M("span", {
|
|
908
|
-
className: "game-ui-field-error",
|
|
909
|
-
role: "alert",
|
|
910
|
-
children: n
|
|
911
|
-
}) : null
|
|
912
|
-
]
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
//#endregion
|
|
916
|
-
//#region src/controls/GameIconButton/GameIconButton.tsx
|
|
917
|
-
var Tt = T(function({ children: e, className: t, label: n, hue: r, size: i = "md", style: a, ...o }, s) {
|
|
918
|
-
return /* @__PURE__ */ N(St, {
|
|
919
|
-
...o,
|
|
920
|
-
ref: s,
|
|
921
|
-
"aria-label": n,
|
|
922
|
-
className: ["game-ui-icon-button", t].filter(Boolean).join(" "),
|
|
923
|
-
"data-game-ui-paint": "",
|
|
924
|
-
"data-game-ui-size": i,
|
|
925
|
-
style: {
|
|
926
|
-
...Y(r),
|
|
927
|
-
...a
|
|
928
|
-
},
|
|
929
|
-
children: [
|
|
930
|
-
/* @__PURE__ */ M(q, {}),
|
|
931
|
-
e,
|
|
932
|
-
o["aria-pressed"] === void 0 ? null : /* @__PURE__ */ M(J, {})
|
|
933
|
-
]
|
|
934
|
-
});
|
|
935
|
-
}), Et = T(function({ className: e, invalid: t, hue: n, type: r = "text", ...i }, a) {
|
|
936
|
-
return /* @__PURE__ */ M("input", {
|
|
937
|
-
className: ["game-ui-input", e].filter(Boolean).join(" "),
|
|
938
|
-
"data-invalid": t ? "true" : void 0,
|
|
939
|
-
ref: a,
|
|
940
|
-
type: r,
|
|
941
|
-
...i,
|
|
942
|
-
style: {
|
|
943
|
-
...Y(n),
|
|
944
|
-
...i.style
|
|
945
|
-
},
|
|
946
|
-
"aria-invalid": i["aria-invalid"] ?? (t || void 0),
|
|
947
|
-
"data-game-ui-paint": ""
|
|
948
|
-
});
|
|
949
|
-
}), Dt = {
|
|
950
|
-
ai: Me,
|
|
951
|
-
alert: Ee,
|
|
952
|
-
card: me,
|
|
953
|
-
chat: De,
|
|
954
|
-
check: je,
|
|
955
|
-
close: Ne,
|
|
956
|
-
coin: _e,
|
|
957
|
-
compass: ve,
|
|
958
|
-
copy: Oe,
|
|
959
|
-
crown: Te,
|
|
960
|
-
energy: ye,
|
|
961
|
-
gem: Pe,
|
|
962
|
-
gift: Le,
|
|
963
|
-
globe: he,
|
|
964
|
-
history: Ie,
|
|
965
|
-
redo: w,
|
|
966
|
-
undo: te,
|
|
967
|
-
home: ce,
|
|
968
|
-
hourglass: v,
|
|
969
|
-
laurel: Fe,
|
|
970
|
-
lock: le,
|
|
971
|
-
lucky: b,
|
|
972
|
-
mail: y,
|
|
973
|
-
medal: ae,
|
|
974
|
-
mission: Se,
|
|
975
|
-
mobile: re,
|
|
976
|
-
portal: x,
|
|
977
|
-
scroll: ne,
|
|
978
|
-
settings: Re,
|
|
979
|
-
shirt: _,
|
|
980
|
-
shop: de,
|
|
981
|
-
smile: C,
|
|
982
|
-
timer: fe,
|
|
983
|
-
trophy: S,
|
|
984
|
-
vote: ee,
|
|
985
|
-
"arrow-left": Ae,
|
|
986
|
-
"arrow-right": xe,
|
|
987
|
-
"chevron-down": ge,
|
|
988
|
-
"chevron-up": we,
|
|
989
|
-
download: be,
|
|
990
|
-
external: pe,
|
|
991
|
-
menu: Ce,
|
|
992
|
-
minus: g,
|
|
993
|
-
moon: ie,
|
|
994
|
-
plus: oe,
|
|
995
|
-
search: se,
|
|
996
|
-
sun: ue,
|
|
997
|
-
user: ke
|
|
998
|
-
}, Ot = Object.keys(Dt);
|
|
999
|
-
//#endregion
|
|
1000
|
-
//#region src/icons/GameIcon/GameIcon.tsx
|
|
1001
|
-
function Z({ icon: e, size: t = "md", label: n, className: r, ...i }) {
|
|
1002
|
-
let a = typeof e == "string" ? Dt[e] : e, o = {
|
|
1003
|
-
sm: 16,
|
|
1004
|
-
md: 20,
|
|
1005
|
-
lg: 24
|
|
1006
|
-
}[t];
|
|
1007
|
-
return /* @__PURE__ */ M("svg", {
|
|
1008
|
-
...i,
|
|
1009
|
-
className: ["game-ui-icon", r].filter(Boolean).join(" "),
|
|
1010
|
-
viewBox: "0 0 24 24",
|
|
1011
|
-
width: o,
|
|
1012
|
-
height: o,
|
|
1013
|
-
fill: "none",
|
|
1014
|
-
stroke: "currentColor",
|
|
1015
|
-
strokeWidth: 2,
|
|
1016
|
-
strokeLinecap: "round",
|
|
1017
|
-
strokeLinejoin: "round",
|
|
1018
|
-
focusable: "false",
|
|
1019
|
-
role: n ? "img" : void 0,
|
|
1020
|
-
"aria-label": n || void 0,
|
|
1021
|
-
"aria-hidden": !n || void 0,
|
|
1022
|
-
"data-icon": a.name,
|
|
1023
|
-
"data-icon-size": t,
|
|
1024
|
-
children: a.paths.map((e, t) => /* @__PURE__ */ M("path", { d: e }, t))
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
//#endregion
|
|
1028
|
-
//#region src/controls/GameLanguageMenu/GameLanguageMenu.tsx
|
|
1029
|
-
function kt({ className: e, currentLabel: t, label: n, options: r, value: i, defaultValue: a, onSelect: o }) {
|
|
1030
|
-
let [s, c] = j(!1), [l, u] = j(a ?? r[0]?.id ?? ""), d = D(), f = ["game-ui-language-menu", e].filter(Boolean).join(" "), p = i ?? l, m = r.find((e) => e.id === p), h = t ?? m?.label ?? r[0]?.label ?? "", g = (e) => {
|
|
1031
|
-
i === void 0 && u(e), o?.(e), c(!1);
|
|
1032
|
-
};
|
|
1033
|
-
return /* @__PURE__ */ N("div", {
|
|
1034
|
-
className: f,
|
|
1035
|
-
children: [/* @__PURE__ */ N("button", {
|
|
1036
|
-
"aria-controls": d,
|
|
1037
|
-
"aria-expanded": s,
|
|
1038
|
-
className: "game-ui-language-trigger",
|
|
1039
|
-
onClick: () => c((e) => !e),
|
|
1040
|
-
type: "button",
|
|
1041
|
-
"data-game-ui-paint": "",
|
|
1042
|
-
children: [
|
|
1043
|
-
/* @__PURE__ */ M(q, {}),
|
|
1044
|
-
/* @__PURE__ */ M(Z, {
|
|
1045
|
-
icon: "globe",
|
|
1046
|
-
size: "sm"
|
|
1047
|
-
}),
|
|
1048
|
-
/* @__PURE__ */ M("span", { children: h })
|
|
1049
|
-
]
|
|
1050
|
-
}), s ? /* @__PURE__ */ M("div", {
|
|
1051
|
-
"aria-label": n,
|
|
1052
|
-
className: "game-ui-language-popover",
|
|
1053
|
-
id: d,
|
|
1054
|
-
role: "menu",
|
|
1055
|
-
children: r.map((e) => /* @__PURE__ */ N("button", {
|
|
1056
|
-
"aria-checked": e.id === p,
|
|
1057
|
-
"data-selected": e.id === p,
|
|
1058
|
-
onClick: () => g(e.id),
|
|
1059
|
-
role: "menuitemradio",
|
|
1060
|
-
type: "button",
|
|
1061
|
-
"data-game-ui-paint": "",
|
|
1062
|
-
children: [
|
|
1063
|
-
/* @__PURE__ */ M(q, {}),
|
|
1064
|
-
/* @__PURE__ */ N("span", { children: [/* @__PURE__ */ M("strong", { children: e.label }), /* @__PURE__ */ M("small", { children: e.meta })] }),
|
|
1065
|
-
/* @__PURE__ */ M(J, {})
|
|
1066
|
-
]
|
|
1067
|
-
}, e.id))
|
|
1068
|
-
}) : null]
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
//#endregion
|
|
1072
|
-
//#region src/controls/GameSegmentedControl/GameSegmentedControl.tsx
|
|
1073
|
-
function At({ activeId: e, label: t, onSelect: n, options: r, disabled: i, hue: a }) {
|
|
1074
|
-
return /* @__PURE__ */ M("div", {
|
|
1075
|
-
"aria-label": t,
|
|
1076
|
-
className: "game-ui-segmented",
|
|
1077
|
-
role: "group",
|
|
1078
|
-
children: r.map((t) => /* @__PURE__ */ N("button", {
|
|
1079
|
-
type: "button",
|
|
1080
|
-
className: "game-ui-segmented-option",
|
|
1081
|
-
"aria-pressed": t.id === e,
|
|
1082
|
-
disabled: i,
|
|
1083
|
-
onClick: n ? () => n(t.id) : void 0,
|
|
1084
|
-
"data-game-ui-paint": "",
|
|
1085
|
-
style: Y(t.hue ?? a),
|
|
1086
|
-
children: [
|
|
1087
|
-
/* @__PURE__ */ M(q, {}),
|
|
1088
|
-
/* @__PURE__ */ M("span", { children: t.label }),
|
|
1089
|
-
/* @__PURE__ */ M(J, {})
|
|
1090
|
-
]
|
|
1091
|
-
}, t.id))
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
//#endregion
|
|
1095
|
-
//#region src/controls/GameSlider/GameSlider.tsx
|
|
1096
|
-
function jt({ label: e, max: t, min: n, step: r, disabled: i, name: a, id: o, onChange: s, value: c }) {
|
|
1097
|
-
return /* @__PURE__ */ N("label", {
|
|
1098
|
-
className: "game-ui-slider",
|
|
1099
|
-
children: [/* @__PURE__ */ M("span", { children: e }), /* @__PURE__ */ M("input", {
|
|
1100
|
-
"aria-label": e,
|
|
1101
|
-
max: t,
|
|
1102
|
-
min: n,
|
|
1103
|
-
step: r,
|
|
1104
|
-
disabled: i,
|
|
1105
|
-
name: a,
|
|
1106
|
-
id: o,
|
|
1107
|
-
onChange: s ? (e) => s(Number(e.currentTarget.value)) : void 0,
|
|
1108
|
-
readOnly: !s,
|
|
1109
|
-
type: "range",
|
|
1110
|
-
value: c,
|
|
1111
|
-
"data-game-ui-paint": ""
|
|
1112
|
-
})]
|
|
1113
|
-
});
|
|
1114
|
-
}
|
|
1115
|
-
//#endregion
|
|
1116
|
-
//#region src/controls/GameTabs/GameTabs.tsx
|
|
1117
|
-
function Mt({ activeId: e, id: t, onSelect: n, tabs: r, hue: i, orientation: a = "horizontal", "aria-label": o, "aria-labelledby": s }) {
|
|
1118
|
-
let c = D(), l = t ?? c;
|
|
1119
|
-
return /* @__PURE__ */ M("div", {
|
|
1120
|
-
className: "game-ui-tabs",
|
|
1121
|
-
onKeyDown: (t) => {
|
|
1122
|
-
if (!n || r.length === 0) return;
|
|
1123
|
-
let i = Math.max(0, r.findIndex((t) => t.id === e)), o;
|
|
1124
|
-
switch (a === "vertical" ? {
|
|
1125
|
-
ArrowUp: "ArrowLeft",
|
|
1126
|
-
ArrowDown: "ArrowRight",
|
|
1127
|
-
ArrowLeft: "",
|
|
1128
|
-
ArrowRight: ""
|
|
1129
|
-
}[t.key] ?? t.key : t.key) {
|
|
1130
|
-
case "ArrowLeft":
|
|
1131
|
-
o = (i - 1 + r.length) % r.length;
|
|
1132
|
-
break;
|
|
1133
|
-
case "ArrowRight":
|
|
1134
|
-
o = (i + 1) % r.length;
|
|
1135
|
-
break;
|
|
1136
|
-
case "Home":
|
|
1137
|
-
o = 0;
|
|
1138
|
-
break;
|
|
1139
|
-
case "End":
|
|
1140
|
-
o = r.length - 1;
|
|
1141
|
-
break;
|
|
1142
|
-
default: return;
|
|
1143
|
-
}
|
|
1144
|
-
t.preventDefault();
|
|
1145
|
-
let s = r[o];
|
|
1146
|
-
s && (s.id !== e && n(s.id), t.currentTarget.querySelectorAll("[role=\"tab\"]")[o]?.focus());
|
|
1147
|
-
},
|
|
1148
|
-
role: "tablist",
|
|
1149
|
-
"aria-orientation": a === "vertical" ? "vertical" : void 0,
|
|
1150
|
-
"aria-label": o,
|
|
1151
|
-
"aria-labelledby": s,
|
|
1152
|
-
children: r.map((t) => /* @__PURE__ */ N("button", {
|
|
1153
|
-
"aria-controls": t.panelId,
|
|
1154
|
-
"aria-selected": t.id === e,
|
|
1155
|
-
className: "game-ui-tab",
|
|
1156
|
-
style: Y(t.hue ?? i),
|
|
1157
|
-
id: `${l}-${t.id}`,
|
|
1158
|
-
onClick: n ? () => n(t.id) : void 0,
|
|
1159
|
-
role: "tab",
|
|
1160
|
-
tabIndex: t.id === e ? 0 : -1,
|
|
1161
|
-
type: "button",
|
|
1162
|
-
"data-game-ui-paint": "",
|
|
1163
|
-
children: [
|
|
1164
|
-
/* @__PURE__ */ M(q, {}),
|
|
1165
|
-
t.label,
|
|
1166
|
-
/* @__PURE__ */ M(J, {})
|
|
1167
|
-
]
|
|
1168
|
-
}, t.id))
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
//#endregion
|
|
1172
|
-
//#region src/controls/GameTextArea/GameTextArea.tsx
|
|
1173
|
-
var Nt = T(function({ className: e, invalid: t, hue: n, rows: r = 3, ...i }, a) {
|
|
1174
|
-
return /* @__PURE__ */ M("textarea", {
|
|
1175
|
-
className: [
|
|
1176
|
-
"game-ui-input",
|
|
1177
|
-
"game-ui-textarea",
|
|
1178
|
-
e
|
|
1179
|
-
].filter(Boolean).join(" "),
|
|
1180
|
-
"data-invalid": t ? "true" : void 0,
|
|
1181
|
-
ref: a,
|
|
1182
|
-
rows: r,
|
|
1183
|
-
...i,
|
|
1184
|
-
style: {
|
|
1185
|
-
...Y(n),
|
|
1186
|
-
...i.style
|
|
1187
|
-
},
|
|
1188
|
-
"aria-invalid": i["aria-invalid"] ?? (t || void 0),
|
|
1189
|
-
"data-game-ui-paint": ""
|
|
1190
|
-
});
|
|
1191
|
-
});
|
|
1192
|
-
//#endregion
|
|
1193
|
-
//#region src/controls/GameToggle/GameToggle.tsx
|
|
1194
|
-
function Pt({ checked: e, disabled: t, label: n, onClick: r, hue: i }) {
|
|
1195
|
-
return /* @__PURE__ */ N("button", {
|
|
1196
|
-
type: "button",
|
|
1197
|
-
className: "game-ui-toggle",
|
|
1198
|
-
role: "switch",
|
|
1199
|
-
"aria-checked": e,
|
|
1200
|
-
disabled: t,
|
|
1201
|
-
onClick: r,
|
|
1202
|
-
"data-game-ui-paint": "",
|
|
1203
|
-
style: Y(i),
|
|
1204
|
-
children: [
|
|
1205
|
-
/* @__PURE__ */ M(q, {}),
|
|
1206
|
-
/* @__PURE__ */ M("span", { children: n }),
|
|
1207
|
-
/* @__PURE__ */ M(J, {}),
|
|
1208
|
-
/* @__PURE__ */ M("span", {
|
|
1209
|
-
className: "game-ui-toggle-track",
|
|
1210
|
-
"aria-hidden": "true",
|
|
1211
|
-
children: /* @__PURE__ */ M("span", { className: "game-ui-toggle-thumb" })
|
|
1212
|
-
})
|
|
1213
|
-
]
|
|
1214
|
-
});
|
|
1215
|
-
}
|
|
1216
|
-
//#endregion
|
|
1217
|
-
//#region src/feedback/GameBadge/GameBadge.tsx
|
|
1218
|
-
function Q({ children: e, className: t, tone: n = "neutral" }) {
|
|
1219
|
-
return /* @__PURE__ */ N("span", {
|
|
1220
|
-
className: ["game-ui-badge", t].filter(Boolean).join(" "),
|
|
1221
|
-
"data-badge-tone": n,
|
|
1222
|
-
"data-game-ui-paint": "",
|
|
1223
|
-
"data-game-ui-meaning": n !== "neutral" && n !== "danger" ? "true" : void 0,
|
|
1224
|
-
"data-game-ui-danger": n === "danger" ? "true" : void 0,
|
|
1225
|
-
style: Y(n === "success" ? "leaf" : n === "warning" ? "sun" : "sky"),
|
|
1226
|
-
children: [/* @__PURE__ */ M(q, {
|
|
1227
|
-
static: !0,
|
|
1228
|
-
maxWobble: 1
|
|
1229
|
-
}), e]
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
//#endregion
|
|
1233
|
-
//#region src/feedback/GameEmptyState/GameEmptyState.tsx
|
|
1234
|
-
function Ft({ action: e, className: t, description: n, icon: r, title: i }) {
|
|
1235
|
-
return /* @__PURE__ */ N("div", {
|
|
1236
|
-
className: ["game-ui-empty-state", t].filter(Boolean).join(" "),
|
|
1237
|
-
children: [
|
|
1238
|
-
r ? /* @__PURE__ */ M(Z, {
|
|
1239
|
-
icon: r,
|
|
1240
|
-
size: "lg"
|
|
1241
|
-
}) : null,
|
|
1242
|
-
/* @__PURE__ */ M("strong", {
|
|
1243
|
-
className: "game-ui-empty-state-title",
|
|
1244
|
-
children: i
|
|
1245
|
-
}),
|
|
1246
|
-
n ? /* @__PURE__ */ M("p", {
|
|
1247
|
-
className: "game-ui-empty-state-body",
|
|
1248
|
-
children: n
|
|
1249
|
-
}) : null,
|
|
1250
|
-
e ? /* @__PURE__ */ M("div", {
|
|
1251
|
-
className: "game-ui-empty-state-action",
|
|
1252
|
-
children: e
|
|
1253
|
-
}) : null
|
|
1254
|
-
]
|
|
1255
|
-
});
|
|
1256
|
-
}
|
|
1257
|
-
//#endregion
|
|
1258
|
-
//#region src/feedback/GameLoadingState/GameLoadingState.tsx
|
|
1259
|
-
function It({ label: e, tone: t = "loading" }) {
|
|
1260
|
-
return /* @__PURE__ */ N("div", {
|
|
1261
|
-
className: "game-ui-loading-state",
|
|
1262
|
-
"data-loading-tone": t,
|
|
1263
|
-
role: t === "error" ? "alert" : "status",
|
|
1264
|
-
children: [/* @__PURE__ */ M(Z, {
|
|
1265
|
-
icon: t === "error" ? "alert" : "timer",
|
|
1266
|
-
size: "lg"
|
|
1267
|
-
}), /* @__PURE__ */ M("span", { children: e })]
|
|
1268
|
-
});
|
|
1269
|
-
}
|
|
1270
|
-
//#endregion
|
|
1271
|
-
//#region src/feedback/GameProgress/geometry.ts
|
|
1272
|
-
function $(e, t, n = 0, r = 4) {
|
|
1273
|
-
let i = Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 0, a = Number.isFinite(e) ? Math.max(1, e) : 1, o = r, s = o + 10;
|
|
1274
|
-
if (i === 0) return "M0 0Z";
|
|
1275
|
-
if (i === 1) return `M0 0H${a + 2 * o}V${s + o}H0Z`;
|
|
1276
|
-
let c = o + i * a, l = Math.min(1.2, i * a * .3), u = Math.min(1.4, Math.max(-1.4, Number.isFinite(n) ? n : 0)), d = (e) => Math.round(e * 1e3) / 1e3;
|
|
1277
|
-
return `M0 0H${d(c)}V${o}C${d(c - l + u)} ${o + 2} ${d(c - l - u)} ${s - 2} ${d(c)} ${s}V${s + o}H0Z`;
|
|
1278
|
-
}
|
|
1279
|
-
//#endregion
|
|
1280
|
-
//#region src/feedback/GameProgress/controller.ts
|
|
1281
|
-
function Lt(e, t, n, r) {
|
|
1282
|
-
let i = e.parentElement, a = e.querySelector("[data-progress-track]"), o = e.querySelector("[data-progress-clip]"), s = e.querySelector("[data-progress-front]"), c = 0, l = n, u = n, d = n, f, p = 0, m = !1, h = (e, t) => {
|
|
1283
|
-
e.getAttribute("d") !== t && e.setAttribute("d", t);
|
|
1284
|
-
}, g = (e = 0) => h(s, $(c || 100, l, e)), _ = () => {
|
|
1285
|
-
f !== void 0 && cancelAnimationFrame(f), f = void 0;
|
|
1286
|
-
}, v = () => {
|
|
1287
|
-
_(), l = u, g(), e.dataset.progressMotion = "static";
|
|
1288
|
-
}, y = () => {
|
|
1289
|
-
let n = Number.parseFloat(getComputedStyle(i).width) || i.clientWidth;
|
|
1290
|
-
if (!n || n === c) return;
|
|
1291
|
-
c = n, e.setAttribute("viewBox", `0 0 ${c + 8} 18`);
|
|
1292
|
-
let r = U(H(c, 10, 5), 1, 0, t, 4);
|
|
1293
|
-
h(a, r), h(o, r), e.dataset.progressReady = "true", g(), f === void 0 && (e.dataset.progressMotion = "static");
|
|
1294
|
-
}, b = (t) => {
|
|
1295
|
-
if (f = void 0, m) return;
|
|
1296
|
-
if (document.hidden || !e.isConnected) {
|
|
1297
|
-
v();
|
|
1298
|
-
return;
|
|
1299
|
-
}
|
|
1300
|
-
let n = Math.min(1, Math.max(0, (t - p) / 600));
|
|
1301
|
-
l = d + (u - d) * (1 - (1 - n) ** 3), g(Math.sin(n * Math.PI * 6) * (1 - n) * 1.4 * Math.sign(u - d)), n < 1 ? f = requestAnimationFrame(b) : v();
|
|
1302
|
-
}, x = () => {
|
|
1303
|
-
document.hidden && v();
|
|
1304
|
-
};
|
|
1305
|
-
y();
|
|
1306
|
-
let S = new ResizeObserver(y);
|
|
1307
|
-
return S.observe(i), document.addEventListener("visibilitychange", x), {
|
|
1308
|
-
update(t) {
|
|
1309
|
-
let n = Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 0;
|
|
1310
|
-
if (n !== u) {
|
|
1311
|
-
if (_(), d = l, u = n, !r || document.hidden) {
|
|
1312
|
-
v();
|
|
1313
|
-
return;
|
|
1314
|
-
}
|
|
1315
|
-
e.dataset.progressMotion = "moving", p = performance.now(), f = requestAnimationFrame(b);
|
|
1316
|
-
}
|
|
1317
|
-
},
|
|
1318
|
-
dispose() {
|
|
1319
|
-
m = !0, _(), S.disconnect(), document.removeEventListener("visibilitychange", x);
|
|
1320
|
-
}
|
|
1321
|
-
};
|
|
1322
|
-
}
|
|
1323
|
-
//#endregion
|
|
1324
|
-
//#region src/feedback/GameProgress/GameProgress.tsx
|
|
1325
|
-
function Rt({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i, className: a }) {
|
|
1326
|
-
let o = !Number.isFinite(t) || t <= 0 ? 100 : t, s = Math.max(0, Math.min(o, Number.isFinite(e) ? e : 0)), c = s / o, l = c * 100, u = `progress-${D().replace(/[^a-zA-Z0-9_-]/g, "")}`, d = h(), f = A(null), p = A(null), m = A(c).current, g = A(c);
|
|
1327
|
-
g.current = c, O(() => {
|
|
1328
|
-
if (!f.current) return;
|
|
1329
|
-
let e = Lt(f.current, V(u), g.current, !d);
|
|
1330
|
-
return p.current = e, () => {
|
|
1331
|
-
e.dispose(), p.current = null;
|
|
1332
|
-
};
|
|
1333
|
-
}, [u, d]), O(() => p.current?.update(c), [c, d]);
|
|
1334
|
-
let _ = U(H(100, 10, 5), 1, 0, V(u), 4);
|
|
1335
|
-
return /* @__PURE__ */ N("div", {
|
|
1336
|
-
className: ["game-ui-progress", a].filter(Boolean).join(" "),
|
|
1337
|
-
children: [/* @__PURE__ */ M("div", {
|
|
1338
|
-
role: "progressbar",
|
|
1339
|
-
"aria-label": n,
|
|
1340
|
-
"aria-valuemin": 0,
|
|
1341
|
-
"aria-valuemax": o,
|
|
1342
|
-
"aria-valuenow": s,
|
|
1343
|
-
"aria-valuetext": i || void 0,
|
|
1344
|
-
className: "game-ui-progress-track",
|
|
1345
|
-
children: /* @__PURE__ */ N("svg", {
|
|
1346
|
-
ref: f,
|
|
1347
|
-
viewBox: "0 0 108 18",
|
|
1348
|
-
preserveAspectRatio: "none",
|
|
1349
|
-
"aria-hidden": "true",
|
|
1350
|
-
focusable: "false",
|
|
1351
|
-
children: [
|
|
1352
|
-
/* @__PURE__ */ N("defs", { children: [/* @__PURE__ */ M("clipPath", {
|
|
1353
|
-
id: `${u}-clip`,
|
|
1354
|
-
children: /* @__PURE__ */ M("path", {
|
|
1355
|
-
"data-progress-clip": "",
|
|
1356
|
-
d: _
|
|
1357
|
-
})
|
|
1358
|
-
}), /* @__PURE__ */ N("linearGradient", {
|
|
1359
|
-
id: `${u}-fill`,
|
|
1360
|
-
children: [/* @__PURE__ */ M("stop", {
|
|
1361
|
-
offset: "0%",
|
|
1362
|
-
style: { stopColor: "var(--game-ui-cta-from)" }
|
|
1363
|
-
}), /* @__PURE__ */ M("stop", {
|
|
1364
|
-
offset: "100%",
|
|
1365
|
-
style: { stopColor: "var(--game-ui-cta-to)" }
|
|
1366
|
-
})]
|
|
1367
|
-
})] }),
|
|
1368
|
-
/* @__PURE__ */ M("path", {
|
|
1369
|
-
"data-progress-track": "",
|
|
1370
|
-
d: _
|
|
1371
|
-
}),
|
|
1372
|
-
/* @__PURE__ */ M("path", {
|
|
1373
|
-
"data-progress-front": "",
|
|
1374
|
-
d: $(100, m),
|
|
1375
|
-
clipPath: `url(#${u}-clip)`,
|
|
1376
|
-
fill: `url(#${u}-fill)`
|
|
1377
|
-
})
|
|
1378
|
-
]
|
|
1379
|
-
})
|
|
1380
|
-
}), i || r ? /* @__PURE__ */ M("span", {
|
|
1381
|
-
className: "game-ui-progress-value",
|
|
1382
|
-
children: i || `${Math.round(l)}%`
|
|
1383
|
-
}) : null]
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
//#endregion
|
|
1387
|
-
//#region src/feedback/GameToast/GameToast.tsx
|
|
1388
|
-
function zt({ children: e, tone: t = "info" }) {
|
|
1389
|
-
return /* @__PURE__ */ N("div", {
|
|
1390
|
-
className: "game-ui-toast",
|
|
1391
|
-
"data-toast-tone": t,
|
|
1392
|
-
"data-game-ui-paint": "",
|
|
1393
|
-
"data-game-ui-meaning": t === "success" ? "true" : void 0,
|
|
1394
|
-
"data-game-ui-danger": t === "danger" ? "true" : void 0,
|
|
1395
|
-
style: Y(t === "success" ? "leaf" : "sky"),
|
|
1396
|
-
role: t === "danger" ? "alert" : "status",
|
|
1397
|
-
children: [/* @__PURE__ */ M(q, { static: !0 }), e]
|
|
1398
|
-
});
|
|
1399
|
-
}
|
|
1400
|
-
//#endregion
|
|
1401
|
-
//#region src/feedback/GameTooltip/GameTooltip.tsx
|
|
1402
|
-
function Bt({ children: e, label: t }) {
|
|
1403
|
-
let n = D();
|
|
1404
|
-
return /* @__PURE__ */ N("span", {
|
|
1405
|
-
className: "game-ui-tooltip",
|
|
1406
|
-
children: [Ve(e) ? ze(e, { "aria-describedby": [e.props["aria-describedby"], n].filter(Boolean).join(" ") }) : e, /* @__PURE__ */ N("span", {
|
|
1407
|
-
id: n,
|
|
1408
|
-
role: "tooltip",
|
|
1409
|
-
"data-game-ui-paint": "",
|
|
1410
|
-
children: [/* @__PURE__ */ M(q, { static: !0 }), t]
|
|
1411
|
-
})]
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
//#endregion
|
|
1415
|
-
//#region src/containers/GameDialog/GameDialog.tsx
|
|
1416
|
-
function Vt({ children: e, className: t, title: n }) {
|
|
1417
|
-
let r = D();
|
|
1418
|
-
return /* @__PURE__ */ N("section", {
|
|
1419
|
-
"aria-labelledby": r,
|
|
1420
|
-
"aria-modal": "true",
|
|
1421
|
-
className: ["game-ui-dialog", t].filter(Boolean).join(" "),
|
|
1422
|
-
role: "dialog",
|
|
1423
|
-
children: [/* @__PURE__ */ M("h2", {
|
|
1424
|
-
id: r,
|
|
1425
|
-
children: n
|
|
1426
|
-
}), /* @__PURE__ */ M("div", {
|
|
1427
|
-
className: "game-ui-dialog-body",
|
|
1428
|
-
children: e
|
|
1429
|
-
})]
|
|
1430
|
-
});
|
|
1431
|
-
}
|
|
1432
|
-
//#endregion
|
|
1433
|
-
//#region src/containers/GameHistoryPanel/GameHistoryPanel.tsx
|
|
1434
|
-
function Ht({ entries: e, label: t }) {
|
|
1435
|
-
return /* @__PURE__ */ M("section", {
|
|
1436
|
-
"aria-label": t,
|
|
1437
|
-
className: "game-ui-history",
|
|
1438
|
-
children: e.map((e) => /* @__PURE__ */ N("article", {
|
|
1439
|
-
className: "game-ui-history-entry",
|
|
1440
|
-
"data-entry-kind": e.kind,
|
|
1441
|
-
children: [/* @__PURE__ */ N("div", {
|
|
1442
|
-
className: "game-ui-history-entry-header",
|
|
1443
|
-
children: [/* @__PURE__ */ M("strong", { children: e.speaker }), /* @__PURE__ */ M("span", { children: e.meta })]
|
|
1444
|
-
}), /* @__PURE__ */ M("p", { children: e.text })]
|
|
1445
|
-
}, e.id))
|
|
1446
|
-
});
|
|
1447
|
-
}
|
|
1448
|
-
//#endregion
|
|
1449
|
-
//#region src/containers/GameHudActions/GameHudActions.tsx
|
|
1450
|
-
function Ut({ children: e, className: t, label: n, ...r }) {
|
|
1451
|
-
return /* @__PURE__ */ M("nav", {
|
|
1452
|
-
"aria-label": n,
|
|
1453
|
-
className: ["game-ui-hud-actions", t].filter(Boolean).join(" "),
|
|
1454
|
-
"data-safe-area": "hud-actions",
|
|
1455
|
-
...r,
|
|
1456
|
-
children: e
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
//#endregion
|
|
1460
|
-
//#region src/containers/GamePanel/GamePanel.tsx
|
|
1461
|
-
function Wt({ children: e, className: t, title: n, tone: r = "default", ...i }) {
|
|
1462
|
-
let a = ["game-ui-panel", t].filter(Boolean).join(" ");
|
|
1463
|
-
return /* @__PURE__ */ N("section", {
|
|
1464
|
-
...i,
|
|
1465
|
-
className: a,
|
|
1466
|
-
"data-panel-tone": r,
|
|
1467
|
-
children: [n ? /* @__PURE__ */ M("h3", { children: n }) : null, e]
|
|
1468
|
-
});
|
|
1469
|
-
}
|
|
1470
|
-
//#endregion
|
|
1471
|
-
//#region src/game/FirstSessionOnboarding/FirstSessionOnboarding.tsx
|
|
1472
|
-
function Gt({ labels: e, onDismiss: t, open: n }) {
|
|
1473
|
-
return n ? /* @__PURE__ */ N("aside", {
|
|
1474
|
-
"aria-labelledby": "swimmer-first-session-onboarding-title",
|
|
1475
|
-
"aria-modal": "true",
|
|
1476
|
-
className: "swimmer-first-session-onboarding",
|
|
1477
|
-
role: "dialog",
|
|
1478
|
-
children: [/* @__PURE__ */ M("div", { className: "swimmer-first-session-onboarding-scrim" }), /* @__PURE__ */ N("div", {
|
|
1479
|
-
className: "swimmer-first-session-onboarding-card",
|
|
1480
|
-
children: [
|
|
1481
|
-
/* @__PURE__ */ M(Z, {
|
|
1482
|
-
icon: "trophy",
|
|
1483
|
-
size: "lg"
|
|
1484
|
-
}),
|
|
1485
|
-
/* @__PURE__ */ M(Q, {
|
|
1486
|
-
tone: "warning",
|
|
1487
|
-
children: e.badge
|
|
1488
|
-
}),
|
|
1489
|
-
/* @__PURE__ */ M("h2", {
|
|
1490
|
-
id: "swimmer-first-session-onboarding-title",
|
|
1491
|
-
children: e.title
|
|
1492
|
-
}),
|
|
1493
|
-
/* @__PURE__ */ M("p", { children: e.body }),
|
|
1494
|
-
/* @__PURE__ */ M("ol", {
|
|
1495
|
-
className: "swimmer-first-session-onboarding-steps",
|
|
1496
|
-
children: e.steps.map((e, t) => /* @__PURE__ */ N("li", { children: [
|
|
1497
|
-
/* @__PURE__ */ M("span", { children: String(t + 1).padStart(2, "0") }),
|
|
1498
|
-
/* @__PURE__ */ M("strong", { children: e.title }),
|
|
1499
|
-
/* @__PURE__ */ M("small", { children: e.body })
|
|
1500
|
-
] }, e.title))
|
|
1501
|
-
}),
|
|
1502
|
-
/* @__PURE__ */ N("div", {
|
|
1503
|
-
className: "swimmer-first-session-onboarding-actions",
|
|
1504
|
-
children: [/* @__PURE__ */ M(X, {
|
|
1505
|
-
onClick: t,
|
|
1506
|
-
variant: "primary",
|
|
1507
|
-
children: e.start
|
|
1508
|
-
}), /* @__PURE__ */ M(X, {
|
|
1509
|
-
onClick: t,
|
|
1510
|
-
variant: "ghost",
|
|
1511
|
-
children: e.skip
|
|
1512
|
-
})]
|
|
1513
|
-
})
|
|
1514
|
-
]
|
|
1515
|
-
})]
|
|
1516
|
-
}) : null;
|
|
1517
|
-
}
|
|
1518
|
-
//#endregion
|
|
1519
|
-
//#region src/game/GameAvatar/GameAvatar.tsx
|
|
1520
|
-
function Kt(e) {
|
|
1521
|
-
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
1522
|
-
return t.length === 0 ? "?" : t.slice(0, 2).map((e) => e[0] ?? "").join("").toUpperCase();
|
|
1523
|
-
}
|
|
1524
|
-
function qt({ className: e, name: t, size: n = "md", src: r, status: i = "none", surface: a = "flat" }) {
|
|
1525
|
-
return /* @__PURE__ */ N("span", {
|
|
1526
|
-
className: ["game-ui-avatar", e].filter(Boolean).join(" "),
|
|
1527
|
-
"data-avatar-size": n,
|
|
1528
|
-
"data-avatar-status": i,
|
|
1529
|
-
"data-game-ui-surface": a === "plaque" ? "plaque" : void 0,
|
|
1530
|
-
children: [r ? /* @__PURE__ */ M("img", {
|
|
1531
|
-
alt: t,
|
|
1532
|
-
src: r
|
|
1533
|
-
}) : /* @__PURE__ */ N(Ue, { children: [/* @__PURE__ */ M("span", {
|
|
1534
|
-
"aria-hidden": "true",
|
|
1535
|
-
className: "game-ui-avatar-initials",
|
|
1536
|
-
children: Kt(t)
|
|
1537
|
-
}), /* @__PURE__ */ M("span", {
|
|
1538
|
-
className: "game-ui-sr-only",
|
|
1539
|
-
children: t
|
|
1540
|
-
})] }), i === "none" ? null : /* @__PURE__ */ M("span", {
|
|
1541
|
-
"aria-hidden": "true",
|
|
1542
|
-
className: "game-ui-avatar-status"
|
|
1543
|
-
})]
|
|
1544
|
-
});
|
|
1545
|
-
}
|
|
1546
|
-
//#endregion
|
|
1547
|
-
//#region src/game/GameRadialMenu/GameRadialMenu.tsx
|
|
1548
|
-
function Jt({ items: e, label: t, onSelect: n }) {
|
|
1549
|
-
return /* @__PURE__ */ M("div", {
|
|
1550
|
-
"aria-label": t,
|
|
1551
|
-
className: "game-ui-radial-menu",
|
|
1552
|
-
role: "group",
|
|
1553
|
-
style: { "--radial-count": e.length },
|
|
1554
|
-
children: e.map((e, t) => /* @__PURE__ */ N("button", {
|
|
1555
|
-
className: "game-ui-radial-item",
|
|
1556
|
-
onClick: n ? () => n(e.id) : void 0,
|
|
1557
|
-
style: { "--radial-index": t },
|
|
1558
|
-
type: "button",
|
|
1559
|
-
"data-game-ui-paint": "",
|
|
1560
|
-
children: [/* @__PURE__ */ M(q, {}), e.label]
|
|
1561
|
-
}, e.id))
|
|
1562
|
-
});
|
|
1563
|
-
}
|
|
1564
|
-
//#endregion
|
|
1565
|
-
//#region src/game/GameStageTile/GameStageTile.tsx
|
|
1566
|
-
function Yt({ badge: e, className: t, icon: n, kicker: r, selected: i = !1, summary: a, title: o, tone: s = "daily", type: c = "button", ...l }) {
|
|
1567
|
-
return /* @__PURE__ */ N("button", {
|
|
1568
|
-
"aria-pressed": i,
|
|
1569
|
-
className: ["game-ui-stage-tile", t].filter(Boolean).join(" "),
|
|
1570
|
-
"data-stage-tone": s,
|
|
1571
|
-
type: c,
|
|
1572
|
-
...l,
|
|
1573
|
-
"data-game-ui-paint": "",
|
|
1574
|
-
children: [
|
|
1575
|
-
/* @__PURE__ */ M(q, {}),
|
|
1576
|
-
n ? /* @__PURE__ */ M(Z, {
|
|
1577
|
-
icon: n,
|
|
1578
|
-
size: "lg"
|
|
1579
|
-
}) : null,
|
|
1580
|
-
/* @__PURE__ */ N("span", {
|
|
1581
|
-
className: "game-ui-stage-tile-copy",
|
|
1582
|
-
children: [
|
|
1583
|
-
/* @__PURE__ */ M("small", { children: r }),
|
|
1584
|
-
/* @__PURE__ */ M("strong", { children: o }),
|
|
1585
|
-
/* @__PURE__ */ M("span", { children: a })
|
|
1586
|
-
]
|
|
1587
|
-
}),
|
|
1588
|
-
e ? /* @__PURE__ */ M(Q, {
|
|
1589
|
-
tone: i ? "success" : "neutral",
|
|
1590
|
-
children: e
|
|
1591
|
-
}) : null,
|
|
1592
|
-
/* @__PURE__ */ M(J, {})
|
|
1593
|
-
]
|
|
1594
|
-
});
|
|
1595
|
-
}
|
|
1596
|
-
//#endregion
|
|
1597
|
-
export { J as A, Ke as B, Et as C, X as D, Ct as E, P as F, We as H, Je as I, F as L, ut as M, lt as N, Y as O, it as P, Ye as R, Ot as S, wt as T, qe as V, Mt as _, Wt as a, kt as b, Vt as c, Rt as d, It as f, Nt as g, Pt as h, Gt as i, ft as j, q as k, Bt as l, Q as m, Jt as n, Ut as o, Ft as p, qt as r, Ht as s, Yt as t, zt as u, jt as v, Tt as w, Z as x, At as y, Ge as z };
|