choco-one-click-payment 1.1.48 → 1.1.49

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 CHANGED
@@ -277,7 +277,7 @@ function Pr() {
277
277
  }, R(g, p);
278
278
  }
279
279
  function L(g) {
280
- var p = K();
280
+ var p = G();
281
281
  return function() {
282
282
  var d = z(g), s;
283
283
  if (p) {
@@ -300,7 +300,7 @@ function Pr() {
300
300
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
301
301
  return g;
302
302
  }
303
- function K() {
303
+ function G() {
304
304
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
305
305
  if (typeof Proxy == "function") return !0;
306
306
  try {
@@ -1733,12 +1733,12 @@ function Pr() {
1733
1733
  return d.__proto__ || Object.getPrototypeOf(d);
1734
1734
  }, D(p);
1735
1735
  }
1736
- var K = 0, z = 1, J = 2, M = 3, v = 4, g = /* @__PURE__ */ (function(p) {
1736
+ var G = 0, z = 1, J = 2, M = 3, v = 4, g = /* @__PURE__ */ (function(p) {
1737
1737
  S(d, p);
1738
1738
  var C = k(d);
1739
1739
  function d(s, a, A) {
1740
1740
  var f;
1741
- return I(this, d), f = C.call(this), f.channel = a, f._centrifuge = s, f._status = K, f._error = null, f._isResubscribe = !1, f._ready = !1, f._subscriptionPromise = null, f._noResubscribe = !1, f._recoverable = !1, f._recover = !1, f._setEvents(A), f._initializePromise(), f._promises = {}, f._promiseId = 0, f._subscribeData = null, f.on("error", function(E) {
1741
+ return I(this, d), f = C.call(this), f.channel = a, f._centrifuge = s, f._status = G, f._error = null, f._isResubscribe = !1, f._ready = !1, f._subscriptionPromise = null, f._noResubscribe = !1, f._recoverable = !1, f._recover = !1, f._setEvents(A), f._initializePromise(), f._promises = {}, f._promiseId = 0, f._subscribeData = null, f.on("error", function(E) {
1742
1742
  this._centrifuge._debug("subscription error", E);
1743
1743
  }), f;
1744
1744
  }
@@ -1787,7 +1787,7 @@ function Pr() {
1787
1787
  }, {
1788
1788
  key: "_isNew",
1789
1789
  value: function() {
1790
- return this._status === K;
1790
+ return this._status === G;
1791
1791
  }
1792
1792
  }, {
1793
1793
  key: "_isUnsubscribed",
@@ -1817,7 +1817,7 @@ function Pr() {
1817
1817
  }, {
1818
1818
  key: "_setNew",
1819
1819
  value: function() {
1820
- this._status = K;
1820
+ this._status = G;
1821
1821
  }
1822
1822
  }, {
1823
1823
  key: "_setSubscribing",
@@ -2142,7 +2142,7 @@ function Pr() {
2142
2142
  if (C === void 0)
2143
2143
  return [];
2144
2144
  var d = C[g];
2145
- return d === void 0 ? [] : typeof d == "function" ? p ? [d.listener || d] : [d] : p ? K(d) : q(d, d.length);
2145
+ return d === void 0 ? [] : typeof d == "function" ? p ? [d.listener || d] : [d] : p ? G(d) : q(d, d.length);
2146
2146
  }
2147
2147
  b.prototype.listeners = function(g) {
2148
2148
  return R(this, g, !0);
@@ -2175,7 +2175,7 @@ function Pr() {
2175
2175
  v[g] = v[g + 1];
2176
2176
  v.pop();
2177
2177
  }
2178
- function K(v) {
2178
+ function G(v) {
2179
2179
  for (var g = new Array(v.length), p = 0; p < g.length; ++p)
2180
2180
  g[p] = v[p].listener || v[p];
2181
2181
  return g;
@@ -2733,7 +2733,7 @@ function qr() {
2733
2733
  };
2734
2734
  }), t;
2735
2735
  }
2736
- const N = nt("logger", qr), Xn = 50, be = "?", an = /\(error: (.*)\)/, cn = /captureMessage|captureException/;
2736
+ const N = nt("logger", qr), Xn = 50, Ce = "?", an = /\(error: (.*)\)/, cn = /captureMessage|captureException/;
2737
2737
  function zr(...e) {
2738
2738
  const t = e.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
2739
2739
  return (n, r = 0, o = 0) => {
@@ -2766,7 +2766,7 @@ function Kr(e) {
2766
2766
  return /sentryWrapped/.test(Oe(t).function || "") && t.pop(), t.reverse(), cn.test(Oe(t).function || "") && (t.pop(), cn.test(Oe(t).function || "") && t.pop()), t.slice(0, Xn).map((n) => ({
2767
2767
  ...n,
2768
2768
  filename: n.filename || Oe(t).filename,
2769
- function: n.function || be
2769
+ function: n.function || Ce
2770
2770
  }));
2771
2771
  }
2772
2772
  function Oe(e) {
@@ -2820,7 +2820,7 @@ function Dt(e) {
2820
2820
  function Yr(e) {
2821
2821
  return e === null || Dt(e) || typeof e != "object" && typeof e != "function";
2822
2822
  }
2823
- function Ee(e) {
2823
+ function be(e) {
2824
2824
  return Pe(e, "Object");
2825
2825
  }
2826
2826
  function ot(e) {
@@ -2833,7 +2833,7 @@ function st(e) {
2833
2833
  return !!(e && e.then && typeof e.then == "function");
2834
2834
  }
2835
2835
  function Zr(e) {
2836
- return Ee(e) && "nativeEvent" in e && "preventDefault" in e && "stopPropagation" in e;
2836
+ return be(e) && "nativeEvent" in e && "preventDefault" in e && "stopPropagation" in e;
2837
2837
  }
2838
2838
  function it(e, t) {
2839
2839
  try {
@@ -2986,7 +2986,7 @@ function Et(e, t) {
2986
2986
  return e;
2987
2987
  }
2988
2988
  function so(e) {
2989
- if (!Ee(e))
2989
+ if (!be(e))
2990
2990
  return !1;
2991
2991
  try {
2992
2992
  const t = Object.getPrototypeOf(e).constructor.name;
@@ -3075,18 +3075,18 @@ var re;
3075
3075
  e[e.REJECTED = r] = "REJECTED";
3076
3076
  })(re || (re = {}));
3077
3077
  function he(e) {
3078
- return new G((t) => {
3078
+ return new W((t) => {
3079
3079
  t(e);
3080
3080
  });
3081
3081
  }
3082
3082
  function We(e) {
3083
- return new G((t, n) => {
3083
+ return new W((t, n) => {
3084
3084
  n(e);
3085
3085
  });
3086
3086
  }
3087
- class G {
3087
+ class W {
3088
3088
  constructor(t) {
3089
- G.prototype.__init.call(this), G.prototype.__init2.call(this), G.prototype.__init3.call(this), G.prototype.__init4.call(this), this._state = re.PENDING, this._handlers = [];
3089
+ W.prototype.__init.call(this), W.prototype.__init2.call(this), W.prototype.__init3.call(this), W.prototype.__init4.call(this), this._state = re.PENDING, this._handlers = [];
3090
3090
  try {
3091
3091
  t(this._resolve, this._reject);
3092
3092
  } catch (n) {
@@ -3095,7 +3095,7 @@ class G {
3095
3095
  }
3096
3096
  /** JSDoc */
3097
3097
  then(t, n) {
3098
- return new G((r, o) => {
3098
+ return new W((r, o) => {
3099
3099
  this._handlers.push([
3100
3100
  !1,
3101
3101
  (i) => {
@@ -3127,7 +3127,7 @@ class G {
3127
3127
  }
3128
3128
  /** JSDoc */
3129
3129
  finally(t) {
3130
- return new G((n, r) => {
3130
+ return new W((n, r) => {
3131
3131
  let o, i;
3132
3132
  return this.then(
3133
3133
  (c) => {
@@ -3410,7 +3410,7 @@ class Mt {
3410
3410
  const n = typeof t == "function" ? t(this) : t, [r, o] = n instanceof ce ? (
3411
3411
  // eslint-disable-next-line deprecation/deprecation
3412
3412
  [n.getScopeData(), n.getRequestSession()]
3413
- ) : Ee(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: h, fingerprint: y = [], propagationContext: m } = r || {};
3413
+ ) : be(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: h, fingerprint: y = [], propagationContext: m } = r || {};
3414
3414
  return this._tags = { ...this._tags, ...i }, this._extra = { ...this._extra, ...c }, this._contexts = { ...this._contexts, ...l }, u && Object.keys(u).length && (this._user = u), h && (this._level = h), y.length && (this._fingerprint = y), m && (this._propagationContext = m), o && (this._requestSession = o), this;
3415
3415
  }
3416
3416
  /**
@@ -3624,19 +3624,19 @@ class fo {
3624
3624
  return this._stack.length <= 1 ? !1 : !!this._stack.pop();
3625
3625
  }
3626
3626
  }
3627
- function ve() {
3627
+ function Ee() {
3628
3628
  const e = Ot(), t = Nt(e);
3629
3629
  return t.stack = t.stack || new fo(lo(), Ao());
3630
3630
  }
3631
3631
  function ho(e) {
3632
- return ve().withScope(e);
3632
+ return Ee().withScope(e);
3633
3633
  }
3634
3634
  function po(e, t) {
3635
- const n = ve();
3635
+ const n = Ee();
3636
3636
  return n.withScope(() => (n.getStackTop().scope = e, t(e)));
3637
3637
  }
3638
3638
  function yn(e) {
3639
- return ve().withScope(() => e(ve().getIsolationScope()));
3639
+ return Ee().withScope(() => e(Ee().getIsolationScope()));
3640
3640
  }
3641
3641
  function go() {
3642
3642
  return {
@@ -3644,8 +3644,8 @@ function go() {
3644
3644
  withScope: ho,
3645
3645
  withSetScope: po,
3646
3646
  withSetIsolationScope: (e, t) => yn(t),
3647
- getCurrentScope: () => ve().getScope(),
3648
- getIsolationScope: () => ve().getIsolationScope()
3647
+ getCurrentScope: () => Ee().getScope(),
3648
+ getIsolationScope: () => Ee().getIsolationScope()
3649
3649
  };
3650
3650
  }
3651
3651
  function Yn(e) {
@@ -4109,7 +4109,7 @@ function us(e, t, n, r) {
4109
4109
  return delete e.sdkProcessingMetadata, we(c, [[{ type: i }, e]]);
4110
4110
  }
4111
4111
  function Qt(e, t, n, r = 0) {
4112
- return new G((o, i) => {
4112
+ return new W((o, i) => {
4113
4113
  const c = e[r];
4114
4114
  if (t === null || typeof c != "function")
4115
4115
  o(t);
@@ -4607,7 +4607,7 @@ class Ts {
4607
4607
  * `false` otherwise
4608
4608
  */
4609
4609
  _isClientDoneProcessing(t) {
4610
- return new G((n) => {
4610
+ return new W((n) => {
4611
4611
  let r = 0;
4612
4612
  const o = 1, i = setInterval(() => {
4613
4613
  this._numProcessing == 0 ? (clearInterval(i), n(!0)) : (r += o, t && r >= t && (clearInterval(i), n(!1)));
@@ -4776,7 +4776,7 @@ function Ls(e, t) {
4776
4776
  if (st(e))
4777
4777
  return e.then(
4778
4778
  (r) => {
4779
- if (!Ee(r) && r !== null)
4779
+ if (!be(r) && r !== null)
4780
4780
  throw new Y(n);
4781
4781
  return r;
4782
4782
  },
@@ -4784,7 +4784,7 @@ function Ls(e, t) {
4784
4784
  throw new Y(`${t} rejected with ${r}`);
4785
4785
  }
4786
4786
  );
4787
- if (!Ee(e) && e !== null)
4787
+ if (!be(e) && e !== null)
4788
4788
  throw new Y(n);
4789
4789
  return e;
4790
4790
  }
@@ -4839,7 +4839,7 @@ function Os(e) {
4839
4839
  ), u;
4840
4840
  }
4841
4841
  function i(c) {
4842
- return new G((u, l) => {
4842
+ return new W((u, l) => {
4843
4843
  let h = t.length;
4844
4844
  if (!h)
4845
4845
  return u(!0);
@@ -5043,7 +5043,7 @@ function ei(e, t, n, r, o) {
5043
5043
  }
5044
5044
  return "code" in c && (i.tags = { ...i.tags, "DOMException.code": `${c.code}` }), i;
5045
5045
  }
5046
- return jn(t) ? pt(e, t) : Ee(t) || ot(t) ? (i = zs(e, t, n, o), _e(i, {
5046
+ return jn(t) ? pt(e, t) : be(t) || ot(t) ? (i = zs(e, t, n, o), _e(i, {
5047
5047
  synthetic: !0
5048
5048
  }), i) : (i = kt(e, t, n, r), dn(i, `${t}`), _e(i, {
5049
5049
  synthetic: !0
@@ -5227,7 +5227,7 @@ const li = 30, Ai = 50;
5227
5227
  function Pt(e, t, n, r) {
5228
5228
  const o = {
5229
5229
  filename: e,
5230
- function: t === "<anonymous>" ? be : t,
5230
+ function: t === "<anonymous>" ? Ce : t,
5231
5231
  in_app: !0
5232
5232
  // All browser frames are considered in_app
5233
5233
  };
@@ -5237,7 +5237,7 @@ const di = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, fi = /^\s*at (?:(.+?\)(?: \
5237
5237
  const t = di.exec(e);
5238
5238
  if (t) {
5239
5239
  const [, r, o, i] = t;
5240
- return Pt(r, be, +o, +i);
5240
+ return Pt(r, Ce, +o, +i);
5241
5241
  }
5242
5242
  const n = fi.exec(e);
5243
5243
  if (n) {
@@ -5245,7 +5245,7 @@ const di = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, fi = /^\s*at (?:(.+?\)(?: \
5245
5245
  const c = hi.exec(n[2]);
5246
5246
  c && (n[2] = c[1], n[3] = c[2], n[4] = c[3]);
5247
5247
  }
5248
- const [o, i] = ur(n[1] || be, n[2]);
5248
+ const [o, i] = ur(n[1] || Ce, n[2]);
5249
5249
  return Pt(i, o, n[3] ? +n[3] : void 0, n[4] ? +n[4] : void 0);
5250
5250
  }
5251
5251
  }, gi = [li, pi], yi = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i, mi = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, Ci = (e) => {
@@ -5255,13 +5255,13 @@ const di = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, fi = /^\s*at (?:(.+?\)(?: \
5255
5255
  const i = mi.exec(t[3]);
5256
5256
  i && (t[1] = t[1] || "eval", t[3] = i[1], t[4] = i[2], t[5] = "");
5257
5257
  }
5258
- let r = t[3], o = t[1] || be;
5258
+ let r = t[3], o = t[1] || Ce;
5259
5259
  return [o, r] = ur(o, r), Pt(r, o, t[4] ? +t[4] : void 0, t[5] ? +t[5] : void 0);
5260
5260
  }
5261
5261
  }, bi = [Ai, Ci], Ei = [gi, bi], vi = zr(...Ei), ur = (e, t) => {
5262
5262
  const n = e.indexOf("safari-extension") !== -1, r = e.indexOf("safari-web-extension") !== -1;
5263
5263
  return n || r ? [
5264
- e.indexOf("@") !== -1 ? e.split("@")[0] : be,
5264
+ e.indexOf("@") !== -1 ? e.split("@")[0] : Ce,
5265
5265
  n ? `safari-extension:${t}` : `safari-web-extension:${t}`
5266
5266
  ] : [e, t];
5267
5267
  }, Ii = "https://bbed26c9265c425abb56ff9d3728183e@sentry.chocodev.kz/302";
@@ -5272,7 +5272,7 @@ function Bi(e) {
5272
5272
  transport: ui,
5273
5273
  stackParser: vi,
5274
5274
  integrations: [],
5275
- release: "1.1.48",
5275
+ release: "1.1.49",
5276
5276
  environment: e.environment || "production"
5277
5277
  }), n = new ce();
5278
5278
  n.setClient(t), n.setTags(e), t.init(), wt = n;
@@ -5557,7 +5557,7 @@ function Fi(e) {
5557
5557
  freedomAmountFormatted: R,
5558
5558
  t: L,
5559
5559
  currency: q
5560
- } = e, D = (o == null ? void 0 : o.label) ?? L("selectMethod"), K = Ye(o), z = lr(i, c), J = xi(u, l, h, y, m, b, I, L, q), M = Ui(B, L), v = (c == null ? void 0 : c.type) === "google_pay", g = (c == null ? void 0 : c.type) === "apple_pay", p = v || g;
5560
+ } = e, D = (o == null ? void 0 : o.label) ?? L("selectMethod"), G = Ye(o), z = lr(i, c), J = xi(u, l, h, y, m, b, I, L, q), M = Ui(B, L), v = (c == null ? void 0 : c.type) === "google_pay", g = (c == null ? void 0 : c.type) === "apple_pay", p = v || g;
5561
5561
  return `
5562
5562
  <div class="choco-widget-bottom-bar" role="region" aria-label="${L("paymentMethod")}">
5563
5563
  ${J}
@@ -5582,7 +5582,7 @@ function Fi(e) {
5582
5582
  >
5583
5583
  <div class="choco-widget-method-label">${L("paymentMethod")}</div>
5584
5584
  <div class="choco-widget-method-value">
5585
- <div class="choco-widget-method-icon-wrapper ${o == null ? void 0 : o.type}" aria-hidden="true">${K}</div>
5585
+ <div class="choco-widget-method-icon-wrapper ${o == null ? void 0 : o.type}" aria-hidden="true">${G}</div>
5586
5586
  <div class="choco-widget-method-details">
5587
5587
  <div class="choco-widget-method-name ${o == null ? void 0 : o.type}">${D}</div>
5588
5588
  <div class="choco-widget-method-chevron">
@@ -5931,7 +5931,7 @@ function Ln(e) {
5931
5931
  function pe(e) {
5932
5932
  e.loading = !0, ie(e);
5933
5933
  }
5934
- function W(e) {
5934
+ function K(e) {
5935
5935
  var m, b, I, B, Q, S, P, k;
5936
5936
  e.loading = !1;
5937
5937
  const t = (m = e.container) == null ? void 0 : m.querySelector(".choco-widget-payment-method"), n = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-pay-button"), r = (I = e.container) == null ? void 0 : I.querySelector(
@@ -5987,7 +5987,7 @@ function gt(e) {
5987
5987
  );
5988
5988
  t && n && (n.src = e.addCardActionUrl, t.classList.add("choco-widget-payment-sheet--open"), t.style.display = "flex", t.setAttribute("aria-hidden", "false"), e.isAddCardViewOpen = !0, Wi(e));
5989
5989
  }
5990
- function Ie(e) {
5990
+ function ve(e) {
5991
5991
  var r, o;
5992
5992
  const t = (r = e.container) == null ? void 0 : r.querySelector('[data-sheet="add-card"]'), n = (o = e.container) == null ? void 0 : o.querySelector(
5993
5993
  "#choco-widget-add-card-iframe"
@@ -6082,14 +6082,14 @@ function Rn(e, t) {
6082
6082
  function de(e) {
6083
6083
  e._orderStatusPollingId && (clearInterval(e._orderStatusPollingId), e._orderStatusPollingId = null);
6084
6084
  }
6085
- function Be(e, t) {
6085
+ function Ie(e, t) {
6086
6086
  de(e), e._orderStatusResolved = !1;
6087
6087
  const n = 6e3, r = 5;
6088
6088
  let o = 0;
6089
6089
  const i = async () => {
6090
6090
  if (!e._orderStatusResolved) {
6091
6091
  if (o >= r) {
6092
- de(e), W(e), e.config.onError({
6092
+ de(e), K(e), e.config.onError({
6093
6093
  attributes: { message: e.t("errorNoServerResponseRetry") }
6094
6094
  });
6095
6095
  return;
@@ -6123,7 +6123,7 @@ function Ht() {
6123
6123
  return typeof document > "u" ? !1 : document.hidden || document.visibilityState === "hidden";
6124
6124
  }
6125
6125
  function gr(e, t) {
6126
- W(e), e.config.onSuccess(t);
6126
+ K(e), e.config.onSuccess(t);
6127
6127
  }
6128
6128
  function yt(e) {
6129
6129
  if (!e._pendingSuccessPayload || Ht()) return;
@@ -6132,7 +6132,7 @@ function yt(e) {
6132
6132
  }
6133
6133
  function yr(e, t) {
6134
6134
  var o, i;
6135
- e.isAddCardViewOpen && Ie(e);
6135
+ e.isAddCardViewOpen && ve(e);
6136
6136
  const n = t.attributes || ((o = t.data) == null ? void 0 : o.attributes) || {}, r = { id: t.id || ((i = t.data) == null ? void 0 : i.id), attributes: n };
6137
6137
  if (Ht()) {
6138
6138
  e._pendingSuccessPayload = r;
@@ -6142,7 +6142,7 @@ function yr(e, t) {
6142
6142
  }
6143
6143
  function mr(e, t) {
6144
6144
  var r, o;
6145
- e.isAddCardViewOpen && Ie(e), W(e);
6145
+ e.isAddCardViewOpen && ve(e), K(e);
6146
6146
  const n = t.attributes || ((r = t.data) == null ? void 0 : r.attributes) || {};
6147
6147
  e.config.onError({ id: t.id || ((o = t.data) == null ? void 0 : o.id), attributes: n });
6148
6148
  }
@@ -6150,16 +6150,16 @@ function $i(e, t) {
6150
6150
  var i, c, u;
6151
6151
  const n = t.attributes || ((i = t.data) == null ? void 0 : i.attributes) || {}, r = n.action_link || n.action_url, o = n.action_url_type || n.action_type || "redirect";
6152
6152
  if (!r) {
6153
- console.error(e.t("errorActionUrlMissing")), e.waitingForNewCardAction && (e.waitingForNewCardAction = !1, W(e), e.config.onError({ attributes: { message: e.t("errorNoServerResponse") } }));
6153
+ console.error(e.t("errorActionUrlMissing")), e.waitingForNewCardAction && (e.waitingForNewCardAction = !1, K(e), e.config.onError({ attributes: { message: e.t("errorNoServerResponse") } }));
6154
6154
  return;
6155
6155
  }
6156
6156
  if (e.waitingForNewCardAction && (e.waitingForNewCardAction = !1, e._clearNewCardActionTimeout()), o === "inner") {
6157
- e.addCardActionUrl = r, W(e), e._showAddCardView();
6157
+ e.addCardActionUrl = r, K(e), e._showAddCardView();
6158
6158
  return;
6159
6159
  }
6160
6160
  if (((c = e.selectedPaymentMethod) == null ? void 0 : c.type) === "kaspi_pay") {
6161
6161
  const l = t.id || ((u = t.data) == null ? void 0 : u.id);
6162
- if (l && !e._orderStatusResolved && !e._orderStatusPollingId && Be(e, String(l)), typeof e.config.onKaspiLink == "function") {
6162
+ if (l && !e._orderStatusResolved && !e._orderStatusPollingId && Ie(e, String(l)), typeof e.config.onKaspiLink == "function") {
6163
6163
  e.config.onKaspiLink({
6164
6164
  action_link: r,
6165
6165
  action_url: r,
@@ -6192,9 +6192,9 @@ async function ea(e) {
6192
6192
  );
6193
6193
  await On(e);
6194
6194
  const l = (u == null ? void 0 : u.id) ?? ((n = u == null ? void 0 : u.data) == null ? void 0 : n.id);
6195
- return l && Be(e, String(l)), u;
6195
+ return l && Ie(e, String(l)), u;
6196
6196
  } catch (u) {
6197
- throw W(e), se(u, { paymentMethod: "balance" }), e.config.onError({
6197
+ throw K(e), se(u, { paymentMethod: "balance" }), e.config.onError({
6198
6198
  attributes: { message: e._resolveErrorMessage(u) }
6199
6199
  }), u;
6200
6200
  }
@@ -6222,7 +6222,7 @@ async function ea(e) {
6222
6222
  );
6223
6223
  await On(e);
6224
6224
  const l = (u == null ? void 0 : u.id) ?? ((r = u == null ? void 0 : u.data) == null ? void 0 : r.id);
6225
- if (l && Be(e, String(l)), ((o = e.selectedPaymentMethod) == null ? void 0 : o.type) === "kaspi_pay") {
6225
+ if (l && Ie(e, String(l)), ((o = e.selectedPaymentMethod) == null ? void 0 : o.type) === "kaspi_pay") {
6226
6226
  const h = (u == null ? void 0 : u.attributes) || ((i = u == null ? void 0 : u.data) == null ? void 0 : i.attributes) || {}, y = h.action_link || h.action_url, m = h.action_url_type || h.action_type || "redirect";
6227
6227
  if (y)
6228
6228
  return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
@@ -6234,7 +6234,7 @@ async function ea(e) {
6234
6234
  }
6235
6235
  return u;
6236
6236
  } catch (u) {
6237
- throw W(e), se(u, { paymentMethod: ((c = e.selectedPaymentMethod) == null ? void 0 : c.type) || "card" }), e.config.onError({ message: e._resolveErrorMessage(u) }), u;
6237
+ throw K(e), se(u, { paymentMethod: ((c = e.selectedPaymentMethod) == null ? void 0 : c.type) || "card" }), e.config.onError({ message: e._resolveErrorMessage(u) }), u;
6238
6238
  }
6239
6239
  }
6240
6240
  async function On(e) {
@@ -6260,25 +6260,20 @@ async function ta(e, t) {
6260
6260
  t
6261
6261
  );
6262
6262
  } catch (n) {
6263
- e.waitingForNewCardAction = !1, e._clearNewCardActionTimeout(), W(e), se(n, { paymentMethod: "new_card" }), e.config.onError({
6263
+ e.waitingForNewCardAction = !1, e._clearNewCardActionTimeout(), K(e), se(n, { paymentMethod: "new_card" }), e.config.onError({
6264
6264
  attributes: { message: e._resolveErrorMessage(n) }
6265
6265
  }), console.error("New card payment error:", n);
6266
6266
  }
6267
6267
  }
6268
- let me = null;
6268
+ let Be = null;
6269
6269
  async function na(e, t) {
6270
6270
  const n = window.ApplePaySession;
6271
6271
  if (!n || !n.canMakePayments()) {
6272
6272
  e.config.onError({ attributes: { message: e.t("errorApplePayUnsupported") } });
6273
6273
  return;
6274
6274
  }
6275
- if (me) {
6276
- try {
6277
- me.abort();
6278
- } catch {
6279
- }
6280
- me = null;
6281
- }
6275
+ if (Be) return;
6276
+ pe(e);
6282
6277
  const r = {
6283
6278
  countryCode: e.config.currency === "GEL" ? "GE" : "KZ",
6284
6279
  currencyCode: e.config.currency,
@@ -6290,7 +6285,7 @@ async function na(e, t) {
6290
6285
  type: "final"
6291
6286
  }
6292
6287
  }, o = new n(3, r);
6293
- me = o, o.onvalidatemerchant = async (i) => {
6288
+ Be = o, o.onvalidatemerchant = async (i) => {
6294
6289
  var c, u;
6295
6290
  try {
6296
6291
  let l;
@@ -6313,12 +6308,12 @@ async function na(e, t) {
6313
6308
  const h = ((u = (c = l == null ? void 0 : l.data) == null ? void 0 : c.attributes) == null ? void 0 : u.session) || l, y = JSON.parse(atob(h));
6314
6309
  o.completeMerchantValidation(y);
6315
6310
  } catch (l) {
6316
- console.error("Apple Pay session error:", l), se(l, { paymentMethod: "apple_pay", phase: "merchant_validation" }), o.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
6311
+ console.error("Apple Pay session error:", l), se(l, { paymentMethod: "apple_pay", phase: "merchant_validation" }), K(e), o.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
6317
6312
  }
6318
6313
  }, o.onpaymentauthorized = async (i) => {
6319
6314
  var c;
6320
6315
  try {
6321
- if (pe(e), typeof e.config.onBeforeCheckout == "function") {
6316
+ if (typeof e.config.onBeforeCheckout == "function") {
6322
6317
  const h = await e.config.onBeforeCheckout();
6323
6318
  h && typeof h == "object" && Object.assign(e.config, h);
6324
6319
  }
@@ -6329,18 +6324,18 @@ async function na(e, t) {
6329
6324
  i.payment,
6330
6325
  t
6331
6326
  );
6332
- o.completePayment(n.STATUS_SUCCESS), me = null;
6327
+ o.completePayment(n.STATUS_SUCCESS), Be = null;
6333
6328
  const l = (u == null ? void 0 : u.id) ?? ((c = u == null ? void 0 : u.data) == null ? void 0 : c.id);
6334
- l && Be(e, String(l));
6329
+ l && !e._orderStatusResolved && Ie(e, String(l));
6335
6330
  } catch (u) {
6336
- console.error("Apple Pay payment error:", u), se(u, { paymentMethod: "apple_pay", phase: "payment_authorized" }), o.completePayment(n.STATUS_FAILURE), W(e), e.config.onError({
6331
+ console.error("Apple Pay payment error:", u), se(u, { paymentMethod: "apple_pay", phase: "payment_authorized" }), o.completePayment(n.STATUS_FAILURE), Be = null, K(e), e.config.onError({
6337
6332
  attributes: {
6338
6333
  message: e._resolveErrorMessage(u, "errorApplePayPayment")
6339
6334
  }
6340
6335
  });
6341
6336
  }
6342
6337
  }, o.oncancel = () => {
6343
- me = null, e.config.onCancel();
6338
+ Be = null, K(e), e.config.onCancel();
6344
6339
  }, o.begin();
6345
6340
  }
6346
6341
  async function ra(e, t) {
@@ -6419,7 +6414,7 @@ async function ra(e, t) {
6419
6414
  return;
6420
6415
  }
6421
6416
  pe(e);
6422
- const K = await Q.loadPaymentData(B), z = (L = (R = K == null ? void 0 : K.paymentMethodData) == null ? void 0 : R.tokenizationData) == null ? void 0 : L.token;
6417
+ const G = await Q.loadPaymentData(B), z = (L = (R = G == null ? void 0 : G.paymentMethodData) == null ? void 0 : R.tokenizationData) == null ? void 0 : L.token;
6423
6418
  if (!z) throw new Error(e.t("errorGooglePayPayment"));
6424
6419
  const J = JSON.parse(z), M = await Fn(
6425
6420
  e.apiUrl,
@@ -6428,9 +6423,9 @@ async function ra(e, t) {
6428
6423
  J,
6429
6424
  t
6430
6425
  ), v = (M == null ? void 0 : M.id) ?? ((q = M == null ? void 0 : M.data) == null ? void 0 : q.id);
6431
- v && Be(e, String(v));
6426
+ v && Ie(e, String(v));
6432
6427
  } catch (D) {
6433
- W(e), D.statusCode === "CANCELED" ? e.config.onCancel() : (se(D, { paymentMethod: "google_pay" }), e.config.onError({
6428
+ K(e), D.statusCode === "CANCELED" ? e.config.onCancel() : (se(D, { paymentMethod: "google_pay" }), e.config.onError({
6434
6429
  attributes: {
6435
6430
  message: e._resolveErrorMessage(D, "errorGooglePayPayment")
6436
6431
  }
@@ -6456,9 +6451,9 @@ async function oa(e, t, n) {
6456
6451
  i,
6457
6452
  t
6458
6453
  ), u = (c == null ? void 0 : c.id) ?? ((r = c == null ? void 0 : c.data) == null ? void 0 : r.id);
6459
- u && Be(e, String(u));
6454
+ u && Ie(e, String(u));
6460
6455
  } catch (o) {
6461
- W(e), o.statusCode === "CANCELED" ? e.config.onCancel() : (se(o, { paymentMethod: "google_pay_native" }), e.config.onError({
6456
+ K(e), o.statusCode === "CANCELED" ? e.config.onCancel() : (se(o, { paymentMethod: "google_pay_native" }), e.config.onError({
6462
6457
  attributes: {
6463
6458
  message: e._resolveErrorMessage(o, "errorGooglePayPayment")
6464
6459
  }
@@ -6476,7 +6471,7 @@ function sa(e) {
6476
6471
  e.isPaymentSheetEditMode = !0, Qe(e), ke(e);
6477
6472
  }), (m = t.querySelector('[data-action="previous-sheet"]')) == null || m.addEventListener("click", () => {
6478
6473
  e.isPaymentSheetEditMode = !1, Qe(e), ke(e);
6479
- }), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => Ie(e)), (I = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || I.addEventListener("click", () => Ve(e)), (B = t.querySelector('[data-action="confirm-delete-submit"]')) == null || B.addEventListener("click", () => {
6474
+ }), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ve(e)), (I = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || I.addEventListener("click", () => Ve(e)), (B = t.querySelector('[data-action="confirm-delete-submit"]')) == null || B.addEventListener("click", () => {
6480
6475
  if (e._pendingDeleteMethod) {
6481
6476
  const k = e._pendingDeleteMethod;
6482
6477
  Tt(e, !0), Zi(e, k).then(() => ae(e)).finally(() => Tt(e, !1));
@@ -6508,7 +6503,7 @@ function sa(e) {
6508
6503
  }
6509
6504
  function ia(e, t) {
6510
6505
  var n, r;
6511
- e.isOpen && (t.key === "Escape" && (t.preventDefault(), e._pendingDeleteMethod ? Ve(e) : e.isAddCardViewOpen ? Ie(e) : e.isPaymentSheetOpen ? ae(e) : e.close()), t.key === "Enter" && ((r = (n = t.target) == null ? void 0 : n.dataset) == null ? void 0 : r.action) === "pay" && (t.preventDefault(), e.handlePayment()));
6506
+ e.isOpen && (t.key === "Escape" && (t.preventDefault(), e._pendingDeleteMethod ? Ve(e) : e.isAddCardViewOpen ? ve(e) : e.isPaymentSheetOpen ? ae(e) : e.close()), t.key === "Enter" && ((r = (n = t.target) == null ? void 0 : n.dataset) == null ? void 0 : r.action) === "pay" && (t.preventDefault(), e.handlePayment()));
6512
6507
  }
6513
6508
  function aa(e, t) {
6514
6509
  const n = t.querySelector('[data-action="sheet-drag-handle"]'), r = t.querySelector(".choco-widget-sheet-content");
@@ -6535,7 +6530,7 @@ function aa(e, t) {
6535
6530
  !e.isPaymentSheetOpen || h.button !== 0 || (h.preventDefault(), i = h.clientY, c = h.clientY, r.classList.add("choco-widget-sheet-content--dragging"), n.setPointerCapture(h.pointerId), n.addEventListener("pointermove", u), n.addEventListener("pointerup", l), n.addEventListener("pointercancel", l));
6536
6531
  });
6537
6532
  }
6538
- class Ce {
6533
+ class me {
6539
6534
  // ─── Статические методы / logout ─────────────────────────────────────────────
6540
6535
  static _getAuthStorageValue(t) {
6541
6536
  return Un(t);
@@ -6655,12 +6650,12 @@ class Ce {
6655
6650
  gt(this);
6656
6651
  }
6657
6652
  _closeAddCardView() {
6658
- Ie(this);
6653
+ ve(this);
6659
6654
  }
6660
6655
  // ─── Таймауты новой карты ─────────────────────────────────────────────────────
6661
6656
  _setNewCardActionTimeout() {
6662
6657
  this._clearNewCardActionTimeout(), this.newCardActionRequiredTimeoutId = setTimeout(() => {
6663
- this.waitingForNewCardAction && (this.waitingForNewCardAction = !1, W(this), this.config.onError({
6658
+ this.waitingForNewCardAction && (this.waitingForNewCardAction = !1, K(this), this.config.onError({
6664
6659
  attributes: { message: this.t("errorNoServerResponseRetry") }
6665
6660
  })), this.newCardActionRequiredTimeoutId = null;
6666
6661
  }, 6e4);
@@ -6676,13 +6671,13 @@ class Ce {
6676
6671
  Tn();
6677
6672
  }
6678
6673
  _getAuthStorageValue(t) {
6679
- return Ce._getAuthStorageValue(t);
6674
+ return me._getAuthStorageValue(t);
6680
6675
  }
6681
6676
  _setAuthStorageValue(t, n) {
6682
- Ce._setAuthStorageValue(t, n);
6677
+ me._setAuthStorageValue(t, n);
6683
6678
  }
6684
6679
  _removeAuthStorageValue(t) {
6685
- Ce._removeAuthStorageValue(t);
6680
+ me._removeAuthStorageValue(t);
6686
6681
  }
6687
6682
  // ─── Google Pay SDK (используется из domUI + paymentFlow) ────────────────────
6688
6683
  _loadGooglePaySdk() {
@@ -6798,7 +6793,7 @@ class Ce {
6798
6793
  destroy() {
6799
6794
  this._destroyed = !0;
6800
6795
  const t = document.getElementById("choco-one-click-widget");
6801
- t && (t.style.display = "none"), this._clearNewCardActionTimeout(), de(this), this._pendingSuccessPayload = null, this._detachLifecycleListeners(), this.isAddCardViewOpen && Ie(this), this.centrifuge && (this.centrifuge.disconnect(), this.centrifuge = null), document.removeEventListener("keydown", this._boundKeyDown), this.container && (this.container.classList.remove("choco-one-click-widget--visible"), setTimeout(() => {
6796
+ t && (t.style.display = "none"), this._clearNewCardActionTimeout(), de(this), this._pendingSuccessPayload = null, this._detachLifecycleListeners(), this.isAddCardViewOpen && ve(this), this.centrifuge && (this.centrifuge.disconnect(), this.centrifuge = null), document.removeEventListener("keydown", this._boundKeyDown), this.container && (this.container.classList.remove("choco-one-click-widget--visible"), setTimeout(() => {
6802
6797
  var n;
6803
6798
  (n = this.container) == null || n.remove(), this.container = null;
6804
6799
  }, 300)), this.isOpen = !1, this.isPaymentSheetOpen = !1, this.isAddCardViewOpen = !1, this.selectedPaymentMethod = null;
@@ -6890,7 +6885,7 @@ class Ce {
6890
6885
  this.config.idempotencyKey = t;
6891
6886
  }
6892
6887
  async logout() {
6893
- await Ce.logout(), this.accessToken = null;
6888
+ await me.logout(), this.accessToken = null;
6894
6889
  }
6895
6890
  async updateTrackId(t) {
6896
6891
  var n, r;
@@ -6944,7 +6939,7 @@ class Ce {
6944
6939
  this.config.onAppliedBonus = t;
6945
6940
  }
6946
6941
  }
6947
- typeof window < "u" && (window.ChocoOneClickWidget = Ce);
6942
+ typeof window < "u" && (window.ChocoOneClickWidget = me);
6948
6943
  export {
6949
- Ce as default
6944
+ me as default
6950
6945
  };