import { c as He, b as Ye, S as Xe, D as Je, R as Ze, v as O, f as Ke, K as le, r as N, Q as ue, Z, _ as Be, F as j, e as f, J as q, s as A, a1 as L, a4 as z, g as v, k as Qe, a as xe, y as $e, N as en, a3 as Q, h as nn, t as de, u as se, q as Ee, Y as t, V as on, W as sn, X as tn, n as an } from "./PlayerAccountControllerNd-NUeaPDxp.js";
import "../lazy/player-bonus-card-NhiZjmzb.js";
function ve(n, e) {
  He(n, e);
}
function rn(n) {
  Ye.set(n);
}
const _e = {
  en: {
    titleBonuses: "Active Bonuses",
    bonusCode: "Do you have a bonus code?",
    getBonus: "Get Bonus",
    invalidBonusCode: "The bonus code provided is invalid.",
    noActiveBonuses: "You have no active bonuses at the moment.",
    forfeitBonus: "Are you sure want to forfeit bonus?",
    forfeitBonusConfirm: "Confirm",
    forfeitBonusCancel: "Cancel",
    bonusClaimSuccessMessage: "Bonus claimed!",
    bonusClaimErrorMessage: "Invalid bonus"
  },
  "zh-hk": {
    titleBonuses: "活躍獎金",
    bonusCode: "你有獎金代碼嗎？",
    getBonus: "獲得獎金",
    invalidBonusCode: "提供的紅利代碼無效。",
    noActiveBonuses: "您目前沒有有效的獎金。",
    forfeitBonus: "您確定要放棄獎金及其獎金嗎？",
    forfeitBonusConfirm: "確認",
    forfeitBonusCancel: "取消",
    bonusClaimSuccessMessage: "獎金要求！",
    bonusClaimErrorMessage: "無效獎金"
  },
  fr: {
    titleBonuses: "Bonus actifs",
    bonusCode: "Avez-vous un code bonus?",
    getBonus: "Obtenir un bonus",
    invalidBonusCode: "Le code bonus fourni n'est pas valide.",
    noActiveBonuses: "Vous n'avez pas de bonus actifs pour le moment.",
    forfeitBonus: "Etes-vous sûr de vouloir supprimer le bonus et ses gains?",
    forfeitBonusConfirm: "Confirmer",
    forfeitBonusCancel: "Annuler",
    bonusClaimSuccessMessage: "Bonus réclamé!",
    bonusClaimErrorMessage: "Bonus invalide"
  },
  ro: {
    titleBonuses: "Bonusuri active",
    bonusCode: "Ai un cod de bonus?",
    getBonus: "Revendică",
    invalidBonusCode: "Codul de bonus introdus este invalid.",
    noActiveBonuses: "Nu ai niciun bonus activ în acest moment.",
    forfeitBonus: "Ești sigur că vrei să anulezi acest bonus și câștigurile provenite din acest bonus?",
    forfeitBonusConfirm: "Confirmă",
    forfeitBonusCancel: "Anulează",
    bonusClaimSuccessMessage: "Bonus revendicat!",
    bonusClaimErrorMessage: "Bonus invalid"
  },
  es: {
    titleBonuses: "Bonos Activos",
    bonusCode: "Tienes un código de Bono?",
    getBonus: "Obtener Bono",
    invalidBonusCode: "El código del Bono no es válido.",
    noActiveBonuses: "Usted no tiene Bonos activos en este momento.",
    forfeitBonus: "Estas seguro que quieres perder el bono?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bono adjudicado!",
    bonusClaimErrorMessage: "Bono invalido"
  },
  pt: {
    titleBonuses: "Bônus Ativos",
    bonusCode: "Você tem um código de bônus?",
    getBonus: "Obter bônus",
    invalidBonusCode: "O código de bônus fornecido é inválido.",
    noActiveBonuses: "Você não tem bônus ativos no momento.",
    forfeitBonus: "Tem certeza de que deseja perder o bônus e seus ganhos?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bônus reivindicado!",
    bonusClaimErrorMessage: "Bônus inválido"
  },
  hr: {
    titleBonuses: "Aktivni bonusi",
    bonusCode: "Imate li bonus kod?",
    getBonus: "Preuzmi bonus",
    invalidBonusCode: "Navedeni bonus kod je nevažeći.",
    noActiveBonuses: "Trenutno nemate aktivnih bonusa.",
    forfeitBonus: "Jeste li sigurni da želite otkazati bonus?",
    forfeitBonusConfirm: "Potvrdi",
    forfeitBonusCancel: "Otkaži",
    bonusClaimSuccessMessage: "Preuzet bonus!",
    bonusClaimErrorMessage: "Nevažeći bonus"
  },
  "pt-br": {
    titleBonuses: "Títulos ativos",
    bonusCode: "Você tem um código de bônus?",
    getBonus: "Reivindicar bônus",
    invalidBonusCode: "O código de bônus emitido é inválido",
    noActiveBonuses: "Não possui títulos ativos no momento",
    forfeitBonus: "Tem certeza de que deseja recusar o bônus?",
    forfeitBonusConfirm: "confirme",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bônus ativado",
    bonusClaimErrorMessage: "Voucher inválido"
  },
  "es-mx": {
    titleBonuses: "Bonos activos",
    bonusCode: "¿Tiene código de bonos?",
    getBonus: "Reclamar bono",
    invalidBonusCode: "El código de bono emitido es inválido",
    noActiveBonuses: "No tiene bonos activos al momento",
    forfeitBonus: "¿ Está seguro que quiere declinar el bono?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bono activado",
    bonusClaimErrorMessage: "Bono inválido"
  },
  tr: {
    titleBonuses: "Aktif Bonuslar",
    bonusCode: "Bonus kodunuz var mı?",
    getBonus: "Bonusu Al",
    invalidBonusCode: "Sağlanan bonus kodu geçersiz.",
    noActiveBonuses: "Şu anda aktif bonusunuz yok.",
    forfeitBonus: "Bonusu kaybetmek istediğinizden emin misiniz?",
    forfeitBonusConfirm: "Onaylamak",
    forfeitBonusCancel: "İptal etmek",
    bonusClaimSuccessMessage: "Bonus talep edildi!",
    bonusClaimErrorMessage: "Geçersiz bonus"
  },
  "en-us": {
    titleBonuses: "Active Bonuses",
    bonusCode: "Do you have a bonus code?",
    getBonus: "Get Bonus",
    invalidBonusCode: "The bonus code provided is invalid.",
    noActiveBonuses: "You have no active bonuses at the moment.",
    forfeitBonus: "Are you sure want to forfeit bonus?",
    forfeitBonusConfirm: "Confirm",
    forfeitBonusCancel: "Cancel",
    bonusClaimSuccessMessage: "Bonus claimed!",
    bonusClaimErrorMessage: "Invalid bonus"
  }
}, ce = {
  CLAIM: "/v1/bonus/claim",
  FORFEIT: "/v1/bonus/forfeit",
  GRANTED: "/v1/bonus/granted"
}, ye = {
  TYPES: "standard,freeBet,freeRound,cashBack,stakeBack,oddsBoost,wagering",
  STATUS_ACTIVE: "active",
  STATUS_COMPLETED: "completed,released,forfeited,expired,closed"
};
async function pe(n, e = {}) {
  const o = typeof n == "string" ? n : n.toString(), a = await fetch(o, e);
  let s = null;
  try {
    s = await a.json();
  } catch {
    s = null;
  }
  if (a.ok && s)
    return s;
  const i = s && typeof s == "object" ? s : {}, r = {
    success: !1,
    errorMessage: typeof i.errorMessage == "string" && i.errorMessage || a.statusText || String(a.status),
    errorCode: typeof i.errorCode == "number" ? i.errorCode : void 0
  };
  return { ...i, ...r };
}
async function ln(n, e, o) {
  const a = `${n}${ce.CLAIM}`;
  return pe(a, {
    method: "PUT",
    headers: {
      "x-SessionId": e,
      accept: "application/json",
      "Content-Type": "application/json-patch+json"
    },
    body: JSON.stringify(o)
  });
}
async function un(n, e, o) {
  const a = new URL(`${n}${ce.FORFEIT}`);
  return a.searchParams.append("bonusWalletID", o.bonusWalletID), pe(a, {
    method: "DELETE",
    headers: {
      "x-SessionId": e,
      accept: "application/json"
    }
  });
}
async function dn(n, e, o) {
  const a = new URL(`${n}${ce.GRANTED}`);
  Object.entries(o).forEach(([i, r]) => {
    r != null && a.searchParams.append(i, String(r));
  });
  const s = {};
  return e && (s["x-SessionId"] = e), pe(a, {
    headers: s
  });
}
function cn(n) {
  Ke(n, "svelte-2jgm79", '.ActiveBonusesWrapper{color:var(--emw--pam-typography, var(--emw--color-contrast, #07072A));padding:50px;max-width:850px}.ActiveBonusesWrapper.ActiveBonusesWrapperMobile{padding:20px 15px;max-width:unset}.MenuReturnButton{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));display:inline-flex;align-items:center;column-gap:10px;margin-bottom:30px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.ActiveBonusesTitle{font-size:26px;color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:400}.ActiveBonusesTitleMobile{font-size:16px}.ActiveBonusesTitleNone{display:none}.BonusCodeContainer{color:var(--emw--color-gray-300, #58586B);display:flex;flex-direction:column;padding-bottom:30px;position:relative;width:70%}.BonusCodeContainer label{font-size:16px;font-weight:300;padding-bottom:5px}.BonusCodeContainer.BonusCodeContainerMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper{display:flex;gap:10px}.BonusCodeContainer .BonusCodeWrapper.BonusCodeWrapperMobile{flex-direction:column}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput{width:70%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--pam-contrast, var(--emw--color-contrast, #07072A));border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput:focus{outline-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput.BonusCodeInputMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--color-white, #FFFFFF);cursor:pointer;border-radius:5px;width:30%;height:44px;font-size:15px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode[disabled]{opacity:0.3;cursor:not-allowed}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode:hover{filter:brightness(0.9)}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode.SubmitBonusCodeMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer.InvalidField input{border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));background:var(--emw--color-primary-50, var(--emw--color-pink-50, #F1BED9));color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer .InvalidBonusCodeMessage{color:var(--emw--color-error, var(--emw--color-red, #FD2839))}.BonusCodeWrapper{display:flex;gap:20px}.SubmitBonusCode{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--color-white, #FFFFFF);cursor:pointer;border-radius:5px;width:30%;height:44px;font-size:15px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.SubmitBonusCode[disabled]{opacity:0.3}.SubmitBonusCode:hover{filter:brightness(0.9)}.SubmitBonusCode:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.ActiveBonusesGrid{display:grid;grid-template-columns:1fr 1fr;gap:50px}.ActiveBonusesGrid.ActiveBonusesGridMobile{grid-template-columns:1fr}.ModalWrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, 0.7);display:flex;justify-content:center;align-items:center;z-index:300}.ModalWrapper .ModalContent{background-color:var(--emw--color-white, #FFFFFF);position:relative;padding:30px;border-top:5px solid var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));border-radius:5px}.ModalWrapper .ModalBody{background-color:var(--emw--color-gray-50, #F9F8F8);padding:30px;text-align:center}.ModalWrapper .ModalBody .ModalText{font-size:22px;margin-bottom:40px}.ModalWrapper .ModalBody .ModalButtons{display:flex;gap:36px}.ModalWrapper .ModalBody .ModalCancel,.ModalWrapper .ModalBody .ModalConfirm{background:transparent;border:1px solid var(--emw--color-gray-300, #58586B);color:var(--emw--color-gray-300, #58586B);cursor:pointer;border-radius:5px;width:200px;height:50px;font-size:16px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.ModalWrapper .ModalBody .ModalConfirm{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF))}.ModalWrapper.ModalWrapperMobile .ModalContent{padding:20px;width:80vw;border-top:none}.ModalWrapper.ModalWrapperMobile .ModalBody{padding:0;background:transparent}.ModalWrapper.ModalWrapperMobile .ModalText{font-size:16px}.ModalWrapper.ModalWrapperMobile .ModalButtons{gap:10px}.ModalWrapper.ModalWrapperMobile .ModalCancel,.ModalWrapper.ModalWrapperMobile .ModalConfirm{height:40px;width:50%;font-size:14px}.BonusesPaginationWrapper{margin:40px 0;display:block;line-break:anywhere;line-height:2em}.BonusesPaginationWrapper.BonusesPaginationWrapperMobile{text-align:center}.BonusesPaginationWrapper .BonusesFirst,.BonusesPaginationWrapper .BonusesPrev,.BonusesPaginationWrapper .BonusesNext,.BonusesPaginationWrapper .BonusesLast,.BonusesPaginationWrapper .BonusesPage{all:unset;box-sizing:border-box;cursor:pointer}.BonusesPaginationWrapper .BonusesFirst,.BonusesPaginationWrapper .BonusesPrev,.BonusesPaginationWrapper .BonusesNext,.BonusesPaginationWrapper .BonusesLast{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-size:16px;cursor:pointer;padding:5px 10px;font-weight:700}.BonusesPaginationWrapper .BonusesFirst.Inactive,.BonusesPaginationWrapper .BonusesPrev.Inactive,.BonusesPaginationWrapper .BonusesNext.Inactive,.BonusesPaginationWrapper .BonusesLast.Inactive{color:var(--emw--color-gray-100, #E6E6E6);cursor:default}.BonusesPaginationWrapper .BonusesPage{margin:0 5px;color:var(--emw--color-gray-300, #58586B);font-size:16px;cursor:pointer;padding:5px 10px;white-space:nowrap}.BonusesPaginationWrapper .BonusesPage.BonusPageActive{background-color:var(--emw--color-white, #FFFFFF);font-weight:700;cursor:default}.ModalLoader{width:300px;height:300px;margin:0 auto;display:flex;align-items:center;justify-content:center}.ModalLoader:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:5px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E)) transparent var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E)) transparent;animation:Loader 1.2s linear infinite}@keyframes Loader{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}');
}
function he(n, e, o) {
  const a = n.slice();
  return a[55] = e[o], a[57] = o, a;
}
function Ce(n, e, o) {
  const a = n.slice();
  return a[58] = e[o], a;
}
function pn(n) {
  let e, o, a, s, i, r, d, u, b, y, M = (
    /*$_*/
    n[20]("titleBonuses") + ""
  ), k, _, h;
  return {
    c() {
      e = A("div"), o = Q("svg"), a = Q("defs"), s = Q("style"), i = z(`.aaa {
                fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));
              }
            `), r = Q("g"), d = Q("g"), u = Q("path"), b = L(), y = A("h2"), k = z(M), v(u, "class", "aaa"), v(u, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), v(u, "transform", "translate(15 15) rotate(180)"), v(d, "transform", "translate(20 158)"), v(r, "transform", "translate(-20 -158)"), v(o, "xmlns", "http://www.w3.org/2000/svg"), v(o, "width", "15"), v(o, "height", "15"), v(o, "viewBox", "0 0 15 15"), v(y, "class", "ActiveBonusesTitleMobile"), v(e, "class", "MenuReturnButton");
    },
    m(C, c) {
      j(C, e, c), f(e, o), f(o, a), f(a, s), f(s, i), f(o, r), f(r, d), f(d, u), f(e, b), f(e, y), f(y, k), _ || (h = q(
        e,
        "click",
        /*click_handler*/
        n[35]
      ), _ = !0);
    },
    p(C, c) {
      c[0] & /*$_*/
      1048576 && M !== (M = /*$_*/
      C[20]("titleBonuses") + "") && Z(k, M);
    },
    d(C) {
      C && N(e), _ = !1, h();
    }
  };
}
function we(n) {
  let e, o = (
    /*$_*/
    n[20]("invalidBonusCode") + ""
  ), a;
  return {
    c() {
      e = A("p"), a = z(o), v(e, "class", "InvalidBonusCodeMessage");
    },
    m(s, i) {
      j(s, e, i), f(e, a);
    },
    p(s, i) {
      i[0] & /*$_*/
      1048576 && o !== (o = /*$_*/
      s[20]("invalidBonusCode") + "") && Z(a, o);
    },
    d(s) {
      s && N(e);
    }
  };
}
function fn(n) {
  let e, o, a;
  function s(u, b) {
    return (
      /*activeBonusesList*/
      u[18].length === 0 ? gn : bn
    );
  }
  let i = s(n), r = i(n), d = (
    /*activeBonusesList*/
    n[18].length !== 0 && Ae(n)
  );
  return {
    c() {
      e = A("div"), r.c(), o = L(), d && d.c(), a = de(), v(e, "class", "ActiveBonusesGrid " + /*isMobile*/
      (n[21] ? "ActiveBonusesGridMobile" : ""));
    },
    m(u, b) {
      j(u, e, b), r.m(e, null), j(u, o, b), d && d.m(u, b), j(u, a, b);
    },
    p(u, b) {
      i === (i = s(u)) && r ? r.p(u, b) : (r.d(1), r = i(u), r && (r.c(), r.m(e, null))), /*activeBonusesList*/
      u[18].length !== 0 ? d ? d.p(u, b) : (d = Ae(u), d.c(), d.m(a.parentNode, a)) : d && (d.d(1), d = null);
    },
    d(u) {
      u && (N(e), N(o), N(a)), r.d(), d && d.d(u);
    }
  };
}
function mn(n) {
  let e;
  return {
    c() {
      e = A("div"), v(e, "class", "ModalLoader"), v(e, "part", "ModalLoader");
    },
    m(o, a) {
      j(o, e, a);
    },
    p: le,
    d(o) {
      o && N(e);
    }
  };
}
function bn(n) {
  let e, o = se(
    /*activeBonusesList*/
    n[18]
  ), a = [];
  for (let s = 0; s < o.length; s += 1)
    a[s] = Me(Ce(n, o, s));
  return {
    c() {
      for (let s = 0; s < a.length; s += 1)
        a[s].c();
      e = de();
    },
    m(s, i) {
      for (let r = 0; r < a.length; r += 1)
        a[r] && a[r].m(s, i);
      j(s, e, i);
    },
    p(s, i) {
      if (i[0] & /*activeBonusesList, lang, dateformat, clientstyling, clientstylingurl, mbsource, translationurl, currencylocale, ishiddenwageringbonus*/
      262399) {
        o = se(
          /*activeBonusesList*/
          s[18]
        );
        let r;
        for (r = 0; r < o.length; r += 1) {
          const d = Ce(s, o, r);
          a[r] ? a[r].p(d, i) : (a[r] = Me(d), a[r].c(), a[r].m(e.parentNode, e));
        }
        for (; r < a.length; r += 1)
          a[r].d(1);
        a.length = o.length;
      }
    },
    d(s) {
      s && N(e), Ee(a, s);
    }
  };
}
function gn(n) {
  let e, o = (
    /*$_*/
    n[20]("noActiveBonuses") + ""
  ), a;
  return {
    c() {
      e = A("p"), a = z(o);
    },
    m(s, i) {
      j(s, e, i), f(e, a);
    },
    p(s, i) {
      i[0] & /*$_*/
      1048576 && o !== (o = /*$_*/
      s[20]("noActiveBonuses") + "") && Z(a, o);
    },
    d(s) {
      s && N(e);
    }
  };
}
function Bn(n) {
  let e, o, a, s, i, r, d, u, b, y, M, k, _, h, C, c, g;
  return {
    c() {
      e = A("player-bonus-card"), t(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[58].termsandconditionsdescription), t(e, "termsandconditionsurl", a = /*activeBonus*/
      n[58].termsandconditionsurl), t(e, "termsandconditionsasset", s = /*activeBonus*/
      n[58].termsandconditionsasset), t(e, "endpoint", i = /*activeBonus*/
      n[58].endpoint), t(e, "playerid", r = /*activeBonus*/
      n[58].playerid), t(e, "session", d = /*activeBonus*/
      n[58].session), t(e, "bonuswalletid", u = /*activeBonus*/
      n[58].walletId), t(e, "bonusdate", b = /*activeBonus*/
      n[58].granted), t(e, "bonusexpirationdate", y = /*activeBonus*/
      n[58].expiryTime), t(e, "bonusstatus", M = /*activeBonus*/
      n[58].status), t(e, "bonusname", k = /*activeBonus*/
      n[58].name), t(e, "bonustype", _ = /*activeBonus*/
      n[58].type), t(e, "bonusamount", h = /*activeBonus*/
      n[58].extension.grantedPlayerCurrencyAmount), t(e, "bonuswageringamount", C = `${/*activeBonus*/
      n[58].fulfilledWR} / ${/*activeBonus*/
      n[58].originalWageringRequirement}`), t(e, "bonusremainingamount", c = /*activeBonus*/
      n[58].currentAmount), t(e, "bonuscurrency", g = /*activeBonus*/
      n[58].currency), t(
        e,
        "lang",
        /*lang*/
        n[0]
      ), t(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), t(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), t(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), t(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), t(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      );
    },
    m(p, m) {
      j(p, e, m);
    },
    p(p, m) {
      m[0] & /*activeBonusesList*/
      262144 && o !== (o = /*activeBonus*/
      p[58].termsandconditionsdescription) && t(e, "termsandconditionsdescription", o), m[0] & /*activeBonusesList*/
      262144 && a !== (a = /*activeBonus*/
      p[58].termsandconditionsurl) && t(e, "termsandconditionsurl", a), m[0] & /*activeBonusesList*/
      262144 && s !== (s = /*activeBonus*/
      p[58].termsandconditionsasset) && t(e, "termsandconditionsasset", s), m[0] & /*activeBonusesList*/
      262144 && i !== (i = /*activeBonus*/
      p[58].endpoint) && t(e, "endpoint", i), m[0] & /*activeBonusesList*/
      262144 && r !== (r = /*activeBonus*/
      p[58].playerid) && t(e, "playerid", r), m[0] & /*activeBonusesList*/
      262144 && d !== (d = /*activeBonus*/
      p[58].session) && t(e, "session", d), m[0] & /*activeBonusesList*/
      262144 && u !== (u = /*activeBonus*/
      p[58].walletId) && t(e, "bonuswalletid", u), m[0] & /*activeBonusesList*/
      262144 && b !== (b = /*activeBonus*/
      p[58].granted) && t(e, "bonusdate", b), m[0] & /*activeBonusesList*/
      262144 && y !== (y = /*activeBonus*/
      p[58].expiryTime) && t(e, "bonusexpirationdate", y), m[0] & /*activeBonusesList*/
      262144 && M !== (M = /*activeBonus*/
      p[58].status) && t(e, "bonusstatus", M), m[0] & /*activeBonusesList*/
      262144 && k !== (k = /*activeBonus*/
      p[58].name) && t(e, "bonusname", k), m[0] & /*activeBonusesList*/
      262144 && _ !== (_ = /*activeBonus*/
      p[58].type) && t(e, "bonustype", _), m[0] & /*activeBonusesList*/
      262144 && h !== (h = /*activeBonus*/
      p[58].extension.grantedPlayerCurrencyAmount) && t(e, "bonusamount", h), m[0] & /*activeBonusesList*/
      262144 && C !== (C = `${/*activeBonus*/
      p[58].fulfilledWR} / ${/*activeBonus*/
      p[58].originalWageringRequirement}`) && t(e, "bonuswageringamount", C), m[0] & /*activeBonusesList*/
      262144 && c !== (c = /*activeBonus*/
      p[58].currentAmount) && t(e, "bonusremainingamount", c), m[0] & /*activeBonusesList*/
      262144 && g !== (g = /*activeBonus*/
      p[58].currency) && t(e, "bonuscurrency", g), m[0] & /*lang*/
      1 && t(
        e,
        "lang",
        /*lang*/
        p[0]
      ), m[0] & /*dateformat*/
      64 && t(
        e,
        "dateformat",
        /*dateformat*/
        p[6]
      ), m[0] & /*clientstyling*/
      2 && t(
        e,
        "clientstyling",
        /*clientstyling*/
        p[1]
      ), m[0] & /*clientstylingurl*/
      4 && t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        p[2]
      ), m[0] & /*mbsource*/
      8 && t(
        e,
        "mbsource",
        /*mbsource*/
        p[3]
      ), m[0] & /*translationurl*/
      16 && t(
        e,
        "translationurl",
        /*translationurl*/
        p[4]
      ), m[0] & /*currencylocale*/
      32 && t(
        e,
        "currencylocale",
        /*currencylocale*/
        p[5]
      ), m[0] & /*ishiddenwageringbonus*/
      128 && t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        p[7]
      );
    },
    d(p) {
      p && N(e);
    }
  };
}
function vn(n) {
  let e, o, a, s, i, r, d, u, b, y, M, k, _, h, C;
  return {
    c() {
      e = A("player-bonus-card"), t(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[58].termsandconditionsdescription), t(e, "termsandconditionsurl", a = /*activeBonus*/
      n[58].termsandconditionsurl), t(e, "termsandconditionsasset", s = /*activeBonus*/
      n[58].termsandconditionsasset), t(e, "endpoint", i = /*activeBonus*/
      n[58].endpoint), t(e, "playerid", r = /*activeBonus*/
      n[58].playerid), t(e, "session", d = /*activeBonus*/
      n[58].session), t(e, "bonuswalletid", u = /*activeBonus*/
      n[58].walletId), t(e, "bonusdate", b = /*activeBonus*/
      n[58].granted), t(e, "bonusexpirationdate", y = /*activeBonus*/
      n[58].expiryTime), t(e, "bonusstatus", M = /*activeBonus*/
      n[58].status), t(e, "bonusname", k = /*activeBonus*/
      n[58].name), t(e, "bonustype", _ = /*activeBonus*/
      n[58].type), t(e, "bonuscurrency", h = /*activeBonus*/
      n[58].currency), t(e, "bonusfreespins", C = /*activeBonus*/
      n[58].freeRoundNumber), t(
        e,
        "lang",
        /*lang*/
        n[0]
      ), t(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), t(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), t(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), t(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), t(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      );
    },
    m(c, g) {
      j(c, e, g);
    },
    p(c, g) {
      g[0] & /*activeBonusesList*/
      262144 && o !== (o = /*activeBonus*/
      c[58].termsandconditionsdescription) && t(e, "termsandconditionsdescription", o), g[0] & /*activeBonusesList*/
      262144 && a !== (a = /*activeBonus*/
      c[58].termsandconditionsurl) && t(e, "termsandconditionsurl", a), g[0] & /*activeBonusesList*/
      262144 && s !== (s = /*activeBonus*/
      c[58].termsandconditionsasset) && t(e, "termsandconditionsasset", s), g[0] & /*activeBonusesList*/
      262144 && i !== (i = /*activeBonus*/
      c[58].endpoint) && t(e, "endpoint", i), g[0] & /*activeBonusesList*/
      262144 && r !== (r = /*activeBonus*/
      c[58].playerid) && t(e, "playerid", r), g[0] & /*activeBonusesList*/
      262144 && d !== (d = /*activeBonus*/
      c[58].session) && t(e, "session", d), g[0] & /*activeBonusesList*/
      262144 && u !== (u = /*activeBonus*/
      c[58].walletId) && t(e, "bonuswalletid", u), g[0] & /*activeBonusesList*/
      262144 && b !== (b = /*activeBonus*/
      c[58].granted) && t(e, "bonusdate", b), g[0] & /*activeBonusesList*/
      262144 && y !== (y = /*activeBonus*/
      c[58].expiryTime) && t(e, "bonusexpirationdate", y), g[0] & /*activeBonusesList*/
      262144 && M !== (M = /*activeBonus*/
      c[58].status) && t(e, "bonusstatus", M), g[0] & /*activeBonusesList*/
      262144 && k !== (k = /*activeBonus*/
      c[58].name) && t(e, "bonusname", k), g[0] & /*activeBonusesList*/
      262144 && _ !== (_ = /*activeBonus*/
      c[58].type) && t(e, "bonustype", _), g[0] & /*activeBonusesList*/
      262144 && h !== (h = /*activeBonus*/
      c[58].currency) && t(e, "bonuscurrency", h), g[0] & /*activeBonusesList*/
      262144 && C !== (C = /*activeBonus*/
      c[58].freeRoundNumber) && t(e, "bonusfreespins", C), g[0] & /*lang*/
      1 && t(
        e,
        "lang",
        /*lang*/
        c[0]
      ), g[0] & /*dateformat*/
      64 && t(
        e,
        "dateformat",
        /*dateformat*/
        c[6]
      ), g[0] & /*clientstyling*/
      2 && t(
        e,
        "clientstyling",
        /*clientstyling*/
        c[1]
      ), g[0] & /*clientstylingurl*/
      4 && t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        c[2]
      ), g[0] & /*mbsource*/
      8 && t(
        e,
        "mbsource",
        /*mbsource*/
        c[3]
      ), g[0] & /*translationurl*/
      16 && t(
        e,
        "translationurl",
        /*translationurl*/
        c[4]
      ), g[0] & /*currencylocale*/
      32 && t(
        e,
        "currencylocale",
        /*currencylocale*/
        c[5]
      ), g[0] & /*ishiddenwageringbonus*/
      128 && t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        c[7]
      );
    },
    d(c) {
      c && N(e);
    }
  };
}
function Me(n) {
  let e;
  function o(i, r) {
    return (
      /*activeBonus*/
      i[58].type === "freeRound" ? vn : Bn
    );
  }
  let a = o(n), s = a(n);
  return {
    c() {
      s.c(), e = de();
    },
    m(i, r) {
      s.m(i, r), j(i, e, r);
    },
    p(i, r) {
      a === (a = o(i)) && s ? s.p(i, r) : (s.d(1), s = a(i), s && (s.c(), s.m(e.parentNode, e)));
    },
    d(i) {
      i && N(e), s.d(i);
    }
  };
}
function Ae(n) {
  let e, o, a, s, i, r, d, u, b, y, M, k, _, h, C, c, g, p, m, Y, X, J, G, D = se(Array(
    /*numberOfPages*/
    n[16]
  )), w = [];
  for (let B = 0; B < D.length; B += 1)
    w[B] = ke(he(n, D, B));
  return {
    c() {
      e = A("div"), o = A("button"), a = z("|<"), r = L(), d = A("button"), u = z("<"), M = L();
      for (let B = 0; B < w.length; B += 1)
        w[B].c();
      k = L(), _ = A("button"), h = z(">"), g = L(), p = A("button"), m = z(">|"), o.disabled = s = /*currentPage*/
      n[17] === 0, v(o, "class", i = "BonusesFirst " + /*currentPage*/
      (n[17] === 0 ? "Inactive" : "")), d.disabled = b = /*currentPage*/
      n[17] === 0, v(d, "class", y = "BonusesPrev " + /*currentPage*/
      (n[17] === 0 ? "Inactive" : "")), _.disabled = C = /*currentPage*/
      n[17] === /*numberOfPages*/
      n[16] - 1, v(_, "class", c = "BonusesNext " + /*currentPage*/
      (n[17] === /*numberOfPages*/
      n[16] - 1 ? "Inactive" : "")), p.disabled = Y = /*currentPage*/
      n[17] === /*numberOfPages*/
      n[16] - 1, v(p, "class", X = "BonusesLast " + /*currentPage*/
      (n[17] === /*numberOfPages*/
      n[16] - 1 ? "Inactive" : "")), v(e, "class", "BonusesPaginationWrapper " + /*isMobile*/
      (n[21] ? "BonusesPaginationWrapperMobile" : ""));
    },
    m(B, S) {
      j(B, e, S), f(e, o), f(o, a), f(e, r), f(e, d), f(d, u), f(e, M);
      for (let E = 0; E < w.length; E += 1)
        w[E] && w[E].m(e, null);
      f(e, k), f(e, _), f(_, h), f(e, g), f(e, p), f(p, m), J || (G = [
        q(
          o,
          "click",
          /*click_handler_1*/
          n[37]
        ),
        q(
          d,
          "click",
          /*click_handler_2*/
          n[38]
        ),
        q(
          _,
          "click",
          /*click_handler_4*/
          n[40]
        ),
        q(
          p,
          "click",
          /*click_handler_5*/
          n[41]
        )
      ], J = !0);
    },
    p(B, S) {
      if (S[0] & /*currentPage*/
      131072 && s !== (s = /*currentPage*/
      B[17] === 0) && (o.disabled = s), S[0] & /*currentPage*/
      131072 && i !== (i = "BonusesFirst " + /*currentPage*/
      (B[17] === 0 ? "Inactive" : "")) && v(o, "class", i), S[0] & /*currentPage*/
      131072 && b !== (b = /*currentPage*/
      B[17] === 0) && (d.disabled = b), S[0] & /*currentPage*/
      131072 && y !== (y = "BonusesPrev " + /*currentPage*/
      (B[17] === 0 ? "Inactive" : "")) && v(d, "class", y), S[0] & /*currentPage, getActiveBonuses, numberOfPages*/
      16973824) {
        D = se(Array(
          /*numberOfPages*/
          B[16]
        ));
        let E;
        for (E = 0; E < D.length; E += 1) {
          const I = he(B, D, E);
          w[E] ? w[E].p(I, S) : (w[E] = ke(I), w[E].c(), w[E].m(e, k));
        }
        for (; E < w.length; E += 1)
          w[E].d(1);
        w.length = D.length;
      }
      S[0] & /*currentPage, numberOfPages*/
      196608 && C !== (C = /*currentPage*/
      B[17] === /*numberOfPages*/
      B[16] - 1) && (_.disabled = C), S[0] & /*currentPage, numberOfPages*/
      196608 && c !== (c = "BonusesNext " + /*currentPage*/
      (B[17] === /*numberOfPages*/
      B[16] - 1 ? "Inactive" : "")) && v(_, "class", c), S[0] & /*currentPage, numberOfPages*/
      196608 && Y !== (Y = /*currentPage*/
      B[17] === /*numberOfPages*/
      B[16] - 1) && (p.disabled = Y), S[0] & /*currentPage, numberOfPages*/
      196608 && X !== (X = "BonusesLast " + /*currentPage*/
      (B[17] === /*numberOfPages*/
      B[16] - 1 ? "Inactive" : "")) && v(p, "class", X);
    },
    d(B) {
      B && N(e), Ee(w, B), J = !1, ue(G);
    }
  };
}
function ke(n) {
  let e, o = (
    /*i*/
    n[57] + 1 + ""
  ), a, s, i, r, d;
  function u() {
    return (
      /*click_handler_3*/
      n[39](
        /*i*/
        n[57]
      )
    );
  }
  return {
    c() {
      e = A("button"), a = z(o), e.disabled = s = /*i*/
      n[57] === /*currentPage*/
      n[17], v(e, "class", i = "BonusesPage " + /*i*/
      (n[57] === /*currentPage*/
      n[17] ? "BonusPageActive" : ""));
    },
    m(b, y) {
      j(b, e, y), f(e, a), r || (d = q(e, "click", u), r = !0);
    },
    p(b, y) {
      n = b, y[0] & /*currentPage*/
      131072 && s !== (s = /*i*/
      n[57] === /*currentPage*/
      n[17]) && (e.disabled = s), y[0] & /*currentPage*/
      131072 && i !== (i = "BonusesPage " + /*i*/
      (n[57] === /*currentPage*/
      n[17] ? "BonusPageActive" : "")) && v(e, "class", i);
    },
    d(b) {
      b && N(e), r = !1, d();
    }
  };
}
function We(n) {
  let e, o, a, s, i = (
    /*$_*/
    n[20]("forfeitBonus") + ""
  ), r, d, u, b, y = (
    /*$_*/
    n[20]("forfeitBonusCancel") + ""
  ), M, k, _, h = (
    /*$_*/
    n[20]("forfeitBonusConfirm") + ""
  ), C, c, g;
  return {
    c() {
      e = A("div"), o = A("div"), a = A("div"), s = A("p"), r = z(i), d = L(), u = A("div"), b = A("button"), M = z(y), k = L(), _ = A("button"), C = z(h), v(s, "class", "ModalText"), v(b, "class", "ModalCancel"), v(_, "class", "ModalConfirm"), v(u, "class", "ModalButtons"), v(a, "class", "ModalBody"), v(o, "class", "ModalContent"), v(e, "class", "ModalWrapper " + /*isMobile*/
      (n[21] ? "ModalWrapperMobile" : ""));
    },
    m(p, m) {
      j(p, e, m), f(e, o), f(o, a), f(a, s), f(s, r), f(a, d), f(a, u), f(u, b), f(b, M), f(u, k), f(u, _), f(_, C), c || (g = [
        q(
          b,
          "click",
          /*closeBonusModal*/
          n[26]
        ),
        q(
          _,
          "click",
          /*debouncedFunction*/
          n[28](
            /*deleteBonus*/
            n[27]
          )
        )
      ], c = !0);
    },
    p(p, m) {
      m[0] & /*$_*/
      1048576 && i !== (i = /*$_*/
      p[20]("forfeitBonus") + "") && Z(r, i), m[0] & /*$_*/
      1048576 && y !== (y = /*$_*/
      p[20]("forfeitBonusCancel") + "") && Z(M, y), m[0] & /*$_*/
      1048576 && h !== (h = /*$_*/
      p[20]("forfeitBonusConfirm") + "") && Z(C, h);
    },
    d(p) {
      p && N(e), c = !1, ue(g);
    }
  };
}
function _n(n) {
  let e, o, a, s, i = (
    /*$_*/
    n[20]("titleBonuses") + ""
  ), r, d, u, b, y = (
    /*$_*/
    n[20]("bonusCode") + ""
  ), M, k, _, h, C, c, g = (
    /*$_*/
    n[20]("getBonus") + ""
  ), p, m, Y, X, J, G, D, w = (
    /*isMobile*/
    n[21] && pn(n)
  ), B = (
    /*invalidBonusCode*/
    n[11] && we(n)
  );
  function S(W, R) {
    return (
      /*isLoading*/
      W[9] ? mn : fn
    );
  }
  let E = S(n), I = E(n), T = (
    /*bonusModal*/
    n[19] && We(n)
  );
  return {
    c() {
      e = A("div"), o = A("div"), w && w.c(), a = L(), s = A("h2"), r = z(i), d = L(), u = A("div"), b = A("label"), M = z(y), k = L(), _ = A("div"), h = A("input"), C = L(), c = A("button"), p = z(g), Y = L(), B && B.c(), X = L(), I.c(), J = L(), T && T.c(), v(s, "class", "ActiveBonusesTitle " + /*isMobile*/
      (n[21] ? "ActiveBonusesTitleNone" : "")), v(b, "for", "BonusCode"), v(h, "class", "BonusCodeInput " + /*isMobile*/
      (n[21] ? "BonusCodeInputMobile" : "")), v(h, "type", "text"), v(h, "id", "BonusCode"), v(c, "class", "SubmitBonusCode " + /*isMobile*/
      (n[21] ? "SubmitBonusCodeMobile" : "")), c.disabled = m = /*invalidBonusField*/
      n[10] || /*isLoading*/
      n[9], v(_, "class", "BonusCodeWrapper " + /*isMobile*/
      (n[21] ? "BonusCodeWrapperMobile" : "")), v(u, "class", "BonusCodeContainer " + /*isMobile*/
      (n[21] ? "BonusCodeContainerMobile" : "")), v(o, "class", "ActiveBonusesWrapper " + /*isMobile*/
      (n[21] ? "ActiveBonusesWrapperMobile" : ""));
    },
    m(W, R) {
      j(W, e, R), f(e, o), w && w.m(o, null), f(o, a), f(o, s), f(s, r), f(o, d), f(o, u), f(u, b), f(b, M), f(u, k), f(u, _), f(_, h), Be(
        h,
        /*bonusCode*/
        n[12]
      ), f(_, C), f(_, c), f(c, p), f(u, Y), B && B.m(u, null), f(o, X), I.m(o, null), f(e, J), T && T.m(e, null), n[42](e), G || (D = [
        q(
          h,
          "input",
          /*input_input_handler*/
          n[36]
        ),
        q(
          h,
          "keyup",
          /*validateBonusCode*/
          n[23]
        ),
        q(
          c,
          "click",
          /*claimBonus*/
          n[25]
        )
      ], G = !0);
    },
    p(W, R) {
      /*isMobile*/
      W[21] && w.p(W, R), R[0] & /*$_*/
      1048576 && i !== (i = /*$_*/
      W[20]("titleBonuses") + "") && Z(r, i), R[0] & /*$_*/
      1048576 && y !== (y = /*$_*/
      W[20]("bonusCode") + "") && Z(M, y), R[0] & /*bonusCode*/
      4096 && h.value !== /*bonusCode*/
      W[12] && Be(
        h,
        /*bonusCode*/
        W[12]
      ), R[0] & /*$_*/
      1048576 && g !== (g = /*$_*/
      W[20]("getBonus") + "") && Z(p, g), R[0] & /*invalidBonusField, isLoading*/
      1536 && m !== (m = /*invalidBonusField*/
      W[10] || /*isLoading*/
      W[9]) && (c.disabled = m), /*invalidBonusCode*/
      W[11] ? B ? B.p(W, R) : (B = we(W), B.c(), B.m(u, null)) : B && (B.d(1), B = null), E === (E = S(W)) && I ? I.p(W, R) : (I.d(1), I = E(W), I && (I.c(), I.m(o, null))), /*bonusModal*/
      W[19] ? T ? T.p(W, R) : (T = We(W), T.c(), T.m(e, null)) : T && (T.d(1), T = null);
    },
    i: le,
    o: le,
    d(W) {
      W && N(e), w && w.d(), B && B.d(), I.d(), T && T.d(), n[42](null), G = !1, ue(D);
    }
  };
}
let yn = "status=active", H = 6;
function hn(n) {
  const e = n.initialWagerRequirementAmount ?? 0, o = n.remainingWagerRequirementAmount ?? 0;
  return {
    ...n,
    walletId: n.bonusWalletID ?? void 0,
    granted: n.grantedDate ?? void 0,
    expiryTime: n.expiryDate ?? void 0,
    currentAmount: n.remainingAmount ?? void 0,
    originalWageringRequirement: n.initialWagerRequirementAmount ?? void 0,
    fulfilledWR: e - o,
    extension: {
      grantedPlayerCurrencyAmount: n.amount ?? void 0
    },
    termsandconditionsurl: n.url ?? void 0,
    termsandconditionsdescription: n.description ?? void 0,
    termsandconditionsasset: n.assets ?? void 0
  };
}
function Cn(n, e, o) {
  let a;
  Qe(n, xe, (l) => o(20, a = l));
  let { endpoint: s = "" } = e, { session: i = "" } = e, { playerid: r = "" } = e, { lang: d = "en" } = e, { currency: u = "" } = e, { clientstyling: b = "" } = e, { clientstylingurl: y = "" } = e, { mbsource: M } = e, { translationurl: k = "" } = e, { currencylocale: _ = "" } = e, { dateformat: h = "" } = e, { bonuscoderegex: C = "" } = e, { ishiddenwageringbonus: c = "false" } = e, { gmversion: g = "" } = e, p = !1, m, Y, X = window.navigator.userAgent, J = $e(X) !== "PC", G = !0, D = !1, w = "", B = 0, S = 0, E = 0, I = 0, T = 0, W = [], R, te = "", ae = !1;
  const Pe = () => {
    fetch(k).then((P) => P.json()).then((P) => {
      Object.keys(P).forEach((U) => {
        ve(U, P[U]);
      });
    }).catch((P) => {
      console.log(P);
    });
  };
  Object.keys(_e).forEach((l) => {
    ve(l, _e[l]);
  });
  const fe = (l) => {
    if (l.data)
      switch (l.data.type) {
        case "DeleteActiveBonus":
          te = l.data.bonuswalletid, o(19, ae = !0);
          break;
      }
  };
  function Se(l, P) {
    return (...U) => {
      clearTimeout(R), R = setTimeout(
        () => {
          l.apply(this, U);
        },
        P
      );
    };
  }
  const me = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: J
      },
      window.location.href
    );
  }, Ie = () => w ? C ? new RegExp(C).test(w) : !0 : !1, Te = () => {
    o(10, G = !Ie()), C && o(11, D = G);
  }, V = async (l) => {
    o(9, p = !0);
    try {
      let P = [], U = 0;
      if (g === "gm2") {
        console.log("getActiveBonuses - gm2", g);
        const F = {
          pagination: `limit=${H},offset=${l}`,
          language: d || "en",
          sortOrder: "desc",
          status: ye.STATUS_ACTIVE,
          type: ye.TYPES,
          expand: "freeSpin"
        };
        c === "true" && (F.includeHiddenWallet = !0);
        const K = await dn(s, i, F);
        console.log("data from getActiveBonuses", K);
        const x = K.items;
        Array.isArray(x) ? P = x.map(hn) : console.error("Unexpected granted bonuses payload", K), U = K.total ?? 0;
      } else {
        console.log("getActiveBonuses - /bonusWallet", g);
        const F = {
          method: "GET",
          headers: { "X-SessionId": i }
        }, K = `/v1/player/${r}/bonusWallet`, x = new URL(`${s}${K}`), re = new URLSearchParams();
        re.set("filter", yn), re.set("pagination", `offset=${l},limit=${H}`), x.search = re.toString();
        const $ = await (await fetch(x, F)).json();
        if (Array.isArray($.items)) {
          for (const ne of $.items) {
            const oe = ne?.extension?.bonus?.presentation;
            oe && (ne.termsandconditionsurl = oe.url, ne.termsandconditionsdescription = oe.description, ne.termsandconditionsasset = oe.assets);
          }
          P = $.items;
        } else
          console.error("Unexpected legacy bonus list payload", $);
        U = $.total ?? 0;
      }
      o(16, I = Math.ceil(U / H)), l - H >= 0 && o(13, B = l - H), l + H < U && o(14, S = l + H), o(15, E = (I - 1) * H), o(17, T = l / H), o(18, W = P), _ && W.forEach((F) => {
        F.fulfilledWR = ee(F.fulfilledWR), F.originalWageringRequirement = ee(F.originalWageringRequirement), F.currentAmount = ee(F.currentAmount), F.extension && (F.extension.grantedPlayerCurrencyAmount = ee(F.extension.grantedPlayerCurrencyAmount));
      }), window.scrollTo({ top: 0, behavior: "smooth" });
    } catch (P) {
      console.error(P);
    } finally {
      o(9, p = !1);
    }
  }, ee = (l) => new Intl.NumberFormat(_, { style: "currency", currency: u }).format(l).replace(/\s/g, ""), be = () => {
    console.log("post claim success, status 200"), o(11, D = !1), V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "success",
          message: a("bonusClaimSuccessMessage")
        }
      },
      window.location.href
    ), typeof gtag == "function" && gtag("event", "ClaimBonus", {
      context: "PlayerActiveBonuses",
      userId: `${r || "Not logged in"}`,
      bonusCode: `${w}`
    });
  }, ge = () => {
    o(11, D = !0), console.log("post claim error - status not 200"), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "error",
          message: a("bonusClaimErrorMessage")
        }
      },
      window.location.href
    );
  }, Fe = async () => {
    o(9, p = !0);
    try {
      if (g === "gm2") {
        if (!(await ln(s, i, { bonusCode: w, currency: u })).success) {
          ge();
          //!
          return;
        }
        be();
        return;
      }
      const l = new URL(`${s}/v1/player/${r}/claimbonus`);
      l.searchParams.append("currency", u), l.searchParams.append("bonusCode", w);
      const P = {
        method: "POST",
        headers: {
          "X-SessionId": i,
          accept: "application/json"
        }
      };
      (await fetch(l.href, P)).status == 200 ? be() : ge();
    } finally {
      o(9, p = !1);
    }
  }, ie = () => {
    window.postMessage({ type: "EnableScroll" }, window.location.href), o(19, ae = !1);
  }, Re = async () => {
    if (g === "gm2") {
      if (!(await un(s, i, { bonusWalletID: te })).success)
        return;
      V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), ie();
      return;
    }
    const l = {
      method: "DELETE",
      headers: {
        "X-SessionId": i,
        "Content-Type": "application/json",
        Accept: "application/json"
      }
    }, P = new URL(`${s}/v1/player/${r}/bonusWallet`);
    P.searchParams.append("bonusWalletID", te), (await fetch(P, l)).status == 200 && (V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), ie());
  }, Le = () => {
    rn(d);
  };
  function ze(l) {
    return Se(l, 1e3);
  }
  en(() => (window.addEventListener("message", fe, !1), () => {
    window.removeEventListener("message", fe);
  }));
  const Ne = () => me();
  function je() {
    w = this.value, o(12, w);
  }
  const De = () => V(0), Oe = () => V(B), Ue = (l) => V(l * H), qe = () => V(S), Ge = () => V(E);
  function Ve(l) {
    nn[l ? "unshift" : "push"](() => {
      m = l, o(8, m);
    });
  }
  return n.$$set = (l) => {
    "endpoint" in l && o(29, s = l.endpoint), "session" in l && o(30, i = l.session), "playerid" in l && o(31, r = l.playerid), "lang" in l && o(0, d = l.lang), "currency" in l && o(32, u = l.currency), "clientstyling" in l && o(1, b = l.clientstyling), "clientstylingurl" in l && o(2, y = l.clientstylingurl), "mbsource" in l && o(3, M = l.mbsource), "translationurl" in l && o(4, k = l.translationurl), "currencylocale" in l && o(5, _ = l.currencylocale), "dateformat" in l && o(6, h = l.dateformat), "bonuscoderegex" in l && o(33, C = l.bonuscoderegex), "ishiddenwageringbonus" in l && o(7, c = l.ishiddenwageringbonus), "gmversion" in l && o(34, g = l.gmversion);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*lang*/
    1 && d && Le(), n.$$.dirty[0] & /*session, endpoint*/
    1610612736 | n.$$.dirty[1] & /*playerid*/
    1 && i && r && s && V(0), n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    258 && b && m && on(m, b), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    260 && y && m && sn(m, y), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
    264 && M && m && tn(m, `${M}.Style`, Y), n.$$.dirty[0] & /*translationurl*/
    16 && k && Pe();
  }, [
    d,
    b,
    y,
    M,
    k,
    _,
    h,
    c,
    m,
    p,
    G,
    D,
    w,
    B,
    S,
    E,
    I,
    T,
    W,
    ae,
    a,
    J,
    me,
    Te,
    V,
    Fe,
    ie,
    Re,
    ze,
    s,
    i,
    r,
    u,
    C,
    g,
    Ne,
    je,
    De,
    Oe,
    Ue,
    qe,
    Ge,
    Ve
  ];
}
class wn extends Xe {
  constructor(e) {
    super(), Je(
      this,
      e,
      Cn,
      _n,
      Ze,
      {
        endpoint: 29,
        session: 30,
        playerid: 31,
        lang: 0,
        currency: 32,
        clientstyling: 1,
        clientstylingurl: 2,
        mbsource: 3,
        translationurl: 4,
        currencylocale: 5,
        dateformat: 6,
        bonuscoderegex: 33,
        ishiddenwageringbonus: 7,
        gmversion: 34
      },
      cn,
      [-1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[29];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), O();
  }
  get session() {
    return this.$$.ctx[30];
  }
  set session(e) {
    this.$$set({ session: e }), O();
  }
  get playerid() {
    return this.$$.ctx[31];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), O();
  }
  get lang() {
    return this.$$.ctx[0];
  }
  set lang(e) {
    this.$$set({ lang: e }), O();
  }
  get currency() {
    return this.$$.ctx[32];
  }
  set currency(e) {
    this.$$set({ currency: e }), O();
  }
  get clientstyling() {
    return this.$$.ctx[1];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), O();
  }
  get clientstylingurl() {
    return this.$$.ctx[2];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), O();
  }
  get mbsource() {
    return this.$$.ctx[3];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), O();
  }
  get translationurl() {
    return this.$$.ctx[4];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), O();
  }
  get currencylocale() {
    return this.$$.ctx[5];
  }
  set currencylocale(e) {
    this.$$set({ currencylocale: e }), O();
  }
  get dateformat() {
    return this.$$.ctx[6];
  }
  set dateformat(e) {
    this.$$set({ dateformat: e }), O();
  }
  get bonuscoderegex() {
    return this.$$.ctx[33];
  }
  set bonuscoderegex(e) {
    this.$$set({ bonuscoderegex: e }), O();
  }
  get ishiddenwageringbonus() {
    return this.$$.ctx[7];
  }
  set ishiddenwageringbonus(e) {
    this.$$set({ ishiddenwageringbonus: e }), O();
  }
  get gmversion() {
    return this.$$.ctx[34];
  }
  set gmversion(e) {
    this.$$set({ gmversion: e }), O();
  }
}
an(wn, { endpoint: {}, session: {}, playerid: {}, lang: {}, currency: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, currencylocale: {}, dateformat: {}, bonuscoderegex: {}, ishiddenwageringbonus: {}, gmversion: {} }, [], [], !0);
export {
  wn as default
};
