@adiakys/feeling-lucky 0.1.0 → 0.3.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.
Files changed (50) hide show
  1. package/README.md +73 -5
  2. package/dist/config/types.d.ts +11 -0
  3. package/dist/{de-Cp-ILcpM.js → de-CmzpGbNK.js} +19 -3
  4. package/dist/developer/panel.d.ts +2 -0
  5. package/dist/developer/settings.d.ts +2 -0
  6. package/dist/engine/dealer.d.ts +21 -0
  7. package/dist/{es-DHZIstf4.js → es-k_kS6Fn2.js} +19 -3
  8. package/dist/feeling-lucky.iife.js +417 -249
  9. package/dist/feeling-lucky.js +17 -39
  10. package/dist/{fr-BPFoerSF.js → fr-GuCZB1l4.js} +19 -3
  11. package/dist/games/blackjack/blackjack.d.ts +1 -0
  12. package/dist/games/cards/dealer.d.ts +9 -0
  13. package/dist/games/cards/table.d.ts +7 -1
  14. package/dist/games/holdem/holdem.d.ts +2 -0
  15. package/dist/{i18n-CihzHMU5.js → i18n-Cid8bj2R.js} +23 -7
  16. package/dist/icons-DTaPp44c.js +863 -0
  17. package/dist/{it-B95CFDto.js → it-BNztlqHd.js} +19 -3
  18. package/dist/locales/de/cards.d.ts +7 -0
  19. package/dist/locales/de/developer.d.ts +7 -0
  20. package/dist/locales/de/room.d.ts +2 -0
  21. package/dist/locales/en/cards.d.ts +7 -0
  22. package/dist/locales/en/developer.d.ts +7 -0
  23. package/dist/locales/en/room.d.ts +2 -0
  24. package/dist/locales/es/cards.d.ts +7 -0
  25. package/dist/locales/es/developer.d.ts +7 -0
  26. package/dist/locales/es/room.d.ts +2 -0
  27. package/dist/locales/fr/cards.d.ts +7 -0
  28. package/dist/locales/fr/developer.d.ts +7 -0
  29. package/dist/locales/fr/room.d.ts +2 -0
  30. package/dist/locales/it/cards.d.ts +7 -0
  31. package/dist/locales/it/developer.d.ts +7 -0
  32. package/dist/locales/it/room.d.ts +2 -0
  33. package/dist/mount-CMm0qSYk.js +6257 -0
  34. package/dist/multiplayer/blackjack.d.ts +35 -0
  35. package/dist/multiplayer/client.d.ts +55 -0
  36. package/dist/multiplayer/holdem.d.ts +21 -0
  37. package/dist/multiplayer/index.d.ts +2 -0
  38. package/dist/multiplayer/seats.d.ts +16 -0
  39. package/dist/multiplayer/shared.d.ts +33 -0
  40. package/dist/multiplayer-CN0t0j_F.js +502 -0
  41. package/dist/{panel-D1hKmQL7.js → panel-BVgq3Cm5.js} +167 -139
  42. package/dist/resolve-Dc48n2Jo.js +28 -0
  43. package/dist/room/boost.d.ts +1 -1
  44. package/dist/room/lobby.d.ts +1 -0
  45. package/dist/room/room.d.ts +11 -1
  46. package/dist/room/stage.d.ts +2 -1
  47. package/dist/runtime/context.d.ts +3 -1
  48. package/dist/runtime/sound.d.ts +1 -1
  49. package/package.json +2 -2
  50. package/dist/mount-BxDaFww2.js +0 -7034
@@ -1,28 +1,29 @@
1
- import { A as e, B as t, C as n, D as r, E as i, F as a, I as o, L as s, M as c, N as l, O as u, P as d, R as f, S as p, T as m, _ as h, a as ee, b as te, c as ne, d as g, f as _, g as v, h as y, i as b, j as x, k as S, l as C, m as re, n as ie, o as w, p as ae, r as oe, s as T, u as se, v as E, w as ce, x as D, y as O, z as k } from "./mount-BxDaFww2.js";
1
+ import { $ as e, A as t, B as n, D as r, G as i, J as a, K as o, P as s, Q as c, T as l, W as u, X as d, Y as f, Z as p, c as ee, k as te, l as m, n as h, q as g, r as _, t as v, tt as y, u as b, w as ne, z as x } from "./icons-DTaPp44c.js";
2
+ import { C as re, D as S, F as C, I as w, L as T, P as E, R as ie, S as D, _ as ae, b as oe, g as se, v as O, x as k, y as A } from "./mount-CMm0qSYk.js";
2
3
  // node_modules/lit-html/directives/live.js
