choco-one-click-payment 1.1.59 → 1.1.60

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
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.choco-one-click-widget{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999;font-family:Sirius,sans-serif;--choco-widget-accent-color: #2F2F2F;pointer-events:none}.choco-one-click-widget--embedded{position:static;top:auto;left:auto;right:auto;bottom:auto;z-index:auto;pointer-events:auto;min-height:1px}.choco-one-click-widget--embedded .choco-widget-bottom-bar{position:static;box-shadow:none;border-radius:24px}.choco-one-click-widget--embedded .choco-widget-payment-sheet{position:fixed}.choco-one-click-widget *{box-sizing:border-box;font-family:Sirius,sans-serif}.choco-one-click-widget .choco-widget-bottom-bar{opacity:0;transform:translateY(16px)}.choco-one-click-widget .choco-widget-balance-section,.choco-one-click-widget .choco-widget-payment-info{opacity:0;transform:translateY(8px)}.choco-one-click-widget--visible .choco-widget-bottom-bar,.choco-one-click-widget--visible .choco-widget-balance-section,.choco-one-click-widget--visible .choco-widget-payment-info{opacity:1;transform:translateY(0)}.choco-widget-bottom-bar{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;padding:16px;box-shadow:0 -4px 20px #0000001a;transition:transform .24s cubic-bezier(.4,0,.2,1),opacity .2s ease;pointer-events:auto}.choco-widget-payment-info{display:flex;flex-direction:column;gap:12px;align-items:stretch;transition:transform .22s ease,opacity .2s ease}.choco-widget-payment-info-main{display:flex;gap:12px;align-items:center}.choco-widget-payment-method{gap:12px;background:#f1f2f7;border-radius:16px;padding:5px 8px;cursor:pointer;transition:background .2s ease;border:none;font-family:inherit;text-align:left;width:100%;position:relative;height:46px}.choco-widget-payment-method:disabled{cursor:not-allowed;pointer-events:none;opacity:.5}.choco-widget-payment-method.google_pay,.choco-widget-payment-method.apple_pay{max-width:140px}.choco-widget-method-icon-placeholder{font-size:24px}.choco-widget-method-details{flex:1}.choco-widget-method-label{font-size:14px;color:#000}.choco-widget-method-value{font-size:14px;font-weight:600;color:#000;display:flex;align-items:center;gap:4px}.choco-widget-method-icon-wrapper svg{display:block;width:100%;max-width:29px;max-height:18px;margin-top:2px}.choco-widget-method-icon-wrapper:empty{display:none}.choco-widget-method-icon-wrapper.google_pay svg{height:17px;max-width:35px;border:1px solid #3C4043;padding:3px 4px 2px;border-radius:8px}.choco-widget-method-name{font-size:14px;font-weight:700}.choco-widget-method-name.google_pay,.choco-widget-method-name.apple_pay{display:none}.choco-widget-method-chevron{position:absolute;right:5px;top:0;bottom:0;margin:auto 0;width:24px;height:24px}.choco-widget-freedom-card-btn{width:100%;height:46px;padding:0 13px;background:linear-gradient(to right,#17678d,#00ca82);border:none;border-radius:16px;font-size:16px;font-weight:700;font-family:inherit;color:#fff;cursor:pointer}.choco-widget-freedom-card-btn:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button{background:var(--choco-widget-accent-color);color:#fff;border:none;border-radius:16px;height:46px;padding:0 16px;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap;width:100%;overflow:hidden}.choco-widget-pay-button--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-pay-button--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-pay-button--loading:after{content:"";display:block;width:100%;height:100%;background:#2f2f2f;position:absolute;left:0;top:0}.choco-widget-pay-button:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button--hidden{display:none}.choco-widget-google-pay-amount{min-width:124px;height:46px;display:flex;flex-direction:column;justify-content:center;text-align:right;width:100%}.choco-widget-google-pay-amount--hidden{display:none}.choco-widget-google-pay-amount-label{font-size:20px;font-weight:700;line-height:24px;color:#1d1d1d}.choco-widget-google-pay-amount-value{font-size:14px;line-height:18px;color:#1d1d1d;white-space:nowrap;opacity:.5}.choco-widget-google-pay-amount-value--hidden{display:none}.choco-widget-google-pay-amount-value-number{text-decoration:line-through}.choco-widget-google-pay-row--hidden{display:none}.choco-widget-wallet-blocked{pointer-events:none;opacity:.6}.choco-widget-google-pay-button-slot{width:100%}.choco-widget-google-pay-button-slot>button{width:100%!important;height:52px;min-height:52px;border-radius:12px!important;font-size:16px!important}.choco-widget-apple-pay-row--hidden{display:none}.choco-widget-apple-pay-button-slot{width:100%}.choco-widget-apple-pay-button-wrapper{position:relative;width:100%;height:52px}.choco-widget-apple-pay-button{width:100%;height:52px;min-height:52px;border:0;border-radius:12px;cursor:pointer;background:#000;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 16px}.choco-widget-apple-pay-button--native{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:52px;opacity:.01;z-index:2}.choco-widget-apple-pay-button-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;background:#000;border-radius:12px;pointer-events:none;z-index:1}.choco-widget-apple-pay-button-text{font-size:16px;line-height:20px;font-weight:600;color:#fff}.choco-widget-apple-pay-button-icon{display:inline-flex;align-items:center;justify-content:center}.choco-widget-payment-sheet{position:absolute;bottom:0;left:0;right:0;top:0;background:#00000080;display:flex;align-items:flex-end;opacity:0;pointer-events:none;transition:opacity .3s ease}.choco-widget-payment-sheet--open{opacity:1;pointer-events:auto}.choco-widget-payment-sheet--open .choco-widget-sheet-content{transform:translateY(0)}.choco-widget-sheet-content{background:#fff;border-radius:24px 24px 0 0;width:100%;max-height:70vh;overflow-y:auto;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);padding:8px 16px 16px;position:relative;will-change:transform}.choco-widget-sheet-content--dragging{transition:none}.choco-widget-sheet-grabber{flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;margin-bottom:8px;-webkit-user-select:none;user-select:none}.choco-widget-sheet-grabber:active{cursor:grabbing}.choco-widget-sheet-grabber:before{content:"";width:72px;height:6px;background:#e5e5e7;border-radius:42px}.choco-widget-sheet-content{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.choco-widget-sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;position:relative}.choco-widget-sheet-title{font-size:20px;font-weight:700;color:#000;margin:0;flex:1;text-align:center}.choco-widget-payment-sheet--edit .choco-widget-sheet-title{padding-left:30px}.choco-widget-payment-sheet--no-cards .choco-widget-sheet-title{padding-right:30px}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-title{padding:0}.choco-widget-sheet-button{background:none;border:none;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.choco-widget-sheet-button svg{color:#000}.choco-widget-sheet-delete-confirm{display:none;padding-top:16px}.choco-widget-payment-sheet--delete-confirm .choco-widget-payment-methods,.choco-widget-payment-sheet--delete-confirm .choco-widget-cashback-section{display:none!important}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-delete-confirm{display:block}.choco-widget-sheet-delete-confirm-text{margin:0 0 24px;font-size:16px;line-height:1.4;color:#242424;text-align:center}.choco-widget-sheet-delete-confirm-actions{display:flex;gap:12px}.choco-widget-delete-confirm-btn{flex:1;padding:14px 20px;font-size:16px;font-weight:600;font-family:inherit;border-radius:16px;border:none;cursor:pointer;transition:background .2s ease,opacity .2s ease}.choco-widget-delete-confirm-btn--cancel{background:#f1f2f7;color:#242424}.choco-widget-delete-confirm-btn--delete{background:var(--choco-widget-accent-color);color:#fff}.choco-widget-delete-confirm-btn--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-sheet-delete-confirm-actions.choco-widget-sheet-delete-confirm-actions--loading .choco-widget-delete-confirm-btn{pointer-events:none;cursor:not-allowed;opacity:.7}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:after{content:"";display:block;width:100%;height:100%;background:#cc3434;position:absolute;left:0;top:0;border-radius:16px}.choco-widget-add-card-sheet{align-items:stretch}.choco-widget-add-card-sheet .choco-widget-add-card-sheet-content{max-height:none;height:100%;display:flex;flex-direction:column;transform:none;border-radius:0;padding:0}.choco-widget-add-card-sheet--open .choco-widget-add-card-sheet-content{transform:none}.choco-widget-add-card-sheet .choco-widget-sheet-header{flex-shrink:0;margin-bottom:0;padding:12px 0;border-bottom:1px solid #eee}.choco-widget-add-card-iframe-wrapper{flex:1;min-height:0;background:#fff}.choco-widget-add-card-iframe{width:100%;height:100%;border:none;display:block}.choco-widget-balance-section{margin-bottom:12px;padding:12px 8px;background:#f1f2f7;border-radius:12px;transition:transform .22s ease,opacity .2s ease}.choco-widget-balance-section.disabled{opacity:.5;pointer-events:none}.choco-widget-balance-toggle{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:4px 0}.choco-widget-balance-toggle:last-child{margin-bottom:0}.choco-widget-balance-toggle--disabled{opacity:.5;pointer-events:none}.choco-widget-balance-info{display:flex;align-items:center;gap:12px}.choco-widget-balance-text{display:flex;flex-direction:column}.choco-widget-balance-label-wrapper{display:flex;align-items:center;gap:8px}.choco-widget-balance-label{font-size:16px;font-weight:500}.choco-widget-balance-sublabel{font-size:12px;color:#767485;margin-top:2px}.choco-widget-balance-icon{width:22px;height:22px}.choco-widget-balance-amount{font-size:16px;font-weight:500;color:#000;white-space:nowrap}.choco-widget-toggle{position:relative;display:inline-block;width:42px;height:26px}.choco-widget-toggle input{opacity:0;width:0;height:0}.choco-widget-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d3df;transition:.3s;border-radius:28px}.choco-widget-toggle-slider:before{position:absolute;content:"";height:22px;width:22px;left:2px;bottom:0;top:0;margin:auto;background-color:#fff;transition:.3s;border-radius:50%}.choco-widget-toggle input:checked+.choco-widget-toggle-slider{background-color:var(--choco-widget-accent-color)}.choco-widget-toggle input:checked+.choco-widget-toggle-slider:before{transform:translate(16px)}.choco-widget-cashback-section{margin-top:20px;padding-top:20px;border-top:1px solid #f0f0f0}.choco-widget-cashback-info{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#fff5ee;border-radius:12px;font-size:14px;color:#ff6b00}.choco-widget-cashback-icon{font-size:20px}.choco-widget-cashback-text strong{font-weight:700}.choco-widget-payment-methods{display:flex;flex-direction:column;gap:8px}.choco-widget-method-item{display:flex;align-items:center;gap:12px;padding:10px 0;cursor:pointer;transition:all .2s ease;border:2px solid transparent;width:100%;border:0;background:none;text-align:left;font-family:inherit;font-size:inherit}.choco-widget-method-item-icon-wrapper{width:37px}.choco-widget-method-item-icon-wrapper svg{display:block;width:100%;max-width:29px;height:29px;margin:0 auto}.choco-widget-method-item-icon-wrapper.google_pay{outline:1px solid #3C4043;padding:3px 5px 2px;border-radius:15px}.choco-widget-method-item-icon-wrapper.google_pay svg{height:15px;max-width:29px}.choco-widget-method-item-label{flex:1;font-size:16px;color:#000}.choco-widget-method-item-check,.choco-widget-method-item-trash-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;margin:-6px 0 -6px 6px;background:none;border:none;cursor:pointer;border-radius:8px;-webkit-tap-highlight-color:transparent}.choco-widget-method-item-check{height:30px;width:30px}.choco-widget-method-item-trash-btn:hover{background:#cc343414}.choco-widget-method-item-trash{flex-shrink:0;width:20px;height:20px}.choco-widget-bottom-bar-prerender{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -4px 20px #0000001a;transition:transform .3s cubic-bezier(.4,0,.2,1);height:78px}.choco-widget-payment-loading{width:30px;height:30px;animation:choco-spin 1s linear infinite;border:3px solid var(--choco-widget-accent-color);border-top:3px solid transparent;border-radius:50%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}@keyframes choco-spin{to{transform:rotate(360deg)}}@keyframes choco-fade-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@media(max-width:768px){.choco-widget-bottom-bar{padding:16px 16px 20px}.choco-widget-sheet-content{max-height:80vh}.choco-widget-sheet-title{font-size:18px}.choco-widget-method-item-label{font-size:17px}}@media(max-width:768px)and (min-height:812px){.choco-widget-bottom-bar,.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom,20px))}}@supports (padding: env(safe-area-inset-bottom)){.choco-widget-bottom-bar{padding-bottom:calc(16px + env(safe-area-inset-bottom))}.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- const Br = {
2
+ const Sr = {
3
3
  ru: {
4
4
  paymentMethod: "Способ оплаты",
5
5
  selectMethod: "Выберите метод",
@@ -164,42 +164,42 @@ const Br = {
164
164
  errorWidgetInit: "ვიჯეტის ინიციალიზაციის შეცდომა",
165
165
  errorPaymentProcess: "გადახდის შეცდომა"
166
166
  }
167
- }, Sr = {
167
+ }, _r = {
168
168
  KZT: "₸",
169
169
  GEL: "₾"
170
170
  };
171
- function _r(e) {
171
+ function Qr(e) {
172
172
  return e === "production" ? "https://api-proxy.choco.kz" : "https://api-proxy.chocodev.kz";
173
173
  }
174
- let Oe;
175
- const Qr = new Uint8Array(16);
176
- function kr() {
177
- if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
174
+ let Ne;
175
+ const kr = new Uint8Array(16);
176
+ function Pr() {
177
+ if (!Ne && (Ne = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ne))
178
178
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
179
- return Oe(Qr);
179
+ return Ne(kr);
180
180
  }
181
181
  const H = [];
182
182
  for (let e = 0; e < 256; ++e)
183
183
  H.push((e + 256).toString(16).slice(1));
184
- function Pr(e, t = 0) {
184
+ function wr(e, t = 0) {
185
185
  return H[e[t + 0]] + H[e[t + 1]] + H[e[t + 2]] + H[e[t + 3]] + "-" + H[e[t + 4]] + H[e[t + 5]] + "-" + H[e[t + 6]] + H[e[t + 7]] + "-" + H[e[t + 8]] + H[e[t + 9]] + "-" + H[e[t + 10]] + H[e[t + 11]] + H[e[t + 12]] + H[e[t + 13]] + H[e[t + 14]] + H[e[t + 15]];
186
186
  }
187
- const wr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), en = {
188
- randomUUID: wr
187
+ const Tr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), en = {
188
+ randomUUID: Tr
189
189
  };
190
190
  function nt(e, t, n) {
191
191
  if (en.randomUUID && !e)
192
192
  return en.randomUUID();
193
193
  e = e || {};
194
- const r = e.random || (e.rng || kr)();
195
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Pr(r);
194
+ const r = e.random || (e.rng || Pr)();
195
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, wr(r);
196
196
  }
197
197
  const tn = "choco_device_id";
198
198
  function $(e, t = "ru", n = "KZT") {
199
199
  const r = Number(e), o = t === "ru" ? "ru-RU" : "en-US";
200
- return `${r.toLocaleString(o)} ${Sr[n]}`;
200
+ return `${r.toLocaleString(o)} ${_r[n]}`;
201
201
  }
202
- function Un() {
202
+ function Fn() {
203
203
  let e = localStorage.getItem(tn);
204
204
  return e || (e = nt(), localStorage.setItem(tn, e)), e;
205
205
  }
@@ -208,7 +208,7 @@ function Ge() {
208
208
  const e = window.safari !== void 0, t = window.navigator.userAgent || "", n = !!t.match(/iPad/i) || !!t.match(/iPhone/i), r = !!t.match(/WebKit/i), o = n && r && !t.match(/CriOS/i);
209
209
  return e || o;
210
210
  }
211
- function Fn() {
211
+ function Xn() {
212
212
  if (typeof navigator > "u") return 0;
213
213
  const e = navigator.userAgent || "", t = e.indexOf("OS");
214
214
  return (e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1) && t > -1 ? Number(e.substring(t + 3, t + 6).replace("_", ".")) : 0;
@@ -229,15 +229,15 @@ function Ye(e) {
229
229
  const t = e === "apple_pay" ? "disableApplePay" : e === "google_pay" ? "disableGooglePay" : null;
230
230
  return t ? sessionStorage.getItem(t) === "true" : !1;
231
231
  }
232
- function Tr(e) {
232
+ function Rr(e) {
233
233
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
234
234
  }
235
- var je = { exports: {} }, Rr = je.exports, nn;
236
- function Lr() {
235
+ var je = { exports: {} }, Lr = je.exports, nn;
236
+ function Or() {
237
237
  return nn || (nn = 1, (function(e, t) {
238
238
  (function(r, o) {
239
239
  e.exports = o();
240
- })(Rr, function() {
240
+ })(Lr, function() {
241
241
  return (
242
242
  /******/
243
243
  (function() {
@@ -249,7 +249,7 @@ function Lr() {
249
249
  Object.defineProperty(u, "__esModule", {
250
250
  value: !0
251
251
  }), u.Centrifuge = void 0;
252
- var h = I(l(187)), y = I(l(471)), m = l(147), b = l(853);
252
+ var f = I(l(187)), y = I(l(471)), m = l(147), b = l(853);
253
253
  function I(g) {
254
254
  return g && g.__esModule ? g : { default: g };
255
255
  }
@@ -400,9 +400,9 @@ function Lr() {
400
400
  }
401
401
  }, {
402
402
  key: "_ajax",
403
- value: function(s, a, A, f, E) {
403
+ value: function(s, a, A, h, E) {
404
404
  var _ = this, T = "";
405
- this._debug("sending AJAX request to", s, "with data", JSON.stringify(f));
405
+ this._debug("sending AJAX request to", s, "with data", JSON.stringify(h));
406
406
  var w;
407
407
  this._xmlhttprequest !== null ? w = new this._xmlhttprequest() : w = l.g.XMLHttpRequest ? new l.g.XMLHttpRequest() : new l.g.ActiveXObject("Microsoft.XMLHTTP");
408
408
  for (var O in a)
@@ -433,7 +433,7 @@ function Lr() {
433
433
  data: null
434
434
  });
435
435
  }, setTimeout(function() {
436
- return w.send(JSON.stringify(f));
436
+ return w.send(JSON.stringify(h));
437
437
  }, 20), w;
438
438
  }
439
439
  }, {
@@ -548,10 +548,10 @@ function Lr() {
548
548
  if (this._callbacks.hasOwnProperty(a)) {
549
549
  var A = this._callbacks[a];
550
550
  clearTimeout(A.timeout);
551
- var f = A.errback;
552
- if (!f)
551
+ var h = A.errback;
552
+ if (!h)
553
553
  continue;
554
- f({
554
+ h({
555
555
  error: this._createErrorObject("disconnected")
556
556
  });
557
557
  }
@@ -580,9 +580,9 @@ function Lr() {
580
580
  for (var a in s) {
581
581
  var A = a.id;
582
582
  if (A in this._callbacks) {
583
- var f = this._callbacks[A];
583
+ var h = this._callbacks[A];
584
584
  clearTimeout(this._callbacks[A].timeout), delete this._callbacks[A];
585
- var E = f.errback;
585
+ var E = h.errback;
586
586
  E({
587
587
  error: this._createErrorObject(M, 0)
588
588
  });
@@ -617,10 +617,10 @@ function Lr() {
617
617
  s._transportClosed = !1, s._isSockjs ? (s._transportName = "sockjs-" + s._transport.transport, s._transport.onheartbeat = function() {
618
618
  return s._restartPing();
619
619
  }) : s._transportName = "websocket";
620
- var f = {
620
+ var h = {
621
621
  // method: this._methodType.CONNECT
622
622
  };
623
- (s._token || s._connectData || s._config.name || s._config.version) && (f.params = {}), s._token && (f.params.token = s._token), s._connectData && (f.params.data = s._connectData), s._config.name && (f.params.name = s._config.name), s._config.version && (f.params.version = s._config.version);
623
+ (s._token || s._connectData || s._config.name || s._config.version) && (h.params = {}), s._token && (h.params.token = s._token), s._connectData && (h.params.data = s._connectData), s._config.name && (h.params.name = s._config.name), s._config.version && (h.params.version = s._config.version);
624
624
  var E = {}, _ = !1;
625
625
  for (var T in s._serverSubs)
626
626
  if (s._serverSubs.hasOwnProperty(T) && s._serverSubs[T].recoverable) {
@@ -630,26 +630,26 @@ function Lr() {
630
630
  };
631
631
  s._serverSubs[T].seq || s._serverSubs[T].gen ? (s._serverSubs[T].seq && (w.seq = s._serverSubs[T].seq), s._serverSubs[T].gen && (w.gen = s._serverSubs[T].gen)) : s._serverSubs[T].offset && (w.offset = s._serverSubs[T].offset), s._serverSubs[T].epoch && (w.epoch = s._serverSubs[T].epoch), E[T] = w;
632
632
  }
633
- _ && (f.params || (f.params = {}), f.params.subs = E), s._latencyStart = /* @__PURE__ */ new Date(), s._call(f).then(function(O) {
633
+ _ && (h.params || (h.params = {}), h.params.subs = E), s._latencyStart = /* @__PURE__ */ new Date(), s._call(h).then(function(O) {
634
634
  s._connectResponse(s._decoder.decodeCommandResult(s._methodType.CONNECT, O.result), _), O.next && O.next();
635
635
  }, function(O) {
636
636
  var F = O.error;
637
637
  F.code === 109 && (s._refreshRequired = !0), s._disconnect("connect error", !0), O.next && O.next();
638
638
  });
639
- }, this._transport.onerror = function(f) {
640
- s._debug("transport level error", f);
641
- }, this._transport.onclose = function(f) {
639
+ }, this._transport.onerror = function(h) {
640
+ s._debug("transport level error", h);
641
+ }, this._transport.onclose = function(h) {
642
642
  s._transportClosed = !0;
643
643
  var E = M, _ = !0;
644
- if (f && "reason" in f && f.reason)
644
+ if (h && "reason" in h && h.reason)
645
645
  try {
646
- var T = JSON.parse(f.reason);
646
+ var T = JSON.parse(h.reason);
647
647
  s._debug("reason is an advice object", T), E = T.reason, _ = T.reconnect;
648
648
  } catch {
649
- E = f.reason, s._debug("reason is a plain string", E);
649
+ E = h.reason, s._debug("reason is a plain string", E);
650
650
  }
651
651
  if (s._config.onTransportClose !== null && s._config.onTransportClose({
652
- event: f,
652
+ event: h,
653
653
  reason: E,
654
654
  reconnect: _
655
655
  }), s._disconnect(E, _), s._reconnect === !0) {
@@ -659,8 +659,8 @@ function Lr() {
659
659
  s._reconnect === !0 && (s._refreshRequired ? s._refresh() : s._connect());
660
660
  }, w);
661
661
  }
662
- }, this._transport.onmessage = function(f) {
663
- s._dataReceived(f.data);
662
+ }, this._transport.onmessage = function(h) {
663
+ s._dataReceived(h.data);
664
664
  };
665
665
  }
666
666
  }, {
@@ -680,11 +680,11 @@ function Lr() {
680
680
  data: a
681
681
  };
682
682
  s !== "" && (A.method = s);
683
- var f = {
683
+ var h = {
684
684
  method: this._methodType.RPC,
685
685
  params: A
686
686
  };
687
- return this._methodCall(f, function(E) {
687
+ return this._methodCall(h, function(E) {
688
688
  return E;
689
689
  });
690
690
  }
@@ -716,9 +716,9 @@ function Lr() {
716
716
  key: "_methodCall",
717
717
  value: function(s, a) {
718
718
  var A = this;
719
- return this.isConnected() ? new Promise(function(f, E) {
719
+ return this.isConnected() ? new Promise(function(h, E) {
720
720
  A._call(s).then(function(_) {
721
- f(a(A._decoder.decodeCommandResult(s.method, _.result))), _.next && _.next();
721
+ h(a(A._decoder.decodeCommandResult(s.method, _.result))), _.next && _.next();
722
722
  }, function(_) {
723
723
  E(_.error), _.next && _.next();
724
724
  });
@@ -741,11 +741,11 @@ function Lr() {
741
741
  }, {
742
742
  key: "history",
743
743
  value: function(s, a) {
744
- var A = this._getHistoryParams(s, a), f = {
744
+ var A = this._getHistoryParams(s, a), h = {
745
745
  method: this._methodType.HISTORY,
746
746
  params: A
747
747
  };
748
- return this._methodCall(f, function(E) {
748
+ return this._methodCall(h, function(E) {
749
749
  return {
750
750
  publications: E.publications,
751
751
  epoch: E.epoch || "",
@@ -789,23 +789,23 @@ function Lr() {
789
789
  value: function(s) {
790
790
  var a = this, A = this._decoder.decodeReplies(s);
791
791
  this._dispatchPromise = this._dispatchPromise.then(function() {
792
- var f;
792
+ var h;
793
793
  a._dispatchPromise = new Promise(function(E) {
794
- f = E;
795
- }), a._dispatchSynchronized(A, f);
794
+ h = E;
795
+ }), a._dispatchSynchronized(A, h);
796
796
  }), this._restartPing();
797
797
  }
798
798
  }, {
799
799
  key: "_dispatchSynchronized",
800
800
  value: function(s, a) {
801
- var A = this, f = Promise.resolve(), E = function(w) {
802
- s.hasOwnProperty(w) && (f = f.then(function() {
801
+ var A = this, h = Promise.resolve(), E = function(w) {
802
+ s.hasOwnProperty(w) && (h = h.then(function() {
803
803
  return A._dispatchReply(s[w]);
804
804
  }));
805
805
  };
806
806
  for (var _ in s)
807
807
  E(_);
808
- f = f.then(function() {
808
+ h = h.then(function() {
809
809
  a();
810
810
  });
811
811
  }
@@ -817,16 +817,16 @@ function Lr() {
817
817
  });
818
818
  if (s == null)
819
819
  return this._debug("dispatch: got undefined or null reply"), a(), A;
820
- var f = s.id;
821
- return f && f > 0 ? this._handleReply(s, a) : this._handlePush(s.result, a), A;
820
+ var h = s.id;
821
+ return h && h > 0 ? this._handleReply(s, a) : this._handlePush(s.result, a), A;
822
822
  }
823
823
  }, {
824
824
  key: "_call",
825
825
  value: function(s) {
826
826
  var a = this;
827
- return new Promise(function(A, f) {
827
+ return new Promise(function(A, h) {
828
828
  var E = a._addMessage(s);
829
- a._registerCall(E, A, f);
829
+ a._registerCall(E, A, h);
830
830
  });
831
831
  }
832
832
  }, {
@@ -847,9 +847,9 @@ function Lr() {
847
847
  return;
848
848
  }
849
849
  if (this._clearConnectedState(A), this._debug("disconnected:", s, a), this._setStatus("disconnected"), this._refreshTimeout && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null), this._reconnecting === !1) {
850
- for (var f in this._serverSubs)
851
- this._serverSubs.hasOwnProperty(f) && this.emit("unsubscribe", {
852
- channel: f
850
+ for (var h in this._serverSubs)
851
+ this._serverSubs.hasOwnProperty(h) && this.emit("unsubscribe", {
852
+ channel: h
853
853
  });
854
854
  this.emit("disconnect", {
855
855
  reason: s,
@@ -872,7 +872,7 @@ function Lr() {
872
872
  return;
873
873
  }
874
874
  this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
875
- var a = this._clientID, A = this._newXHRID(), f = function(w) {
875
+ var a = this._clientID, A = this._newXHRID(), h = function(w) {
876
876
  if (A in s._xhrs && delete s._xhrs[A], s._clientID === a) {
877
877
  if (w.error || w.status !== 200) {
878
878
  if (w.error ? s._debug("error refreshing connection token", w.error) : s._debug("error refreshing connection token: wrong status code", w.status), s._numRefreshFailed++, s._refreshTimeout !== null && (clearTimeout(s._refreshTimeout), s._refreshTimeout = null), s._config.refreshAttempts !== null && s._numRefreshFailed >= s._config.refreshAttempts) {
@@ -909,9 +909,9 @@ function Lr() {
909
909
  };
910
910
  if (this._config.onRefresh !== null) {
911
911
  var E = {};
912
- this._config.onRefresh(E, f);
912
+ this._config.onRefresh(E, h);
913
913
  } else {
914
- var _ = this._ajax(this._config.refreshEndpoint, this._config.refreshParams, this._config.refreshHeaders, this._config.refreshData, f);
914
+ var _ = this._ajax(this._config.refreshEndpoint, this._config.refreshParams, this._config.refreshHeaders, this._config.refreshData, h);
915
915
  this._xhrs[A] = _;
916
916
  }
917
917
  }
@@ -946,8 +946,8 @@ function Lr() {
946
946
  this._clearSubRefreshTimeout(s);
947
947
  else
948
948
  return;
949
- var A = this._clientID, f = this._newXHRID(), E = function(O) {
950
- if (f in a._xhrs && delete a._xhrs[f], !(O.error || O.status !== 200 || a._clientID !== A)) {
949
+ var A = this._clientID, h = this._newXHRID(), E = function(O) {
950
+ if (h in a._xhrs && delete a._xhrs[h], !(O.error || O.status !== 200 || a._clientID !== A)) {
951
951
  var F = {};
952
952
  if (O.data.channels)
953
953
  for (var X in O.data.channels) {
@@ -962,8 +962,8 @@ function Lr() {
962
962
  channel: s,
963
963
  token: me
964
964
  }
965
- }, Le = a._getSub(s);
966
- Le !== null && a._call(pt).then(function(ne) {
965
+ }, Oe = a._getSub(s);
966
+ Oe !== null && a._call(pt).then(function(ne) {
967
967
  a._subRefreshResponse(s, a._decoder.decodeCommandResult(a._methodType.SUB_REFRESH, ne.result)), ne.next && ne.next();
968
968
  }, function(ne) {
969
969
  a._subRefreshError(s, ne.error), ne.next && ne.next();
@@ -980,7 +980,7 @@ function Lr() {
980
980
  }, E);
981
981
  else {
982
982
  var T = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, _, E);
983
- this._xhrs[f] = T;
983
+ this._xhrs[h] = T;
984
984
  }
985
985
  }
986
986
  }, {
@@ -993,8 +993,8 @@ function Lr() {
993
993
  value: function(s, a) {
994
994
  var A = this;
995
995
  this._debug("subscription refresh error", s, a), this._clearSubRefreshTimeout(s);
996
- var f = this._getSub(s);
997
- if (f !== null) {
996
+ var h = this._getSub(s);
997
+ if (h !== null) {
998
998
  var E = Math.round(Math.random() * 1e3), _ = setTimeout(function() {
999
999
  return A._subRefresh(s);
1000
1000
  }, this._config.subRefreshInterval + E);
@@ -1006,8 +1006,8 @@ function Lr() {
1006
1006
  value: function(s, a) {
1007
1007
  var A = this;
1008
1008
  this._debug("subscription refresh success", s), this._clearSubRefreshTimeout(s);
1009
- var f = this._getSub(s);
1010
- if (f !== null && a.expires === !0) {
1009
+ var h = this._getSub(s);
1010
+ if (h !== null && a.expires === !0) {
1011
1011
  var E = setTimeout(function() {
1012
1012
  return A._subRefresh(s);
1013
1013
  }, this._getTTLMilliseconds(a.ttl));
@@ -1019,8 +1019,8 @@ function Lr() {
1019
1019
  value: function(s, a) {
1020
1020
  var A = this;
1021
1021
  this._debug("subscribing on", s.channel);
1022
- var f = s.channel;
1023
- if (f in this._subs || (this._subs[f] = s), !this.isConnected()) {
1022
+ var h = s.channel;
1023
+ if (h in this._subs || (this._subs[h] = s), !this.isConnected()) {
1024
1024
  s._setNew();
1025
1025
  return;
1026
1026
  }
@@ -1028,29 +1028,29 @@ function Lr() {
1028
1028
  var E = {
1029
1029
  method: this._methodType.SUBSCRIBE,
1030
1030
  params: {
1031
- channel: f
1031
+ channel: h
1032
1032
  }
1033
1033
  };
1034
- if (s._subscribeData && (E.params.data = s._subscribeData), (0, b.startsWith)(f, this._config.privateChannelPrefix))
1035
- this._isSubscribeBatching ? this._privateChannels[f] = !0 : (this.startSubscribeBatching(), this._subscribe(s), this.stopSubscribeBatching());
1034
+ if (s._subscribeData && (E.params.data = s._subscribeData), (0, b.startsWith)(h, this._config.privateChannelPrefix))
1035
+ this._isSubscribeBatching ? this._privateChannels[h] = !0 : (this.startSubscribeBatching(), this._subscribe(s), this.stopSubscribeBatching());
1036
1036
  else {
1037
1037
  var _ = s._needRecover();
1038
1038
  if (_ === !0) {
1039
1039
  E.params.recover = !0;
1040
- var T = this._getLastSeq(f), w = this._getLastGen(f);
1040
+ var T = this._getLastSeq(h), w = this._getLastGen(h);
1041
1041
  if (T || w)
1042
1042
  T && (E.params.seq = T), w && (E.params.gen = w);
1043
1043
  else {
1044
- var O = this._getLastOffset(f);
1044
+ var O = this._getLastOffset(h);
1045
1045
  O && (E.params.offset = O);
1046
1046
  }
1047
- var F = this._getLastEpoch(f);
1047
+ var F = this._getLastEpoch(h);
1048
1048
  F && (E.params.epoch = F);
1049
1049
  }
1050
1050
  this._call(E).then(function(X) {
1051
- A._subscribeResponse(f, _, A._decoder.decodeCommandResult(A._methodType.SUBSCRIBE, X.result)), X.next && X.next();
1051
+ A._subscribeResponse(h, _, A._decoder.decodeCommandResult(A._methodType.SUBSCRIBE, X.result)), X.next && X.next();
1052
1052
  }, function(X) {
1053
- A._subscribeError(f, X.error), X.next && X.next();
1053
+ A._subscribeError(h, X.error), X.next && X.next();
1054
1054
  });
1055
1055
  }
1056
1056
  }
@@ -1088,7 +1088,7 @@ function Lr() {
1088
1088
  }, {
1089
1089
  key: "_connectResponse",
1090
1090
  value: function(s, a) {
1091
- var A = this, f = this._reconnecting;
1091
+ var A = this, h = this._reconnecting;
1092
1092
  if (this._reconnecting = !1, this._resetRetry(), this._refreshRequired = !1, !this.isConnected()) {
1093
1093
  this._latencyStart !== null && (this._latency = (/* @__PURE__ */ new Date()).getTime() - this._latencyStart.getTime(), this._latencyStart = null), this._clientID = s.client, this._setStatus("connected"), this._refreshTimeout && clearTimeout(this._refreshTimeout), s.expires && (this._refreshTimeout = setTimeout(function() {
1094
1094
  return A._refresh();
@@ -1096,7 +1096,7 @@ function Lr() {
1096
1096
  for (var E in this._subs)
1097
1097
  if (this._subs.hasOwnProperty(E)) {
1098
1098
  var _ = this._subs[E];
1099
- _._shouldResubscribe() && this._subscribe(_, f);
1099
+ _._shouldResubscribe() && this._subscribe(_, h);
1100
1100
  }
1101
1101
  this.stopSubscribeBatching(), this.stopBatching(), this._startPing();
1102
1102
  var T = {
@@ -1112,9 +1112,9 @@ function Lr() {
1112
1112
  value: function(s) {
1113
1113
  for (var a in s)
1114
1114
  if (s.hasOwnProperty(a)) {
1115
- var A = s[a], f = this._serverSubs[a] !== void 0, E = {
1115
+ var A = s[a], h = this._serverSubs[a] !== void 0, E = {
1116
1116
  channel: a,
1117
- isResubscribe: f
1117
+ isResubscribe: h
1118
1118
  };
1119
1119
  E = this._expandSubscribeContext(E, A), this.emit("subscribe", E);
1120
1120
  }
@@ -1179,12 +1179,12 @@ function Lr() {
1179
1179
  value: function(s, a) {
1180
1180
  var A = !1;
1181
1181
  "recovered" in a && (A = a.recovered), s.recovered = A;
1182
- var f = !1;
1183
- "positioned" in a && (f = a.positioned);
1182
+ var h = !1;
1183
+ "positioned" in a && (h = a.positioned);
1184
1184
  var E = "";
1185
1185
  "epoch" in a && (E = a.epoch);
1186
1186
  var _ = 0;
1187
- return "offset" in a && (_ = a.offset), f && (s.streamPosition = {
1187
+ return "offset" in a && (_ = a.offset), h && (s.streamPosition = {
1188
1188
  offset: _,
1189
1189
  epoch: E
1190
1190
  }), a.data && (s.data = a.data), s;
@@ -1192,7 +1192,7 @@ function Lr() {
1192
1192
  }, {
1193
1193
  key: "_subscribeResponse",
1194
1194
  value: function(s, a, A) {
1195
- var f = this, E = this._getSub(s);
1195
+ var h = this, E = this._getSub(s);
1196
1196
  if (E && E._isSubscribing()) {
1197
1197
  E._setSubscribeSuccess(A);
1198
1198
  var _ = A.publications;
@@ -1203,7 +1203,7 @@ function Lr() {
1203
1203
  }
1204
1204
  if (A.recoverable && (!a || !A.recovered) && (this._lastSeq[s] = A.seq || 0, this._lastGen[s] = A.gen || 0, this._lastOffset[s] = A.offset || 0), this._lastEpoch[s] = A.epoch || "", A.recoverable && (E._recoverable = !0), A.expires === !0) {
1205
1205
  var w = setTimeout(function() {
1206
- return f._subRefresh(s);
1206
+ return h._subRefresh(s);
1207
1207
  }, this._getTTLMilliseconds(A.ttl));
1208
1208
  this._subRefreshTimeouts[s] = w;
1209
1209
  }
@@ -1212,7 +1212,7 @@ function Lr() {
1212
1212
  }, {
1213
1213
  key: "_handleReply",
1214
1214
  value: function(s, a) {
1215
- var A = s.id, f = s.result;
1215
+ var A = s.id, h = s.result;
1216
1216
  if (!(A in this._callbacks)) {
1217
1217
  a();
1218
1218
  return;
@@ -1234,7 +1234,7 @@ function Lr() {
1234
1234
  if (!_)
1235
1235
  return;
1236
1236
  _({
1237
- result: f,
1237
+ result: h,
1238
1238
  next: a
1239
1239
  });
1240
1240
  }
@@ -1244,34 +1244,34 @@ function Lr() {
1244
1244
  value: function(s, a) {
1245
1245
  var A = {
1246
1246
  info: a.info
1247
- }, f = this._getSub(s);
1248
- if (!f) {
1247
+ }, h = this._getSub(s);
1248
+ if (!h) {
1249
1249
  this._isServerSub(s) && (A.channel = s, this.emit("join", A));
1250
1250
  return;
1251
1251
  }
1252
- f.emit("join", A);
1252
+ h.emit("join", A);
1253
1253
  }
1254
1254
  }, {
1255
1255
  key: "_handleLeave",
1256
1256
  value: function(s, a) {
1257
1257
  var A = {
1258
1258
  info: a.info
1259
- }, f = this._getSub(s);
1260
- if (!f) {
1259
+ }, h = this._getSub(s);
1260
+ if (!h) {
1261
1261
  this._isServerSub(s) && (A.channel = s, this.emit("leave", A));
1262
1262
  return;
1263
1263
  }
1264
- f.emit("leave", A);
1264
+ h.emit("leave", A);
1265
1265
  }
1266
1266
  }, {
1267
1267
  key: "_handleUnsub",
1268
1268
  value: function(s, a) {
1269
- var A = {}, f = this._getSub(s);
1270
- if (!f) {
1269
+ var A = {}, h = this._getSub(s);
1270
+ if (!h) {
1271
1271
  this._isServerSub(s) && (delete this._serverSubs[s], A.channel = s, this.emit("unsubscribe", A));
1272
1272
  return;
1273
1273
  }
1274
- f.unsubscribe(), a.resubscribe === !0 && f.subscribe();
1274
+ h.unsubscribe(), a.resubscribe === !0 && h.subscribe();
1275
1275
  }
1276
1276
  }, {
1277
1277
  key: "_handleSub",
@@ -1292,17 +1292,17 @@ function Lr() {
1292
1292
  }, {
1293
1293
  key: "_handlePublication",
1294
1294
  value: function(s, a) {
1295
- var A = this._getSub(s), f = {
1295
+ var A = this._getSub(s), h = {
1296
1296
  data: a.data,
1297
1297
  seq: a.seq,
1298
1298
  gen: a.gen,
1299
1299
  offset: a.offset
1300
1300
  };
1301
- if (a.info && (f.info = a.info), !A) {
1302
- this._isServerSub(s) && (a.seq !== void 0 && (this._serverSubs[s].seq = a.seq), a.gen !== void 0 && (this._serverSubs[s].gen = a.gen), a.offset !== void 0 && (this._serverSubs[s].offset = a.offset), f.channel = s, this.emit("publish", f));
1301
+ if (a.info && (h.info = a.info), !A) {
1302
+ this._isServerSub(s) && (a.seq !== void 0 && (this._serverSubs[s].seq = a.seq), a.gen !== void 0 && (this._serverSubs[s].gen = a.gen), a.offset !== void 0 && (this._serverSubs[s].offset = a.offset), h.channel = s, this.emit("publish", h));
1303
1303
  return;
1304
1304
  }
1305
- a.seq !== void 0 && (this._lastSeq[s] = a.seq), a.gen !== void 0 && (this._lastGen[s] = a.gen), a.offset !== void 0 && (this._lastOffset[s] = a.offset), A.emit("publish", f);
1305
+ a.seq !== void 0 && (this._lastSeq[s] = a.seq), a.gen !== void 0 && (this._lastGen[s] = a.gen), a.offset !== void 0 && (this._lastOffset[s] = a.offset), A.emit("publish", h);
1306
1306
  }
1307
1307
  }, {
1308
1308
  key: "_handleMessage",
@@ -1312,25 +1312,25 @@ function Lr() {
1312
1312
  }, {
1313
1313
  key: "_handlePush",
1314
1314
  value: function(s, a) {
1315
- var A = this._decoder.decodePush(s), f = 0;
1316
- "type" in A && (f = A.type);
1315
+ var A = this._decoder.decodePush(s), h = 0;
1316
+ "type" in A && (h = A.type);
1317
1317
  var E = A.channel;
1318
- if (f === this._pushType.PUBLICATION) {
1318
+ if (h === this._pushType.PUBLICATION) {
1319
1319
  var _ = this._decoder.decodePushData(this._pushType.PUBLICATION, A.data);
1320
1320
  this._handlePublication(E, _);
1321
- } else if (f === this._pushType.MESSAGE) {
1321
+ } else if (h === this._pushType.MESSAGE) {
1322
1322
  var T = this._decoder.decodePushData(this._pushType.MESSAGE, A.data);
1323
1323
  this._handleMessage(T);
1324
- } else if (f === this._pushType.JOIN) {
1324
+ } else if (h === this._pushType.JOIN) {
1325
1325
  var w = this._decoder.decodePushData(this._pushType.JOIN, A.data);
1326
1326
  this._handleJoin(E, w);
1327
- } else if (f === this._pushType.LEAVE) {
1327
+ } else if (h === this._pushType.LEAVE) {
1328
1328
  var O = this._decoder.decodePushData(this._pushType.LEAVE, A.data);
1329
1329
  this._handleLeave(E, O);
1330
- } else if (f === this._pushType.UNSUBSCRIBE) {
1330
+ } else if (h === this._pushType.UNSUBSCRIBE) {
1331
1331
  var F = this._decoder.decodePushData(this._pushType.UNSUBSCRIBE, A.data);
1332
1332
  this._handleUnsub(E, F);
1333
- } else if (f === this._pushType.SUBSCRIBE) {
1333
+ } else if (h === this._pushType.SUBSCRIBE) {
1334
1334
  var X = this._decoder.decodePushData(this._pushType.UNSUBSCRIBE, A.data);
1335
1335
  this._handleSub(E, X);
1336
1336
  }
@@ -1395,14 +1395,14 @@ function Lr() {
1395
1395
  }, {
1396
1396
  key: "_registerCall",
1397
1397
  value: function(s, a, A) {
1398
- var f = this;
1398
+ var h = this;
1399
1399
  this._callbacks[s] = {
1400
1400
  callback: a,
1401
1401
  errback: A,
1402
1402
  timeout: null
1403
1403
  }, this._callbacks[s].timeout = setTimeout(function() {
1404
- delete f._callbacks[s], (0, b.isFunction)(A) && A({
1405
- error: f._createErrorObject(J)
1404
+ delete h._callbacks[s], (0, b.isFunction)(A) && A({
1405
+ error: h._createErrorObject(J)
1406
1406
  });
1407
1407
  }, this._config.timeout);
1408
1408
  }
@@ -1455,12 +1455,12 @@ function Lr() {
1455
1455
  var a = this._privateChannels;
1456
1456
  this._privateChannels = {};
1457
1457
  var A = [];
1458
- for (var f in a)
1459
- if (a.hasOwnProperty(f)) {
1460
- var E = this._getSub(f);
1458
+ for (var h in a)
1459
+ if (a.hasOwnProperty(h)) {
1460
+ var E = this._getSub(h);
1461
1461
  if (!E)
1462
1462
  continue;
1463
- A.push(f);
1463
+ A.push(h);
1464
1464
  }
1465
1465
  if (A.length === 0) {
1466
1466
  this._debug("no private channels found, no need to make request");
@@ -1480,18 +1480,18 @@ function Lr() {
1480
1480
  }
1481
1481
  return;
1482
1482
  }
1483
- var Le = {};
1483
+ var Oe = {};
1484
1484
  if (x.data.channels)
1485
1485
  for (var ne in x.data.channels) {
1486
1486
  var gt = x.data.channels[ne];
1487
- gt.channel && (Le[gt.channel] = gt.token);
1487
+ gt.channel && (Oe[gt.channel] = gt.token);
1488
1488
  }
1489
1489
  var Kt = !1;
1490
1490
  s._isBatching || (s.startBatching(), Kt = !0);
1491
1491
  for (var Gt in A)
1492
1492
  if (A.hasOwnProperty(Gt)) {
1493
- var Ir = (function() {
1494
- var Z = A[Gt], Wt = Le[Z];
1493
+ var Br = (function() {
1494
+ var Z = A[Gt], Wt = Oe[Z];
1495
1495
  if (Wt) {
1496
1496
  var Ce = {
1497
1497
  method: s._methodType.SUBSCRIBE,
@@ -1523,7 +1523,7 @@ function Lr() {
1523
1523
  } else
1524
1524
  return s._subscribeError(Z, s._createErrorObject("permission denied", 103)), "continue";
1525
1525
  })();
1526
- if (Ir === "continue") continue;
1526
+ if (Br === "continue") continue;
1527
1527
  }
1528
1528
  Kt && s.stopBatching();
1529
1529
  }
@@ -1545,14 +1545,14 @@ function Lr() {
1545
1545
  }, {
1546
1546
  key: "subscribe",
1547
1547
  value: function(s, a, A) {
1548
- var f = this._getSub(s);
1549
- if (f !== null)
1550
- return f._setEvents(a), f._isUnsubscribed() && f.subscribe(A), f;
1548
+ var h = this._getSub(s);
1549
+ if (h !== null)
1550
+ return h._setEvents(a), h._isUnsubscribed() && h.subscribe(A), h;
1551
1551
  var E = new y.default(this, s, a);
1552
1552
  return this._subs[s] = E, E.subscribe(A), E;
1553
1553
  }
1554
1554
  }]), C;
1555
- })(h.default);
1555
+ })(f.default);
1556
1556
  u.Centrifuge = v;
1557
1557
  })
1558
1558
  ),
@@ -1563,7 +1563,7 @@ function Lr() {
1563
1563
  Object.defineProperty(u, "__esModule", {
1564
1564
  value: !0
1565
1565
  }), u.default = void 0;
1566
- var h = l(382), y = h.Centrifuge;
1566
+ var f = l(382), y = f.Centrifuge;
1567
1567
  u.default = y, c.exports = u.default;
1568
1568
  })
1569
1569
  ),
@@ -1578,14 +1578,14 @@ function Lr() {
1578
1578
  if (!(Q instanceof S))
1579
1579
  throw new TypeError("Cannot call a class as a function");
1580
1580
  }
1581
- function h(Q, S) {
1581
+ function f(Q, S) {
1582
1582
  for (var P = 0; P < S.length; P++) {
1583
1583
  var k = S[P];
1584
1584
  k.enumerable = k.enumerable || !1, k.configurable = !0, "value" in k && (k.writable = !0), Object.defineProperty(Q, k.key, k);
1585
1585
  }
1586
1586
  }
1587
1587
  function y(Q, S, P) {
1588
- return S && h(Q.prototype, S), Q;
1588
+ return S && f(Q.prototype, S), Q;
1589
1589
  }
1590
1590
  var m = {
1591
1591
  CONNECT: 0,
@@ -1664,13 +1664,13 @@ function Lr() {
1664
1664
  471: (
1665
1665
  /***/
1666
1666
  (function(c, u, l) {
1667
- function h(p) {
1667
+ function f(p) {
1668
1668
  "@babel/helpers - typeof";
1669
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? h = function(d) {
1669
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? f = function(d) {
1670
1670
  return typeof d;
1671
- } : h = function(d) {
1671
+ } : f = function(d) {
1672
1672
  return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d;
1673
- }, h(p);
1673
+ }, f(p);
1674
1674
  }
1675
1675
  Object.defineProperty(u, "__esModule", {
1676
1676
  value: !0
@@ -1715,7 +1715,7 @@ function Lr() {
1715
1715
  };
1716
1716
  }
1717
1717
  function L(p, C) {
1718
- if (C && (h(C) === "object" || typeof C == "function"))
1718
+ if (C && (f(C) === "object" || typeof C == "function"))
1719
1719
  return C;
1720
1720
  if (C !== void 0)
1721
1721
  throw new TypeError("Derived constructors may only return object or undefined");
@@ -1745,10 +1745,10 @@ function Lr() {
1745
1745
  S(d, p);
1746
1746
  var C = k(d);
1747
1747
  function d(s, a, A) {
1748
- var f;
1749
- 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) {
1748
+ var h;
1749
+ return I(this, d), h = C.call(this), h.channel = a, h._centrifuge = s, h._status = G, h._error = null, h._isResubscribe = !1, h._ready = !1, h._subscriptionPromise = null, h._noResubscribe = !1, h._recoverable = !1, h._recover = !1, h._setEvents(A), h._initializePromise(), h._promises = {}, h._promiseId = 0, h._subscribeData = null, h.on("error", function(E) {
1750
1750
  this._centrifuge._debug("subscription error", E);
1751
- }), f;
1751
+ }), h;
1752
1752
  }
1753
1753
  return Q(d, [{
1754
1754
  key: "_nextPromiseId",
@@ -1759,11 +1759,11 @@ function Lr() {
1759
1759
  key: "_initializePromise",
1760
1760
  value: function() {
1761
1761
  var a = this;
1762
- this._ready = !1, this._subscriptionPromise = new Promise(function(A, f) {
1762
+ this._ready = !1, this._subscriptionPromise = new Promise(function(A, h) {
1763
1763
  a._resolve = function(E) {
1764
1764
  a._ready = !0, A(E);
1765
1765
  }, a._reject = function(E) {
1766
- a._ready = !0, f(E);
1766
+ a._ready = !0, h(E);
1767
1767
  };
1768
1768
  }).then(function() {
1769
1769
  }, function() {
@@ -1786,8 +1786,8 @@ function Lr() {
1786
1786
  if ((0, m.isFunction)(a))
1787
1787
  this.on("publish", a);
1788
1788
  else if (Object.prototype.toString.call(a) === Object.prototype.toString.call({}))
1789
- for (var A = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"], f = 0, E = A.length; f < E; f++) {
1790
- var _ = A[f];
1789
+ for (var A = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"], h = 0, E = A.length; h < E; h++) {
1790
+ var _ = A[h];
1791
1791
  _ in a && this.on(_, a[_]);
1792
1792
  }
1793
1793
  }
@@ -1839,8 +1839,8 @@ function Lr() {
1839
1839
  this._status = J;
1840
1840
  var A = this._getSubscribeSuccessContext(a);
1841
1841
  this._recover = !1, this.emit("subscribe", A), this._resolve(A);
1842
- for (var f in this._promises)
1843
- clearTimeout(this._promises[f].timeout), this._promises[f].resolve(), delete this._promises[f];
1842
+ for (var h in this._promises)
1843
+ clearTimeout(this._promises[h].timeout), this._promises[h].resolve(), delete this._promises[h];
1844
1844
  }
1845
1845
  }
1846
1846
  }, {
@@ -1850,8 +1850,8 @@ function Lr() {
1850
1850
  this._status = M, this._error = a;
1851
1851
  var A = this._getSubscribeErrorContext();
1852
1852
  this.emit("error", A), this._reject(A);
1853
- for (var f in this._promises)
1854
- clearTimeout(this._promises[f].timeout), this._promises[f].reject(a), delete this._promises[f];
1853
+ for (var h in this._promises)
1854
+ clearTimeout(this._promises[h].timeout), this._promises[h].reject(a), delete this._promises[h];
1855
1855
  }
1856
1856
  }
1857
1857
  }, {
@@ -1917,7 +1917,7 @@ function Lr() {
1917
1917
  return Promise.resolve();
1918
1918
  if (this._isError())
1919
1919
  return Promise.reject(this._error);
1920
- var A = new Promise(function(f, E) {
1920
+ var A = new Promise(function(h, E) {
1921
1921
  var _ = setTimeout(function() {
1922
1922
  E({
1923
1923
  code: 0,
@@ -1926,7 +1926,7 @@ function Lr() {
1926
1926
  }, a._centrifuge._config.timeout);
1927
1927
  a._promises[a._nextPromiseId()] = {
1928
1928
  timeout: _,
1929
- resolve: f,
1929
+ resolve: h,
1930
1930
  reject: E
1931
1931
  };
1932
1932
  });
@@ -1975,8 +1975,8 @@ function Lr() {
1975
1975
  (function(c, u, l) {
1976
1976
  Object.defineProperty(u, "__esModule", {
1977
1977
  value: !0
1978
- }), u.backoff = b, u.errorExists = I, u.extend = B, u.isFunction = y, u.log = m, u.startsWith = h;
1979
- function h(Q, S) {
1978
+ }), u.backoff = b, u.errorExists = I, u.extend = B, u.isFunction = y, u.log = m, u.startsWith = f;
1979
+ function f(Q, S) {
1980
1980
  return Q.lastIndexOf(S, 0) === 0;
1981
1981
  }
1982
1982
  function y(Q) {
@@ -2008,10 +2008,10 @@ function Lr() {
2008
2008
  (function(c) {
2009
2009
  var u = typeof Reflect == "object" ? Reflect : null, l = u && typeof u.apply == "function" ? u.apply : function(g, p, C) {
2010
2010
  return Function.prototype.apply.call(g, p, C);
2011
- }, h;
2012
- u && typeof u.ownKeys == "function" ? h = u.ownKeys : Object.getOwnPropertySymbols ? h = function(g) {
2011
+ }, f;
2012
+ u && typeof u.ownKeys == "function" ? f = u.ownKeys : Object.getOwnPropertySymbols ? f = function(g) {
2013
2013
  return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g));
2014
- } : h = function(g) {
2014
+ } : f = function(g) {
2015
2015
  return Object.getOwnPropertyNames(g);
2016
2016
  };
2017
2017
  function y(v) {
@@ -2065,13 +2065,13 @@ function Lr() {
2065
2065
  var A = new Error("Unhandled error." + (a ? " (" + a.message + ")" : ""));
2066
2066
  throw A.context = a, A;
2067
2067
  }
2068
- var f = s[g];
2069
- if (f === void 0)
2068
+ var h = s[g];
2069
+ if (h === void 0)
2070
2070
  return !1;
2071
- if (typeof f == "function")
2072
- l(f, this, p);
2071
+ if (typeof h == "function")
2072
+ l(h, this, p);
2073
2073
  else
2074
- for (var E = f.length, _ = q(f, E), C = 0; C < E; ++C)
2074
+ for (var E = h.length, _ = q(h, E), C = 0; C < E; ++C)
2075
2075
  l(_[C], this, p);
2076
2076
  return !0;
2077
2077
  };
@@ -2171,7 +2171,7 @@ function Lr() {
2171
2171
  return 0;
2172
2172
  }
2173
2173
  b.prototype.eventNames = function() {
2174
- return this._eventsCount > 0 ? h(this._events) : [];
2174
+ return this._eventsCount > 0 ? f(this._events) : [];
2175
2175
  };
2176
2176
  function q(v, g) {
2177
2177
  for (var p = new Array(g), C = 0; C < g; ++C)
@@ -2248,30 +2248,30 @@ function Lr() {
2248
2248
  });
2249
2249
  })(je)), je.exports;
2250
2250
  }
2251
- var Or = Lr();
2252
- const Nr = /* @__PURE__ */ Tr(Or);
2253
- let Ne = null;
2251
+ var Nr = Or();
2252
+ const Dr = /* @__PURE__ */ Rr(Nr);
2253
+ let De = null;
2254
2254
  function rn(e, t) {
2255
2255
  if (!(e != null && e.client_url) || !(e != null && e.token) || !(e != null && e.channel))
2256
2256
  return console.error("[Centrifuge] Invalid socket_connections"), null;
2257
2257
  const { client_url: n, token: r, channel: o } = e;
2258
- if (o.includes("#") || console.warn("[Centrifuge] Channel should contain #user_id"), Ne) {
2258
+ if (o.includes("#") || console.warn("[Centrifuge] Channel should contain #user_id"), De) {
2259
2259
  try {
2260
- console.log("[Centrifuge] Disconnecting previous instance..."), Ne.disconnect();
2260
+ console.log("[Centrifuge] Disconnecting previous instance..."), De.disconnect();
2261
2261
  } catch (c) {
2262
2262
  console.error("[Centrifuge] Error while disconnecting previous instance:", c);
2263
2263
  }
2264
- Ne = null;
2264
+ De = null;
2265
2265
  }
2266
2266
  console.log("[Centrifuge] Creating new instance:", n);
2267
- const i = new Nr(n);
2267
+ const i = new Dr(n);
2268
2268
  return i.setToken(r), i.on("connect", (c) => {
2269
2269
  console.log("[Centrifuge] Connected", c), console.log("[Centrifuge] Subscribing to channel:", o);
2270
2270
  const u = i.subscribe(o);
2271
2271
  u.on("publish", (l) => {
2272
2272
  console.log("[Centrifuge] Publish event received:", l);
2273
- const h = Dr(l);
2274
- h && t(h);
2273
+ const f = Mr(l);
2274
+ f && t(f);
2275
2275
  }), u.on("subscribe", (l) => {
2276
2276
  console.log("[Centrifuge] ✅ Channel subscribed successfully:", o, l);
2277
2277
  }), u.on("error", (l) => {
@@ -2279,9 +2279,9 @@ function rn(e, t) {
2279
2279
  }), u.on("unsubscribe", (l) => {
2280
2280
  console.log("[Centrifuge] Channel unsubscribed:", l);
2281
2281
  });
2282
- }), i.on("disconnect", (c) => console.log("[Centrifuge] Disconnected", c)), i.on("error", (c) => console.error("[Centrifuge] Error", c)), console.log("[Centrifuge] Calling connect()..."), i.connect(), Ne = i, { centrifuge: i };
2282
+ }), i.on("disconnect", (c) => console.log("[Centrifuge] Disconnected", c)), i.on("error", (c) => console.error("[Centrifuge] Error", c)), console.log("[Centrifuge] Calling connect()..."), i.connect(), De = i, { centrifuge: i };
2283
2283
  }
2284
- function Dr(e) {
2284
+ function Mr(e) {
2285
2285
  var n, r, o;
2286
2286
  if (console.log("[Centrifuge] Raw message received:", JSON.stringify(e)), !(e != null && e.data))
2287
2287
  return console.warn("[Centrifuge] Empty or invalid response"), null;
@@ -2295,11 +2295,11 @@ const de = {
2295
2295
  iconType: "kaspi_pay",
2296
2296
  label: "Kaspi.kz",
2297
2297
  type: "kaspi_pay"
2298
- }, Xn = {
2298
+ }, Hn = {
2299
2299
  iconType: "apple_pay",
2300
2300
  label: "Apple Pay",
2301
2301
  type: "apple_pay"
2302
- }, Hn = {
2302
+ }, jn = {
2303
2303
  iconType: "google_pay",
2304
2304
  label: "Google Pay",
2305
2305
  type: "google_pay"
@@ -2312,7 +2312,7 @@ function on(e) {
2312
2312
  let t = String(e).trim().toLowerCase();
2313
2313
  return t.startsWith("payment_method_") && (t = t.replace("payment_method_", "")), t === "kaspi" ? "kaspi_pay" : t === "apple" ? "apple_pay" : t === "google" ? "google_pay" : t === "newcard" ? "new_card" : t === "card" ? "card" : ["kaspi_pay", "apple_pay", "google_pay", "new_card"].includes(t) ? t : null;
2314
2314
  }
2315
- function Mr(e) {
2315
+ function xr(e) {
2316
2316
  var i, c, u;
2317
2317
  const t = e, n = ((i = t == null ? void 0 : t.context) == null ? void 0 : i.last_payment_method) ?? (t == null ? void 0 : t.last_payment_method) ?? ((c = t == null ? void 0 : t.attributes) == null ? void 0 : c.last_payment_method);
2318
2318
  if (!n) return null;
@@ -2325,10 +2325,10 @@ function Mr(e) {
2325
2325
  cardId: o != null ? String(o) : null
2326
2326
  };
2327
2327
  }
2328
- function xr(e, t, n = {}) {
2328
+ function Ur(e, t, n = {}) {
2329
2329
  var S, P, k, L;
2330
- const r = [], o = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, i = ((P = e == null ? void 0 : e.cards_v2) == null ? void 0 : P.data) || [], c = ((L = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : L.attributes) || {}, u = ee(c.payment_method_kaspi), l = ee(c.payment_method_card), h = typeof window < "u" && window.self === window.top, m = Dt() === "ios", b = !!(n != null && n.onlyKaspiAvailable), I = !!(n != null && n.disableKaspi);
2331
- return o != null && o.isKaspiOnly && u && !I ? [de] : b ? o != null && o.isAvailable && u && !I ? [de] : [] : (ee(c.payment_method_apple_pay) && !Ye("apple_pay") && (Ge() && h || We() || m || Fn() === 16) && r.push(Xn), o != null && o.isAvailable && u && !I && r.push(de), l && i.filter((R) => !R.isExpired).forEach((R) => {
2330
+ const r = [], o = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, i = ((P = e == null ? void 0 : e.cards_v2) == null ? void 0 : P.data) || [], c = ((L = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : L.attributes) || {}, u = ee(c.payment_method_kaspi), l = ee(c.payment_method_card), f = typeof window < "u" && window.self === window.top, m = Dt() === "ios", b = !!(n != null && n.onlyKaspiAvailable), I = !!(n != null && n.disableKaspi);
2331
+ return o != null && o.isKaspiOnly && u && !I ? [de] : b ? o != null && o.isAvailable && u && !I ? [de] : [] : (ee(c.payment_method_apple_pay) && !Ye("apple_pay") && (Ge() && f || We() || m || Xn() === 16) && r.push(Hn), o != null && o.isAvailable && u && !I && r.push(de), l && i.filter((R) => !R.isExpired).forEach((R) => {
2332
2332
  r.push({
2333
2333
  iconType: Je(R.attributes.mask),
2334
2334
  type: "card",
@@ -2337,7 +2337,7 @@ function xr(e, t, n = {}) {
2337
2337
  cardType: R.type,
2338
2338
  isDefault: R.attributes.isDefault
2339
2339
  });
2340
- }), ee(c.payment_method_google_pay) && !Ye("google_pay") && !(n != null && n.disableGooglePay) && !Ge() && !We() && r.push(Hn), ee(c.payment_method_new_card) && r.push({
2340
+ }), ee(c.payment_method_google_pay) && !Ye("google_pay") && !(n != null && n.disableGooglePay) && !Ge() && !We() && r.push(jn), ee(c.payment_method_new_card) && r.push({
2341
2341
  iconType: "new_card",
2342
2342
  type: "new_card",
2343
2343
  label: t ? t("newCard") : "Оплата новой картой"
@@ -2345,14 +2345,14 @@ function xr(e, t, n = {}) {
2345
2345
  }
2346
2346
  function It(e, t = {}) {
2347
2347
  var Q, S, P, k;
2348
- const n = (Q = e == null ? void 0 : e.kaspi) == null ? void 0 : Q.data, r = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], o = ((k = (P = e == null ? void 0 : e.payment_methods) == null ? void 0 : P.data) == null ? void 0 : k.attributes) || {}, i = ee(o.payment_method_kaspi), c = ee(o.payment_method_card), u = !!(t != null && t.disableKaspi), l = typeof window < "u" && window.self === window.top, y = Dt() === "ios", m = ee(o.payment_method_apple_pay) && !Ye("apple_pay") && (Ge() && l || We() || y || Fn() === 16), b = ee(o.payment_method_google_pay) && !Ye("google_pay") && !(t != null && t.disableGooglePay) && !Ge() && !We();
2348
+ const n = (Q = e == null ? void 0 : e.kaspi) == null ? void 0 : Q.data, r = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], o = ((k = (P = e == null ? void 0 : e.payment_methods) == null ? void 0 : P.data) == null ? void 0 : k.attributes) || {}, i = ee(o.payment_method_kaspi), c = ee(o.payment_method_card), u = !!(t != null && t.disableKaspi), l = typeof window < "u" && window.self === window.top, y = Dt() === "ios", m = ee(o.payment_method_apple_pay) && !Ye("apple_pay") && (Ge() && l || We() || y || Xn() === 16), b = ee(o.payment_method_google_pay) && !Ye("google_pay") && !(t != null && t.disableGooglePay) && !Ge() && !We();
2349
2349
  if (n != null && n.isKaspiOnly && i && !u || t != null && t.onlyKaspiAvailable && (n != null && n.isAvailable) && i && !u)
2350
2350
  return de;
2351
- const I = Mr(e);
2351
+ const I = xr(e);
2352
2352
  if ((I == null ? void 0 : I.type) === "kaspi_pay" && (n != null && n.isAvailable) && i && !u)
2353
2353
  return de;
2354
- if ((I == null ? void 0 : I.type) === "apple_pay" && m) return Xn;
2355
- if ((I == null ? void 0 : I.type) === "google_pay" && b) return Hn;
2354
+ if ((I == null ? void 0 : I.type) === "apple_pay" && m) return Hn;
2355
+ if ((I == null ? void 0 : I.type) === "google_pay" && b) return jn;
2356
2356
  if ((I == null ? void 0 : I.type) === "new_card" && ee(o.payment_method_new_card))
2357
2357
  return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
2358
2358
  if ((I == null ? void 0 : I.type) === "card" && c) {
@@ -2415,7 +2415,7 @@ function Ee(e) {
2415
2415
  function ie(e) {
2416
2416
  return e ? { "X-Country": e } : {};
2417
2417
  }
2418
- async function Ur(e, t) {
2418
+ async function Fr(e, t) {
2419
2419
  var n;
2420
2420
  try {
2421
2421
  const r = await e.json(), o = (n = r == null ? void 0 : r.errors) == null ? void 0 : n[0];
@@ -2425,7 +2425,7 @@ async function Ur(e, t) {
2425
2425
  }
2426
2426
  }
2427
2427
  async function le(e, t) {
2428
- const n = await Ur(e, t);
2428
+ const n = await Fr(e, t);
2429
2429
  throw Object.assign(new Error(n), { status: e.status });
2430
2430
  }
2431
2431
  function rt(e, t, n = {}) {
@@ -2469,13 +2469,13 @@ async function st(e, t, n, r, o) {
2469
2469
  return i.ok || await le(i, o), i.json();
2470
2470
  }
2471
2471
  async function sn(e, t, n, r) {
2472
- var l, h, y, m;
2472
+ var l, f, y, m;
2473
2473
  const o = await fetch(`${e}/api/v2/oauth2/tokens`, {
2474
2474
  method: "POST",
2475
2475
  headers: {
2476
2476
  "Content-Type": "application/json",
2477
2477
  "X-Idempotency-Key": nt(),
2478
- "X-Fingerprint": Un(),
2478
+ "X-Fingerprint": Fn(),
2479
2479
  ...ie(r)
2480
2480
  },
2481
2481
  body: JSON.stringify({
@@ -2485,12 +2485,12 @@ async function sn(e, t, n, r) {
2485
2485
  })
2486
2486
  });
2487
2487
  o.ok || await le(o, "Не удалось авторизоваться через track_id");
2488
- const i = await o.json(), c = (i == null ? void 0 : i.access_token) ?? ((h = (l = i == null ? void 0 : i.data) == null ? void 0 : l.attributes) == null ? void 0 : h.access_token), u = (i == null ? void 0 : i.refresh_token) ?? ((m = (y = i == null ? void 0 : i.data) == null ? void 0 : y.attributes) == null ? void 0 : m.refresh_token) ?? null;
2488
+ const i = await o.json(), c = (i == null ? void 0 : i.access_token) ?? ((f = (l = i == null ? void 0 : i.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), u = (i == null ? void 0 : i.refresh_token) ?? ((m = (y = i == null ? void 0 : i.data) == null ? void 0 : y.attributes) == null ? void 0 : m.refresh_token) ?? null;
2489
2489
  if (!c) throw new Error("В ответе отсутствует access_token");
2490
2490
  return { access_token: c, refresh_token: u };
2491
2491
  }
2492
- async function Fr(e, t, n, r) {
2493
- var l, h, y, m;
2492
+ async function Xr(e, t, n, r) {
2493
+ var l, f, y, m;
2494
2494
  const o = await fetch(`${e}/api/v2/oauth2/tokens`, {
2495
2495
  method: "POST",
2496
2496
  headers: {
@@ -2504,7 +2504,7 @@ async function Fr(e, t, n, r) {
2504
2504
  })
2505
2505
  });
2506
2506
  o.ok || await le(o, "Не удалось обновить токен по refresh_token");
2507
- const i = await o.json(), c = (i == null ? void 0 : i.access_token) ?? ((h = (l = i == null ? void 0 : i.data) == null ? void 0 : l.attributes) == null ? void 0 : h.access_token), u = (i == null ? void 0 : i.refresh_token) ?? ((m = (y = i == null ? void 0 : i.data) == null ? void 0 : y.attributes) == null ? void 0 : m.refresh_token) ?? null;
2507
+ const i = await o.json(), c = (i == null ? void 0 : i.access_token) ?? ((f = (l = i == null ? void 0 : i.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), u = (i == null ? void 0 : i.refresh_token) ?? ((m = (y = i == null ? void 0 : i.data) == null ? void 0 : y.attributes) == null ? void 0 : m.refresh_token) ?? null;
2508
2508
  if (!c) throw new Error("В ответе отсутствует access_token");
2509
2509
  return { access_token: c, refresh_token: u };
2510
2510
  }
@@ -2528,7 +2528,7 @@ async function Bt(e, t) {
2528
2528
  });
2529
2529
  return n.ok || await le(n, "Ошибка получения контекста оплаты"), n.json();
2530
2530
  }
2531
- async function Xr(e, t, n) {
2531
+ async function Hr(e, t, n) {
2532
2532
  const r = await fetch(`${e}/payment-gateway/v1/cards/${n}`, {
2533
2533
  method: "DELETE",
2534
2534
  headers: {
@@ -2539,7 +2539,7 @@ async function Xr(e, t, n) {
2539
2539
  });
2540
2540
  return r.ok || await le(r, "Не удалось удалить карту"), r.json().catch(() => ({}));
2541
2541
  }
2542
- async function Hr(e, t, n) {
2542
+ async function jr(e, t, n) {
2543
2543
  const r = await fetch(
2544
2544
  `${e}/payment-gateway/v1/cards/${n}/mark_as_default`,
2545
2545
  {
@@ -2553,7 +2553,7 @@ async function Hr(e, t, n) {
2553
2553
  );
2554
2554
  return r.ok || await le(r, "Не удалось отметить карту как основную"), r.json().catch(() => ({}));
2555
2555
  }
2556
- async function jr(e, t, n) {
2556
+ async function an(e, t, n) {
2557
2557
  const r = await fetch(`${e}/orders/v1/orders/${n}/status`, {
2558
2558
  method: "GET",
2559
2559
  headers: {
@@ -2570,7 +2570,7 @@ async function jr(e, t, n) {
2570
2570
  const o = await r.json(), i = (o == null ? void 0 : o.data) ?? o;
2571
2571
  return { data: { status: i == null ? void 0 : i.status, payload: (i == null ? void 0 : i.payload) ?? {} } };
2572
2572
  }
2573
- async function an(e, t, n, r, o = {}) {
2573
+ async function cn(e, t, n, r, o = {}) {
2574
2574
  const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } = rt(
2575
2575
  t,
2576
2576
  {
@@ -2615,7 +2615,7 @@ async function qr(e, t) {
2615
2615
  );
2616
2616
  return n.ok || await le(n, "Ошибка получения купонов"), n.json();
2617
2617
  }
2618
- async function cn(e, t, n) {
2618
+ async function un(e, t, n) {
2619
2619
  const r = window.location.hostname, o = {
2620
2620
  validationUrl: n,
2621
2621
  domainName: r
@@ -2647,7 +2647,7 @@ async function zr(e, t, n, r, o = {}) {
2647
2647
  "Ошибка создания заказа с Apple Pay"
2648
2648
  );
2649
2649
  }
2650
- async function jn(e, t, n, r, o = {}) {
2650
+ async function Jn(e, t, n, r, o = {}) {
2651
2651
  const { checkoutAmount: i, checkoutPaymentMethod: c, useBalanceFlag: u, voucher: l } = rt(
2652
2652
  t,
2653
2653
  { type: "google_pay", data: r },
@@ -2719,7 +2719,7 @@ function it(e, t, n) {
2719
2719
  const r = n || j, o = r.__SENTRY__ = r.__SENTRY__ || {}, i = o[he] = o[he] || {};
2720
2720
  return i[e] || (i[e] = t());
2721
2721
  }
2722
- const xt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Gr = "Sentry Logger ", un = [
2722
+ const xt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Gr = "Sentry Logger ", ln = [
2723
2723
  "debug",
2724
2724
  "info",
2725
2725
  "warn",
@@ -2727,13 +2727,13 @@ const xt = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Gr = "Sentry Logge
2727
2727
  "log",
2728
2728
  "assert",
2729
2729
  "trace"
2730
- ], ln = {};
2730
+ ], An = {};
2731
2731
  function at(e) {
2732
2732
  if (!("console" in j))
2733
2733
  return e();
2734
- const t = j.console, n = {}, r = Object.keys(ln);
2734
+ const t = j.console, n = {}, r = Object.keys(An);
2735
2735
  r.forEach((o) => {
2736
- const i = ln[o];
2736
+ const i = An[o];
2737
2737
  n[o] = t[o], t[o] = i;
2738
2738
  });
2739
2739
  try {
@@ -2755,18 +2755,18 @@ function Wr() {
2755
2755
  },
2756
2756
  isEnabled: () => e
2757
2757
  };
2758
- return xt ? un.forEach((n) => {
2758
+ return xt ? ln.forEach((n) => {
2759
2759
  t[n] = (...r) => {
2760
2760
  e && at(() => {
2761
2761
  j.console[n](`${Gr}[${n}]:`, ...r);
2762
2762
  });
2763
2763
  };
2764
- }) : un.forEach((n) => {
2764
+ }) : ln.forEach((n) => {
2765
2765
  t[n] = () => {
2766
2766
  };
2767
2767
  }), t;
2768
2768
  }
2769
- const N = it("logger", Wr), Jn = 50, ve = "?", An = /\(error: (.*)\)/, dn = /captureMessage|captureException/;
2769
+ const N = it("logger", Wr), qn = 50, ve = "?", dn = /\(error: (.*)\)/, fn = /captureMessage|captureException/;
2770
2770
  function Yr(...e) {
2771
2771
  const t = e.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
2772
2772
  return (n, r = 0, o = 0) => {
@@ -2776,16 +2776,16 @@ function Yr(...e) {
2776
2776
  const l = c[u];
2777
2777
  if (l.length > 1024)
2778
2778
  continue;
2779
- const h = An.test(l) ? l.replace(An, "$1") : l;
2780
- if (!h.match(/\S*Error: /)) {
2779
+ const f = dn.test(l) ? l.replace(dn, "$1") : l;
2780
+ if (!f.match(/\S*Error: /)) {
2781
2781
  for (const y of t) {
2782
- const m = y(h);
2782
+ const m = y(f);
2783
2783
  if (m) {
2784
2784
  i.push(m);
2785
2785
  break;
2786
2786
  }
2787
2787
  }
2788
- if (i.length >= Jn + o)
2788
+ if (i.length >= qn + o)
2789
2789
  break;
2790
2790
  }
2791
2791
  }
@@ -2796,13 +2796,13 @@ function Vr(e) {
2796
2796
  if (!e.length)
2797
2797
  return [];
2798
2798
  const t = Array.from(e);
2799
- return /sentryWrapped/.test(De(t).function || "") && t.pop(), t.reverse(), dn.test(De(t).function || "") && (t.pop(), dn.test(De(t).function || "") && t.pop()), t.slice(0, Jn).map((n) => ({
2799
+ return /sentryWrapped/.test(Me(t).function || "") && t.pop(), t.reverse(), fn.test(Me(t).function || "") && (t.pop(), fn.test(Me(t).function || "") && t.pop()), t.slice(0, qn).map((n) => ({
2800
2800
  ...n,
2801
- filename: n.filename || De(t).filename,
2801
+ filename: n.filename || Me(t).filename,
2802
2802
  function: n.function || ve
2803
2803
  }));
2804
2804
  }
2805
- function De(e) {
2805
+ function Me(e) {
2806
2806
  return e[e.length - 1] || {};
2807
2807
  }
2808
2808
  const Ct = "<anonymous>";
@@ -2820,9 +2820,9 @@ function Ft(e) {
2820
2820
  const t = e.__SENTRY__ = e.__SENTRY__ || {};
2821
2821
  return t.version = t.version || he, t[he] = t[he] || {};
2822
2822
  }
2823
- const qn = Object.prototype.toString;
2824
- function zn(e) {
2825
- switch (qn.call(e)) {
2823
+ const zn = Object.prototype.toString;
2824
+ function Kn(e) {
2825
+ switch (zn.call(e)) {
2826
2826
  case "[object Error]":
2827
2827
  case "[object Exception]":
2828
2828
  case "[object DOMException]":
@@ -2832,20 +2832,20 @@ function zn(e) {
2832
2832
  return lt(e, Error);
2833
2833
  }
2834
2834
  }
2835
- function Te(e, t) {
2836
- return qn.call(e) === `[object ${t}]`;
2835
+ function Re(e, t) {
2836
+ return zn.call(e) === `[object ${t}]`;
2837
2837
  }
2838
- function Kn(e) {
2839
- return Te(e, "ErrorEvent");
2838
+ function Gn(e) {
2839
+ return Re(e, "ErrorEvent");
2840
2840
  }
2841
- function fn(e) {
2842
- return Te(e, "DOMError");
2841
+ function hn(e) {
2842
+ return Re(e, "DOMError");
2843
2843
  }
2844
2844
  function $r(e) {
2845
- return Te(e, "DOMException");
2845
+ return Re(e, "DOMException");
2846
2846
  }
2847
- function Gn(e) {
2848
- return Te(e, "String");
2847
+ function Wn(e) {
2848
+ return Re(e, "String");
2849
2849
  }
2850
2850
  function Xt(e) {
2851
2851
  return typeof e == "object" && e !== null && "__sentry_template_string__" in e && "__sentry_template_values__" in e;
@@ -2854,7 +2854,7 @@ function eo(e) {
2854
2854
  return e === null || Xt(e) || typeof e != "object" && typeof e != "function";
2855
2855
  }
2856
2856
  function Ie(e) {
2857
- return Te(e, "Object");
2857
+ return Re(e, "Object");
2858
2858
  }
2859
2859
  function ct(e) {
2860
2860
  return typeof Event < "u" && lt(e, Event);
@@ -2887,10 +2887,10 @@ function io(e, t = {}) {
2887
2887
  const r = 5, o = [];
2888
2888
  let i = 0, c = 0;
2889
2889
  const u = " > ", l = u.length;
2890
- let h;
2890
+ let f;
2891
2891
  const y = Array.isArray(t) ? t : t.keyAttrs, m = !Array.isArray(t) && t.maxStringLength || so;
2892
- for (; n && i++ < r && (h = ao(n, y), !(h === "html" || i > 1 && c + o.length * l + h.length >= m)); )
2893
- o.push(h), c += h.length, n = n.parentNode;
2892
+ for (; n && i++ < r && (f = ao(n, y), !(f === "html" || i > 1 && c + o.length * l + f.length >= m)); )
2893
+ o.push(f), c += f.length, n = n.parentNode;
2894
2894
  return o.reverse().join(u);
2895
2895
  } catch {
2896
2896
  return "<unknown>";
@@ -2915,7 +2915,7 @@ function ao(e, t) {
2915
2915
  else {
2916
2916
  n.id && r.push(`#${n.id}`);
2917
2917
  const c = n.className;
2918
- if (c && Gn(c)) {
2918
+ if (c && Wn(c)) {
2919
2919
  const u = c.split(/\s+/);
2920
2920
  for (const l of u)
2921
2921
  r.push(`.${l}`);
@@ -2928,10 +2928,10 @@ function ao(e, t) {
2928
2928
  }
2929
2929
  return r.join("");
2930
2930
  }
2931
- function Qe(e, t = 0) {
2931
+ function ke(e, t = 0) {
2932
2932
  return typeof e != "string" || t === 0 || e.length <= t ? e : `${e.slice(0, t)}...`;
2933
2933
  }
2934
- function Wn(e, t, n) {
2934
+ function Yn(e, t, n) {
2935
2935
  try {
2936
2936
  Object.defineProperty(e, t, {
2937
2937
  // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
@@ -2943,33 +2943,33 @@ function Wn(e, t, n) {
2943
2943
  xt && N.log(`Failed to add non-enumerable property "${t}" to object`, e);
2944
2944
  }
2945
2945
  }
2946
- function Yn(e) {
2947
- if (zn(e))
2946
+ function Vn(e) {
2947
+ if (Kn(e))
2948
2948
  return {
2949
2949
  message: e.message,
2950
2950
  name: e.name,
2951
2951
  stack: e.stack,
2952
- ...pn(e)
2952
+ ...gn(e)
2953
2953
  };
2954
2954
  if (ct(e)) {
2955
2955
  const t = {
2956
2956
  type: e.type,
2957
- target: hn(e.target),
2958
- currentTarget: hn(e.currentTarget),
2959
- ...pn(e)
2957
+ target: pn(e.target),
2958
+ currentTarget: pn(e.currentTarget),
2959
+ ...gn(e)
2960
2960
  };
2961
2961
  return typeof CustomEvent < "u" && lt(e, CustomEvent) && (t.detail = e.detail), t;
2962
2962
  } else
2963
2963
  return e;
2964
2964
  }
2965
- function hn(e) {
2965
+ function pn(e) {
2966
2966
  try {
2967
2967
  return to(e) ? io(e) : Object.prototype.toString.call(e);
2968
2968
  } catch {
2969
2969
  return "<unknown>";
2970
2970
  }
2971
2971
  }
2972
- function pn(e) {
2972
+ function gn(e) {
2973
2973
  if (typeof e == "object" && e !== null) {
2974
2974
  const t = {};
2975
2975
  for (const n in e)
@@ -2979,17 +2979,17 @@ function pn(e) {
2979
2979
  return {};
2980
2980
  }
2981
2981
  function co(e, t = 40) {
2982
- const n = Object.keys(Yn(e));
2982
+ const n = Object.keys(Vn(e));
2983
2983
  n.sort();
2984
2984
  const r = n[0];
2985
2985
  if (!r)
2986
2986
  return "[object has no keys]";
2987
2987
  if (r.length >= t)
2988
- return Qe(r, t);
2988
+ return ke(r, t);
2989
2989
  for (let o = n.length; o > 0; o--) {
2990
2990
  const i = n.slice(0, o).join(", ");
2991
2991
  if (!(i.length > t))
2992
- return o === n.length ? i : Qe(i, t);
2992
+ return o === n.length ? i : ke(i, t);
2993
2993
  }
2994
2994
  return "";
2995
2995
  }
@@ -3028,24 +3028,24 @@ function uo(e) {
3028
3028
  return !0;
3029
3029
  }
3030
3030
  }
3031
- const Vn = 1e3;
3031
+ const Zn = 1e3;
3032
3032
  function At() {
3033
- return Date.now() / Vn;
3033
+ return Date.now() / Zn;
3034
3034
  }
3035
3035
  function lo() {
3036
3036
  const { performance: e } = j;
3037
3037
  if (!e || !e.now)
3038
3038
  return At;
3039
3039
  const t = Date.now() - e.now(), n = e.timeOrigin == null ? t : e.timeOrigin;
3040
- return () => (n + e.now()) / Vn;
3040
+ return () => (n + e.now()) / Zn;
3041
3041
  }
3042
- const Zn = lo();
3042
+ const $n = lo();
3043
3043
  (() => {
3044
3044
  const { performance: e } = j;
3045
3045
  if (!e || !e.now)
3046
3046
  return;
3047
- const t = 3600 * 1e3, n = e.now(), r = Date.now(), o = e.timeOrigin ? Math.abs(e.timeOrigin + n - r) : t, i = o < t, c = e.timing && e.timing.navigationStart, l = typeof c == "number" ? Math.abs(c + n - r) : t, h = l < t;
3048
- return i || h ? o <= l ? e.timeOrigin : c : r;
3047
+ const t = 3600 * 1e3, n = e.now(), r = Date.now(), o = e.timeOrigin ? Math.abs(e.timeOrigin + n - r) : t, i = o < t, c = e.timing && e.timing.navigationStart, l = typeof c == "number" ? Math.abs(c + n - r) : t, f = l < t;
3048
+ return i || f ? o <= l ? e.timeOrigin : c : r;
3049
3049
  })();
3050
3050
  function te() {
3051
3051
  const e = j, t = e.crypto || e.msCrypto;
@@ -3070,11 +3070,11 @@ function te() {
3070
3070
  function Ao(e) {
3071
3071
  return e.exception && e.exception.values ? e.exception.values[0] : void 0;
3072
3072
  }
3073
- function gn(e, t, n) {
3073
+ function yn(e, t, n) {
3074
3074
  const r = e.exception = e.exception || {}, o = r.values = r.values || [], i = o[0] = o[0] || {};
3075
3075
  i.value || (i.value = t || ""), i.type || (i.type = "Error");
3076
3076
  }
3077
- function ke(e, t) {
3077
+ function Pe(e, t) {
3078
3078
  const n = Ao(e);
3079
3079
  if (!n)
3080
3080
  return;
@@ -3084,11 +3084,11 @@ function ke(e, t) {
3084
3084
  n.mechanism.data = i;
3085
3085
  }
3086
3086
  }
3087
- function yn(e) {
3087
+ function mn(e) {
3088
3088
  if (fo(e))
3089
3089
  return !0;
3090
3090
  try {
3091
- Wn(e, "__sentry_captured__", !0);
3091
+ Yn(e, "__sentry_captured__", !0);
3092
3092
  } catch {
3093
3093
  }
3094
3094
  return !1;
@@ -3215,7 +3215,7 @@ class W {
3215
3215
  }
3216
3216
  }
3217
3217
  function _t(e, t = {}) {
3218
- if (t.user && (!e.ipAddress && t.user.ip_address && (e.ipAddress = t.user.ip_address), !e.did && !t.did && (e.did = t.user.id || t.user.email || t.user.username)), e.timestamp = t.timestamp || Zn(), t.abnormal_mechanism && (e.abnormal_mechanism = t.abnormal_mechanism), t.ignoreDuration && (e.ignoreDuration = t.ignoreDuration), t.sid && (e.sid = t.sid.length === 32 ? t.sid : te()), t.init !== void 0 && (e.init = t.init), !e.did && t.did && (e.did = `${t.did}`), typeof t.started == "number" && (e.started = t.started), e.ignoreDuration)
3218
+ if (t.user && (!e.ipAddress && t.user.ip_address && (e.ipAddress = t.user.ip_address), !e.did && !t.did && (e.did = t.user.id || t.user.email || t.user.username)), e.timestamp = t.timestamp || $n(), t.abnormal_mechanism && (e.abnormal_mechanism = t.abnormal_mechanism), t.ignoreDuration && (e.ignoreDuration = t.ignoreDuration), t.sid && (e.sid = t.sid.length === 32 ? t.sid : te()), t.init !== void 0 && (e.init = t.init), !e.did && t.did && (e.did = `${t.did}`), typeof t.started == "number" && (e.started = t.started), e.ignoreDuration)
3219
3219
  e.duration = void 0;
3220
3220
  else if (typeof t.duration == "number")
3221
3221
  e.duration = t.duration;
@@ -3225,7 +3225,7 @@ function _t(e, t = {}) {
3225
3225
  }
3226
3226
  t.release && (e.release = t.release), t.environment && (e.environment = t.environment), !e.ipAddress && t.ipAddress && (e.ipAddress = t.ipAddress), !e.userAgent && t.userAgent && (e.userAgent = t.userAgent), typeof t.errors == "number" && (e.errors = t.errors), t.status && (e.status = t.status);
3227
3227
  }
3228
- function mn() {
3228
+ function Cn() {
3229
3229
  return te();
3230
3230
  }
3231
3231
  function Qt() {
@@ -3242,10 +3242,10 @@ function dt(e, t, n = 2) {
3242
3242
  return r;
3243
3243
  }
3244
3244
  const kt = "_sentrySpan";
3245
- function Cn(e, t) {
3246
- t ? Wn(e, kt, t) : delete e[kt];
3245
+ function bn(e, t) {
3246
+ t ? Yn(e, kt, t) : delete e[kt];
3247
3247
  }
3248
- function bn(e) {
3248
+ function En(e) {
3249
3249
  return e[kt];
3250
3250
  }
3251
3251
  const ho = 100;
@@ -3280,7 +3280,7 @@ class Ht {
3280
3280
  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.
3281
3281
  constructor() {
3282
3282
  this._notifyingListeners = !1, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = {
3283
- traceId: mn(),
3283
+ traceId: Cn(),
3284
3284
  spanId: Qt()
3285
3285
  };
3286
3286
  }
@@ -3291,7 +3291,7 @@ class Ht {
3291
3291
  const t = new Ht();
3292
3292
  return t._breadcrumbs = [...this._breadcrumbs], t._tags = { ...this._tags }, t._extra = { ...this._extra }, t._contexts = { ...this._contexts }, this._contexts.flags && (t._contexts.flags = {
3293
3293
  values: [...this._contexts.flags.values]
3294
- }), t._user = this._user, t._level = this._level, t._session = this._session, t._transactionName = this._transactionName, t._fingerprint = this._fingerprint, t._eventProcessors = [...this._eventProcessors], t._requestSession = this._requestSession, t._attachments = [...this._attachments], t._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, t._propagationContext = { ...this._propagationContext }, t._client = this._client, t._lastEventId = this._lastEventId, Cn(t, bn(this)), t;
3294
+ }), t._user = this._user, t._level = this._level, t._session = this._session, t._transactionName = this._transactionName, t._fingerprint = this._fingerprint, t._eventProcessors = [...this._eventProcessors], t._requestSession = this._requestSession, t._attachments = [...this._attachments], t._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, t._propagationContext = { ...this._propagationContext }, t._client = this._client, t._lastEventId = this._lastEventId, bn(t, En(this)), t;
3295
3295
  }
3296
3296
  /**
3297
3297
  * @inheritDoc
@@ -3443,14 +3443,14 @@ class Ht {
3443
3443
  const n = typeof t == "function" ? t(this) : t, [r, o] = n instanceof ue ? (
3444
3444
  // eslint-disable-next-line deprecation/deprecation
3445
3445
  [n.getScopeData(), n.getRequestSession()]
3446
- ) : Ie(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: h, fingerprint: y = [], propagationContext: m } = r || {};
3447
- 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;
3446
+ ) : Ie(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: f, fingerprint: y = [], propagationContext: m } = r || {};
3447
+ return this._tags = { ...this._tags, ...i }, this._extra = { ...this._extra, ...c }, this._contexts = { ...this._contexts, ...l }, u && Object.keys(u).length && (this._user = u), f && (this._level = f), y.length && (this._fingerprint = y), m && (this._propagationContext = m), o && (this._requestSession = o), this;
3448
3448
  }
3449
3449
  /**
3450
3450
  * @inheritDoc
3451
3451
  */
3452
3452
  clear() {
3453
- return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._session = void 0, Cn(this, void 0), this._attachments = [], this.setPropagationContext({ traceId: mn() }), this._notifyScopeListeners(), this;
3453
+ return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._session = void 0, bn(this, void 0), this._attachments = [], this.setPropagationContext({ traceId: Cn() }), this._notifyScopeListeners(), this;
3454
3454
  }
3455
3455
  /**
3456
3456
  * @inheritDoc
@@ -3504,7 +3504,7 @@ class Ht {
3504
3504
  propagationContext: this._propagationContext,
3505
3505
  sdkProcessingMetadata: this._sdkProcessingMetadata,
3506
3506
  transactionName: this._transactionName,
3507
- span: bn(this)
3507
+ span: En(this)
3508
3508
  };
3509
3509
  }
3510
3510
  /**
@@ -3668,36 +3668,36 @@ function Co(e, t) {
3668
3668
  const n = Be();
3669
3669
  return n.withScope(() => (n.getStackTop().scope = e, t(e)));
3670
3670
  }
3671
- function En(e) {
3671
+ function vn(e) {
3672
3672
  return Be().withScope(() => e(Be().getIsolationScope()));
3673
3673
  }
3674
3674
  function bo() {
3675
3675
  return {
3676
- withIsolationScope: En,
3676
+ withIsolationScope: vn,
3677
3677
  withScope: mo,
3678
3678
  withSetScope: Co,
3679
- withSetIsolationScope: (e, t) => En(t),
3679
+ withSetIsolationScope: (e, t) => vn(t),
3680
3680
  getCurrentScope: () => Be().getScope(),
3681
3681
  getIsolationScope: () => Be().getIsolationScope()
3682
3682
  };
3683
3683
  }
3684
- function $n(e) {
3684
+ function er(e) {
3685
3685
  const t = Ft(e);
3686
3686
  return t.acs ? t.acs : bo();
3687
3687
  }
3688
- function er() {
3688
+ function tr() {
3689
3689
  const e = Ut();
3690
- return $n(e).getCurrentScope();
3690
+ return er(e).getCurrentScope();
3691
3691
  }
3692
3692
  function Eo() {
3693
3693
  const e = Ut();
3694
- return $n(e).getIsolationScope();
3694
+ return er(e).getIsolationScope();
3695
3695
  }
3696
3696
  function vo() {
3697
3697
  return it("globalScope", () => new ue());
3698
3698
  }
3699
3699
  function jt() {
3700
- return er().getClient();
3700
+ return tr().getClient();
3701
3701
  }
3702
3702
  function Io(e) {
3703
3703
  const t = e.getPropagationContext(), { traceId: n, spanId: r, parentSpanId: o } = t;
@@ -3733,19 +3733,19 @@ function Oo(e) {
3733
3733
  return n;
3734
3734
  }
3735
3735
  function No(e) {
3736
- if (!(!e || !Gn(e) && !Array.isArray(e)))
3736
+ if (!(!e || !Wn(e) && !Array.isArray(e)))
3737
3737
  return Array.isArray(e) ? e.reduce((t, n) => {
3738
- const r = vn(n);
3738
+ const r = In(n);
3739
3739
  return Object.entries(r).forEach(([o, i]) => {
3740
3740
  t[o] = i;
3741
3741
  }), t;
3742
- }, {}) : vn(e);
3742
+ }, {}) : In(e);
3743
3743
  }
3744
- function vn(e) {
3744
+ function In(e) {
3745
3745
  return e.split(",").map((t) => t.split("=").map((n) => decodeURIComponent(n.trim()))).reduce((t, [n, r]) => (n && r && (t[n] = r), t), {});
3746
3746
  }
3747
3747
  const Do = 1;
3748
- let In = !1;
3748
+ let Bn = !1;
3749
3749
  function Mo(e) {
3750
3750
  const { spanId: t, traceId: n, isRemote: r } = e.spanContext(), o = r ? t : Jt(e).parent_span_id, i = r ? Qt() : t;
3751
3751
  return V({
@@ -3754,10 +3754,10 @@ function Mo(e) {
3754
3754
  trace_id: n
3755
3755
  });
3756
3756
  }
3757
- function Bn(e) {
3758
- return typeof e == "number" ? Sn(e) : Array.isArray(e) ? e[0] + e[1] / 1e9 : e instanceof Date ? Sn(e.getTime()) : Zn();
3759
- }
3760
3757
  function Sn(e) {
3758
+ return typeof e == "number" ? _n(e) : Array.isArray(e) ? e[0] + e[1] / 1e9 : e instanceof Date ? _n(e.getTime()) : $n();
3759
+ }
3760
+ function _n(e) {
3761
3761
  return e > 9999999999 ? e / 1e3 : e;
3762
3762
  }
3763
3763
  function Jt(e) {
@@ -3773,9 +3773,9 @@ function Jt(e) {
3773
3773
  data: r,
3774
3774
  description: i,
3775
3775
  parent_span_id: u,
3776
- start_timestamp: Bn(o),
3776
+ start_timestamp: Sn(o),
3777
3777
  // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time
3778
- timestamp: Bn(c) || void 0,
3778
+ timestamp: Sn(c) || void 0,
3779
3779
  status: Xo(l),
3780
3780
  op: r[ko],
3781
3781
  origin: r[Po],
@@ -3806,15 +3806,15 @@ function Xo(e) {
3806
3806
  return e.code === To ? "ok" : e.message || "unknown_error";
3807
3807
  }
3808
3808
  const Ho = "_sentryRootSpan";
3809
- function tr(e) {
3809
+ function nr(e) {
3810
3810
  return e[Ho] || e;
3811
3811
  }
3812
3812
  function jo() {
3813
- In || (at(() => {
3813
+ Bn || (at(() => {
3814
3814
  console.warn(
3815
3815
  "[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly."
3816
3816
  );
3817
- }), In = !0);
3817
+ }), Bn = !0);
3818
3818
  }
3819
3819
  function Jo(e) {
3820
3820
  if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__)
@@ -3822,10 +3822,10 @@ function Jo(e) {
3822
3822
  const t = jt(), n = t && t.getOptions();
3823
3823
  return !!n && (n.enableTracing || "tracesSampleRate" in n || "tracesSampler" in n);
3824
3824
  }
3825
- const nr = "production", qo = "_frozenDsc";
3826
- function rr(e, t) {
3825
+ const rr = "production", qo = "_frozenDsc";
3826
+ function or(e, t) {
3827
3827
  const n = t.getOptions(), { publicKey: r } = t.getDsn() || {}, o = V({
3828
- environment: n.environment || nr,
3828
+ environment: n.environment || rr,
3829
3829
  release: n.release,
3830
3830
  public_key: r,
3831
3831
  trace_id: e
@@ -3834,21 +3834,21 @@ function rr(e, t) {
3834
3834
  }
3835
3835
  function zo(e, t) {
3836
3836
  const n = t.getPropagationContext();
3837
- return n.dsc || rr(n.traceId, e);
3837
+ return n.dsc || or(n.traceId, e);
3838
3838
  }
3839
3839
  function Ko(e) {
3840
3840
  const t = jt();
3841
3841
  if (!t)
3842
3842
  return {};
3843
- const n = tr(e), r = n[qo];
3843
+ const n = nr(e), r = n[qo];
3844
3844
  if (r)
3845
3845
  return r;
3846
3846
  const o = n.spanContext().traceState, i = o && o.get("sentry.dsc"), c = i && Oo(i);
3847
3847
  if (c)
3848
3848
  return c;
3849
- const u = rr(e.spanContext().traceId, t), l = Jt(n), h = l.data || {}, y = h[Qo];
3849
+ const u = or(e.spanContext().traceId, t), l = Jt(n), f = l.data || {}, y = f[Qo];
3850
3850
  y != null && (u.sample_rate = `${y}`);
3851
- const m = h[_o], b = l.description;
3851
+ const m = f[_o], b = l.description;
3852
3852
  return m !== "url" && b && (u.transaction = b), Jo() && (u.sampled = String(Fo(n))), t.emit("createDsc", u, n), u;
3853
3853
  }
3854
3854
  function Go(e) {
@@ -3882,15 +3882,15 @@ function Vo(e) {
3882
3882
  return;
3883
3883
  }
3884
3884
  const [n, r, o = "", i = "", c = "", u = ""] = t.slice(1);
3885
- let l = "", h = u;
3886
- const y = h.split("/");
3887
- if (y.length > 1 && (l = y.slice(0, -1).join("/"), h = y.pop()), h) {
3888
- const m = h.match(/^\d+/);
3889
- m && (h = m[0]);
3885
+ let l = "", f = u;
3886
+ const y = f.split("/");
3887
+ if (y.length > 1 && (l = y.slice(0, -1).join("/"), f = y.pop()), f) {
3888
+ const m = f.match(/^\d+/);
3889
+ m && (f = m[0]);
3890
3890
  }
3891
- return or({ host: i, pass: o, path: l, projectId: h, port: c, protocol: n, publicKey: r });
3891
+ return sr({ host: i, pass: o, path: l, projectId: f, port: c, protocol: n, publicKey: r });
3892
3892
  }
3893
- function or(e) {
3893
+ function sr(e) {
3894
3894
  return {
3895
3895
  protocol: e.protocol,
3896
3896
  publicKey: e.publicKey || "",
@@ -3908,7 +3908,7 @@ function Zo(e) {
3908
3908
  return ["protocol", "publicKey", "host", "projectId"].find((c) => e[c] ? !1 : (N.error(`Invalid Sentry Dsn: ${c} missing`), !0)) ? !1 : n.match(/^\d+$/) ? Yo(r) ? t && isNaN(parseInt(t, 10)) ? (N.error(`Invalid Sentry Dsn: Invalid port ${t}`), !1) : !0 : (N.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), !1) : (N.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), !1);
3909
3909
  }
3910
3910
  function $o(e) {
3911
- const t = typeof e == "string" ? Vo(e) : or(e);
3911
+ const t = typeof e == "string" ? Vo(e) : sr(e);
3912
3912
  if (!(!t || !Zo(t)))
3913
3913
  return t;
3914
3914
  }
@@ -3941,9 +3941,9 @@ function oe(e, t = 100, n = 1 / 0) {
3941
3941
  return { ERROR: `**non-serializable** (${r})` };
3942
3942
  }
3943
3943
  }
3944
- function sr(e, t = 3, n = 100 * 1024) {
3944
+ function ir(e, t = 3, n = 100 * 1024) {
3945
3945
  const r = oe(e, t);
3946
- return os(r) > n ? sr(e, t - 1, n) : r;
3946
+ return os(r) > n ? ir(e, t - 1, n) : r;
3947
3947
  }
3948
3948
  function Pt(e, t, n = 1 / 0, r = 1 / 0, o = es()) {
3949
3949
  const [i, c] = o;
@@ -3960,16 +3960,16 @@ function Pt(e, t, n = 1 / 0, r = 1 / 0, o = es()) {
3960
3960
  return u.replace("object ", "");
3961
3961
  if (i(t))
3962
3962
  return "[Circular ~]";
3963
- const h = t;
3964
- if (h && typeof h.toJSON == "function")
3963
+ const f = t;
3964
+ if (f && typeof f.toJSON == "function")
3965
3965
  try {
3966
- const I = h.toJSON();
3966
+ const I = f.toJSON();
3967
3967
  return Pt("", I, l - 1, r, o);
3968
3968
  } catch {
3969
3969
  }
3970
3970
  const y = Array.isArray(t) ? [] : {};
3971
3971
  let m = 0;
3972
- const b = Yn(t);
3972
+ const b = Vn(t);
3973
3973
  for (const I in b) {
3974
3974
  if (!Object.prototype.hasOwnProperty.call(b, I))
3975
3975
  continue;
@@ -4022,14 +4022,14 @@ function rs(e) {
4022
4022
  function os(e) {
4023
4023
  return rs(JSON.stringify(e));
4024
4024
  }
4025
- function Re(e, t = []) {
4025
+ function Le(e, t = []) {
4026
4026
  return [e, t];
4027
4027
  }
4028
4028
  function ss(e, t) {
4029
4029
  const [n, r] = e;
4030
4030
  return [n, [...r, t]];
4031
4031
  }
4032
- function _n(e, t) {
4032
+ function Qn(e, t) {
4033
4033
  const n = e[1];
4034
4034
  for (const r of n) {
4035
4035
  const o = r[0].type;
@@ -4103,10 +4103,10 @@ const us = {
4103
4103
  statsd: "metric_bucket",
4104
4104
  raw_security: "security"
4105
4105
  };
4106
- function Qn(e) {
4106
+ function kn(e) {
4107
4107
  return us[e];
4108
4108
  }
4109
- function ir(e) {
4109
+ function ar(e) {
4110
4110
  if (!e || !e.sdk)
4111
4111
  return;
4112
4112
  const { name: t, version: n } = e.sdk;
@@ -4128,18 +4128,18 @@ function As(e, t) {
4128
4128
  return t && (e.sdk = e.sdk || {}, e.sdk.name = e.sdk.name || t.name, e.sdk.version = e.sdk.version || t.version, e.sdk.integrations = [...e.sdk.integrations || [], ...t.integrations || []], e.sdk.packages = [...e.sdk.packages || [], ...t.packages || []]), e;
4129
4129
  }
4130
4130
  function ds(e, t, n, r) {
4131
- const o = ir(n), i = {
4131
+ const o = ar(n), i = {
4132
4132
  sent_at: (/* @__PURE__ */ new Date()).toISOString(),
4133
4133
  ...o && { sdk: o },
4134
4134
  ...!!r && t && { dsn: ft(t) }
4135
4135
  }, c = "aggregates" in e ? [{ type: "sessions" }, e] : [{ type: "session" }, e.toJSON()];
4136
- return Re(i, [c]);
4136
+ return Le(i, [c]);
4137
4137
  }
4138
4138
  function fs(e, t, n, r) {
4139
- const o = ir(n), i = e.type && e.type !== "replay_event" ? e.type : "event";
4139
+ const o = ar(n), i = e.type && e.type !== "replay_event" ? e.type : "event";
4140
4140
  As(e, n && n.sdk);
4141
4141
  const c = ls(e, o, r, t);
4142
- return delete e.sdkProcessingMetadata, Re(c, [[{ type: i }, e]]);
4142
+ return delete e.sdkProcessingMetadata, Le(c, [[{ type: i }, e]]);
4143
4143
  }
4144
4144
  function Tt(e, t, n, r = 0) {
4145
4145
  return new W((o, i) => {
@@ -4152,35 +4152,35 @@ function Tt(e, t, n, r = 0) {
4152
4152
  }
4153
4153
  });
4154
4154
  }
4155
- let Me, kn, xe;
4155
+ let xe, Pn, Ue;
4156
4156
  function hs(e) {
4157
4157
  const t = j._sentryDebugIds;
4158
4158
  if (!t)
4159
4159
  return {};
4160
4160
  const n = Object.keys(t);
4161
- return xe && n.length === kn || (kn = n.length, xe = n.reduce((r, o) => {
4162
- Me || (Me = {});
4163
- const i = Me[o];
4161
+ return Ue && n.length === Pn || (Pn = n.length, Ue = n.reduce((r, o) => {
4162
+ xe || (xe = {});
4163
+ const i = xe[o];
4164
4164
  if (i)
4165
4165
  r[i[0]] = i[1];
4166
4166
  else {
4167
4167
  const c = e(o);
4168
4168
  for (let u = c.length - 1; u >= 0; u--) {
4169
- const l = c[u], h = l && l.filename, y = t[o];
4170
- if (h && y) {
4171
- r[h] = y, Me[o] = [h, y];
4169
+ const l = c[u], f = l && l.filename, y = t[o];
4170
+ if (f && y) {
4171
+ r[f] = y, xe[o] = [f, y];
4172
4172
  break;
4173
4173
  }
4174
4174
  }
4175
4175
  }
4176
4176
  return r;
4177
- }, {})), xe;
4177
+ }, {})), Ue;
4178
4178
  }
4179
4179
  function ps(e, t) {
4180
4180
  const { fingerprint: n, span: r, breadcrumbs: o, sdkProcessingMetadata: i } = t;
4181
4181
  gs(e, t), r && Cs(e, r), bs(e, n), ys(e, o), ms(e, i);
4182
4182
  }
4183
- function Pn(e, t) {
4183
+ function wn(e, t) {
4184
4184
  const {
4185
4185
  extra: n,
4186
4186
  tags: r,
@@ -4189,23 +4189,23 @@ function Pn(e, t) {
4189
4189
  level: c,
4190
4190
  sdkProcessingMetadata: u,
4191
4191
  breadcrumbs: l,
4192
- fingerprint: h,
4192
+ fingerprint: f,
4193
4193
  eventProcessors: y,
4194
4194
  attachments: m,
4195
4195
  propagationContext: b,
4196
4196
  transactionName: I,
4197
4197
  span: B
4198
4198
  } = t;
4199
- Ue(e, "extra", n), Ue(e, "tags", r), Ue(e, "user", o), Ue(e, "contexts", i), e.sdkProcessingMetadata = dt(e.sdkProcessingMetadata, u, 2), c && (e.level = c), I && (e.transactionName = I), B && (e.span = B), l.length && (e.breadcrumbs = [...e.breadcrumbs, ...l]), h.length && (e.fingerprint = [...e.fingerprint, ...h]), y.length && (e.eventProcessors = [...e.eventProcessors, ...y]), m.length && (e.attachments = [...e.attachments, ...m]), e.propagationContext = { ...e.propagationContext, ...b };
4199
+ Fe(e, "extra", n), Fe(e, "tags", r), Fe(e, "user", o), Fe(e, "contexts", i), e.sdkProcessingMetadata = dt(e.sdkProcessingMetadata, u, 2), c && (e.level = c), I && (e.transactionName = I), B && (e.span = B), l.length && (e.breadcrumbs = [...e.breadcrumbs, ...l]), f.length && (e.fingerprint = [...e.fingerprint, ...f]), y.length && (e.eventProcessors = [...e.eventProcessors, ...y]), m.length && (e.attachments = [...e.attachments, ...m]), e.propagationContext = { ...e.propagationContext, ...b };
4200
4200
  }
4201
- function Ue(e, t, n) {
4201
+ function Fe(e, t, n) {
4202
4202
  e[t] = dt(e[t], n, 1);
4203
4203
  }
4204
4204
  function gs(e, t) {
4205
4205
  const { extra: n, tags: r, user: o, contexts: i, level: c, transactionName: u } = t, l = V(n);
4206
4206
  l && Object.keys(l).length && (e.extra = { ...l, ...e.extra });
4207
- const h = V(r);
4208
- h && Object.keys(h).length && (e.tags = { ...h, ...e.tags });
4207
+ const f = V(r);
4208
+ f && Object.keys(f).length && (e.tags = { ...f, ...e.tags });
4209
4209
  const y = V(o);
4210
4210
  y && Object.keys(y).length && (e.user = { ...y, ...e.user });
4211
4211
  const m = V(i);
@@ -4229,7 +4229,7 @@ function Cs(e, t) {
4229
4229
  dynamicSamplingContext: Ko(t),
4230
4230
  ...e.sdkProcessingMetadata
4231
4231
  };
4232
- const n = tr(t), r = Jt(n).description;
4232
+ const n = nr(t), r = Jt(n).description;
4233
4233
  r && !e.transaction && e.type === "transaction" && (e.transaction = r);
4234
4234
  }
4235
4235
  function bs(e, t) {
@@ -4240,18 +4240,18 @@ function Es(e, t, n, r, o, i) {
4240
4240
  ...t,
4241
4241
  event_id: t.event_id || n.event_id || te(),
4242
4242
  timestamp: t.timestamp || At()
4243
- }, h = n.integrations || e.integrations.map((S) => S.name);
4244
- vs(l, e), Ss(l, h), o && o.emit("applyFrameMetadata", t), t.type === void 0 && Is(l, e.stackParser);
4243
+ }, f = n.integrations || e.integrations.map((S) => S.name);
4244
+ vs(l, e), Ss(l, f), o && o.emit("applyFrameMetadata", t), t.type === void 0 && Is(l, e.stackParser);
4245
4245
  const y = Qs(r, n.captureContext);
4246
- n.mechanism && ke(l, n.mechanism);
4246
+ n.mechanism && Pe(l, n.mechanism);
4247
4247
  const m = o ? o.getEventProcessors() : [], b = vo().getScopeData();
4248
4248
  if (i) {
4249
4249
  const S = i.getScopeData();
4250
- Pn(b, S);
4250
+ wn(b, S);
4251
4251
  }
4252
4252
  if (y) {
4253
4253
  const S = y.getScopeData();
4254
- Pn(b, S);
4254
+ wn(b, S);
4255
4255
  }
4256
4256
  const I = [...n.attachments || [], ...b.attachments];
4257
4257
  I.length && (n.attachments = I), ps(l, b);
@@ -4264,11 +4264,11 @@ function Es(e, t, n, r, o, i) {
4264
4264
  }
4265
4265
  function vs(e, t) {
4266
4266
  const { environment: n, release: r, dist: o, maxValueLength: i = 250 } = t;
4267
- e.environment = e.environment || n || nr, !e.release && r && (e.release = r), !e.dist && o && (e.dist = o), e.message && (e.message = Qe(e.message, i));
4267
+ e.environment = e.environment || n || rr, !e.release && r && (e.release = r), !e.dist && o && (e.dist = o), e.message && (e.message = ke(e.message, i));
4268
4268
  const c = e.exception && e.exception.values && e.exception.values[0];
4269
- c && c.value && (c.value = Qe(c.value, i));
4269
+ c && c.value && (c.value = ke(c.value, i));
4270
4270
  const u = e.request;
4271
- u && u.url && (u.url = Qe(u.url, i));
4271
+ u && u.url && (u.url = ke(u.url, i));
4272
4272
  }
4273
4273
  function Is(e, t) {
4274
4274
  const n = hs(t);
@@ -4359,23 +4359,23 @@ function Ts(e, t) {
4359
4359
  function Rs(e, t, n) {
4360
4360
  return t || `${ws(e)}?${Ts(e, n)}`;
4361
4361
  }
4362
- const wn = [];
4362
+ const Tn = [];
4363
4363
  function Ls(e, t) {
4364
4364
  const n = {};
4365
4365
  return t.forEach((r) => {
4366
- r && ar(e, r, n);
4366
+ r && cr(e, r, n);
4367
4367
  }), n;
4368
4368
  }
4369
- function Tn(e, t) {
4369
+ function Rn(e, t) {
4370
4370
  for (const n of t)
4371
4371
  n && n.afterAllSetup && n.afterAllSetup(e);
4372
4372
  }
4373
- function ar(e, t, n) {
4373
+ function cr(e, t, n) {
4374
4374
  if (n[t.name]) {
4375
4375
  U && N.log(`Integration skipped because it was already installed: ${t.name}`);
4376
4376
  return;
4377
4377
  }
4378
- if (n[t.name] = t, wn.indexOf(t.name) === -1 && typeof t.setupOnce == "function" && (t.setupOnce(), wn.push(t.name)), t.setup && typeof t.setup == "function" && t.setup(e), typeof t.preprocessEvent == "function") {
4378
+ if (n[t.name] = t, Tn.indexOf(t.name) === -1 && typeof t.setupOnce == "function" && (t.setupOnce(), Tn.push(t.name)), t.setup && typeof t.setup == "function" && t.setup(e), typeof t.preprocessEvent == "function") {
4379
4379
  const r = t.preprocessEvent.bind(t);
4380
4380
  e.on("preprocessEvent", (o, i) => r(o, i, e));
4381
4381
  }
@@ -4395,14 +4395,14 @@ function Os(e, t, n) {
4395
4395
  discarded_events: e
4396
4396
  }
4397
4397
  ];
4398
- return Re(t ? { dsn: t } : {}, [r]);
4398
+ return Le(t ? { dsn: t } : {}, [r]);
4399
4399
  }
4400
4400
  class Y extends Error {
4401
4401
  constructor(t, n = "warn") {
4402
4402
  super(t), this.message = t, this.logLevel = n;
4403
4403
  }
4404
4404
  }
4405
- const Rn = "Not capturing exception because it's already been captured.";
4405
+ const Ln = "Not capturing exception because it's already been captured.";
4406
4406
  class Ns {
4407
4407
  /** Options passed to the SDK. */
4408
4408
  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
@@ -4441,8 +4441,8 @@ class Ns {
4441
4441
  */
4442
4442
  captureException(t, n, r) {
4443
4443
  const o = te();
4444
- if (yn(t))
4445
- return U && N.log(Rn), o;
4444
+ if (mn(t))
4445
+ return U && N.log(Ln), o;
4446
4446
  const i = {
4447
4447
  event_id: o,
4448
4448
  ...n
@@ -4468,8 +4468,8 @@ class Ns {
4468
4468
  */
4469
4469
  captureEvent(t, n, r) {
4470
4470
  const o = te();
4471
- if (n && n.originalException && yn(n.originalException))
4472
- return U && N.log(Rn), o;
4471
+ if (n && n.originalException && mn(n.originalException))
4472
+ return U && N.log(Ln), o;
4473
4473
  const i = {
4474
4474
  event_id: o,
4475
4475
  ...n
@@ -4551,7 +4551,7 @@ class Ns {
4551
4551
  */
4552
4552
  addIntegration(t) {
4553
4553
  const n = this._integrations[t.name];
4554
- ar(this, t, this._integrations), n || Tn(this, [t]);
4554
+ cr(this, t, this._integrations), n || Rn(this, [t]);
4555
4555
  }
4556
4556
  /**
4557
4557
  * @inheritDoc
@@ -4607,7 +4607,7 @@ class Ns {
4607
4607
  /** Setup integrations for this client. */
4608
4608
  _setupIntegrations() {
4609
4609
  const { integrations: t } = this._options;
4610
- this._integrations = Ls(this, t), Tn(this, t);
4610
+ this._integrations = Ls(this, t), Rn(this, t);
4611
4611
  }
4612
4612
  /** Updates existing session based on the provided event */
4613
4613
  _updateSessionFromEvent(t, n) {
@@ -4616,8 +4616,8 @@ class Ns {
4616
4616
  if (i) {
4617
4617
  o = !0;
4618
4618
  for (const l of i) {
4619
- const h = l.mechanism;
4620
- if (h && h.handled === !1) {
4619
+ const f = l.mechanism;
4620
+ if (f && f.handled === !1) {
4621
4621
  r = !0;
4622
4622
  break;
4623
4623
  }
@@ -4665,7 +4665,7 @@ class Ns {
4665
4665
  * @param currentScope A scope containing event metadata.
4666
4666
  * @returns A new event with more information.
4667
4667
  */
4668
- _prepareEvent(t, n, r = er(), o = Eo()) {
4668
+ _prepareEvent(t, n, r = tr(), o = Eo()) {
4669
4669
  const i = this.getOptions(), c = Object.keys(this._integrations);
4670
4670
  return !n.integrations && c.length > 0 && (n.integrations = c), this.emit("preprocessEvent", t, n), t.type || o.setLastEventId(t.event_id || n.event_id), Es(i, t, n, r, this, o).then((u) => {
4671
4671
  if (u === null)
@@ -4709,7 +4709,7 @@ class Ns {
4709
4709
  * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
4710
4710
  */
4711
4711
  _processEvent(t, n, r) {
4712
- const o = this.getOptions(), { sampleRate: i } = o, c = ur(t), u = cr(t), l = t.type || "error", h = `before send for type \`${l}\``, y = typeof i > "u" ? void 0 : Go(i);
4712
+ const o = this.getOptions(), { sampleRate: i } = o, c = lr(t), u = ur(t), l = t.type || "error", f = `before send for type \`${l}\``, y = typeof i > "u" ? void 0 : Go(i);
4713
4713
  if (u && typeof y == "number" && Math.random() > y)
4714
4714
  return this.recordDroppedEvent("sample_rate", "error", t), Ze(
4715
4715
  new Y(
@@ -4724,14 +4724,14 @@ class Ns {
4724
4724
  if (n.data && n.data.__sentry__ === !0)
4725
4725
  return B;
4726
4726
  const S = Ms(this, o, B, n);
4727
- return Ds(S, h);
4727
+ return Ds(S, f);
4728
4728
  }).then((B) => {
4729
4729
  if (B === null) {
4730
4730
  if (this.recordDroppedEvent("before_send", m, t), c) {
4731
4731
  const k = 1 + (t.spans || []).length;
4732
4732
  this.recordDroppedEvent("before_send", "span", k);
4733
4733
  }
4734
- throw new Y(`${h} returned \`null\`, will not send event.`, "log");
4734
+ throw new Y(`${f} returned \`null\`, will not send event.`, "log");
4735
4735
  }
4736
4736
  const Q = r && r.getSession();
4737
4737
  if (!c && Q && this._updateSessionFromEvent(Q, B), c) {
@@ -4823,14 +4823,14 @@ function Ds(e, t) {
4823
4823
  }
4824
4824
  function Ms(e, t, n, r) {
4825
4825
  const { beforeSend: o, beforeSendTransaction: i, beforeSendSpan: c } = t;
4826
- if (cr(n) && o)
4826
+ if (ur(n) && o)
4827
4827
  return o(n, r);
4828
- if (ur(n)) {
4828
+ if (lr(n)) {
4829
4829
  if (n.spans && c) {
4830
4830
  const u = [];
4831
4831
  for (const l of n.spans) {
4832
- const h = c(l);
4833
- h ? u.push(h) : (jo(), e.recordDroppedEvent("before_send", "span"));
4832
+ const f = c(l);
4833
+ f ? u.push(f) : (jo(), e.recordDroppedEvent("before_send", "span"));
4834
4834
  }
4835
4835
  n.spans = u;
4836
4836
  }
@@ -4847,10 +4847,10 @@ function Ms(e, t, n, r) {
4847
4847
  }
4848
4848
  return n;
4849
4849
  }
4850
- function cr(e) {
4850
+ function ur(e) {
4851
4851
  return e.type === void 0;
4852
4852
  }
4853
- function ur(e) {
4853
+ function lr(e) {
4854
4854
  return e.type === "transaction";
4855
4855
  }
4856
4856
  function xs(e) {
@@ -4873,15 +4873,15 @@ function xs(e) {
4873
4873
  }
4874
4874
  function i(c) {
4875
4875
  return new W((u, l) => {
4876
- let h = t.length;
4877
- if (!h)
4876
+ let f = t.length;
4877
+ if (!f)
4878
4878
  return u(!0);
4879
4879
  const y = setTimeout(() => {
4880
4880
  c && c > 0 && u(!1);
4881
4881
  }, c);
4882
4882
  t.forEach((m) => {
4883
4883
  pe(m).then(() => {
4884
- --h || (clearTimeout(y), u(!0));
4884
+ --f || (clearTimeout(y), u(!0));
4885
4885
  }, l);
4886
4886
  });
4887
4887
  });
@@ -4912,11 +4912,11 @@ function js(e, { statusCode: t, headers: n }, r = Date.now()) {
4912
4912
  }, i = n && n["x-sentry-rate-limits"], c = n && n["retry-after"];
4913
4913
  if (i)
4914
4914
  for (const u of i.trim().split(",")) {
4915
- const [l, h, , , y] = u.split(":", 5), m = parseInt(l, 10), b = (isNaN(m) ? 60 : m) * 1e3;
4916
- if (!h)
4915
+ const [l, f, , , y] = u.split(":", 5), m = parseInt(l, 10), b = (isNaN(m) ? 60 : m) * 1e3;
4916
+ if (!f)
4917
4917
  o.all = r + b;
4918
4918
  else
4919
- for (const I of h.split(";"))
4919
+ for (const I of f.split(";"))
4920
4920
  I === "metric_bucket" ? (!y || y.split(";").includes("custom")) && (o[I] = r + b) : o[I] = r + b;
4921
4921
  }
4922
4922
  else c ? o.all = r + Fs(c, r) : t === 429 && (o.all = r + 60 * 1e3);
@@ -4930,31 +4930,31 @@ function qs(e, t, n = xs(
4930
4930
  const o = (c) => n.drain(c);
4931
4931
  function i(c) {
4932
4932
  const u = [];
4933
- if (_n(c, (m, b) => {
4934
- const I = Qn(b);
4933
+ if (Qn(c, (m, b) => {
4934
+ const I = kn(b);
4935
4935
  if (Hs(r, I)) {
4936
- const B = Ln(m, b);
4936
+ const B = On(m, b);
4937
4937
  e.recordDroppedEvent("ratelimit_backoff", I, B);
4938
4938
  } else
4939
4939
  u.push(m);
4940
4940
  }), u.length === 0)
4941
4941
  return pe({});
4942
- const l = Re(c[0], u), h = (m) => {
4943
- _n(l, (b, I) => {
4944
- const B = Ln(b, I);
4945
- e.recordDroppedEvent(m, Qn(I), B);
4942
+ const l = Le(c[0], u), f = (m) => {
4943
+ Qn(l, (b, I) => {
4944
+ const B = On(b, I);
4945
+ e.recordDroppedEvent(m, kn(I), B);
4946
4946
  });
4947
4947
  }, y = () => t({ body: is(l) }).then(
4948
4948
  (m) => (m.statusCode !== void 0 && (m.statusCode < 200 || m.statusCode >= 300) && U && N.warn(`Sentry responded with status code ${m.statusCode} to sent event.`), r = js(r, m), m),
4949
4949
  (m) => {
4950
- throw h("network_error"), m;
4950
+ throw f("network_error"), m;
4951
4951
  }
4952
4952
  );
4953
4953
  return n.add(y).then(
4954
4954
  (m) => m,
4955
4955
  (m) => {
4956
4956
  if (m instanceof Y)
4957
- return U && N.error("Skipped sending event because buffer is full."), h("queue_overflow"), pe({});
4957
+ return U && N.error("Skipped sending event because buffer is full."), f("queue_overflow"), pe({});
4958
4958
  throw m;
4959
4959
  }
4960
4960
  );
@@ -4964,7 +4964,7 @@ function qs(e, t, n = xs(
4964
4964
  flush: o
4965
4965
  };
4966
4966
  }
4967
- function Ln(e, t) {
4967
+ function On(e, t) {
4968
4968
  if (!(t !== "event" && t !== "transaction"))
4969
4969
  return Array.isArray(e) ? e[1] : void 0;
4970
4970
  }
@@ -4985,8 +4985,8 @@ function Ks(e) {
4985
4985
  function Gs() {
4986
4986
  return "npm";
4987
4987
  }
4988
- const Fe = j, Ws = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
4989
- function lr(e, t) {
4988
+ const Xe = j, Ws = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
4989
+ function Ar(e, t) {
4990
4990
  const n = qt(e, t), r = {
4991
4991
  type: ei(t),
4992
4992
  value: ti(t)
@@ -4995,12 +4995,12 @@ function lr(e, t) {
4995
4995
  }
4996
4996
  function Ys(e, t, n, r) {
4997
4997
  const o = jt(), i = o && o.getOptions().normalizeDepth, c = ai(t), u = {
4998
- __serialized__: sr(t, i)
4998
+ __serialized__: ir(t, i)
4999
4999
  };
5000
5000
  if (c)
5001
5001
  return {
5002
5002
  exception: {
5003
- values: [lr(e, c)]
5003
+ values: [Ar(e, c)]
5004
5004
  },
5005
5005
  extra: u
5006
5006
  };
@@ -5016,15 +5016,15 @@ function Ys(e, t, n, r) {
5016
5016
  extra: u
5017
5017
  };
5018
5018
  if (n) {
5019
- const h = qt(e, n);
5020
- h.length && (l.exception.values[0].stacktrace = { frames: h });
5019
+ const f = qt(e, n);
5020
+ f.length && (l.exception.values[0].stacktrace = { frames: f });
5021
5021
  }
5022
5022
  return l;
5023
5023
  }
5024
5024
  function bt(e, t) {
5025
5025
  return {
5026
5026
  exception: {
5027
- values: [lr(e, t)]
5027
+ values: [Ar(e, t)]
5028
5028
  }
5029
5029
  };
5030
5030
  }
@@ -5043,20 +5043,20 @@ function Zs(e) {
5043
5043
  function $s(e) {
5044
5044
  return typeof e.framesToPop == "number" ? e.framesToPop : 0;
5045
5045
  }
5046
- function Ar(e) {
5046
+ function dr(e) {
5047
5047
  return typeof WebAssembly < "u" && typeof WebAssembly.Exception < "u" ? e instanceof WebAssembly.Exception : !1;
5048
5048
  }
5049
5049
  function ei(e) {
5050
5050
  const t = e && e.name;
5051
- return !t && Ar(e) ? e.message && Array.isArray(e.message) && e.message.length == 2 ? e.message[0] : "WebAssembly.Exception" : t;
5051
+ return !t && dr(e) ? e.message && Array.isArray(e.message) && e.message.length == 2 ? e.message[0] : "WebAssembly.Exception" : t;
5052
5052
  }
5053
5053
  function ti(e) {
5054
5054
  const t = e && e.message;
5055
- return t ? t.error && typeof t.error.message == "string" ? t.error.message : Ar(e) && Array.isArray(e.message) && e.message.length == 2 ? e.message[1] : t : "No error message";
5055
+ return t ? t.error && typeof t.error.message == "string" ? t.error.message : dr(e) && Array.isArray(e.message) && e.message.length == 2 ? e.message[1] : t : "No error message";
5056
5056
  }
5057
5057
  function ni(e, t, n, r) {
5058
5058
  const o = n && n.syntheticException || void 0, i = oi(e, t, o, r);
5059
- return ke(i), i.level = "error", n && n.event_id && (i.event_id = n.event_id), pe(i);
5059
+ return Pe(i), i.level = "error", n && n.event_id && (i.event_id = n.event_id), pe(i);
5060
5060
  }
5061
5061
  function ri(e, t, n = "info", r, o) {
5062
5062
  const i = r && r.syntheticException || void 0, c = Rt(e, t, i, o);
@@ -5064,21 +5064,21 @@ function ri(e, t, n = "info", r, o) {
5064
5064
  }
5065
5065
  function oi(e, t, n, r, o) {
5066
5066
  let i;
5067
- if (Kn(t) && t.error)
5067
+ if (Gn(t) && t.error)
5068
5068
  return bt(e, t.error);
5069
- if (fn(t) || $r(t)) {
5069
+ if (hn(t) || $r(t)) {
5070
5070
  const c = t;
5071
5071
  if ("stack" in t)
5072
5072
  i = bt(e, t);
5073
5073
  else {
5074
- const u = c.name || (fn(c) ? "DOMError" : "DOMException"), l = c.message ? `${u}: ${c.message}` : u;
5075
- i = Rt(e, l, n, r), gn(i, l);
5074
+ const u = c.name || (hn(c) ? "DOMError" : "DOMException"), l = c.message ? `${u}: ${c.message}` : u;
5075
+ i = Rt(e, l, n, r), yn(i, l);
5076
5076
  }
5077
5077
  return "code" in c && (i.tags = { ...i.tags, "DOMException.code": `${c.code}` }), i;
5078
5078
  }
5079
- return zn(t) ? bt(e, t) : Ie(t) || ct(t) ? (i = Ys(e, t, n, o), ke(i, {
5079
+ return Kn(t) ? bt(e, t) : Ie(t) || ct(t) ? (i = Ys(e, t, n, o), Pe(i, {
5080
5080
  synthetic: !0
5081
- }), i) : (i = Rt(e, t, n, r), gn(i, `${t}`), ke(i, {
5081
+ }), i) : (i = Rt(e, t, n, r), yn(i, `${t}`), Pe(i, {
5082
5082
  synthetic: !0
5083
5083
  }), i);
5084
5084
  }
@@ -5088,7 +5088,7 @@ function Rt(e, t, n, r) {
5088
5088
  const i = qt(e, n);
5089
5089
  i.length && (o.exception = {
5090
5090
  values: [{ value: t, stacktrace: { frames: i } }]
5091
- }), ke(o, { synthetic: !0 });
5091
+ }), Pe(o, { synthetic: !0 });
5092
5092
  }
5093
5093
  if (Xt(t)) {
5094
5094
  const { __sentry_template_string__: i, __sentry_template_values__: c } = t;
@@ -5101,7 +5101,7 @@ function Rt(e, t, n, r) {
5101
5101
  }
5102
5102
  function si(e, { isUnhandledRejection: t }) {
5103
5103
  const n = co(e), r = "exception";
5104
- return Kn(e) ? `Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\`` : ct(e) ? `Event \`${ii(e)}\` (type=${e.type}) captured as ${r}` : `Object captured as ${r} with keys: ${n}`;
5104
+ return Gn(e) ? `Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\`` : ct(e) ? `Event \`${ii(e)}\` (type=${e.type}) captured as ${r}` : `Object captured as ${r} with keys: ${n}`;
5105
5105
  }
5106
5106
  function ii(e) {
5107
5107
  try {
@@ -5134,7 +5134,7 @@ function ci(e, {
5134
5134
  },
5135
5135
  ...!!n && !!r && { dsn: ft(r) }
5136
5136
  }, i = ui(e);
5137
- return Re(o, [i]);
5137
+ return Le(o, [i]);
5138
5138
  }
5139
5139
  function ui(e) {
5140
5140
  return [{
@@ -5152,9 +5152,9 @@ class li extends Ns {
5152
5152
  // We default this to true, as it is the safer scenario
5153
5153
  parentSpanIsAlwaysRootSpan: !0,
5154
5154
  ...t
5155
- }, r = Fe.SENTRY_SDK_SOURCE || Gs();
5156
- zs(n, "browser", ["browser"], r), super(n), n.sendClientReports && Fe.document && Fe.document.addEventListener("visibilitychange", () => {
5157
- Fe.document.visibilityState === "hidden" && this._flushOutcomes();
5155
+ }, r = Xe.SENTRY_SDK_SOURCE || Gs();
5156
+ zs(n, "browser", ["browser"], r), super(n), n.sendClientReports && Xe.document && Xe.document.addEventListener("visibilitychange", () => {
5157
+ Xe.document.visibilityState === "hidden" && this._flushOutcomes();
5158
5158
  });
5159
5159
  }
5160
5160
  /**
@@ -5193,15 +5193,15 @@ class li extends Ns {
5193
5193
  return t.platform = t.platform || "javascript", super._prepareEvent(t, n, r);
5194
5194
  }
5195
5195
  }
5196
- const Ai = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, Xe = j, qe = {};
5196
+ const Ai = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, He = j, qe = {};
5197
5197
  function di(e) {
5198
5198
  const t = qe[e];
5199
5199
  if (t)
5200
5200
  return t;
5201
- let n = Xe[e];
5201
+ let n = He[e];
5202
5202
  if (Ks(n))
5203
- return qe[e] = n.bind(Xe);
5204
- const r = Xe.document;
5203
+ return qe[e] = n.bind(He);
5204
+ const r = He.document;
5205
5205
  if (r && typeof r.createElement == "function")
5206
5206
  try {
5207
5207
  const o = r.createElement("iframe");
@@ -5211,9 +5211,9 @@ function di(e) {
5211
5211
  } catch (o) {
5212
5212
  Ai && N.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `, o);
5213
5213
  }
5214
- return n && (qe[e] = n.bind(Xe));
5214
+ return n && (qe[e] = n.bind(He));
5215
5215
  }
5216
- function On(e) {
5216
+ function Nn(e) {
5217
5217
  qe[e] = void 0;
5218
5218
  }
5219
5219
  function fi(e, t = di("fetch")) {
@@ -5241,7 +5241,7 @@ function fi(e, t = di("fetch")) {
5241
5241
  ...e.fetchOptions
5242
5242
  };
5243
5243
  if (!t)
5244
- return On("fetch"), Ze("No fetch implementation available");
5244
+ return Nn("fetch"), Ze("No fetch implementation available");
5245
5245
  try {
5246
5246
  return t(e.url, u).then((l) => (n -= c, r--, {
5247
5247
  statusCode: l.status,
@@ -5251,7 +5251,7 @@ function fi(e, t = di("fetch")) {
5251
5251
  }
5252
5252
  }));
5253
5253
  } catch (l) {
5254
- return On("fetch"), n -= c, r--, Ze(l);
5254
+ return Nn("fetch"), n -= c, r--, Ze(l);
5255
5255
  }
5256
5256
  }
5257
5257
  return qs(e, o);
@@ -5278,7 +5278,7 @@ const gi = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, yi = /^\s*at (?:(.+?\)(?: \
5278
5278
  const c = mi.exec(n[2]);
5279
5279
  c && (n[2] = c[1], n[3] = c[2], n[4] = c[3]);
5280
5280
  }
5281
- const [o, i] = dr(n[1] || ve, n[2]);
5281
+ const [o, i] = fr(n[1] || ve, n[2]);
5282
5282
  return Lt(i, o, n[3] ? +n[3] : void 0, n[4] ? +n[4] : void 0);
5283
5283
  }
5284
5284
  }, bi = [hi, Ci], Ei = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i, vi = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, Ii = (e) => {
@@ -5289,9 +5289,9 @@ const gi = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, yi = /^\s*at (?:(.+?\)(?: \
5289
5289
  i && (t[1] = t[1] || "eval", t[3] = i[1], t[4] = i[2], t[5] = "");
5290
5290
  }
5291
5291
  let r = t[3], o = t[1] || ve;
5292
- return [o, r] = dr(o, r), Lt(r, o, t[4] ? +t[4] : void 0, t[5] ? +t[5] : void 0);
5292
+ return [o, r] = fr(o, r), Lt(r, o, t[4] ? +t[4] : void 0, t[5] ? +t[5] : void 0);
5293
5293
  }
5294
- }, Bi = [pi, Ii], Si = [bi, Bi], _i = Yr(...Si), dr = (e, t) => {
5294
+ }, Bi = [pi, Ii], Si = [bi, Bi], _i = Yr(...Si), fr = (e, t) => {
5295
5295
  const n = e.indexOf("safari-extension") !== -1, r = e.indexOf("safari-web-extension") !== -1;
5296
5296
  return n || r ? [
5297
5297
  e.indexOf("@") !== -1 ? e.split("@")[0] : ve,
@@ -5305,7 +5305,7 @@ function ki(e) {
5305
5305
  transport: fi,
5306
5306
  stackParser: _i,
5307
5307
  integrations: [],
5308
- release: "1.1.59",
5308
+ release: "1.1.60",
5309
5309
  environment: e.environment || "production"
5310
5310
  }), n = new ue();
5311
5311
  n.setClient(t), n.setTags(e), t.init(), Ot = n;
@@ -5319,14 +5319,14 @@ function se(e, t) {
5319
5319
  function ze(e, t) {
5320
5320
  Ve("webPayToken", e), t && Ve("webPayRefreshToken", t);
5321
5321
  }
5322
- function Nn() {
5322
+ function Dn() {
5323
5323
  Ee("webPayToken"), Ee("webPayRefreshToken");
5324
5324
  }
5325
5325
  async function Pi(e) {
5326
5326
  const t = Mt("webPayRefreshToken");
5327
5327
  if (t && e.config.clientId)
5328
5328
  try {
5329
- const n = await Fr(
5329
+ const n = await Xr(
5330
5330
  e.apiUrl,
5331
5331
  e.config.clientId,
5332
5332
  t,
@@ -5443,7 +5443,7 @@ const zt = `<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="h
5443
5443
  function $e(e) {
5444
5444
  return Mi(e == null ? void 0 : e.iconType);
5445
5445
  }
5446
- function fr(e, t, n, r = {}) {
5446
+ function hr(e, t, n, r = {}) {
5447
5447
  const { editMode: o = !1 } = r;
5448
5448
  return (o ? e.filter((c) => c.type === "card") : e).map((c) => {
5449
5449
  const u = !o && !!t && t.type === c.type && t.cardId === c.cardId, l = JSON.stringify(c).replace(/'/g, "&apos;");
@@ -5506,7 +5506,7 @@ function Fi(e, t, n, r) {
5506
5506
  }
5507
5507
  function Xi(e, t, n, r, o) {
5508
5508
  if (!e) return "";
5509
- const i = new Date(e.expires_at), c = isNaN(i.getTime()) ? "" : `${String(i.getDate()).padStart(2, "0")}.${String(i.getMonth() + 1).padStart(2, "0")}`, u = c ? r("couponUntil", { date: c }) : "", l = Number(e.reward_amount), h = Number.isFinite(l) && l > 0 ? $(l, "ru", o) : null;
5509
+ const i = new Date(e.expires_at), c = isNaN(i.getTime()) ? "" : `${String(i.getDate()).padStart(2, "0")}.${String(i.getMonth() + 1).padStart(2, "0")}`, u = c ? r("couponUntil", { date: c }) : "", l = Number(e.reward_amount), f = Number.isFinite(l) && l > 0 ? $(l, "ru", o) : null;
5510
5510
  return `
5511
5511
  <div class="choco-widget-balance-toggle${n ? " choco-widget-balance-toggle--disabled" : ""}" data-action="toggle-coupon">
5512
5512
  <div class="choco-widget-balance-info">
@@ -5516,11 +5516,11 @@ function Xi(e, t, n, r, o) {
5516
5516
  </div>
5517
5517
  </div>
5518
5518
  <div class="choco-widget-balance-label-wrapper">
5519
- ${h ? `
5519
+ ${f ? `
5520
5520
  <div class="choco-widget-balance-icon">
5521
5521
  ${zt}
5522
5522
  </div>
5523
- <div class="choco-widget-balance-amount">${h}</div>
5523
+ <div class="choco-widget-balance-amount">${f}</div>
5524
5524
  ` : ""}
5525
5525
  <label class="choco-widget-toggle">
5526
5526
  <input type="checkbox" ${t && !n ? "checked" : ""} ${n ? "disabled" : ""} />
@@ -5532,7 +5532,7 @@ function Xi(e, t, n, r, o) {
5532
5532
  }
5533
5533
  function Hi(e, t, n, r, o, i, c, u, l) {
5534
5534
  if (!e && !n && !o) return "";
5535
- const h = e ? `
5535
+ const f = e ? `
5536
5536
  <div class="choco-widget-balance-toggle" data-action="toggle-balance">
5537
5537
  <div class="choco-widget-balance-info">
5538
5538
  <div class="choco-widget-balance-text">
@@ -5554,7 +5554,7 @@ function Hi(e, t, n, r, o, i, c, u, l) {
5554
5554
  return `
5555
5555
  <div class="choco-widget-balance-section">
5556
5556
  ${Xi(o, i, c, u, l)}
5557
- ${h}
5557
+ ${f}
5558
5558
  ${Fi(n, r, u, l)}
5559
5559
  </div>
5560
5560
  `;
@@ -5581,7 +5581,7 @@ function Ji(e) {
5581
5581
  selectedMethod: c,
5582
5582
  balanceFormatted: u,
5583
5583
  useBalance: l,
5584
- bonuses: h,
5584
+ bonuses: f,
5585
5585
  useBonuses: y,
5586
5586
  coupon: m,
5587
5587
  useCoupon: b,
@@ -5594,7 +5594,7 @@ function Ji(e) {
5594
5594
  freedomAmountFormatted: L,
5595
5595
  t: R,
5596
5596
  currency: q
5597
- } = e, D = (o == null ? void 0 : o.label) ?? R("selectMethod"), G = $e(o), z = fr(i, c), J = Hi(u, l, h, y, m, b, I, R, q), M = ji(B, R), v = (c == null ? void 0 : c.type) === "google_pay", g = (c == null ? void 0 : c.type) === "apple_pay", p = v || g;
5597
+ } = e, D = (o == null ? void 0 : o.label) ?? R("selectMethod"), G = $e(o), z = hr(i, c), J = Hi(u, l, f, y, m, b, I, R, q), M = ji(B, R), v = (c == null ? void 0 : c.type) === "google_pay", g = (c == null ? void 0 : c.type) === "apple_pay", p = v || g;
5598
5598
  return `
5599
5599
  <div class="choco-widget-bottom-bar" role="region" aria-label="${R("paymentMethod")}">
5600
5600
  ${J}
@@ -5731,7 +5731,7 @@ function qi() {
5731
5731
  `;
5732
5732
  }
5733
5733
  function zi(e, t, n, r = {}) {
5734
- return fr(e, t, n, r);
5734
+ return hr(e, t, n, r);
5735
5735
  }
5736
5736
  function Ki(e) {
5737
5737
  return $e(e);
@@ -5745,20 +5745,20 @@ function Gi(e) {
5745
5745
  }
5746
5746
  return { mountTarget: document.body, isEmbedded: !1 };
5747
5747
  }
5748
- function hr(e) {
5748
+ function pr(e) {
5749
5749
  if (typeof document > "u") return !1;
5750
5750
  e.container || (e.container = document.createElement("div"), e.container.id = "choco-one-click-widget", e.container.className = "choco-one-click-widget");
5751
5751
  const { mountTarget: t, isEmbedded: n } = Gi(e);
5752
5752
  return t ? (e.container.parentElement !== t && t.appendChild(e.container), e.container.classList.toggle("choco-one-click-widget--embedded", n), !0) : !1;
5753
5753
  }
5754
5754
  function Wi(e) {
5755
- hr(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = qi());
5755
+ pr(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = qi());
5756
5756
  }
5757
5757
  function Yi(e) {
5758
5758
  var m, b, I, B, Q;
5759
- if (e._destroyed || !hr(e)) return;
5759
+ if (e._destroyed || !pr(e)) return;
5760
5760
  e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
5761
- const t = e.getAvailablePaymentMethods(), n = (m = e.checkoutContext) == null ? void 0 : m.data, r = e.config.currency || "KZT", o = (B = (I = (b = n == null ? void 0 : n.balance) == null ? void 0 : b.data) == null ? void 0 : I.money) == null ? void 0 : B[r], i = !e.config.disableUseBalance && o > 0 ? $(o, e.config.locale, e.config.currency) : null, c = (Q = n == null ? void 0 : n.cashback) == null ? void 0 : Q.data, u = (c == null ? void 0 : c.cashbackAmount) > 0 ? $(c.cashbackAmount, e.config.locale, e.config.currency) : null, l = e._getPayableAmount(), h = l < e.config.amount;
5761
+ const t = e.getAvailablePaymentMethods(), n = (m = e.checkoutContext) == null ? void 0 : m.data, r = e.config.currency || "KZT", o = (B = (I = (b = n == null ? void 0 : n.balance) == null ? void 0 : b.data) == null ? void 0 : I.money) == null ? void 0 : B[r], i = !e.config.disableUseBalance && o > 0 ? $(o, e.config.locale, e.config.currency) : null, c = (Q = n == null ? void 0 : n.cashback) == null ? void 0 : Q.data, u = (c == null ? void 0 : c.cashbackAmount) > 0 ? $(c.cashbackAmount, e.config.locale, e.config.currency) : null, l = e._getPayableAmount(), f = l < e.config.amount;
5762
5762
  e.container.innerHTML = Ji({
5763
5763
  amountFormatted: $(l, e.config.locale, e.config.currency),
5764
5764
  originalAmountFormatted: $(
@@ -5766,7 +5766,7 @@ function Yi(e) {
5766
5766
  e.config.locale,
5767
5767
  e.config.currency
5768
5768
  ),
5769
- showOriginalAmount: h,
5769
+ showOriginalAmount: f,
5770
5770
  paymentMethod: e.selectedPaymentMethod,
5771
5771
  methods: t,
5772
5772
  selectedMethod: e.selectedPaymentMethod,
@@ -5801,7 +5801,7 @@ function Yi(e) {
5801
5801
  });
5802
5802
  });
5803
5803
  }
5804
- function Pe(e) {
5804
+ function we(e) {
5805
5805
  var r;
5806
5806
  const t = (r = e.container) == null ? void 0 : r.querySelector(
5807
5807
  ".choco-widget-payment-methods"
@@ -5824,16 +5824,16 @@ function Pe(e) {
5824
5824
  const c = JSON.parse(
5825
5825
  i.currentTarget.getAttribute("data-method") || "{}"
5826
5826
  );
5827
- mr(e, c);
5827
+ Cr(e, c);
5828
5828
  });
5829
5829
  });
5830
5830
  }
5831
- function pr(e) {
5831
+ function gr(e) {
5832
5832
  var o, i, c;
5833
5833
  const t = (o = e.container) == null ? void 0 : o.querySelector(".choco-widget-payment-method"), n = (i = e.container) == null ? void 0 : i.querySelector(".choco-widget-method-name"), r = (c = e.container) == null ? void 0 : c.querySelector(
5834
5834
  ".choco-widget-method-icon-wrapper"
5835
5835
  );
5836
- t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), n && e.selectedPaymentMethod && (n.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, n.textContent = e.selectedPaymentMethod.label), r && e.selectedPaymentMethod && (r.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, r.innerHTML = Ki(e.selectedPaymentMethod)), gr(e);
5836
+ t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), n && e.selectedPaymentMethod && (n.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, n.textContent = e.selectedPaymentMethod.label), r && e.selectedPaymentMethod && (r.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, r.innerHTML = Ki(e.selectedPaymentMethod)), yr(e);
5837
5837
  }
5838
5838
  function Ke(e) {
5839
5839
  var m, b, I, B, Q, S;
@@ -5847,7 +5847,7 @@ function Ke(e) {
5847
5847
  ), i = (Q = e.container) == null ? void 0 : Q.querySelector(
5848
5848
  ".choco-widget-google-pay-amount-value-number"
5849
5849
  );
5850
- const c = e._getPayableAmount(), u = $(c, e.config.locale, e.config.currency), l = c < e.config.amount, h = $(
5850
+ const c = e._getPayableAmount(), u = $(c, e.config.locale, e.config.currency), l = c < e.config.amount, f = $(
5851
5851
  e.config.amount,
5852
5852
  e.config.locale,
5853
5853
  e.config.currency
@@ -5863,11 +5863,11 @@ function Ke(e) {
5863
5863
  }
5864
5864
  !o && n && (o = document.createElement("div"), o.className = "choco-widget-google-pay-amount-value", o.innerHTML = `${e.t("instead")} <span class="choco-widget-google-pay-amount-value-number"></span>`, n.appendChild(o), i = o.querySelector(
5865
5865
  ".choco-widget-google-pay-amount-value-number"
5866
- )), i ? i.textContent = h : o && (o.textContent = `${e.t("instead")} ${h}`);
5866
+ )), i ? i.textContent = f : o && (o.textContent = `${e.t("instead")} ${f}`);
5867
5867
  }
5868
- function gr(e) {
5869
- var l, h, y, m, b, I, B, Q, S, P;
5870
- const t = ((l = e.selectedPaymentMethod) == null ? void 0 : l.type) === "google_pay", n = ((h = e.selectedPaymentMethod) == null ? void 0 : h.type) === "apple_pay", r = t || n, o = (y = e.container) == null ? void 0 : y.querySelector(".choco-widget-pay-button"), i = (m = e.container) == null ? void 0 : m.querySelector(
5868
+ function yr(e) {
5869
+ var l, f, y, m, b, I, B, Q, S, P;
5870
+ const t = ((l = e.selectedPaymentMethod) == null ? void 0 : l.type) === "google_pay", n = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "apple_pay", r = t || n, o = (y = e.container) == null ? void 0 : y.querySelector(".choco-widget-pay-button"), i = (m = e.container) == null ? void 0 : m.querySelector(
5871
5871
  ".choco-widget-google-pay-amount"
5872
5872
  ), c = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), u = (I = e.container) == null ? void 0 : I.querySelector(".choco-widget-apple-pay-row");
5873
5873
  if (o == null || o.classList.toggle("choco-widget-pay-button--hidden", r), i == null || i.classList.toggle(
@@ -5897,7 +5897,7 @@ function gr(e) {
5897
5897
  Ke(e), ae(e);
5898
5898
  }
5899
5899
  async function Vi(e) {
5900
- var c, u, l, h, y;
5900
+ var c, u, l, f, y;
5901
5901
  const t = (c = e.container) == null ? void 0 : c.querySelector(
5902
5902
  '[data-action="google-pay-button-slot"]'
5903
5903
  );
@@ -5910,7 +5910,7 @@ async function Vi(e) {
5910
5910
  return;
5911
5911
  }
5912
5912
  if (n !== e._googlePayButtonRenderVersion) return;
5913
- if (!((y = (h = (l = window.google) == null ? void 0 : l.payments) == null ? void 0 : h.api) != null && y.PaymentsClient)) {
5913
+ if (!((y = (f = (l = window.google) == null ? void 0 : l.payments) == null ? void 0 : f.api) != null && y.PaymentsClient)) {
5914
5914
  e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
5915
5915
  return;
5916
5916
  }
@@ -5954,7 +5954,7 @@ function Zi(e) {
5954
5954
  </span>
5955
5955
  `, n.appendChild(r), n.appendChild(o), t.appendChild(n), ae(e);
5956
5956
  }
5957
- function Dn(e) {
5957
+ function Mn(e) {
5958
5958
  var o;
5959
5959
  if (!e.selectedCoupon) return;
5960
5960
  const t = e._isCouponDisabled();
@@ -5979,8 +5979,8 @@ function K(e) {
5979
5979
  ".choco-widget-google-pay-amount"
5980
5980
  ), c = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-google-pay-row"), u = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-apple-pay-row"), l = (k = e.container) == null ? void 0 : k.querySelector(
5981
5981
  ".choco-widget-balance-section"
5982
- ), h = e._isInteractionBlocked(), y = e.paymentMethodDisabled || h;
5983
- t && (t.disabled = y), n && (n.disabled = h, n.classList.remove("choco-widget-pay-button--loading")), r && (r.disabled = h), o && (o.disabled = h), i == null || i.classList.toggle("choco-widget-wallet-blocked", h), i == null || i.setAttribute("aria-disabled", String(h)), c == null || c.classList.toggle("choco-widget-wallet-blocked", h), c == null || c.setAttribute("aria-disabled", String(h)), u == null || u.classList.toggle("choco-widget-wallet-blocked", h), u == null || u.setAttribute("aria-disabled", String(h)), l == null || l.classList.remove("disabled");
5982
+ ), f = e._isInteractionBlocked(), y = e.paymentMethodDisabled || f;
5983
+ t && (t.disabled = y), n && (n.disabled = f, n.classList.remove("choco-widget-pay-button--loading")), r && (r.disabled = f), o && (o.disabled = f), i == null || i.classList.toggle("choco-widget-wallet-blocked", f), i == null || i.setAttribute("aria-disabled", String(f)), c == null || c.classList.toggle("choco-widget-wallet-blocked", f), c == null || c.setAttribute("aria-disabled", String(f)), u == null || u.classList.toggle("choco-widget-wallet-blocked", f), u == null || u.setAttribute("aria-disabled", String(f)), l == null || l.classList.remove("disabled");
5984
5984
  }
5985
5985
  function ae(e) {
5986
5986
  var b, I, B, Q, S, P, k, L, R;
@@ -5990,16 +5990,16 @@ function ae(e) {
5990
5990
  ".choco-widget-apple-pay-button-slot button"
5991
5991
  ), c = (P = e.container) == null ? void 0 : P.querySelector(
5992
5992
  ".choco-widget-google-pay-amount"
5993
- ), u = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (L = e.container) == null ? void 0 : L.querySelector(".choco-widget-apple-pay-row"), h = (R = e.container) == null ? void 0 : R.querySelector(
5993
+ ), u = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (L = e.container) == null ? void 0 : L.querySelector(".choco-widget-apple-pay-row"), f = (R = e.container) == null ? void 0 : R.querySelector(
5994
5994
  ".choco-widget-balance-section"
5995
5995
  ), y = e._isInteractionBlocked(), m = e.paymentMethodDisabled || y;
5996
- h == null || h.classList.toggle("disabled", y), t && (t.disabled = m), n && (n.disabled = y, n.classList.toggle("choco-widget-pay-button--loading", e.loading)), r && (r.disabled = y), o && (o.disabled = y), i && (i.disabled = y), c == null || c.classList.toggle("choco-widget-wallet-blocked", y), c == null || c.setAttribute("aria-disabled", String(y)), u == null || u.classList.toggle("choco-widget-wallet-blocked", y), u == null || u.setAttribute("aria-disabled", String(y)), l == null || l.classList.toggle("choco-widget-wallet-blocked", y), l == null || l.setAttribute("aria-disabled", String(y));
5996
+ f == null || f.classList.toggle("disabled", y), t && (t.disabled = m), n && (n.disabled = y, n.classList.toggle("choco-widget-pay-button--loading", e.loading)), r && (r.disabled = y), o && (o.disabled = y), i && (i.disabled = y), c == null || c.classList.toggle("choco-widget-wallet-blocked", y), c == null || c.setAttribute("aria-disabled", String(y)), u == null || u.classList.toggle("choco-widget-wallet-blocked", y), u == null || u.setAttribute("aria-disabled", String(y)), l == null || l.classList.toggle("choco-widget-wallet-blocked", y), l == null || l.setAttribute("aria-disabled", String(y));
5997
5997
  }
5998
- function yr(e) {
5998
+ function mr(e) {
5999
5999
  var n;
6000
6000
  if (e._isInteractionBlocked()) return;
6001
6001
  const t = (n = e.container) == null ? void 0 : n.querySelector('[data-sheet="payment"]');
6002
- t && (t.classList.add("choco-widget-payment-sheet--open"), e.isPaymentSheetOpen = !0, we(e));
6002
+ t && (t.classList.add("choco-widget-payment-sheet--open"), e.isPaymentSheetOpen = !0, Te(e));
6003
6003
  }
6004
6004
  function ce(e) {
6005
6005
  var n;
@@ -6007,14 +6007,14 @@ function ce(e) {
6007
6007
  if (t) {
6008
6008
  et(e);
6009
6009
  const r = t.querySelector(".choco-widget-sheet-content");
6010
- r && (r.style.transform = "", r.classList.remove("choco-widget-sheet-content--dragging")), t.classList.remove("choco-widget-payment-sheet--open"), e.isPaymentSheetOpen = !1, e.isPaymentSheetEditMode && (e.isPaymentSheetEditMode = !1, Pe(e), we(e));
6010
+ r && (r.style.transform = "", r.classList.remove("choco-widget-sheet-content--dragging")), t.classList.remove("choco-widget-payment-sheet--open"), e.isPaymentSheetOpen = !1, e.isPaymentSheetEditMode && (e.isPaymentSheetEditMode = !1, we(e), Te(e));
6011
6011
  }
6012
6012
  }
6013
- function we(e) {
6013
+ function Te(e) {
6014
6014
  var l;
6015
6015
  const t = (l = e.container) == null ? void 0 : l.querySelector('[data-sheet="payment"]');
6016
6016
  if (!t) return;
6017
- const n = t.querySelector(".choco-widget-sheet-title"), r = t.querySelector('[data-action="close-sheet"]'), o = t.querySelector('[data-action="edit-sheet"]'), i = t.querySelector('[data-action="previous-sheet"]'), u = e.getAvailablePaymentMethods().some((h) => h.type === "card");
6017
+ const n = t.querySelector(".choco-widget-sheet-title"), r = t.querySelector('[data-action="close-sheet"]'), o = t.querySelector('[data-action="edit-sheet"]'), i = t.querySelector('[data-action="previous-sheet"]'), u = e.getAvailablePaymentMethods().some((f) => f.type === "card");
6018
6018
  e.isPaymentSheetEditMode ? (t.classList.add("choco-widget-payment-sheet--edit"), n && (n.textContent = e.t("editCards")), r && (r.style.display = "none"), o && (o.style.display = "none"), i && (i.style.display = "")) : (t.classList.remove("choco-widget-payment-sheet--edit"), t.classList.toggle("choco-widget-payment-sheet--no-cards", !u), n && (n.textContent = e.t("paymentMethods")), r && (r.style.display = ""), o && (o.style.display = u ? "" : "none"), i && (i.style.display = "none"));
6019
6019
  }
6020
6020
  function Et(e) {
@@ -6053,7 +6053,7 @@ function et(e) {
6053
6053
  var n;
6054
6054
  e._pendingDeleteMethod = null, Nt(e, !1);
6055
6055
  const t = (n = e.container) == null ? void 0 : n.querySelector('[data-sheet="payment"]');
6056
- t == null || t.classList.remove("choco-widget-payment-sheet--delete-confirm"), we(e);
6056
+ t == null || t.classList.remove("choco-widget-payment-sheet--delete-confirm"), Te(e);
6057
6057
  }
6058
6058
  function Nt(e, t) {
6059
6059
  var i, c, u;
@@ -6071,27 +6071,27 @@ async function na(e, t) {
6071
6071
  const n = t == null ? void 0 : t.cardId;
6072
6072
  if (!(!n || (t == null ? void 0 : t.type) !== "card"))
6073
6073
  try {
6074
- await Xr(e.apiUrl, e._getApiConfig(), n), e.checkoutContext = await Bt(
6074
+ await Hr(e.apiUrl, e._getApiConfig(), n), e.checkoutContext = await Bt(
6075
6075
  e.apiUrl,
6076
6076
  e._getApiConfig()
6077
6077
  ), ((r = e.selectedPaymentMethod) == null ? void 0 : r.type) === "card" && ((o = e.selectedPaymentMethod) == null ? void 0 : o.cardId) === n && (e.selectedPaymentMethod = It(
6078
6078
  e.checkoutContext.data,
6079
6079
  e._getKaspiOptions()
6080
- ), e._emitPaymentMethodSelected(), pr(e)), Pe(e), e.config.onSuccess({ message: e.t("cardDeleted") }), e.config.onCardDeleted && e.config.onCardDeleted({ cardId: n });
6080
+ ), e._emitPaymentMethodSelected(), gr(e)), we(e), e.config.onSuccess({ message: e.t("cardDeleted") }), e.config.onCardDeleted && e.config.onCardDeleted({ cardId: n });
6081
6081
  } catch (i) {
6082
6082
  e.config.onError({
6083
6083
  attributes: { message: (i == null ? void 0 : i.message) || e.t("paymentError") }
6084
6084
  });
6085
6085
  }
6086
6086
  }
6087
- function mr(e, t) {
6087
+ function Cr(e, t) {
6088
6088
  if (e._isInteractionBlocked()) return;
6089
6089
  if (e.selectedPaymentMethod = t, e._emitPaymentMethodSelected(), t.type === "new_card") {
6090
6090
  e._emitUserEvent("one_click_pay_method_resolved", { payment_method: t.type }), ce(e), e.handlePayment();
6091
6091
  return;
6092
6092
  }
6093
6093
  const n = e._getPaymentMethodForUserEvent();
6094
- n != null && e._emitUserEvent("one_click_pay_method_resolved", { payment_method: n }), Pe(e), ce(e), pr(e);
6094
+ n != null && e._emitUserEvent("one_click_pay_method_resolved", { payment_method: n }), we(e), ce(e), gr(e);
6095
6095
  }
6096
6096
  const tt = "choco_pending_order_id", ra = 1800 * 1e3;
6097
6097
  function oa(e) {
@@ -6107,10 +6107,10 @@ function sa() {
6107
6107
  return null;
6108
6108
  }
6109
6109
  }
6110
- function Cr(e) {
6110
+ function br(e) {
6111
6111
  e._pendingOrderId = null, Ee(tt);
6112
6112
  }
6113
- function Mn(e, t) {
6113
+ function xn(e, t) {
6114
6114
  var r;
6115
6115
  const n = t.type || ((r = t.data) == null ? void 0 : r.type);
6116
6116
  if (!n) {
@@ -6119,10 +6119,10 @@ function Mn(e, t) {
6119
6119
  }
6120
6120
  switch (n) {
6121
6121
  case "order.paid":
6122
- e._orderStatusResolved = !0, fe(e), Er(e, t);
6122
+ e._orderStatusResolved = !0, fe(e), vr(e, t);
6123
6123
  break;
6124
6124
  case "order.failed":
6125
- e._orderStatusResolved = !0, fe(e), vr(e, t);
6125
+ e._orderStatusResolved = !0, fe(e), Ir(e, t);
6126
6126
  break;
6127
6127
  case "order.action_required":
6128
6128
  ia(e, t);
@@ -6148,21 +6148,26 @@ function ye(e, t) {
6148
6148
  }
6149
6149
  o += 1;
6150
6150
  try {
6151
- const { data: c } = await jr(
6152
- e.apiUrl,
6153
- e._getApiConfig(),
6154
- String(t)
6155
- ), u = c == null ? void 0 : c.status, l = (c == null ? void 0 : c.payload) || {};
6156
- if (u === "success") {
6157
- e._orderStatusResolved = !0, fe(e), Er(e, {
6158
- id: String(l.id || t),
6159
- attributes: { amount: l.amount, paid_at: l.paid_at || "" }
6151
+ let c;
6152
+ try {
6153
+ c = await an(e.apiUrl, e._getApiConfig(), String(t));
6154
+ } catch (y) {
6155
+ if ((y == null ? void 0 : y.status) === 401)
6156
+ await e._obtainTokenByRefreshOrTrackId(), c = await an(e.apiUrl, e._getApiConfig(), String(t));
6157
+ else
6158
+ throw y;
6159
+ }
6160
+ const { data: u } = c, l = u == null ? void 0 : u.status, f = (u == null ? void 0 : u.payload) || {};
6161
+ if (l === "success") {
6162
+ e._orderStatusResolved = !0, fe(e), vr(e, {
6163
+ id: String(f.id || t),
6164
+ attributes: { amount: f.amount, paid_at: f.paid_at || "" }
6160
6165
  });
6161
6166
  return;
6162
6167
  }
6163
- u === "fail" && (e._orderStatusResolved = !0, fe(e), vr(e, {
6164
- id: String(l.id || t),
6165
- attributes: { message: l.message || e.t("paymentError") }
6168
+ l === "fail" && (e._orderStatusResolved = !0, fe(e), Ir(e, {
6169
+ id: String(f.id || t),
6170
+ attributes: { message: f.message || e.t("paymentError") }
6166
6171
  }));
6167
6172
  } catch (c) {
6168
6173
  console.warn("[Polling] checkOrderStatus error:", c);
@@ -6174,32 +6179,32 @@ function ye(e, t) {
6174
6179
  function ht() {
6175
6180
  return typeof document > "u" ? !1 : document.hidden || document.visibilityState === "hidden";
6176
6181
  }
6177
- function br(e, t) {
6182
+ function Er(e, t) {
6178
6183
  K(e), e.config.onSuccess(t);
6179
6184
  }
6180
6185
  function vt(e) {
6181
6186
  if (!e._pendingSuccessPayload || ht()) return;
6182
6187
  const t = e._pendingSuccessPayload;
6183
- e._pendingSuccessPayload = null, br(e, t);
6188
+ e._pendingSuccessPayload = null, Er(e, t);
6184
6189
  }
6185
- function He(e) {
6186
- if (ht() || e._orderStatusResolved || e._orderStatusPollingId) return;
6190
+ function _e(e) {
6191
+ if (ht() || e._orderStatusResolved) return;
6187
6192
  const t = e._pendingOrderId || sa();
6188
6193
  t && (e._pendingOrderId = t, ye(e, t));
6189
6194
  }
6190
- function Er(e, t) {
6195
+ function vr(e, t) {
6191
6196
  var o, i;
6192
- Cr(e), e.isAddCardViewOpen && Se(e);
6197
+ br(e), e.isAddCardViewOpen && Se(e);
6193
6198
  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 };
6194
6199
  if (ht()) {
6195
6200
  e._pendingSuccessPayload = r;
6196
6201
  return;
6197
6202
  }
6198
- br(e, r);
6203
+ Er(e, r);
6199
6204
  }
6200
- function vr(e, t) {
6205
+ function Ir(e, t) {
6201
6206
  var r, o;
6202
- Cr(e), e.isAddCardViewOpen && Se(e), K(e);
6207
+ br(e), e.isAddCardViewOpen && Se(e), K(e);
6203
6208
  const n = t.attributes || ((r = t.data) == null ? void 0 : r.attributes) || {};
6204
6209
  e.config.onError({ id: t.id || ((o = t.data) == null ? void 0 : o.id), attributes: n });
6205
6210
  }
@@ -6240,14 +6245,14 @@ async function aa(e) {
6240
6245
  if (e._isBalanceFullyCoveringAmount()) {
6241
6246
  ge(e);
6242
6247
  try {
6243
- const u = await an(
6248
+ const u = await cn(
6244
6249
  e.apiUrl,
6245
6250
  e._getApiConfig(),
6246
6251
  e.deviceId,
6247
6252
  e.selectedPaymentMethod,
6248
6253
  t
6249
6254
  );
6250
- await xn(e);
6255
+ await Un(e);
6251
6256
  const l = (u == null ? void 0 : u.id) ?? ((n = u == null ? void 0 : u.data) == null ? void 0 : n.id);
6252
6257
  return l && ye(e, String(l)), u;
6253
6258
  } catch (u) {
@@ -6270,17 +6275,17 @@ async function aa(e) {
6270
6275
  }
6271
6276
  ge(e);
6272
6277
  try {
6273
- const u = await an(
6278
+ const u = await cn(
6274
6279
  e.apiUrl,
6275
6280
  e._getApiConfig(),
6276
6281
  e.deviceId,
6277
6282
  e.selectedPaymentMethod,
6278
6283
  t
6279
6284
  );
6280
- await xn(e);
6285
+ await Un(e);
6281
6286
  const l = (u == null ? void 0 : u.id) ?? ((r = u == null ? void 0 : u.data) == null ? void 0 : r.id);
6282
6287
  if (l && ye(e, String(l)), ((o = e.selectedPaymentMethod) == null ? void 0 : o.type) === "kaspi_pay") {
6283
- 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";
6288
+ const f = (u == null ? void 0 : u.attributes) || ((i = u == null ? void 0 : u.data) == null ? void 0 : i.attributes) || {}, y = f.action_link || f.action_url, m = f.action_url_type || f.action_type || "redirect";
6284
6289
  if (y)
6285
6290
  return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
6286
6291
  action_link: y,
@@ -6294,11 +6299,11 @@ async function aa(e) {
6294
6299
  throw K(e), se(u, { paymentMethod: ((c = e.selectedPaymentMethod) == null ? void 0 : c.type) || "card" }), e.config.onError({ message: e._resolveErrorMessage(u) }), u;
6295
6300
  }
6296
6301
  }
6297
- async function xn(e) {
6302
+ async function Un(e) {
6298
6303
  var t, n;
6299
6304
  if (!(((t = e.selectedPaymentMethod) == null ? void 0 : t.type) !== "card" || !((n = e.selectedPaymentMethod) != null && n.cardId)))
6300
6305
  try {
6301
- await Hr(
6306
+ await jr(
6302
6307
  e.apiUrl,
6303
6308
  e._getApiConfig(),
6304
6309
  e.selectedPaymentMethod.cardId
@@ -6322,14 +6327,14 @@ async function ca(e, t) {
6322
6327
  }), console.error("New card payment error:", n);
6323
6328
  }
6324
6329
  }
6325
- let _e = null;
6330
+ let Qe = null;
6326
6331
  async function ua(e, t) {
6327
6332
  const n = window.ApplePaySession;
6328
6333
  if (!n || !n.canMakePayments()) {
6329
6334
  e.config.onError({ attributes: { message: e.t("errorApplePayUnsupported") } });
6330
6335
  return;
6331
6336
  }
6332
- if (_e) return;
6337
+ if (Qe) return;
6333
6338
  ge(e);
6334
6339
  const r = {
6335
6340
  countryCode: e.config.currency === "GEL" ? "GE" : "KZ",
@@ -6342,19 +6347,19 @@ async function ua(e, t) {
6342
6347
  type: "final"
6343
6348
  }
6344
6349
  }, o = new n(3, r);
6345
- _e = o, o.onvalidatemerchant = async (i) => {
6350
+ Qe = o, o.onvalidatemerchant = async (i) => {
6346
6351
  var c, u;
6347
6352
  try {
6348
6353
  let l;
6349
6354
  try {
6350
- l = await cn(
6355
+ l = await un(
6351
6356
  e.apiUrl,
6352
6357
  e._getApiConfig(),
6353
6358
  i.validationURL
6354
6359
  );
6355
6360
  } catch (m) {
6356
6361
  if (m.status === 401)
6357
- await e._obtainTokenByRefreshOrTrackId(), l = await cn(
6362
+ await e._obtainTokenByRefreshOrTrackId(), l = await un(
6358
6363
  e.apiUrl,
6359
6364
  e._getApiConfig(),
6360
6365
  i.validationURL
@@ -6362,7 +6367,7 @@ async function ua(e, t) {
6362
6367
  else
6363
6368
  throw m;
6364
6369
  }
6365
- 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));
6370
+ const f = ((u = (c = l == null ? void 0 : l.data) == null ? void 0 : c.attributes) == null ? void 0 : u.session) || l, y = JSON.parse(atob(f));
6366
6371
  o.completeMerchantValidation(y);
6367
6372
  } catch (l) {
6368
6373
  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") } });
@@ -6371,8 +6376,8 @@ async function ua(e, t) {
6371
6376
  var c;
6372
6377
  try {
6373
6378
  if (typeof e.config.onBeforeCheckout == "function") {
6374
- const h = await e.config.onBeforeCheckout();
6375
- h && typeof h == "object" && Object.assign(e.config, h);
6379
+ const f = await e.config.onBeforeCheckout();
6380
+ f && typeof f == "object" && Object.assign(e.config, f);
6376
6381
  }
6377
6382
  const u = await zr(
6378
6383
  e.apiUrl,
@@ -6381,11 +6386,11 @@ async function ua(e, t) {
6381
6386
  i.payment,
6382
6387
  t
6383
6388
  );
6384
- o.completePayment(n.STATUS_SUCCESS), _e = null;
6389
+ o.completePayment(n.STATUS_SUCCESS), Qe = null;
6385
6390
  const l = (u == null ? void 0 : u.id) ?? ((c = u == null ? void 0 : u.data) == null ? void 0 : c.id);
6386
6391
  l && !e._orderStatusResolved && ye(e, String(l));
6387
6392
  } catch (u) {
6388
- console.error("Apple Pay payment error:", u), se(u, { paymentMethod: "apple_pay", phase: "payment_authorized" }), o.completePayment(n.STATUS_FAILURE), _e = null, K(e), e.config.onError({
6393
+ console.error("Apple Pay payment error:", u), se(u, { paymentMethod: "apple_pay", phase: "payment_authorized" }), o.completePayment(n.STATUS_FAILURE), Qe = null, K(e), e.config.onError({
6389
6394
  attributes: {
6390
6395
  message: e._resolveErrorMessage(u, "errorApplePayPayment")
6391
6396
  }
@@ -6393,7 +6398,7 @@ async function ua(e, t) {
6393
6398
  }
6394
6399
  }, o.oncancel = () => {
6395
6400
  var i;
6396
- if (_e = null, K(e), ((i = e.selectedPaymentMethod) == null ? void 0 : i.type) === "apple_pay") {
6401
+ if (Qe = null, K(e), ((i = e.selectedPaymentMethod) == null ? void 0 : i.type) === "apple_pay") {
6397
6402
  e.config.onError({
6398
6403
  attributes: { message: e.t("errorApplePayInterrupted") }
6399
6404
  });
@@ -6416,7 +6421,7 @@ async function la(e, t) {
6416
6421
  });
6417
6422
  return;
6418
6423
  }
6419
- const l = e.config.environment === "production", h = (o == null ? void 0 : o.merchant_name) || "Choco", y = o == null ? void 0 : o.google_merchant_id;
6424
+ const l = e.config.environment === "production", f = (o == null ? void 0 : o.merchant_name) || "Choco", y = o == null ? void 0 : o.google_merchant_id;
6420
6425
  if (l && !y) {
6421
6426
  e.config.onError({
6422
6427
  attributes: { message: e.t("errorGooglePaySettingsUnavailable") }
@@ -6463,7 +6468,7 @@ async function la(e, t) {
6463
6468
  currencyCode: e.config.currency,
6464
6469
  countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
6465
6470
  },
6466
- merchantInfo: l ? { merchantId: y, merchantName: h } : { merchantName: h }
6471
+ merchantInfo: l ? { merchantId: y, merchantName: f } : { merchantName: f }
6467
6472
  }, Q = new b.payments.api.PaymentsClient({
6468
6473
  environment: l ? "PRODUCTION" : "TEST"
6469
6474
  });
@@ -6480,7 +6485,7 @@ async function la(e, t) {
6480
6485
  ge(e);
6481
6486
  const G = await Q.loadPaymentData(B), z = (R = (L = G == null ? void 0 : G.paymentMethodData) == null ? void 0 : L.tokenizationData) == null ? void 0 : R.token;
6482
6487
  if (!z) throw new Error(e.t("errorGooglePayPayment"));
6483
- const J = JSON.parse(z), M = await jn(
6488
+ const J = JSON.parse(z), M = await Jn(
6484
6489
  e.apiUrl,
6485
6490
  e._getApiConfig(),
6486
6491
  e.deviceId,
@@ -6508,7 +6513,7 @@ async function Aa(e, t, n) {
6508
6513
  amount: Number(e._getCheckoutAmount()),
6509
6514
  gateway: n.gateway,
6510
6515
  gatewayMerchantId: n.gatewayMerchantId
6511
- }), i = JSON.parse(o), c = await jn(
6516
+ }), i = JSON.parse(o), c = await Jn(
6512
6517
  e.apiUrl,
6513
6518
  e._getApiConfig(),
6514
6519
  e.deviceId,
@@ -6525,16 +6530,16 @@ async function Aa(e, t, n) {
6525
6530
  }
6526
6531
  }
6527
6532
  function da(e) {
6528
- var c, u, l, h, y, m, b, I, B, Q, S, P;
6533
+ var c, u, l, f, y, m, b, I, B, Q, S, P;
6529
6534
  const t = e.container;
6530
6535
  (c = t.querySelector('[data-action="freedom-card"]')) == null || c.addEventListener("click", () => {
6531
6536
  e.config.onFreedomLink && e.config.onFreedomLink();
6532
- }), (u = t.querySelector('[data-action="pay"]')) == null || u.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => yr(e)), t.querySelectorAll('[data-action="close"]').forEach((k) => k.addEventListener("click", () => e.close())), (h = t.querySelector('[data-action="close-sheet"]')) == null || h.addEventListener("click", () => {
6537
+ }), (u = t.querySelector('[data-action="pay"]')) == null || u.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => mr(e)), t.querySelectorAll('[data-action="close"]').forEach((k) => k.addEventListener("click", () => e.close())), (f = t.querySelector('[data-action="close-sheet"]')) == null || f.addEventListener("click", () => {
6533
6538
  e._pendingDeleteMethod ? et(e) : ce(e);
6534
6539
  }), (y = t.querySelector('[data-action="edit-sheet"]')) == null || y.addEventListener("click", () => {
6535
- e.isPaymentSheetEditMode = !0, Pe(e), we(e);
6540
+ e.isPaymentSheetEditMode = !0, we(e), Te(e);
6536
6541
  }), (m = t.querySelector('[data-action="previous-sheet"]')) == null || m.addEventListener("click", () => {
6537
- e.isPaymentSheetEditMode = !1, Pe(e), we(e);
6542
+ e.isPaymentSheetEditMode = !1, we(e), Te(e);
6538
6543
  }), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => Se(e)), (I = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || I.addEventListener("click", () => et(e)), (B = t.querySelector('[data-action="confirm-delete-submit"]')) == null || B.addEventListener("click", () => {
6539
6544
  if (e._pendingDeleteMethod) {
6540
6545
  const k = e._pendingDeleteMethod;
@@ -6545,7 +6550,7 @@ function da(e) {
6545
6550
  const R = JSON.parse(
6546
6551
  L.currentTarget.getAttribute("data-method") || "{}"
6547
6552
  );
6548
- mr(e, R);
6553
+ Cr(e, R);
6549
6554
  });
6550
6555
  });
6551
6556
  const n = t.querySelector('[data-sheet="payment"]');
@@ -6554,16 +6559,16 @@ function da(e) {
6554
6559
  }), ha(e, n));
6555
6560
  const r = t.querySelector('[data-action="toggle-balance"]');
6556
6561
  r && ((Q = r.querySelector("input[type='checkbox']")) == null || Q.addEventListener("change", (k) => {
6557
- e.useBalance = k.target.checked, Dn(e), e._updatePayButtonAmount();
6562
+ e.useBalance = k.target.checked, Mn(e), e._updatePayButtonAmount();
6558
6563
  }));
6559
6564
  const o = t.querySelector('[data-action="toggle-bonuses"]');
6560
6565
  o && ((S = o.querySelector("input[type='checkbox']")) == null || S.addEventListener("change", (k) => {
6561
- e.useBonuses = k.target.checked, e.config.onAppliedBonus(e.useBonuses), Dn(e), e._updatePayButtonAmount();
6566
+ e.useBonuses = k.target.checked, e.config.onAppliedBonus(e.useBonuses), Mn(e), e._updatePayButtonAmount();
6562
6567
  }));
6563
6568
  const i = t.querySelector('[data-action="toggle-coupon"]');
6564
6569
  i && ((P = i.querySelector("input[type='checkbox']")) == null || P.addEventListener("change", (k) => {
6565
6570
  e.useCoupon = k.target.checked, e._updatePayButtonAmount(), e._emitCouponSuppressingCashback();
6566
- })), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), gr(e);
6571
+ })), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), yr(e);
6567
6572
  }
6568
6573
  function fa(e, t) {
6569
6574
  var n, r;
@@ -6574,12 +6579,12 @@ function ha(e, t) {
6574
6579
  if (!n || !r) return;
6575
6580
  const o = 80;
6576
6581
  let i = 0, c = 0;
6577
- const u = (h) => {
6578
- c = h.clientY;
6582
+ const u = (f) => {
6583
+ c = f.clientY;
6579
6584
  const y = Math.max(0, c - i);
6580
6585
  r.style.transform = `translateY(${y}px)`;
6581
- }, l = (h) => {
6582
- n.releasePointerCapture(h.pointerId), n.removeEventListener("pointermove", u), n.removeEventListener("pointerup", l), n.removeEventListener("pointercancel", l);
6586
+ }, l = (f) => {
6587
+ n.releasePointerCapture(f.pointerId), n.removeEventListener("pointermove", u), n.removeEventListener("pointerup", l), n.removeEventListener("pointercancel", l);
6583
6588
  const y = Math.max(0, c - i);
6584
6589
  if (r.classList.remove("choco-widget-sheet-content--dragging"), y >= o) {
6585
6590
  r.style.transform = "translateY(100%)";
@@ -6590,8 +6595,8 @@ function ha(e, t) {
6590
6595
  } else
6591
6596
  r.style.transform = "";
6592
6597
  };
6593
- n.addEventListener("pointerdown", (h) => {
6594
- !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));
6598
+ n.addEventListener("pointerdown", (f) => {
6599
+ !e.isPaymentSheetOpen || f.button !== 0 || (f.preventDefault(), i = f.clientY, c = f.clientY, r.classList.add("choco-widget-sheet-content--dragging"), n.setPointerCapture(f.pointerId), n.addEventListener("pointermove", u), n.addEventListener("pointerup", l), n.addEventListener("pointercancel", l));
6595
6600
  });
6596
6601
  }
6597
6602
  class be {
@@ -6606,11 +6611,11 @@ class be {
6606
6611
  Ee(t);
6607
6612
  }
6608
6613
  static async logout() {
6609
- Nn();
6614
+ Dn();
6610
6615
  }
6611
6616
  // ─── Конструктор ──────────────────────────────────────────────────────────────
6612
6617
  constructor(t) {
6613
- this.config = Kr(t), this.accessToken = null, this.deviceId = Un(), this.apiUrl = _r(this.config.environment), this.translations = Br, this.checkoutContext = null, this.centrifuge = null, this.selectedPaymentMethod = null, this.selectedCoupon = null, this.useCoupon = !1, this.container = null, this.isOpen = !1, this.isPaymentSheetOpen = !1, this.isPaymentSheetEditMode = !1, this.loading = !1, this.disabled = !1, this.paymentMethodDisabled = !1, this.useBalance = !1, this.useBonuses = !1, this.addCardActionUrl = null, this.isAddCardViewOpen = !1, this.waitingForNewCardAction = !1, this.newCardActionRequiredTimeoutId = null, this._googlePayScriptPromise = null, this._googlePayButtonRenderVersion = 0, this._orderStatusPollingId = null, this._orderStatusResolved = !1, this._pendingOrderId = null, this._pendingDeleteMethod = null, this._pendingSuccessPayload = null, this._lifecycleListenersAttached = !1, this._destroyed = !1, this._boundAddCardMessage = null, this._boundKeyDown = (n) => fa(this, n), this._boundVisibilityChange = () => this._onVisibilityChange(), this._boundWindowFocus = () => this._onWindowFocus(), this._boundPageShow = () => this._onPageShow(), ki({
6618
+ this.config = Kr(t), this.accessToken = null, this.deviceId = Fn(), this.apiUrl = Qr(this.config.environment), this.translations = Sr, this.checkoutContext = null, this.centrifuge = null, this.selectedPaymentMethod = null, this.selectedCoupon = null, this.useCoupon = !1, this.container = null, this.isOpen = !1, this.isPaymentSheetOpen = !1, this.isPaymentSheetEditMode = !1, this.loading = !1, this.disabled = !1, this.paymentMethodDisabled = !1, this.useBalance = !1, this.useBonuses = !1, this.addCardActionUrl = null, this.isAddCardViewOpen = !1, this.waitingForNewCardAction = !1, this.newCardActionRequiredTimeoutId = null, this._googlePayScriptPromise = null, this._googlePayButtonRenderVersion = 0, this._orderStatusPollingId = null, this._orderStatusResolved = !1, this._pendingOrderId = null, this._pendingDeleteMethod = null, this._pendingSuccessPayload = null, this._lifecycleListenersAttached = !1, this._destroyed = !1, this._boundAddCardMessage = null, this._boundKeyDown = (n) => fa(this, n), this._boundVisibilityChange = () => this._onVisibilityChange(), this._boundWindowFocus = () => this._onWindowFocus(), this._boundPageShow = () => this._onPageShow(), ki({
6614
6619
  clientId: String(this.config.clientId),
6615
6620
  terminalId: String(this.config.terminalId),
6616
6621
  environment: this.config.environment
@@ -6661,13 +6666,13 @@ class be {
6661
6666
  return Number.isFinite(t) && t > 0 ? t : 0;
6662
6667
  }
6663
6668
  _getPaymentBreakdown() {
6664
- const t = this.config.amount, n = this._getBalanceAmount(), r = this.useBalance ? Math.min(n, t) : 0, o = t - r, i = this.useBalance && r >= t, c = this.useBonuses ? this._getAvailableBonus() : 0, u = Math.max(o - c, 0), l = this._getCouponDiscount(), h = Math.max(u - l, 0), y = this.useBalance ? t : h, m = this.useBalance && !i, I = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
6669
+ const t = this.config.amount, n = this._getBalanceAmount(), r = this.useBalance ? Math.min(n, t) : 0, o = t - r, i = this.useBalance && r >= t, c = this.useBonuses ? this._getAvailableBonus() : 0, u = Math.max(o - c, 0), l = this._getCouponDiscount(), f = Math.max(u - l, 0), y = this.useBalance ? t : f, m = this.useBalance && !i, I = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
6665
6670
  id: this.selectedCoupon.voucher_id,
6666
6671
  template_id: this.selectedCoupon.template_id,
6667
6672
  type: this.selectedCoupon.type
6668
6673
  } : void 0;
6669
6674
  return {
6670
- payableAmount: h,
6675
+ payableAmount: f,
6671
6676
  checkoutOptions: {
6672
6677
  checkoutAmount: y,
6673
6678
  forceBalanceMethod: i,
@@ -6737,7 +6742,7 @@ class be {
6737
6742
  ze(t, n);
6738
6743
  }
6739
6744
  _clearAuthStorage() {
6740
- Nn();
6745
+ Dn();
6741
6746
  }
6742
6747
  _getAuthStorageValue(t) {
6743
6748
  return be._getAuthStorageValue(t);
@@ -6778,13 +6783,13 @@ class be {
6778
6783
  this._lifecycleListenersAttached && (document.removeEventListener("visibilitychange", this._boundVisibilityChange), window.removeEventListener("focus", this._boundWindowFocus), window.removeEventListener("pageshow", this._boundPageShow), this._lifecycleListenersAttached = !1);
6779
6784
  }
6780
6785
  _onVisibilityChange() {
6781
- ht() || (vt(this), He(this));
6786
+ ht() || (vt(this), _e(this));
6782
6787
  }
6783
6788
  _onWindowFocus() {
6784
- vt(this), He(this);
6789
+ vt(this), _e(this);
6785
6790
  }
6786
6791
  _onPageShow() {
6787
- vt(this), He(this);
6792
+ vt(this), _e(this);
6788
6793
  }
6789
6794
  // ─── Авторизация (приватная) ──────────────────────────────────────────────────
6790
6795
  async _obtainTokenByRefreshOrTrackId() {
@@ -6846,9 +6851,9 @@ class be {
6846
6851
  if (this._destroyed || (await this._fetchCoupons(), this._emitCouponSuppressingCashback(), this._destroyed)) return !1;
6847
6852
  const r = rn(
6848
6853
  (n = (t = this.checkoutContext) == null ? void 0 : t.data) == null ? void 0 : n.socket_connections,
6849
- (o) => Mn(this, o)
6854
+ (o) => xn(this, o)
6850
6855
  );
6851
- return r && (this.centrifuge = r.centrifuge), He(this), this.selectedPaymentMethod = It(
6856
+ return r && (this.centrifuge = r.centrifuge), _e(this), this.selectedPaymentMethod = It(
6852
6857
  this.checkoutContext.data,
6853
6858
  this._getKaspiOptions()
6854
6859
  ), this._emitPaymentMethodSelected(), this._render(), !0;
@@ -6869,7 +6874,7 @@ class be {
6869
6874
  }
6870
6875
  getAvailablePaymentMethods() {
6871
6876
  var t;
6872
- return (t = this.checkoutContext) != null && t.data ? xr(
6877
+ return (t = this.checkoutContext) != null && t.data ? Ur(
6873
6878
  this.checkoutContext.data,
6874
6879
  (n) => this.t(n),
6875
6880
  this._getKaspiOptions()
@@ -6900,11 +6905,24 @@ class be {
6900
6905
  }
6901
6906
  }
6902
6907
  openPaymentSheet() {
6903
- yr(this);
6908
+ mr(this);
6904
6909
  }
6905
6910
  closePaymentSheet() {
6906
6911
  ce(this);
6907
6912
  }
6913
+ /**
6914
+ * Принудительно дозапросить статус незакрытого заказа.
6915
+ *
6916
+ * Fallback для webview супераппа, который при возврате из приложения банка (Kaspi Pay)
6917
+ * не эмитит `visibilitychange`/`focus`/`pageshow`. В этом случае нативный слой должен
6918
+ * вызвать этот метод, когда webview снова становится активным — виджет проверит,
6919
+ * есть ли незавершённый заказ, и дотянет его статус по HTTP.
6920
+ *
6921
+ * Безопасно вызывать всегда: если ожидающего заказа нет или он уже разрешён — no-op.
6922
+ */
6923
+ resumeOrderStatusCheck() {
6924
+ _e(this);
6925
+ }
6908
6926
  async updateAmount(t) {
6909
6927
  var n;
6910
6928
  if (typeof t != "number" || !Number.isFinite(t) || t < 0)
@@ -6969,7 +6987,7 @@ class be {
6969
6987
  await this._fetchCoupons(), this._emitCouponSuppressingCashback(), this.centrifuge && (this.centrifuge.disconnect(), this.centrifuge = null);
6970
6988
  const o = rn(
6971
6989
  (r = (n = this.checkoutContext) == null ? void 0 : n.data) == null ? void 0 : r.socket_connections,
6972
- (i) => Mn(this, i)
6990
+ (i) => xn(this, i)
6973
6991
  );
6974
6992
  return o && (this.centrifuge = o.centrifuge), this.selectedPaymentMethod = It(
6975
6993
  this.checkoutContext.data,