@betorigami/game-ui-wheel 1.0.3 → 1.1.1

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 (3) hide show
  1. package/dist/index.mjs +301 -305
  2. package/dist/standalone.mjs +6414 -6189
  3. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { genCorrelationId as he, getTranslation as g, createMockGenerator as ge, OrigamiActionType as Q, noiseClick as ce, gameContext as N, OrigamiElement as T, componentStyles as W, watch as te, DEFAULT_CURRENCY as G, formatMonetaryAmount as ue, DEFAULT_LANGUAGE as L, getCurrencyIcon as pe, OrigamiGame as z, InvalidReason as me, GameComponent as se, HotkeyController as de, HotkeyHelper as ee, waitForEvent as fe, formatAutobetSettings as ye, getGameOutcome as be, calculateGameLayoutStyle as we, isEndAction as ve } from "@betorigami/game-ui-shared";
2
- import { css as A, svg as V, nothing as X, html as l, LitElement as Se } from "lit";
3
- import { Wheel as _e, WheelRiskLevel as u, WheelSegments as R, getWheelPattern as $e, getWheelSegmentMultipliers as ke, describeWheelOutcomes as De, isWheelRiskLevel as ie, isWheelSegments as ae, WHEEL_RISK_LEVELS as xe, WHEEL_SEGMENT_OPTIONS as Ee, getWheelMaxMultiplier as re } from "@betorigami/game-wheel";
4
- import { cache as Ie } from "lit/directives/cache.js";
5
- import { property as o, customElement as k, query as Z, state as w } from "lit/decorators.js";
1
+ import { genCorrelationId as ge, resolveApiErrorCode as ce, getTranslation as g, errorCodeToTranslationKey as ue, ErrorCode as K, createMockGenerator as pe, OrigamiActionType as ee, noiseClick as me, gameContext as R, OrigamiElement as C, componentStyles as L, watch as se, DEFAULT_CURRENCY as q, formatMonetaryAmount as de, DEFAULT_LANGUAGE as W, getCurrencyIcon as fe, OrigamiGame as X, InvalidReason as ye, GameComponent as ie, HotkeyController as be, HotkeyHelper as te, waitForEvent as ve, formatAutobetSettings as we, getGameOutcome as Se, calculateGameLayoutStyle as _e, isEndAction as $e } from "@betorigami/game-ui-shared";
2
+ import { css as I, svg as Y, nothing as Z, html as l, LitElement as ke } from "lit";
3
+ import { Wheel as De, WheelRiskLevel as u, WheelSegments as N, getWheelPattern as xe, getWheelSegmentMultipliers as Ee, describeWheelOutcomes as Ae, isWheelRiskLevel as re, isWheelSegments as ae, WHEEL_RISK_LEVELS as Ie, WHEEL_SEGMENT_OPTIONS as Me, getWheelMaxMultiplier as oe } from "@betorigami/game-wheel";
4
+ import { cache as Pe } from "lit/directives/cache.js";
5
+ import { property as n, customElement as k, query as J, state as v } from "lit/decorators.js";
6
6
  import f from "big.js";
7
- import { sumPayout as Ae } from "@betorigami/game-engine";
7
+ import { sumPayout as Oe } from "@betorigami/game-engine";
8
8
  import { consume as U } from "@lit/context";
