@adiakys/feeling-lucky 0.2.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.
- package/README.md +53 -1
- package/dist/config/types.d.ts +5 -0
- package/dist/{de-B56NsnDF.js → de-CmzpGbNK.js} +11 -1
- package/dist/developer/panel.d.ts +1 -0
- package/dist/developer/settings.d.ts +1 -0
- package/dist/{es-9iWwCe8s.js → es-k_kS6Fn2.js} +11 -1
- package/dist/feeling-lucky.iife.js +395 -243
- package/dist/feeling-lucky.js +17 -41
- package/dist/{fr-Y2BcCS3U.js → fr-GuCZB1l4.js} +11 -1
- package/dist/games/cards/table.d.ts +3 -1
- package/dist/{i18n-it2FlmVZ.js → i18n-Cid8bj2R.js} +15 -5
- package/dist/icons-DTaPp44c.js +863 -0
- package/dist/{it-CNSOLgaT.js → it-BNztlqHd.js} +11 -1
- package/dist/locales/de/cards.d.ts +7 -0
- package/dist/locales/de/developer.d.ts +3 -0
- package/dist/locales/en/cards.d.ts +7 -0
- package/dist/locales/en/developer.d.ts +3 -0
- package/dist/locales/es/cards.d.ts +7 -0
- package/dist/locales/es/developer.d.ts +3 -0
- package/dist/locales/fr/cards.d.ts +7 -0
- package/dist/locales/fr/developer.d.ts +3 -0
- package/dist/locales/it/cards.d.ts +7 -0
- package/dist/locales/it/developer.d.ts +3 -0
- package/dist/mount-CMm0qSYk.js +6257 -0
- package/dist/multiplayer/blackjack.d.ts +35 -0
- package/dist/multiplayer/client.d.ts +55 -0
- package/dist/multiplayer/holdem.d.ts +21 -0
- package/dist/multiplayer/index.d.ts +2 -0
- package/dist/multiplayer/seats.d.ts +16 -0
- package/dist/multiplayer/shared.d.ts +33 -0
- package/dist/multiplayer-CN0t0j_F.js +502 -0
- package/dist/{panel-tWJMt9kl.js → panel-BVgq3Cm5.js} +158 -145
- package/dist/resolve-Dc48n2Jo.js +28 -0
- package/dist/room/room.d.ts +7 -1
- package/dist/runtime/context.d.ts +2 -1
- package/package.json +2 -2
- package/dist/mount-CBUkAcVV.js +0 -7109
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
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
|
|
4
|
-
constructor(
|
|
5
|
-
if (super(
|
|
6
|
-
if (!e
|
|
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(
|
|
12
|
-
if (
|
|
13
|
-
let
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
} else if (
|
|
17
|
-
if (!!
|
|
18
|
-
} else if (
|
|
19
|
-
return
|
|
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
|
-
}),
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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" }]],
|
|
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
|
-
],
|
|
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
|
-
},
|
|
81
|
+
}, R = [
|
|
81
82
|
"segment",
|
|
82
83
|
"combination",
|
|
83
84
|
"number",
|
|
84
85
|
"pocket",
|
|
85
86
|
"award"
|
|
86
|
-
],
|
|
87
|
+
], z = {}, B = { prizes: [] }, V = () => ({
|
|
87
88
|
multiplier: void 0,
|
|
88
89
|
variant: void 0,
|
|
89
90
|
result: "automatic",
|
|
90
91
|
advanced: {}
|
|
91
|
-
}),
|
|
92
|
-
slot:
|
|
93
|
-
scratch:
|
|
94
|
-
},
|
|
95
|
-
function
|
|
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
|
|
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
|
|
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
|
|
115
|
+
var K = {
|
|
115
116
|
automatic: void 0,
|
|
116
117
|
loss: "none",
|
|
117
118
|
win: "small",
|
|
118
119
|
jackpot: "jackpot"
|
|
119
|
-
},
|
|
120
|
-
function
|
|
121
|
-
let { result: n, advanced: r } =
|
|
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 ?
|
|
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
|
|
129
|
-
function
|
|
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
|
|
137
|
-
boost: ({ game: e }, t) =>
|
|
138
|
-
tier: ({ game: 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 } =
|
|
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 } =
|
|
144
|
-
return
|
|
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 =
|
|
148
|
-
return r.length ?
|
|
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 =
|
|
152
|
-
return n &&
|
|
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 } =
|
|
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,57 +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 } =
|
|
164
|
+
let { result: i, advanced: a } = U("roulette");
|
|
164
165
|
if (a.number) return Number(a.number);
|
|
165
|
-
let o =
|
|
166
|
+
let o = K[i];
|
|
166
167
|
if (!o && !a.storm) return r();
|
|
167
|
-
let s =
|
|
168
|
-
let r =
|
|
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 ?
|
|
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 (!
|
|
176
|
-
let [r, i] =
|
|
177
|
-
if (
|
|
178
|
-
let t =
|
|
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 =
|
|
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 :
|
|
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 } =
|
|
192
|
-
return !
|
|
193
|
-
through: [...
|
|
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 =
|
|
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 } =
|
|
203
|
-
return n ? Number(n) - 1 :
|
|
203
|
+
let { pocket: n } = U("pachinko").advanced;
|
|
204
|
+
return n ? Number(n) - 1 : q() ? le : t();
|
|
204
205
|
},
|
|
205
|
-
"scratch.ticket": (e, t) =>
|
|
206
|
-
locale: (e, t) =>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"
|
|
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(),
|
|
211
213
|
"scratch.award": (e, t) => {
|
|
212
|
-
let { award: n } =
|
|
213
|
-
return n ?
|
|
214
|
+
let { award: n } = U("scratch").advanced;
|
|
215
|
+
return n ? W(n).award : t();
|
|
214
216
|
}
|
|
215
217
|
}, Y = "feeling-lucky.developer", X = 8, Z = [
|
|
216
218
|
"small",
|
|
@@ -219,12 +221,12 @@ var J = {
|
|
|
219
221
|
"hunt",
|
|
220
222
|
"pachinko",
|
|
221
223
|
"jackpot"
|
|
222
|
-
], Q = !1, $ = class extends
|
|
224
|
+
], Q = !1, $ = class extends h {
|
|
223
225
|
constructor() {
|
|
224
226
|
super(), this.open = !0, this.unlocked = Q, this.password = "", this.wrong = !1, this.minimized = !1, this.position = {
|
|
225
227
|
x: innerWidth - 416 - 16,
|
|
226
228
|
y: 108
|
|
227
|
-
}, this.selected = "wheel", this.draft =
|
|
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) => {
|
|
228
230
|
if (e.button !== 0 || !this.minimized && e.target.closest("button")) return;
|
|
229
231
|
let t = this.box.getBoundingClientRect();
|
|
230
232
|
this.drag = {
|
|
@@ -242,16 +244,16 @@ var J = {
|
|
|
242
244
|
}, this.unlock = async (e) => {
|
|
243
245
|
e.preventDefault();
|
|
244
246
|
let t = this.password;
|
|
245
|
-
this.password = "", this.wrong = !await
|
|
247
|
+
this.password = "", this.wrong = !await ce(t, this.passwordHash ?? ""), !this.wrong && (this.grant(), this.focusFirst());
|
|
246
248
|
}, this.apply = () => {
|
|
247
249
|
let e = Object.fromEntries(Object.entries(this.draft.advanced).filter(([, e]) => e !== void 0));
|
|
248
|
-
this.draft.multiplier !== void 0 || this.draft.variant !== void 0 || this.draft.result !== "automatic" || Object.keys(e).length ?
|
|
250
|
+
this.draft.multiplier !== void 0 || this.draft.variant !== void 0 || this.draft.result !== "automatic" || Object.keys(e).length ? z[this.selected] = {
|
|
249
251
|
...this.draft,
|
|
250
252
|
advanced: e
|
|
251
|
-
} : delete
|
|
253
|
+
} : delete z[this.selected], l(this.selected);
|
|
252
254
|
}, this.reset = () => {
|
|
253
|
-
for (let e of
|
|
254
|
-
this.load(this.selected),
|
|
255
|
+
for (let e of b) delete z[e];
|
|
256
|
+
this.load(this.selected), l(this.selected);
|
|
255
257
|
}, this.toggle = () => {
|
|
256
258
|
this.open = !this.open, this.open ? (this.lastFocus = this.activeElement, this.focusFirst()) : this.lastFocus instanceof HTMLElement && this.lastFocus.isConnected && this.lastFocus.focus();
|
|
257
259
|
}, this.shortcut = (e) => {
|
|
@@ -271,7 +273,7 @@ var J = {
|
|
|
271
273
|
value: e,
|
|
272
274
|
label: this.t(`wheel.segment.${e}`)
|
|
273
275
|
};
|
|
274
|
-
let { tier: t, award: n } =
|
|
276
|
+
let { tier: t, award: n } = W(e);
|
|
275
277
|
return {
|
|
276
278
|
value: e,
|
|
277
279
|
label: this.awardLabel(t, n)
|
|
@@ -289,13 +291,13 @@ var J = {
|
|
|
289
291
|
this.load(this.selected);
|
|
290
292
|
}
|
|
291
293
|
willUpdate() {
|
|
292
|
-
|
|
294
|
+
B.prizes = this.room.prizes, !this.unlocked && this.passwordHash === void 0 && this.grant();
|
|
293
295
|
}
|
|
294
296
|
get activeElement() {
|
|
295
297
|
return this.getRootNode().activeElement;
|
|
296
298
|
}
|
|
297
299
|
load(e) {
|
|
298
|
-
this.draft = structuredClone(
|
|
300
|
+
this.draft = structuredClone(U(e)), this.loads++;
|
|
299
301
|
}
|
|
300
302
|
save() {
|
|
301
303
|
try {
|
|
@@ -319,16 +321,19 @@ var J = {
|
|
|
319
321
|
this.minimized = e, this.save(), this.focusFirst();
|
|
320
322
|
}
|
|
321
323
|
grant() {
|
|
322
|
-
|
|
324
|
+
ne(de), this.unlocked = Q = !0;
|
|
323
325
|
}
|
|
324
326
|
setLanguage(e) {
|
|
325
|
-
|
|
327
|
+
B.locale = e || void 0, r.value++;
|
|
326
328
|
}
|
|
327
329
|
setDealer(e) {
|
|
328
|
-
|
|
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();
|
|
329
334
|
}
|
|
330
335
|
setTheme(e) {
|
|
331
|
-
|
|
336
|
+
B.theme = e || void 0, r.value++, this.requestUpdate();
|
|
332
337
|
}
|
|
333
338
|
connectedCallback() {
|
|
334
339
|
super.connectedCallback(), this.lastFocus = this.activeElement, addEventListener("keydown", this.shortcut, !0), addEventListener("resize", this.fit);
|
|
@@ -346,16 +351,16 @@ var J = {
|
|
|
346
351
|
});
|
|
347
352
|
}
|
|
348
353
|
options(e) {
|
|
349
|
-
let
|
|
354
|
+
let n = (e, t) => [{
|
|
350
355
|
value: "hit",
|
|
351
356
|
label: this.t(`developer.option.${e}`)
|
|
352
357
|
}, {
|
|
353
358
|
value: "miss",
|
|
354
359
|
label: this.t(`developer.option.${t}`)
|
|
355
|
-
}],
|
|
360
|
+
}], r = () => O(oe(this.room.board)).sort((e, t) => Z.indexOf(e.split(":")[0]) - Z.indexOf(t.split(":")[0]));
|
|
356
361
|
switch (e) {
|
|
357
|
-
case "segment": return ["none", ...
|
|
358
|
-
case "booster": return
|
|
362
|
+
case "segment": return ["none", ...r()].map(this.segmentOption);
|
|
363
|
+
case "booster": return r().map(this.segmentOption);
|
|
359
364
|
case "prize": return this.room.prizes.map((e) => ({
|
|
360
365
|
value: e.id,
|
|
361
366
|
label: e.name
|
|
@@ -374,15 +379,15 @@ var J = {
|
|
|
374
379
|
value: String(t),
|
|
375
380
|
label: String(t)
|
|
376
381
|
}));
|
|
377
|
-
case "storm": return
|
|
378
|
-
case "violet": return
|
|
379
|
-
case "pocket": return
|
|
382
|
+
case "storm": return n("lands", "misses");
|
|
383
|
+
case "violet": return n("hit", "miss");
|
|
384
|
+
case "pocket": return D.map((e, t) => ({
|
|
380
385
|
value: String(t + 1),
|
|
381
386
|
label: this.t("developer.option.pocket", { n: t + 1 })
|
|
382
387
|
}));
|
|
383
|
-
case "award": return
|
|
384
|
-
value:
|
|
385
|
-
label: this.awardLabel(e,
|
|
388
|
+
case "award": return te.flatMap((e) => this.room.board[e].map((n) => ({
|
|
389
|
+
value: t(e, n),
|
|
390
|
+
label: this.awardLabel(e, n)
|
|
386
391
|
})));
|
|
387
392
|
}
|
|
388
393
|
}
|
|
@@ -401,70 +406,78 @@ var J = {
|
|
|
401
406
|
}
|
|
402
407
|
};
|
|
403
408
|
}
|
|
404
|
-
choices(e,
|
|
405
|
-
return
|
|
406
|
-
${e.map((e) =>
|
|
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>`)}`;
|
|
407
412
|
}
|
|
408
413
|
renderBody() {
|
|
409
|
-
if (!this.unlocked) return
|
|
414
|
+
if (!this.unlocked) return y`<form class="lk-dev-body" @submit=${this.unlock}>
|
|
410
415
|
<label class="lk-dev-row">${this.t("developer.password")}
|
|
411
416
|
<input
|
|
412
417
|
data-first
|
|
413
418
|
type="password"
|
|
414
419
|
autocomplete="off"
|
|
415
|
-
.value=${
|
|
420
|
+
.value=${j(this.password)}
|
|
416
421
|
aria-invalid=${this.wrong}
|
|
417
|
-
aria-describedby=${this.wrong ? "lk-dev-wrong" :
|
|
422
|
+
aria-describedby=${this.wrong ? "lk-dev-wrong" : c}
|
|
418
423
|
@input=${(e) => {
|
|
419
424
|
this.password = e.target.value, this.wrong = !1;
|
|
420
425
|
}}
|
|
421
426
|
/>
|
|
422
427
|
</label>
|
|
423
|
-
${this.wrong ?
|
|
428
|
+
${this.wrong ? y`<p id="lk-dev-wrong" class="lk-dev-error" role="alert">${this.t("developer.wrongPassword")}</p>` : c}
|
|
424
429
|
<footer>
|
|
425
|
-
<button type="submit" class="is-primary" ?disabled=${!this.password}>${
|
|
430
|
+
<button type="submit" class="is-primary" ?disabled=${!this.password}>${v(P)}${this.t("developer.unlock")}</button>
|
|
426
431
|
</footer>
|
|
427
432
|
</form>`;
|
|
428
|
-
let { selected: e, draft:
|
|
429
|
-
return
|
|
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">
|
|
430
435
|
<p class="lk-dev-hint">${this.t("developer.hint")}</p>
|
|
431
436
|
<label class="lk-dev-row">${this.t("developer.theme")}
|
|
432
|
-
<select data-first @change=${(e) => this.setTheme(
|
|
437
|
+
<select data-first @change=${(e) => this.setTheme(i(e))}>
|
|
433
438
|
${this.choices([{
|
|
434
439
|
value: "none",
|
|
435
440
|
label: this.t("developer.noTheme")
|
|
436
|
-
}, ...
|
|
441
|
+
}, ...k.map((e) => ({
|
|
437
442
|
value: e,
|
|
438
443
|
label: this.t(`themes.${e}.name`)
|
|
439
|
-
}))],
|
|
444
|
+
}))], B.theme, this.t("developer.calendar"))}
|
|
440
445
|
</select>
|
|
441
446
|
</label>
|
|
442
447
|
<label class="lk-dev-row">${this.t("developer.language")}
|
|
443
|
-
<select @change=${(e) => this.setLanguage(
|
|
448
|
+
<select @change=${(e) => this.setLanguage(i(e))}>
|
|
444
449
|
${this.choices(this.room.locales.map((e) => ({
|
|
445
450
|
value: e,
|
|
446
451
|
label: new Intl.DisplayNames([e], { type: "language" }).of(e) ?? e
|
|
447
|
-
})),
|
|
452
|
+
})), B.locale, this.t("developer.autoLanguage"))}
|
|
448
453
|
</select>
|
|
449
454
|
</label>
|
|
450
|
-
${this.room.
|
|
451
|
-
<select @change=${(e) => this.
|
|
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))}>
|
|
452
465
|
${this.choices([{
|
|
453
466
|
value: "none",
|
|
454
467
|
label: this.t("developer.dealerAbsent")
|
|
455
468
|
}, ...this.room.dealers.map((e, t) => ({
|
|
456
469
|
value: String(t),
|
|
457
470
|
label: e.name ?? this.t("developer.dealerNumber", { n: t + 1 })
|
|
458
|
-
}))],
|
|
471
|
+
}))], B.dealer === void 0 ? void 0 : String(B.dealer), this.t("developer.dealerShifts"))}
|
|
459
472
|
</select>
|
|
460
|
-
</label>` :
|
|
473
|
+
</label>` : c}
|
|
461
474
|
<label class="lk-dev-row">${this.t("developer.game")}
|
|
462
475
|
<select @change=${this.selectGame}>
|
|
463
|
-
${
|
|
476
|
+
${b.map((t) => y`<option value=${t} ?selected=${t === e}>${this.t(`games.${t}.name`)}</option>`)}
|
|
464
477
|
</select>
|
|
465
478
|
</label>
|
|
466
|
-
${
|
|
467
|
-
<select @change=${(e) => this.change("multiplier", Number(
|
|
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)}>
|
|
468
481
|
${this.choices([
|
|
469
482
|
1,
|
|
470
483
|
2,
|
|
@@ -474,49 +487,49 @@ var J = {
|
|
|
474
487
|
].map((e) => ({
|
|
475
488
|
value: String(e),
|
|
476
489
|
label: `×${e}`
|
|
477
|
-
})),
|
|
490
|
+
})), t.multiplier?.toString(), this.t("developer.daily"))}
|
|
478
491
|
</select>
|
|
479
492
|
</label>
|
|
480
|
-
${
|
|
481
|
-
<select @change=${(e) => this.change("variant",
|
|
482
|
-
${this.choices(
|
|
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) => ({
|
|
483
496
|
value: t,
|
|
484
497
|
label: this.t(`${e}.names.${t}`)
|
|
485
|
-
})),
|
|
498
|
+
})), t.variant, this.t("developer.daily"))}
|
|
486
499
|
</select>
|
|
487
|
-
</label>` :
|
|
500
|
+
</label>` : c}
|
|
488
501
|
<label class="lk-dev-row">${this.t("developer.result")}
|
|
489
|
-
<select ?disabled=${!!
|
|
490
|
-
${
|
|
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>`)}
|
|
491
504
|
</select>
|
|
492
505
|
</label>
|
|
493
|
-
${
|
|
506
|
+
${n ? y`<p class="lk-dev-note">${this.t("developer.decidedBy", { field: this.t(`developer.field.${n}`) })}</p>` : c}
|
|
494
507
|
|
|
495
508
|
<details
|
|
496
509
|
class="lk-dev-advanced"
|
|
497
|
-
?open=${this.advancedOpen ||
|
|
510
|
+
?open=${this.advancedOpen || L[e].some((e) => t.advanced[e] !== void 0)}
|
|
498
511
|
@toggle=${(e) => this.advancedOpen = e.target.open}
|
|
499
512
|
>
|
|
500
|
-
<summary>${
|
|
501
|
-
${
|
|
502
|
-
<select @change=${(t) => this.changeAdvanced(e,
|
|
503
|
-
${this.choices(this.options(e),
|
|
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"))}
|
|
504
517
|
</select>
|
|
505
518
|
</label>`)}
|
|
506
519
|
<p class="lk-dev-note">${this.t(`developer.about.${e}`)}</p>
|
|
507
520
|
</details>`)}
|
|
508
521
|
|
|
509
522
|
<footer>
|
|
510
|
-
<button type="button" @click=${this.reset}>${
|
|
511
|
-
<button type="button" class="is-primary" @click=${this.apply}>${
|
|
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>
|
|
512
525
|
</footer>
|
|
513
526
|
</div>`;
|
|
514
527
|
}
|
|
515
528
|
render() {
|
|
516
|
-
if (!this.open) return
|
|
529
|
+
if (!this.open) return c;
|
|
517
530
|
let e = this.unlocked && this.minimized;
|
|
518
|
-
return
|
|
519
|
-
${e ?
|
|
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
|
|
520
533
|
type="button"
|
|
521
534
|
class="lk-dev-icon"
|
|
522
535
|
aria-label=${this.t("developer.restore")}
|
|
@@ -527,19 +540,19 @@ var J = {
|
|
|
527
540
|
@pointercancel=${this.release}
|
|
528
541
|
@click=${this.restore}
|
|
529
542
|
>
|
|
530
|
-
${
|
|
531
|
-
</button>` :
|
|
543
|
+
${v(M)}
|
|
544
|
+
</button>` : y`<section class="lk-dev-panel" aria-label=${this.t("developer.title")}>
|
|
532
545
|
<header @pointerdown=${this.grab} @pointermove=${this.move} @pointerup=${this.release} @pointercancel=${this.release}>
|
|
533
|
-
${
|
|
534
|
-
<strong>${
|
|
535
|
-
${this.unlocked ?
|
|
536
|
-
${
|
|
537
|
-
</button>` :
|
|
538
|
-
<button type="button" aria-label=${this.t("developer.close")} title=${this.t("developer.close")} @click=${this.toggle}>${
|
|
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>
|
|
539
552
|
</header>
|
|
540
553
|
${this.renderBody()}
|
|
541
554
|
</section>`}
|
|
542
555
|
</div>`;
|
|
543
556
|
}
|
|
544
557
|
};
|
|
545
|
-
|
|
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 };
|