3
- var A = x(class extends c {
4
- constructor(t) {
5
- if (super(t), t.type !== l.PROPERTY && t.type !== l.ATTRIBUTE && t.type !== l.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
6
- if (!e(t)) throw Error("`live` bindings can only contain a single expression");
4
+ var j = i(class extends o {
5
+ constructor(e) {
6
+ if (super(e), e.type !== g.PROPERTY && e.type !== g.ATTRIBUTE && e.type !== g.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
7
+ if (!ie(e)) throw Error("`live` bindings can only contain a single expression");
7
8
  }
8
9
  render(e) {
9
10
  return e;
10
11
  }
11
- update(e, [t]) {
12
- if (t === k || t === f) return t;
13
- let n = e.element, r = e.name;
14
- if (e.type === l.PROPERTY) {
15
- if (t === n[r]) return k;
16
- } else if (e.type === l.BOOLEAN_ATTRIBUTE) {
17
- if (!!t === n.hasAttribute(r)) return k;
18
- } else if (e.type === l.ATTRIBUTE && n.getAttribute(r) === t + "") return k;
19
- return S(e), t;
12
+ update(t, [n]) {
13
+ if (n === e || n === c) return n;
14
+ let r = t.element, i = t.name;
15
+ if (t.type === g.PROPERTY) {
16
+ if (n === r[i]) return e;
17
+ } else if (t.type === g.BOOLEAN_ATTRIBUTE) {
18
+ if (!!n === r.hasAttribute(i)) return e;
19
+ } else if (t.type === g.ATTRIBUTE && r.getAttribute(i) === n + "") return e;
20
+ return T(t), n;
20
21
  }
21
- }), j = [
22
+ }), M = [
22
23
  ["path", { d: "m18 16 4-4-4-4" }],
23
24
  ["path", { d: "m6 8-4 4 4 4" }],
24
25
  ["path", { d: "m14.5 4-5 16" }]
25
- ], M = [
26
+ ], N = [
26
27
  ["circle", {
27
28
  cx: "9",
28
29
  cy: "12",
@@ -53,19 +54,19 @@ var A = x(class extends c {
53
54
  cy: "19",
54
55
  r: "1"
55
56
  }]
56
- ], N = [["rect", {
57
+ ], P = [["rect", {
57
58
  width: "18",
58
59
  height: "11",
59
60
  x: "3",
60
61
  y: "11",
61
62
  rx: "2",
62
63
  ry: "2"
63
- }], ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1" }]], P = [["path", { d: "M5 12h14" }]], F = [
64
+ }], ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1" }]], F = [["path", { d: "M5 12h14" }]], I = [
64
65
  "automatic",
65
66
  "loss",
66
67
  "win",
67
68
  "jackpot"
68
- ], I = {
69
+ ], L = {
69
70
  wheel: [
70
71
  "segment",
71
72
  "booster",
@@ -77,82 +78,82 @@ var A = x(class extends c {
77
78
  scratch: ["award", "prize"],
78
79
  blackjack: ["prize"],
79
80
  holdem: ["prize"]
80
- }, L = [
81
+ }, R = [
81
82
  "segment",
82
83
  "combination",
83
84
  "number",
84
85
  "pocket",
85
86
  "award"
86
- ], R = {}, z = { prizes: [] }, B = () => ({
87
+ ], z = {}, B = { prizes: [] }, V = () => ({
87
88
  multiplier: void 0,
88
89
  variant: void 0,
89
90
  result: "automatic",
90
91
  advanced: {}
91
- }), V = {
92
- slot: ae,
93
- scratch: re
94
- }, H = (e) => R[e] ?? B();
95
- function U(e) {
92
+ }), H = {
93
+ slot: ee,
94
+ scratch: m
95
+ }, U = (e) => z[e] ?? V();
96
+ function W(e) {
96
97
  let t = e.indexOf(":");
97
98
  return {
98
99
  tier: e.slice(0, t),
99
100
  award: e.slice(t + 1) || null
100
101
  };
101
102
  }
102
- var W = {
103
+ var G = {
103
104
  none: "none",
104
105
  pair: "small",
105
106
  logos: "big",
106
107
  sevens: "big",
107
108
  infinities: "jackpot"
108
109
  };
109
- async function le(e, t) {
110
+ async function ce(e, t) {
110
111
  let n = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
111
112
  return [...new Uint8Array(n)].map((e) => e.toString(16).padStart(2, "0")).join("") === t.toLowerCase();
112
113
  }
113
114
  // src/developer/rig.ts
114
- var G = {
115
+ var K = {
115
116
  automatic: void 0,
116
117
  loss: "none",
117
118
  win: "small",
118
119
  jackpot: "jackpot"
119
- }, ue = g.indexOf("jackpot");
120
- function de(e, t) {
121
- let { result: n, advanced: r } = H(e);
120
+ }, le = D.indexOf("jackpot");
121
+ function ue(e, t) {
122
+ let { result: n, advanced: r } = U(e);
122
123
  if (e === "wheel" && r.segment) {
123
124
  let e = r.segment.split(":")[0];
124
125
  return e === "coin" || e === "hunt" || e === "pachinko" ? t() === "big" ? "big" : "small" : e;
125
126
  }
126
- return e === "slot" && r.combination ? W[r.combination] : e === "pachinko" && r.pocket ? g[Number(r.pocket) - 1] : e === "scratch" && r.award ? U(r.award).tier : G[n] ?? t();
127
+ return e === "slot" && r.combination ? G[r.combination] : e === "pachinko" && r.pocket ? D[Number(r.pocket) - 1] : e === "scratch" && r.award ? W(r.award).tier : K[n] ?? t();
127
128
  }
128
- var K = () => H("pachinko").result === "jackpot" && !H("pachinko").advanced.pocket;
129
- function q(e, t) {
129
+ var q = () => U("pachinko").result === "jackpot" && !U("pachinko").advanced.pocket;
130
+ function J(e, t) {
130
131
  let r = Math.min(...e.map((e) => e.x)) + 16, i = Math.max(...e.map((e) => e.x)) - 16, a = (r + i) / 2;
131
132
  return [...new Set(e.map((e) => e.y))].sort((e, t) => e - t).slice(1, 1 + t).flatMap((t) => {
132
133
  let o = Math.max(r, Math.min(i, a + n(-25, 25))), s = e.filter((e) => e.y === t).sort((e, t) => Math.abs(e.x - o) - Math.abs(t.x - o))[0];
133
134
  return s ? (a = s.x, [s]) : [];
134
135
  });
135
136
  }
136
- var J = {
137
- boost: ({ game: e }, t) => H(e).multiplier ?? t(),
138
- tier: ({ game: e }, t) => de(e, t),
137
+ var de = {
138
+ boost: ({ game: e }, t) => U(e).multiplier ?? t(),
139
+ tier: ({ game: e }, t) => ue(e, t),
139
140
  prize: ({ game: e, prizeIds: t }, n) => {
140
- let { prize: r, award: i } = H(e).advanced;
141
+ let { prize: r, award: i } = U(e).advanced;
141
142
  if (r && t.includes(r)) return r;
142
143
  if (e !== "scratch" || !i) return n();
143
- let { tier: a, award: o } = U(i), s = D(z.prizes.filter(({ id: e }) => t.includes(e)), a, o);
144
- return s.length ? p(s).id : n();
144
+ let { tier: a, award: o } = W(i), c = s(B.prizes.filter(({ id: e }) => t.includes(e)), a, o);
145
+ return c.length ? x(c).id : n();
145
146
  },
146
147
  "wheel.segment": ({ segments: e }, t) => {
147
- let n = H("wheel").advanced.segment, r = n ? e.flatMap((e, t) => ne(e) === n ? [t] : []) : [];
148
- return r.length ? p(r) : t();
148
+ let n = U("wheel").advanced.segment, r = n ? e.flatMap((e, t) => A(e) === n ? [t] : []) : [];
149
+ return r.length ? x(r) : t();
149
150
  },
150
151
  "wheel.booster": ({ segments: e }, t) => {
151
- let n = H("wheel").advanced.booster;
152
- return n && T(e).includes(n) ? n : t();
152
+ let n = U("wheel").advanced.booster;
153
+ return n && O(e).includes(n) ? n : t();
153
154
  },
154
155
  "slot.line": ({ prizeId: e }, t) => {
155
- let { combination: n } = H("slot").advanced, r = n === "logos" ? e : n === "sevens" ? "seven" : void 0;
156
+ let { combination: n } = U("slot").advanced, r = n === "logos" ? e : n === "sevens" ? "seven" : void 0;
156
157
  return r ? [
157
158
  r,
158
159
  r,
@@ -160,56 +161,58 @@ var J = {
160
161
  ] : t();
161
162
  },
162
163
  "roulette.number": ({ bets: e, storm: t, boost: n }, r) => {
163
- let { result: i, advanced: a } = H("roulette");
164
+ let { result: i, advanced: a } = U("roulette");
164
165
  if (a.number) return Number(a.number);
165
- let o = G[i];
166
+ let o = K[i];
166
167
  if (!o && !a.storm) return r();
167
- let s = ie.filter((n) => {
168
- let r = oe(e, n)?.tier ?? "none";
168
+ let s = se.filter((n) => {
169
+ let r = ae(e, n)?.tier ?? "none";
169
170
  return (!o || (o === "small" ? r !== "none" : r === o)) && (!a.storm || t.includes(n) === (a.storm === "hit"));
170
171
  });
171
- return s.length ? p(s.flatMap((e) => Array(t.includes(e) ? n : 1).fill(e))) : r();
172
+ return s.length ? x(s.flatMap((e) => Array(t.includes(e) ? n : 1).fill(e))) : r();
172
173
  },
173
174
  "pachinko.board": ({ pegs: e }, t) => {
174
175
  let n = t();
175
- if (!K()) return n;
176
- let [r, i] = _, a = (e) => e.y >= r && e.y <= i;
177
- if (H("pachinko").advanced.violet === "hit") {
178
- let t = q(e, 9), n = p(t.filter(a));
176
+ if (!q()) return n;
177
+ let [r, i] = re, a = (e) => e.y >= r && e.y <= i;
178
+ if (U("pachinko").advanced.violet === "hit") {
179
+ let t = J(e, 9), n = x(t.filter(a));
179
180
  return {
180
181
  violet: n,
181
182
  reds: t.filter((e) => e !== n)
182
183
  };
183
184
  }
184
- let o = q(e, 8), s = e.filter((e) => !o.includes(e) && a(e));
185
+ let o = J(e, 8), s = e.filter((e) => !o.includes(e) && a(e));
185
186
  return {
186
- violet: s.includes(n.violet) ? n.violet : p(s),
187
+ violet: s.includes(n.violet) ? n.violet : x(s),
187
188
  reds: o
188
189
  };
189
190
  },
190
191
  "pachinko.route": ({ violet: e, reds: t }, n) => {
191
- let { violet: r } = H("pachinko").advanced;
192
- return !K() && !r ? n() : {
193
- through: [...K() ? t : [], ...r === "hit" ? [e] : []].sort((e, t) => e.y - t.y),
192
+ let { violet: r } = U("pachinko").advanced;
193
+ return !q() && !r ? n() : {
194
+ through: [...q() ? t : [], ...r === "hit" ? [e] : []].sort((e, t) => e.y - t.y),
194
195
  avoid: r === "miss" ? [e] : []
195
196
  };
196
197
  },
197
198
  "pachinko.wins": (e, t) => {
198
- let n = G[H("pachinko").result];
199
+ let n = K[U("pachinko").result];
199
200
  return n ? n !== "none" : t();
200
201
  },
201
202
  "pachinko.pocket": (e, t) => {
202
- let { pocket: n } = H("pachinko").advanced;
203
- return n ? Number(n) - 1 : K() ? ue : t();
203
+ let { pocket: n } = U("pachinko").advanced;
204
+ return n ? Number(n) - 1 : q() ? le : t();
204
205
  },
205
- "scratch.ticket": (e, t) => H("scratch").variant ?? t(),
206
- locale: (e, t) => z.locale ?? t(),
207
- theme: (e, t) => z.theme === void 0 ? t() : z.theme === "none" ? null : z.theme,
208
- "slot.machine": (e, t) => H("slot").variant ?? t(),
209
- "breakaway.tackle": (e, t) => G[H("slot").result] && G[H("slot").result] !== "none" ? null : t(),
206
+ "scratch.ticket": (e, t) => U("scratch").variant ?? t(),
207
+ locale: (e, t) => B.locale ?? t(),
208
+ multiplayer: (e, t) => !B.singlePlayer && t(),
209
+ dealer: ({ count: e }, t) => B.dealer === void 0 ? t() : B.dealer === "none" ? null : B.dealer < e ? B.dealer : t(),
210
+ theme: (e, t) => B.theme === void 0 ? t() : B.theme === "none" ? null : B.theme,
211
+ "slot.machine": (e, t) => U("slot").variant ?? t(),
212
+ "breakaway.tackle": (e, t) => K[U("slot").result] && K[U("slot").result] !== "none" ? null : t(),
210
213
  "scratch.award": (e, t) => {
211
- let { award: n } = H("scratch").advanced;
212
- return n ? U(n).award : t();
214
+ let { award: n } = U("scratch").advanced;
215
+ return n ? W(n).award : t();
213
216
  }
214
217
  }, Y = "feeling-lucky.developer", X = 8, Z = [
215
218
  "small",
@@ -218,12 +221,12 @@ var J = {
218
221
  "hunt",
219
222
  "pachinko",
220
223
  "jackpot"
221
- ], Q = !1, $ = class extends ee {
224
+ ], Q = !1, $ = class extends h {
222
225
  constructor() {
223
226
  super(), this.open = !0, this.unlocked = Q, this.password = "", this.wrong = !1, this.minimized = !1, this.position = {
224
227
  x: innerWidth - 416 - 16,
225
228
  y: 108
226
- }, this.selected = "wheel", this.draft = B(), this.loads = 0, this.advancedOpen = !1, this.drag = null, this.dragged = !1, this.lastFocus = null, this.grab = (e) => {
229
+ }, this.selected = "wheel", this.draft = V(), this.loads = 0, this.advancedOpen = !1, this.drag = null, this.dragged = !1, this.lastFocus = null, this.grab = (e) => {
227
230
  if (e.button !== 0 || !this.minimized && e.target.closest("button")) return;
228
231
  let t = this.box.getBoundingClientRect();
229
232
  this.drag = {
@@ -241,16 +244,16 @@ var J = {
241
244
  }, this.unlock = async (e) => {
242
245
  e.preventDefault();
243
246
  let t = this.password;
244
- this.password = "", this.wrong = !await le(t, this.passwordHash ?? ""), !this.wrong && (this.grant(), this.focusFirst());
247
+ this.password = "", this.wrong = !await ce(t, this.passwordHash ?? ""), !this.wrong && (this.grant(), this.focusFirst());
245
248
  }, this.apply = () => {
246
249
  let e = Object.fromEntries(Object.entries(this.draft.advanced).filter(([, e]) => e !== void 0));
247
- this.draft.multiplier !== void 0 || this.draft.variant !== void 0 || this.draft.result !== "automatic" || Object.keys(e).length ? R[this.selected] = {
250
+ this.draft.multiplier !== void 0 || this.draft.variant !== void 0 || this.draft.result !== "automatic" || Object.keys(e).length ? z[this.selected] = {
248
251
  ...this.draft,
249
252
  advanced: e
250
- } : delete R[this.selected], h(this.selected);
253
+ } : delete z[this.selected], l(this.selected);
251
254
  }, this.reset = () => {
252
- for (let e of y) delete R[e];
253
- this.load(this.selected), h(this.selected);
255
+ for (let e of b) delete z[e];
256
+ this.load(this.selected), l(this.selected);
254
257
  }, this.toggle = () => {
255
258
  this.open = !this.open, this.open ? (this.lastFocus = this.activeElement, this.focusFirst()) : this.lastFocus instanceof HTMLElement && this.lastFocus.isConnected && this.lastFocus.focus();
256
259
  }, this.shortcut = (e) => {
@@ -270,7 +273,7 @@ var J = {
270
273
  value: e,
271
274
  label: this.t(`wheel.segment.${e}`)
272
275
  };
273
- let { tier: t, award: n } = U(e);
276
+ let { tier: t, award: n } = W(e);
274
277
  return {
275
278
  value: e,
276
279
  label: this.awardLabel(t, n)
@@ -288,13 +291,13 @@ var J = {
288
291
  this.load(this.selected);
289
292
  }
290
293
  willUpdate() {
291
- z.prizes = this.room.prizes, !this.unlocked && this.passwordHash === void 0 && this.grant();
294
+ B.prizes = this.room.prizes, !this.unlocked && this.passwordHash === void 0 && this.grant();
292
295
  }
293
296
  get activeElement() {
294
297
  return this.getRootNode().activeElement;
295
298
  }
296
299
  load(e) {
297
- this.draft = structuredClone(H(e)), this.loads++;
300
+ this.draft = structuredClone(U(e)), this.loads++;
298
301
  }
299
302
  save() {
300
303
  try {
@@ -318,13 +321,19 @@ var J = {
318
321
  this.minimized = e, this.save(), this.focusFirst();
319
322
  }
320
323
  grant() {
321
- v(J), this.unlocked = Q = !0;
324
+ ne(de), this.unlocked = Q = !0;
322
325
  }
323
326
  setLanguage(e) {
324
- z.locale = e || void 0, E.value++;
327
+ B.locale = e || void 0, r.value++;
328
+ }
329
+ setDealer(e) {
330
+ B.dealer = e === "" ? void 0 : e === "none" ? "none" : Number(e), r.value++, this.requestUpdate();
331
+ }
332
+ setTables(e) {
333
+ B.singlePlayer = e === "single" || void 0, r.value++, this.requestUpdate();
325
334
  }
326
335
  setTheme(e) {
327
- z.theme = e || void 0, E.value++, this.requestUpdate();
336
+ B.theme = e || void 0, r.value++, this.requestUpdate();
328
337
  }
329
338
  connectedCallback() {
330
339
  super.connectedCallback(), this.lastFocus = this.activeElement, addEventListener("keydown", this.shortcut, !0), addEventListener("resize", this.fit);
@@ -342,16 +351,16 @@ var J = {
342
351
  });
343
352
  }
344
353
  options(e) {
345
- let t = (e, t) => [{
354
+ let n = (e, t) => [{
346
355
  value: "hit",
347
356
  label: this.t(`developer.option.${e}`)
348
357
  }, {
349
358
  value: "miss",
350
359
  label: this.t(`developer.option.${t}`)
351
- }], n = () => T(C(this.room.board)).sort((e, t) => Z.indexOf(e.split(":")[0]) - Z.indexOf(t.split(":")[0]));
360
+ }], r = () => O(oe(this.room.board)).sort((e, t) => Z.indexOf(e.split(":")[0]) - Z.indexOf(t.split(":")[0]));
352
361
  switch (e) {
353
- case "segment": return ["none", ...n()].map(this.segmentOption);
354
- case "booster": return n().map(this.segmentOption);
362
+ case "segment": return ["none", ...r()].map(this.segmentOption);
363
+ case "booster": return r().map(this.segmentOption);
355
364
  case "prize": return this.room.prizes.map((e) => ({
356
365
  value: e.id,
357
366
  label: e.name
@@ -370,15 +379,15 @@ var J = {
370
379
  value: String(t),
371
380
  label: String(t)
372
381
  }));
373
- case "storm": return t("lands", "misses");
374
- case "violet": return t("hit", "miss");
375
- case "pocket": return g.map((e, t) => ({
382
+ case "storm": return n("lands", "misses");
383
+ case "violet": return n("hit", "miss");
384
+ case "pocket": return D.map((e, t) => ({
376
385
  value: String(t + 1),
377
386
  label: this.t("developer.option.pocket", { n: t + 1 })
378
387
  }));
379
- case "award": return O.flatMap((e) => this.room.board[e].map((t) => ({
380
- value: te(e, t),
381
- label: this.awardLabel(e, t)
388
+ case "award": return te.flatMap((e) => this.room.board[e].map((n) => ({
389
+ value: t(e, n),
390
+ label: this.awardLabel(e, n)
382
391
  })));
383
392
  }
384
393
  }
@@ -397,59 +406,78 @@ var J = {
397
406
  }
398
407
  };
399
408
  }
400
- choices(e, n, r) {
401
- return t`<option value="" ?selected=${n === void 0}>${r}</option>
402
- ${e.map((e) => t`<option value=${e.value} ?selected=${e.value === n}>${e.label}</option>`)}`;
409
+ choices(e, t, n) {
410
+ return y`<option value="" ?selected=${t === void 0}>${n}</option>
411
+ ${e.map((e) => y`<option value=${e.value} ?selected=${e.value === t}>${e.label}</option>`)}`;
403
412
  }
404
413
  renderBody() {
405
- if (!this.unlocked) return t`<form class="lk-dev-body" @submit=${this.unlock}>
414
+ if (!this.unlocked) return y`<form class="lk-dev-body" @submit=${this.unlock}>
406
415
  <label class="lk-dev-row">${this.t("developer.password")}
407
416
  <input
408
417
  data-first
409
418
  type="password"
410
419
  autocomplete="off"
411
- .value=${A(this.password)}
420
+ .value=${j(this.password)}
412
421
  aria-invalid=${this.wrong}
413
- aria-describedby=${this.wrong ? "lk-dev-wrong" : f}
422
+ aria-describedby=${this.wrong ? "lk-dev-wrong" : c}
414
423
  @input=${(e) => {
415
424
  this.password = e.target.value, this.wrong = !1;
416
425
  }}
417
426
  />
418
427
  </label>
419
- ${this.wrong ? t`<p id="lk-dev-wrong" class="lk-dev-error" role="alert">${this.t("developer.wrongPassword")}</p>` : f}
428
+ ${this.wrong ? y`<p id="lk-dev-wrong" class="lk-dev-error" role="alert">${this.t("developer.wrongPassword")}</p>` : c}
420
429
  <footer>
421
- <button type="submit" class="is-primary" ?disabled=${!this.password}>${b(N)}${this.t("developer.unlock")}</button>
430
+ <button type="submit" class="is-primary" ?disabled=${!this.password}>${v(P)}${this.t("developer.unlock")}</button>
422
431
  </footer>
423
432
  </form>`;
424
- let { selected: e, draft: n } = this, a = I[e].find((e) => L.includes(e) && n.advanced[e] !== void 0), o = V[e], s = (e) => e.target.value;
425
- return t`<div class="lk-dev-body">
433
+ let { selected: e, draft: t } = this, n = L[e].find((e) => R.includes(e) && t.advanced[e] !== void 0), r = H[e], i = (e) => e.target.value;
434
+ return y`<div class="lk-dev-body">
426
435
  <p class="lk-dev-hint">${this.t("developer.hint")}</p>
427
436
  <label class="lk-dev-row">${this.t("developer.theme")}
428
- <select data-first @change=${(e) => this.setTheme(s(e))}>
437
+ <select data-first @change=${(e) => this.setTheme(i(e))}>
429
438
  ${this.choices([{
430
439
  value: "none",
431
440
  label: this.t("developer.noTheme")
432
- }, ...se.map((e) => ({
441
+ }, ...k.map((e) => ({
433
442
  value: e,
434
443
  label: this.t(`themes.${e}.name`)
435
- }))], z.theme, this.t("developer.calendar"))}
444
+ }))], B.theme, this.t("developer.calendar"))}
436
445
  </select>
437
446
  </label>
438
447
  <label class="lk-dev-row">${this.t("developer.language")}
439
- <select @change=${(e) => this.setLanguage(s(e))}>
448
+ <select @change=${(e) => this.setLanguage(i(e))}>
440
449
  ${this.choices(this.room.locales.map((e) => ({
441
450
  value: e,
442
451
  label: new Intl.DisplayNames([e], { type: "language" }).of(e) ?? e
443
- })), z.locale, this.t("developer.autoLanguage"))}
452
+ })), B.locale, this.t("developer.autoLanguage"))}
444
453
  </select>
445
454
  </label>
455
+ ${this.room.multiplayer ? y`<label class="lk-dev-row">${this.t("developer.tables")}
456
+ <select @change=${(e) => this.setTables(i(e))}>
457
+ ${this.choices([{
458
+ value: "single",
459
+ label: this.t("developer.singlePlayer")
460
+ }], B.singlePlayer ? "single" : void 0, this.t("developer.multiplayer"))}
461
+ </select>
462
+ </label>` : c}
463
+ ${this.room.dealers.length ? y`<label class="lk-dev-row">${this.t("developer.dealer")}
464
+ <select @change=${(e) => this.setDealer(i(e))}>
465
+ ${this.choices([{
466
+ value: "none",
467
+ label: this.t("developer.dealerAbsent")
468
+ }, ...this.room.dealers.map((e, t) => ({
469
+ value: String(t),
470
+ label: e.name ?? this.t("developer.dealerNumber", { n: t + 1 })
471
+ }))], B.dealer === void 0 ? void 0 : String(B.dealer), this.t("developer.dealerShifts"))}
472
+ </select>
473
+ </label>` : c}
446
474
  <label class="lk-dev-row">${this.t("developer.game")}
447
475
  <select @change=${this.selectGame}>
448
- ${y.map((n) => t`<option value=${n} ?selected=${n === e}>${this.t(`games.${n}.name`)}</option>`)}
476
+ ${b.map((t) => y`<option value=${t} ?selected=${t === e}>${this.t(`games.${t}.name`)}</option>`)}
449
477
  </select>
450
478
  </label>
451
- ${u(this.loads, t`<label class="lk-dev-row">${this.t("developer.multiplier")}
452
- <select @change=${(e) => this.change("multiplier", Number(s(e)) || void 0)}>
479
+ ${w(this.loads, y`<label class="lk-dev-row">${this.t("developer.multiplier")}
480
+ <select @change=${(e) => this.change("multiplier", Number(i(e)) || void 0)}>
453
481
  ${this.choices([
454
482
  1,
455
483
  2,
@@ -459,49 +487,49 @@ var J = {
459
487
  ].map((e) => ({
460
488
  value: String(e),
461
489
  label: `×${e}`
462
- })), n.multiplier?.toString(), this.t("developer.daily"))}
490
+ })), t.multiplier?.toString(), this.t("developer.daily"))}
463
491
  </select>
464
492
  </label>
465
- ${o ? t`<label class="lk-dev-row">${this.t(`developer.variant.${e}`)}
466
- <select @change=${(e) => this.change("variant", s(e) || void 0)}>
467
- ${this.choices(o.map((t) => ({
493
+ ${r ? y`<label class="lk-dev-row">${this.t(`developer.variant.${e}`)}
494
+ <select @change=${(e) => this.change("variant", i(e) || void 0)}>
495
+ ${this.choices(r.map((t) => ({
468
496
  value: t,
469
497
  label: this.t(`${e}.names.${t}`)
470
- })), n.variant, this.t("developer.daily"))}
498
+ })), t.variant, this.t("developer.daily"))}
471
499
  </select>
472
- </label>` : f}
500
+ </label>` : c}
473
501
  <label class="lk-dev-row">${this.t("developer.result")}
474
- <select ?disabled=${!!a} @change=${(e) => this.change("result", s(e))}>
475
- ${F.map((e) => t`<option value=${e} ?selected=${e === n.result}>${this.t(`developer.${e}`)}</option>`)}
502
+ <select ?disabled=${!!n} @change=${(e) => this.change("result", i(e))}>
503
+ ${I.map((e) => y`<option value=${e} ?selected=${e === t.result}>${this.t(`developer.${e}`)}</option>`)}
476
504
  </select>
477
505
  </label>
478
- ${a ? t`<p class="lk-dev-note">${this.t("developer.decidedBy", { field: this.t(`developer.field.${a}`) })}</p>` : f}
506
+ ${n ? y`<p class="lk-dev-note">${this.t("developer.decidedBy", { field: this.t(`developer.field.${n}`) })}</p>` : c}
479
507
 
480
508
  <details
481
509
  class="lk-dev-advanced"
482
- ?open=${this.advancedOpen || I[e].some((e) => n.advanced[e] !== void 0)}
510
+ ?open=${this.advancedOpen || L[e].some((e) => t.advanced[e] !== void 0)}
483
511
  @toggle=${(e) => this.advancedOpen = e.target.open}
484
512
  >
485
- <summary>${b(i)}${this.t("developer.advanced")}</summary>
486
- ${I[e].map((e) => t`<label class="lk-dev-row">${this.t(`developer.field.${e}`)}
487
- <select @change=${(t) => this.changeAdvanced(e, s(t))}>
488
- ${this.choices(this.options(e), n.advanced[e], this.t("developer.automatic"))}
513
+ <summary>${v(E)}${this.t("developer.advanced")}</summary>
514
+ ${L[e].map((e) => y`<label class="lk-dev-row">${this.t(`developer.field.${e}`)}
515
+ <select @change=${(t) => this.changeAdvanced(e, i(t))}>
516
+ ${this.choices(this.options(e), t.advanced[e], this.t("developer.automatic"))}
489
517
  </select>
490
518
  </label>`)}
491
519
  <p class="lk-dev-note">${this.t(`developer.about.${e}`)}</p>
492
520
  </details>`)}
493
521
 
494
522
  <footer>
495
- <button type="button" @click=${this.reset}>${b(m)}${this.t("developer.reset")}</button>
496
- <button type="button" class="is-primary" @click=${this.apply}>${b(r)}${this.t("developer.apply")}</button>
523
+ <button type="button" @click=${this.reset}>${v(S)}${this.t("developer.reset")}</button>
524
+ <button type="button" class="is-primary" @click=${this.apply}>${v(C)}${this.t("developer.apply")}</button>
497
525
  </footer>
498
526
  </div>`;
499
527
  }
500
528
  render() {
501
- if (!this.open) return f;
529
+ if (!this.open) return c;
502
530
  let e = this.unlocked && this.minimized;
503
- return t`<div class="lk-dev ${e ? "is-icon" : ""}" style="left: ${this.position.x}px; top: ${this.position.y}px" @keydown=${this.keydown}>
504
- ${e ? t`<button
531
+ return y`<div class="lk-dev ${e ? "is-icon" : ""}" style="left: ${this.position.x}px; top: ${this.position.y}px" @keydown=${this.keydown}>
532
+ ${e ? y`<button
505
533
  type="button"
506
534
  class="lk-dev-icon"
507
535
  aria-label=${this.t("developer.restore")}
@@ -512,19 +540,19 @@ var J = {
512
540
  @pointercancel=${this.release}
513
541
  @click=${this.restore}
514
542
  >
515
- ${b(j)}
516
- </button>` : t`<section class="lk-dev-panel" aria-label=${this.t("developer.title")}>
543
+ ${v(M)}
544
+ </button>` : y`<section class="lk-dev-panel" aria-label=${this.t("developer.title")}>
517
545
  <header @pointerdown=${this.grab} @pointermove=${this.move} @pointerup=${this.release} @pointercancel=${this.release}>
518
- ${b(M, "lk-dev-grip")}
519
- <strong>${b(j)}${this.t("developer.title")}</strong>
520
- ${this.unlocked ? t`<button type="button" aria-label=${this.t("developer.minimize")} title=${this.t("developer.minimize")} @click=${() => this.minimize(!0)}>
521
- ${b(P)}
522
- </button>` : f}
523
- <button type="button" aria-label=${this.t("developer.close")} title=${this.t("developer.close")} @click=${this.toggle}>${b(ce)}</button>
546
+ ${v(N, "lk-dev-grip")}
547
+ <strong>${v(M)}${this.t("developer.title")}</strong>
548
+ ${this.unlocked ? y`<button type="button" aria-label=${this.t("developer.minimize")} title=${this.t("developer.minimize")} @click=${() => this.minimize(!0)}>
549
+ ${v(F)}
550
+ </button>` : c}
551
+ <button type="button" aria-label=${this.t("developer.close")} title=${this.t("developer.close")} @click=${this.toggle}>${v(u)}</button>
524
552
  </header>
525
553
  ${this.renderBody()}
526
554
  </section>`}
527
555
  </div>`;
528
556
  }
529
557
  };
530
- w([o({ attribute: !1 })], $.prototype, "passwordHash", void 0), w([a()], $.prototype, "open", void 0), w([a()], $.prototype, "unlocked", void 0), w([a()], $.prototype, "password", void 0), w([a()], $.prototype, "wrong", void 0), w([a()], $.prototype, "minimized", void 0), w([a()], $.prototype, "position", void 0), w([a()], $.prototype, "selected", void 0), w([a()], $.prototype, "draft", void 0), w([a()], $.prototype, "loads", void 0), w([a()], $.prototype, "advancedOpen", void 0), w([d(".lk-dev")], $.prototype, "box", void 0), w([d(".lk-dev [data-first]")], $.prototype, "first", void 0), w([d(".lk-dev-icon")], $.prototype, "iconButton", void 0), $ = w([s("fl-developer")], $);
558
+ _([d({ attribute: !1 })], $.prototype, "passwordHash", void 0), _([f()], $.prototype, "open", void 0), _([f()], $.prototype, "unlocked", void 0), _([f()], $.prototype, "password", void 0), _([f()], $.prototype, "wrong", void 0), _([f()], $.prototype, "minimized", void 0), _([f()], $.prototype, "position", void 0), _([f()], $.prototype, "selected", void 0), _([f()], $.prototype, "draft", void 0), _([f()], $.prototype, "loads", void 0), _([f()], $.prototype, "advancedOpen", void 0), _([a(".lk-dev")], $.prototype, "box", void 0), _([a(".lk-dev [data-first]")], $.prototype, "first", void 0), _([a(".lk-dev-icon")], $.prototype, "iconButton", void 0), $ = _([p("fl-developer")], $);
@@ -0,0 +1,28 @@
1
+ // src/config/resolve.ts
2
+ var e = async (e) => typeof e == "function" ? e() : e;
3
+ async function t(t) {
4
+ let [n, r, i, a, o, s, c, l] = await Promise.all([
5
+ e(t.prizes),
6
+ t.locale === void 0 ? void 0 : e(t.locale),
7
+ t.messages === void 0 ? {} : e(t.messages),
8
+ t.player === void 0 ? null : e(t.player),
9
+ t.developer !== void 0 && e(t.developer),
10
+ t.logo === void 0 ? void 0 : e(t.logo),
11
+ t.dealers === void 0 ? void 0 : e(t.dealers),
12
+ t.multiplayer === void 0 ? void 0 : e(t.multiplayer)
13
+ ]);
14
+ if (!n.length) throw Error("feeling-lucky: at least one prize is needed");
15
+ return {
16
+ prizes: n,
17
+ locale: r,
18
+ messages: i,
19
+ player: a,
20
+ logo: s,
21
+ dealers: c,
22
+ developer: o === !1 ? null : { passwordHash: o === !0 ? void 0 : o.passwordHash },
23
+ multiplayer: typeof l == "string" ? { url: l } : l,
24
+ onWin: t.onWin,
25
+ onClaim: t.onClaim
26
+ };
27
+ }
28
+ export { t as n, e as t };
@@ -1,2 +1,2 @@
1
1
  import type { Translate } from '../runtime/i18n';
2
- export declare const boost: (t: Translate, multiplier: number) => import("lit-html").TemplateResult<1>;
2
+ export declare const boost: (t: Translate, multiplier: number, dealer?: boolean) => import("lit-html").TemplateResult<1>;
@@ -7,6 +7,7 @@ export declare class Lobby extends LuckyElement {
7
7
  page: number;
8
8
  private takeoffShown;
9
9
  private grid?;
10
+ constructor();
10
11
  private strips;
11
12
  private stripsFor?;
12
13
  private struck;