9
- import { styleMap as Me } from "lit/directives/style-map.js";
10
- const Pe = {
9
+ import { styleMap as Ce } from "lit/directives/style-map.js";
10
+ const Te = {
11
11
  overview: {
12
12
  translation: {
13
13
  key: "gameInfo.wheel.overview",
@@ -48,7 +48,7 @@ const Pe = {
48
48
  }
49
49
  }
50
50
  };
51
- class K {
51
+ class G {
52
52
  /**
53
53
  * Calculate exact target angle for a segment with pseudorandom position
54
54
  * @param segmentIndex - Index of winning segment (0-based)
@@ -56,9 +56,9 @@ class K {
56
56
  * @param betId - UUID to seed random position
57
57
  * @returns Target angle in degrees (0-360)
58
58
  */
59
- static calculateTargetAngle(e, i, a) {
60
- const s = 360 / i, r = e * s, n = this.hashUuidToSegmentOffset(a, s);
61
- return ((360 - (r + n)) % 360 + 360) % 360;
59
+ static calculateTargetAngle(e, i, r) {
60
+ const s = 360 / i, a = e * s, o = this.hashUuidToSegmentOffset(r, s);
61
+ return ((360 - (a + o)) % 360 + 360) % 360;
62
62
  }
63
63
  /**
64
64
  * Generate deceleration frame offsets using exponential decay
@@ -72,13 +72,13 @@ class K {
72
72
  */
73
73
  static generateDecelerationOffsets(e, i) {
74
74
  const s = [0];
75
- let r = 0, n = 0;
75
+ let a = 0, o = 0;
76
76
  for (; ; ) {
77
- n++;
78
- const d = e * Math.exp(-i * n);
77
+ o++;
78
+ const d = e * Math.exp(-i * o);
79
79
  if (d < 0.01)
80
80
  break;
81
- r += d, s.push(r);
81
+ a += d, s.push(a);
82
82
  }
83
83
  return s;
84
84
  }
@@ -89,8 +89,8 @@ class K {
89
89
  * @param decelerationDistance - Total degrees to decelerate over
90
90
  * @returns Angle at which to start decelerating
91
91
  */
92
- static calculateDecelerationStartAngle(e, i, a) {
93
- let s = i - a;
92
+ static calculateDecelerationStartAngle(e, i, r) {
93
+ let s = i - r;
94
94
  for (; s <= e; )
95
95
  s += 360;
96
96
  return s;
@@ -103,11 +103,11 @@ class K {
103
103
  * @private Internal helper method
104
104
  */
105
105
  static hashUuidToSegmentOffset(e, i) {
106
- const s = e.split("-").pop(), r = s ? parseInt(s, 16) : 0, n = i - 2;
107
- return 1 + r % n;
106
+ const s = e.split("-").pop(), a = s ? parseInt(s, 16) : 0, o = i - 2;
107
+ return 1 + a % o;
108
108
  }
109
109
  }
110
- class Oe {
110
+ class Be {
111
111
  constructor(e, i) {
112
112
  this.authToken = e, this.baseUrl = i + "/games/wheel";
113
113
  }
@@ -118,7 +118,7 @@ class Oe {
118
118
  headers: {
119
119
  "Content-Type": "application/json",
120
120
  Authorization: `Bearer ${this.authToken}`,
121
- "X-Origami-Trace": he()
121
+ "X-Origami-Trace": ge()
122
122
  },
123
123
  body: JSON.stringify({
124
124
  amount: e.amount,
@@ -128,40 +128,34 @@ class Oe {
128
128
  },
129
129
  meta: e.meta
130
130
  })
131
- }), a = await i.json();
132
- if (i.ok && a.id)
133
- return { success: !0, data: a };
134
- let s = "alerts.gameError";
135
- switch (a?.errorCode) {
136
- case "INSUFFICIENT_BALANCE":
137
- s = "alerts.insufficientBalance";
138
- break;
139
- case "LIMIT_REACHED":
140
- s = "alerts.betLimitReached";
141
- break;
142
- }
131
+ }), r = await i.json();
132
+ if (i.ok && r.id)
133
+ return { success: !0, data: r };
134
+ const s = ce(r);
143
135
  return {
144
136
  success: !1,
145
- error: g(s, e.language)
137
+ error: g(ue(s), e.language),
138
+ errorCode: s
146
139
  };
147
140
  } catch {
148
141
  return {
149
142
  success: !1,
150
- error: g("alerts.gameError", e.language)
143
+ error: g("alerts.gameError", e.language),
144
+ errorCode: K.UNKNOWN
151
145
  };
152
146
  }
153
147
  }
154
148
  }
155
- class Te {
149
+ class We {
156
150
  constructor(e) {
157
151
  this.edge = e;
158
152
  }
159
153
  async startBet(e) {
160
- const { amount: i, riskLevel: a, segments: s } = e, r = { riskLevel: a, segments: s, betAmount: f(i) }, n = new _e().getGameResult({
161
- generator: ge(),
154
+ const { amount: i, riskLevel: r, segments: s } = e, a = { riskLevel: r, segments: s, betAmount: f(i) }, o = new De().getGameResult({
155
+ generator: pe(),
162
156
  edge: this.edge,
163
- gameInputs: r
164
- }), d = Ae(n.payout).toString();
157
+ gameInputs: a
158
+ }), d = Oe(o.payout).toString();
165
159
  return { success: !0, data: {
166
160
  id: crypto.randomUUID(),
167
161
  tenantId: "origami-casino",
@@ -171,7 +165,7 @@ class Te {
171
165
  amount: i,
172
166
  payout: d,
173
167
  afterBalance: "1000",
174
- multiplier: n.payoutMultiplier.toString(),
168
+ multiplier: o.payoutMultiplier.toString(),
175
169
  clientSeed: "mock-seed",
176
170
  randomValue: "mock-random",
177
171
  proof: "mock-proof",
@@ -179,21 +173,21 @@ class Te {
179
173
  betActions: [
180
174
  {
181
175
  data: {
182
- WHEEL: { riskLevel: a, segments: s }
176
+ WHEEL: { riskLevel: r, segments: s }
183
177
  },
184
- type: Q.START_BET
178
+ type: ee.START_BET
185
179
  },
186
180
  {
187
181
  data: {
188
- WHEEL: { result: n.outputs.result }
182
+ WHEEL: { result: o.outputs.result }
189
183
  },
190
- type: Q.END_BET
184
+ type: ee.END_BET
191
185
  }
192
186
  ]
193
187
  } };
194
188
  }
195
189
  }
196
- const Be = A`
190
+ const Le = I`
197
191
  :host {
198
192
  width: 100%;
199
193
  height: 100%;
@@ -220,7 +214,7 @@ const Be = A`
220
214
  display: block;
221
215
  }
222
216
  }
223
- `, Ce = A`
217
+ `, Ne = I`
224
218
  :host {
225
219
  width: 100%;
226
220
  height: 100%;
@@ -322,24 +316,24 @@ const Be = A`
322
316
  aspect-ratio: 1 / 1;
323
317
  margin: 0 auto;
324
318
  }
325
- `, C = {
319
+ `, B = {
326
320
  BLACK: "var(--wheel-color-black)",
327
321
  GREEN: "var(--wheel-color-green)",
328
322
  YELLOW: "var(--wheel-color-yellow)",
329
323
  RED: "var(--wheel-color-red)",
330
324
  BLUE: "var(--wheel-color-blue)",
331
325
  PURPLE: "var(--wheel-color-purple)"
332
- }, Le = {
333
- ZERO: C.BLACK,
334
- A: C.GREEN,
335
- B: C.YELLOW,
336
- C: C.BLUE,
337
- D: C.RED,
338
- E: C.PURPLE
339
- }, ne = (t) => Le[t], q = 9, We = 0.08, Re = 0.8, Ne = 1e4, Ue = () => ({
340
- layers: [ce(2800, { duration: 15e-4, decay: 8, gain: 0.6 })],
326
+ }, Re = {
327
+ ZERO: B.BLACK,
328
+ A: B.GREEN,
329
+ B: B.YELLOW,
330
+ C: B.BLUE,
331
+ D: B.RED,
332
+ E: B.PURPLE
333
+ }, ne = (t) => Re[t], V = 9, Ue = 0.08, je = 0.8, Fe = 1e4, He = () => ({
334
+ layers: [me(2800, { duration: 15e-4, decay: 8, gain: 0.6 })],
341
335
  gainScale: 1
342
- }), Fe = A`
336
+ }), Ke = I`
343
337
  :host {
344
338
  --wheel-color-black: #1a1a1a;
345
339
  --wheel-color-green: #00d084;
@@ -360,40 +354,40 @@ const Be = A`
360
354
  }
361
355
  }
362
356
  `;
363
- var He = Object.defineProperty, je = Object.getOwnPropertyDescriptor, F = (t, e, i, a) => {
364
- for (var s = a > 1 ? void 0 : a ? je(e, i) : e, r = t.length - 1, n; r >= 0; r--)
365
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
366
- return a && s && He(e, i, s), s;
357
+ var Ge = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, j = (t, e, i, r) => {
358
+ for (var s = r > 1 ? void 0 : r ? qe(e, i) : e, a = t.length - 1, o; a >= 0; a--)
359
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
360
+ return r && s && Ge(e, i, s), s;
367
361
  };
368
- let P = class extends T {
362
+ let P = class extends C {
369
363
  constructor() {
370
- super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = R.TEN, this.highlightedSegments = [];
364
+ super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.highlightedSegments = [];
371
365
  }
372
366
  generateWheelPaths() {
373
- const t = $e({ riskLevel: this.risk, segments: this.segments }), e = { cx: 285, cy: 285 }, i = 284.371, a = 2 * Math.PI / this.segments, s = [];
374
- for (let r = 0; r < this.segments; r++) {
375
- const n = ne(t[r]), _ = this.highlightedSegments.length > 0 && !this.highlightedSegments.includes(r) ? 0.25 : 1, E = r * a - Math.PI / 2, I = (r + 1) * a - Math.PI / 2, M = {
367
+ const t = xe({ riskLevel: this.risk, segments: this.segments }), e = { cx: 285, cy: 285 }, i = 284.371, r = 2 * Math.PI / this.segments, s = [];
368
+ for (let a = 0; a < this.segments; a++) {
369
+ const o = ne(t[a]), _ = this.highlightedSegments.length > 0 && !this.highlightedSegments.includes(a) ? 0.25 : 1, E = a * r - Math.PI / 2, A = (a + 1) * r - Math.PI / 2, M = {
376
370
  x: e.cx + i * Math.cos(E),
377
371
  y: e.cy + i * Math.sin(E)
378
- }, j = {
379
- x: e.cx + i * Math.cos(I),
380
- y: e.cy + i * Math.sin(I)
372
+ }, H = {
373
+ x: e.cx + i * Math.cos(A),
374
+ y: e.cy + i * Math.sin(A)
381
375
  };
382
376
  s.push(
383
- V`<path
377
+ Y`<path
384
378
  class="segment-path"
385
- fill="${n}"
386
- stroke="${n}"
379
+ fill="${o}"
380
+ stroke="${o}"
387
381
  stroke-width="1"
388
382
  opacity="${_}"
389
- d="M${e.cx} ${e.cy} L${M.x.toFixed(3)} ${M.y.toFixed(3)} A${i} ${i} 0 0 1 ${j.x.toFixed(3)} ${j.y.toFixed(3)} Z"
383
+ d="M${e.cx} ${e.cy} L${M.x.toFixed(3)} ${M.y.toFixed(3)} A${i} ${i} 0 0 1 ${H.x.toFixed(3)} ${H.y.toFixed(3)} Z"
390
384
  />`
391
385
  );
392
386
  }
393
387
  return s;
394
388
  }
395
389
  render() {
396
- return V`
390
+ return Y`
397
391
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 570 570" width="100%" height="100%" fill="none" preserveAspectRatio="xMidYMid meet">
398
392
  <g clip-path="url(#a)">
399
393
  ${this.generateWheelPaths()}
@@ -409,28 +403,28 @@ let P = class extends T {
409
403
  `;
410
404
  }
411
405
  };
412
- P.styles = [Fe];
413
- F([
414
- o({ type: String })
406
+ P.styles = [Ke];
407
+ j([
408
+ n({ type: String })
415
409
  ], P.prototype, "risk", 2);
416
- F([
417
- o({ type: Number })
410
+ j([
411
+ n({ type: Number })
418
412
  ], P.prototype, "segments", 2);
419
- F([
420
- o({ type: Array })
413
+ j([
414
+ n({ type: Array })
421
415
  ], P.prototype, "highlightedSegments", 2);
422
- F([
423
- U({ context: N, subscribe: !0 })
416
+ j([
417
+ U({ context: R, subscribe: !0 })
424
418
  ], P.prototype, "gameData", 2);
425
- P = F([
419
+ P = j([
426
420
  k("origami-wheel-svg")
427
421
  ], P);
428
- var Ke = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, c = (t, e, i, a) => {
429
- for (var s = a > 1 ? void 0 : a ? Ge(e, i) : e, r = t.length - 1, n; r >= 0; r--)
430
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
431
- return a && s && Ke(e, i, s), s;
422
+ var Ve = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, c = (t, e, i, r) => {
423
+ for (var s = r > 1 ? void 0 : r ? Ye(e, i) : e, a = t.length - 1, o; a >= 0; a--)
424
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
425
+ return r && s && Ve(e, i, s), s;
432
426
  };
433
- let h = class extends T {
427
+ let h = class extends C {
434
428
  constructor() {
435
429
  super(...arguments), this.isPlaying = !1, this.staticDisplay = !1, this.ignoreInstantBet = !1, this.risk = u.MEDIUM_RISK, this.segments = 10, this.targetAngle = null, this.resultSegment = null, this.hoveredSegments = [], this._angle = 0, this._rafId = null, this._decelerationOffsets = null, this._currentDecelerationFrame = 0, this._decelerationStartAngle = 0;
436
430
  }
@@ -449,10 +443,10 @@ let h = class extends T {
449
443
  this._angle = this.targetAngle, this._updateTransform(), this._stopLoop(), this.emit("wheel-spin-complete");
450
444
  return;
451
445
  }
452
- const t = this._isInstantBet ? Re : We;
453
- this._decelerationOffsets = K.generateDecelerationOffsets(q, t);
446
+ const t = this._isInstantBet ? je : Ue;
447
+ this._decelerationOffsets = G.generateDecelerationOffsets(V, t);
454
448
  const e = this._decelerationOffsets[this._decelerationOffsets.length - 1];
455
- this._decelerationStartAngle = K.calculateDecelerationStartAngle(this._angle, this.targetAngle, e), this._currentDecelerationFrame = 0;
449
+ this._decelerationStartAngle = G.calculateDecelerationStartAngle(this._angle, this.targetAngle, e), this._currentDecelerationFrame = 0;
456
450
  }
457
451
  handleIsPlayingChange() {
458
452
  this.isPlaying && this._rafId === null && !this._isInstantBet ? this._startLoop() : !this.isPlaying && this._rafId !== null && this._stopLoop();
@@ -461,19 +455,19 @@ let h = class extends T {
461
455
  const t = () => {
462
456
  const e = this._angle;
463
457
  if (this._currentDecelerationFrame > 0) {
464
- const r = this._decelerationOffsets[this._currentDecelerationFrame];
465
- if (this._angle = this._decelerationStartAngle + r, this._currentDecelerationFrame++, this._currentDecelerationFrame >= this._decelerationOffsets.length) {
458
+ const a = this._decelerationOffsets[this._currentDecelerationFrame];
459
+ if (this._angle = this._decelerationStartAngle + a, this._currentDecelerationFrame++, this._currentDecelerationFrame >= this._decelerationOffsets.length) {
466
460
  this._angle = this.targetAngle, this._decelerationOffsets = null, this._currentDecelerationFrame = 0, this._updateTransform(), this.emit("wheel-spin-complete"), this._rafId = null;
467
461
  return;
468
462
  }
469
463
  } else if (this._decelerationOffsets !== null && this._currentDecelerationFrame === 0) {
470
- const r = this._angle + q;
471
- r >= this._decelerationStartAngle ? (this._angle = this._decelerationStartAngle, this._currentDecelerationFrame = 1) : this._angle = r;
464
+ const a = this._angle + V;
465
+ a >= this._decelerationStartAngle ? (this._angle = this._decelerationStartAngle, this._currentDecelerationFrame = 1) : this._angle = a;
472
466
  } else
473
- this._angle += q;
467
+ this._angle += V;
474
468
  this._updateTransform();
475
- const a = 360 / this.segments;
476
- Math.floor(this._angle / a) - Math.floor(e / a) > 0 && this.gameData?.soundEffects?.play(Ue()), this._rafId = requestAnimationFrame(t);
469
+ const r = 360 / this.segments;
470
+ Math.floor(this._angle / r) - Math.floor(e / r) > 0 && this.gameData?.soundEffects?.play(He()), this._rafId = requestAnimationFrame(t);
477
471
  };
478
472
  this._rafId === null && (this._rafId = requestAnimationFrame(t));
479
473
  }
@@ -506,7 +500,7 @@ let h = class extends T {
506
500
  fill="none"
507
501
  >
508
502
  <circle cx="284" cy="284" r="78" fill="var(--background-base)" stroke="white" stroke-width="36" />
509
- ${this.gameData?.customWheelCenterSvgUrl ? V`<image
503
+ ${this.gameData?.customWheelCenterSvgUrl ? Y`<image
510
504
  href=${this.gameData.customWheelCenterSvgUrl}
511
505
  x=${224 + (this.gameData.customWheelCenterPadding ?? 0)}
512
506
  y=${224 + (this.gameData.customWheelCenterPadding ?? 0)}
@@ -514,7 +508,7 @@ let h = class extends T {
514
508
  height=${120 - 2 * (this.gameData.customWheelCenterPadding ?? 0)}
515
509
  style="clip-path: circle(50%)"
516
510
  preserveAspectRatio="xMidYMid slice"
517
- />` : X}
511
+ />` : Z}
518
512
  <path
519
513
  d="M281.402 125.5C282.557 123.5 285.443 123.5 286.598 125.5L334.23 208C335.384 210 333.941 212.5 331.632 212.5H236.369C234.059 212.5 232.616 210 233.771 208L281.402 125.5Z"
520
514
  fill="white"
@@ -526,47 +520,47 @@ let h = class extends T {
526
520
  `;
527
521
  }
528
522
  };
529
- h.styles = [W, Ce];
523
+ h.styles = [L, Ne];
530
524
  c([
531
- o({ type: Boolean })
525
+ n({ type: Boolean })
532
526
  ], h.prototype, "isPlaying", 2);
533
527
  c([
534
- o({ type: Boolean })
528
+ n({ type: Boolean })
535
529
  ], h.prototype, "staticDisplay", 2);
536
530
  c([
537
- o({ type: Boolean })
531
+ n({ type: Boolean })
538
532
  ], h.prototype, "ignoreInstantBet", 2);
539
533
  c([
540
- o({ type: String })
534
+ n({ type: String })
541
535
  ], h.prototype, "risk", 2);
542
536
  c([
543
- o({ type: Number })
537
+ n({ type: Number })
544
538
  ], h.prototype, "segments", 2);
545
539
  c([
546
- o({ type: Number })
540
+ n({ type: Number })
547
541
  ], h.prototype, "targetAngle", 2);
548
542
  c([
549
- o({ type: Number })
543
+ n({ type: Number })
550
544
  ], h.prototype, "resultSegment", 2);
551
545
  c([
552
- o({ type: Array })
546
+ n({ type: Array })
553
547
  ], h.prototype, "hoveredSegments", 2);
554
548
  c([
555
- U({ context: N, subscribe: !0 })
549
+ U({ context: R, subscribe: !0 })
556
550
  ], h.prototype, "gameData", 2);
557
551
  c([
558
- Z(".wheel-svg")
552
+ J(".wheel-svg")
559
553
  ], h.prototype, "_wheelEl", 2);
560
554
  c([
561
- te("targetAngle")
555
+ se("targetAngle")
562
556
  ], h.prototype, "handleTargetAngleChange", 1);
563
557
  c([
564
- te("isPlaying")
558
+ se("isPlaying")
565
559
  ], h.prototype, "handleIsPlayingChange", 1);
566
560
  h = c([
567
561
  k("origami-wheel-animator")
568
562
  ], h);
569
- const qe = A`
563
+ const ze = I`
570
564
  :host {
571
565
  display: flex;
572
566
  flex-direction: column;
@@ -701,14 +695,14 @@ const qe = A`
701
695
  cursor: help;
702
696
  }
703
697
  `;
704
- var Ve = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, B = (t, e, i, a) => {
705
- for (var s = a > 1 ? void 0 : a ? Ye(e, i) : e, r = t.length - 1, n; r >= 0; r--)
706
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
707
- return a && s && Ve(e, i, s), s;
698
+ var Xe = Object.defineProperty, Ze = Object.getOwnPropertyDescriptor, T = (t, e, i, r) => {
699
+ for (var s = r > 1 ? void 0 : r ? Ze(e, i) : e, a = t.length - 1, o; a >= 0; a--)
700
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
701
+ return r && s && Xe(e, i, s), s;
708
702
  };
709
- let $ = class extends T {
703
+ let $ = class extends C {
710
704
  constructor() {
711
- super(...arguments), this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments = R.TEN, this.resultSegment = null, this.hoveredTileIndex = null;
705
+ super(...arguments), this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.resultSegment = null, this.hoveredTileIndex = null;
712
706
  }
713
707
  get edge() {
714
708
  return this.gameData?.edge ?? 1;
@@ -717,10 +711,10 @@ let $ = class extends T {
717
711
  return { riskLevel: this.risk, segments: this.segments };
718
712
  }
719
713
  get segmentMultipliers() {
720
- return ke(this.selection, this.edge);
714
+ return Ee(this.selection, this.edge);
721
715
  }
722
716
  get tiles() {
723
- return De(this.selection, this.edge).outcomes;
717
+ return Ae(this.selection, this.edge).outcomes;
724
718
  }
725
719
  getActiveTileIndexFromSegment() {
726
720
  if (this.resultSegment === null) return null;
@@ -746,30 +740,30 @@ let $ = class extends T {
746
740
  this.isDesktop && (this.hoveredTileIndex = null, this.emit("wheel-multiplier-hover", { detail: { segments: [] } }));
747
741
  }
748
742
  formatProfit(t) {
749
- const e = f(this.gameData?.betAmount ?? 0).times(t.minus(1)), i = e.lt(0) ? f(0) : e, a = this.gameData?.currency ?? G;
750
- return ue(i.toNumber(), a, { includeSymbol: !1 });
743
+ const e = f(this.gameData?.betAmount ?? 0).times(t.minus(1)), i = e.lt(0) ? f(0) : e, r = this.gameData?.currency ?? q;
744
+ return de(i.toNumber(), r, { includeSymbol: !1 });
751
745
  }
752
746
  formatChance(t, e) {
753
747
  return `${t}/${e}`;
754
748
  }
755
749
  render() {
756
- const t = this.tiles, e = Math.min(t.length, 6), i = this.gameData?.language || L, a = this.activeTileIndex, s = t[a], r = t.reduce((_, E) => _ + E.weight, 0), n = this.formatProfit(s.multiplier), d = this.formatChance(s.weight, r);
750
+ const t = this.tiles, e = Math.min(t.length, 6), i = this.gameData?.language || W, r = this.activeTileIndex, s = t[r], a = t.reduce((_, E) => _ + E.weight, 0), o = this.formatProfit(s.multiplier), d = this.formatChance(s.weight, a);
757
751
  return l`
758
752
  <div class="container">
759
753
  ${this.isDesktop ? l`<div class="multiplier-info">
760
754
  <div class="info-item">
761
755
  <div>
762
756
  <span class="label">${g("common.profitOnWin", i)}:</span>
763
- <span class="value">${n}</span>
757
+ <span class="value">${o}</span>
764
758
  </div>
765
759
  <origami-tooltip
766
- content=${this.gameData?.currency ?? G}
760
+ content=${this.gameData?.currency ?? q}
767
761
  position="top"
768
762
  .trigger=${["hover"]}
769
763
  .offset=${6}
770
764
  inline
771
765
  >
772
- <span class="info-icon">${pe(this.gameData?.currency ?? G)}</span>
766
+ <span class="info-icon">${fe(this.gameData?.currency ?? q)}</span>
773
767
  </origami-tooltip>
774
768
  </div>
775
769
 
@@ -784,24 +778,24 @@ let $ = class extends T {
784
778
  size="16px"
785
779
  ></lottie-icon>
786
780
  </div>
787
- </div>` : X}
781
+ </div>` : Z}
788
782
 
789
783
  <div class="tiles" role="list" style="--grid-columns: ${e}" @mouseleave=${() => this.handleTileMouseLeave()}>
790
- ${t.map(({ slot: _, multiplier: E }, I) => {
791
- const M = `${E.toString()}X`, j = ne(_), J = this.hoveredTileIndex === I;
784
+ ${t.map(({ slot: _, multiplier: E }, A) => {
785
+ const M = `${E.toString()}X`, H = ne(_), Q = this.hoveredTileIndex === A;
792
786
  return l`
793
787
  <div
794
788
  class="tile"
795
789
  role="listitem"
796
- hovered=${J}
797
- active=${!J && I === a}
798
- @mouseenter=${() => this.handleTileMouseEnter(I)}
790
+ hovered=${Q}
791
+ active=${!Q && A === r}
792
+ @mouseenter=${() => this.handleTileMouseEnter(A)}
799
793
  >
800
794
  <div class="tile-content">
801
795
  <span class="tile-label">${M}</span>
802
796
  <span
803
797
  class="dot"
804
- style=${Me({ backgroundColor: j })}
798
+ style=${Ce({ backgroundColor: H })}
805
799
  aria-hidden="true"
806
800
  ></span>
807
801
  </div>
@@ -813,34 +807,34 @@ let $ = class extends T {
813
807
  `;
814
808
  }
815
809
  };
816
- $.styles = [W, qe];
817
- B([
818
- o({ type: Boolean, attribute: "data-is-desktop" })
810
+ $.styles = [L, ze];
811
+ T([
812
+ n({ type: Boolean, attribute: "data-is-desktop" })
819
813
  ], $.prototype, "isDesktop", 2);
820
- B([
821
- o({ type: String })
814
+ T([
815
+ n({ type: String })
822
816
  ], $.prototype, "risk", 2);
823
- B([
824
- o({ type: Number })
817
+ T([
818
+ n({ type: Number })
825
819
  ], $.prototype, "segments", 2);
826
- B([
827
- o({ type: Number })
820
+ T([
821
+ n({ type: Number })
828
822
  ], $.prototype, "resultSegment", 2);
829
- B([
830
- w()
823
+ T([
824
+ v()
831
825
  ], $.prototype, "hoveredTileIndex", 2);
832
- B([
833
- U({ context: N, subscribe: !0 })
826
+ T([
827
+ U({ context: R, subscribe: !0 })
834
828
  ], $.prototype, "gameData", 2);
835
- $ = B([
829
+ $ = T([
836
830
  k("origami-wheel-content-bottom")
837
831
  ], $);
838
- var ze = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, D = (t, e, i, a) => {
839
- for (var s = a > 1 ? void 0 : a ? Xe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
840
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
841
- return a && s && ze(e, i, s), s;
832
+ var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, D = (t, e, i, r) => {
833
+ for (var s = r > 1 ? void 0 : r ? Qe(e, i) : e, a = t.length - 1, o; a >= 0; a--)
834
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
835
+ return r && s && Je(e, i, s), s;
842
836
  };
843
- let y = class extends T {
837
+ let y = class extends C {
844
838
  constructor() {
845
839
  super(...arguments), this.isDesktop = !1, this.isPlaying = !1, this.history = [], this.risk = u.MEDIUM_RISK, this.segments = 10, this.targetAngle = null, this.resultSegment = null, this.hoveredSegments = [];
846
840
  }
@@ -851,7 +845,7 @@ let y = class extends T {
851
845
  return l`
852
846
  <origami-history-pills
853
847
  data-is-desktop=${this.isDesktop}
854
- .gameType=${z.WHEEL}
848
+ .gameType=${X.WHEEL}
855
849
  .history=${[...this.history].reverse()}
856
850
  ></origami-history-pills>
857
851
 
@@ -877,35 +871,35 @@ let y = class extends T {
877
871
  `;
878
872
  }
879
873
  };
880
- y.styles = [W, Be];
874
+ y.styles = [L, Le];
881
875
  D([
882
- o({ type: Boolean })
876
+ n({ type: Boolean })
883
877
  ], y.prototype, "isDesktop", 2);
884
878
  D([
885
- o({ type: Boolean })
879
+ n({ type: Boolean })
886
880
  ], y.prototype, "isPlaying", 2);
887
881
  D([
888
- o({ type: Array })
882
+ n({ type: Array })
889
883
  ], y.prototype, "history", 2);
890
884
  D([
891
- o({ type: String })
885
+ n({ type: String })
892
886
  ], y.prototype, "risk", 2);
893
887
  D([
894
- o({ type: Number })
888
+ n({ type: Number })
895
889
  ], y.prototype, "segments", 2);
896
890
  D([
897
- o({ type: Number })
891
+ n({ type: Number })
898
892
  ], y.prototype, "targetAngle", 2);
899
893
  D([
900
- o({ type: Number })
894
+ n({ type: Number })
901
895
  ], y.prototype, "resultSegment", 2);
902
896
  D([
903
- w()
897
+ v()
904
898
  ], y.prototype, "hoveredSegments", 2);
905
899
  y = D([
906
900
  k("origami-wheel-layout")
907
901
  ], y);
908
- const oe = A`
902
+ const le = I`
909
903
  :host {
910
904
  display: flex;
911
905
  flex-direction: column;
@@ -935,7 +929,7 @@ const oe = A`
935
929
  .grid-full-width {
936
930
  grid-column: span 2;
937
931
  }
938
- `, Ze = A`
932
+ `, et = I`
939
933
  :host {
940
934
  display: contents;
941
935
  }
@@ -944,35 +938,35 @@ const oe = A`
944
938
  grid-column: span 2;
945
939
  }
946
940
  `;
947
- var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, H = (t, e, i, a) => {
948
- for (var s = a > 1 ? void 0 : a ? Qe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
949
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
950
- return a && s && Je(e, i, s), s;
941
+ var tt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, F = (t, e, i, r) => {
942
+ for (var s = r > 1 ? void 0 : r ? st(e, i) : e, a = t.length - 1, o; a >= 0; a--)
943
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
944
+ return r && s && tt(e, i, s), s;
951
945
  };
952
- const et = {
946
+ const it = {
953
947
  [u.LOW_RISK]: "common.low",
954
948
  [u.MEDIUM_RISK]: "common.medium",
955
949
  [u.HIGH_RISK]: "common.high"
956
950
  };
957
- let O = class extends T {
951
+ let O = class extends C {
958
952
  constructor() {
959
- super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = R.TEN, this.disabled = !1;
953
+ super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.disabled = !1;
960
954
  }
961
955
  handleRiskChange(t) {
962
956
  const { value: e } = t.detail;
963
- ie(e) && this.emit("wheel-risk-change", { detail: { value: e } });
957
+ re(e) && this.emit("wheel-risk-change", { detail: { value: e } });
964
958
  }
965
959
  handleSegmentsChange(t) {
966
960
  const e = Number(t.detail.value);
967
961
  ae(e) && this.emit("wheel-segments-change", { detail: { value: e } });
968
962
  }
969
963
  render() {
970
- const t = this.gameData?.language || L;
964
+ const t = this.gameData?.language || W;
971
965
  return l`
972
966
  <origami-select
973
967
  class="grid-full-width"
974
968
  label=${g("common.risk", t)}
975
- .options=${xe.map((e) => ({ value: e, label: g(et[e], t) }))}
969
+ .options=${Ie.map((e) => ({ value: e, label: g(it[e], t) }))}
976
970
  .value=${this.risk}
977
971
  @select-change=${this.handleRiskChange}
978
972
  ?disabled=${this.disabled}
@@ -981,7 +975,7 @@ let O = class extends T {
981
975
  <origami-select
982
976
  class="grid-full-width"
983
977
  label=${g("games.wheel.segments", t)}
984
- .options=${Ee.map((e) => ({ value: e.toString(), label: e.toString() }))}
978
+ .options=${Me.map((e) => ({ value: e.toString(), label: e.toString() }))}
985
979
  .value=${this.segments.toString()}
986
980
  @select-change=${this.handleSegmentsChange}
987
981
  ?disabled=${this.disabled}
@@ -989,30 +983,30 @@ let O = class extends T {
989
983
  `;
990
984
  }
991
985
  };
992
- O.styles = [W, Ze];
993
- H([
994
- o({ type: String })
986
+ O.styles = [L, et];
987
+ F([
988
+ n({ type: String })
995
989
  ], O.prototype, "risk", 2);
996
- H([
997
- o({ type: Number })
990
+ F([
991
+ n({ type: Number })
998
992
  ], O.prototype, "segments", 2);
999
- H([
1000
- o({ type: Boolean })
993
+ F([
994
+ n({ type: Boolean })
1001
995
  ], O.prototype, "disabled", 2);
1002
- H([
1003
- U({ context: N, subscribe: !0 })
996
+ F([
997
+ U({ context: R, subscribe: !0 })
1004
998
  ], O.prototype, "gameData", 2);
1005
- O = H([
999
+ O = F([
1006
1000
  k("origami-wheel-selectors")
1007
1001
  ], O);
1008
- var tt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, v = (t, e, i, a) => {
1009
- for (var s = a > 1 ? void 0 : a ? st(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1010
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
1011
- return a && s && tt(e, i, s), s;
1002
+ var rt = Object.defineProperty, at = Object.getOwnPropertyDescriptor, w = (t, e, i, r) => {
1003
+ for (var s = r > 1 ? void 0 : r ? at(e, i) : e, a = t.length - 1, o; a >= 0; a--)
1004
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
1005
+ return r && s && rt(e, i, s), s;
1012
1006
  };
1013
- let p = class extends T {
1007
+ let p = class extends C {
1014
1008
  constructor() {
1015
- super(...arguments), this.isPlaying = !1, this.betDisabled = !1, this.inputsDisabled = !1, this.risk = u.MEDIUM_RISK, this.segments = R.TEN, this.betMaxMultiplier = f(1), this.isBetAmountValid = !0, this._betAboveBalance = !1;
1009
+ super(...arguments), this.isPlaying = !1, this.betDisabled = !1, this.inputsDisabled = !1, this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.betMaxMultiplier = f(1), this.isBetAmountValid = !0, this._betAboveBalance = !1;
1016
1010
  }
1017
1011
  render() {
1018
1012
  const t = this.gameData?.language || "en";
@@ -1025,7 +1019,7 @@ let p = class extends T {
1025
1019
  this.isBetAmountValid = e.detail.isValid;
1026
1020
  }}
1027
1021
  @bet-amount-input-error-change=${(e) => {
1028
- this._betAboveBalance = e.detail.invalidReason === me.BET_AMOUNT_ABOVE_BALANCE;
1022
+ this._betAboveBalance = e.detail.invalidReason === ye.BET_AMOUNT_ABOVE_BALANCE;
1029
1023
  }}
1030
1024
  ></origami-bet-amount-input>
1031
1025
 
@@ -1047,45 +1041,45 @@ let p = class extends T {
1047
1041
  `;
1048
1042
  }
1049
1043
  };
1050
- p.styles = [W, oe];
1051
- v([
1052
- o({ type: Boolean })
1044
+ p.styles = [L, le];
1045
+ w([
1046
+ n({ type: Boolean })
1053
1047
  ], p.prototype, "isPlaying", 2);
1054
- v([
1055
- o({ type: Boolean })
1048
+ w([
1049
+ n({ type: Boolean })
1056
1050
  ], p.prototype, "betDisabled", 2);
1057
- v([
1058
- o({ type: Boolean })
1051
+ w([
1052
+ n({ type: Boolean })
1059
1053
  ], p.prototype, "inputsDisabled", 2);
1060
- v([
1061
- o({ type: String })
1054
+ w([
1055
+ n({ type: String })
1062
1056
  ], p.prototype, "risk", 2);
1063
- v([
1064
- o({ type: Number })
1057
+ w([
1058
+ n({ type: Number })
1065
1059
  ], p.prototype, "segments", 2);
1066
- v([
1067
- o({ attribute: !1 })
1060
+ w([
1061
+ n({ attribute: !1 })
1068
1062
  ], p.prototype, "betMaxMultiplier", 2);
1069
- v([
1070
- U({ context: N, subscribe: !0 })
1063
+ w([
1064
+ U({ context: R, subscribe: !0 })
1071
1065
  ], p.prototype, "gameData", 2);
1072
- v([
1073
- w()
1066
+ w([
1067
+ v()
1074
1068
  ], p.prototype, "isBetAmountValid", 2);
1075
- v([
1076
- w()
1069
+ w([
1070
+ v()
1077
1071
  ], p.prototype, "_betAboveBalance", 2);
1078
- p = v([
1072
+ p = w([
1079
1073
  k("origami-wheel-manual")
1080
1074
  ], p);
1081
- var it = Object.defineProperty, at = Object.getOwnPropertyDescriptor, x = (t, e, i, a) => {
1082
- for (var s = a > 1 ? void 0 : a ? at(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1083
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
1084
- return a && s && it(e, i, s), s;
1075
+ var ot = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, x = (t, e, i, r) => {
1076
+ for (var s = r > 1 ? void 0 : r ? nt(e, i) : e, a = t.length - 1, o; a >= 0; a--)
1077
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
1078
+ return r && s && ot(e, i, s), s;
1085
1079
  };
1086
- let b = class extends T {
1080
+ let b = class extends C {
1087
1081
  constructor() {
1088
- super(...arguments), this.inputsDisabled = !1, this.autobetStopping = !1, this.autobetInProgress = !1, this.betDisabled = !1, this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments = R.TEN, this.betMaxMultiplier = f(1);
1082
+ super(...arguments), this.inputsDisabled = !1, this.autobetStopping = !1, this.autobetInProgress = !1, this.betDisabled = !1, this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.betMaxMultiplier = f(1);
1089
1083
  }
1090
1084
  render() {
1091
1085
  return l`
@@ -1106,35 +1100,35 @@ let b = class extends T {
1106
1100
  `;
1107
1101
  }
1108
1102
  };
1109
- b.styles = [W, oe];
1103
+ b.styles = [L, le];
1110
1104
  x([
1111
- o({ type: Boolean })
1105
+ n({ type: Boolean })
1112
1106
  ], b.prototype, "inputsDisabled", 2);
1113
1107
  x([
1114
- o({ type: Boolean })
1108
+ n({ type: Boolean })
1115
1109
  ], b.prototype, "autobetStopping", 2);
1116
1110
  x([
1117
- o({ type: Boolean })
1111
+ n({ type: Boolean })
1118
1112
  ], b.prototype, "autobetInProgress", 2);
1119
1113
  x([
1120
- o({ type: Boolean })
1114
+ n({ type: Boolean })
1121
1115
  ], b.prototype, "betDisabled", 2);
1122
1116
  x([
1123
- o({ type: Boolean })
1117
+ n({ type: Boolean })
1124
1118
  ], b.prototype, "isDesktop", 2);
1125
1119
  x([
1126
- o({ type: String })
1120
+ n({ type: String })
1127
1121
  ], b.prototype, "risk", 2);
1128
1122
  x([
1129
- o({ type: Number })
1123
+ n({ type: Number })
1130
1124
  ], b.prototype, "segments", 2);
1131
1125
  x([
1132
- o({ attribute: !1 })
1126
+ n({ attribute: !1 })
1133
1127
  ], b.prototype, "betMaxMultiplier", 2);
1134
1128
  b = x([
1135
1129
  k("origami-wheel-auto")
1136
1130
  ], b);
1137
- const rt = A`
1131
+ const lt = I`
1138
1132
  :host {
1139
1133
  height: 100%;
1140
1134
  }
@@ -1143,21 +1137,21 @@ const rt = A`
1143
1137
  display: block;
1144
1138
  }
1145
1139
  `;
1146
- var nt = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, S = (t, e, i, a) => {
1147
- for (var s = a > 1 ? void 0 : a ? ot(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1148
- (n = t[r]) && (s = (a ? n(e, i, s) : n(s)) || s);
1149
- return a && s && nt(e, i, s), s;
1140
+ var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, S = (t, e, i, r) => {
1141
+ for (var s = r > 1 ? void 0 : r ? gt(e, i) : e, a = t.length - 1, o; a >= 0; a--)
1142
+ (o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
1143
+ return r && s && ht(e, i, s), s;
1150
1144
  };
1151
- let m = class extends se {
1145
+ let m = class extends ie {
1152
1146
  constructor() {
1153
- super(), this.isManualPlaying = !1, this.history = [], this.wheelRisk = u.MEDIUM_RISK, this.numberOfSegments = 10, this.targetAngle = null, this.resultSegment = null, this.isWheelSpinning = !1, new de(this, [
1147
+ super(), this.isManualPlaying = !1, this.history = [], this.wheelRisk = u.MEDIUM_RISK, this.numberOfSegments = 10, this.targetAngle = null, this.resultSegment = null, this.isWheelSpinning = !1, new be(this, [
1154
1148
  {
1155
1149
  key: " ",
1156
- callback: () => ee.clickBetButton(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl),
1150
+ callback: () => te.clickBetButton(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl),
1157
1151
  options: {
1158
1152
  repeat: !0,
1159
1153
  repeatInterval: 200,
1160
- disabled: () => this.gameData?.hotkeysOpenEnabled ? ee.isBetButtonDisabled(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl) : !0
1154
+ disabled: () => this.gameData?.hotkeysOpenEnabled ? te.isBetButtonDisabled(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl) : !0
1161
1155
  }
1162
1156
  }
1163
1157
  ]);
@@ -1169,7 +1163,7 @@ let m = class extends se {
1169
1163
  this.numberOfSegments = t.detail.value, this.resultSegment = null;
1170
1164
  }
1171
1165
  get wheelApi() {
1172
- return this.isDemoMode ? new Te(this.gameData.edge) : new Oe(this.gameData.authToken, this.gameData.baseUrl);
1166
+ return this.isDemoMode ? new We(this.gameData.edge) : new Be(this.gameData.authToken, this.gameData.baseUrl);
1173
1167
  }
1174
1168
  get isToggleDisabled() {
1175
1169
  return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
@@ -1178,7 +1172,7 @@ let m = class extends se {
1178
1172
  return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
1179
1173
  }
1180
1174
  wheelSpinCompletedPromise() {
1181
- return fe(this, "wheel-spin-complete", void 0, Ne, !0);
1175
+ return ve(this, "wheel-spin-complete", void 0, Fe, !0);
1182
1176
  }
1183
1177
  async handleBetExecution(t, e) {
1184
1178
  if (this.resetForNextBet(() => {
@@ -1186,48 +1180,49 @@ let m = class extends se {
1186
1180
  }), !this.gameData?.currency)
1187
1181
  return {
1188
1182
  success: !1,
1189
- error: g("alerts.gameError", this.gameData?.language || L)
1183
+ error: g("alerts.gameError", this.gameData?.language || W)
1190
1184
  };
1191
1185
  const i = f(this.gameData.balance);
1192
1186
  try {
1193
1187
  if (this.isDemoMode && i.lt(t))
1194
- throw new Error(g("alerts.insufficientBalance", this.gameData?.language || L));
1188
+ throw new Error(g("alerts.insufficientBalance", this.gameData?.language || W));
1195
1189
  this.preDeductStake(i, t);
1196
- const a = !this.isInstantBet;
1197
- a && (this.isWheelSpinning = !0);
1190
+ const r = !this.isInstantBet;
1191
+ r && (this.isWheelSpinning = !0);
1198
1192
  const s = await this.placeBet(
1199
1193
  () => this.wheelApi.startBet({
1200
1194
  amount: t,
1201
1195
  language: this.gameData.language,
1202
1196
  riskLevel: this.wheelRisk,
1203
1197
  segments: this.numberOfSegments,
1204
- meta: e ? ye(e) : void 0
1198
+ meta: e ? we(e) : void 0
1205
1199
  })
1206
1200
  );
1207
1201
  if (s.success) {
1208
- const { data: r } = s, n = Number(r.multiplier ?? 0), { betActions: d } = r, _ = d[d.length - 1];
1202
+ const { data: a } = s, o = Number(a.multiplier ?? 0), { betActions: d } = a, _ = d[d.length - 1];
1209
1203
  if (_?.data?.WHEEL) {
1210
1204
  const { result: M } = _.data.WHEEL;
1211
- this.resultSegment = M[0] ?? 0, this.targetAngle = K.calculateTargetAngle(this.resultSegment, this.numberOfSegments, r.id);
1205
+ this.resultSegment = M[0] ?? 0, this.targetAngle = G.calculateTargetAngle(this.resultSegment, this.numberOfSegments, a.id);
1212
1206
  }
1213
- a && await this.wheelSpinCompletedPromise(), this.isWheelSpinning = !1;
1214
- const E = f(n).gt(0);
1215
- this.history = [...this.history, { multiplier: n, won: E, id: r.id }], this.updateHistoryWithBet(r);
1216
- const I = this.isDemoMode ? i.minus(r.amount ?? 0).plus(r.payout ?? 0) : f(r.afterBalance ?? 0);
1217
- return this.gameData.updateBalance(I), f(n).gt(1) && this.playWinFeedback(), s;
1207
+ r && await this.wheelSpinCompletedPromise(), this.isWheelSpinning = !1;
1208
+ const E = f(o).gt(0);
1209
+ this.history = [...this.history, { multiplier: o, won: E, id: a.id }], this.updateHistoryWithBet(a);
1210
+ const A = this.isDemoMode ? i.minus(a.amount ?? 0).plus(a.payout ?? 0) : f(a.afterBalance ?? 0);
1211
+ return this.gameData.updateBalance(A), f(o).gt(1) && this.playWinFeedback(), s;
1218
1212
  } else
1219
- throw new Error(s.error);
1220
- } catch (a) {
1221
- this.gameData.updateBalance(i), this.isWheelSpinning = !1;
1222
- const s = a instanceof Error ? a.message : g("alerts.gameError", this.gameData?.language || L);
1223
- return this.showError(s), {
1213
+ return this.gameData.updateBalance(i), this.isWheelSpinning = !1, s;
1214
+ } catch (r) {
1215
+ return this.gameData.updateBalance(i), this.isWheelSpinning = !1, {
1224
1216
  success: !1,
1225
- error: s
1217
+ error: r instanceof Error ? r.message : g("alerts.gameError", this.gameData?.language || W),
1218
+ errorCode: K.UNKNOWN
1226
1219
  };
1227
1220
  }
1228
1221
  }
1229
1222
  async wheelPlay() {
1230
- this.isManualPlaying = !0, await this.handleBetExecution(this.gameData?.betAmount ?? "0"), this.isManualPlaying = !1;
1223
+ this.isManualPlaying = !0;
1224
+ const t = await this.handleBetExecution(this.gameData?.betAmount ?? "0");
1225
+ t.success || (this.checkSessionExpired(t.errorCode ?? K.UNKNOWN), this.showError(t.error)), this.isManualPlaying = !1;
1231
1226
  }
1232
1227
  async executeAutobet(t, e) {
1233
1228
  const i = await this.handleBetExecution(e, t);
@@ -1236,15 +1231,16 @@ let m = class extends se {
1236
1231
  pnl: f(0),
1237
1232
  gameOutcome: "Draw",
1238
1233
  hasError: !0,
1239
- errorMessage: i.error || g("alerts.errorProcessingBet", this.gameData?.language || L)
1234
+ errorCode: i.errorCode ?? K.UNKNOWN,
1235
+ errorMessage: i.error || g("alerts.errorProcessingBet", this.gameData?.language || W)
1240
1236
  };
1241
- const a = i.data, s = f(a.payout ?? 0).minus(a.amount ?? 0), r = Number(a.multiplier), n = be(r);
1242
- return await this.holdResultDisplay(), { pnl: s, gameOutcome: n, hasError: !1 };
1237
+ const r = i.data, s = f(r.payout ?? 0).minus(r.amount ?? 0), a = Number(r.multiplier), o = Se(a);
1238
+ return await this.holdResultDisplay(), { pnl: s, gameOutcome: o, hasError: !1 };
1243
1239
  }
1244
1240
  render() {
1245
- const t = this.gameData?.mainWidth >= 768, e = re(this.gameData.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), i = !1, a = we(this.gameData);
1241
+ const t = this.gameData?.mainWidth >= 768, e = oe(this.gameData.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), i = !1, r = _e(this.gameData);
1246
1242
  return l`
1247
- <origami-game-layout style=${a} .gameType=${z.WHEEL} data-is-desktop=${t}>
1243
+ <origami-game-layout style=${r} .gameType=${X.WHEEL} data-is-desktop=${t}>
1248
1244
  <origami-game-sidebar
1249
1245
  slot="control-panel"
1250
1246
  data-is-desktop=${t}
@@ -1254,7 +1250,7 @@ let m = class extends se {
1254
1250
  @wheel-risk-change=${this.handleWheelRiskChange}
1255
1251
  @wheel-segments-change=${this.handleWheelSegmentsChange}
1256
1252
  >
1257
- ${Ie(
1253
+ ${Pe(
1258
1254
  this.manualOrAuto === "Manual" ? l`<origami-wheel-manual
1259
1255
  slot="controls"
1260
1256
  data-is-desktop=${t}
@@ -1283,7 +1279,7 @@ let m = class extends se {
1283
1279
  )}
1284
1280
  </origami-game-sidebar>
1285
1281
 
1286
- ${t ? X : l`
1282
+ ${t ? Z : l`
1287
1283
  <origami-wheel-content-bottom
1288
1284
  slot="content-bottom"
1289
1285
  ?data-is-desktop=${t}
@@ -1307,48 +1303,48 @@ let m = class extends se {
1307
1303
  `;
1308
1304
  }
1309
1305
  };
1310
- m.styles = [...se.styles, rt];
1306
+ m.styles = [...ie.styles, lt];
1311
1307
  S([
1312
- w()
1308
+ v()
1313
1309
  ], m.prototype, "isManualPlaying", 2);
1314
1310
  S([
1315
- w()
1311
+ v()
1316
1312
  ], m.prototype, "history", 2);
1317
1313
  S([
1318
- w()
1314
+ v()
1319
1315
  ], m.prototype, "wheelRisk", 2);
1320
1316
  S([
1321
- w()
1317
+ v()
1322
1318
  ], m.prototype, "numberOfSegments", 2);
1323
1319
  S([
1324
- w()
1320
+ v()
1325
1321
  ], m.prototype, "targetAngle", 2);
1326
1322
  S([
1327
- w()
1323
+ v()
1328
1324
  ], m.prototype, "resultSegment", 2);
1329
1325
  S([
1330
- w()
1326
+ v()
1331
1327
  ], m.prototype, "isWheelSpinning", 2);
1332
1328
  S([
1333
- Z("origami-wheel-manual")
1329
+ J("origami-wheel-manual")
1334
1330
  ], m.prototype, "_wheelManualEl", 2);
1335
1331
  S([
1336
- Z("origami-wheel-auto")
1332
+ J("origami-wheel-auto")
1337
1333
  ], m.prototype, "_wheelAutoEl", 2);
1338
1334
  m = S([
1339
1335
  k("origami-wheel-game")
1340
1336
  ], m);
1341
- var lt = Object.getOwnPropertyDescriptor, ht = (t, e, i, a) => {
1342
- for (var s = a > 1 ? void 0 : a ? lt(e, i) : e, r = t.length - 1, n; r >= 0; r--)
1343
- (n = t[r]) && (s = n(s) || s);
1337
+ var ct = Object.getOwnPropertyDescriptor, ut = (t, e, i, r) => {
1338
+ for (var s = r > 1 ? void 0 : r ? ct(e, i) : e, a = t.length - 1, o; a >= 0; a--)
1339
+ (o = t[a]) && (s = o(s) || s);
1344
1340
  return s;
1345
1341
  };
1346
- let Y = class extends Se {
1342
+ let z = class extends ke {
1347
1343
  render() {
1348
1344
  return l`<slot></slot>`;
1349
1345
  }
1350
1346
  };
1351
- Y.styles = A`
1347
+ z.styles = I`
1352
1348
  :host {
1353
1349
  pointer-events: none;
1354
1350
  width: 100%;
@@ -1369,19 +1365,19 @@ Y.styles = A`
1369
1365
  }
1370
1366
  }
1371
1367
  `;
1372
- Y = ht([
1368
+ z = ut([
1373
1369
  k("origami-wheel-outcome")
1374
- ], Y);
1375
- const gt = (t) => typeof t == "object" && t !== null && "risk" in t && ie(t.risk) && "segments" in t && ae(t.segments) && "resultSegment" in t && typeof t.resultSegment == "number" && "betId" in t && typeof t.betId == "string", le = (t) => {
1370
+ ], z);
1371
+ const pt = (t) => typeof t == "object" && t !== null && "risk" in t && re(t.risk) && "segments" in t && ae(t.segments) && "resultSegment" in t && typeof t.resultSegment == "number" && "betId" in t && typeof t.betId == "string", he = (t) => {
1376
1372
  const e = t?.WHEEL;
1377
1373
  return e !== void 0 && "segments" in e ? e : void 0;
1378
- }, ct = (t) => {
1379
- const e = le(t.betActions[0]?.data), i = t.betActions[t.betActions.length - 1]?.data.WHEEL;
1380
- return e === void 0 || i === void 0 || !ve(i) ? { risk: u.MEDIUM_RISK, segments: R.TEN, resultSegment: 0, betId: t.id || "123" } : { risk: e.riskLevel, segments: e.segments, resultSegment: i.result[0] ?? 0, betId: t.id };
1381
- }, ut = (t, { enableAnimation: e, inBetResultModal: i, language: a }) => {
1382
- if (!gt(t))
1383
- return l`<p>${g("errors.noWheelData", a)}</p>`;
1384
- const s = K.calculateTargetAngle(t.resultSegment, t.segments, t.betId);
1374
+ }, mt = (t) => {
1375
+ const e = he(t.betActions[0]?.data), i = t.betActions[t.betActions.length - 1]?.data.WHEEL;
1376
+ return e === void 0 || i === void 0 || !$e(i) ? { risk: u.MEDIUM_RISK, segments: N.TEN, resultSegment: 0, betId: t.id || "123" } : { risk: e.riskLevel, segments: e.segments, resultSegment: i.result[0] ?? 0, betId: t.id };
1377
+ }, dt = (t, { enableAnimation: e, inBetResultModal: i, language: r }) => {
1378
+ if (!pt(t))
1379
+ return l`<p>${g("errors.noWheelData", r)}</p>`;
1380
+ const s = G.calculateTargetAngle(t.resultSegment, t.segments, t.betId);
1385
1381
  return l`
1386
1382
  <origami-wheel-outcome>
1387
1383
  <origami-wheel-animator
@@ -1397,20 +1393,20 @@ const gt = (t) => typeof t == "object" && t !== null && "risk" in t && ie(t.risk
1397
1393
  ></origami-wheel-animator>
1398
1394
  </origami-wheel-outcome>
1399
1395
  `;
1400
- }, pt = (t) => {
1401
- const e = le(t);
1396
+ }, ft = (t) => {
1397
+ const e = he(t);
1402
1398
  return e === void 0 ? {} : { segments: e.segments, riskLevel: e.riskLevel };
1403
- }, mt = ({ segments: t, riskLevel: e }) => ({ segments: t, riskLevel: e }), Dt = {
1404
- id: z.WHEEL,
1399
+ }, yt = ({ segments: t, riskLevel: e }) => ({ segments: t, riskLevel: e }), At = {
1400
+ id: X.WHEEL,
1405
1401
  renderGame: () => l`<origami-wheel-game></origami-wheel-game>`,
1406
- gameInfo: Pe,
1407
- maxMultiplier: (t) => re(t).toNumber(),
1408
- verifierInputs: pt,
1409
- verifierQuery: mt,
1410
- extractOutcome: ct,
1411
- renderOutcome: ut
1402
+ gameInfo: Te,
1403
+ maxMultiplier: (t) => oe(t).toNumber(),
1404
+ verifierInputs: ft,
1405
+ verifierQuery: yt,
1406
+ extractOutcome: mt,
1407
+ renderOutcome: dt
1412
1408
  };
1413
1409
  export {
1414
1410
  m as WheelGame,
1415
- Dt as wheelUiModule
1411
+ At as wheelUiModule
1416
1412
  };