choco-one-click-payment 1.1.43 → 1.1.45
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/index.esm.js +200 -192
- package/dist/index.js +23 -23
- package/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4,6 +4,7 @@ const bt = {
|
|
|
4
4
|
paymentMethod: "Способ оплаты",
|
|
5
5
|
selectMethod: "Выберите метод",
|
|
6
6
|
pay: "Оплатить",
|
|
7
|
+
login: "Войти",
|
|
7
8
|
paymentSuccess: "Оплата прошла успешно!",
|
|
8
9
|
paymentError: "Ошибка оплаты",
|
|
9
10
|
paymentMethods: "Способ оплаты",
|
|
@@ -42,6 +43,7 @@ const bt = {
|
|
|
42
43
|
paymentMethod: "Payment method",
|
|
43
44
|
selectMethod: "Select method",
|
|
44
45
|
pay: "Pay",
|
|
46
|
+
login: "Sign in",
|
|
45
47
|
paymentSuccess: "Payment successful!",
|
|
46
48
|
paymentError: "Payment error",
|
|
47
49
|
paymentMethods: "Payment method",
|
|
@@ -80,6 +82,7 @@ const bt = {
|
|
|
80
82
|
paymentMethod: "Төлем әдісі",
|
|
81
83
|
selectMethod: "Әдісті таңдаңыз",
|
|
82
84
|
pay: "Төлеу",
|
|
85
|
+
login: "Кіру",
|
|
83
86
|
paymentSuccess: "Төлем сәтті өтті!",
|
|
84
87
|
paymentError: "Төлем қатесі",
|
|
85
88
|
paymentMethods: "Төлем әдісі",
|
|
@@ -118,6 +121,7 @@ const bt = {
|
|
|
118
121
|
paymentMethod: "გადახდის მეთოდი",
|
|
119
122
|
selectMethod: "აირჩიეთ მეთოდი",
|
|
120
123
|
pay: "გადახდა",
|
|
124
|
+
login: "შესვლა",
|
|
121
125
|
paymentSuccess: "გადახდა წარმატებით შესრულდა!",
|
|
122
126
|
paymentError: "გადახდის შეცდომა",
|
|
123
127
|
paymentMethods: "გადახდის მეთოდი",
|
|
@@ -237,30 +241,30 @@ function wt() {
|
|
|
237
241
|
Object.defineProperty(l, "__esModule", {
|
|
238
242
|
value: !0
|
|
239
243
|
}), l.Centrifuge = void 0;
|
|
240
|
-
var C =
|
|
241
|
-
function
|
|
244
|
+
var C = P(f(187)), B = P(f(471)), _ = f(147), b = f(853);
|
|
245
|
+
function P(g) {
|
|
242
246
|
return g && g.__esModule ? g : { default: g };
|
|
243
247
|
}
|
|
244
|
-
function
|
|
248
|
+
function L(g) {
|
|
245
249
|
"@babel/helpers - typeof";
|
|
246
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
250
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? L = function(p) {
|
|
247
251
|
return typeof p;
|
|
248
|
-
} :
|
|
252
|
+
} : L = function(p) {
|
|
249
253
|
return p && typeof Symbol == "function" && p.constructor === Symbol && p !== Symbol.prototype ? "symbol" : typeof p;
|
|
250
|
-
},
|
|
254
|
+
}, L(g);
|
|
251
255
|
}
|
|
252
256
|
function v(g, h) {
|
|
253
257
|
if (!(g instanceof h))
|
|
254
258
|
throw new TypeError("Cannot call a class as a function");
|
|
255
259
|
}
|
|
256
|
-
function
|
|
260
|
+
function S(g, h) {
|
|
257
261
|
for (var p = 0; p < h.length; p++) {
|
|
258
262
|
var A = h[p];
|
|
259
263
|
A.enumerable = A.enumerable || !1, A.configurable = !0, "value" in A && (A.writable = !0), Object.defineProperty(g, A.key, A);
|
|
260
264
|
}
|
|
261
265
|
}
|
|
262
|
-
function
|
|
263
|
-
return h &&
|
|
266
|
+
function k(g, h, p) {
|
|
267
|
+
return h && S(g.prototype, h), g;
|
|
264
268
|
}
|
|
265
269
|
function I(g, h) {
|
|
266
270
|
if (typeof h != "function" && h !== null)
|
|
@@ -272,7 +276,7 @@ function wt() {
|
|
|
272
276
|
return A.__proto__ = n, A;
|
|
273
277
|
}, R(g, h);
|
|
274
278
|
}
|
|
275
|
-
function
|
|
279
|
+
function T(g) {
|
|
276
280
|
var h = q();
|
|
277
281
|
return function() {
|
|
278
282
|
var A = J(g), n;
|
|
@@ -285,7 +289,7 @@ function wt() {
|
|
|
285
289
|
};
|
|
286
290
|
}
|
|
287
291
|
function x(g, h) {
|
|
288
|
-
if (h && (
|
|
292
|
+
if (h && (L(h) === "object" || typeof h == "function"))
|
|
289
293
|
return h;
|
|
290
294
|
if (h !== void 0)
|
|
291
295
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -313,7 +317,7 @@ function wt() {
|
|
|
313
317
|
}
|
|
314
318
|
var F = "timeout", M = "connection closed", m = /* @__PURE__ */ (function(g) {
|
|
315
319
|
I(p, g);
|
|
316
|
-
var h =
|
|
320
|
+
var h = T(p);
|
|
317
321
|
function p(A, n) {
|
|
318
322
|
var r;
|
|
319
323
|
return v(this, p), r = h.call(this), r._url = A, r._websocket = null, r._sockjs = null, r._isSockjs = !1, r._xmlhttprequest = null, r._binary = !1, r._methodType = null, r._pushType = null, r._encoder = null, r._decoder = null, r._status = "disconnected", r._reconnect = !0, r._reconnecting = !1, r._transport = null, r._transportName = null, r._transportClosed = !0, r._messageId = 0, r._clientID = null, r._refreshRequired = !1, r._subs = {}, r._serverSubs = {}, r._lastSeq = {}, r._lastGen = {}, r._lastOffset = {}, r._lastEpoch = {}, r._messages = [], r._isBatching = !1, r._isSubscribeBatching = !1, r._privateChannels = {}, r._numRefreshFailed = 0, r._refreshTimeout = null, r._pingTimeout = null, r._pongTimeout = null, r._subRefreshTimeouts = {}, r._retries = 0, r._callbacks = {}, r._latency = null, r._latencyStart = null, r._connectData = null, r._token = null, r._xhrID = 0, r._xhrs = {}, r._dispatchPromise = Promise.resolve(), r._protocol = "", r._config = {
|
|
@@ -351,7 +355,7 @@ function wt() {
|
|
|
351
355
|
disableWithCredentials: !1
|
|
352
356
|
}, r._configure(n), r;
|
|
353
357
|
}
|
|
354
|
-
return
|
|
358
|
+
return k(p, [{
|
|
355
359
|
key: "setToken",
|
|
356
360
|
value: function(n) {
|
|
357
361
|
this._token = n;
|
|
@@ -389,13 +393,13 @@ function wt() {
|
|
|
389
393
|
}, {
|
|
390
394
|
key: "_ajax",
|
|
391
395
|
value: function(n, r, c, d, y) {
|
|
392
|
-
var E = this,
|
|
396
|
+
var E = this, w = "";
|
|
393
397
|
this._debug("sending AJAX request to", n, "with data", JSON.stringify(d));
|
|
394
398
|
var Q;
|
|
395
399
|
this._xmlhttprequest !== null ? Q = new this._xmlhttprequest() : Q = f.g.XMLHttpRequest ? new f.g.XMLHttpRequest() : new f.g.ActiveXObject("Microsoft.XMLHTTP");
|
|
396
400
|
for (var O in r)
|
|
397
|
-
r.hasOwnProperty(O) && (
|
|
398
|
-
|
|
401
|
+
r.hasOwnProperty(O) && (w.length > 0 && (w += "&"), w += encodeURIComponent(O) + "=" + encodeURIComponent(r[O]));
|
|
402
|
+
w.length > 0 && (w = "?" + w), Q.open("POST", n + w, !0), "withCredentials" in Q && (Q.withCredentials = !this._config.disableWithCredentials), Q.setRequestHeader("X-Requested-With", "XMLHttpRequest"), Q.setRequestHeader("Content-Type", "application/json");
|
|
399
403
|
for (var X in c)
|
|
400
404
|
c.hasOwnProperty(X) && Q.setRequestHeader(X, c[X]);
|
|
401
405
|
return Q.onreadystatechange = function() {
|
|
@@ -437,7 +441,7 @@ function wt() {
|
|
|
437
441
|
}, {
|
|
438
442
|
key: "_websocketSupported",
|
|
439
443
|
value: function() {
|
|
440
|
-
return this._config.websocket !== null ? !0 : !(typeof WebSocket != "function" && (typeof WebSocket > "u" ? "undefined" :
|
|
444
|
+
return this._config.websocket !== null ? !0 : !(typeof WebSocket != "function" && (typeof WebSocket > "u" ? "undefined" : L(WebSocket)) !== "object");
|
|
441
445
|
}
|
|
442
446
|
}, {
|
|
443
447
|
key: "_setFormat",
|
|
@@ -550,8 +554,8 @@ function wt() {
|
|
|
550
554
|
n ? (E._isSuccess() && (E._triggerUnsubscribe(), E._recover = !0), E._shouldResubscribe() && E._setSubscribing()) : E._setUnsubscribed();
|
|
551
555
|
}
|
|
552
556
|
this._abortInflightXHRs(), this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
|
|
553
|
-
for (var
|
|
554
|
-
this._subRefreshTimeouts.hasOwnProperty(
|
|
557
|
+
for (var w in this._subRefreshTimeouts)
|
|
558
|
+
this._subRefreshTimeouts.hasOwnProperty(w) && this._subRefreshTimeouts[w] && this._clearSubRefreshTimeout(w);
|
|
555
559
|
this._subRefreshTimeouts = {}, this._reconnect || (this._subs = {});
|
|
556
560
|
}
|
|
557
561
|
}, {
|
|
@@ -610,13 +614,13 @@ function wt() {
|
|
|
610
614
|
};
|
|
611
615
|
(n._token || n._connectData || n._config.name || n._config.version) && (d.params = {}), n._token && (d.params.token = n._token), n._connectData && (d.params.data = n._connectData), n._config.name && (d.params.name = n._config.name), n._config.version && (d.params.version = n._config.version);
|
|
612
616
|
var y = {}, E = !1;
|
|
613
|
-
for (var
|
|
614
|
-
if (n._serverSubs.hasOwnProperty(
|
|
617
|
+
for (var w in n._serverSubs)
|
|
618
|
+
if (n._serverSubs.hasOwnProperty(w) && n._serverSubs[w].recoverable) {
|
|
615
619
|
E = !0;
|
|
616
620
|
var Q = {
|
|
617
621
|
recover: !0
|
|
618
622
|
};
|
|
619
|
-
n._serverSubs[
|
|
623
|
+
n._serverSubs[w].seq || n._serverSubs[w].gen ? (n._serverSubs[w].seq && (Q.seq = n._serverSubs[w].seq), n._serverSubs[w].gen && (Q.gen = n._serverSubs[w].gen)) : n._serverSubs[w].offset && (Q.offset = n._serverSubs[w].offset), n._serverSubs[w].epoch && (Q.epoch = n._serverSubs[w].epoch), y[w] = Q;
|
|
620
624
|
}
|
|
621
625
|
E && (d.params || (d.params = {}), d.params.subs = y), n._latencyStart = /* @__PURE__ */ new Date(), n._call(d).then(function(O) {
|
|
622
626
|
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT, O.result), E), O.next && O.next();
|
|
@@ -631,8 +635,8 @@ function wt() {
|
|
|
631
635
|
var y = M, E = !0;
|
|
632
636
|
if (d && "reason" in d && d.reason)
|
|
633
637
|
try {
|
|
634
|
-
var
|
|
635
|
-
n._debug("reason is an advice object",
|
|
638
|
+
var w = JSON.parse(d.reason);
|
|
639
|
+
n._debug("reason is an advice object", w), y = w.reason, E = w.reconnect;
|
|
636
640
|
} catch {
|
|
637
641
|
y = d.reason, n._debug("reason is a plain string", y);
|
|
638
642
|
}
|
|
@@ -967,8 +971,8 @@ function wt() {
|
|
|
967
971
|
data: E
|
|
968
972
|
}, y);
|
|
969
973
|
else {
|
|
970
|
-
var
|
|
971
|
-
this._xhrs[d] =
|
|
974
|
+
var w = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, E, y);
|
|
975
|
+
this._xhrs[d] = w;
|
|
972
976
|
}
|
|
973
977
|
}
|
|
974
978
|
}, {
|
|
@@ -1025,9 +1029,9 @@ function wt() {
|
|
|
1025
1029
|
var E = n._needRecover();
|
|
1026
1030
|
if (E === !0) {
|
|
1027
1031
|
y.params.recover = !0;
|
|
1028
|
-
var
|
|
1029
|
-
if (
|
|
1030
|
-
|
|
1032
|
+
var w = this._getLastSeq(d), Q = this._getLastGen(d);
|
|
1033
|
+
if (w || Q)
|
|
1034
|
+
w && (y.params.seq = w), Q && (y.params.gen = Q);
|
|
1031
1035
|
else {
|
|
1032
1036
|
var O = this._getLastOffset(d);
|
|
1033
1037
|
O && (y.params.offset = O);
|
|
@@ -1087,12 +1091,12 @@ function wt() {
|
|
|
1087
1091
|
E._shouldResubscribe() && this._subscribe(E, d);
|
|
1088
1092
|
}
|
|
1089
1093
|
this.stopSubscribeBatching(), this.stopBatching(), this._startPing();
|
|
1090
|
-
var
|
|
1094
|
+
var w = {
|
|
1091
1095
|
client: n.client,
|
|
1092
1096
|
transport: this._transportName,
|
|
1093
1097
|
latency: this._latency
|
|
1094
1098
|
};
|
|
1095
|
-
n.data && (
|
|
1099
|
+
n.data && (w.data = n.data), this.emit("connect", w), n.subs && this._processServerSubs(n.subs);
|
|
1096
1100
|
}
|
|
1097
1101
|
}
|
|
1098
1102
|
}, {
|
|
@@ -1108,9 +1112,9 @@ function wt() {
|
|
|
1108
1112
|
}
|
|
1109
1113
|
for (var E in n)
|
|
1110
1114
|
if (n.hasOwnProperty(E)) {
|
|
1111
|
-
var
|
|
1112
|
-
if (
|
|
1113
|
-
var Q =
|
|
1115
|
+
var w = n[E];
|
|
1116
|
+
if (w.recovered) {
|
|
1117
|
+
var Q = w.publications;
|
|
1114
1118
|
if (Q && Q.length > 0) {
|
|
1115
1119
|
Q.length > 1 && (!Q[0].offset || Q[0].offset > Q[1].offset) && (Q = Q.reverse());
|
|
1116
1120
|
for (var O in Q)
|
|
@@ -1118,11 +1122,11 @@ function wt() {
|
|
|
1118
1122
|
}
|
|
1119
1123
|
}
|
|
1120
1124
|
this._serverSubs[E] = {
|
|
1121
|
-
seq:
|
|
1122
|
-
gen:
|
|
1123
|
-
offset:
|
|
1124
|
-
epoch:
|
|
1125
|
-
recoverable:
|
|
1125
|
+
seq: w.seq,
|
|
1126
|
+
gen: w.gen,
|
|
1127
|
+
offset: w.offset,
|
|
1128
|
+
epoch: w.epoch,
|
|
1129
|
+
recoverable: w.recoverable
|
|
1126
1130
|
};
|
|
1127
1131
|
}
|
|
1128
1132
|
}
|
|
@@ -1186,8 +1190,8 @@ function wt() {
|
|
|
1186
1190
|
var E = c.publications;
|
|
1187
1191
|
if (E && E.length > 0) {
|
|
1188
1192
|
E.length >= 2 && !E[0].offset && !E[1].offset && (E = E.reverse());
|
|
1189
|
-
for (var
|
|
1190
|
-
E.hasOwnProperty(
|
|
1193
|
+
for (var w in E)
|
|
1194
|
+
E.hasOwnProperty(w) && this._handlePublication(n, E[w]);
|
|
1191
1195
|
}
|
|
1192
1196
|
if (c.recoverable && (!r || !c.recovered) && (this._lastSeq[n] = c.seq || 0, this._lastGen[n] = c.gen || 0, this._lastOffset[n] = c.offset || 0), this._lastEpoch[n] = c.epoch || "", c.recoverable && (y._recoverable = !0), c.expires === !0) {
|
|
1193
1197
|
var Q = setTimeout(function() {
|
|
@@ -1207,13 +1211,13 @@ function wt() {
|
|
|
1207
1211
|
}
|
|
1208
1212
|
var y = this._callbacks[c];
|
|
1209
1213
|
if (clearTimeout(this._callbacks[c].timeout), delete this._callbacks[c], (0, b.errorExists)(n)) {
|
|
1210
|
-
var
|
|
1211
|
-
if (!
|
|
1214
|
+
var w = y.errback;
|
|
1215
|
+
if (!w) {
|
|
1212
1216
|
r();
|
|
1213
1217
|
return;
|
|
1214
1218
|
}
|
|
1215
1219
|
var Q = n.error;
|
|
1216
|
-
|
|
1220
|
+
w({
|
|
1217
1221
|
error: Q,
|
|
1218
1222
|
next: r
|
|
1219
1223
|
});
|
|
@@ -1307,8 +1311,8 @@ function wt() {
|
|
|
1307
1311
|
var E = this._decoder.decodePushData(this._pushType.PUBLICATION, c.data);
|
|
1308
1312
|
this._handlePublication(y, E);
|
|
1309
1313
|
} else if (d === this._pushType.MESSAGE) {
|
|
1310
|
-
var
|
|
1311
|
-
this._handleMessage(
|
|
1314
|
+
var w = this._decoder.decodePushData(this._pushType.MESSAGE, c.data);
|
|
1315
|
+
this._handleMessage(w);
|
|
1312
1316
|
} else if (d === this._pushType.JOIN) {
|
|
1313
1317
|
var Q = this._decoder.decodePushData(this._pushType.JOIN, c.data);
|
|
1314
1318
|
this._handleJoin(y, Q);
|
|
@@ -1457,8 +1461,8 @@ function wt() {
|
|
|
1457
1461
|
var E = {
|
|
1458
1462
|
client: this._clientID,
|
|
1459
1463
|
channels: c
|
|
1460
|
-
},
|
|
1461
|
-
if (Q in n._xhrs && delete n._xhrs[Q], n._clientID ===
|
|
1464
|
+
}, w = this._clientID, Q = this._newXHRID(), O = function(D) {
|
|
1465
|
+
if (Q in n._xhrs && delete n._xhrs[Q], n._clientID === w) {
|
|
1462
1466
|
if (D.error || D.status !== 200) {
|
|
1463
1467
|
n._debug("authorization request failed");
|
|
1464
1468
|
for (var re in c)
|
|
@@ -1562,18 +1566,18 @@ function wt() {
|
|
|
1562
1566
|
Object.defineProperty(l, "__esModule", {
|
|
1563
1567
|
value: !0
|
|
1564
1568
|
}), l.JsonPushType = l.JsonMethodType = l.JsonEncoder = l.JsonDecoder = void 0;
|
|
1565
|
-
function f(v,
|
|
1566
|
-
if (!(v instanceof
|
|
1569
|
+
function f(v, S) {
|
|
1570
|
+
if (!(v instanceof S))
|
|
1567
1571
|
throw new TypeError("Cannot call a class as a function");
|
|
1568
1572
|
}
|
|
1569
|
-
function C(v,
|
|
1570
|
-
for (var
|
|
1571
|
-
var I = k
|
|
1573
|
+
function C(v, S) {
|
|
1574
|
+
for (var k = 0; k < S.length; k++) {
|
|
1575
|
+
var I = S[k];
|
|
1572
1576
|
I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(v, I.key, I);
|
|
1573
1577
|
}
|
|
1574
1578
|
}
|
|
1575
|
-
function B(v,
|
|
1576
|
-
return
|
|
1579
|
+
function B(v, S, k) {
|
|
1580
|
+
return S && C(v.prototype, S), v;
|
|
1577
1581
|
}
|
|
1578
1582
|
var _ = {
|
|
1579
1583
|
CONNECT: 0,
|
|
@@ -1599,29 +1603,29 @@ function wt() {
|
|
|
1599
1603
|
SUBSCRIBE: 5
|
|
1600
1604
|
};
|
|
1601
1605
|
l.JsonPushType = b;
|
|
1602
|
-
var
|
|
1606
|
+
var P = /* @__PURE__ */ (function() {
|
|
1603
1607
|
function v() {
|
|
1604
1608
|
f(this, v);
|
|
1605
1609
|
}
|
|
1606
1610
|
return B(v, [{
|
|
1607
1611
|
key: "encodeCommands",
|
|
1608
|
-
value: function(
|
|
1609
|
-
return
|
|
1612
|
+
value: function(k) {
|
|
1613
|
+
return k.map(function(I) {
|
|
1610
1614
|
return JSON.stringify(I);
|
|
1611
1615
|
}).join(`
|
|
1612
1616
|
`);
|
|
1613
1617
|
}
|
|
1614
1618
|
}]), v;
|
|
1615
1619
|
})();
|
|
1616
|
-
l.JsonEncoder =
|
|
1617
|
-
var
|
|
1620
|
+
l.JsonEncoder = P;
|
|
1621
|
+
var L = /* @__PURE__ */ (function() {
|
|
1618
1622
|
function v() {
|
|
1619
1623
|
f(this, v);
|
|
1620
1624
|
}
|
|
1621
1625
|
return B(v, [{
|
|
1622
1626
|
key: "decodeReplies",
|
|
1623
|
-
value: function(
|
|
1624
|
-
return
|
|
1627
|
+
value: function(k) {
|
|
1628
|
+
return k.split(`
|
|
1625
1629
|
`).filter(function(I) {
|
|
1626
1630
|
return I !== "";
|
|
1627
1631
|
}).map(function(I) {
|
|
@@ -1630,22 +1634,22 @@ function wt() {
|
|
|
1630
1634
|
}
|
|
1631
1635
|
}, {
|
|
1632
1636
|
key: "decodeCommandResult",
|
|
1633
|
-
value: function(
|
|
1637
|
+
value: function(k, I) {
|
|
1634
1638
|
return I;
|
|
1635
1639
|
}
|
|
1636
1640
|
}, {
|
|
1637
1641
|
key: "decodePush",
|
|
1638
|
-
value: function(
|
|
1639
|
-
return
|
|
1642
|
+
value: function(k) {
|
|
1643
|
+
return k;
|
|
1640
1644
|
}
|
|
1641
1645
|
}, {
|
|
1642
1646
|
key: "decodePushData",
|
|
1643
|
-
value: function(
|
|
1647
|
+
value: function(k, I) {
|
|
1644
1648
|
return I;
|
|
1645
1649
|
}
|
|
1646
1650
|
}]), v;
|
|
1647
1651
|
})();
|
|
1648
|
-
l.JsonDecoder =
|
|
1652
|
+
l.JsonDecoder = L;
|
|
1649
1653
|
})
|
|
1650
1654
|
),
|
|
1651
1655
|
/***/
|
|
@@ -1667,28 +1671,28 @@ function wt() {
|
|
|
1667
1671
|
function b(h) {
|
|
1668
1672
|
return h && h.__esModule ? h : { default: h };
|
|
1669
1673
|
}
|
|
1670
|
-
function
|
|
1674
|
+
function P(h, p) {
|
|
1671
1675
|
if (!(h instanceof p))
|
|
1672
1676
|
throw new TypeError("Cannot call a class as a function");
|
|
1673
1677
|
}
|
|
1674
|
-
function
|
|
1678
|
+
function L(h, p) {
|
|
1675
1679
|
for (var A = 0; A < p.length; A++) {
|
|
1676
1680
|
var n = p[A];
|
|
1677
1681
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(h, n.key, n);
|
|
1678
1682
|
}
|
|
1679
1683
|
}
|
|
1680
1684
|
function v(h, p, A) {
|
|
1681
|
-
return p &&
|
|
1685
|
+
return p && L(h.prototype, p), h;
|
|
1682
1686
|
}
|
|
1683
|
-
function
|
|
1687
|
+
function S(h, p) {
|
|
1684
1688
|
if (typeof p != "function" && p !== null)
|
|
1685
1689
|
throw new TypeError("Super expression must either be null or a function");
|
|
1686
|
-
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p &&
|
|
1690
|
+
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p && k(h, p);
|
|
1687
1691
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1692
|
+
function k(h, p) {
|
|
1693
|
+
return k = Object.setPrototypeOf || function(n, r) {
|
|
1690
1694
|
return n.__proto__ = r, n;
|
|
1691
|
-
},
|
|
1695
|
+
}, k(h, p);
|
|
1692
1696
|
}
|
|
1693
1697
|
function I(h) {
|
|
1694
1698
|
var p = x();
|
|
@@ -1707,9 +1711,9 @@ function wt() {
|
|
|
1707
1711
|
return p;
|
|
1708
1712
|
if (p !== void 0)
|
|
1709
1713
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1710
|
-
return
|
|
1714
|
+
return T(h);
|
|
1711
1715
|
}
|
|
1712
|
-
function
|
|
1716
|
+
function T(h) {
|
|
1713
1717
|
if (h === void 0)
|
|
1714
1718
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1715
1719
|
return h;
|
|
@@ -1730,11 +1734,11 @@ function wt() {
|
|
|
1730
1734
|
}, N(h);
|
|
1731
1735
|
}
|
|
1732
1736
|
var q = 0, J = 1, F = 2, M = 3, m = 4, g = /* @__PURE__ */ (function(h) {
|
|
1733
|
-
|
|
1737
|
+
S(A, h);
|
|
1734
1738
|
var p = I(A);
|
|
1735
1739
|
function A(n, r, c) {
|
|
1736
1740
|
var d;
|
|
1737
|
-
return
|
|
1741
|
+
return P(this, A), d = p.call(this), d.channel = r, d._centrifuge = n, d._status = q, d._error = null, d._isResubscribe = !1, d._ready = !1, d._subscriptionPromise = null, d._noResubscribe = !1, d._recoverable = !1, d._recover = !1, d._setEvents(c), d._initializePromise(), d._promises = {}, d._promiseId = 0, d._subscribeData = null, d.on("error", function(y) {
|
|
1738
1742
|
this._centrifuge._debug("subscription error", y);
|
|
1739
1743
|
}), d;
|
|
1740
1744
|
}
|
|
@@ -1963,29 +1967,29 @@ function wt() {
|
|
|
1963
1967
|
(function(a, l, f) {
|
|
1964
1968
|
Object.defineProperty(l, "__esModule", {
|
|
1965
1969
|
value: !0
|
|
1966
|
-
}), l.backoff = b, l.errorExists =
|
|
1967
|
-
function C(v,
|
|
1968
|
-
return v.lastIndexOf(
|
|
1970
|
+
}), l.backoff = b, l.errorExists = P, l.extend = L, l.isFunction = B, l.log = _, l.startsWith = C;
|
|
1971
|
+
function C(v, S) {
|
|
1972
|
+
return v.lastIndexOf(S, 0) === 0;
|
|
1969
1973
|
}
|
|
1970
1974
|
function B(v) {
|
|
1971
1975
|
return v == null ? !1 : typeof v == "function";
|
|
1972
1976
|
}
|
|
1973
|
-
function _(v,
|
|
1977
|
+
function _(v, S) {
|
|
1974
1978
|
if (f.g.console) {
|
|
1975
|
-
var
|
|
1976
|
-
B(
|
|
1979
|
+
var k = f.g.console[v];
|
|
1980
|
+
B(k) && k.apply(f.g.console, S);
|
|
1977
1981
|
}
|
|
1978
1982
|
}
|
|
1979
|
-
function b(v,
|
|
1980
|
-
var I = 0.5 * Math.random(), R = Math.min(
|
|
1983
|
+
function b(v, S, k) {
|
|
1984
|
+
var I = 0.5 * Math.random(), R = Math.min(k, S * Math.pow(2, v + 1));
|
|
1981
1985
|
return Math.floor((1 - I) * R);
|
|
1982
1986
|
}
|
|
1983
|
-
function
|
|
1987
|
+
function P(v) {
|
|
1984
1988
|
return "error" in v && v.error !== null;
|
|
1985
1989
|
}
|
|
1986
|
-
function
|
|
1987
|
-
for (var
|
|
1988
|
-
|
|
1990
|
+
function L(v, S) {
|
|
1991
|
+
for (var k in S)
|
|
1992
|
+
S.hasOwnProperty(k) && (v[k] = S[k]);
|
|
1989
1993
|
return v;
|
|
1990
1994
|
}
|
|
1991
1995
|
})
|
|
@@ -2012,20 +2016,20 @@ function wt() {
|
|
|
2012
2016
|
b.init.call(this);
|
|
2013
2017
|
}
|
|
2014
2018
|
a.exports = b, a.exports.once = J, b.EventEmitter = b, b.prototype._events = void 0, b.prototype._eventsCount = 0, b.prototype._maxListeners = void 0;
|
|
2015
|
-
var
|
|
2016
|
-
function
|
|
2019
|
+
var P = 10;
|
|
2020
|
+
function L(m) {
|
|
2017
2021
|
if (typeof m != "function")
|
|
2018
2022
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof m);
|
|
2019
2023
|
}
|
|
2020
2024
|
Object.defineProperty(b, "defaultMaxListeners", {
|
|
2021
2025
|
enumerable: !0,
|
|
2022
2026
|
get: function() {
|
|
2023
|
-
return
|
|
2027
|
+
return P;
|
|
2024
2028
|
},
|
|
2025
2029
|
set: function(m) {
|
|
2026
2030
|
if (typeof m != "number" || m < 0 || _(m))
|
|
2027
2031
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + m + ".");
|
|
2028
|
-
|
|
2032
|
+
P = m;
|
|
2029
2033
|
}
|
|
2030
2034
|
}), b.init = function() {
|
|
2031
2035
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
@@ -2063,9 +2067,9 @@ function wt() {
|
|
|
2063
2067
|
f(E[p], this, h);
|
|
2064
2068
|
return !0;
|
|
2065
2069
|
};
|
|
2066
|
-
function
|
|
2070
|
+
function S(m, g, h, p) {
|
|
2067
2071
|
var A, n, r;
|
|
2068
|
-
if (
|
|
2072
|
+
if (L(h), n = m._events, n === void 0 ? (n = m._events = /* @__PURE__ */ Object.create(null), m._eventsCount = 0) : (n.newListener !== void 0 && (m.emit(
|
|
2069
2073
|
"newListener",
|
|
2070
2074
|
g,
|
|
2071
2075
|
h.listener ? h.listener : h
|
|
@@ -2079,25 +2083,25 @@ function wt() {
|
|
|
2079
2083
|
return m;
|
|
2080
2084
|
}
|
|
2081
2085
|
b.prototype.addListener = function(g, h) {
|
|
2082
|
-
return
|
|
2086
|
+
return S(this, g, h, !1);
|
|
2083
2087
|
}, b.prototype.on = b.prototype.addListener, b.prototype.prependListener = function(g, h) {
|
|
2084
|
-
return
|
|
2088
|
+
return S(this, g, h, !0);
|
|
2085
2089
|
};
|
|
2086
|
-
function
|
|
2090
|
+
function k() {
|
|
2087
2091
|
if (!this.fired)
|
|
2088
2092
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
2089
2093
|
}
|
|
2090
2094
|
function I(m, g, h) {
|
|
2091
|
-
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A =
|
|
2095
|
+
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A = k.bind(p);
|
|
2092
2096
|
return A.listener = h, p.wrapFn = A, A;
|
|
2093
2097
|
}
|
|
2094
2098
|
b.prototype.once = function(g, h) {
|
|
2095
|
-
return
|
|
2099
|
+
return L(h), this.on(g, I(this, g, h)), this;
|
|
2096
2100
|
}, b.prototype.prependOnceListener = function(g, h) {
|
|
2097
|
-
return
|
|
2101
|
+
return L(h), this.prependListener(g, I(this, g, h)), this;
|
|
2098
2102
|
}, b.prototype.removeListener = function(g, h) {
|
|
2099
2103
|
var p, A, n, r, c;
|
|
2100
|
-
if (
|
|
2104
|
+
if (L(h), A = this._events, A === void 0)
|
|
2101
2105
|
return this;
|
|
2102
2106
|
if (p = A[g], p === void 0)
|
|
2103
2107
|
return this;
|
|
@@ -2145,9 +2149,9 @@ function wt() {
|
|
|
2145
2149
|
}, b.prototype.rawListeners = function(g) {
|
|
2146
2150
|
return R(this, g, !1);
|
|
2147
2151
|
}, b.listenerCount = function(m, g) {
|
|
2148
|
-
return typeof m.listenerCount == "function" ? m.listenerCount(g) :
|
|
2149
|
-
}, b.prototype.listenerCount =
|
|
2150
|
-
function
|
|
2152
|
+
return typeof m.listenerCount == "function" ? m.listenerCount(g) : T.call(m, g);
|
|
2153
|
+
}, b.prototype.listenerCount = T;
|
|
2154
|
+
function T(m) {
|
|
2151
2155
|
var g = this._events;
|
|
2152
2156
|
if (g !== void 0) {
|
|
2153
2157
|
var h = g[m];
|
|
@@ -2314,16 +2318,16 @@ function Rt(e) {
|
|
|
2314
2318
|
};
|
|
2315
2319
|
}
|
|
2316
2320
|
function Ot(e, t, o = {}) {
|
|
2317
|
-
var
|
|
2318
|
-
const i = [], s = (
|
|
2319
|
-
return s != null && s.isKaspiOnly && l && !
|
|
2321
|
+
var S, k, I, R;
|
|
2322
|
+
const i = [], s = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, u = ((k = e == null ? void 0 : e.cards_v2) == null ? void 0 : k.data) || [], a = ((R = (I = e == null ? void 0 : e.payment_methods) == null ? void 0 : I.data) == null ? void 0 : R.attributes) || {}, l = W(a.payment_method_kaspi), f = W(a.payment_method_card), C = typeof window < "u" && window.self === window.top, _ = Xe() === "ios", b = !!(o != null && o.onlyKaspiAvailable), P = !!(o != null && o.disableKaspi);
|
|
2323
|
+
return s != null && s.isKaspiOnly && l && !P ? [ee] : b ? s != null && s.isAvailable && l && !P ? [ee] : [] : (W(a.payment_method_apple_pay) && !me("apple_pay") && (Ce() && C || ye() || _ || st() === 16) && i.push(it), s != null && s.isAvailable && l && !P && i.push(ee), f && u.filter((T) => !T.isExpired).forEach((T) => {
|
|
2320
2324
|
i.push({
|
|
2321
|
-
iconType: ge(
|
|
2325
|
+
iconType: ge(T.attributes.mask),
|
|
2322
2326
|
type: "card",
|
|
2323
|
-
cardId:
|
|
2324
|
-
label: `•••• ${
|
|
2325
|
-
cardType:
|
|
2326
|
-
isDefault:
|
|
2327
|
+
cardId: T.id,
|
|
2328
|
+
label: `•••• ${T.attributes.mask.slice(-4)}`,
|
|
2329
|
+
cardType: T.type,
|
|
2330
|
+
isDefault: T.attributes.isDefault
|
|
2327
2331
|
});
|
|
2328
2332
|
}), W(a.payment_method_google_pay) && !me("google_pay") && !(o != null && o.disableGooglePay) && !Ce() && !ye() && i.push(at), W(a.payment_method_new_card) && i.push({
|
|
2329
2333
|
iconType: "new_card",
|
|
@@ -2332,19 +2336,19 @@ function Ot(e, t, o = {}) {
|
|
|
2332
2336
|
}), i);
|
|
2333
2337
|
}
|
|
2334
2338
|
function Re(e, t = {}) {
|
|
2335
|
-
var v,
|
|
2336
|
-
const o = (v = e == null ? void 0 : e.kaspi) == null ? void 0 : v.data, i = ((
|
|
2339
|
+
var v, S, k, I;
|
|
2340
|
+
const o = (v = e == null ? void 0 : e.kaspi) == null ? void 0 : v.data, i = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], s = ((I = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : I.attributes) || {}, u = W(s.payment_method_kaspi), a = W(s.payment_method_card), l = !!(t != null && t.disableKaspi), f = typeof window < "u" && window.self === window.top, B = Xe() === "ios", _ = W(s.payment_method_apple_pay) && !me("apple_pay") && (Ce() && f || ye() || B || st() === 16), b = W(s.payment_method_google_pay) && !me("google_pay") && !(t != null && t.disableGooglePay) && !Ce() && !ye();
|
|
2337
2341
|
if (o != null && o.isKaspiOnly && u && !l || t != null && t.onlyKaspiAvailable && (o != null && o.isAvailable) && u && !l)
|
|
2338
2342
|
return ee;
|
|
2339
|
-
const
|
|
2340
|
-
if ((
|
|
2343
|
+
const P = Rt(e);
|
|
2344
|
+
if ((P == null ? void 0 : P.type) === "kaspi_pay" && (o != null && o.isAvailable) && u && !l)
|
|
2341
2345
|
return ee;
|
|
2342
|
-
if ((
|
|
2343
|
-
if ((
|
|
2344
|
-
if ((
|
|
2346
|
+
if ((P == null ? void 0 : P.type) === "apple_pay" && _) return it;
|
|
2347
|
+
if ((P == null ? void 0 : P.type) === "google_pay" && b) return at;
|
|
2348
|
+
if ((P == null ? void 0 : P.type) === "new_card" && W(s.payment_method_new_card))
|
|
2345
2349
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
2346
|
-
if ((
|
|
2347
|
-
const R =
|
|
2350
|
+
if ((P == null ? void 0 : P.type) === "card" && a) {
|
|
2351
|
+
const R = P.cardId != null ? i.find((T) => !T.isExpired && String(T.id) === P.cardId) : null;
|
|
2348
2352
|
if (R)
|
|
2349
2353
|
return {
|
|
2350
2354
|
iconType: ge(R.attributes.mask),
|
|
@@ -2355,9 +2359,9 @@ function Re(e, t = {}) {
|
|
|
2355
2359
|
};
|
|
2356
2360
|
}
|
|
2357
2361
|
if (a) {
|
|
2358
|
-
const R = i.find((
|
|
2362
|
+
const R = i.find((T) => {
|
|
2359
2363
|
var x;
|
|
2360
|
-
return ((x =
|
|
2364
|
+
return ((x = T.attributes) == null ? void 0 : x.isDefault) && !T.isExpired;
|
|
2361
2365
|
});
|
|
2362
2366
|
if (R)
|
|
2363
2367
|
return {
|
|
@@ -2369,13 +2373,13 @@ function Re(e, t = {}) {
|
|
|
2369
2373
|
};
|
|
2370
2374
|
}
|
|
2371
2375
|
if (o != null && o.isAvailable && u && !l) return ee;
|
|
2372
|
-
const
|
|
2373
|
-
return
|
|
2374
|
-
iconType: ge(
|
|
2376
|
+
const L = a ? i.find((R) => !R.isExpired) : null;
|
|
2377
|
+
return L ? {
|
|
2378
|
+
iconType: ge(L.attributes.mask),
|
|
2375
2379
|
type: "card",
|
|
2376
|
-
cardId:
|
|
2377
|
-
label: `••••${
|
|
2378
|
-
cardType:
|
|
2380
|
+
cardId: L.id,
|
|
2381
|
+
label: `••••${L.attributes.mask.slice(-4)}`,
|
|
2382
|
+
cardType: L.type
|
|
2379
2383
|
} : null;
|
|
2380
2384
|
}
|
|
2381
2385
|
function ct(e) {
|
|
@@ -2670,6 +2674,7 @@ function jt(e) {
|
|
|
2670
2674
|
onlyKaspiAvailable: !!e.onlyKaspiAvailable,
|
|
2671
2675
|
disableKaspi: !!e.disableKaspi,
|
|
2672
2676
|
disableGooglePay: !!e.disableGooglePay,
|
|
2677
|
+
disableUseBalance: !!e.disableUseBalance,
|
|
2673
2678
|
isNativeAndroid: !!e.isNativeAndroid,
|
|
2674
2679
|
isFridge: !!e.isFridge,
|
|
2675
2680
|
bonuses: s
|
|
@@ -2923,18 +2928,18 @@ function cn(e) {
|
|
|
2923
2928
|
useBonuses: B,
|
|
2924
2929
|
coupon: _,
|
|
2925
2930
|
useCoupon: b,
|
|
2926
|
-
couponDisabled:
|
|
2927
|
-
cashbackFormatted:
|
|
2931
|
+
couponDisabled: P,
|
|
2932
|
+
cashbackFormatted: L,
|
|
2928
2933
|
disabled: v,
|
|
2929
|
-
paymentMethodDisabled:
|
|
2930
|
-
loading:
|
|
2934
|
+
paymentMethodDisabled: S = !1,
|
|
2935
|
+
loading: k,
|
|
2931
2936
|
showFreedomBtn: I,
|
|
2932
2937
|
freedomAmountFormatted: R,
|
|
2933
|
-
t:
|
|
2938
|
+
t: T,
|
|
2934
2939
|
currency: x
|
|
2935
|
-
} = e, N = (s == null ? void 0 : s.label) ??
|
|
2940
|
+
} = e, N = (s == null ? void 0 : s.label) ?? T("selectMethod"), q = Ee(s), J = ut(u, a), F = sn(l, f, C, B, _, b, P, T, x), M = an(L, T), m = (a == null ? void 0 : a.type) === "google_pay", g = (a == null ? void 0 : a.type) === "apple_pay", h = m || g;
|
|
2936
2941
|
return `
|
|
2937
|
-
<div class="choco-widget-bottom-bar" role="region" aria-label="${
|
|
2942
|
+
<div class="choco-widget-bottom-bar" role="region" aria-label="${T("paymentMethod")}">
|
|
2938
2943
|
${F}
|
|
2939
2944
|
<div class="choco-widget-payment-info">
|
|
2940
2945
|
${I ? `
|
|
@@ -2942,7 +2947,7 @@ function cn(e) {
|
|
|
2942
2947
|
class="choco-widget-freedom-card-btn"
|
|
2943
2948
|
data-action="freedom-card"
|
|
2944
2949
|
type="button"
|
|
2945
|
-
${v ||
|
|
2950
|
+
${v || k ? "disabled" : ""}
|
|
2946
2951
|
>
|
|
2947
2952
|
от ${R} по карте Freedom
|
|
2948
2953
|
</button>
|
|
@@ -2951,11 +2956,11 @@ function cn(e) {
|
|
|
2951
2956
|
<button
|
|
2952
2957
|
class="choco-widget-payment-method ${(s == null ? void 0 : s.type) || ""}"
|
|
2953
2958
|
data-action="change-method"
|
|
2954
|
-
aria-label="${
|
|
2959
|
+
aria-label="${T("paymentMethod")}: ${N}"
|
|
2955
2960
|
type="button"
|
|
2956
|
-
${
|
|
2961
|
+
${S || v || k ? "disabled" : ""}
|
|
2957
2962
|
>
|
|
2958
|
-
<div class="choco-widget-method-label">${
|
|
2963
|
+
<div class="choco-widget-method-label">${T("paymentMethod")}</div>
|
|
2959
2964
|
<div class="choco-widget-method-value">
|
|
2960
2965
|
<div class="choco-widget-method-icon-wrapper ${s == null ? void 0 : s.type}" aria-hidden="true">${q}</div>
|
|
2961
2966
|
<div class="choco-widget-method-details">
|
|
@@ -2969,17 +2974,17 @@ function cn(e) {
|
|
|
2969
2974
|
</div>
|
|
2970
2975
|
</button>
|
|
2971
2976
|
<div class="choco-widget-google-pay-amount ${h ? "" : "choco-widget-google-pay-amount--hidden"}" aria-live="polite">
|
|
2972
|
-
<div class="choco-widget-google-pay-amount-label">${
|
|
2973
|
-
${i ? `<div class="choco-widget-google-pay-amount-value">${
|
|
2977
|
+
<div class="choco-widget-google-pay-amount-label">${T("total")} ${t}</div>
|
|
2978
|
+
${i ? `<div class="choco-widget-google-pay-amount-value">${T("instead")} <span class="choco-widget-google-pay-amount-value-number">${o || ""}</span></div>` : ""}
|
|
2974
2979
|
</div>
|
|
2975
2980
|
<button
|
|
2976
|
-
class="choco-widget-pay-button ${
|
|
2981
|
+
class="choco-widget-pay-button ${k ? "choco-widget-pay-button--loading" : ""} ${h ? "choco-widget-pay-button--hidden" : ""}"
|
|
2977
2982
|
data-action="pay"
|
|
2978
|
-
aria-label="${
|
|
2983
|
+
aria-label="${S ? T("login") : `${T("pay")} ${t}`}"
|
|
2979
2984
|
type="button"
|
|
2980
|
-
${v ||
|
|
2985
|
+
${v || k ? "disabled" : ""}
|
|
2981
2986
|
>
|
|
2982
|
-
${
|
|
2987
|
+
${S ? T("login") : `${T("pay")} ${t}`}
|
|
2983
2988
|
</button>
|
|
2984
2989
|
</div>
|
|
2985
2990
|
<div class="choco-widget-google-pay-row ${m ? "" : "choco-widget-google-pay-row--hidden"}">
|
|
@@ -3011,7 +3016,7 @@ function cn(e) {
|
|
|
3011
3016
|
<path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3012
3017
|
</svg>
|
|
3013
3018
|
</button>
|
|
3014
|
-
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${
|
|
3019
|
+
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${T("paymentMethods")}</h3>
|
|
3015
3020
|
<button
|
|
3016
3021
|
class="choco-widget-sheet-button choco-widget-sheet-button--edit"
|
|
3017
3022
|
data-action="edit-sheet"
|
|
@@ -3026,7 +3031,7 @@ function cn(e) {
|
|
|
3026
3031
|
<button
|
|
3027
3032
|
class="choco-widget-sheet-button choco-widget-sheet-button--previous"
|
|
3028
3033
|
data-action="previous-sheet"
|
|
3029
|
-
aria-label="${
|
|
3034
|
+
aria-label="${T("back")}"
|
|
3030
3035
|
type="button"
|
|
3031
3036
|
style="display: none;"
|
|
3032
3037
|
>
|
|
@@ -3041,8 +3046,8 @@ function cn(e) {
|
|
|
3041
3046
|
</div>
|
|
3042
3047
|
<div class="choco-widget-sheet-delete-confirm" data-delete-confirm="content" aria-hidden="true">
|
|
3043
3048
|
<div class="choco-widget-sheet-delete-confirm-actions">
|
|
3044
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${
|
|
3045
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${
|
|
3049
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${T("cancel")}</button>
|
|
3050
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${T("delete")}</button>
|
|
3046
3051
|
</div>
|
|
3047
3052
|
</div>
|
|
3048
3053
|
${M}
|
|
@@ -3052,10 +3057,10 @@ function cn(e) {
|
|
|
3052
3057
|
<div class="choco-widget-add-card-sheet choco-widget-payment-sheet" data-sheet="add-card" aria-hidden="true" style="display: none;">
|
|
3053
3058
|
<div class="choco-widget-sheet-content choco-widget-add-card-sheet-content">
|
|
3054
3059
|
<div class="choco-widget-sheet-header">
|
|
3055
|
-
<h3 class="choco-widget-sheet-title">${
|
|
3060
|
+
<h3 class="choco-widget-sheet-title">${T("addCard")}</h3>
|
|
3056
3061
|
</div>
|
|
3057
3062
|
<div class="choco-widget-add-card-iframe-wrapper">
|
|
3058
|
-
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${
|
|
3063
|
+
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${T("addCard")}" sandbox="allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts"></iframe>
|
|
3059
3064
|
</div>
|
|
3060
3065
|
</div>
|
|
3061
3066
|
</div>
|
|
@@ -3093,10 +3098,10 @@ function hn(e) {
|
|
|
3093
3098
|
lt(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = An());
|
|
3094
3099
|
}
|
|
3095
3100
|
function fn(e) {
|
|
3096
|
-
var B, _, b,
|
|
3101
|
+
var B, _, b, P, L;
|
|
3097
3102
|
if (e._destroyed || !lt(e)) return;
|
|
3098
3103
|
e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
|
|
3099
|
-
const t = e.getAvailablePaymentMethods(), o = (B = e.checkoutContext) == null ? void 0 : B.data, i = e.config.currency || "KZT", s = (
|
|
3104
|
+
const t = e.getAvailablePaymentMethods(), o = (B = e.checkoutContext) == null ? void 0 : B.data, i = e.config.currency || "KZT", s = (P = (b = (_ = o == null ? void 0 : o.balance) == null ? void 0 : _.data) == null ? void 0 : b.money) == null ? void 0 : P[i], u = !e.config.disableUseBalance && s > 0 ? K(s, e.config.locale, e.config.currency) : null, a = (L = o == null ? void 0 : o.cashback) == null ? void 0 : L.data, l = (a == null ? void 0 : a.cashbackAmount) > 0 ? K(a.cashbackAmount, e.config.locale, e.config.currency) : null, f = e._getPayableAmount(), C = f < e.config.amount;
|
|
3100
3105
|
e.container.innerHTML = cn({
|
|
3101
3106
|
amountFormatted: K(f, e.config.locale, e.config.currency),
|
|
3102
3107
|
originalAmountFormatted: K(
|
|
@@ -3125,7 +3130,7 @@ function fn(e) {
|
|
|
3125
3130
|
e.config.locale,
|
|
3126
3131
|
e.config.currency
|
|
3127
3132
|
),
|
|
3128
|
-
t: (v,
|
|
3133
|
+
t: (v, S) => e.t(v, S),
|
|
3129
3134
|
currency: i
|
|
3130
3135
|
}), e._attachEventListeners(), e.isOpen = !0, e._emitUserEvent("one_click_pay_cta_rendered", {
|
|
3131
3136
|
terminal_id: e.config.terminalId,
|
|
@@ -3174,13 +3179,13 @@ function dt(e) {
|
|
|
3174
3179
|
t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), o && e.selectedPaymentMethod && (o.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, o.textContent = e.selectedPaymentMethod.label), i && e.selectedPaymentMethod && (i.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, i.innerHTML = ln(e.selectedPaymentMethod)), ht(e);
|
|
3175
3180
|
}
|
|
3176
3181
|
function pe(e) {
|
|
3177
|
-
var _, b,
|
|
3182
|
+
var _, b, P, L, v, S;
|
|
3178
3183
|
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-pay-button"), o = (b = e.container) == null ? void 0 : b.querySelector(
|
|
3179
3184
|
".choco-widget-google-pay-amount"
|
|
3180
|
-
), i = (
|
|
3185
|
+
), i = (P = e.container) == null ? void 0 : P.querySelector(
|
|
3181
3186
|
".choco-widget-google-pay-amount-label"
|
|
3182
3187
|
);
|
|
3183
|
-
let s = (
|
|
3188
|
+
let s = (L = e.container) == null ? void 0 : L.querySelector(
|
|
3184
3189
|
".choco-widget-google-pay-amount-value"
|
|
3185
3190
|
), u = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3186
3191
|
".choco-widget-google-pay-amount-value-number"
|
|
@@ -3190,8 +3195,11 @@ function pe(e) {
|
|
|
3190
3195
|
e.config.locale,
|
|
3191
3196
|
e.config.currency
|
|
3192
3197
|
);
|
|
3193
|
-
|
|
3194
|
-
|
|
3198
|
+
if (t) {
|
|
3199
|
+
const k = e.paymentMethodDisabled ? e.t("login") : `${e.t("pay")} ${l}`;
|
|
3200
|
+
t.textContent = k, t.setAttribute("aria-label", k);
|
|
3201
|
+
}
|
|
3202
|
+
const B = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-freedom-card-btn");
|
|
3195
3203
|
if (B && (B.textContent = `от ${K(Math.round(a * 0.84), e.config.locale, e.config.currency)} по карте Freedom`), i && (i.textContent = `${e.t("total")} ${l}`), !f) {
|
|
3196
3204
|
s == null || s.remove();
|
|
3197
3205
|
return;
|
|
@@ -3201,16 +3209,16 @@ function pe(e) {
|
|
|
3201
3209
|
)), u ? u.textContent = C : s && (s.textContent = `${e.t("instead")} ${C}`);
|
|
3202
3210
|
}
|
|
3203
3211
|
function ht(e) {
|
|
3204
|
-
var f, C, B, _, b,
|
|
3212
|
+
var f, C, B, _, b, P, L, v, S, k;
|
|
3205
3213
|
const t = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "google_pay", o = ((C = e.selectedPaymentMethod) == null ? void 0 : C.type) === "apple_pay", i = t || o, s = (B = e.container) == null ? void 0 : B.querySelector(".choco-widget-pay-button"), u = (_ = e.container) == null ? void 0 : _.querySelector(
|
|
3206
3214
|
".choco-widget-google-pay-amount"
|
|
3207
|
-
), a = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), l = (
|
|
3215
|
+
), a = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), l = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-apple-pay-row");
|
|
3208
3216
|
if (s == null || s.classList.toggle("choco-widget-pay-button--hidden", i), u == null || u.classList.toggle(
|
|
3209
3217
|
"choco-widget-google-pay-amount--hidden",
|
|
3210
3218
|
!i
|
|
3211
3219
|
), a == null || a.classList.toggle("choco-widget-google-pay-row--hidden", !t), l == null || l.classList.toggle("choco-widget-apple-pay-row--hidden", !o), t) {
|
|
3212
3220
|
gn(e);
|
|
3213
|
-
const I = (
|
|
3221
|
+
const I = (L = e.container) == null ? void 0 : L.querySelector(
|
|
3214
3222
|
'[data-action="apple-pay-button-slot"]'
|
|
3215
3223
|
);
|
|
3216
3224
|
I && (I.innerHTML = "");
|
|
@@ -3222,9 +3230,9 @@ function ht(e) {
|
|
|
3222
3230
|
I && (I.innerHTML = ""), pn(e);
|
|
3223
3231
|
} else {
|
|
3224
3232
|
e._googlePayButtonRenderVersion += 1;
|
|
3225
|
-
const I = (
|
|
3233
|
+
const I = (S = e.container) == null ? void 0 : S.querySelector(
|
|
3226
3234
|
'[data-action="google-pay-button-slot"]'
|
|
3227
|
-
), R = (
|
|
3235
|
+
), R = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3228
3236
|
'[data-action="apple-pay-button-slot"]'
|
|
3229
3237
|
);
|
|
3230
3238
|
I && (I.innerHTML = ""), R && (R.innerHTML = "");
|
|
@@ -3304,28 +3312,28 @@ function ne(e) {
|
|
|
3304
3312
|
e.loading = !0, Y(e);
|
|
3305
3313
|
}
|
|
3306
3314
|
function j(e) {
|
|
3307
|
-
var _, b,
|
|
3315
|
+
var _, b, P, L, v, S, k, I;
|
|
3308
3316
|
e.loading = !1;
|
|
3309
|
-
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-pay-button"), i = (
|
|
3317
|
+
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-pay-button"), i = (P = e.container) == null ? void 0 : P.querySelector(
|
|
3310
3318
|
".choco-widget-google-pay-button-slot button"
|
|
3311
|
-
), s = (
|
|
3319
|
+
), s = (L = e.container) == null ? void 0 : L.querySelector(
|
|
3312
3320
|
".choco-widget-apple-pay-button-slot button"
|
|
3313
3321
|
), u = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3314
3322
|
".choco-widget-google-pay-amount"
|
|
3315
|
-
), a = (
|
|
3323
|
+
), a = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-google-pay-row"), l = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-apple-pay-row"), f = (I = e.container) == null ? void 0 : I.querySelector(
|
|
3316
3324
|
".choco-widget-balance-section"
|
|
3317
3325
|
), C = e._isInteractionBlocked(), B = e.paymentMethodDisabled || C;
|
|
3318
3326
|
t && (t.disabled = B), o && (o.disabled = C, o.classList.remove("choco-widget-pay-button--loading")), i && (i.disabled = C), s && (s.disabled = C), u == null || u.classList.toggle("choco-widget-wallet-blocked", C), u == null || u.setAttribute("aria-disabled", String(C)), a == null || a.classList.toggle("choco-widget-wallet-blocked", C), a == null || a.setAttribute("aria-disabled", String(C)), l == null || l.classList.toggle("choco-widget-wallet-blocked", C), l == null || l.setAttribute("aria-disabled", String(C)), f == null || f.classList.remove("disabled");
|
|
3319
3327
|
}
|
|
3320
3328
|
function Y(e) {
|
|
3321
|
-
var b,
|
|
3322
|
-
const t = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-payment-method"), o = (
|
|
3329
|
+
var b, P, L, v, S, k, I, R, T;
|
|
3330
|
+
const t = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-payment-method"), o = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-pay-button"), i = (L = e.container) == null ? void 0 : L.querySelector(".choco-widget-freedom-card-btn"), s = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3323
3331
|
".choco-widget-google-pay-button-slot button"
|
|
3324
|
-
), u = (
|
|
3332
|
+
), u = (S = e.container) == null ? void 0 : S.querySelector(
|
|
3325
3333
|
".choco-widget-apple-pay-button-slot button"
|
|
3326
|
-
), a = (
|
|
3334
|
+
), a = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3327
3335
|
".choco-widget-google-pay-amount"
|
|
3328
|
-
), l = (I = e.container) == null ? void 0 : I.querySelector(".choco-widget-google-pay-row"), f = (R = e.container) == null ? void 0 : R.querySelector(".choco-widget-apple-pay-row"), C = (
|
|
3336
|
+
), l = (I = e.container) == null ? void 0 : I.querySelector(".choco-widget-google-pay-row"), f = (R = e.container) == null ? void 0 : R.querySelector(".choco-widget-apple-pay-row"), C = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3329
3337
|
".choco-widget-balance-section"
|
|
3330
3338
|
), B = e._isInteractionBlocked(), _ = e.paymentMethodDisabled || B;
|
|
3331
3339
|
C == null || C.classList.toggle("disabled", B), t && (t.disabled = _), o && (o.disabled = B, o.classList.toggle("choco-widget-pay-button--loading", e.loading)), i && (i.disabled = B), s && (s.disabled = B), u && (u.disabled = B), a == null || a.classList.toggle("choco-widget-wallet-blocked", B), a == null || a.setAttribute("aria-disabled", String(B)), l == null || l.classList.toggle("choco-widget-wallet-blocked", B), l == null || l.setAttribute("aria-disabled", String(B)), f == null || f.classList.toggle("choco-widget-wallet-blocked", B), f == null || f.setAttribute("aria-disabled", String(B));
|
|
@@ -3703,8 +3711,8 @@ async function In(e, t) {
|
|
|
3703
3711
|
}, s.begin();
|
|
3704
3712
|
}
|
|
3705
3713
|
async function Qn(e, t) {
|
|
3706
|
-
var
|
|
3707
|
-
const o = (
|
|
3714
|
+
var S, k, I, R, T, x;
|
|
3715
|
+
const o = (S = e.checkoutContext) == null ? void 0 : S.data, i = ((I = (k = o == null ? void 0 : o.payment_methods) == null ? void 0 : k.data) == null ? void 0 : I.attributes) || {}, s = i.google_pay_settings || {};
|
|
3708
3716
|
if (!(i.payment_method_google_pay === "enabled" || i.payment_method_google_pay === !0)) {
|
|
3709
3717
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3710
3718
|
return;
|
|
@@ -3739,7 +3747,7 @@ async function Qn(e, t) {
|
|
|
3739
3747
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3740
3748
|
return;
|
|
3741
3749
|
}
|
|
3742
|
-
const
|
|
3750
|
+
const P = [
|
|
3743
3751
|
{
|
|
3744
3752
|
type: "CARD",
|
|
3745
3753
|
parameters: {
|
|
@@ -3752,10 +3760,10 @@ async function Qn(e, t) {
|
|
|
3752
3760
|
parameters: { gateway: a, gatewayMerchantId: l }
|
|
3753
3761
|
}
|
|
3754
3762
|
}
|
|
3755
|
-
],
|
|
3763
|
+
], L = {
|
|
3756
3764
|
apiVersion: 2,
|
|
3757
3765
|
apiVersionMinor: 0,
|
|
3758
|
-
allowedPaymentMethods:
|
|
3766
|
+
allowedPaymentMethods: P,
|
|
3759
3767
|
transactionInfo: {
|
|
3760
3768
|
totalPriceStatus: "FINAL",
|
|
3761
3769
|
totalPriceLabel: "Итого",
|
|
@@ -3771,14 +3779,14 @@ async function Qn(e, t) {
|
|
|
3771
3779
|
const N = await v.isReadyToPay({
|
|
3772
3780
|
apiVersion: 2,
|
|
3773
3781
|
apiVersionMinor: 0,
|
|
3774
|
-
allowedPaymentMethods:
|
|
3782
|
+
allowedPaymentMethods: P
|
|
3775
3783
|
});
|
|
3776
3784
|
if (!(N != null && N.result)) {
|
|
3777
3785
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3778
3786
|
return;
|
|
3779
3787
|
}
|
|
3780
3788
|
ne(e);
|
|
3781
|
-
const q = await v.loadPaymentData(
|
|
3789
|
+
const q = await v.loadPaymentData(L), J = (T = (R = q == null ? void 0 : q.paymentMethodData) == null ? void 0 : R.tokenizationData) == null ? void 0 : T.token;
|
|
3782
3790
|
if (!J) throw new Error(e.t("errorGooglePayPayment"));
|
|
3783
3791
|
const F = JSON.parse(J), M = await At(
|
|
3784
3792
|
e.apiUrl,
|
|
@@ -3825,7 +3833,7 @@ async function Sn(e, t, o) {
|
|
|
3825
3833
|
}
|
|
3826
3834
|
}
|
|
3827
3835
|
function Pn(e) {
|
|
3828
|
-
var a, l, f, C, B, _, b,
|
|
3836
|
+
var a, l, f, C, B, _, b, P, L, v, S, k;
|
|
3829
3837
|
const t = e.container;
|
|
3830
3838
|
(a = t.querySelector('[data-action="freedom-card"]')) == null || a.addEventListener("click", () => {
|
|
3831
3839
|
e.config.onFreedomLink && e.config.onFreedomLink();
|
|
@@ -3835,17 +3843,17 @@ function Pn(e) {
|
|
|
3835
3843
|
e.isPaymentSheetEditMode = !0, Ae(e), ue(e);
|
|
3836
3844
|
}), (_ = t.querySelector('[data-action="previous-sheet"]')) == null || _.addEventListener("click", () => {
|
|
3837
3845
|
e.isPaymentSheetEditMode = !1, Ae(e), ue(e);
|
|
3838
|
-
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ae(e)), (
|
|
3846
|
+
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ae(e)), (P = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || P.addEventListener("click", () => ve(e)), (L = t.querySelector('[data-action="confirm-delete-submit"]')) == null || L.addEventListener("click", () => {
|
|
3839
3847
|
if (e._pendingDeleteMethod) {
|
|
3840
3848
|
const I = e._pendingDeleteMethod;
|
|
3841
3849
|
De(e, !0), bn(e, I).then(() => G(e)).finally(() => De(e, !1));
|
|
3842
3850
|
}
|
|
3843
3851
|
}), t.querySelectorAll(".choco-widget-method-item").forEach((I) => {
|
|
3844
3852
|
I.addEventListener("click", (R) => {
|
|
3845
|
-
const
|
|
3853
|
+
const T = JSON.parse(
|
|
3846
3854
|
R.currentTarget.getAttribute("data-method") || "{}"
|
|
3847
3855
|
);
|
|
3848
|
-
gt(e,
|
|
3856
|
+
gt(e, T);
|
|
3849
3857
|
});
|
|
3850
3858
|
});
|
|
3851
3859
|
const o = t.querySelector('[data-sheet="payment"]');
|
|
@@ -3857,11 +3865,11 @@ function Pn(e) {
|
|
|
3857
3865
|
e.useBalance = I.target.checked, tt(e), e._updatePayButtonAmount();
|
|
3858
3866
|
}));
|
|
3859
3867
|
const s = t.querySelector('[data-action="toggle-bonuses"]');
|
|
3860
|
-
s && ((
|
|
3868
|
+
s && ((S = s.querySelector("input[type='checkbox']")) == null || S.addEventListener("change", (I) => {
|
|
3861
3869
|
e.useBonuses = I.target.checked, e.config.onAppliedBonus(e.useBonuses), tt(e), e._updatePayButtonAmount();
|
|
3862
3870
|
}));
|
|
3863
3871
|
const u = t.querySelector('[data-action="toggle-coupon"]');
|
|
3864
|
-
u && ((
|
|
3872
|
+
u && ((k = u.querySelector("input[type='checkbox']")) == null || k.addEventListener("change", (I) => {
|
|
3865
3873
|
e.useCoupon = I.target.checked, e._updatePayButtonAmount();
|
|
3866
3874
|
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), ht(e);
|
|
3867
3875
|
}
|
|
@@ -3957,7 +3965,7 @@ class ie {
|
|
|
3957
3965
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
3958
3966
|
}
|
|
3959
3967
|
_getPaymentBreakdown() {
|
|
3960
|
-
const t = this.config.amount, o = this._getBalanceAmount(), i = this.useBalance ? Math.min(o, t) : 0, s = t - i, u = this.useBalance && i >= t, a = this.useBonuses ? this._getAvailableBonus() : 0, l = Math.max(s - a, 0), f = this._getCouponDiscount(), C = Math.max(l - f, 0), B = this.useBalance ? t : C, _ = this.useBalance && !u,
|
|
3968
|
+
const t = this.config.amount, o = this._getBalanceAmount(), i = this.useBalance ? Math.min(o, t) : 0, s = t - i, u = this.useBalance && i >= t, a = this.useBonuses ? this._getAvailableBonus() : 0, l = Math.max(s - a, 0), f = this._getCouponDiscount(), C = Math.max(l - f, 0), B = this.useBalance ? t : C, _ = this.useBalance && !u, P = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
|
|
3961
3969
|
id: this.selectedCoupon.voucher_id,
|
|
3962
3970
|
template_id: this.selectedCoupon.template_id,
|
|
3963
3971
|
type: this.selectedCoupon.type
|
|
@@ -3968,7 +3976,7 @@ class ie {
|
|
|
3968
3976
|
checkoutAmount: B,
|
|
3969
3977
|
forceBalanceMethod: u,
|
|
3970
3978
|
useBalance: _,
|
|
3971
|
-
voucher:
|
|
3979
|
+
voucher: P
|
|
3972
3980
|
}
|
|
3973
3981
|
};
|
|
3974
3982
|
}
|