@everymatrix/player-account-biometrics 1.87.19 → 1.87.21

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.
@@ -0,0 +1,403 @@
1
+ var O = (i, e, t) => new Promise((r, s) => {
2
+ var n = (c) => {
3
+ try {
4
+ l(t.next(c));
5
+ } catch (u) {
6
+ s(u);
7
+ }
8
+ }, o = (c) => {
9
+ try {
10
+ l(t.throw(c));
11
+ } catch (u) {
12
+ s(u);
13
+ }
14
+ }, l = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(n, o);
15
+ l((t = t.apply(i, e)).next());
16
+ });
17
+ import { a as P, $ as K, S as G, i as W, s as F, f, b as J, n as I, d as w, c as k, e as Q, g as V, o as Y, h as y, j as Z, k as $, l as z, m as X, t as ee, p as D, q as p, r as te, u as ie, v as se, w as re, x as ne } from "./PlayerAccountBiometrics-BSpoxpYK.js";
18
+ function oe(i, e) {
19
+ P(i, e);
20
+ }
21
+ function ae(i) {
22
+ K.set(i);
23
+ }
24
+ const le = {
25
+ en: {
26
+ btnEnableBiometrics: "Enable biometrics",
27
+ btnDisableBiometrics: "Disable biometrics",
28
+ errorMessage: "Biometrics update failed"
29
+ },
30
+ "zh-hk": {
31
+ btnEnableBiometrics: "Enable biometrics",
32
+ btnDisableBiometrics: "Disable biometrics",
33
+ errorMessage: "Biometrics update failed"
34
+ },
35
+ fr: {
36
+ btnEnableBiometrics: "Enable biometrics",
37
+ btnDisableBiometrics: "Disable biometrics",
38
+ errorMessage: "Biometrics update failed"
39
+ },
40
+ tr: {
41
+ btnEnableBiometrics: "Enable biometrics",
42
+ btnDisableBiometrics: "Disable biometrics",
43
+ errorMessage: "Biometrics update failed"
44
+ },
45
+ ro: {
46
+ btnEnableBiometrics: "Enable biometrics",
47
+ btnDisableBiometrics: "Disable biometrics",
48
+ errorMessage: "Biometrics update failed"
49
+ },
50
+ es: {
51
+ btnEnableBiometrics: "Enable biometrics",
52
+ btnDisableBiometrics: "Disable biometrics",
53
+ errorMessage: "Biometrics update failed"
54
+ },
55
+ pt: {
56
+ btnEnableBiometrics: "Enable biometrics",
57
+ btnDisableBiometrics: "Disable biometrics",
58
+ errorMessage: "Biometrics update failed"
59
+ },
60
+ hr: {
61
+ btnEnableBiometrics: "Omogući biometriju",
62
+ btnDisableBiometrics: "Onemogući biometriju",
63
+ errorMessage: "Biometrics update failed"
64
+ },
65
+ "pt-br": {
66
+ btnEnableBiometrics: "Enable biometrics",
67
+ btnDisableBiometrics: "Disable biometrics",
68
+ errorMessage: "Biometrics update failed"
69
+ },
70
+ "es-mx": {
71
+ btnEnableBiometrics: "Enable biometrics",
72
+ btnDisableBiometrics: "Disable biometrics",
73
+ errorMessage: "Biometrics update failed"
74
+ },
75
+ "en-us": {
76
+ btnEnableBiometrics: "Enable biometrics",
77
+ btnDisableBiometrics: "Disable biometrics",
78
+ errorMessage: "Biometrics update failed"
79
+ }
80
+ };
81
+ function ce(i, e, t) {
82
+ return window.emMessageBus && (e = window.emMessageBus.subscribe(i, t)), e;
83
+ }
84
+ function be(i) {
85
+ J(i, "svelte-4r3z7g", '*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.toggle-content{display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:transparent;border:none;border-radius:20px;cursor:pointer;gap:10px}.toggle-content:disabled{cursor:not-allowed}.toggle-content .skip-switch{display:inline-flex;align-items:center;position:relative;height:20px;vertical-align:middle;transition:opacity 0.2s}.toggle-content .skip-switch.disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.toggle-content .skip-switch.checked .skip-switch-core{border-color:var(--emw--color-primary, #22b04e);background:var(--emw--color-primary, #22b04e)}.toggle-content .skip-switch.checked .skip-switch-core::after{transform:translateX(14px)}.toggle-content .skip-switch .skip-switch-input{position:absolute;width:0;height:0;opacity:0;margin:0}.toggle-content .skip-switch .skip-switch-core{width:34px;height:20px;border-radius:20px;border:1px solid var(--emw--color-gray-300, #ababab);background:var(--emw--color-gray-300, #ababab);position:relative;cursor:pointer;transition:background-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1)}.toggle-content .skip-switch .skip-switch-core::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;background:#fff;border-radius:50%;transform:translateX(0);transition:transform 0.25s cubic-bezier(0.22, 1, 0.36, 1)}.skip-switch.shake{animation:shake 0.4s ease}@keyframes shake{0%{transform:translateX(0)}20%{transform:translateX(-3px)}40%{transform:translateX(3px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}100%{transform:translateX(0)}}.BiometricsToggle{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));color:var(--emw--button-typography, var(--emw--color-white, #ffffff));cursor:pointer;border-radius:5px;width:100%;height:50px;display:flex;align-items:center;justify-content:center;font-size:16px;text-transform:uppercase;transition-duration:0.3s;box-sizing:border-box}.BiometricsToggle:disabled{opacity:0.6;cursor:not-allowed}');
86
+ }
87
+ function R(i) {
88
+ let e;
89
+ function t(n, o) {
90
+ if (
91
+ /*mode*/
92
+ n[1] === "button"
93
+ )
94
+ return ue;
95
+ if (
96
+ /*mode*/
97
+ n[1] === "switch"
98
+ )
99
+ return me;
100
+ }
101
+ let r = t(i), s = r && r(i);
102
+ return {
103
+ c() {
104
+ e = y("div"), s && s.c();
105
+ },
106
+ m(n, o) {
107
+ k(n, e, o), s && s.m(e, null), i[15](e);
108
+ },
109
+ p(n, o) {
110
+ r === (r = t(n)) && s ? s.p(n, o) : (s && s.d(1), s = r && r(n), s && (s.c(), s.m(e, null)));
111
+ },
112
+ d(n) {
113
+ n && w(e), s && s.d(), i[15](null);
114
+ }
115
+ };
116
+ }
117
+ function me(i) {
118
+ let e, t, r, s;
119
+ return {
120
+ c() {
121
+ e = y("button"), t = y("div"), t.innerHTML = '<input type="checkbox" class="skip-switch-input"/> <span class="skip-switch-core"></span>', D(t, "class", "skip-switch"), p(
122
+ t,
123
+ "checked",
124
+ /*biometricsEnabled*/
125
+ i[3]
126
+ ), p(
127
+ t,
128
+ "disabled",
129
+ /*isUpdatingBiometrics*/
130
+ i[4]
131
+ ), p(
132
+ t,
133
+ "shake",
134
+ /*shake*/
135
+ i[5]
136
+ ), D(e, "class", "toggle-content"), e.disabled = /*isUpdatingBiometrics*/
137
+ i[4];
138
+ },
139
+ m(n, o) {
140
+ k(n, e, o), z(e, t), r || (s = X(
141
+ e,
142
+ "click",
143
+ /*toggleBiometrics*/
144
+ i[7]
145
+ ), r = !0);
146
+ },
147
+ p(n, o) {
148
+ o & /*biometricsEnabled*/
149
+ 8 && p(
150
+ t,
151
+ "checked",
152
+ /*biometricsEnabled*/
153
+ n[3]
154
+ ), o & /*isUpdatingBiometrics*/
155
+ 16 && p(
156
+ t,
157
+ "disabled",
158
+ /*isUpdatingBiometrics*/
159
+ n[4]
160
+ ), o & /*shake*/
161
+ 32 && p(
162
+ t,
163
+ "shake",
164
+ /*shake*/
165
+ n[5]
166
+ ), o & /*isUpdatingBiometrics*/
167
+ 16 && (e.disabled = /*isUpdatingBiometrics*/
168
+ n[4]);
169
+ },
170
+ d(n) {
171
+ n && w(e), r = !1, s();
172
+ }
173
+ };
174
+ }
175
+ function ue(i) {
176
+ let e, t = (
177
+ /*biometricsEnabled*/
178
+ (i[3] ? (
179
+ /*$_*/
180
+ i[6]("btnDisableBiometrics")
181
+ ) : (
182
+ /*$_*/
183
+ i[6]("btnEnableBiometrics")
184
+ )) + ""
185
+ ), r, s, n;
186
+ return {
187
+ c() {
188
+ e = y("button"), r = ee(t), D(e, "class", "BiometricsToggle"), e.disabled = /*isUpdatingBiometrics*/
189
+ i[4];
190
+ },
191
+ m(o, l) {
192
+ k(o, e, l), z(e, r), s || (n = X(
193
+ e,
194
+ "click",
195
+ /*click_handler*/
196
+ i[14]
197
+ ), s = !0);
198
+ },
199
+ p(o, l) {
200
+ l & /*biometricsEnabled, $_*/
201
+ 72 && t !== (t = /*biometricsEnabled*/
202
+ (o[3] ? (
203
+ /*$_*/
204
+ o[6]("btnDisableBiometrics")
205
+ ) : (
206
+ /*$_*/
207
+ o[6]("btnEnableBiometrics")
208
+ )) + "") && $(r, t), l & /*isUpdatingBiometrics*/
209
+ 16 && (e.disabled = /*isUpdatingBiometrics*/
210
+ o[4]);
211
+ },
212
+ d(o) {
213
+ o && w(e), s = !1, n();
214
+ }
215
+ };
216
+ }
217
+ function de(i) {
218
+ let e, t = (
219
+ /*isNativeApp*/
220
+ i[0] && R(i)
221
+ );
222
+ return {
223
+ c() {
224
+ t && t.c(), e = Q();
225
+ },
226
+ m(r, s) {
227
+ t && t.m(r, s), k(r, e, s);
228
+ },
229
+ p(r, [s]) {
230
+ /*isNativeApp*/
231
+ r[0] ? t ? t.p(r, s) : (t = R(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
232
+ },
233
+ i: I,
234
+ o: I,
235
+ d(r) {
236
+ r && w(e), t && t.d(r);
237
+ }
238
+ };
239
+ }
240
+ function fe(i, e, t) {
241
+ let r;
242
+ V(i, ne, (a) => t(6, r = a));
243
+ let { lang: s = "en" } = e, { clientstyling: n = "" } = e, { clientstylingurl: o = "" } = e, { mbsource: l } = e, { translationurl: c = "" } = e, { isNativeApp: u = !1 } = e, { mode: M = "button" } = e, m, h, d = null, B = !1, g = !1;
244
+ const E = (a) => {
245
+ Object.keys(a).forEach((b) => {
246
+ oe(b, a[b]);
247
+ });
248
+ }, j = () => {
249
+ fetch(c).then((b) => b.json()).then((b) => {
250
+ E(b);
251
+ }).catch((b) => {
252
+ console.log(b);
253
+ });
254
+ };
255
+ E(le);
256
+ const C = () => {
257
+ ae(s);
258
+ }, S = {
259
+ BIOMETRICS_RESPONSE: 3e3,
260
+ SHAKE_DURATION: 500
261
+ };
262
+ let _ = !1;
263
+ const L = () => {
264
+ t(5, _ = !0), setTimeout(
265
+ () => {
266
+ t(5, _ = !1);
267
+ },
268
+ S.SHAKE_DURATION
269
+ );
270
+ }, T = () => {
271
+ d && clearTimeout(d), d = setTimeout(
272
+ () => {
273
+ t(4, g = !1), L(), window.postMessage(
274
+ {
275
+ type: "WidgetNotification",
276
+ data: {
277
+ type: "error",
278
+ message: r("errorMessage")
279
+ }
280
+ },
281
+ window.location.href
282
+ );
283
+ },
284
+ S.BIOMETRICS_RESPONSE
285
+ );
286
+ }, x = () => O(this, null, function* () {
287
+ g || (t(4, g = !0), window.postMessage({
288
+ type: "ToggleBiometrics",
289
+ data: `${!B}`
290
+ }), T());
291
+ }), v = (a) => {
292
+ var b, N;
293
+ ((b = a.data) == null ? void 0 : b.type) === "NativeAppReady" && (t(0, u = !0), A()), ((N = a.data) == null ? void 0 : N.type) === "BiometricsStatus" && (t(3, B = a.data.status || !1), t(4, g = !1), d && (clearTimeout(d), d = null));
294
+ }, A = () => {
295
+ t(4, g = !0), window.postMessage({ type: "GetBiometricsStatus" }), T();
296
+ }, U = () => {
297
+ window.postMessage({ type: "CheckNativeApp" });
298
+ };
299
+ Y(() => (window.addEventListener("message", v), u === !0 ? A() : U(), () => {
300
+ window.removeEventListener("message", v), h && h.unsubscribe(), d && clearTimeout(d);
301
+ }));
302
+ const H = () => x();
303
+ function q(a) {
304
+ Z[a ? "unshift" : "push"](() => {
305
+ m = a, t(2, m);
306
+ });
307
+ }
308
+ return i.$$set = (a) => {
309
+ "lang" in a && t(8, s = a.lang), "clientstyling" in a && t(9, n = a.clientstyling), "clientstylingurl" in a && t(10, o = a.clientstylingurl), "mbsource" in a && t(11, l = a.mbsource), "translationurl" in a && t(12, c = a.translationurl), "isNativeApp" in a && t(0, u = a.isNativeApp), "mode" in a && t(1, M = a.mode);
310
+ }, i.$$.update = () => {
311
+ i.$$.dirty & /*lang*/
312
+ 256 && s && C(), i.$$.dirty & /*clientstyling, customStylingContainer*/
313
+ 516 && n && m && te(m, n), i.$$.dirty & /*clientstylingurl, customStylingContainer*/
314
+ 1028 && o && m && ie(m, o), i.$$.dirty & /*mbsource, customStylingContainer*/
315
+ 2052 && l && m && se(m, `${l}.Style`), i.$$.dirty & /*translationurl*/
316
+ 4096 && c && j(), i.$$.dirty & /*mbsource, translationurl, translationSubscription*/
317
+ 14336 && l && !c && t(13, h = ce(`${l}.Translation`, h, E));
318
+ }, [
319
+ u,
320
+ M,
321
+ m,
322
+ B,
323
+ g,
324
+ _,
325
+ r,
326
+ x,
327
+ s,
328
+ n,
329
+ o,
330
+ l,
331
+ c,
332
+ h,
333
+ H,
334
+ q
335
+ ];
336
+ }
337
+ class ge extends G {
338
+ constructor(e) {
339
+ super(), W(
340
+ this,
341
+ e,
342
+ fe,
343
+ de,
344
+ F,
345
+ {
346
+ lang: 8,
347
+ clientstyling: 9,
348
+ clientstylingurl: 10,
349
+ mbsource: 11,
350
+ translationurl: 12,
351
+ isNativeApp: 0,
352
+ mode: 1
353
+ },
354
+ be
355
+ );
356
+ }
357
+ get lang() {
358
+ return this.$$.ctx[8];
359
+ }
360
+ set lang(e) {
361
+ this.$$set({ lang: e }), f();
362
+ }
363
+ get clientstyling() {
364
+ return this.$$.ctx[9];
365
+ }
366
+ set clientstyling(e) {
367
+ this.$$set({ clientstyling: e }), f();
368
+ }
369
+ get clientstylingurl() {
370
+ return this.$$.ctx[10];
371
+ }
372
+ set clientstylingurl(e) {
373
+ this.$$set({ clientstylingurl: e }), f();
374
+ }
375
+ get mbsource() {
376
+ return this.$$.ctx[11];
377
+ }
378
+ set mbsource(e) {
379
+ this.$$set({ mbsource: e }), f();
380
+ }
381
+ get translationurl() {
382
+ return this.$$.ctx[12];
383
+ }
384
+ set translationurl(e) {
385
+ this.$$set({ translationurl: e }), f();
386
+ }
387
+ get isNativeApp() {
388
+ return this.$$.ctx[0];
389
+ }
390
+ set isNativeApp(e) {
391
+ this.$$set({ isNativeApp: e }), f();
392
+ }
393
+ get mode() {
394
+ return this.$$.ctx[1];
395
+ }
396
+ set mode(e) {
397
+ this.$$set({ mode: e }), f();
398
+ }
399
+ }
400
+ re(ge, { lang: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, isNativeApp: { type: "Boolean" }, mode: {} }, [], [], !0);
401
+ export {
402
+ ge as default
403
+ };