choco-one-click-payment 1.1.42 → 1.1.43
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 +191 -189
- package/dist/index.js +13 -13
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -183,7 +183,7 @@ function Be(e, t, o) {
|
|
|
183
183
|
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Qt(i);
|
|
184
184
|
}
|
|
185
185
|
const Ve = "choco_device_id";
|
|
186
|
-
function
|
|
186
|
+
function K(e, t = "ru", o = "KZT") {
|
|
187
187
|
const i = Number(e), s = t === "ru" ? "ru-RU" : "en-US";
|
|
188
188
|
return `${i.toLocaleString(s)} ${Et[o]}`;
|
|
189
189
|
}
|
|
@@ -237,7 +237,7 @@ function wt() {
|
|
|
237
237
|
Object.defineProperty(l, "__esModule", {
|
|
238
238
|
value: !0
|
|
239
239
|
}), l.Centrifuge = void 0;
|
|
240
|
-
var C = S(f(187)),
|
|
240
|
+
var C = S(f(187)), B = S(f(471)), _ = f(147), b = f(853);
|
|
241
241
|
function S(g) {
|
|
242
242
|
return g && g.__esModule ? g : { default: g };
|
|
243
243
|
}
|
|
@@ -249,20 +249,20 @@ function wt() {
|
|
|
249
249
|
return p && typeof Symbol == "function" && p.constructor === Symbol && p !== Symbol.prototype ? "symbol" : typeof p;
|
|
250
250
|
}, T(g);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function v(g, h) {
|
|
253
253
|
if (!(g instanceof h))
|
|
254
254
|
throw new TypeError("Cannot call a class as a function");
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function k(g, h) {
|
|
257
257
|
for (var p = 0; p < h.length; p++) {
|
|
258
258
|
var A = h[p];
|
|
259
259
|
A.enumerable = A.enumerable || !1, A.configurable = !0, "value" in A && (A.writable = !0), Object.defineProperty(g, A.key, A);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
return h &&
|
|
262
|
+
function w(g, h, p) {
|
|
263
|
+
return h && k(g.prototype, h), g;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function I(g, h) {
|
|
266
266
|
if (typeof h != "function" && h !== null)
|
|
267
267
|
throw new TypeError("Super expression must either be null or a function");
|
|
268
268
|
g.prototype = Object.create(h && h.prototype, { constructor: { value: g, writable: !0, configurable: !0 } }), h && R(g, h);
|
|
@@ -312,11 +312,11 @@ function wt() {
|
|
|
312
312
|
}, J(g);
|
|
313
313
|
}
|
|
314
314
|
var F = "timeout", M = "connection closed", m = /* @__PURE__ */ (function(g) {
|
|
315
|
-
|
|
315
|
+
I(p, g);
|
|
316
316
|
var h = L(p);
|
|
317
317
|
function p(A, n) {
|
|
318
318
|
var r;
|
|
319
|
-
return
|
|
319
|
+
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 = {
|
|
320
320
|
protocol: "",
|
|
321
321
|
debug: !1,
|
|
322
322
|
name: "js",
|
|
@@ -351,7 +351,7 @@ function wt() {
|
|
|
351
351
|
disableWithCredentials: !1
|
|
352
352
|
}, r._configure(n), r;
|
|
353
353
|
}
|
|
354
|
-
return
|
|
354
|
+
return w(p, [{
|
|
355
355
|
key: "setToken",
|
|
356
356
|
value: function(n) {
|
|
357
357
|
this._token = n;
|
|
@@ -951,10 +951,10 @@ function wt() {
|
|
|
951
951
|
token: re
|
|
952
952
|
}
|
|
953
953
|
}, le = r._getSub(n);
|
|
954
|
-
le !== null && r._call(Pe).then(function(
|
|
955
|
-
r._subRefreshResponse(n, r._decoder.decodeCommandResult(r._methodType.SUB_REFRESH,
|
|
956
|
-
}, function(
|
|
957
|
-
r._subRefreshError(n,
|
|
954
|
+
le !== null && r._call(Pe).then(function(V) {
|
|
955
|
+
r._subRefreshResponse(n, r._decoder.decodeCommandResult(r._methodType.SUB_REFRESH, V.result)), V.next && V.next();
|
|
956
|
+
}, function(V) {
|
|
957
|
+
r._subRefreshError(n, V.error), V.next && V.next();
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
}
|
|
@@ -1470,8 +1470,8 @@ function wt() {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
var le = {};
|
|
1472
1472
|
if (D.data.channels)
|
|
1473
|
-
for (var
|
|
1474
|
-
var ke = D.data.channels[
|
|
1473
|
+
for (var V in D.data.channels) {
|
|
1474
|
+
var ke = D.data.channels[V];
|
|
1475
1475
|
ke.channel && (le[ke.channel] = ke.token);
|
|
1476
1476
|
}
|
|
1477
1477
|
var Fe = !1;
|
|
@@ -1536,7 +1536,7 @@ function wt() {
|
|
|
1536
1536
|
var d = this._getSub(n);
|
|
1537
1537
|
if (d !== null)
|
|
1538
1538
|
return d._setEvents(r), d._isUnsubscribed() && d.subscribe(c), d;
|
|
1539
|
-
var y = new
|
|
1539
|
+
var y = new B.default(this, n, r);
|
|
1540
1540
|
return this._subs[n] = y, y.subscribe(c), y;
|
|
1541
1541
|
}
|
|
1542
1542
|
}]), p;
|
|
@@ -1551,8 +1551,8 @@ function wt() {
|
|
|
1551
1551
|
Object.defineProperty(l, "__esModule", {
|
|
1552
1552
|
value: !0
|
|
1553
1553
|
}), l.default = void 0;
|
|
1554
|
-
var C = f(382),
|
|
1555
|
-
l.default =
|
|
1554
|
+
var C = f(382), B = C.Centrifuge;
|
|
1555
|
+
l.default = B, a.exports = l.default;
|
|
1556
1556
|
})
|
|
1557
1557
|
),
|
|
1558
1558
|
/***/
|
|
@@ -1562,18 +1562,18 @@ function wt() {
|
|
|
1562
1562
|
Object.defineProperty(l, "__esModule", {
|
|
1563
1563
|
value: !0
|
|
1564
1564
|
}), l.JsonPushType = l.JsonMethodType = l.JsonEncoder = l.JsonDecoder = void 0;
|
|
1565
|
-
function f(
|
|
1566
|
-
if (!(
|
|
1565
|
+
function f(v, k) {
|
|
1566
|
+
if (!(v instanceof k))
|
|
1567
1567
|
throw new TypeError("Cannot call a class as a function");
|
|
1568
1568
|
}
|
|
1569
|
-
function C(
|
|
1570
|
-
for (var
|
|
1571
|
-
var
|
|
1572
|
-
|
|
1569
|
+
function C(v, k) {
|
|
1570
|
+
for (var w = 0; w < k.length; w++) {
|
|
1571
|
+
var I = k[w];
|
|
1572
|
+
I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(v, I.key, I);
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function v
|
|
1576
|
-
return
|
|
1575
|
+
function B(v, k, w) {
|
|
1576
|
+
return k && C(v.prototype, k), v;
|
|
1577
1577
|
}
|
|
1578
1578
|
var _ = {
|
|
1579
1579
|
CONNECT: 0,
|
|
@@ -1600,50 +1600,50 @@ function wt() {
|
|
|
1600
1600
|
};
|
|
1601
1601
|
l.JsonPushType = b;
|
|
1602
1602
|
var S = /* @__PURE__ */ (function() {
|
|
1603
|
-
function
|
|
1604
|
-
f(this,
|
|
1603
|
+
function v() {
|
|
1604
|
+
f(this, v);
|
|
1605
1605
|
}
|
|
1606
|
-
return v
|
|
1606
|
+
return B(v, [{
|
|
1607
1607
|
key: "encodeCommands",
|
|
1608
|
-
value: function(
|
|
1609
|
-
return
|
|
1610
|
-
return JSON.stringify(
|
|
1608
|
+
value: function(w) {
|
|
1609
|
+
return w.map(function(I) {
|
|
1610
|
+
return JSON.stringify(I);
|
|
1611
1611
|
}).join(`
|
|
1612
1612
|
`);
|
|
1613
1613
|
}
|
|
1614
|
-
}]),
|
|
1614
|
+
}]), v;
|
|
1615
1615
|
})();
|
|
1616
1616
|
l.JsonEncoder = S;
|
|
1617
1617
|
var T = /* @__PURE__ */ (function() {
|
|
1618
|
-
function
|
|
1619
|
-
f(this,
|
|
1618
|
+
function v() {
|
|
1619
|
+
f(this, v);
|
|
1620
1620
|
}
|
|
1621
|
-
return v
|
|
1621
|
+
return B(v, [{
|
|
1622
1622
|
key: "decodeReplies",
|
|
1623
|
-
value: function(
|
|
1624
|
-
return
|
|
1625
|
-
`).filter(function(
|
|
1626
|
-
return
|
|
1627
|
-
}).map(function(
|
|
1628
|
-
return JSON.parse(
|
|
1623
|
+
value: function(w) {
|
|
1624
|
+
return w.split(`
|
|
1625
|
+
`).filter(function(I) {
|
|
1626
|
+
return I !== "";
|
|
1627
|
+
}).map(function(I) {
|
|
1628
|
+
return JSON.parse(I);
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
}, {
|
|
1632
1632
|
key: "decodeCommandResult",
|
|
1633
|
-
value: function(
|
|
1634
|
-
return
|
|
1633
|
+
value: function(w, I) {
|
|
1634
|
+
return I;
|
|
1635
1635
|
}
|
|
1636
1636
|
}, {
|
|
1637
1637
|
key: "decodePush",
|
|
1638
|
-
value: function(
|
|
1639
|
-
return
|
|
1638
|
+
value: function(w) {
|
|
1639
|
+
return w;
|
|
1640
1640
|
}
|
|
1641
1641
|
}, {
|
|
1642
1642
|
key: "decodePushData",
|
|
1643
|
-
value: function(
|
|
1644
|
-
return
|
|
1643
|
+
value: function(w, I) {
|
|
1644
|
+
return I;
|
|
1645
1645
|
}
|
|
1646
|
-
}]),
|
|
1646
|
+
}]), v;
|
|
1647
1647
|
})();
|
|
1648
1648
|
l.JsonDecoder = T;
|
|
1649
1649
|
})
|
|
@@ -1663,7 +1663,7 @@ function wt() {
|
|
|
1663
1663
|
Object.defineProperty(l, "__esModule", {
|
|
1664
1664
|
value: !0
|
|
1665
1665
|
}), l.default = void 0;
|
|
1666
|
-
var
|
|
1666
|
+
var B = b(f(187)), _ = f(853);
|
|
1667
1667
|
function b(h) {
|
|
1668
1668
|
return h && h.__esModule ? h : { default: h };
|
|
1669
1669
|
}
|
|
@@ -1677,20 +1677,20 @@ function wt() {
|
|
|
1677
1677
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(h, n.key, n);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function v(h, p, A) {
|
|
1681
1681
|
return p && T(h.prototype, p), h;
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1683
|
+
function k(h, p) {
|
|
1684
1684
|
if (typeof p != "function" && p !== null)
|
|
1685
1685
|
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 &&
|
|
1686
|
+
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p && w(h, p);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1688
|
+
function w(h, p) {
|
|
1689
|
+
return w = Object.setPrototypeOf || function(n, r) {
|
|
1690
1690
|
return n.__proto__ = r, n;
|
|
1691
|
-
},
|
|
1691
|
+
}, w(h, p);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function I(h) {
|
|
1694
1694
|
var p = x();
|
|
1695
1695
|
return function() {
|
|
1696
1696
|
var n = N(h), r;
|
|
@@ -1730,15 +1730,15 @@ function wt() {
|
|
|
1730
1730
|
}, N(h);
|
|
1731
1731
|
}
|
|
1732
1732
|
var q = 0, J = 1, F = 2, M = 3, m = 4, g = /* @__PURE__ */ (function(h) {
|
|
1733
|
-
|
|
1734
|
-
var p =
|
|
1733
|
+
k(A, h);
|
|
1734
|
+
var p = I(A);
|
|
1735
1735
|
function A(n, r, c) {
|
|
1736
1736
|
var d;
|
|
1737
1737
|
return S(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
1738
|
this._centrifuge._debug("subscription error", y);
|
|
1739
1739
|
}), d;
|
|
1740
1740
|
}
|
|
1741
|
-
return
|
|
1741
|
+
return v(A, [{
|
|
1742
1742
|
key: "_nextPromiseId",
|
|
1743
1743
|
value: function() {
|
|
1744
1744
|
return ++this._promiseId;
|
|
@@ -1953,7 +1953,7 @@ function wt() {
|
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
}]), A;
|
|
1956
|
-
})(
|
|
1956
|
+
})(B.default);
|
|
1957
1957
|
l.default = g, a.exports = l.default;
|
|
1958
1958
|
})
|
|
1959
1959
|
),
|
|
@@ -1963,30 +1963,30 @@ function wt() {
|
|
|
1963
1963
|
(function(a, l, f) {
|
|
1964
1964
|
Object.defineProperty(l, "__esModule", {
|
|
1965
1965
|
value: !0
|
|
1966
|
-
}), l.backoff = b, l.errorExists = S, l.extend = T, l.isFunction =
|
|
1967
|
-
function C(
|
|
1968
|
-
return
|
|
1966
|
+
}), l.backoff = b, l.errorExists = S, l.extend = T, l.isFunction = B, l.log = _, l.startsWith = C;
|
|
1967
|
+
function C(v, k) {
|
|
1968
|
+
return v.lastIndexOf(k, 0) === 0;
|
|
1969
1969
|
}
|
|
1970
|
-
function v
|
|
1971
|
-
return
|
|
1970
|
+
function B(v) {
|
|
1971
|
+
return v == null ? !1 : typeof v == "function";
|
|
1972
1972
|
}
|
|
1973
|
-
function _(
|
|
1973
|
+
function _(v, k) {
|
|
1974
1974
|
if (f.g.console) {
|
|
1975
|
-
var
|
|
1976
|
-
|
|
1975
|
+
var w = f.g.console[v];
|
|
1976
|
+
B(w) && w.apply(f.g.console, k);
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
function b(
|
|
1980
|
-
var
|
|
1981
|
-
return Math.floor((1 -
|
|
1979
|
+
function b(v, k, w) {
|
|
1980
|
+
var I = 0.5 * Math.random(), R = Math.min(w, k * Math.pow(2, v + 1));
|
|
1981
|
+
return Math.floor((1 - I) * R);
|
|
1982
1982
|
}
|
|
1983
|
-
function S(
|
|
1984
|
-
return "error" in
|
|
1983
|
+
function S(v) {
|
|
1984
|
+
return "error" in v && v.error !== null;
|
|
1985
1985
|
}
|
|
1986
|
-
function T(
|
|
1987
|
-
for (var
|
|
1988
|
-
|
|
1989
|
-
return
|
|
1986
|
+
function T(v, k) {
|
|
1987
|
+
for (var w in k)
|
|
1988
|
+
k.hasOwnProperty(w) && (v[w] = k[w]);
|
|
1989
|
+
return v;
|
|
1990
1990
|
}
|
|
1991
1991
|
})
|
|
1992
1992
|
),
|
|
@@ -2002,7 +2002,7 @@ function wt() {
|
|
|
2002
2002
|
} : C = function(g) {
|
|
2003
2003
|
return Object.getOwnPropertyNames(g);
|
|
2004
2004
|
};
|
|
2005
|
-
function
|
|
2005
|
+
function B(m) {
|
|
2006
2006
|
console && console.warn && console.warn(m);
|
|
2007
2007
|
}
|
|
2008
2008
|
var _ = Number.isNaN || function(g) {
|
|
@@ -2034,11 +2034,11 @@ function wt() {
|
|
|
2034
2034
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + g + ".");
|
|
2035
2035
|
return this._maxListeners = g, this;
|
|
2036
2036
|
};
|
|
2037
|
-
function
|
|
2037
|
+
function v(m) {
|
|
2038
2038
|
return m._maxListeners === void 0 ? b.defaultMaxListeners : m._maxListeners;
|
|
2039
2039
|
}
|
|
2040
2040
|
b.prototype.getMaxListeners = function() {
|
|
2041
|
-
return
|
|
2041
|
+
return v(this);
|
|
2042
2042
|
}, b.prototype.emit = function(g) {
|
|
2043
2043
|
for (var h = [], p = 1; p < arguments.length; p++) h.push(arguments[p]);
|
|
2044
2044
|
var A = g === "error", n = this._events;
|
|
@@ -2063,7 +2063,7 @@ function wt() {
|
|
|
2063
2063
|
f(E[p], this, h);
|
|
2064
2064
|
return !0;
|
|
2065
2065
|
};
|
|
2066
|
-
function
|
|
2066
|
+
function k(m, g, h, p) {
|
|
2067
2067
|
var A, n, r;
|
|
2068
2068
|
if (T(h), n = m._events, n === void 0 ? (n = m._events = /* @__PURE__ */ Object.create(null), m._eventsCount = 0) : (n.newListener !== void 0 && (m.emit(
|
|
2069
2069
|
"newListener",
|
|
@@ -2071,30 +2071,30 @@ function wt() {
|
|
|
2071
2071
|
h.listener ? h.listener : h
|
|
2072
2072
|
), n = m._events), r = n[g]), r === void 0)
|
|
2073
2073
|
r = n[g] = h, ++m._eventsCount;
|
|
2074
|
-
else if (typeof r == "function" ? r = n[g] = p ? [h, r] : [r, h] : p ? r.unshift(h) : r.push(h), A =
|
|
2074
|
+
else if (typeof r == "function" ? r = n[g] = p ? [h, r] : [r, h] : p ? r.unshift(h) : r.push(h), A = v(m), A > 0 && r.length > A && !r.warned) {
|
|
2075
2075
|
r.warned = !0;
|
|
2076
2076
|
var c = new Error("Possible EventEmitter memory leak detected. " + r.length + " " + String(g) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2077
|
-
c.name = "MaxListenersExceededWarning", c.emitter = m, c.type = g, c.count = r.length,
|
|
2077
|
+
c.name = "MaxListenersExceededWarning", c.emitter = m, c.type = g, c.count = r.length, B(c);
|
|
2078
2078
|
}
|
|
2079
2079
|
return m;
|
|
2080
2080
|
}
|
|
2081
2081
|
b.prototype.addListener = function(g, h) {
|
|
2082
|
-
return
|
|
2082
|
+
return k(this, g, h, !1);
|
|
2083
2083
|
}, b.prototype.on = b.prototype.addListener, b.prototype.prependListener = function(g, h) {
|
|
2084
|
-
return
|
|
2084
|
+
return k(this, g, h, !0);
|
|
2085
2085
|
};
|
|
2086
|
-
function
|
|
2086
|
+
function w() {
|
|
2087
2087
|
if (!this.fired)
|
|
2088
2088
|
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
2089
|
}
|
|
2090
|
-
function
|
|
2091
|
-
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A =
|
|
2090
|
+
function I(m, g, h) {
|
|
2091
|
+
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A = w.bind(p);
|
|
2092
2092
|
return A.listener = h, p.wrapFn = A, A;
|
|
2093
2093
|
}
|
|
2094
2094
|
b.prototype.once = function(g, h) {
|
|
2095
|
-
return T(h), this.on(g,
|
|
2095
|
+
return T(h), this.on(g, I(this, g, h)), this;
|
|
2096
2096
|
}, b.prototype.prependOnceListener = function(g, h) {
|
|
2097
|
-
return T(h), this.prependListener(g,
|
|
2097
|
+
return T(h), this.prependListener(g, I(this, g, h)), this;
|
|
2098
2098
|
}, b.prototype.removeListener = function(g, h) {
|
|
2099
2099
|
var p, A, n, r, c;
|
|
2100
2100
|
if (T(h), A = this._events, A === void 0)
|
|
@@ -2292,7 +2292,7 @@ const ee = {
|
|
|
2292
2292
|
label: "Google Pay",
|
|
2293
2293
|
type: "google_pay"
|
|
2294
2294
|
};
|
|
2295
|
-
function
|
|
2295
|
+
function W(e) {
|
|
2296
2296
|
return e === "enabled" || e === !0;
|
|
2297
2297
|
}
|
|
2298
2298
|
function Ze(e) {
|
|
@@ -2314,9 +2314,9 @@ function Rt(e) {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
2316
|
function Ot(e, t, o = {}) {
|
|
2317
|
-
var
|
|
2318
|
-
const i = [], s = (
|
|
2319
|
-
return s != null && s.isKaspiOnly && l && !S ? [ee] : b ? s != null && s.isAvailable && l && !S ? [ee] : [] : (
|
|
2317
|
+
var k, w, I, R;
|
|
2318
|
+
const i = [], s = (k = e == null ? void 0 : e.kaspi) == null ? void 0 : k.data, u = ((w = e == null ? void 0 : e.cards_v2) == null ? void 0 : w.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), S = !!(o != null && o.disableKaspi);
|
|
2319
|
+
return s != null && s.isKaspiOnly && l && !S ? [ee] : b ? s != null && s.isAvailable && l && !S ? [ee] : [] : (W(a.payment_method_apple_pay) && !me("apple_pay") && (Ce() && C || ye() || _ || st() === 16) && i.push(it), s != null && s.isAvailable && l && !S && i.push(ee), f && u.filter((L) => !L.isExpired).forEach((L) => {
|
|
2320
2320
|
i.push({
|
|
2321
2321
|
iconType: ge(L.attributes.mask),
|
|
2322
2322
|
type: "card",
|
|
@@ -2325,15 +2325,15 @@ function Ot(e, t, o = {}) {
|
|
|
2325
2325
|
cardType: L.type,
|
|
2326
2326
|
isDefault: L.attributes.isDefault
|
|
2327
2327
|
});
|
|
2328
|
-
}),
|
|
2328
|
+
}), 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
2329
|
iconType: "new_card",
|
|
2330
2330
|
type: "new_card",
|
|
2331
2331
|
label: t ? t("newCard") : "Оплата новой картой"
|
|
2332
2332
|
}), i);
|
|
2333
2333
|
}
|
|
2334
2334
|
function Re(e, t = {}) {
|
|
2335
|
-
var
|
|
2336
|
-
const o = (
|
|
2335
|
+
var v, k, w, I;
|
|
2336
|
+
const o = (v = e == null ? void 0 : e.kaspi) == null ? void 0 : v.data, i = ((k = e == null ? void 0 : e.cards_v2) == null ? void 0 : k.data) || [], s = ((I = (w = e == null ? void 0 : e.payment_methods) == null ? void 0 : w.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
2337
|
if (o != null && o.isKaspiOnly && u && !l || t != null && t.onlyKaspiAvailable && (o != null && o.isAvailable) && u && !l)
|
|
2338
2338
|
return ee;
|
|
2339
2339
|
const S = Rt(e);
|
|
@@ -2341,7 +2341,7 @@ function Re(e, t = {}) {
|
|
|
2341
2341
|
return ee;
|
|
2342
2342
|
if ((S == null ? void 0 : S.type) === "apple_pay" && _) return it;
|
|
2343
2343
|
if ((S == null ? void 0 : S.type) === "google_pay" && b) return at;
|
|
2344
|
-
if ((S == null ? void 0 : S.type) === "new_card" &&
|
|
2344
|
+
if ((S == null ? void 0 : S.type) === "new_card" && W(s.payment_method_new_card))
|
|
2345
2345
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
2346
2346
|
if ((S == null ? void 0 : S.type) === "card" && a) {
|
|
2347
2347
|
const R = S.cardId != null ? i.find((L) => !L.isExpired && String(L.id) === S.cardId) : null;
|
|
@@ -2453,7 +2453,7 @@ async function Se(e, t, o, i, s) {
|
|
|
2453
2453
|
return u.ok || await Z(u, s), u.json();
|
|
2454
2454
|
}
|
|
2455
2455
|
async function Nt(e, t, o) {
|
|
2456
|
-
var l, f, C,
|
|
2456
|
+
var l, f, C, B;
|
|
2457
2457
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2458
2458
|
method: "POST",
|
|
2459
2459
|
headers: {
|
|
@@ -2468,12 +2468,12 @@ async function Nt(e, t, o) {
|
|
|
2468
2468
|
})
|
|
2469
2469
|
});
|
|
2470
2470
|
i.ok || await Z(i, "Не удалось авторизоваться через track_id");
|
|
2471
|
-
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((
|
|
2471
|
+
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((B = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : B.refresh_token) ?? null;
|
|
2472
2472
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2473
2473
|
return { access_token: u, refresh_token: a };
|
|
2474
2474
|
}
|
|
2475
2475
|
async function Dt(e, t, o) {
|
|
2476
|
-
var l, f, C,
|
|
2476
|
+
var l, f, C, B;
|
|
2477
2477
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2478
2478
|
method: "POST",
|
|
2479
2479
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2484,7 +2484,7 @@ async function Dt(e, t, o) {
|
|
|
2484
2484
|
})
|
|
2485
2485
|
});
|
|
2486
2486
|
i.ok || await Z(i, "Не удалось обновить токен по refresh_token");
|
|
2487
|
-
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((
|
|
2487
|
+
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((B = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : B.refresh_token) ?? null;
|
|
2488
2488
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2489
2489
|
return { access_token: u, refresh_token: a };
|
|
2490
2490
|
}
|
|
@@ -2834,7 +2834,7 @@ function rn(e, t, o, i) {
|
|
|
2834
2834
|
<div class="choco-widget-balance-icon">
|
|
2835
2835
|
${Ue}
|
|
2836
2836
|
</div>
|
|
2837
|
-
<div class="choco-widget-balance-amount">${s ?
|
|
2837
|
+
<div class="choco-widget-balance-amount">${s ? K(e.amount, "ru", i) : 0}</div>
|
|
2838
2838
|
<label class="choco-widget-toggle">
|
|
2839
2839
|
<input type="checkbox" ${t ? "checked" : ""} />
|
|
2840
2840
|
<span class="choco-widget-toggle-slider"></span>
|
|
@@ -2845,7 +2845,7 @@ function rn(e, t, o, i) {
|
|
|
2845
2845
|
}
|
|
2846
2846
|
function on(e, t, o, i, s) {
|
|
2847
2847
|
if (!e) return "";
|
|
2848
|
-
const u = new Date(e.expires_at), a = isNaN(u.getTime()) ? "" : `${String(u.getDate()).padStart(2, "0")}.${String(u.getMonth() + 1).padStart(2, "0")}`, l = a ? i("couponUntil", { date: a }) : "", f = Number(e.reward_amount), C = Number.isFinite(f) && f > 0 ?
|
|
2848
|
+
const u = new Date(e.expires_at), a = isNaN(u.getTime()) ? "" : `${String(u.getDate()).padStart(2, "0")}.${String(u.getMonth() + 1).padStart(2, "0")}`, l = a ? i("couponUntil", { date: a }) : "", f = Number(e.reward_amount), C = Number.isFinite(f) && f > 0 ? K(f, "ru", s) : null;
|
|
2849
2849
|
return `
|
|
2850
2850
|
<div class="choco-widget-balance-toggle${o ? " choco-widget-balance-toggle--disabled" : ""}" data-action="toggle-coupon">
|
|
2851
2851
|
<div class="choco-widget-balance-info">
|
|
@@ -2920,29 +2920,29 @@ function cn(e) {
|
|
|
2920
2920
|
balanceFormatted: l,
|
|
2921
2921
|
useBalance: f,
|
|
2922
2922
|
bonuses: C,
|
|
2923
|
-
useBonuses:
|
|
2923
|
+
useBonuses: B,
|
|
2924
2924
|
coupon: _,
|
|
2925
2925
|
useCoupon: b,
|
|
2926
2926
|
couponDisabled: S,
|
|
2927
2927
|
cashbackFormatted: T,
|
|
2928
|
-
disabled:
|
|
2929
|
-
paymentMethodDisabled:
|
|
2930
|
-
loading:
|
|
2931
|
-
showFreedomBtn:
|
|
2928
|
+
disabled: v,
|
|
2929
|
+
paymentMethodDisabled: k = !1,
|
|
2930
|
+
loading: w,
|
|
2931
|
+
showFreedomBtn: I,
|
|
2932
2932
|
freedomAmountFormatted: R,
|
|
2933
2933
|
t: L,
|
|
2934
2934
|
currency: x
|
|
2935
|
-
} = e, N = (s == null ? void 0 : s.label) ?? L("selectMethod"), q = Ee(s), J = ut(u, a), F = sn(l, f, C,
|
|
2935
|
+
} = e, N = (s == null ? void 0 : s.label) ?? L("selectMethod"), q = Ee(s), J = ut(u, a), F = sn(l, f, C, B, _, b, S, L, x), M = an(T, L), m = (a == null ? void 0 : a.type) === "google_pay", g = (a == null ? void 0 : a.type) === "apple_pay", h = m || g;
|
|
2936
2936
|
return `
|
|
2937
2937
|
<div class="choco-widget-bottom-bar" role="region" aria-label="${L("paymentMethod")}">
|
|
2938
2938
|
${F}
|
|
2939
2939
|
<div class="choco-widget-payment-info">
|
|
2940
|
-
${
|
|
2940
|
+
${I ? `
|
|
2941
2941
|
<button
|
|
2942
2942
|
class="choco-widget-freedom-card-btn"
|
|
2943
2943
|
data-action="freedom-card"
|
|
2944
2944
|
type="button"
|
|
2945
|
-
${
|
|
2945
|
+
${v || w ? "disabled" : ""}
|
|
2946
2946
|
>
|
|
2947
2947
|
от ${R} по карте Freedom
|
|
2948
2948
|
</button>
|
|
@@ -2953,7 +2953,7 @@ function cn(e) {
|
|
|
2953
2953
|
data-action="change-method"
|
|
2954
2954
|
aria-label="${L("paymentMethod")}: ${N}"
|
|
2955
2955
|
type="button"
|
|
2956
|
-
${
|
|
2956
|
+
${k || v || w ? "disabled" : ""}
|
|
2957
2957
|
>
|
|
2958
2958
|
<div class="choco-widget-method-label">${L("paymentMethod")}</div>
|
|
2959
2959
|
<div class="choco-widget-method-value">
|
|
@@ -2973,11 +2973,11 @@ function cn(e) {
|
|
|
2973
2973
|
${i ? `<div class="choco-widget-google-pay-amount-value">${L("instead")} <span class="choco-widget-google-pay-amount-value-number">${o || ""}</span></div>` : ""}
|
|
2974
2974
|
</div>
|
|
2975
2975
|
<button
|
|
2976
|
-
class="choco-widget-pay-button ${
|
|
2976
|
+
class="choco-widget-pay-button ${w ? "choco-widget-pay-button--loading" : ""} ${h ? "choco-widget-pay-button--hidden" : ""}"
|
|
2977
2977
|
data-action="pay"
|
|
2978
2978
|
aria-label="${L("pay")} ${t}"
|
|
2979
2979
|
type="button"
|
|
2980
|
-
${
|
|
2980
|
+
${v || w ? "disabled" : ""}
|
|
2981
2981
|
>
|
|
2982
2982
|
${L("pay")} ${t}
|
|
2983
2983
|
</button>
|
|
@@ -3093,13 +3093,13 @@ function hn(e) {
|
|
|
3093
3093
|
lt(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = An());
|
|
3094
3094
|
}
|
|
3095
3095
|
function fn(e) {
|
|
3096
|
-
var
|
|
3096
|
+
var B, _, b, S, T;
|
|
3097
3097
|
if (e._destroyed || !lt(e)) return;
|
|
3098
3098
|
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 = (
|
|
3099
|
+
const t = e.getAvailablePaymentMethods(), o = (B = e.checkoutContext) == null ? void 0 : B.data, i = e.config.currency || "KZT", s = (S = (b = (_ = o == null ? void 0 : o.balance) == null ? void 0 : _.data) == null ? void 0 : b.money) == null ? void 0 : S[i], u = s > 0 ? K(s, e.config.locale, e.config.currency) : null, a = (T = o == null ? void 0 : o.cashback) == null ? void 0 : T.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
3100
|
e.container.innerHTML = cn({
|
|
3101
|
-
amountFormatted:
|
|
3102
|
-
originalAmountFormatted:
|
|
3101
|
+
amountFormatted: K(f, e.config.locale, e.config.currency),
|
|
3102
|
+
originalAmountFormatted: K(
|
|
3103
3103
|
e.config.amount,
|
|
3104
3104
|
e.config.locale,
|
|
3105
3105
|
e.config.currency
|
|
@@ -3120,12 +3120,12 @@ function fn(e) {
|
|
|
3120
3120
|
paymentMethodDisabled: e.paymentMethodDisabled,
|
|
3121
3121
|
loading: e.loading,
|
|
3122
3122
|
showFreedomBtn: !e.config.isFridge && e.config.onFreedomLink !== null,
|
|
3123
|
-
freedomAmountFormatted:
|
|
3124
|
-
Math.round(
|
|
3123
|
+
freedomAmountFormatted: K(
|
|
3124
|
+
Math.round(f * 0.84),
|
|
3125
3125
|
e.config.locale,
|
|
3126
3126
|
e.config.currency
|
|
3127
3127
|
),
|
|
3128
|
-
t: (
|
|
3128
|
+
t: (v, k) => e.t(v, k),
|
|
3129
3129
|
currency: i
|
|
3130
3130
|
}), e._attachEventListeners(), e.isOpen = !0, e._emitUserEvent("one_click_pay_cta_rendered", {
|
|
3131
3131
|
terminal_id: e.config.terminalId,
|
|
@@ -3134,8 +3134,8 @@ function fn(e) {
|
|
|
3134
3134
|
payment_method: e._getPaymentMethodForUserEvent()
|
|
3135
3135
|
}), requestAnimationFrame(() => {
|
|
3136
3136
|
requestAnimationFrame(() => {
|
|
3137
|
-
var
|
|
3138
|
-
e._destroyed || (
|
|
3137
|
+
var v;
|
|
3138
|
+
e._destroyed || (v = e.container) == null || v.classList.add("choco-one-click-widget--visible");
|
|
3139
3139
|
});
|
|
3140
3140
|
});
|
|
3141
3141
|
}
|
|
@@ -3174,23 +3174,25 @@ function dt(e) {
|
|
|
3174
3174
|
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
3175
|
}
|
|
3176
3176
|
function pe(e) {
|
|
3177
|
-
var
|
|
3178
|
-
const t = (
|
|
3177
|
+
var _, b, S, T, v, k;
|
|
3178
|
+
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-pay-button"), o = (b = e.container) == null ? void 0 : b.querySelector(
|
|
3179
3179
|
".choco-widget-google-pay-amount"
|
|
3180
|
-
), i = (
|
|
3180
|
+
), i = (S = e.container) == null ? void 0 : S.querySelector(
|
|
3181
3181
|
".choco-widget-google-pay-amount-label"
|
|
3182
3182
|
);
|
|
3183
|
-
let s = (
|
|
3183
|
+
let s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3184
3184
|
".choco-widget-google-pay-amount-value"
|
|
3185
|
-
), u = (
|
|
3185
|
+
), u = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3186
3186
|
".choco-widget-google-pay-amount-value-number"
|
|
3187
3187
|
);
|
|
3188
|
-
const a = e._getPayableAmount(), l =
|
|
3188
|
+
const a = e._getPayableAmount(), l = K(a, e.config.locale, e.config.currency), f = a < e.config.amount, C = K(
|
|
3189
3189
|
e.config.amount,
|
|
3190
3190
|
e.config.locale,
|
|
3191
3191
|
e.config.currency
|
|
3192
3192
|
);
|
|
3193
|
-
|
|
3193
|
+
t && (t.textContent = `${e.t("pay")} ${l}`, t.setAttribute("aria-label", `${e.t("pay")} ${l}`));
|
|
3194
|
+
const B = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-freedom-card-btn");
|
|
3195
|
+
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) {
|
|
3194
3196
|
s == null || s.remove();
|
|
3195
3197
|
return;
|
|
3196
3198
|
}
|
|
@@ -3199,8 +3201,8 @@ function pe(e) {
|
|
|
3199
3201
|
)), u ? u.textContent = C : s && (s.textContent = `${e.t("instead")} ${C}`);
|
|
3200
3202
|
}
|
|
3201
3203
|
function ht(e) {
|
|
3202
|
-
var f, C,
|
|
3203
|
-
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 = (
|
|
3204
|
+
var f, C, B, _, b, S, T, v, k, w;
|
|
3205
|
+
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(
|
|
3204
3206
|
".choco-widget-google-pay-amount"
|
|
3205
3207
|
), a = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), l = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-apple-pay-row");
|
|
3206
3208
|
if (s == null || s.classList.toggle("choco-widget-pay-button--hidden", i), u == null || u.classList.toggle(
|
|
@@ -3208,29 +3210,29 @@ function ht(e) {
|
|
|
3208
3210
|
!i
|
|
3209
3211
|
), 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) {
|
|
3210
3212
|
gn(e);
|
|
3211
|
-
const
|
|
3213
|
+
const I = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3212
3214
|
'[data-action="apple-pay-button-slot"]'
|
|
3213
3215
|
);
|
|
3214
|
-
|
|
3216
|
+
I && (I.innerHTML = "");
|
|
3215
3217
|
} else if (o) {
|
|
3216
3218
|
e._googlePayButtonRenderVersion += 1;
|
|
3217
|
-
const
|
|
3219
|
+
const I = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3218
3220
|
'[data-action="google-pay-button-slot"]'
|
|
3219
3221
|
);
|
|
3220
|
-
|
|
3222
|
+
I && (I.innerHTML = ""), pn(e);
|
|
3221
3223
|
} else {
|
|
3222
3224
|
e._googlePayButtonRenderVersion += 1;
|
|
3223
|
-
const
|
|
3225
|
+
const I = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3224
3226
|
'[data-action="google-pay-button-slot"]'
|
|
3225
|
-
), R = (
|
|
3227
|
+
), R = (w = e.container) == null ? void 0 : w.querySelector(
|
|
3226
3228
|
'[data-action="apple-pay-button-slot"]'
|
|
3227
3229
|
);
|
|
3228
|
-
|
|
3230
|
+
I && (I.innerHTML = ""), R && (R.innerHTML = "");
|
|
3229
3231
|
}
|
|
3230
3232
|
pe(e), Y(e);
|
|
3231
3233
|
}
|
|
3232
3234
|
async function gn(e) {
|
|
3233
|
-
var a, l, f, C,
|
|
3235
|
+
var a, l, f, C, B;
|
|
3234
3236
|
const t = (a = e.container) == null ? void 0 : a.querySelector(
|
|
3235
3237
|
'[data-action="google-pay-button-slot"]'
|
|
3236
3238
|
);
|
|
@@ -3243,7 +3245,7 @@ async function gn(e) {
|
|
|
3243
3245
|
return;
|
|
3244
3246
|
}
|
|
3245
3247
|
if (o !== e._googlePayButtonRenderVersion) return;
|
|
3246
|
-
if (!((
|
|
3248
|
+
if (!((B = (C = (f = window.google) == null ? void 0 : f.payments) == null ? void 0 : C.api) != null && B.PaymentsClient)) {
|
|
3247
3249
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3248
3250
|
return;
|
|
3249
3251
|
}
|
|
@@ -3302,31 +3304,31 @@ function ne(e) {
|
|
|
3302
3304
|
e.loading = !0, Y(e);
|
|
3303
3305
|
}
|
|
3304
3306
|
function j(e) {
|
|
3305
|
-
var _, b, S, T,
|
|
3307
|
+
var _, b, S, T, v, k, w, I;
|
|
3306
3308
|
e.loading = !1;
|
|
3307
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 = (S = e.container) == null ? void 0 : S.querySelector(
|
|
3308
3310
|
".choco-widget-google-pay-button-slot button"
|
|
3309
3311
|
), s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3310
3312
|
".choco-widget-apple-pay-button-slot button"
|
|
3311
|
-
), u = (
|
|
3313
|
+
), u = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3312
3314
|
".choco-widget-google-pay-amount"
|
|
3313
|
-
), a = (
|
|
3315
|
+
), a = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-apple-pay-row"), f = (I = e.container) == null ? void 0 : I.querySelector(
|
|
3314
3316
|
".choco-widget-balance-section"
|
|
3315
|
-
), C = e._isInteractionBlocked(),
|
|
3316
|
-
t && (t.disabled =
|
|
3317
|
+
), C = e._isInteractionBlocked(), B = e.paymentMethodDisabled || C;
|
|
3318
|
+
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");
|
|
3317
3319
|
}
|
|
3318
3320
|
function Y(e) {
|
|
3319
|
-
var b, S, T,
|
|
3320
|
-
const t = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-payment-method"), o = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-pay-button"), i = (T = e.container) == null ? void 0 : T.querySelector(".choco-widget-freedom-card-btn"), s = (
|
|
3321
|
+
var b, S, T, v, k, w, I, R, L;
|
|
3322
|
+
const t = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-payment-method"), o = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-pay-button"), i = (T = e.container) == null ? void 0 : T.querySelector(".choco-widget-freedom-card-btn"), s = (v = e.container) == null ? void 0 : v.querySelector(
|
|
3321
3323
|
".choco-widget-google-pay-button-slot button"
|
|
3322
|
-
), u = (
|
|
3324
|
+
), u = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3323
3325
|
".choco-widget-apple-pay-button-slot button"
|
|
3324
|
-
), a = (
|
|
3326
|
+
), a = (w = e.container) == null ? void 0 : w.querySelector(
|
|
3325
3327
|
".choco-widget-google-pay-amount"
|
|
3326
|
-
), l = (
|
|
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 = (L = e.container) == null ? void 0 : L.querySelector(
|
|
3327
3329
|
".choco-widget-balance-section"
|
|
3328
|
-
),
|
|
3329
|
-
C == null || C.classList.toggle("disabled",
|
|
3330
|
+
), B = e._isInteractionBlocked(), _ = e.paymentMethodDisabled || B;
|
|
3331
|
+
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));
|
|
3330
3332
|
}
|
|
3331
3333
|
function ft(e) {
|
|
3332
3334
|
var o;
|
|
@@ -3593,12 +3595,12 @@ async function vn(e) {
|
|
|
3593
3595
|
await rt(e);
|
|
3594
3596
|
const l = (a == null ? void 0 : a.id) ?? ((i = a == null ? void 0 : a.data) == null ? void 0 : i.id);
|
|
3595
3597
|
if (l && ce(e, String(l)), ((s = e.selectedPaymentMethod) == null ? void 0 : s.type) === "kaspi_pay") {
|
|
3596
|
-
const f = (a == null ? void 0 : a.attributes) || ((u = a == null ? void 0 : a.data) == null ? void 0 : u.attributes) || {}, C = f.action_link || f.action_url,
|
|
3598
|
+
const f = (a == null ? void 0 : a.attributes) || ((u = a == null ? void 0 : a.data) == null ? void 0 : u.attributes) || {}, C = f.action_link || f.action_url, B = f.action_url_type || f.action_type || "redirect";
|
|
3597
3599
|
if (C)
|
|
3598
3600
|
return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
|
|
3599
3601
|
action_link: C,
|
|
3600
3602
|
action_url: C,
|
|
3601
|
-
action_type:
|
|
3603
|
+
action_type: B,
|
|
3602
3604
|
event: a
|
|
3603
3605
|
}), a) : (window.location.href = C, a);
|
|
3604
3606
|
}
|
|
@@ -3667,8 +3669,8 @@ async function In(e, t) {
|
|
|
3667
3669
|
e.apiUrl,
|
|
3668
3670
|
e._getApiConfig(),
|
|
3669
3671
|
u.validationURL
|
|
3670
|
-
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f,
|
|
3671
|
-
s.completeMerchantValidation(
|
|
3672
|
+
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f, B = JSON.parse(atob(C));
|
|
3673
|
+
s.completeMerchantValidation(B);
|
|
3672
3674
|
} catch (f) {
|
|
3673
3675
|
console.error("Apple Pay session error:", f), s.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
|
|
3674
3676
|
}
|
|
@@ -3701,8 +3703,8 @@ async function In(e, t) {
|
|
|
3701
3703
|
}, s.begin();
|
|
3702
3704
|
}
|
|
3703
3705
|
async function Qn(e, t) {
|
|
3704
|
-
var
|
|
3705
|
-
const o = (
|
|
3706
|
+
var k, w, I, R, L, x;
|
|
3707
|
+
const o = (k = e.checkoutContext) == null ? void 0 : k.data, i = ((I = (w = o == null ? void 0 : o.payment_methods) == null ? void 0 : w.data) == null ? void 0 : I.attributes) || {}, s = i.google_pay_settings || {};
|
|
3706
3708
|
if (!(i.payment_method_google_pay === "enabled" || i.payment_method_google_pay === !0)) {
|
|
3707
3709
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3708
3710
|
return;
|
|
@@ -3714,8 +3716,8 @@ async function Qn(e, t) {
|
|
|
3714
3716
|
});
|
|
3715
3717
|
return;
|
|
3716
3718
|
}
|
|
3717
|
-
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco",
|
|
3718
|
-
if (f && !
|
|
3719
|
+
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco", B = s == null ? void 0 : s.google_merchant_id;
|
|
3720
|
+
if (f && !B) {
|
|
3719
3721
|
e.config.onError({
|
|
3720
3722
|
attributes: { message: e.t("errorGooglePaySettingsUnavailable") }
|
|
3721
3723
|
});
|
|
@@ -3761,12 +3763,12 @@ async function Qn(e, t) {
|
|
|
3761
3763
|
currencyCode: e.config.currency,
|
|
3762
3764
|
countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
|
|
3763
3765
|
},
|
|
3764
|
-
merchantInfo: f ? { merchantId:
|
|
3765
|
-
},
|
|
3766
|
+
merchantInfo: f ? { merchantId: B, merchantName: C } : { merchantName: C }
|
|
3767
|
+
}, v = new b.payments.api.PaymentsClient({
|
|
3766
3768
|
environment: f ? "PRODUCTION" : "TEST"
|
|
3767
3769
|
});
|
|
3768
3770
|
try {
|
|
3769
|
-
const N = await
|
|
3771
|
+
const N = await v.isReadyToPay({
|
|
3770
3772
|
apiVersion: 2,
|
|
3771
3773
|
apiVersionMinor: 0,
|
|
3772
3774
|
allowedPaymentMethods: S
|
|
@@ -3776,7 +3778,7 @@ async function Qn(e, t) {
|
|
|
3776
3778
|
return;
|
|
3777
3779
|
}
|
|
3778
3780
|
ne(e);
|
|
3779
|
-
const q = await
|
|
3781
|
+
const q = await v.loadPaymentData(T), J = (L = (R = q == null ? void 0 : q.paymentMethodData) == null ? void 0 : R.tokenizationData) == null ? void 0 : L.token;
|
|
3780
3782
|
if (!J) throw new Error(e.t("errorGooglePayPayment"));
|
|
3781
3783
|
const F = JSON.parse(J), M = await At(
|
|
3782
3784
|
e.apiUrl,
|
|
@@ -3823,23 +3825,23 @@ async function Sn(e, t, o) {
|
|
|
3823
3825
|
}
|
|
3824
3826
|
}
|
|
3825
3827
|
function Pn(e) {
|
|
3826
|
-
var a, l, f, C,
|
|
3828
|
+
var a, l, f, C, B, _, b, S, T, v, k, w;
|
|
3827
3829
|
const t = e.container;
|
|
3828
3830
|
(a = t.querySelector('[data-action="freedom-card"]')) == null || a.addEventListener("click", () => {
|
|
3829
3831
|
e.config.onFreedomLink && e.config.onFreedomLink();
|
|
3830
|
-
}), (l = t.querySelector('[data-action="pay"]')) == null || l.addEventListener("click", () => e.handlePayment()), (f = t.querySelector('[data-action="change-method"]')) == null || f.addEventListener("click", () => ft(e)), t.querySelectorAll('[data-action="close"]').forEach((
|
|
3832
|
+
}), (l = t.querySelector('[data-action="pay"]')) == null || l.addEventListener("click", () => e.handlePayment()), (f = t.querySelector('[data-action="change-method"]')) == null || f.addEventListener("click", () => ft(e)), t.querySelectorAll('[data-action="close"]').forEach((I) => I.addEventListener("click", () => e.close())), (C = t.querySelector('[data-action="close-sheet"]')) == null || C.addEventListener("click", () => {
|
|
3831
3833
|
e._pendingDeleteMethod ? ve(e) : G(e);
|
|
3832
|
-
}), (
|
|
3834
|
+
}), (B = t.querySelector('[data-action="edit-sheet"]')) == null || B.addEventListener("click", () => {
|
|
3833
3835
|
e.isPaymentSheetEditMode = !0, Ae(e), ue(e);
|
|
3834
3836
|
}), (_ = t.querySelector('[data-action="previous-sheet"]')) == null || _.addEventListener("click", () => {
|
|
3835
3837
|
e.isPaymentSheetEditMode = !1, Ae(e), ue(e);
|
|
3836
3838
|
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ae(e)), (S = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || S.addEventListener("click", () => ve(e)), (T = t.querySelector('[data-action="confirm-delete-submit"]')) == null || T.addEventListener("click", () => {
|
|
3837
3839
|
if (e._pendingDeleteMethod) {
|
|
3838
|
-
const
|
|
3839
|
-
De(e, !0), bn(e,
|
|
3840
|
+
const I = e._pendingDeleteMethod;
|
|
3841
|
+
De(e, !0), bn(e, I).then(() => G(e)).finally(() => De(e, !1));
|
|
3840
3842
|
}
|
|
3841
|
-
}), t.querySelectorAll(".choco-widget-method-item").forEach((
|
|
3842
|
-
|
|
3843
|
+
}), t.querySelectorAll(".choco-widget-method-item").forEach((I) => {
|
|
3844
|
+
I.addEventListener("click", (R) => {
|
|
3843
3845
|
const L = JSON.parse(
|
|
3844
3846
|
R.currentTarget.getAttribute("data-method") || "{}"
|
|
3845
3847
|
);
|
|
@@ -3847,20 +3849,20 @@ function Pn(e) {
|
|
|
3847
3849
|
});
|
|
3848
3850
|
});
|
|
3849
3851
|
const o = t.querySelector('[data-sheet="payment"]');
|
|
3850
|
-
o && (o.addEventListener("click", (
|
|
3851
|
-
|
|
3852
|
+
o && (o.addEventListener("click", (I) => {
|
|
3853
|
+
I.target === o && G(e);
|
|
3852
3854
|
}), wn(e, o));
|
|
3853
3855
|
const i = t.querySelector('[data-action="toggle-balance"]');
|
|
3854
|
-
i && ((
|
|
3855
|
-
e.useBalance =
|
|
3856
|
+
i && ((v = i.querySelector("input[type='checkbox']")) == null || v.addEventListener("change", (I) => {
|
|
3857
|
+
e.useBalance = I.target.checked, tt(e), e._updatePayButtonAmount();
|
|
3856
3858
|
}));
|
|
3857
3859
|
const s = t.querySelector('[data-action="toggle-bonuses"]');
|
|
3858
|
-
s && ((
|
|
3859
|
-
e.useBonuses =
|
|
3860
|
+
s && ((k = s.querySelector("input[type='checkbox']")) == null || k.addEventListener("change", (I) => {
|
|
3861
|
+
e.useBonuses = I.target.checked, e.config.onAppliedBonus(e.useBonuses), tt(e), e._updatePayButtonAmount();
|
|
3860
3862
|
}));
|
|
3861
3863
|
const u = t.querySelector('[data-action="toggle-coupon"]');
|
|
3862
|
-
u && ((
|
|
3863
|
-
e.useCoupon =
|
|
3864
|
+
u && ((w = u.querySelector("input[type='checkbox']")) == null || w.addEventListener("change", (I) => {
|
|
3865
|
+
e.useCoupon = I.target.checked, e._updatePayButtonAmount();
|
|
3864
3866
|
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), ht(e);
|
|
3865
3867
|
}
|
|
3866
3868
|
function kn(e, t) {
|
|
@@ -3874,12 +3876,12 @@ function wn(e, t) {
|
|
|
3874
3876
|
let u = 0, a = 0;
|
|
3875
3877
|
const l = (C) => {
|
|
3876
3878
|
a = C.clientY;
|
|
3877
|
-
const
|
|
3878
|
-
i.style.transform = `translateY(${
|
|
3879
|
+
const B = Math.max(0, a - u);
|
|
3880
|
+
i.style.transform = `translateY(${B}px)`;
|
|
3879
3881
|
}, f = (C) => {
|
|
3880
3882
|
o.releasePointerCapture(C.pointerId), o.removeEventListener("pointermove", l), o.removeEventListener("pointerup", f), o.removeEventListener("pointercancel", f);
|
|
3881
|
-
const
|
|
3882
|
-
if (i.classList.remove("choco-widget-sheet-content--dragging"),
|
|
3883
|
+
const B = Math.max(0, a - u);
|
|
3884
|
+
if (i.classList.remove("choco-widget-sheet-content--dragging"), B >= s) {
|
|
3883
3885
|
i.style.transform = "translateY(100%)";
|
|
3884
3886
|
const _ = () => {
|
|
3885
3887
|
i.removeEventListener("transitionend", _), i.style.transform = "", G(e);
|
|
@@ -3955,7 +3957,7 @@ class ie {
|
|
|
3955
3957
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
3956
3958
|
}
|
|
3957
3959
|
_getPaymentBreakdown() {
|
|
3958
|
-
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),
|
|
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, S = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
|
|
3959
3961
|
id: this.selectedCoupon.voucher_id,
|
|
3960
3962
|
template_id: this.selectedCoupon.template_id,
|
|
3961
3963
|
type: this.selectedCoupon.type
|
|
@@ -3963,7 +3965,7 @@ class ie {
|
|
|
3963
3965
|
return {
|
|
3964
3966
|
payableAmount: C,
|
|
3965
3967
|
checkoutOptions: {
|
|
3966
|
-
checkoutAmount:
|
|
3968
|
+
checkoutAmount: B,
|
|
3967
3969
|
forceBalanceMethod: u,
|
|
3968
3970
|
useBalance: _,
|
|
3969
3971
|
voucher: S
|