@everymatrix/mini-games-hub 0.2.7 → 0.2.9

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 (84) hide show
  1. package/components/ArrowLeftIcon-BBQbSgPj.js +20 -0
  2. package/components/ArrowLeftIcon-CK2Rm6IW.cjs +1 -0
  3. package/components/ArrowLeftIcon-CbMwJALt.js +20 -0
  4. package/components/ArrowLeftIcon-Ls7P40Uk.cjs +1 -0
  5. package/components/CoinFlip-CWv6r8u1.cjs +1 -0
  6. package/components/CoinFlip-CaRkaWEA.cjs +1 -0
  7. package/components/CoinFlip-D3kH_y8b.js +390 -0
  8. package/components/CoinFlip-hKLoCmvJ.js +355 -0
  9. package/components/CoinRoyale-Cr3FMU-f.js +998 -0
  10. package/components/CoinRoyale-DcXB88TG.cjs +734 -0
  11. package/components/CoinRoyale-HFE5DCkQ.js +1036 -0
  12. package/components/CoinRoyale-mXlKdlwT.cjs +734 -0
  13. package/components/{GameCard-vgoswSWl.cjs → GameCard-BPoaBZ8h.cjs} +3 -3
  14. package/components/{GameCard-C-zSlvo1.cjs → GameCard-DfVe9CgG.cjs} +3 -3
  15. package/components/{GameCard-B3YKo9k6.js → GameCard-cglVYPLz.js} +36 -36
  16. package/components/{GameCard-BQ6hFy67.js → GameCard-grRDxpTz.js} +39 -36
  17. package/components/{MiniGamesHub-C0q9vZFD.js → MiniGamesHub-CxhilLzF.js} +342 -206
  18. package/components/{MiniGamesHub-D5Y5OYt-.js → MiniGamesHub-DUICCoYd.js} +301 -168
  19. package/components/MiniGamesHub-DW82s9I9.cjs +79 -0
  20. package/components/MiniGamesHub-uuQkACzs.cjs +79 -0
  21. package/components/{WheelOfFortune-u6v6YLc5.js → WheelOfFortune-CsDXFzBd.js} +146 -138
  22. package/components/{WheelOfFortune-BJ9iMr53.cjs → WheelOfFortune-DGY-q1LW.cjs} +2 -2
  23. package/components/{WheelOfFortune-2WKhJAdZ.cjs → WheelOfFortune-DfN31a-S.cjs} +2 -2
  24. package/components/{WheelOfFortune-DC57_QGF.js → WheelOfFortune-MIjCRllT.js} +186 -175
  25. package/components/WheelOfFortuneDrawResults-CKN979BS.js +261 -0
  26. package/components/WheelOfFortuneDrawResults-CmfWdZz0.cjs +1 -0
  27. package/components/WheelOfFortuneDrawResults-Di5DQfhF.cjs +1 -0
  28. package/components/WheelOfFortuneDrawResults-Dr-xmM_N.js +286 -0
  29. package/components/WheelOfFortuneHistory-BL4DV0im.cjs +13 -0
  30. package/components/WheelOfFortuneHistory-CqRO9Oee.cjs +13 -0
  31. package/components/WheelOfFortuneHistory-DFn33FhJ.js +222 -0
  32. package/components/WheelOfFortuneHistory-DvqIUld0.js +223 -0
  33. package/components/WheelOfFortuneRules-BxMUpX5_.js +120 -0
  34. package/components/WheelOfFortuneRules-CnS5xZ_B.js +109 -0
  35. package/components/WheelOfFortuneRules-Cu5CBrl6.cjs +5 -0
  36. package/components/WheelOfFortuneRules-UZj0hVWC.cjs +5 -0
  37. package/components/{WheelOfFortuneWheel-D_tfW-rK.js → WheelOfFortuneWheel-C694AcSr.js} +405 -380
  38. package/components/WheelOfFortuneWheel-CvGaRYgu.cjs +3 -0
  39. package/components/WheelOfFortuneWheel-Dxh6wKCh.cjs +3 -0
  40. package/components/{WheelOfFortuneWheel-DmTRvIN6.js → WheelOfFortuneWheel-cBswACGf.js} +545 -519
  41. package/components/bg-scene-Bz42V1FW.cjs +1 -0
  42. package/components/bg-scene-DpHgKCHj.js +4 -0
  43. package/components/coin-heads-BuJOLpyg.cjs +1 -0
  44. package/components/coin-heads-loqcEtH2.js +4 -0
  45. package/components/coin-tails-20vJmhwv.cjs +1 -0
  46. package/components/coin-tails-BTbsTwkz.js +4 -0
  47. package/components/{constants-BYsDpbRv.js → constants-BDSd8ptj.js} +25 -15
  48. package/components/constants-CoPH35Re.cjs +1 -0
  49. package/components/{sparkles-BnriHiyw.cjs → sparkles-9YGw1xiU.cjs} +1 -1
  50. package/components/{sparkles-DplvhrIm.cjs → sparkles-B3XdFovy.cjs} +1 -1
  51. package/components/{sparkles-CSfeD2Zu.js → sparkles-BWGIWWDc.js} +1 -1
  52. package/components/{sparkles-CTrQ372y.js → sparkles-uxV1OTbN.js} +1 -1
  53. package/components/{spin-controller-CIshWmlA.cjs → spin-controller-BXcblJt7.cjs} +1 -1
  54. package/components/{spin-controller-HS3m99tB.cjs → spin-controller-BzO5YNSN.cjs} +1 -1
  55. package/components/{spin-controller-BuBkKrNR.js → spin-controller-CZWa2gmm.js} +2 -2
  56. package/components/{spin-controller-REPdRwaB.js → spin-controller-D3hdDnQ0.js} +2 -2
  57. package/components/{utils-B86dsoC-.js → utils-3LNftCeZ.js} +976 -958
  58. package/components/utils-BxNmJ6YA.cjs +3 -0
  59. package/components/{utils-BtFS7k_l.js → utils-DGrEJJ_K.js} +1063 -1045
  60. package/components/utils-DyVEmMSf.cjs +3 -0
  61. package/es2015/mini-games-hub.cjs +1 -1
  62. package/es2015/mini-games-hub.js +1 -1
  63. package/esnext/mini-games-hub.cjs +1 -1
  64. package/esnext/mini-games-hub.js +1 -1
  65. package/package.json +1 -1
  66. package/components/MiniGamesHub-CfiDjCz7.cjs +0 -16
  67. package/components/MiniGamesHub-DYwmUNTy.cjs +0 -16
  68. package/components/WheelOfFortuneDrawResults-BKkTmsVC.cjs +0 -1
  69. package/components/WheelOfFortuneDrawResults-D3rgrYi_.js +0 -254
  70. package/components/WheelOfFortuneDrawResults-DTufAeXD.cjs +0 -1
  71. package/components/WheelOfFortuneDrawResults-gx2xkUtF.js +0 -279
  72. package/components/WheelOfFortuneHistory-B-Yadw5p.js +0 -213
  73. package/components/WheelOfFortuneHistory-DdXxYW6M.cjs +0 -12
  74. package/components/WheelOfFortuneHistory-DhFZUmGd.cjs +0 -12
  75. package/components/WheelOfFortuneHistory-IM5H-der.js +0 -213
  76. package/components/WheelOfFortuneRules-BM75DT61.js +0 -107
  77. package/components/WheelOfFortuneRules-D-xnWFIU.cjs +0 -3
  78. package/components/WheelOfFortuneRules-DkQOlpqR.js +0 -118
  79. package/components/WheelOfFortuneRules-_a2c-LEy.cjs +0 -3
  80. package/components/WheelOfFortuneWheel-CUs0nOjA.cjs +0 -3
  81. package/components/WheelOfFortuneWheel-D9nXwM0H.cjs +0 -3
  82. package/components/constants-DM6Vdc6Z.cjs +0 -1
  83. package/components/utils-By_D2O28.cjs +0 -3
  84. package/components/utils-CSIl6eA7.cjs +0 -3
