60p82u21t54k 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/60p82u21t54k.es.js +417 -11
- package/dist/60p82u21t54k.umd.js +1 -1
- package/dist/api/loginApi.d.ts +3 -4
- package/dist/api/loginApi.d.ts.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/model/login/type.d.ts +5 -0
- package/dist/model/login/type.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/60p82u21t54k.es.js
CHANGED
|
@@ -1,14 +1,420 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import P from "axios";
|
|
2
|
+
const b = P.create({
|
|
3
|
+
baseURL: "/graph",
|
|
4
|
+
timeout: 5e3,
|
|
5
|
+
// Request timeout
|
|
6
|
+
headers: {
|
|
7
|
+
"Content-Type": "application/json"
|
|
8
|
+
}
|
|
9
|
+
// params: { apiKey: 'your-api-key' }, // Default query parameters that will be sent with each request.
|
|
10
|
+
// auth: { username: 'user', password: 'pass' }, // Basic authentication credentials.
|
|
11
|
+
// responseEncoding: 'utf8', // Indicates the encoding to use for the response.
|
|
12
|
+
// responseType: 'json', // Specifies the type of data the server will respond with.
|
|
13
|
+
// xsrfCookieName: 'XSRF-TOKEN', // The name of the cookie to use as a value for the xsrf token.
|
|
14
|
+
// xsrfHeaderName: 'X-XSRF-TOKEN', // The name of the HTTP header that carries the xsrf token value.
|
|
15
|
+
// maxContentLength: 2000, // The maximum size of the HTTP response content in bytes allowed.
|
|
16
|
+
// maxBodyLength: 2000, // The maximum size of the request body in bytes allowed.
|
|
17
|
+
// // Allows changes to the request data before it is sent to the server.
|
|
18
|
+
// transformRequest: [
|
|
19
|
+
// (data, headers) => {
|
|
20
|
+
// console.log(headers)
|
|
21
|
+
// console.log(data)
|
|
22
|
+
// // Modify data and headers here
|
|
23
|
+
// return data
|
|
24
|
+
// },
|
|
25
|
+
// ],
|
|
26
|
+
// // Allows changes to the response data before it is passed to then or catch.
|
|
27
|
+
// transformResponse: [
|
|
28
|
+
// (data) => {
|
|
29
|
+
// // Modify data here
|
|
30
|
+
// return data
|
|
31
|
+
// },
|
|
32
|
+
// ],
|
|
33
|
+
// // Custom function to validate the response status code.
|
|
34
|
+
// validateStatus: (status) => {
|
|
35
|
+
// return status >= 200 && status < 300 // default
|
|
36
|
+
// },
|
|
37
|
+
// withCredentials: true, // Indicates whether or not cross-site Access-Control requests should be made using credentials.
|
|
38
|
+
// // Defines the proxy server settings.
|
|
39
|
+
// proxy: {
|
|
40
|
+
// host: '127.0.0.1',
|
|
41
|
+
// port: 9000,
|
|
42
|
+
// auth: {
|
|
43
|
+
// username: 'proxyuser',
|
|
44
|
+
// password: 'proxypass',
|
|
45
|
+
// },
|
|
46
|
+
// },
|
|
47
|
+
});
|
|
48
|
+
b.interceptors.request.use(
|
|
49
|
+
(e) => e,
|
|
50
|
+
(e) => (console.error("Error request:", e.response), Promise.reject(e))
|
|
51
|
+
);
|
|
52
|
+
b.interceptors.response.use(
|
|
53
|
+
(e) => e,
|
|
54
|
+
(e) => {
|
|
55
|
+
const t = {
|
|
56
|
+
status: null,
|
|
57
|
+
message: "An error occurred"
|
|
58
|
+
};
|
|
59
|
+
return e.response ? (t.status = e.response.status, t.message = e.response.data.message || e.response.statusText, console.error("Error response:", JSON.stringify(t)), e.response.status === 401 ? console.error("Unauthorized access - redirecting to login.") : e.response.status === 404 ? console.error("Resource not found.") : e.response.status >= 500 && console.error("Server error. Please try again later.")) : e.request ? console.error("No response received:", e.request) : console.error("Error setting up request:", e.message), Promise.reject(t);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
const N = (e) => new TextEncoder().encode(e), v = (e) => {
|
|
63
|
+
try {
|
|
64
|
+
return atob(e);
|
|
65
|
+
} catch (t) {
|
|
66
|
+
return console.error("Failed to decode Base64:", t), "";
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var _ = /* @__PURE__ */ ((e) => (e.announcement = "announcement", e.gameList = "gameList", e.fishGameList = "fishGameList", e.cmsList = "cmsList", e.paymentsProvider = "paymentsProvider", e))(_ || {}), g = /* @__PURE__ */ ((e) => (e.default = "default", e.pay = "pay", e.auto = "auto", e.fix = "fix", e.manual = "manual", e.unknown = "unknown", e))(g || {});
|
|
70
|
+
const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
71
|
+
__proto__: null,
|
|
72
|
+
PaymentType: g
|
|
73
|
+
}, Symbol.toStringTag, { value: "Module" })), O = (e) => e.mdPaymentChannels.map((t) => {
|
|
74
|
+
const s = [];
|
|
75
|
+
switch (t.name) {
|
|
76
|
+
case g.default:
|
|
77
|
+
s.push(k(t.paymentmethod.manual, e));
|
|
78
|
+
break;
|
|
79
|
+
case g.pay:
|
|
80
|
+
s.push(T(t.paymentmethod.onlinebanking, e));
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
if (t.paymentmethod.auto.bank.length > 0 && s.push(
|
|
84
|
+
B(t.bankid ?? 0, t.paymentmethod.auto, e)
|
|
85
|
+
), t.paymentmethod.manual.bank.length > 0) {
|
|
86
|
+
let a = !1;
|
|
87
|
+
for (let n = 0; n < t.paymentmethod.manual.bank.length; n++) {
|
|
88
|
+
const o = t.paymentmethod.manual.bank[n];
|
|
89
|
+
if (o.list && o.list.length > 0) {
|
|
90
|
+
a = !0;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
a && s.push(k(t.paymentmethod.manual, e));
|
|
95
|
+
}
|
|
96
|
+
t.paymentmethod.fixamount.bank.length > 0 && s.push(
|
|
97
|
+
q(t.bankid ?? 0, t.paymentmethod.fixamount)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
name: t.label,
|
|
102
|
+
imageUrl: `/image/game/native/deposit/sidemenu/${t.name}.png?${e.systemtime}`,
|
|
103
|
+
paymentList: s
|
|
104
|
+
};
|
|
105
|
+
}), S = {
|
|
106
|
+
id: 0,
|
|
107
|
+
name: "",
|
|
108
|
+
type: g.unknown,
|
|
109
|
+
promo: [],
|
|
110
|
+
bank: [],
|
|
111
|
+
requiredField: {
|
|
112
|
+
deposit_bank: !1,
|
|
113
|
+
deposit_datetime: !1,
|
|
114
|
+
deposit_detail: !1,
|
|
115
|
+
deposit_method: !1,
|
|
116
|
+
depositor: !1,
|
|
117
|
+
uploadReceipt: !1
|
|
118
|
+
}
|
|
119
|
+
}, M = (e) => {
|
|
120
|
+
const t = {
|
|
121
|
+
id: 0,
|
|
122
|
+
name: "excludePromo",
|
|
123
|
+
value: "0",
|
|
124
|
+
disabled: !0
|
|
125
|
+
}, s = e.map((a, n) => ({
|
|
126
|
+
id: n + 1,
|
|
127
|
+
name: a.promodesc,
|
|
128
|
+
value: a.promoindex.toString(),
|
|
129
|
+
disabled: !1
|
|
130
|
+
}));
|
|
131
|
+
return [t, ...s];
|
|
132
|
+
}, h = (e, t, s, a) => {
|
|
133
|
+
let n, o;
|
|
134
|
+
s > 0 ? n = e > 0 ? Math.max(s, e) : s : n = Math.max(e, 0), a > 0 ? o = t > 0 ? Math.min(a, t) : a : o = Math.max(t, 0);
|
|
135
|
+
const u = Math.round(n);
|
|
136
|
+
let i = 1e3;
|
|
137
|
+
o < i && (i = Math.round(o));
|
|
138
|
+
const m = i - u;
|
|
139
|
+
let l = "", d = "";
|
|
140
|
+
if (m > 0) {
|
|
141
|
+
let c = Math.round((i - u) * 0.25).toString().split(""), p = [];
|
|
142
|
+
for (const r of c)
|
|
143
|
+
r !== "" && p.push(r);
|
|
144
|
+
for (let r = 0; r < p.length; r++)
|
|
145
|
+
r === 0 ? l += (parseInt(p[r]) + 1).toString() : l += "0";
|
|
146
|
+
c = Math.round((i - u) * 0.5).toString().split(""), p = [];
|
|
147
|
+
for (const r of c)
|
|
148
|
+
r !== "" && p.push(r);
|
|
149
|
+
for (let r = 0; r < p.length; r++)
|
|
150
|
+
r === 0 ? d += (parseInt(p[r]) + 1).toString() : d += "0";
|
|
151
|
+
} else
|
|
152
|
+
l = i.toString(), d = i.toString();
|
|
153
|
+
return { amountList: [
|
|
154
|
+
u.toString(),
|
|
155
|
+
l,
|
|
156
|
+
d,
|
|
157
|
+
i.toString()
|
|
158
|
+
], minAmount: u, maxAmount: o };
|
|
159
|
+
}, k = (e, t) => t ? {
|
|
160
|
+
id: 0,
|
|
161
|
+
name: "manualMethod",
|
|
162
|
+
type: g.manual,
|
|
163
|
+
promo: M(e.promo),
|
|
164
|
+
bank: e.bank.map((n) => {
|
|
165
|
+
const o = n.list && n.list.length > 0 ? n.list[0].mintransaction ?? "0.00" : "0.00", u = n.list && n.list.length > 0 ? n.list[0].maxtransaction ?? "0.00" : "0.00", { amountList: i, minAmount: m, maxAmount: l } = h(
|
|
166
|
+
Number(o),
|
|
167
|
+
Number(u),
|
|
168
|
+
t.mdBankLevelDetail.deposit_min,
|
|
169
|
+
t.mdBankLevelDetail.deposit_max
|
|
170
|
+
);
|
|
171
|
+
return t.mdManualDepositRequireField.depositor = !0, {
|
|
172
|
+
id: n.bankindex ?? 0,
|
|
173
|
+
bankAccountId: n.list && n.list.length > 0 ? n.list[0].bankaccountindex ?? 0 : 0,
|
|
174
|
+
name: n.list && n.list.length > 0 ? n.list[0].label ?? "" : "",
|
|
175
|
+
accountName: n.list && n.list.length > 0 ? n.list[0].bankaccountname ?? "" : "",
|
|
176
|
+
accountNo: n.list && n.list.length > 0 ? n.list[0].bankaccountno ?? "" : "",
|
|
177
|
+
qrcode: n.list && n.list.length > 0 ? n.list[0].bankaccountdesc : "",
|
|
178
|
+
amountList: i,
|
|
179
|
+
min: m,
|
|
180
|
+
max: l
|
|
181
|
+
};
|
|
182
|
+
}),
|
|
183
|
+
requiredField: {
|
|
184
|
+
...t.mdManualDepositRequireField,
|
|
185
|
+
uploadReceipt: t.mdUploadReceipt
|
|
186
|
+
}
|
|
187
|
+
} : S, T = (e, t) => {
|
|
188
|
+
if (!t) return S;
|
|
189
|
+
const a = {
|
|
190
|
+
id: 0,
|
|
191
|
+
name: "onlineBankingMethod",
|
|
192
|
+
type: g.pay,
|
|
193
|
+
promo: M(e.promo),
|
|
194
|
+
bank: e.banklist.map((n) => {
|
|
195
|
+
let o = "0.00", u = "0.00";
|
|
196
|
+
const i = n.bankindex ?? 0;
|
|
197
|
+
for (let c = 0; c < t.mdGatewayMinMax.length; c++)
|
|
198
|
+
t.mdGatewayMinMax[c].bankindex == i.toString() && (o = t.mdGatewayMinMax[c].min, u = t.mdGatewayMinMax[c].max);
|
|
199
|
+
const { amountList: m, minAmount: l, maxAmount: d } = h(
|
|
200
|
+
Number(o),
|
|
201
|
+
Number(u),
|
|
202
|
+
t.mdBankLevelDetail.onlinepayment_min,
|
|
203
|
+
t.mdBankLevelDetail.onlinepayment_max
|
|
204
|
+
), y = {
|
|
205
|
+
id: 0,
|
|
206
|
+
name: "autoChannel",
|
|
207
|
+
amountList: m,
|
|
208
|
+
min: l,
|
|
209
|
+
max: d
|
|
210
|
+
}, x = n.pg.map((c) => {
|
|
211
|
+
const p = c.mintransaction ?? "0.00", L = c.maxtransaction ?? "0.00", { amountList: A, minAmount: r, maxAmount: R } = h(
|
|
212
|
+
Number(p),
|
|
213
|
+
Number(L),
|
|
214
|
+
t.mdBankLevelDetail.onlinepayment_min,
|
|
215
|
+
t.mdBankLevelDetail.onlinepayment_max
|
|
216
|
+
);
|
|
217
|
+
return {
|
|
218
|
+
id: c.pgindex,
|
|
219
|
+
name: c.bankaccountname,
|
|
220
|
+
amountList: A,
|
|
221
|
+
min: r,
|
|
222
|
+
max: R
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
id: n.bankindex ?? 0,
|
|
227
|
+
name: n.banknameenglish ?? "",
|
|
228
|
+
amountList: [],
|
|
229
|
+
min: 0,
|
|
230
|
+
max: 0,
|
|
231
|
+
gateway: [y, ...x]
|
|
232
|
+
};
|
|
233
|
+
}),
|
|
234
|
+
requiredField: {
|
|
235
|
+
deposit_bank: !1,
|
|
236
|
+
deposit_datetime: !1,
|
|
237
|
+
deposit_detail: !1,
|
|
238
|
+
deposit_method: !1,
|
|
239
|
+
depositor: !1,
|
|
240
|
+
uploadReceipt: !1
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
return console.log(a), a;
|
|
244
|
+
}, B = (e, t, s) => {
|
|
245
|
+
if (!s) return S;
|
|
246
|
+
const a = g.auto;
|
|
247
|
+
let n = [];
|
|
248
|
+
const o = s.mdGatewayMinMax;
|
|
249
|
+
if (t.bank.length > 0 && s.mdPGSelection == "1")
|
|
250
|
+
n = t.bank.map((i) => {
|
|
251
|
+
const { amountList: m, minAmount: l, maxAmount: d } = h(
|
|
252
|
+
i.minTransaction ?? 0,
|
|
253
|
+
i.maxTransaction ?? 0,
|
|
254
|
+
s.mdBankLevelDetail.onlinepayment_min,
|
|
255
|
+
s.mdBankLevelDetail.onlinepayment_max
|
|
256
|
+
);
|
|
257
|
+
return {
|
|
258
|
+
id: i.pgindex,
|
|
259
|
+
name: i.bankaccountname || "",
|
|
260
|
+
amountList: m,
|
|
261
|
+
min: l,
|
|
262
|
+
max: d
|
|
263
|
+
};
|
|
264
|
+
});
|
|
265
|
+
else {
|
|
266
|
+
let i = "0.00", m = "0.00";
|
|
267
|
+
for (let f = 0; f < o.length; f++)
|
|
268
|
+
o[f].bankindex === e.toString() && (i = o[f].min, m = o[f].max);
|
|
269
|
+
const { amountList: l, minAmount: d, maxAmount: y } = h(
|
|
270
|
+
Number(i),
|
|
271
|
+
Number(m),
|
|
272
|
+
s.mdBankLevelDetail.onlinepayment_min,
|
|
273
|
+
s.mdBankLevelDetail.onlinepayment_max
|
|
274
|
+
), x = {
|
|
275
|
+
id: 0,
|
|
276
|
+
name: "autoChannel",
|
|
277
|
+
amountList: l,
|
|
278
|
+
min: d,
|
|
279
|
+
max: y
|
|
280
|
+
};
|
|
281
|
+
n.push(x);
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
id: e,
|
|
285
|
+
name: "autoMethod",
|
|
286
|
+
type: a,
|
|
287
|
+
promo: M(t.promo),
|
|
288
|
+
bank: n,
|
|
289
|
+
requiredField: {
|
|
290
|
+
deposit_bank: !1,
|
|
291
|
+
deposit_datetime: !1,
|
|
292
|
+
deposit_detail: !1,
|
|
293
|
+
deposit_method: !1,
|
|
294
|
+
depositor: !1,
|
|
295
|
+
uploadReceipt: !1
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}, q = (e, t) => {
|
|
299
|
+
const s = g.fix;
|
|
300
|
+
return {
|
|
301
|
+
id: e,
|
|
302
|
+
name: "fixAmountMethod",
|
|
303
|
+
type: s,
|
|
304
|
+
promo: M(t.promo),
|
|
305
|
+
bank: t.bank.map((n) => {
|
|
306
|
+
const o = n.amtlist.map(Number).sort((i, m) => i - m);
|
|
307
|
+
return {
|
|
308
|
+
id: n.pgindex,
|
|
309
|
+
name: n.name,
|
|
310
|
+
amountList: n.amtlist,
|
|
311
|
+
min: o.length > 0 ? o[0] : 0,
|
|
312
|
+
max: o.length > 0 ? o[o.length - 1] : 0
|
|
313
|
+
};
|
|
314
|
+
}),
|
|
315
|
+
requiredField: {
|
|
316
|
+
deposit_bank: !1,
|
|
317
|
+
deposit_datetime: !1,
|
|
318
|
+
deposit_detail: !1,
|
|
319
|
+
deposit_method: !1,
|
|
320
|
+
depositor: !1,
|
|
321
|
+
uploadReceipt: !1
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
}, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
325
|
+
__proto__: null,
|
|
326
|
+
getPaymentsProviderResponse: O
|
|
327
|
+
}, Symbol.toStringTag, { value: "Module" })), j = (e) => e.map((t) => ({
|
|
328
|
+
alert: t.announcement_alert == "1",
|
|
329
|
+
update_time: t.announcement_lastupdated,
|
|
330
|
+
content: t.announcement_simplified
|
|
331
|
+
})), $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
332
|
+
__proto__: null,
|
|
333
|
+
getAnnouncementResponse: j
|
|
334
|
+
}, Symbol.toStringTag, { value: "Module" })), C = async (e) => {
|
|
335
|
+
var t, s;
|
|
336
|
+
try {
|
|
337
|
+
const a = {
|
|
338
|
+
requests: e
|
|
339
|
+
};
|
|
340
|
+
console.log(a);
|
|
341
|
+
const n = await b.post(
|
|
342
|
+
"/jwt",
|
|
343
|
+
N(JSON.stringify(a))
|
|
344
|
+
), o = {
|
|
345
|
+
status: 200,
|
|
346
|
+
message: "",
|
|
347
|
+
result: {}
|
|
348
|
+
};
|
|
349
|
+
for (const u of n.data.responses) {
|
|
350
|
+
const i = v(u.attributes), m = u.name, l = i ? JSON.parse(i) : null;
|
|
351
|
+
if (!l)
|
|
352
|
+
return o.result[m] = null, o;
|
|
353
|
+
switch (m) {
|
|
354
|
+
case _.announcement:
|
|
355
|
+
o.result[m] = j(l);
|
|
356
|
+
break;
|
|
357
|
+
case _.cmsList:
|
|
358
|
+
o.result[m] = l;
|
|
359
|
+
break;
|
|
360
|
+
case _.paymentsProvider: {
|
|
361
|
+
console.log(l), o.result[m] = O(l);
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return o;
|
|
367
|
+
} catch (a) {
|
|
368
|
+
return P.isAxiosError(a) ? (console.error(a), {
|
|
369
|
+
status: ((t = a.response) == null ? void 0 : t.status) || 500,
|
|
370
|
+
message: JSON.stringify((s = a.response) == null ? void 0 : s.data),
|
|
371
|
+
result: {}
|
|
372
|
+
}) : (console.error(a), {
|
|
373
|
+
status: a.status || 500,
|
|
374
|
+
message: a.message,
|
|
375
|
+
result: {}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
379
|
+
__proto__: null,
|
|
380
|
+
post: C
|
|
381
|
+
}, Symbol.toStringTag, { value: "Module" })), D = async (e, t) => {
|
|
382
|
+
try {
|
|
383
|
+
const s = {
|
|
384
|
+
status: 200,
|
|
385
|
+
message: ""
|
|
386
|
+
};
|
|
387
|
+
return await b.post(
|
|
388
|
+
"/auth/sesh",
|
|
389
|
+
JSON.stringify({
|
|
390
|
+
usr: e,
|
|
391
|
+
pwd: t
|
|
392
|
+
})
|
|
393
|
+
), s;
|
|
394
|
+
} catch (s) {
|
|
395
|
+
return console.error(`login: ${JSON.stringify(s)}`), {
|
|
396
|
+
status: s.status || 500,
|
|
397
|
+
message: s.message
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
}, I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
401
|
+
__proto__: null,
|
|
402
|
+
login: D
|
|
403
|
+
}, Symbol.toStringTag, { value: "Module" })), U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9
404
|
__proto__: null
|
|
10
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
405
|
+
}, Symbol.toStringTag, { value: "Module" })), H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
406
|
+
__proto__: null
|
|
407
|
+
}, Symbol.toStringTag, { value: "Module" })), K = {
|
|
408
|
+
install() {
|
|
409
|
+
}
|
|
410
|
+
};
|
|
11
411
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
412
|
+
K as Repository,
|
|
413
|
+
H as announcementType,
|
|
414
|
+
J as api,
|
|
415
|
+
$ as getAnnouncementResponse,
|
|
416
|
+
G as getPaymentsProviderResponse,
|
|
417
|
+
I as loginApi,
|
|
418
|
+
U as loginType,
|
|
419
|
+
z as paymentsProviderType
|
|
14
420
|
};
|
package/dist/60p82u21t54k.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],h):(c=typeof globalThis<"u"?globalThis:c||self,h(c["60p82u21t54k"]={},c.axios))})(this,function(c,h){"use strict";const b=h.create({baseURL:"/graph",timeout:5e3,headers:{"Content-Type":"application/json"}});b.interceptors.request.use(e=>e,e=>(console.error("Error request:",e.response),Promise.reject(e))),b.interceptors.response.use(e=>e,e=>{const t={status:null,message:"An error occurred"};return e.response?(t.status=e.response.status,t.message=e.response.data.message||e.response.statusText,console.error("Error response:",JSON.stringify(t)),e.response.status===401?console.error("Unauthorized access - redirecting to login."):e.response.status===404?console.error("Resource not found."):e.response.status>=500&&console.error("Server error. Please try again later.")):e.request?console.error("No response received:",e.request):console.error("Error setting up request:",e.message),Promise.reject(t)});const R=e=>new TextEncoder().encode(e),v=e=>{try{return atob(e)}catch(t){return console.error("Failed to decode Base64:",t),""}};var S=(e=>(e.announcement="announcement",e.gameList="gameList",e.fishGameList="fishGameList",e.cmsList="cmsList",e.paymentsProvider="paymentsProvider",e))(S||{}),f=(e=>(e.default="default",e.pay="pay",e.auto="auto",e.fix="fix",e.manual="manual",e.unknown="unknown",e))(f||{});const N=Object.freeze(Object.defineProperty({__proto__:null,PaymentType:f},Symbol.toStringTag,{value:"Module"})),k=e=>e.mdPaymentChannels.map(t=>{const o=[];switch(t.name){case f.default:o.push(P(t.paymentmethod.manual,e));break;case f.pay:o.push(B(t.paymentmethod.onlinebanking,e));break;default:if(t.paymentmethod.auto.bank.length>0&&o.push(q(t.bankid??0,t.paymentmethod.auto,e)),t.paymentmethod.manual.bank.length>0){let a=!1;for(let n=0;n<t.paymentmethod.manual.bank.length;n++){const s=t.paymentmethod.manual.bank[n];if(s.list&&s.list.length>0){a=!0;break}}a&&o.push(P(t.paymentmethod.manual,e))}t.paymentmethod.fixamount.bank.length>0&&o.push(C(t.bankid??0,t.paymentmethod.fixamount))}return{name:t.label,imageUrl:`/image/game/native/deposit/sidemenu/${t.name}.png?${e.systemtime}`,paymentList:o}}),A={id:0,name:"",type:f.unknown,promo:[],bank:[],requiredField:{deposit_bank:!1,deposit_datetime:!1,deposit_detail:!1,deposit_method:!1,depositor:!1,uploadReceipt:!1}},M=e=>{const t={id:0,name:"excludePromo",value:"0",disabled:!0},o=e.map((a,n)=>({id:n+1,name:a.promodesc,value:a.promoindex.toString(),disabled:!1}));return[t,...o]},x=(e,t,o,a)=>{let n,s;o>0?n=e>0?Math.max(o,e):o:n=Math.max(e,0),a>0?s=t>0?Math.min(a,t):a:s=Math.max(t,0);const u=Math.round(n);let i=1e3;s<i&&(i=Math.round(s));const m=i-u;let l="",p="";if(m>0){let d=Math.round((i-u)*.25).toString().split(""),g=[];for(const r of d)r!==""&&g.push(r);for(let r=0;r<g.length;r++)r===0?l+=(parseInt(g[r])+1).toString():l+="0";d=Math.round((i-u)*.5).toString().split(""),g=[];for(const r of d)r!==""&&g.push(r);for(let r=0;r<g.length;r++)r===0?p+=(parseInt(g[r])+1).toString():p+="0"}else l=i.toString(),p=i.toString();return{amountList:[u.toString(),l,p,i.toString()],minAmount:u,maxAmount:s}},P=(e,t)=>t?{id:0,name:"manualMethod",type:f.manual,promo:M(e.promo),bank:e.bank.map(n=>{const s=n.list&&n.list.length>0?n.list[0].mintransaction??"0.00":"0.00",u=n.list&&n.list.length>0?n.list[0].maxtransaction??"0.00":"0.00",{amountList:i,minAmount:m,maxAmount:l}=x(Number(s),Number(u),t.mdBankLevelDetail.deposit_min,t.mdBankLevelDetail.deposit_max);return t.mdManualDepositRequireField.depositor=!0,{id:n.bankindex??0,bankAccountId:n.list&&n.list.length>0?n.list[0].bankaccountindex??0:0,name:n.list&&n.list.length>0?n.list[0].label??"":"",accountName:n.list&&n.list.length>0?n.list[0].bankaccountname??"":"",accountNo:n.list&&n.list.length>0?n.list[0].bankaccountno??"":"",qrcode:n.list&&n.list.length>0?n.list[0].bankaccountdesc:"",amountList:i,min:m,max:l}}),requiredField:{...t.mdManualDepositRequireField,uploadReceipt:t.mdUploadReceipt}}:A,B=(e,t)=>{if(!t)return A;const a={id:0,name:"onlineBankingMethod",type:f.pay,promo:M(e.promo),bank:e.banklist.map(n=>{let s="0.00",u="0.00";const i=n.bankindex??0;for(let d=0;d<t.mdGatewayMinMax.length;d++)t.mdGatewayMinMax[d].bankindex==i.toString()&&(s=t.mdGatewayMinMax[d].min,u=t.mdGatewayMinMax[d].max);const{amountList:m,minAmount:l,maxAmount:p}=x(Number(s),Number(u),t.mdBankLevelDetail.onlinepayment_min,t.mdBankLevelDetail.onlinepayment_max),_={id:0,name:"autoChannel",amountList:m,min:l,max:p},L=n.pg.map(d=>{const g=d.mintransaction??"0.00",j=d.maxtransaction??"0.00",{amountList:T,minAmount:r,maxAmount:I}=x(Number(g),Number(j),t.mdBankLevelDetail.onlinepayment_min,t.mdBankLevelDetail.onlinepayment_max);return{id:d.pgindex,name:d.bankaccountname,amountList:T,min:r,max:I}});return{id:n.bankindex??0,name:n.banknameenglish??"",amountList:[],min:0,max:0,gateway:[_,...L]}}),requiredField:{deposit_bank:!1,deposit_datetime:!1,deposit_detail:!1,deposit_method:!1,depositor:!1,uploadReceipt:!1}};return console.log(a),a},q=(e,t,o)=>{if(!o)return A;const a=f.auto;let n=[];const s=o.mdGatewayMinMax;if(t.bank.length>0&&o.mdPGSelection=="1")n=t.bank.map(i=>{const{amountList:m,minAmount:l,maxAmount:p}=x(i.minTransaction??0,i.maxTransaction??0,o.mdBankLevelDetail.onlinepayment_min,o.mdBankLevelDetail.onlinepayment_max);return{id:i.pgindex,name:i.bankaccountname||"",amountList:m,min:l,max:p}});else{let i="0.00",m="0.00";for(let y=0;y<s.length;y++)s[y].bankindex===e.toString()&&(i=s[y].min,m=s[y].max);const{amountList:l,minAmount:p,maxAmount:_}=x(Number(i),Number(m),o.mdBankLevelDetail.onlinepayment_min,o.mdBankLevelDetail.onlinepayment_max),L={id:0,name:"autoChannel",amountList:l,min:p,max:_};n.push(L)}return{id:e,name:"autoMethod",type:a,promo:M(t.promo),bank:n,requiredField:{deposit_bank:!1,deposit_datetime:!1,deposit_detail:!1,deposit_method:!1,depositor:!1,uploadReceipt:!1}}},C=(e,t)=>{const o=f.fix;return{id:e,name:"fixAmountMethod",type:o,promo:M(t.promo),bank:t.bank.map(n=>{const s=n.amtlist.map(Number).sort((i,m)=>i-m);return{id:n.pgindex,name:n.name,amountList:n.amtlist,min:s.length>0?s[0]:0,max:s.length>0?s[s.length-1]:0}}),requiredField:{deposit_bank:!1,deposit_datetime:!1,deposit_detail:!1,deposit_method:!1,depositor:!1,uploadReceipt:!1}}},D=Object.freeze(Object.defineProperty({__proto__:null,getPaymentsProviderResponse:k},Symbol.toStringTag,{value:"Module"})),O=e=>e.map(t=>({alert:t.announcement_alert=="1",update_time:t.announcement_lastupdated,content:t.announcement_simplified})),E=Object.freeze(Object.defineProperty({__proto__:null,getAnnouncementResponse:O},Symbol.toStringTag,{value:"Module"})),F=Object.freeze(Object.defineProperty({__proto__:null,post:async e=>{var t,o;try{const a={requests:e};console.log(a);const n=await b.post("/jwt",R(JSON.stringify(a))),s={status:200,message:"",result:{}};for(const u of n.data.responses){const i=v(u.attributes),m=u.name,l=i?JSON.parse(i):null;if(!l)return s.result[m]=null,s;switch(m){case S.announcement:s.result[m]=O(l);break;case S.cmsList:s.result[m]=l;break;case S.paymentsProvider:{console.log(l),s.result[m]=k(l);break}}}return s}catch(a){return h.isAxiosError(a)?(console.error(a),{status:((t=a.response)==null?void 0:t.status)||500,message:JSON.stringify((o=a.response)==null?void 0:o.data),result:{}}):(console.error(a),{status:a.status||500,message:a.message,result:{}})}}},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null,login:async(e,t)=>{try{const o={status:200,message:""};return await b.post("/auth/sesh",JSON.stringify({usr:e,pwd:t})),o}catch(o){return console.error(`login: ${JSON.stringify(o)}`),{status:o.status||500,message:o.message}}}},Symbol.toStringTag,{value:"Module"})),G=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),$=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),J={install(){}};c.Repository=J,c.announcementType=$,c.api=F,c.getAnnouncementResponse=E,c.getPaymentsProviderResponse=D,c.loginApi=z,c.loginType=G,c.paymentsProviderType=N,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/dist/api/loginApi.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}>;
|
|
1
|
+
import { LoginResponse } from '../model/login/type';
|
|
2
|
+
|
|
3
|
+
export declare const login: (username: string, password: string) => Promise<LoginResponse>;
|
|
5
4
|
//# sourceMappingURL=loginApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loginApi.d.ts","sourceRoot":"","sources":["../../src/api/loginApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loginApi.d.ts","sourceRoot":"","sources":["../../src/api/loginApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIlD,eAAO,MAAM,KAAK,aACN,MAAM,YACN,MAAM,KACf,OAAO,CAAC,aAAa,CAwBvB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import * as api from './api/api';
|
|
2
|
+
import * as loginApi from './api/loginApi';
|
|
3
|
+
import * as loginType from './model/login/type';
|
|
1
4
|
import * as getAnnouncementResponse from './model/announcement/getAnnouncementResponse';
|
|
2
5
|
import * as announcementType from './model/announcement/type';
|
|
3
|
-
|
|
6
|
+
import * as getPaymentsProviderResponse from './model/deposit/getPaymentsProviderResponse';
|
|
7
|
+
import * as paymentsProviderType from './model/deposit/type';
|
|
8
|
+
export { api, loginApi, loginType, getAnnouncementResponse, announcementType, getPaymentsProviderResponse, paymentsProviderType, };
|
|
4
9
|
export type RepositoryType = {
|
|
10
|
+
api: typeof api;
|
|
11
|
+
loginApi: typeof loginApi;
|
|
12
|
+
loginType: typeof loginType;
|
|
5
13
|
getAnnouncementResponse: typeof getAnnouncementResponse;
|
|
6
14
|
announcementType: typeof announcementType;
|
|
15
|
+
getPaymentsProviderResponse: typeof getPaymentsProviderResponse;
|
|
16
|
+
paymentsProviderType: typeof paymentsProviderType;
|
|
7
17
|
};
|
|
18
|
+
export { default as Repository } from './plugin';
|
|
8
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,uBAAuB,MAAM,8CAA8C,CAAA;AACvF,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAChC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,uBAAuB,MAAM,8CAA8C,CAAA;AACvF,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,2BAA2B,MAAM,6CAA6C,CAAA;AAC1F,OAAO,KAAK,oBAAoB,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EACL,GAAG,EACH,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,2BAA2B,EAC3B,oBAAoB,GACrB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,OAAO,GAAG,CAAA;IACf,QAAQ,EAAE,OAAO,QAAQ,CAAA;IACzB,SAAS,EAAE,OAAO,SAAS,CAAA;IAC3B,uBAAuB,EAAE,OAAO,uBAAuB,CAAA;IACvD,gBAAgB,EAAE,OAAO,gBAAgB,CAAA;IACzC,2BAA2B,EAAE,OAAO,2BAA2B,CAAA;IAC/D,oBAAoB,EAAE,OAAO,oBAAoB,CAAA;CAClD,CAAA;AAED,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/model/login/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
|