@@ -0,0 +1,261 @@
1
+ import { d as Re, c as Se, p as E, b as Fe, i as D, e as g, s as je, f as j, g as Le, t as le, l as d, u as N, r as A, j as Me, k as Pe, h as Ee } from "./WheelOfFortuneWheel-C694AcSr.js";
2
+ import { a5 as Ce, ad as oe, L as a, ae as We, a9 as Be, b3 as De, b1 as q, bc as Q, b6 as f, aU as C, b5 as l, ba as m, aJ as h, b7 as v, ar as F, b2 as G, b9 as Ge } from "./utils-3LNftCeZ.js";
3
+ import { E as Ue } from "./error-DJgbe-Bh.js";
4
+ import { a as Ie } from "./sparkles-BWGIWWDc.js";
5
+ var V = j('<span class="button-spinner"></span>'), Je = j('<div class="confirm-modal-content"><p class="confirm-modal-title"> </p> <p class="confirm-modal-body"></p> <div class="confirm-modal-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"><span> </span> <!></button></div></div>'), $ = j('<h2 class="draw-result-title"> </h2> <p class="draw-result-description"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>', 1), Ne = j('<span class="draw-result-sparkle" aria-hidden="true">✦</span>'), Oe = j('<h2 class="draw-result-title"> <!></h2> <p class="draw-result-description"></p> <div class="draw-result-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"> </button></div>', 1), He = j('<img alt="Error" class="draw-result-error-image"/> <p class="draw-result-description draw-result-description--error"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>', 1), Ke = j('<div class="draw-result-panel"><div class="draw-result-confetti-layer"></div> <!> <div class="draw-result-stack"><!></div></div>');
6
+ function Xe(ce, R) {
7
+ Ce(R, !0);
8
+ const s = () => je(De, "$_", de), [de, ve] = Le(), L = E(R, "result", 7), O = E(R, "endpoint", 7), U = E(R, "session", 7), H = E(R, "liteMode", 7, !1), K = E(R, "playAgainLabel", 7, "spinAgain"), W = E(R, "onFetchRemainingTimes", 7, () => {
9
+ }), ee = Q(() => L()?.success !== !0), X = Q(() => L()?.type), ae = Q(() => a(X) === "noprize"), ue = /* @__PURE__ */ new Set(["loyalty"]), pe = {
10
+ bonus: s()("prizeBonus"),
11
+ role: s()("prizeRole"),
12
+ tournament: s()("prizeTournament"),
13
+ ticket: s()("prizeTicket"),
14
+ loyalty: s()("prizeLoyalty"),
15
+ challenge: s()("prizeChallenge"),
16
+ custom: s()("prizeCustom")
17
+ }, me = [
18
+ { t: "-0.7em", l: "5%", s: "0.45em", d: "680ms" },
19
+ { t: "-0.5em", l: "22%", s: "0.28em", d: "760ms" },
20
+ { t: "-0.9em", l: "40%", s: "0.38em", d: "820ms" },
21
+ { t: "-0.6em", l: "58%", s: "0.3em", d: "740ms" },
22
+ { t: "-0.8em", l: "76%", s: "0.42em", d: "900ms" },
23
+ { t: "-0.4em", l: "92%", s: "0.25em", d: "860ms" },
24
+ { t: "0.1em", l: "14%", s: "0.22em", d: "800ms" },
25
+ { t: "0em", l: "72%", s: "0.2em", d: "950ms" }
26
+ ];
27
+ let I = q(void 0), y = q("initial"), u = q(null);
28
+ oe(() => {
29
+ a(I) && a(y) === "claimSuccess" && !H() && Ie(a(I));
30
+ }), oe(() => {
31
+ (a(ae) || a(ee)) && We(() => W()());
32
+ });
33
+ const te = (e) => {
34
+ const t = new URL(`${O()}/v1/wof/draw/${L().lotteryProgramID}`), r = new Headers();
35
+ U() && r.append("X-SessionId", U()), r.append("Content-Type", "application/json");
36
+ const c = { action: e, guid: L().guid };
37
+ return fetch(t, { method: "PUT", headers: r, body: JSON.stringify(c) }).then((o) => o.json());
38
+ }, se = async () => {
39
+ h(u, "claim");
40
+ try {
41
+ const e = await te(0), t = Ge(e, "draw"), r = t?.state === "fulfilled" && t?.completed, c = t?.state === "drawn" && !t?.completed;
42
+ r ? h(y, "claimSuccess") : c ? h(y, "claimFailed") : h(y, "claimFailed");
43
+ } catch (e) {
44
+ console.log(e), h(y, "claimFailed");
45
+ } finally {
46
+ h(u, null), W()();
47
+ }
48
+ }, _e = async () => {
49
+ h(u, "reject"), h(y, "initial");
50
+ const e = W();
51
+ try {
52
+ window.postMessage({ type: "BackToWheel", skipFetch: !0 }, window.location.href), await te(2), e?.();
53
+ } catch (t) {
54
+ console.log(t);
55
+ } finally {
56
+ h(u, null);
57
+ }
58
+ }, fe = () => {
59
+ window.postMessage({ type: "BackToWheel" }, window.location.href);
60
+ }, Y = () => {
61
+ window.postMessage({ type: "SpinAgain" }, window.location.href);
62
+ };
63
+ var be = {
64
+ get result() {
65
+ return L();
66
+ },
67
+ set result(e) {
68
+ L(e), C();
69
+ },
70
+ get endpoint() {
71
+ return O();
72
+ },
73
+ set endpoint(e) {
74
+ O(e), C();
75
+ },
76
+ get session() {
77
+ return U();
78
+ },
79
+ set session(e) {
80
+ U(e), C();
81
+ },
82
+ get liteMode() {
83
+ return H();
84
+ },
85
+ set liteMode(e = !1) {
86
+ H(e), C();
87
+ },
88
+ get playAgainLabel() {
89
+ return K();
90
+ },
91
+ set playAgainLabel(e = "spinAgain") {
92
+ K(e), C();
93
+ },
94
+ get onFetchRemainingTimes() {
95
+ return W();
96
+ },
97
+ set onFetchRemainingTimes(e = () => {
98
+ }) {
99
+ W(e), C();
100
+ }
101
+ }, Z = Ke(), re = f(Z);
102
+ Fe(re, (e) => h(I, e), () => a(I));
103
+ var ie = l(re, 2);
104
+ {
105
+ var ge = (e) => {
106
+ var t = Je(), r = f(t), c = v(r, !0), o = l(r, 2);
107
+ le(o, () => s()("rejectWarningText"), !0), m(o);
108
+ var p = l(o, 2), n = f(p), i = f(n);
109
+ let _;
110
+ var b = v(i, !0), k = l(i, 2);
111
+ {
112
+ var x = (T) => {
113
+ var B = V();
114
+ g(T, B);
115
+ };
116
+ D(k, (T) => {
117
+ a(u) === "claim" && T(x);
118
+ });
119
+ }
120
+ m(n);
121
+ var M = l(n, 2), S = f(M);
122
+ let J;
123
+ var z = v(S, !0), w = l(S, 2);
124
+ {
125
+ var P = (T) => {
126
+ var B = V();
127
+ g(T, B);
128
+ };
129
+ D(w, (T) => {
130
+ a(u) === "reject" && T(P);
131
+ });
132
+ }
133
+ m(M), m(p), m(t), F(
134
+ (T, B, Ae) => {
135
+ d(c, T), n.disabled = !!a(u), _ = N(i, "", _, { opacity: a(u) === "claim" ? 0 : 1 }), d(b, B), M.disabled = !!a(u), J = N(S, "", J, { opacity: a(u) === "reject" ? 0 : 1 }), d(z, Ae);
136
+ },
137
+ [
138
+ () => s()("areYouSure"),
139
+ () => s()("keepPrize"),
140
+ () => s()("rejectPrize")
141
+ ]
142
+ ), A("click", n, se), A("click", M, _e), g(e, t);
143
+ };
144
+ D(ie, (e) => {
145
+ a(y) === "rejectModal" && e(ge);
146
+ });
147
+ }
148
+ var ne = l(ie, 2), he = f(ne);
149
+ {
150
+ var ye = (e) => {
151
+ var t = $(), r = G(t), c = v(r, !0), o = l(r, 2), p = v(o, !0), n = l(o, 2), i = f(n), _ = v(i, !0);
152
+ m(n), F(
153
+ (b, k, x) => {
154
+ d(c, b), d(p, k), d(_, x);
155
+ },
156
+ [
157
+ () => s()("prizeAssignedTitle"),
158
+ () => s()("prizeAssigned"),
159
+ () => s()("backToGame")
160
+ ]
161
+ ), A("click", i, fe), g(e, t);
162
+ }, we = (e) => {
163
+ var t = $(), r = G(t), c = v(r, !0), o = l(r, 2), p = v(o, !0), n = l(o, 2), i = f(n), _ = v(i, !0);
164
+ m(n), F(
165
+ (b, k, x) => {
166
+ d(c, b), d(p, k), d(_, x);
167
+ },
168
+ [
169
+ () => s()("drawFailedTitle"),
170
+ () => s()("drawFailed"),
171
+ () => s()("backToGame")
172
+ ]
173
+ ), A("click", i, Y), g(e, t);
174
+ }, ke = (e) => {
175
+ var t = $(), r = G(t), c = v(r, !0), o = l(r, 2), p = v(o, !0), n = l(o, 2), i = f(n), _ = v(i, !0);
176
+ m(n), F(
177
+ (b, k, x) => {
178
+ d(c, b), d(p, k), i.disabled = !!a(u), d(_, x);
179
+ },
180
+ [
181
+ () => s()("noPrizeTitle"),
182
+ () => s()("noPrize"),
183
+ () => s()(K())
184
+ ]
185
+ ), A("click", i, Y), g(e, t);
186
+ }, xe = (e) => {
187
+ var t = Oe(), r = G(t), c = f(r), o = l(c);
188
+ Me(o, 17, () => me, Pe, (z, w) => {
189
+ var P = Ne();
190
+ F(() => N(P, `top:${a(w).t ?? ""};left:${a(w).l ?? ""};font-size:${a(w).s ?? ""};animation-delay:${a(w).d ?? ""}`)), g(z, P);
191
+ }), m(r);
192
+ var p = l(r, 2);
193
+ le(
194
+ p,
195
+ () => s()("success", {
196
+ values: {
197
+ prize: pe[a(X)],
198
+ form: ue.has(a(X)) ? "plural" : "singular"
199
+ }
200
+ }),
201
+ !0
202
+ ), m(p);
203
+ var n = l(p, 2), i = f(n), _ = f(i);
204
+ let b;
205
+ var k = v(_, !0), x = l(_, 2);
206
+ {
207
+ var M = (z) => {
208
+ var w = V();
209
+ g(z, w);
210
+ };
211
+ D(x, (z) => {
212
+ a(u) === "claim" && z(M);
213
+ });
214
+ }
215
+ m(i);
216
+ var S = l(i, 2), J = v(S, !0);
217
+ m(n), F(
218
+ (z, w, P) => {
219
+ d(c, `${z ?? ""} `), i.disabled = !!a(u), b = N(_, "", b, { opacity: a(u) === "claim" ? 0 : 1 }), d(k, w), S.disabled = !!a(u), d(J, P);
220
+ },
221
+ [
222
+ () => s()("congratulations"),
223
+ () => s()("claimReward"),
224
+ () => s()("reject")
225
+ ]
226
+ ), A("click", i, se), A("click", S, () => h(y, "rejectModal")), g(e, t);
227
+ }, ze = (e) => {
228
+ var t = He(), r = G(t), c = l(r, 2), o = v(c, !0), p = l(c, 2), n = f(p), i = v(n, !0);
229
+ m(p), F(
230
+ (_, b) => {
231
+ Ee(r, "src", Ue), d(o, _), d(i, b);
232
+ },
233
+ [() => s()("errorJSON"), () => s()("backToGame")]
234
+ ), A("click", n, Y), g(e, t);
235
+ };
236
+ D(he, (e) => {
237
+ a(y) === "claimSuccess" ? e(ye) : a(y) === "claimFailed" ? e(we, 1) : a(ae) ? e(ke, 2) : a(ee) ? e(ze, -1) : e(xe, 3);
238
+ });
239
+ }
240
+ m(ne), m(Z), g(ce, Z);
241
+ var Te = Be(be);
242
+ return ve(), Te;
243
+ }
244
+ Re(["click"]);
245
+ Se(
246
+ Xe,
247
+ {
248
+ result: {},
249
+ endpoint: {},
250
+ session: {},
251
+ liteMode: {},
252
+ playAgainLabel: {},
253
+ onFetchRemainingTimes: {}
254
+ },
255
+ [],
256
+ [],
257
+ { mode: "open" }
258
+ );
259
+ export {
260
+ Xe as W
261
+ };
@@ -0,0 +1 @@
1
+ "use strict";var G=(C,y,r)=>new Promise((E,L)=>{var x=m=>{try{k(r.next(m))}catch(T){L(T)}},z=m=>{try{k(r.throw(m))}catch(T){L(T)}},k=m=>m.done?E(m.value):Promise.resolve(m.value).then(x,z);k((r=r.apply(C,y)).next())});const t=require("./WheelOfFortuneWheel-CvGaRYgu.cjs"),e=require("./utils-BxNmJ6YA.cjs"),pe=require("./error-YyYl7p6_.cjs"),ue=require("./sparkles-9YGw1xiU.cjs");var I=t.from_html('<span class="button-spinner"></span>'),ve=t.from_html('<div class="confirm-modal-content"><p class="confirm-modal-title"> </p> <p class="confirm-modal-body"></p> <div class="confirm-modal-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"><span> </span> <!></button></div></div>'),N=t.from_html('<h2 class="draw-result-title"> </h2> <p class="draw-result-description"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>',1),me=t.from_html('<span class="draw-result-sparkle" aria-hidden="true">✦</span>'),ge=t.from_html('<h2 class="draw-result-title"> <!></h2> <p class="draw-result-description"></p> <div class="draw-result-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"> </button></div>',1),he=t.from_html('<img alt="Error" class="draw-result-error-image"/> <p class="draw-result-description draw-result-description--error"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>',1),fe=t.from_html('<div class="draw-result-panel"><div class="draw-result-confetti-layer"></div> <!> <div class="draw-result-stack"><!></div></div>');function V(C,y){e.push(y,!0);const r=()=>t.store_get(e.$format,"$_",E),[E,L]=t.setup_stores(),x=t.prop(y,"result",7),z=t.prop(y,"endpoint",7),k=t.prop(y,"session",7),m=t.prop(y,"liteMode",7,!1),T=t.prop(y,"playAgainLabel",7,"spinAgain"),j=t.prop(y,"onFetchRemainingTimes",7,()=>{}),U=e.user_derived(()=>{var s;return((s=x())==null?void 0:s.success)!==!0}),O=e.user_derived(()=>{var s;return(s=x())==null?void 0:s.type}),J=e.user_derived(()=>e.get(O)==="noprize"),D=new Set(["loyalty"]),$={bonus:r()("prizeBonus"),role:r()("prizeRole"),tournament:r()("prizeTournament"),ticket:r()("prizeTicket"),loyalty:r()("prizeLoyalty"),challenge:r()("prizeChallenge"),custom:r()("prizeCustom")},ee=[{t:"-0.7em",l:"5%",s:"0.45em",d:"680ms"},{t:"-0.5em",l:"22%",s:"0.28em",d:"760ms"},{t:"-0.9em",l:"40%",s:"0.38em",d:"820ms"},{t:"-0.6em",l:"58%",s:"0.3em",d:"740ms"},{t:"-0.8em",l:"76%",s:"0.42em",d:"900ms"},{t:"-0.4em",l:"92%",s:"0.25em",d:"860ms"},{t:"0.1em",l:"14%",s:"0.22em",d:"800ms"},{t:"0em",l:"72%",s:"0.2em",d:"950ms"}];let M=e.state(void 0),h=e.state("initial"),d=e.state(null);e.user_effect(()=>{e.get(M)&&e.get(h)==="claimSuccess"&&!m()&&ue.burstSuccessConfetti(e.get(M))}),e.user_effect(()=>{(e.get(J)||e.get(U))&&e.untrack(()=>j()())});const H=s=>{const a=new URL(`${z()}/v1/wof/draw/${x().lotteryProgramID}`),i=new Headers;k()&&i.append("X-SessionId",k()),i.append("Content-Type","application/json");const c={action:s,guid:x().guid};return fetch(a,{method:"PUT",headers:i,body:JSON.stringify(c)}).then(o=>o.json())},K=()=>G(this,null,function*(){e.set(d,"claim");try{const s=yield H(0),a=e.normalizeDrawResult(s,"draw"),i=(a==null?void 0:a.state)==="fulfilled"&&(a==null?void 0:a.completed),c=(a==null?void 0:a.state)==="drawn"&&!(a!=null&&a.completed);i?e.set(h,"claimSuccess"):e.set(h,"claimFailed")}catch(s){console.log(s),e.set(h,"claimFailed")}finally{e.set(d,null),j()()}}),te=()=>G(this,null,function*(){e.set(d,"reject"),e.set(h,"initial");const s=j();try{window.postMessage({type:"BackToWheel",skipFetch:!0},window.location.href),yield H(2),s==null||s()}catch(a){console.log(a)}finally{e.set(d,null)}}),se=()=>{window.postMessage({type:"BackToWheel"},window.location.href)},q=()=>{window.postMessage({type:"SpinAgain"},window.location.href)};var ae={get result(){return x()},set result(s){x(s),e.flushSync()},get endpoint(){return z()},set endpoint(s){z(s),e.flushSync()},get session(){return k()},set session(s){k(s),e.flushSync()},get liteMode(){return m()},set liteMode(s=!1){m(s),e.flushSync()},get playAgainLabel(){return T()},set playAgainLabel(s="spinAgain"){T(s),e.flushSync()},get onFetchRemainingTimes(){return j()},set onFetchRemainingTimes(s=()=>{}){j(s),e.flushSync()}},B=fe(),X=e.child(B);t.bind_this(X,s=>e.set(M,s),()=>e.get(M));var Y=e.sibling(X,2);{var re=s=>{var a=ve(),i=e.child(a),c=e.only_child(i,!0),o=e.sibling(i,2);t.html(o,()=>r()("rejectWarningText"),!0),e.reset(o);var _=e.sibling(o,2),n=e.child(_),l=e.child(n);let p;var u=e.only_child(l,!0),b=e.sibling(l,2);{var w=v=>{var S=I();t.append(v,S)};t.if_block(b,v=>{e.get(d)==="claim"&&v(w)})}e.reset(n);var A=e.sibling(n,2),F=e.child(A);let P;var g=e.only_child(F,!0),f=e.sibling(F,2);{var R=v=>{var S=I();t.append(v,S)};t.if_block(f,v=>{e.get(d)==="reject"&&v(R)})}e.reset(A),e.reset(_),e.reset(a),e.template_effect((v,S,W)=>{t.set_text(c,v),n.disabled=!!e.get(d),p=t.set_style(l,"",p,{opacity:e.get(d)==="claim"?0:1}),t.set_text(u,S),A.disabled=!!e.get(d),P=t.set_style(F,"",P,{opacity:e.get(d)==="reject"?0:1}),t.set_text(g,W)},[()=>r()("areYouSure"),()=>r()("keepPrize"),()=>r()("rejectPrize")]),t.delegated("click",n,K),t.delegated("click",A,te),t.append(s,a)};t.if_block(Y,s=>{e.get(h)==="rejectModal"&&s(re)})}var Z=e.sibling(Y,2),ie=e.child(Z);{var le=s=>{var a=N(),i=e.first_child(a),c=e.only_child(i,!0),o=e.sibling(i,2),_=e.only_child(o,!0),n=e.sibling(o,2),l=e.child(n),p=e.only_child(l,!0);e.reset(n),e.template_effect((u,b,w)=>{t.set_text(c,u),t.set_text(_,b),t.set_text(p,w)},[()=>r()("prizeAssignedTitle"),()=>r()("prizeAssigned"),()=>r()("backToGame")]),t.delegated("click",l,se),t.append(s,a)},ne=s=>{var a=N(),i=e.first_child(a),c=e.only_child(i,!0),o=e.sibling(i,2),_=e.only_child(o,!0),n=e.sibling(o,2),l=e.child(n),p=e.only_child(l,!0);e.reset(n),e.template_effect((u,b,w)=>{t.set_text(c,u),t.set_text(_,b),t.set_text(p,w)},[()=>r()("drawFailedTitle"),()=>r()("drawFailed"),()=>r()("backToGame")]),t.delegated("click",l,q),t.append(s,a)},oe=s=>{var a=N(),i=e.first_child(a),c=e.only_child(i,!0),o=e.sibling(i,2),_=e.only_child(o,!0),n=e.sibling(o,2),l=e.child(n),p=e.only_child(l,!0);e.reset(n),e.template_effect((u,b,w)=>{t.set_text(c,u),t.set_text(_,b),l.disabled=!!e.get(d),t.set_text(p,w)},[()=>r()("noPrizeTitle"),()=>r()("noPrize"),()=>r()(T())]),t.delegated("click",l,q),t.append(s,a)},ce=s=>{var a=ge(),i=e.first_child(a),c=e.child(i),o=e.sibling(c);t.each(o,17,()=>ee,t.index,(g,f)=>{var R=me();e.template_effect(()=>{var v,S,W,Q;return t.set_style(R,`top:${(v=e.get(f).t)!=null?v:""};left:${(S=e.get(f).l)!=null?S:""};font-size:${(W=e.get(f).s)!=null?W:""};animation-delay:${(Q=e.get(f).d)!=null?Q:""}`)}),t.append(g,R)}),e.reset(i);var _=e.sibling(i,2);t.html(_,()=>r()("success",{values:{prize:$[e.get(O)],form:D.has(e.get(O))?"plural":"singular"}}),!0),e.reset(_);var n=e.sibling(_,2),l=e.child(n),p=e.child(l);let u;var b=e.only_child(p,!0),w=e.sibling(p,2);{var A=g=>{var f=I();t.append(g,f)};t.if_block(w,g=>{e.get(d)==="claim"&&g(A)})}e.reset(l);var F=e.sibling(l,2),P=e.only_child(F,!0);e.reset(n),e.template_effect((g,f,R)=>{t.set_text(c,`${g!=null?g:""} `),l.disabled=!!e.get(d),u=t.set_style(p,"",u,{opacity:e.get(d)==="claim"?0:1}),t.set_text(b,f),F.disabled=!!e.get(d),t.set_text(P,R)},[()=>r()("congratulations"),()=>r()("claimReward"),()=>r()("reject")]),t.delegated("click",l,K),t.delegated("click",F,()=>e.set(h,"rejectModal")),t.append(s,a)},de=s=>{var a=he(),i=e.first_child(a),c=e.sibling(i,2),o=e.only_child(c,!0),_=e.sibling(c,2),n=e.child(_),l=e.only_child(n,!0);e.reset(_),e.template_effect((p,u)=>{t.set_attribute(i,"src",pe.Error),t.set_text(o,p),t.set_text(l,u)},[()=>r()("errorJSON"),()=>r()("backToGame")]),t.delegated("click",n,q),t.append(s,a)};t.if_block(ie,s=>{e.get(h)==="claimSuccess"?s(le):e.get(h)==="claimFailed"?s(ne,1):e.get(J)?s(oe,2):e.get(U)?s(de,-1):s(ce,3)})}e.reset(Z),e.reset(B),t.append(C,B);var _e=e.pop(ae);return L(),_e}t.delegate(["click"]);t.create_custom_element(V,{result:{},endpoint:{},session:{},liteMode:{},playAgainLabel:{},onFetchRemainingTimes:{}},[],[],{mode:"open"});exports.WheelOfFortuneDrawResults=V;
@@ -0,0 +1 @@
1
+ "use strict";const t=require("./WheelOfFortuneWheel-Dxh6wKCh.cjs"),e=require("./utils-DyVEmMSf.cjs"),de=require("./error-YyYl7p6_.cjs"),_e=require("./sparkles-B3XdFovy.cjs");var E=t.from_html('<span class="button-spinner"></span>'),pe=t.from_html('<div class="confirm-modal-content"><p class="confirm-modal-title"> </p> <p class="confirm-modal-body"></p> <div class="confirm-modal-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"><span> </span> <!></button></div></div>'),D=t.from_html('<h2 class="draw-result-title"> </h2> <p class="draw-result-description"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>',1),ue=t.from_html('<span class="draw-result-sparkle" aria-hidden="true">✦</span>'),me=t.from_html('<h2 class="draw-result-title"> <!></h2> <p class="draw-result-description"></p> <div class="draw-result-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"> </button></div>',1),ve=t.from_html('<img alt="Error" class="draw-result-error-image"/> <p class="draw-result-description draw-result-description--error"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>',1),ge=t.from_html('<div class="draw-result-panel"><div class="draw-result-confetti-layer"></div> <!> <div class="draw-result-stack"><!></div></div>');function J(H,b){e.push(b,!0);const r=()=>t.store_get(e.$format,"$_",K),[K,X]=t.setup_stores(),x=t.prop(b,"result",7),j=t.prop(b,"endpoint",7),F=t.prop(b,"session",7),L=t.prop(b,"liteMode",7,!1),M=t.prop(b,"playAgainLabel",7,"spinAgain"),S=t.prop(b,"onFetchRemainingTimes",7,()=>{}),O=e.user_derived(()=>x()?.success!==!0),P=e.user_derived(()=>x()?.type),q=e.user_derived(()=>e.get(P)==="noprize"),Y=new Set(["loyalty"]),Z={bonus:r()("prizeBonus"),role:r()("prizeRole"),tournament:r()("prizeTournament"),ticket:r()("prizeTicket"),loyalty:r()("prizeLoyalty"),challenge:r()("prizeChallenge"),custom:r()("prizeCustom")},Q=[{t:"-0.7em",l:"5%",s:"0.45em",d:"680ms"},{t:"-0.5em",l:"22%",s:"0.28em",d:"760ms"},{t:"-0.9em",l:"40%",s:"0.38em",d:"820ms"},{t:"-0.6em",l:"58%",s:"0.3em",d:"740ms"},{t:"-0.8em",l:"76%",s:"0.42em",d:"900ms"},{t:"-0.4em",l:"92%",s:"0.25em",d:"860ms"},{t:"0.1em",l:"14%",s:"0.22em",d:"800ms"},{t:"0em",l:"72%",s:"0.2em",d:"950ms"}];let R=e.state(void 0),m=e.state("initial"),d=e.state(null);e.user_effect(()=>{e.get(R)&&e.get(m)==="claimSuccess"&&!L()&&_e.burstSuccessConfetti(e.get(R))}),e.user_effect(()=>{(e.get(q)||e.get(O))&&e.untrack(()=>S()())});const B=s=>{const a=new URL(`${j()}/v1/wof/draw/${x().lotteryProgramID}`),i=new Headers;F()&&i.append("X-SessionId",F()),i.append("Content-Type","application/json");const c={action:s,guid:x().guid};return fetch(a,{method:"PUT",headers:i,body:JSON.stringify(c)}).then(o=>o.json())},G=async()=>{e.set(d,"claim");try{const s=await B(0),a=e.normalizeDrawResult(s,"draw"),i=a?.state==="fulfilled"&&a?.completed,c=a?.state==="drawn"&&!a?.completed;i?e.set(m,"claimSuccess"):e.set(m,"claimFailed")}catch(s){console.log(s),e.set(m,"claimFailed")}finally{e.set(d,null),S()()}},V=async()=>{e.set(d,"reject"),e.set(m,"initial");const s=S();try{window.postMessage({type:"BackToWheel",skipFetch:!0},window.location.href),await B(2),s?.()}catch(a){console.log(a)}finally{e.set(d,null)}},$=()=>{window.postMessage({type:"BackToWheel"},window.location.href)},W=()=>{window.postMessage({type:"SpinAgain"},window.location.href)};var ee={get result(){return x()},set result(s){x(s),e.flushSync()},get endpoint(){return j()},set endpoint(s){j(s),e.flushSync()},get session(){return F()},set session(s){F(s),e.flushSync()},get liteMode(){return L()},set liteMode(s=!1){L(s),e.flushSync()},get playAgainLabel(){return M()},set playAgainLabel(s="spinAgain"){M(s),e.flushSync()},get onFetchRemainingTimes(){return S()},set onFetchRemainingTimes(s=()=>{}){S(s),e.flushSync()}},C=ge(),I=e.child(C);t.bind_this(I,s=>e.set(R,s),()=>e.get(R));var N=e.sibling(I,2);{var te=s=>{var a=pe(),i=e.child(a),c=e.only_child(i,!0),o=e.sibling(i,2);t.html(o,()=>r()("rejectWarningText"),!0),e.reset(o);var _=e.sibling(o,2),n=e.child(_),l=e.child(n);let p;var u=e.only_child(l,!0),g=e.sibling(l,2);{var h=y=>{var T=E();t.append(y,T)};t.if_block(g,y=>{e.get(d)==="claim"&&y(h)})}e.reset(n);var k=e.sibling(n,2),w=e.child(k);let A;var f=e.only_child(w,!0),v=e.sibling(w,2);{var z=y=>{var T=E();t.append(y,T)};t.if_block(v,y=>{e.get(d)==="reject"&&y(z)})}e.reset(k),e.reset(_),e.reset(a),e.template_effect((y,T,ce)=>{t.set_text(c,y),n.disabled=!!e.get(d),p=t.set_style(l,"",p,{opacity:e.get(d)==="claim"?0:1}),t.set_text(u,T),k.disabled=!!e.get(d),A=t.set_style(w,"",A,{opacity:e.get(d)==="reject"?0:1}),t.set_text(f,ce)},[()=>r()("areYouSure"),()=>r()("keepPrize"),()=>r()("rejectPrize")]),t.delegated("click",n,G),t.delegated("click",k,V),t.append(s,a)};t.if_block(N,s=>{e.get(m)==="rejectModal"&&s(te)})}var U=e.sibling(N,2),se=e.child(U);{var ae=s=>{var a=D(),i=e.first_child(a),c=e.only_child(i,!0),o=e.sibling(i,2),_=e.only_child(o,!0),n=e.sibling(o,2),l=e.child(n),p=e.only_child(l,!0);e.reset(n),e.template_effect((u,g,h)=>{t.set_text(c,u),t.set_text(_,g),t.set_text(p,h)},[()=>r()("prizeAssignedTitle"),()=>r()("prizeAssigned"),()=>r()("backToGame")]),t.delegated("click",l,$),t.append(s,a)},re=s=>{var a=D(),i=e.first_child(a),c=e.only_child(i,!0),o=e.sibling(i,2),_=e.only_child(o,!0),n=e.sibling(o,2),l=e.child(n),p=e.only_child(l,!0);e.reset(n),e.template_effect((u,g,h)=>{t.set_text(c,u),t.set_text(_,g),t.set_text(p,h)},[()=>r()("drawFailedTitle"),()=>r()("drawFailed"),()=>r()("backToGame")]),t.delegated("click",l,W),t.append(s,a)},ie=s=>{var a=D(),i=e.first_child(a),c=e.only_child(i,!0),o=e.sibling(i,2),_=e.only_child(o,!0),n=e.sibling(o,2),l=e.child(n),p=e.only_child(l,!0);e.reset(n),e.template_effect((u,g,h)=>{t.set_text(c,u),t.set_text(_,g),l.disabled=!!e.get(d),t.set_text(p,h)},[()=>r()("noPrizeTitle"),()=>r()("noPrize"),()=>r()(M())]),t.delegated("click",l,W),t.append(s,a)},le=s=>{var a=me(),i=e.first_child(a),c=e.child(i),o=e.sibling(c);t.each(o,17,()=>Q,t.index,(f,v)=>{var z=ue();e.template_effect(()=>t.set_style(z,`top:${e.get(v).t??""};left:${e.get(v).l??""};font-size:${e.get(v).s??""};animation-delay:${e.get(v).d??""}`)),t.append(f,z)}),e.reset(i);var _=e.sibling(i,2);t.html(_,()=>r()("success",{values:{prize:Z[e.get(P)],form:Y.has(e.get(P))?"plural":"singular"}}),!0),e.reset(_);var n=e.sibling(_,2),l=e.child(n),p=e.child(l);let u;var g=e.only_child(p,!0),h=e.sibling(p,2);{var k=f=>{var v=E();t.append(f,v)};t.if_block(h,f=>{e.get(d)==="claim"&&f(k)})}e.reset(l);var w=e.sibling(l,2),A=e.only_child(w,!0);e.reset(n),e.template_effect((f,v,z)=>{t.set_text(c,`${f??""} `),l.disabled=!!e.get(d),u=t.set_style(p,"",u,{opacity:e.get(d)==="claim"?0:1}),t.set_text(g,v),w.disabled=!!e.get(d),t.set_text(A,z)},[()=>r()("congratulations"),()=>r()("claimReward"),()=>r()("reject")]),t.delegated("click",l,G),t.delegated("click",w,()=>e.set(m,"rejectModal")),t.append(s,a)},ne=s=>{var a=ve(),i=e.first_child(a),c=e.sibling(i,2),o=e.only_child(c,!0),_=e.sibling(c,2),n=e.child(_),l=e.only_child(n,!0);e.reset(_),e.template_effect((p,u)=>{t.set_attribute(i,"src",de.Error),t.set_text(o,p),t.set_text(l,u)},[()=>r()("errorJSON"),()=>r()("backToGame")]),t.delegated("click",n,W),t.append(s,a)};t.if_block(se,s=>{e.get(m)==="claimSuccess"?s(ae):e.get(m)==="claimFailed"?s(re,1):e.get(q)?s(ie,2):e.get(O)?s(ne,-1):s(le,3)})}e.reset(U),e.reset(C),t.append(H,C);var oe=e.pop(ee);return X(),oe}t.delegate(["click"]);t.create_custom_element(J,{result:{},endpoint:{},session:{},liteMode:{},playAgainLabel:{},onFetchRemainingTimes:{}},[],[],{mode:"open"});exports.WheelOfFortuneDrawResults=J;
@@ -0,0 +1,286 @@
1
+ var ee = (q, A, a) => new Promise((Q, H) => {
2
+ var z = (y) => {
3
+ try {
4
+ R(a.next(y));
5
+ } catch (M) {
6
+ H(M);
7
+ }
8
+ }, I = (y) => {
9
+ try {
10
+ R(a.throw(y));
11
+ } catch (M) {
12
+ H(M);
13
+ }
14
+ }, R = (y) => y.done ? Q(y.value) : Promise.resolve(y.value).then(z, I);
15
+ R((a = a.apply(q, A)).next());
16
+ });
17
+ import { d as Re, c as je, p as G, b as Le, i as N, e as w, s as Me, f as C, g as Pe, t as pe, k as d, u as Z, r as L, h as Ee, j as Ce, m as We } from "./WheelOfFortuneWheel-cBswACGf.js";
18
+ import { a5 as Be, ad as me, L as s, ae as Ge, a9 as Ue, b4 as Ie, b1 as te, bb as ae, b6 as f, b3 as l, aU as U, aJ as k, b7 as v, ba as m, ar as E, b2 as O, b9 as Je } from "./utils-DGrEJJ_K.js";
19
+ import { E as Ne } from "./error-DJgbe-Bh.js";
20
+ import { a as Oe } from "./sparkles-uxV1OTbN.js";
21
+ var se = C('<span class="button-spinner"></span>'), He = C('<div class="confirm-modal-content"><p class="confirm-modal-title"> </p> <p class="confirm-modal-body"></p> <div class="confirm-modal-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"><span> </span> <!></button></div></div>'), re = C('<h2 class="draw-result-title"> </h2> <p class="draw-result-description"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>', 1), Ke = C('<span class="draw-result-sparkle" aria-hidden="true">✦</span>'), Xe = C('<h2 class="draw-result-title"> <!></h2> <p class="draw-result-description"></p> <div class="draw-result-actions"><button class="primary-cta"><span> </span> <!></button> <button class="secondary-cta"> </button></div>', 1), Ye = C('<img alt="Error" class="draw-result-error-image"/> <p class="draw-result-description draw-result-description--error"> </p> <div class="draw-result-actions"><button class="secondary-cta"> </button></div>', 1), Ze = C('<div class="draw-result-panel"><div class="draw-result-confetti-layer"></div> <!> <div class="draw-result-stack"><!></div></div>');
22
+ function qe(q, A) {
23
+ Be(A, !0);
24
+ const a = () => Me(Ie, "$_", Q), [Q, H] = Pe(), z = G(A, "result", 7), I = G(A, "endpoint", 7), R = G(A, "session", 7), y = G(A, "liteMode", 7, !1), M = G(A, "playAgainLabel", 7, "spinAgain"), J = G(A, "onFetchRemainingTimes", 7, () => {
25
+ }), ie = ae(() => {
26
+ var e;
27
+ return ((e = z()) == null ? void 0 : e.success) !== !0;
28
+ }), V = ae(() => {
29
+ var e;
30
+ return (e = z()) == null ? void 0 : e.type;
31
+ }), ne = ae(() => s(V) === "noprize"), _e = /* @__PURE__ */ new Set(["loyalty"]), fe = {
32
+ bonus: a()("prizeBonus"),
33
+ role: a()("prizeRole"),
34
+ tournament: a()("prizeTournament"),
35
+ ticket: a()("prizeTicket"),
36
+ loyalty: a()("prizeLoyalty"),
37
+ challenge: a()("prizeChallenge"),
38
+ custom: a()("prizeCustom")
39
+ }, be = [
40
+ { t: "-0.7em", l: "5%", s: "0.45em", d: "680ms" },
41
+ { t: "-0.5em", l: "22%", s: "0.28em", d: "760ms" },
42
+ { t: "-0.9em", l: "40%", s: "0.38em", d: "820ms" },
43
+ { t: "-0.6em", l: "58%", s: "0.3em", d: "740ms" },
44
+ { t: "-0.8em", l: "76%", s: "0.42em", d: "900ms" },
45
+ { t: "-0.4em", l: "92%", s: "0.25em", d: "860ms" },
46
+ { t: "0.1em", l: "14%", s: "0.22em", d: "800ms" },
47
+ { t: "0em", l: "72%", s: "0.2em", d: "950ms" }
48
+ ];
49
+ let K = te(void 0), x = te("initial"), u = te(null);
50
+ me(() => {
51
+ s(K) && s(x) === "claimSuccess" && !y() && Oe(s(K));
52
+ }), me(() => {
53
+ (s(ne) || s(ie)) && Ge(() => J()());
54
+ });
55
+ const le = (e) => {
56
+ const t = new URL(`${I()}/v1/wof/draw/${z().lotteryProgramID}`), r = new Headers();
57
+ R() && r.append("X-SessionId", R()), r.append("Content-Type", "application/json");
58
+ const c = { action: e, guid: z().guid };
59
+ return fetch(t, { method: "PUT", headers: r, body: JSON.stringify(c) }).then((o) => o.json());
60
+ }, oe = () => ee(this, null, function* () {
61
+ k(u, "claim");
62
+ try {
63
+ const e = yield le(0), t = Je(e, "draw"), r = (t == null ? void 0 : t.state) === "fulfilled" && (t == null ? void 0 : t.completed), c = (t == null ? void 0 : t.state) === "drawn" && !(t != null && t.completed);
64
+ r ? k(x, "claimSuccess") : c ? k(x, "claimFailed") : k(x, "claimFailed");
65
+ } catch (e) {
66
+ console.log(e), k(x, "claimFailed");
67
+ } finally {
68
+ k(u, null), J()();
69
+ }
70
+ }), ge = () => ee(this, null, function* () {
71
+ k(u, "reject"), k(x, "initial");
72
+ const e = J();
73
+ try {
74
+ window.postMessage({ type: "BackToWheel", skipFetch: !0 }, window.location.href), yield le(2), e == null || e();
75
+ } catch (t) {
76
+ console.log(t);
77
+ } finally {
78
+ k(u, null);
79
+ }
80
+ }), ye = () => {
81
+ window.postMessage({ type: "BackToWheel" }, window.location.href);
82
+ }, D = () => {
83
+ window.postMessage({ type: "SpinAgain" }, window.location.href);
84
+ };
85
+ var he = {
86
+ get result() {
87
+ return z();
88
+ },
89
+ set result(e) {
90
+ z(e), U();
91
+ },
92
+ get endpoint() {
93
+ return I();
94
+ },
95
+ set endpoint(e) {
96
+ I(e), U();
97
+ },
98
+ get session() {
99
+ return R();
100
+ },
101
+ set session(e) {
102
+ R(e), U();
103
+ },
104
+ get liteMode() {
105
+ return y();
106
+ },
107
+ set liteMode(e = !1) {
108
+ y(e), U();
109
+ },
110
+ get playAgainLabel() {
111
+ return M();
112
+ },
113
+ set playAgainLabel(e = "spinAgain") {
114
+ M(e), U();
115
+ },
116
+ get onFetchRemainingTimes() {
117
+ return J();
118
+ },
119
+ set onFetchRemainingTimes(e = () => {
120
+ }) {
121
+ J(e), U();
122
+ }
123
+ }, $ = Ze(), ce = f($);
124
+ Le(ce, (e) => k(K, e), () => s(K));
125
+ var de = l(ce, 2);
126
+ {
127
+ var we = (e) => {
128
+ var t = He(), r = f(t), c = v(r, !0), o = l(r, 2);
129
+ pe(o, () => a()("rejectWarningText"), !0), m(o);
130
+ var p = l(o, 2), n = f(p), i = f(n);
131
+ let _;
132
+ var b = v(i, !0), S = l(i, 2);
133
+ {
134
+ var F = (g) => {
135
+ var j = se();
136
+ w(g, j);
137
+ };
138
+ N(S, (g) => {
139
+ s(u) === "claim" && g(F);
140
+ });
141
+ }
142
+ m(n);
143
+ var W = l(n, 2), P = f(W);
144
+ let X;
145
+ var h = v(P, !0), T = l(P, 2);
146
+ {
147
+ var B = (g) => {
148
+ var j = se();
149
+ w(g, j);
150
+ };
151
+ N(T, (g) => {
152
+ s(u) === "reject" && g(B);
153
+ });
154
+ }
155
+ m(W), m(p), m(t), E(
156
+ (g, j, Y) => {
157
+ d(c, g), n.disabled = !!s(u), _ = Z(i, "", _, { opacity: s(u) === "claim" ? 0 : 1 }), d(b, j), W.disabled = !!s(u), X = Z(P, "", X, { opacity: s(u) === "reject" ? 0 : 1 }), d(h, Y);
158
+ },
159
+ [
160
+ () => a()("areYouSure"),
161
+ () => a()("keepPrize"),
162
+ () => a()("rejectPrize")
163
+ ]
164
+ ), L("click", n, oe), L("click", W, ge), w(e, t);
165
+ };
166
+ N(de, (e) => {
167
+ s(x) === "rejectModal" && e(we);
168
+ });
169
+ }
170
+ var ve = l(de, 2), ke = f(ve);
171
+ {
172
+ var xe = (e) => {
173
+ var t = re(), r = O(t), c = v(r, !0), o = l(r, 2), p = v(o, !0), n = l(o, 2), i = f(n), _ = v(i, !0);
174
+ m(n), E(
175
+ (b, S, F) => {
176
+ d(c, b), d(p, S), d(_, F);
177
+ },
178
+ [
179
+ () => a()("prizeAssignedTitle"),
180
+ () => a()("prizeAssigned"),
181
+ () => a()("backToGame")
182
+ ]
183
+ ), L("click", i, ye), w(e, t);
184
+ }, Te = (e) => {
185
+ var t = re(), r = O(t), c = v(r, !0), o = l(r, 2), p = v(o, !0), n = l(o, 2), i = f(n), _ = v(i, !0);
186
+ m(n), E(
187
+ (b, S, F) => {
188
+ d(c, b), d(p, S), d(_, F);
189
+ },
190
+ [
191
+ () => a()("drawFailedTitle"),
192
+ () => a()("drawFailed"),
193
+ () => a()("backToGame")
194
+ ]
195
+ ), L("click", i, D), w(e, t);
196
+ }, Ae = (e) => {
197
+ var t = re(), r = O(t), c = v(r, !0), o = l(r, 2), p = v(o, !0), n = l(o, 2), i = f(n), _ = v(i, !0);
198
+ m(n), E(
199
+ (b, S, F) => {
200
+ d(c, b), d(p, S), i.disabled = !!s(u), d(_, F);
201
+ },
202
+ [
203
+ () => a()("noPrizeTitle"),
204
+ () => a()("noPrize"),
205
+ () => a()(M())
206
+ ]
207
+ ), L("click", i, D), w(e, t);
208
+ }, Se = (e) => {
209
+ var t = Xe(), r = O(t), c = f(r), o = l(c);
210
+ Ee(o, 17, () => be, Ce, (h, T) => {
211
+ var B = Ke();
212
+ E(() => {
213
+ var g, j, Y, ue;
214
+ return Z(B, `top:${(g = s(T).t) != null ? g : ""};left:${(j = s(T).l) != null ? j : ""};font-size:${(Y = s(T).s) != null ? Y : ""};animation-delay:${(ue = s(T).d) != null ? ue : ""}`);
215
+ }), w(h, B);
216
+ }), m(r);
217
+ var p = l(r, 2);
218
+ pe(
219
+ p,
220
+ () => a()("success", {
221
+ values: {
222
+ prize: fe[s(V)],
223
+ form: _e.has(s(V)) ? "plural" : "singular"
224
+ }
225
+ }),
226
+ !0
227
+ ), m(p);
228
+ var n = l(p, 2), i = f(n), _ = f(i);
229
+ let b;
230
+ var S = v(_, !0), F = l(_, 2);
231
+ {
232
+ var W = (h) => {
233
+ var T = se();
234
+ w(h, T);
235
+ };
236
+ N(F, (h) => {
237
+ s(u) === "claim" && h(W);
238
+ });
239
+ }
240
+ m(i);
241
+ var P = l(i, 2), X = v(P, !0);
242
+ m(n), E(
243
+ (h, T, B) => {
244
+ d(c, `${h != null ? h : ""} `), i.disabled = !!s(u), b = Z(_, "", b, { opacity: s(u) === "claim" ? 0 : 1 }), d(S, T), P.disabled = !!s(u), d(X, B);
245
+ },
246
+ [
247
+ () => a()("congratulations"),
248
+ () => a()("claimReward"),
249
+ () => a()("reject")
250
+ ]
251
+ ), L("click", i, oe), L("click", P, () => k(x, "rejectModal")), w(e, t);
252
+ }, Fe = (e) => {
253
+ var t = Ye(), r = O(t), c = l(r, 2), o = v(c, !0), p = l(c, 2), n = f(p), i = v(n, !0);
254
+ m(p), E(
255
+ (_, b) => {
256
+ We(r, "src", Ne), d(o, _), d(i, b);
257
+ },
258
+ [() => a()("errorJSON"), () => a()("backToGame")]
259
+ ), L("click", n, D), w(e, t);
260
+ };
261
+ N(ke, (e) => {
262
+ s(x) === "claimSuccess" ? e(xe) : s(x) === "claimFailed" ? e(Te, 1) : s(ne) ? e(Ae, 2) : s(ie) ? e(Fe, -1) : e(Se, 3);
263
+ });
264
+ }
265
+ m(ve), m($), w(q, $);
266
+ var ze = Ue(he);
267
+ return H(), ze;
268
+ }
269
+ Re(["click"]);
270
+ je(
271
+ qe,
272
+ {
273
+ result: {},
274
+ endpoint: {},
275
+ session: {},
276
+ liteMode: {},
277
+ playAgainLabel: {},
278
+ onFetchRemainingTimes: {}
279
+ },
280
+ [],
281
+ [],
282
+ { mode: "open" }
283
+ );
284
+ export {
285
+ qe as W
286
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";const t=require("./WheelOfFortuneWheel-CvGaRYgu.cjs"),e=require("./utils-BxNmJ6YA.cjs");var ye=t.from_html('<div class="lucky-wheel-history-item history-grid history-skeleton-row svelte-4la0az" aria-hidden="true"><p class="svelte-4la0az"><span class="history-skeleton-bar svelte-4la0az"></span></p> <p class="svelte-4la0az"><span class="history-skeleton-bar history-skeleton-bar--name svelte-4la0az">&nbsp;</span></p> <div class="date-time-cell svelte-4la0az"><span class="history-skeleton-bar svelte-4la0az">Oct 00, 0000</span> <span class="history-skeleton-bar svelte-4la0az">00:00:00</span></div> <div class="history-icon svelte-4la0az"><span class="history-skeleton-bar history-skeleton-bar--icon svelte-4la0az"></span></div> <div class="history-icon svelte-4la0az"><span class="history-skeleton-bar history-skeleton-bar--icon svelte-4la0az"></span></div></div>'),be=t.from_html('<div class="lucky-wheel-history-header history-grid svelte-4la0az"><p class="svelte-4la0az">#</p> <p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p></div> <!>',1),V=t.from_svg('<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-4la0az"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.3977 2.60225C10.6174 2.82192 10.6174 3.17808 10.3977 3.39775L4.89775 8.89775C4.67808 9.11742 4.32192 9.11742 4.10225 8.89775L1.60225 6.39775C1.38258 6.17808 1.38258 5.82192 1.60225 5.60225C1.82192 5.38258 2.17808 5.38258 2.39775 5.60225L4.5 7.7045L9.60225 2.60225C9.82192 2.38258 10.1781 2.38258 10.3977 2.60225Z" fill="#29CF00" class="svelte-4la0az"></path></svg>'),ee=t.from_svg('<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-4la0az"><path d="M6.73367 6.0952L9.82534 3.0327C9.92639 2.92941 9.98768 2.79371 9.99835 2.6496C10.009 2.50549 9.96841 2.36225 9.88367 2.2452C9.83646 2.1749 9.77377 2.11636 9.70041 2.07407C9.62705 2.03178 9.54498 2.00686 9.46049 2.00123C9.376 1.99559 9.29135 2.0094 9.21302 2.04158C9.1347 2.07376 9.06479 2.12346 9.00867 2.18686L5.91701 5.27853L2.82534 2.18686C2.76922 2.12346 2.69931 2.07376 2.62099 2.04158C2.54266 2.0094 2.45801 1.99559 2.37352 2.00123C2.28903 2.00686 2.20696 2.03178 2.1336 2.07407C2.06024 2.11636 1.99755 2.1749 1.95034 2.2452C1.8656 2.36225 1.82498 2.50549 1.83566 2.6496C1.84633 2.79371 1.90762 2.92941 2.00867 3.0327L5.10034 6.0952L2.00867 9.1577C1.90762 9.26099 1.84633 9.39668 1.83566 9.54079C1.82498 9.6849 1.8656 9.82814 1.95034 9.9452C1.99755 10.0155 2.06024 10.074 2.1336 10.1163C2.20696 10.1586 2.28903 10.1835 2.37352 10.1892C2.45801 10.1948 2.54266 10.181 2.62099 10.1488C2.69931 10.1166 2.76922 10.0669 2.82534 10.0035L5.91701 6.91186L9.00867 10.0035C9.06479 10.0669 9.1347 10.1166 9.21302 10.1488C9.29135 10.181 9.376 10.1948 9.46049 10.1892C9.54498 10.1835 9.62705 10.1586 9.70041 10.1163C9.77377 10.074 9.83646 10.0155 9.88367 9.9452C9.96841 9.82814 10.009 9.6849 9.99835 9.54079C9.98768 9.39668 9.92639 9.26099 9.82534 9.1577L6.73367 6.0952Z" fill="#EB0000" class="svelte-4la0az"></path></svg>'),ze=t.from_html('<div class="lucky-wheel-history-item history-grid svelte-4la0az"><p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p> <div class="date-time-cell svelte-4la0az"><span class="svelte-4la0az"> </span> <span class="svelte-4la0az"> </span></div> <div class="history-icon svelte-4la0az"><!></div> <div class="history-icon svelte-4la0az"><!></div></div>'),we=t.from_html('<span class="pagination-ellipsis svelte-4la0az">&hellip;</span>'),ke=t.from_html("<button> </button>"),Ce=t.from_html('<div class="lucky-wheel-pagination svelte-4la0az"><button class="pagination-button pagination-nav svelte-4la0az">&#8249;</button> <div class="pagination-pages svelte-4la0az"></div> <button class="pagination-button pagination-nav svelte-4la0az">&#8250;</button></div>'),Le=t.from_html('<div class="lucky-wheel-history-header history-grid svelte-4la0az"><p class="svelte-4la0az">#</p> <p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p> <p class="svelte-4la0az"> </p></div> <!> <!>',1),Te=t.from_html('<h2 class="no-history svelte-4la0az"> </h2>'),Ee=t.from_html('<div class="history-list svelte-4la0az"><!></div>');const He={hash:"svelte-4la0az",code:`.svelte-4la0az,
2
+ .svelte-4la0az::before,
3
+ .svelte-4la0az::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.history-list.svelte-4la0az {display:flex;flex-direction:column;gap:6px;width:100%;max-width:700px;margin:0 auto;}.history-grid.svelte-4la0az {display:grid;grid-template-columns:28px 1fr 1fr 44px 60px;align-items:center;gap:8px;}.date-time-cell.svelte-4la0az {display:flex;flex-direction:column;gap:2px;}.date-time-cell.svelte-4la0az span:where(.svelte-4la0az):last-child {opacity:0.6;font-size:10px;}.lucky-wheel-history-item.svelte-4la0az {width:100%;border:1px solid var(--color-border-subtle, rgba(251, 251, 251, 0.0509803922));border-radius:6px;padding:8px 12px;background-color:var(--color-overlay-neutral-1, rgba(251, 251, 251, 0.1019607843));color:var(--color-text-default, #ffffff);font-size:12px;}.lucky-wheel-history-header.svelte-4la0az {width:100%;padding:6px 12px;color:var(--color-text-default, #ffffff);opacity:0.6;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;}.history-icon.svelte-4la0az {display:flex;align-items:center;justify-content:center;}.no-history.svelte-4la0az {width:100%;font-size:14px;font-weight:400;margin-top:12px;}.lucky-wheel-pagination.svelte-4la0az {display:flex;align-items:center;justify-content:center;gap:6px;width:100%;margin-top:8px;}.pagination-pages.svelte-4la0az {display:flex;align-items:center;gap:4px;}.pagination-ellipsis.svelte-4la0az {color:var(--color-text-default, #ffffff);padding:0 2px;user-select:none;opacity:0.6;font-size:14px;line-height:32px;}.pagination-button.svelte-4la0az {border:1px solid var(--color-border-subtle, rgba(251, 251, 251, 0.0509803922));border-radius:6px;padding:6px 10px;background-color:var(--color-overlay-neutral-1, rgba(251, 251, 251, 0.1019607843));color:var(--color-text-default, #ffffff);cursor:pointer;transition:background-color 0.15s ease;font-size:13px;line-height:1;}.pagination-button.svelte-4la0az:hover:not(:disabled) {background-color:var(--color-overlay-neutral-2, rgba(251, 251, 251, 0.2));}.pagination-button.svelte-4la0az:disabled {opacity:0.4;cursor:not-allowed;}.pagination-page.svelte-4la0az {min-width:32px;text-align:center;padding:6px 8px;}.pagination-nav.svelte-4la0az {min-width:32px;text-align:center;font-size:16px;padding:4px 8px;flex-shrink:0;}.pagination-page.active.svelte-4la0az {background-color:var(--color-overlay-neutral-2, rgba(251, 251, 251, 0.2));border-color:var(--color-text-default, #ffffff);font-weight:600;}
4
+
5
+ @keyframes svelte-4la0az-skeleton-pulse {
6
+ 0%, 100% {
7
+ opacity: 0.3;
8
+ }
9
+ 50% {
10
+ opacity: 0.6;
11
+ }
12
+ }.history-skeleton-row.svelte-4la0az {pointer-events:none;
13
+ animation: svelte-4la0az-skeleton-pulse 1.4s ease-in-out infinite;}.history-skeleton-bar.svelte-4la0az {display:inline-block;max-width:100%;border-radius:4px;background-color:var(--color-overlay-neutral-2, rgba(251, 251, 251, 0.2));color:transparent;user-select:none;}.history-skeleton-bar--name.svelte-4la0az {width:70%;}.history-skeleton-bar--icon.svelte-4la0az {width:12px;height:12px;}`};function te(N,S){e.push(S,!0),t.append_styles(N,He);const s=()=>t.store_get(e.$format,"$_",ae),[ae,le]=t.setup_stores(),Z=t.prop(S,"programId",7),q=t.prop(S,"endpoint",7),F=t.prop(S,"session",7);let W=e.state(!0),c=e.state(e.proxy([])),se=e.state(!1);const T=10;let v=e.state(1);const P=e.user_derived(()=>e.get(c)&&e.get(c).length>0?Math.ceil(e.get(c).length/T):1),ie=e.user_derived(()=>e.get(c)&&e.get(c).length>0?e.get(c).slice((e.get(v)-1)*T,e.get(v)*T):[]),oe={bonus:s()("prizeBonus"),role:s()("prizeRole"),tournament:s()("prizeTournament"),ticket:s()("prizeTicket"),loyalty:s()("prizeLoyalty"),challenge:s()("prizeChallenge"),noprize:s()("noWin"),custom:s()("prizeCustom")},re=e.user_derived(()=>{const a=e.get(P);if(a<=5)return Array.from({length:a},(n,d)=>d+1);const l=[],o=e.get(v);l.push(1),o>3&&l.push("...");const r=Math.max(2,o-1),y=Math.min(a-1,o+1);for(let n=r;n<=y;n++)l.push(n);return o<a-2&&l.push("..."),a>1&&l.push(a),l});let G=e.state(void 0);const ne=()=>{var a;for(let l=(a=e.get(G))==null?void 0:a.parentElement;l;l=l.parentElement){const{overflowY:o}=getComputedStyle(l);(o==="auto"||o==="scroll")&&l.scrollHeight>l.clientHeight&&l.scrollTo({top:0,behavior:"smooth"})}window.scrollTo({top:0,behavior:"smooth"})},U=a=>{a<1||a>e.get(P)||(e.set(v,a,!0),ne())},pe=()=>{e.set(W,!0);const a=new URL(`${q()}/v1/wof/outcome/${Z()}`),l=new Headers;F()&&l.append("X-SessionId",F()),fetch(a,{method:"GET",headers:l,cache:"no-store"}).then(r=>r.json()).then(r=>{e.set(c,r==null?void 0:r.items.map(y=>e.normalizeDrawResult(y,"history")),!0),e.set(v,1)}).catch(r=>{console.log(r),e.set(se,!0)}).finally(()=>e.set(W,!1))};t.onMount(()=>{pe()});var ve={get programId(){return Z()},set programId(a){Z(a),e.flushSync()},get endpoint(){return q()},set endpoint(a){q(a),e.flushSync()},get session(){return F()},set session(a){F(a),e.flushSync()}},E=Ee(),ce=e.child(E);{var de=a=>{var l=be(),o=e.first_child(l),r=e.sibling(e.child(o),2),y=e.only_child(r,!0),n=e.sibling(r,2),d=e.only_child(n,!0),_=e.sibling(n,2),z=e.only_child(_,!0),X=e.sibling(_,2),R=e.only_child(X,!0);e.reset(o);var Y=e.sibling(o,2);t.each(Y,17,()=>Array(T),t.index,(w,B,H,O)=>{var k=ye(),j=e.child(k),$=e.child(j);$.textContent=`${H+1}.`,e.reset(j),e.next(8),e.reset(k),t.append(w,k)}),e.template_effect((w,B,H,O)=>{t.set_text(y,w),t.set_text(d,B),t.set_text(z,H),t.set_text(R,O)},[()=>s()("name"),()=>s()("date"),()=>s()("spin"),()=>s()("assigned")]),t.append(a,l)},ge=a=>{var l=t.comment(),o=e.first_child(l);{var r=n=>{var d=Le(),_=e.first_child(d),z=e.sibling(e.child(_),2),X=e.only_child(z,!0),R=e.sibling(z,2),Y=e.only_child(R,!0),w=e.sibling(R,2),B=e.only_child(w,!0),H=e.sibling(w,2),O=e.only_child(H,!0);e.reset(_);var k=e.sibling(_,2);t.each(k,17,()=>e.get(ie),t.index,(b,p,u)=>{var g=ze(),C=e.child(g),I=e.only_child(C),h=e.sibling(C,2),A=e.only_child(h,!0),M=e.sibling(h,2),D=e.child(M),J=e.only_child(D,!0),m=e.sibling(D,2),x=e.only_child(m,!0);e.reset(M);var L=e.sibling(M,2),K=e.child(L);{var fe=i=>{var f=V();t.append(i,f)},_e=i=>{var f=ee();t.append(i,f)};t.if_block(K,i=>{e.get(p).state==="drawn"||e.get(p).state==="fulfilled"?i(fe):i(_e,-1)})}e.reset(L);var Q=e.sibling(L,2),ue=e.child(Q);{var me=i=>{var f=V();t.append(i,f)},xe=i=>{var f=ee();t.append(i,f)};t.if_block(ue,i=>{e.get(p).completed&&e.get(p).state==="fulfilled"?i(me):i(xe,-1)})}e.reset(Q),e.reset(g),e.template_effect((i,f)=>{t.set_text(I,`${(e.get(v)-1)*T+u+1}.`),t.set_text(A,oe[e.get(p).type]||"-"),t.set_text(J,i),t.set_text(x,f)},[()=>e.formatDateTimeForHistory(e.get(p).time).date,()=>e.formatDateTimeForHistory(e.get(p).time).time]),t.append(b,g)});var j=e.sibling(k,2);{var $=b=>{var p=Ce(),u=e.child(p),g=e.sibling(u,2);t.each(g,21,()=>e.get(re),t.index,(I,h)=>{var A=t.comment(),M=e.first_child(A);{var D=m=>{var x=we();t.append(m,x)},J=m=>{var x=ke();let L;var K=e.only_child(x,!0);e.template_effect(()=>{L=t.set_class(x,1,"pagination-button pagination-page svelte-4la0az",null,L,{active:e.get(v)===e.get(h)}),t.set_text(K,e.get(h))}),t.delegated("click",x,()=>U(e.get(h))),t.append(m,x)};t.if_block(M,m=>{e.get(h)==="..."?m(D):m(J,-1)})}t.append(I,A)}),e.reset(g);var C=e.sibling(g,2);e.reset(p),e.template_effect((I,h)=>{u.disabled=e.get(v)===1,t.set_attribute(u,"aria-label",I),C.disabled=e.get(v)===e.get(P),t.set_attribute(C,"aria-label",h)},[()=>s()("previous"),()=>s()("next")]),t.delegated("click",u,()=>U(e.get(v)-1)),t.delegated("click",C,()=>U(e.get(v)+1)),t.append(b,p)};t.if_block(j,b=>{e.get(P)>1&&b($)})}e.template_effect((b,p,u,g)=>{t.set_text(X,b),t.set_text(Y,p),t.set_text(B,u),t.set_text(O,g)},[()=>s()("name"),()=>s()("date"),()=>s()("spin"),()=>s()("assigned")]),t.append(n,d)},y=n=>{var d=Te(),_=e.only_child(d,!0);e.template_effect(z=>t.set_text(_,z),[()=>s()("noHistory")]),t.append(n,d)};t.if_block(o,n=>{e.get(c)&&e.get(c).length>0?n(r):n(y,-1)})}t.append(a,l)};t.if_block(ce,a=>{e.get(W)?a(de):a(ge,-1)})}e.reset(E),t.bind_this(E,a=>e.set(G,a),()=>e.get(G)),e.template_effect(()=>t.set_attribute(E,"aria-busy",e.get(W))),t.append(N,E);var he=e.pop(ve);return le(),he}t.delegate(["click"]);t.create_custom_element(te,{programId:{},endpoint:{},session:{}},[],[],{mode:"open"});exports.WheelOfFortuneHistory=te;