var bt = Object.defineProperty;
var Oe = Object.getOwnPropertySymbols;
var yt = Object.prototype.hasOwnProperty, kt = Object.prototype.propertyIsEnumerable;
var Ye = (A, e, t) => e in A ? bt(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t, Pe = (A, e) => {
  for (var t in e || (e = {}))
    yt.call(e, t) && Ye(A, t, e[t]);
  if (Oe)
    for (var t of Oe(e))
      kt.call(e, t) && Ye(A, t, e[t]);
  return A;
};
var fe = (A, e, t) => new Promise((n, s) => {
  var l = (c) => {
    try {
      o(t.next(c));
    } catch (r) {
      s(r);
    }
  }, i = (c) => {
    try {
      o(t.throw(c));
    } catch (r) {
      s(r);
    }
  }, o = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(l, i);
  o((t = t.apply(A, e)).next());
});
import { $ as Ne, b as Bt, a as Ct, S as Mt, i as Rt, s as Le, f as se, c as Ht, n as Xe, d as M, H as Me, h as R, j as a, k as f, y as H, l as m, m as Qt, o as Tt, p as zt, I as ct, w as X, t as ue, J as ft, K as ut, L as de, x as P, v as Je, e as Ee, g as Fe, B as Dt, q as Wt, M as dt, N as je, z as h, r as Ie, u as gt, O as ht, A as xe, P as Ge, C as Pt, D as Lt, E as jt, F as It, G as xt } from "./PrizeEngineSuite-CXW8m3Yx.js";
import "../stencil/ui-skeleton-xXZA3rYO.js";
const Ve = {
  en: {
    NoContent: "You don't have any lottery programs available now.",
    NoNext: `You don't have any spins available. Please check <a href="javascript:void(0)">Terms and Conditions</a>`,
    NoHistories: "No histories",
    Program: "Program",
    History: "History",
    ActiveTickets: "Active Tickets",
    ImplicitTickets: "Implicit Tickets",
    RemainingTimes: "Remaining Times",
    Retry: "Network is a bit busy now, please click OK to re-spin",
    ShowNext: "{name} will be available on<br /> <strong>{startTime}</strong> <br />Please wait till it is open.",
    DrawFailed: "The prize assignment may be failed, please contact customer support for more details",
    Timeout: "Network is a bit busy now, please try again later.",
    ErrorNetwork: "You are offline, please check your network settings",
    ErrorJSON: "Unexpected Data Response, please contact customer support",
    Congratulation: "Congratulations!",
    Continue: "Continue",
    NoPrizeTitle: "Not This Time!",
    NoPrize: "Don't Worry! Your turn might come next. Try Again!",
    Success: "You won a {prize}!",
    OK: "OK",
    Rewards: "Rewards",
    Status: "Status",
    Time: "Time",
    Loss: "OOPs! You are close to a prize!",
    Fulfilled: "Successful",
    Drawn: "Failed",
    Rules: "Rules",
    LuckyWheels: "Lucky Wheels",
    InfoTooltip: "Luckywheel tooltips",
    RulesDescription: "Lucky Wheel is a particularly interesting game, will bring you a lot of surprises; When you obtained the Lucky Wheel, means you got a chance to spin the Lucky Wheel, and if you are lucky, you can get the surprise prize.",
    Terms: "Terms&Conditions",
    PrizeAgenda: "Prize agenda",
    TournamentTicket: "Tournament ticket",
    FreeSpins: "Free spins",
    BonusMoney: "Bonus Money",
    LoyaltyPoints: "Loyalty Points&Coins",
    LuckyWheel: "LuckyWheel",
    CoinRoyale: "Coin Royale",
    MysteryChest: "Mystery Chest",
    CustomRewards: "Custom Rewards",
    Play: "Play",
    Spin: "Spin",
    FlipCoin: "Flip Coin",
    OpenChest: "Open Chest",
    AvailablePeriod: "Available Period",
    Recurrence: "Recurrence",
    TopRewards: "Top Rewards",
    AreYouSure: "Are you sure",
    RejectWarningText: "Once rejected, this prize will be lost<br/>and cannot be recovered.<br/>Please confirm your decision",
    KeepPrize: "No, I want to keep prize",
    RejectPrize: "Yes, I reject prize",
    Accept: "Accept",
    Reject: "Reject",
    RewardIssued: "Your reward has issued successfully",
    BackToGame: "Back to Game",
    Spins: "Spins",
    Every: "every",
    Minute: "minute",
    Minutes: "minutes",
    Day: "day",
    Days: "days",
    Week: "week",
    Weeks: "weeks",
    Month: "month",
    Months: "months",
    InThisPeriod: "in this period",
    From: "from",
    To: "to",
    EveryWeek: "every week",
    EachMonth: "of each month",
    Monday: "Monday",
    Tuesday: "Tuesday",
    Wednesday: "Wednesday",
    Thursday: "Thursday",
    Friday: "Friday",
    Saturday: "Saturday",
    Sunday: "Sunday"
  }
};
function Xt({ withLocale: A, translations: e }) {
  Ne.subscribe((t) => {
    t == null && (Ct.set(e), Ne.set(A));
  });
}
function Se(A, e) {
  Bt(A, e);
}
function Zt(A) {
  Ne.set(A);
}
const Nt = () => {
  Xt({ withLocale: "en", translations: {} }), Object.keys(Ve).forEach((A) => {
    Se(A, Ve[A]);
  });
};
if (typeof window != "undefined") {
  let A = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = A(customElements.define), import("./PrizeEngineChest-CGJl7oh3.js").then(({ default: e }) => {
    !customElements.get("prize-engine-chest") && customElements.define("prize-engine-chest", e.element);
  });
}
if (typeof window != "undefined") {
  let A = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = A(customElements.define), import("./PrizeEngineCoin-aVwTza41.js").then(({ default: e }) => {
    !customElements.get("prize-engine-coin") && customElements.define("prize-engine-coin", e.element);
  });
}
if (typeof window != "undefined") {
  let A = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = A(customElements.define), import("./PrizeEngineLuckywheel-Dt106xKR.js").then(({ default: e }) => {
    !customElements.get("prize-engine-luckywheel") && customElements.define("prize-engine-luckywheel", e.element);
  });
}
const St = "data:image/webp;base64, ", Jt = "data:image/webp;base64, ", Et = "data:image/webp;base64, ", Ft = "data:image/webp;base64, ", Ot = "data:image/webp;base64, ", Yt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAABCcAAAQnAEmzTo0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMVSURBVHgBbVTNThNRGD3fnSmYYNLizhVl4ZriC9AhcUFcWDYmbsQuiCsT0aioJJRogrJhacJC0MSwMsALMIUHsDQxYSeDCVspiWA7befz3Jm2AnGSm7k/3+85517Bf75F9fMOoikXjTzHkIO6OAgrnFcdNLaK8mjzso+cX5S0kk2h9ZHGeUNnOtY4MlzDRVjjP801DBpBG83xorwMur6mO3ml33MCqSg0r4h2Beo9kduDCtDYHDyUKc5lPAI+03z4CvTbFy3lLgSa1f2sC9dngWk6HjbQLjyTW+VOyb2qp2W6LGg95rRGu0EX2F7X2WwvkEG/z0oyHCesJNuHlF9SP2PPNA6hcbBVXeWeTQh7FgiiwRS344Sv9ehOhMami+aag7MZ/n3iMGLQrKZw4hloxUFTB3B2k7j4BD5HvPZa+O0NoL1BEsYitMdNC1qQOLP5VJLRWgunHtdVZssp+ivEbYhVDocwv2hGTEzQguMVpVSL+WExKeh9kxxK7a3ciDEpicdgraLGTant3zoEBHm30+NQF7O78mbHQI6ZKC/P9UjdmN7mgYM/pDxU0svew7QgXHgqEwvW6YOuUhoh2w6HDMJD6+PEo06iQvp3ACXl5p+4RJN9rXaDGBjLKiuUAIh6NCQfhcGKWEkzvSjZa93t97pbYFYC2ThwUd/heYGZM8wcOEiNFqVY69p+1RfHBDww7K9saZzT/XxH3ZkIMt+xGya4U8yYkViYFrNTf1WXY2ms6xx9lNqTPWPgrHFCEJ15G4RZfbY2wsL3BIaB9CfPgz7oKH33OEZctBmsxKsjUzxjDnfLLMp1Iq87QDtPx4plMSI2Z6R4RiaCJAlg23HQ5zFwlUlyV5D6Qck8YNJgUpY2Y4BTkCI3KHvN8n8c4qpnZYCeqhPwE2xangWccA/y7JgBvN4VKclwYBKD+A7143R5SbfHOhxq94qs6Ar33A3ECVFjB+OT8i5ImD73LfIZiXgNqKMsWeo+HZlEJ3XOwzTX9nkpU3fFe+eekQuBLtFfsHeOziNO/DaRYkqB/zU+bOXLPn8BG6xnv5+RMCQAAAAASUVORK5CYII=";
function Gt(A) {
  Ht(A, "svelte-1m851ap", `:host{display:block;height:100%;width:100%;flex-grow:1}.PrizeDetailsContent.svelte-1m851ap.svelte-1m851ap{width:100%;height:100%;display:flex;flex-direction:column;position:relative;overflow:hidden;font-family:var(--emw--font-family-primary, "Ubuntu", sans-serif);background:transparent}.ViewLayer.svelte-1m851ap.svelte-1m851ap{width:100%;height:100%;display:flex;flex-direction:column;background:transparent}.ViewLayer.hidden.svelte-1m851ap.svelte-1m851ap{visibility:hidden}.GameLayer.svelte-1m851ap.svelte-1m851ap{position:relative;z-index:1;padding:40px 80px;box-sizing:border-box}.GameLayer.Mobile.svelte-1m851ap.svelte-1m851ap{padding:0}.GameLayer.Mobile.svelte-1m851ap .Header.svelte-1m851ap{height:auto;padding:32px 36px}.GameLayer.Mobile.svelte-1m851ap .HeaderTitle.svelte-1m851ap{font-size:var(--emw--font-size-medium, 16px);font-weight:500;line-height:1}.GameLayer.Mobile.svelte-1m851ap .IconButton.svelte-1m851ap{width:24px;height:24px}.GameLayer.Mobile.svelte-1m851ap .GameComponentContainer.svelte-1m851ap{height:370px;flex-grow:0;padding-top:20px}.GameLayer.Mobile.svelte-1m851ap .InfoSection.svelte-1m851ap{height:196px;flex-grow:0;margin:0;padding:20px 0;justify-content:flex-start;box-sizing:border-box;gap:12px}.GameLayer.Mobile.svelte-1m851ap .ActionButton.svelte-1m851ap{width:170px;height:48px;font-size:16px;box-shadow:0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px 0px rgba(0, 0, 0, 0.3);gap:4px;margin-bottom:8px}.GameLayer.Mobile.svelte-1m851ap .ActionButton .ButtonBase.svelte-1m851ap{text-transform:capitalize}.GameLayer.Mobile.svelte-1m851ap .ActionButton .ButtonCross.svelte-1m851ap{font-size:12px}.GameLayer.Mobile.svelte-1m851ap .ActionButton .ButtonCount.svelte-1m851ap{font-size:14px}.GameLayer.Mobile.svelte-1m851ap .InfoItem.svelte-1m851ap{font-size:12px;color:#a9ccbd;gap:4px;margin-bottom:12px}.GameLayer.Mobile.svelte-1m851ap .RulesToggle.svelte-1m851ap{position:relative;bottom:auto;left:auto;transform:none;opacity:0.5;font-size:12px;padding:8px;margin-top:auto}.RulesLayer.svelte-1m851ap.svelte-1m851ap{position:absolute;inset:0;z-index:100;padding:40px 80px;box-sizing:border-box;display:flex;flex-direction:column}.RulesLayer.Mobile.svelte-1m851ap.svelte-1m851ap{padding:20px 28px}.RulesLayer.Mobile.svelte-1m851ap .Header.svelte-1m851ap{padding:12px 8px 24px}.RulesLayer.Mobile.svelte-1m851ap .IconButton.svelte-1m851ap{width:24px;height:24px}.RulesLayer.svelte-1m851ap .HeaderPlaceholder.svelte-1m851ap{width:30px}.MessageLayer.svelte-1m851ap.svelte-1m851ap{position:absolute;inset:0;z-index:100;background:var(--emw--color-gray-transparency-30, rgba(13, 27, 29, 0.92))}.LayerContent.svelte-1m851ap.svelte-1m851ap{flex-grow:1;overflow-y:auto;display:flex;flex-direction:column;padding:0 24px}.LayerContent.Center.svelte-1m851ap.svelte-1m851ap{justify-content:center;align-items:center;text-align:center}.Header.svelte-1m851ap.svelte-1m851ap{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 24px;flex-shrink:0;position:relative}.Header.svelte-1m851ap .HeaderTitle.svelte-1m851ap{color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-large, 22px);font-weight:700;text-align:center;flex-grow:1}.ViewWrapper.svelte-1m851ap.svelte-1m851ap{flex-grow:1;display:flex;flex-direction:column;overflow:hidden}.GameComponentContainer.svelte-1m851ap.svelte-1m851ap{flex-grow:1;display:flex;flex-direction:column;min-height:0;justify-content:center;align-items:center}.InfoSection.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;align-items:center;gap:16px;margin-top:16px;margin-bottom:48px;flex-shrink:0}.InfoItem.svelte-1m851ap.svelte-1m851ap{display:flex;align-items:center;gap:8px;color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-medium, 16px)}.SmallIcon.svelte-1m851ap.svelte-1m851ap{width:20px;height:20px;background-size:contain;background-repeat:no-repeat;background-position:center;display:flex;align-items:center;justify-content:center;color:var(--emw--color-secondary-variant, #729787)}.IconButton.svelte-1m851ap.svelte-1m851ap{width:30px;height:30px;border:0;cursor:pointer;background-color:transparent;background-size:100%;background-repeat:no-repeat;padding:0}.IconButton.Back.svelte-1m851ap.svelte-1m851ap{background:center/100% url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M10.3579 5.26604C10.0032 4.91132 9.42806 4.91132 9.07334 5.26604L5.26604 9.07334C4.91132 9.42806 4.91132 10.0032 5.26604 10.3579L9.07334 14.1652C9.42806 14.5199 10.0032 14.5199 10.3579 14.1652C10.7126 13.8105 10.7126 13.2354 10.3579 12.8806L8.10118 10.6239H10.7817C12.0761 10.6239 12.9922 10.6246 13.7085 10.6832C14.4142 10.7408 14.8455 10.85 15.1847 11.0229C15.8735 11.3738 16.4335 11.9338 16.7844 12.6226C16.9573 12.9618 17.0665 13.3931 17.1241 14.0989C17.1827 14.8151 17.1834 15.7312 17.1834 17.0256V18.0917C17.1834 18.5933 17.59 19 18.0917 19C18.5933 19 19 18.5933 19 18.0917V16.9854C19 15.74 19 14.7498 18.9347 13.9509C18.8679 13.1329 18.7281 12.4359 18.403 11.7978C17.8779 10.7673 17.04 9.92938 16.0095 9.40427C15.3714 9.07918 14.6744 8.9394 13.8564 8.87257C13.0575 8.80729 12.0673 8.8073 10.8219 8.8073H8.10118L10.3579 6.55059C10.7126 6.19587 10.7126 5.62076 10.3579 5.26604Z" fill="%23729787"/></svg>') no-repeat}.IconButton.Close.svelte-1m851ap.svelte-1m851ap{background-image:url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6 6 18M6 6l12 12" stroke="%23729787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.GameDescription.svelte-1m851ap.svelte-1m851ap{margin-bottom:32px;font-size:var(--emw--font-size-small, 14px);color:var(--emw--color-primary-variant, #a9ccbe);line-height:1.6}.TermsLink.svelte-1m851ap.svelte-1m851ap{display:inline-flex;align-items:center;gap:6px;background:linear-gradient(90deg, var(--emw--color-teal, #75ffe9) 0%, var(--emw--color-green, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;text-decoration:none;font-weight:700;margin-bottom:32px}.TermsLink.svelte-1m851ap .ExternalIcon.svelte-1m851ap{width:16px;height:16px;background:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M18 13V19C18 19.5304 17.7893 20.0391 17.4142 20.4142C17.0391 20.7893 16.5304 21 16 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V8C3 7.46957 3.21071 6.96086 3.58579 6.58579C3.96086 6.21071 4.46957 6 5 6H11M15 3H21M21 3V9M21 3L10 13" stroke="%2375FFE9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.DetailsGrid.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;gap:32px}.DetailItem.svelte-1m851ap.svelte-1m851ap{display:flex;gap:12px;align-items:flex-start}.DetailItem.svelte-1m851ap .Icon.svelte-1m851ap{width:20px;height:20px;flex-shrink:0}.DetailItem.svelte-1m851ap .Icon.History.svelte-1m851ap{background:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M12 8V12L15 14M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="%23ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.DetailItem.svelte-1m851ap .Icon.Cup.svelte-1m851ap{background:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M6 9H4.5C3.67157 9 3 8.32843 3 7.5V6.5C3 5.67157 3.67157 5 4.5 5H6M18 9H19.5C20.3284 9 21 8.32843 21 7.5V6.5C21 5.67157 20.3284 5 19.5 5H18M18 22H6M12 15V22M18 5V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V5H18Z" stroke="%23ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.DetailItem.svelte-1m851ap .DetailText strong.svelte-1m851ap{color:var(--emw--color-white, #ffffff);font-weight:700;font-size:var(--emw--font-size-small-plus, 15px);display:block;margin-bottom:4px}.DetailItem.svelte-1m851ap .DetailText span.svelte-1m851ap{color:var(--emw--color-secondary-variant, #a9ccbe);line-height:1.5}.RewardList.svelte-1m851ap.svelte-1m851ap{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.RewardItem.svelte-1m851ap.svelte-1m851ap{color:var(--emw--color-secondary-variant, #a9ccbe)}.RewardItem.svelte-1m851ap .RewardIcon.svelte-1m851ap{width:24px;height:24px;object-fit:contain}.ImageWrapper.svelte-1m851ap.svelte-1m851ap{position:relative;display:flex;justify-content:center;align-items:center;width:100px;height:100px;margin-bottom:24px}.ImageWrapper.svelte-1m851ap.svelte-1m851ap::before{content:"";position:absolute;width:160px;height:160px;background:radial-gradient(circle, var(--emw--color-teal-10, rgba(117, 255, 233, 0.1019607843)) 0%, transparent 50%);border-radius:50%;z-index:0;filter:blur(10px)}.ImageWrapper.svelte-1m851ap .GiftImage.svelte-1m851ap{height:100px;object-fit:contain;position:relative;z-index:1}.ViewDataContainer.svelte-1m851ap.svelte-1m851ap{display:grid;width:100%;min-height:200px;align-items:center;justify-items:center;transition:transform 0.4s cubic-bezier(0.4, 0, 0.2, 1)}.ViewDataContainer.shifted.svelte-1m851ap.svelte-1m851ap{transform:translateY(-16px)}.ViewDataContainer.svelte-1m851ap .ViewDataContent.svelte-1m851ap{grid-area:1/1;display:flex;flex-direction:column;align-items:center}.MessageTitle.svelte-1m851ap.svelte-1m851ap{font-size:var(--emw--size-medium-2x-minus, 32px);font-weight:700;margin:0 0 16px;color:var(--emw--color-white, white);line-height:1.2}.MessageText.svelte-1m851ap.svelte-1m851ap{font-size:var(--emw--font-size-medium, 16px);color:var(--emw--color-primary-variant, #a9ccbe);max-width:320px;line-height:1.5;margin:0 0 24px}.ButtonGroup.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;gap:16px;width:100%;align-items:center;margin-top:8px}.ButtonGroup.wide-buttons.svelte-1m851ap .ActionButton.svelte-1m851ap{width:280px}.ActionButton.svelte-1m851ap.svelte-1m851ap{cursor:pointer;height:60px;width:240px;border-radius:54px;font-weight:700;font-size:var(--emw--font-size-medium-plus, 18px);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);display:flex;align-items:center;justify-content:center;padding:0}.ActionButton.svelte-1m851ap .ButtonTextWrapper.svelte-1m851ap{display:grid;place-items:center}.ActionButton.svelte-1m851ap .ButtonTextWrapper span.svelte-1m851ap{grid-area:1/1}.ActionButton.primary.svelte-1m851ap.svelte-1m851ap{border:none;background:linear-gradient(90deg, var(--emw--color-teal, #75ffe9) 0%, var(--emw--color-green, #b2ff6d) 100%);color:var(--emw--color-background-secondary, #152b30)}.ActionButton.outline.svelte-1m851ap.svelte-1m851ap{background:transparent;border:1px solid var(--emw--color-teal, #75ffe9);color:var(--emw--color-white, white)}.ActionButton.svelte-1m851ap.svelte-1m851ap:disabled{opacity:0.5;cursor:not-allowed}.SkeletonWrapper.svelte-1m851ap.svelte-1m851ap{display:flex;flex-direction:column;align-items:center;width:100%;gap:32px}.SkeletonWrapper.svelte-1m851ap .SkeletonContent.svelte-1m851ap{display:flex;flex-direction:column;align-items:center;gap:24px;justify-content:center}.RulesToggle.svelte-1m851ap.svelte-1m851ap{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);background:transparent;border:none;color:var(--emw--color-secondary-variant, #729787);font-size:var(--emw--font-size-small, 14px);display:flex;align-items:center;gap:4px;cursor:pointer;padding:8px}.RulesToggle.svelte-1m851ap .ChevronUp.svelte-1m851ap{width:12px;height:12px;background-color:currentColor;mask:center/contain no-repeat url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 15L12 9L6 15" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>')}`);
}
function qe(A, e, t) {
  const n = A.slice();
  return n[57] = e[t], n;
}
function Ue(A, e, t) {
  const n = A.slice();
  return n[60] = e[t], n;
}
function Ke(A) {
  let e, t, n, s, l, i = (
    /*activeGame*/
    (A[9].program.name[
      /*lang*/
      A[2]
    ] || /*activeGame*/
    A[9].program.name["*"]) + ""
  ), o, c, r, d, w, b, v, C, O, V, L, K, ie = (
    /*$_*/
    A[15]("Rules") + ""
  ), me, ee, u, J, le, E, j;
  function T(y, x) {
    if (
      /*gameType*/
      y[14] === "wheelOfFortune"
    )
      return Ut;
    if (
      /*gameType*/
      y[14] === "flipCoin"
    )
      return qt;
    if (
      /*gameType*/
      y[14] === "mysteryChest"
    )
      return Vt;
  }
  let Z = T(A), D = Z && Z(A);
  function F(y, x) {
    return (
      /*gameType*/
      y[14] !== "wheelOfFortune" || /*themeIndex*/
      y[21] === 7 ? _t : Kt
    );
  }
  let Ae = F(A), N = Ae(A), I = (
    /*displayExpiry*/
    A[23] && _e(A)
  ), W = (
    /*showRulesOverlay*/
    A[18] && $e(A)
  );
  return {
    c() {
      e = f("div"), t = f("div"), n = f("button"), s = H(), l = f("div"), o = P(i), c = H(), r = f("button"), d = H(), w = f("div"), b = f("div"), D && D.c(), v = H(), C = f("div"), N.c(), O = H(), I && I.c(), V = H(), L = f("button"), K = f("span"), me = P(ie), ee = H(), u = f("span"), J = H(), W && W.c(), le = Je(), m(n, "type", "button"), m(n, "class", "IconButton Back svelte-1m851ap"), m(l, "class", "HeaderTitle svelte-1m851ap"), m(r, "type", "button"), m(r, "class", "IconButton Close svelte-1m851ap"), m(t, "class", "Header svelte-1m851ap"), m(b, "class", "GameComponentContainer svelte-1m851ap"), m(u, "class", "ChevronUp svelte-1m851ap"), m(L, "type", "button"), m(L, "class", "RulesToggle svelte-1m851ap"), m(C, "class", "InfoSection svelte-1m851ap"), m(w, "class", "ViewWrapper svelte-1m851ap"), m(e, "class", "ViewLayer GameLayer svelte-1m851ap"), ue(
        e,
        "Mobile",
        /*mobileView*/
        A[24]
      ), ue(
        e,
        "hidden",
        /*showRulesOverlay*/
        A[18] || /*isMessageShown*/
        A[11]
      );
    },
    m(y, x) {
      R(y, e, x), a(e, t), a(t, n), a(t, s), a(t, l), a(l, o), a(t, c), a(t, r), a(e, d), a(e, w), a(w, b), D && D.m(b, null), a(w, v), a(w, C), N.m(C, null), a(C, O), I && I.m(C, null), a(C, V), a(C, L), a(L, K), a(K, me), a(L, ee), a(L, u), R(y, J, x), W && W.m(y, x), R(y, le, x), E || (j = [
        de(
          n,
          "click",
          /*onBack*/
          A[29]
        ),
        de(
          r,
          "click",
          /*onClose*/
          A[30]
        ),
        de(
          L,
          "click",
          /*click_handler*/
          A[37]
        )
      ], E = !0);
    },
    p(y, x) {
      x[0] & /*activeGame, lang*/
      516 && i !== (i = /*activeGame*/
      (y[9].program.name[
        /*lang*/
        y[2]
      ] || /*activeGame*/
      y[9].program.name["*"]) + "") && X(o, i), Z === (Z = T(y)) && D ? D.p(y, x) : (D && D.d(1), D = Z && Z(y), D && (D.c(), D.m(b, null))), Ae === (Ae = F(y)) && N ? N.p(y, x) : (N.d(1), N = Ae(y), N && (N.c(), N.m(C, O))), /*displayExpiry*/
      y[23] ? I ? I.p(y, x) : (I = _e(y), I.c(), I.m(C, V)) : I && (I.d(1), I = null), x[0] & /*$_*/
      32768 && ie !== (ie = /*$_*/
      y[15]("Rules") + "") && X(me, ie), x[0] & /*showRulesOverlay, isMessageShown*/
      264192 && ue(
        e,
        "hidden",
        /*showRulesOverlay*/
        y[18] || /*isMessageShown*/
        y[11]
      ), /*showRulesOverlay*/
      y[18] ? W ? (W.p(y, x), x[0] & /*showRulesOverlay*/
      262144 && Me(W, 1)) : (W = $e(y), W.c(), Me(W, 1), W.m(le.parentNode, le)) : W && (ht(), ft(W, 1, 1, () => {
        W = null;
      }), ut());
    },
    d(y) {
      y && (M(e), M(J), M(le)), D && D.d(), N.d(), I && I.d(), W && W.d(y), E = !1, ct(j);
    }
  };
}
function Vt(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-chest"), h(
        e,
        "data",
        /*activeGame*/
        A[9]
      ), h(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), h(
        e,
        "session",
        /*session*/
        A[1]
      ), h(
        e,
        "lang",
        /*lang*/
        A[2]
      ), h(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), h(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), h(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), h(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      512 && h(
        e,
        "data",
        /*activeGame*/
        t[9]
      ), n[0] & /*endpoint*/
      1 && h(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && h(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && h(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && h(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && h(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && h(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function qt(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-coin"), h(
        e,
        "data",
        /*activeGame*/
        A[9]
      ), h(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), h(
        e,
        "session",
        /*session*/
        A[1]
      ), h(
        e,
        "lang",
        /*lang*/
        A[2]
      ), h(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), h(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), h(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), h(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      512 && h(
        e,
        "data",
        /*activeGame*/
        t[9]
      ), n[0] & /*endpoint*/
      1 && h(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && h(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && h(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && h(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && h(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && h(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function Ut(A) {
  let e;
  return {
    c() {
      e = f("prize-engine-luckywheel"), h(
        e,
        "data",
        /*activeGame*/
        A[9]
      ), h(
        e,
        "endpoint",
        /*endpoint*/
        A[0]
      ), h(
        e,
        "session",
        /*session*/
        A[1]
      ), h(
        e,
        "lang",
        /*lang*/
        A[2]
      ), h(
        e,
        "clientstyling",
        /*clientstyling*/
        A[3]
      ), h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        A[4]
      ), h(
        e,
        "translationurl",
        /*translationurl*/
        A[5]
      ), h(
        e,
        "mbsource",
        /*mbsource*/
        A[6]
      ), h(
        e,
        "size",
        /*luckywheelsize*/
        A[7]
      ), h(
        e,
        "mobilesize",
        /*luckywheelmobilesize*/
        A[8]
      ), h(e, "isdrawer", "false");
    },
    m(t, n) {
      R(t, e, n);
    },
    p(t, n) {
      n[0] & /*activeGame*/
      512 && h(
        e,
        "data",
        /*activeGame*/
        t[9]
      ), n[0] & /*endpoint*/
      1 && h(
        e,
        "endpoint",
        /*endpoint*/
        t[0]
      ), n[0] & /*session*/
      2 && h(
        e,
        "session",
        /*session*/
        t[1]
      ), n[0] & /*lang*/
      4 && h(
        e,
        "lang",
        /*lang*/
        t[2]
      ), n[0] & /*clientstyling*/
      8 && h(
        e,
        "clientstyling",
        /*clientstyling*/
        t[3]
      ), n[0] & /*clientstylingurl*/
      16 && h(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[4]
      ), n[0] & /*translationurl*/
      32 && h(
        e,
        "translationurl",
        /*translationurl*/
        t[5]
      ), n[0] & /*mbsource*/
      64 && h(
        e,
        "mbsource",
        /*mbsource*/
        t[6]
      ), n[0] & /*luckywheelsize*/
      128 && h(
        e,
        "size",
        /*luckywheelsize*/
        t[7]
      ), n[0] & /*luckywheelmobilesize*/
      256 && h(
        e,
        "mobilesize",
        /*luckywheelmobilesize*/
        t[8]
      );
    },
    d(t) {
      t && M(e);
    }
  };
}
function Kt(A) {
  let e, t, n = (
    /*$_*/
    A[15]("RemainingTimes") + ""
  ), s, l, i, o, c, r, d = (
    /*activeGame*/
    A[9].current.remainingTimes + ""
  ), w;
  return {
    c() {
      e = f("div"), t = f("span"), s = P(n), l = P(":"), i = H(), o = f("span"), o.innerHTML = `<img src="${Yt}" alt="Key"/>`, c = H(), r = f("span"), w = P(d), m(o, "class", "SmallIcon svelte-1m851ap"), m(e, "class", "InfoItem svelte-1m851ap");
    },
    m(b, v) {
      R(b, e, v), a(e, t), a(t, s), a(t, l), a(e, i), a(e, o), a(e, c), a(e, r), a(r, w);
    },
    p(b, v) {
      v[0] & /*$_*/
      32768 && n !== (n = /*$_*/
      b[15]("RemainingTimes") + "") && X(s, n), v[0] & /*activeGame*/
      512 && d !== (d = /*activeGame*/
      b[9].current.remainingTimes + "") && X(w, d);
    },
    d(b) {
      b && M(e);
    }
  };
}
function _t(A) {
  let e, t, n = (
    /*buttonTextParts*/
    A[19].base + ""
  ), s, l, i, o, c, r = (
    /*buttonTextParts*/
    A[19].count + ""
  ), d, w, b, v;
  return {
    c() {
      var C;
      e = f("button"), t = f("span"), s = P(n), l = H(), i = f("span"), i.textContent = "×", o = H(), c = f("span"), d = P(r), m(t, "class", "ButtonBase svelte-1m851ap"), m(i, "class", "ButtonCross svelte-1m851ap"), m(c, "class", "ButtonCount svelte-1m851ap"), m(e, "type", "button"), m(e, "class", "ActionButton primary svelte-1m851ap"), e.disabled = w = /*isDrawing*/
      A[17] || !/*activeGame*/
      ((C = A[9].current) != null && C.remainingTimes);
    },
    m(C, O) {
      R(C, e, O), a(e, t), a(t, s), a(e, l), a(e, i), a(e, o), a(e, c), a(c, d), b || (v = de(
        e,
        "click",
        /*performDraw*/
        A[27]
      ), b = !0);
    },
    p(C, O) {
      var V;
      O[0] & /*buttonTextParts*/
      524288 && n !== (n = /*buttonTextParts*/
      C[19].base + "") && X(s, n), O[0] & /*buttonTextParts*/
      524288 && r !== (r = /*buttonTextParts*/
      C[19].count + "") && X(d, r), O[0] & /*isDrawing, activeGame*/
      131584 && w !== (w = /*isDrawing*/
      C[17] || !/*activeGame*/
      ((V = C[9].current) != null && V.remainingTimes)) && (e.disabled = w);
    },
    d(C) {
      C && M(e), b = !1, v();
    }
  };
}
function _e(A) {
  let e, t, n, s, l;
  return {
    c() {
      e = f("div"), t = f("span"), t.innerHTML = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="14" r="7" stroke="currentColor" stroke-width="1.5"></circle><path d="M12 11V14L14 16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M12 4V7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9 4H15" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17 7L18 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7 7L6 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>', n = H(), s = f("span"), l = P(
        /*displayExpiry*/
        A[23]
      ), m(t, "class", "SmallIcon Timer svelte-1m851ap"), m(e, "class", "InfoItem svelte-1m851ap");
    },
    m(i, o) {
      R(i, e, o), a(e, t), a(e, n), a(e, s), a(s, l);
    },
    p(i, o) {
      o[0] & /*displayExpiry*/
      8388608 && X(
        l,
        /*displayExpiry*/
        i[23]
      );
    },
    d(i) {
      i && M(e);
    }
  };
}
function $e(A) {
  var Re, He, Qe, Te, ze, De;
  let e, t, n, s, l, i = (
    /*$_*/
    A[15]("Rules") + ""
  ), o, c, r, d, w, b, v = (
    /*$_*/
    A[15]("RulesDescription") + ""
  ), C, O, V, L, K, ie, me, ee, u, J = (
    /*$_*/
    A[15]("AvailablePeriod") + ""
  ), le, E, j, T = (
    /*formatDateTime*/
    A[31](
      /*activeGame*/
      (Re = A[9].program.trigger) == null ? void 0 : Re.startTime
    ) + ""
  ), Z, D, F = (
    /*formatDateTime*/
    A[31](
      /*activeGame*/
      (He = A[9].program.trigger) == null ? void 0 : He.endTime
    ) + ""
  ), Ae, N, I, W, y, x, oe, be, ye = (
    /*$_*/
    A[15]("TopRewards") + ""
  ), q, ge, he, we, ce, _, ke, ve, Y = (
    /*effectiveTermsUrl*/
    A[22] && et(A)
  ), G = (
    /*activeGame*/
    ((ze = (Te = (Qe = A[9]) == null ? void 0 : Qe.program) == null ? void 0 : Te.trigger) == null ? void 0 : ze.periods) && tt(A)
  ), S = (
    /*activeGame*/
    ((De = A[9].program.wheelOfFortune) == null ? void 0 : De.partitions) && nt(A)
  );
  return {
    c() {
      e = f("div"), t = f("div"), n = f("div"), s = H(), l = f("div"), o = P(i), c = H(), r = f("button"), d = H(), w = f("div"), b = f("div"), C = P(v), O = H(), Y && Y.c(), V = H(), L = f("div"), K = f("div"), ie = f("span"), me = H(), ee = f("div"), u = f("strong"), le = P(J), E = H(), j = f("span"), Z = P(T), D = P(" ~ "), Ae = P(F), N = H(), G && G.c(), I = H(), W = f("div"), y = f("span"), x = H(), oe = f("div"), be = f("strong"), q = P(ye), ge = H(), he = f("span"), S && S.c(), m(n, "class", "HeaderPlaceholder svelte-1m851ap"), m(l, "class", "HeaderTitle svelte-1m851ap"), m(r, "type", "button"), m(r, "class", "IconButton Close svelte-1m851ap"), m(t, "class", "Header svelte-1m851ap"), m(b, "class", "GameDescription svelte-1m851ap"), m(ie, "class", "Icon History svelte-1m851ap"), m(u, "class", "svelte-1m851ap"), m(j, "class", "svelte-1m851ap"), m(ee, "class", "DetailText"), m(K, "class", "DetailItem svelte-1m851ap"), m(y, "class", "Icon Cup svelte-1m851ap"), m(be, "class", "svelte-1m851ap"), m(he, "class", "RewardList svelte-1m851ap"), m(oe, "class", "DetailText"), m(W, "class", "DetailItem Rewards svelte-1m851ap"), m(L, "class", "DetailsGrid svelte-1m851ap"), m(w, "class", "LayerContent svelte-1m851ap"), m(e, "class", "ViewLayer RulesLayer svelte-1m851ap"), ue(
        e,
        "Mobile",
        /*mobileView*/
        A[24]
      );
    },
    m(z, te) {
      R(z, e, te), a(e, t), a(t, n), a(t, s), a(t, l), a(l, o), a(t, c), a(t, r), a(e, d), a(e, w), a(w, b), a(b, C), a(w, O), Y && Y.m(w, null), a(w, V), a(w, L), a(L, K), a(K, ie), a(K, me), a(K, ee), a(ee, u), a(u, le), a(ee, E), a(ee, j), a(j, Z), a(j, D), a(j, Ae), a(L, N), G && G.m(L, null), a(L, I), a(L, W), a(W, y), a(W, x), a(W, oe), a(oe, be), a(be, q), a(oe, ge), a(oe, he), S && S.m(he, null), _ = !0, ke || (ve = de(
        r,
        "click",
        /*click_handler_1*/
        A[38]
      ), ke = !0);
    },
    p(z, te) {
      var We, p, g, Q, k, B;
      (!_ || te[0] & /*$_*/
      32768) && i !== (i = /*$_*/
      z[15]("Rules") + "") && X(o, i), (!_ || te[0] & /*$_*/
      32768) && v !== (v = /*$_*/
      z[15]("RulesDescription") + "") && X(C, v), /*effectiveTermsUrl*/
      z[22] ? Y ? Y.p(z, te) : (Y = et(z), Y.c(), Y.m(w, V)) : Y && (Y.d(1), Y = null), (!_ || te[0] & /*$_*/
      32768) && J !== (J = /*$_*/
      z[15]("AvailablePeriod") + "") && X(le, J), (!_ || te[0] & /*activeGame*/
      512) && T !== (T = /*formatDateTime*/
      z[31](
        /*activeGame*/
        (We = z[9].program.trigger) == null ? void 0 : We.startTime
      ) + "") && X(Z, T), (!_ || te[0] & /*activeGame*/
      512) && F !== (F = /*formatDateTime*/
      z[31](
        /*activeGame*/
        (p = z[9].program.trigger) == null ? void 0 : p.endTime
      ) + "") && X(Ae, F), /*activeGame*/
      (k = (Q = (g = z[9]) == null ? void 0 : g.program) == null ? void 0 : Q.trigger) != null && k.periods ? G ? G.p(z, te) : (G = tt(z), G.c(), G.m(L, I)) : G && (G.d(1), G = null), (!_ || te[0] & /*$_*/
      32768) && ye !== (ye = /*$_*/
      z[15]("TopRewards") + "") && X(q, ye), /*activeGame*/
      (B = z[9].program.wheelOfFortune) != null && B.partitions ? S ? S.p(z, te) : (S = nt(z), S.c(), S.m(he, null)) : S && (S.d(1), S = null);
    },
    i(z) {
      _ || (z && Ee(() => {
        _ && (ce && ce.end(1), we = Fe(e, je, { y: "100%", duration: 400 }), we.start());
      }), _ = !0);
    },
    o(z) {
      we && we.invalidate(), z && (ce = dt(e, je, { y: "100%", duration: 400 })), _ = !1;
    },
    d(z) {
      z && M(e), Y && Y.d(), G && G.d(), S && S.d(), z && ce && ce.end(), ke = !1, ve();
    }
  };
}
function et(A) {
  let e, t, n = (
    /*$_*/
    A[15]("Terms") + ""
  ), s, l, i;
  return {
    c() {
      e = f("a"), t = f("span"), s = P(n), l = H(), i = f("span"), m(i, "class", "ExternalIcon svelte-1m851ap"), m(e, "class", "TermsLink svelte-1m851ap"), m(
        e,
        "href",
        /*effectiveTermsUrl*/
        A[22]
      ), m(e, "target", "_blank");
    },
    m(o, c) {
      R(o, e, c), a(e, t), a(t, s), a(e, l), a(e, i);
    },
    p(o, c) {
      c[0] & /*$_*/
      32768 && n !== (n = /*$_*/
      o[15]("Terms") + "") && X(s, n), c[0] & /*effectiveTermsUrl*/
      4194304 && m(
        e,
        "href",
        /*effectiveTermsUrl*/
        o[22]
      );
    },
    d(o) {
      o && M(e);
    }
  };
}
function tt(A) {
  let e, t = Ie(
    /*activeGame*/
    A[9].program.trigger.periods
  ), n = [];
  for (let s = 0; s < t.length; s += 1)
    n[s] = At(Ue(A, t, s));
  return {
    c() {
      for (let s = 0; s < n.length; s += 1)
        n[s].c();
      e = Je();
    },
    m(s, l) {
      for (let i = 0; i < n.length; i += 1)
        n[i] && n[i].m(s, l);
      R(s, e, l);
    },
    p(s, l) {
      if (l[0] & /*getRecurrenceText, activeGame, $_*/
      33587712) {
        t = Ie(
          /*activeGame*/
          s[9].program.trigger.periods
        );
        let i;
        for (i = 0; i < t.length; i += 1) {
          const o = Ue(s, t, i);
          n[i] ? n[i].p(o, l) : (n[i] = At(o), n[i].c(), n[i].m(e.parentNode, e));
        }
        for (; i < n.length; i += 1)
          n[i].d(1);
        n.length = t.length;
      }
    },
    d(s) {
      s && M(e), gt(n, s);
    }
  };
}
function At(A) {
  let e, t, n, s, l, i = (
    /*$_*/
    A[15]("Recurrence") + ""
  ), o, c, r, d = (
    /*getRecurrenceText*/
    A[25](
      /*period*/
      A[60]
    ) + ""
  ), w, b;
  return {
    c() {
      e = f("div"), t = f("span"), n = H(), s = f("div"), l = f("strong"), o = P(i), c = H(), r = f("span"), w = P(d), b = H(), m(t, "class", "Icon History svelte-1m851ap"), m(l, "class", "svelte-1m851ap"), m(r, "class", "svelte-1m851ap"), m(s, "class", "DetailText"), m(e, "class", "DetailItem svelte-1m851ap");
    },
    m(v, C) {
      R(v, e, C), a(e, t), a(e, n), a(e, s), a(s, l), a(l, o), a(s, c), a(s, r), a(r, w), a(e, b);
    },
    p(v, C) {
      C[0] & /*$_*/
      32768 && i !== (i = /*$_*/
      v[15]("Recurrence") + "") && X(o, i), C[0] & /*activeGame*/
      512 && d !== (d = /*getRecurrenceText*/
      v[25](
        /*period*/
        v[60]
      ) + "") && X(w, d);
    },
    d(v) {
      v && M(e);
    }
  };
}
function nt(A) {
  let e, t = Ie(
    /*activeGame*/
    A[9].program.wheelOfFortune.partitions
  ), n = [];
  for (let s = 0; s < t.length; s += 1)
    n[s] = st(qe(A, t, s));
  return {
    c() {
      for (let s = 0; s < n.length; s += 1)
        n[s].c();
      e = Je();
    },
    m(s, l) {
      for (let i = 0; i < n.length; i += 1)
        n[i] && n[i].m(s, l);
      R(s, e, l);
    },
    p(s, l) {
      if (l[0] & /*activeGame, lang*/
      516) {
        t = Ie(
          /*activeGame*/
          s[9].program.wheelOfFortune.partitions
        );
        let i;
        for (i = 0; i < t.length; i += 1) {
          const o = qe(s, t, i);
          n[i] ? n[i].p(o, l) : (n[i] = st(o), n[i].c(), n[i].m(e.parentNode, e));
        }
        for (; i < n.length; i += 1)
          n[i].d(1);
        n.length = t.length;
      }
    },
    d(s) {
      s && M(e), gt(n, s);
    }
  };
}
function $t(A) {
  let e, t;
  return {
    c() {
      e = f("img"), m(e, "class", "RewardIcon svelte-1m851ap"), xe(e.src, t = /*partition*/
      A[57].image1[
        /*lang*/
        A[2]
      ] || /*partition*/
      A[57].image1["*"]) || m(e, "src", t), m(e, "alt", "");
    },
    m(n, s) {
      R(n, e, s);
    },
    p(n, s) {
      s[0] & /*activeGame, lang*/
      516 && !xe(e.src, t = /*partition*/
      n[57].image1[
        /*lang*/
        n[2]
      ] || /*partition*/
      n[57].image1["*"]) && m(e, "src", t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function eA(A) {
  let e, t = (
    /*partition*/
    (A[57].name[
      /*lang*/
      A[2]
    ] || /*partition*/
    A[57].name["*"]) + ""
  ), n;
  return {
    c() {
      e = f("span"), n = P(t), m(e, "class", "svelte-1m851ap");
    },
    m(s, l) {
      R(s, e, l), a(e, n);
    },
    p(s, l) {
      l[0] & /*activeGame, lang*/
      516 && t !== (t = /*partition*/
      (s[57].name[
        /*lang*/
        s[2]
      ] || /*partition*/
      s[57].name["*"]) + "") && X(n, t);
    },
    d(s) {
      s && M(e);
    }
  };
}
function st(A) {
  let e, t;
  function n(i, o) {
    if (
      /*partition*/
      i[57].name[
        /*lang*/
        i[2]
      ] || /*partition*/
      i[57].name["*"]
    )
      return eA;
    if (
      /*partition*/
      i[57].image1
    )
      return $t;
  }
  let s = n(A), l = s && s(A);
  return {
    c() {
      e = f("span"), l && l.c(), t = H(), m(e, "class", "RewardItem svelte-1m851ap");
    },
    m(i, o) {
      R(i, e, o), l && l.m(e, null), a(e, t);
    },
    p(i, o) {
      s === (s = n(i)) && l ? l.p(i, o) : (l && l.d(1), l = s && s(i), l && (l.c(), l.m(e, t)));
    },
    d(i) {
      i && M(e), l && l.d();
    }
  };
}
function it(A) {
  let e, t, n;
  function s(o, c) {
    if (
      /*internalLoading*/
      o[16]
    )
      return AA;
    if (
      /*viewData*/
      o[20]
    )
      return tA;
  }
  let l = s(A), i = l && l(A);
  return {
    c() {
      e = f("div"), t = f("div"), i && i.c(), m(t, "class", "LayerContent Center svelte-1m851ap"), m(e, "class", "ViewLayer MessageLayer svelte-1m851ap");
    },
    m(o, c) {
      R(o, e, c), a(e, t), i && i.m(t, null);
    },
    p(o, c) {
      l === (l = s(o)) && i ? i.p(o, c) : (i && i.d(1), i = l && l(o), i && (i.c(), i.m(t, null)));
    },
    i(o) {
      o && (n || Ee(() => {
        n = Fe(e, Dt, { duration: 250 }), n.start();
      }));
    },
    o: Xe,
    d(o) {
      o && M(e), i && i.d();
    }
  };
}
function tA(A) {
  let e, t = (
    /*viewData*/
    A[20].key
  ), n, s, l = ot(A);
  function i(r, d) {
    return (
      /*messageMode*/
      r[12] === "gift" ? sA : nA
    );
  }
  let o = i(A), c = o(A);
  return {
    c() {
      e = f("div"), l.c(), n = H(), s = f("div"), c.c(), m(e, "class", "ViewDataContainer svelte-1m851ap"), ue(
        e,
        "shifted",
        /*internalMode*/
        A[13] === "confirmReject"
      ), m(s, "class", "ButtonGroup svelte-1m851ap"), ue(
        s,
        "wide-buttons",
        /*internalMode*/
        A[13] === "confirmReject"
      );
    },
    m(r, d) {
      R(r, e, d), l.m(e, null), R(r, n, d), R(r, s, d), c.m(s, null);
    },
    p(r, d) {
      d[0] & /*viewData*/
      1048576 && Le(t, t = /*viewData*/
      r[20].key) ? (ht(), ft(l, 1, 1, Xe), ut(), l = ot(r), l.c(), Me(l, 1), l.m(e, null)) : l.p(r, d), d[0] & /*internalMode*/
      8192 && ue(
        e,
        "shifted",
        /*internalMode*/
        r[13] === "confirmReject"
      ), o === (o = i(r)) && c ? c.p(r, d) : (c.d(1), c = o(r), c && (c.c(), c.m(s, null))), d[0] & /*internalMode*/
      8192 && ue(
        s,
        "wide-buttons",
        /*internalMode*/
        r[13] === "confirmReject"
      );
    },
    d(r) {
      r && (M(e), M(n), M(s)), l.d(r), c.d();
    }
  };
}
function AA(A) {
  let e;
  return {
    c() {
      e = f("div"), e.innerHTML = '<div class="SkeletonContent svelte-1m851ap"><ui-skeleton structure="rectangle" width="100px" height="100px" border-radius="20px"></ui-skeleton> <ui-skeleton structure="text" width="240px" height="24px"></ui-skeleton></div> <div class="SkeletonFooter"><ui-skeleton structure="rectangle" width="240px" height="60px" border-radius="54px"></ui-skeleton></div>', m(e, "class", "SkeletonWrapper svelte-1m851ap");
    },
    m(t, n) {
      R(t, e, n);
    },
    p: Xe,
    d(t) {
      t && M(e);
    }
  };
}
function lt(A) {
  let e, t, n;
  return {
    c() {
      e = f("div"), t = f("img"), xe(t.src, n = /*viewData*/
      A[20].image) || m(t, "src", n), m(t, "alt", ""), m(t, "class", "GiftImage svelte-1m851ap"), m(e, "class", "ImageWrapper svelte-1m851ap");
    },
    m(s, l) {
      R(s, e, l), a(e, t);
    },
    p(s, l) {
      l[0] & /*viewData*/
      1048576 && !xe(t.src, n = /*viewData*/
      s[20].image) && m(t, "src", n);
    },
    d(s) {
      s && M(e);
    }
  };
}
function rt(A) {
  let e, t = (
    /*viewData*/
    A[20].title + ""
  );
  return {
    c() {
      e = f("p"), m(e, "class", "MessageTitle svelte-1m851ap");
    },
    m(n, s) {
      R(n, e, s), e.innerHTML = t;
    },
    p(n, s) {
      s[0] & /*viewData*/
      1048576 && t !== (t = /*viewData*/
      n[20].title + "") && (e.innerHTML = t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function at(A) {
  let e, t = (
    /*viewData*/
    A[20].text + ""
  );
  return {
    c() {
      e = f("p"), m(e, "class", "MessageText svelte-1m851ap");
    },
    m(n, s) {
      R(n, e, s), e.innerHTML = t;
    },
    p(n, s) {
      s[0] & /*viewData*/
      1048576 && t !== (t = /*viewData*/
      n[20].text + "") && (e.innerHTML = t);
    },
    d(n) {
      n && M(e);
    }
  };
}
function ot(A) {
  let e, t, n, s, l, i, o = (
    /*viewData*/
    A[20].image && lt(A)
  ), c = (
    /*viewData*/
    A[20].title && rt(A)
  ), r = (
    /*viewData*/
    A[20].text && at(A)
  );
  return {
    c() {
      e = f("div"), o && o.c(), t = H(), c && c.c(), n = H(), r && r.c(), m(e, "class", "ViewDataContent svelte-1m851ap");
    },
    m(d, w) {
      R(d, e, w), o && o.m(e, null), a(e, t), c && c.m(e, null), a(e, n), r && r.m(e, null), i = !0;
    },
    p(d, w) {
      A = d, /*viewData*/
      A[20].image ? o ? o.p(A, w) : (o = lt(A), o.c(), o.m(e, t)) : o && (o.d(1), o = null), /*viewData*/
      A[20].title ? c ? c.p(A, w) : (c = rt(A), c.c(), c.m(e, n)) : c && (c.d(1), c = null), /*viewData*/
      A[20].text ? r ? r.p(A, w) : (r = at(A), r.c(), r.m(e, null)) : r && (r.d(1), r = null);
    },
    i(d) {
      i || (d && Ee(() => {
        i && (l && l.end(1), s = Fe(e, je, {
          y: (
            /*internalMode*/
            A[13] === "confirmReject" ? 10 : -10
          ),
          duration: 300,
          delay: 100
        }), s.start());
      }), i = !0);
    },
    o(d) {
      s && s.invalidate(), d && (l = dt(e, je, {
        y: (
          /*internalMode*/
          A[13] === "confirmReject" ? -10 : 10
        ),
        duration: 150
      })), i = !1;
    },
    d(d) {
      d && M(e), o && o.d(), c && c.d(), r && r.d(), d && l && l.end();
    }
  };
}
function nA(A) {
  let e, t, n;
  function s(o, c) {
    return (
      /*messageMode*/
      o[12] === "success" ? rA : (
        /*messageMode*/
        o[12] === "noprize" ? lA : iA
      )
    );
  }
  let l = s(A), i = l(A);
  return {
    c() {
      e = f("button"), i.c(), m(e, "type", "button"), m(e, "class", "ActionButton primary svelte-1m851ap");
    },
    m(o, c) {
      R(o, e, c), i.m(e, null), t || (n = de(
        e,
        "click",
        /*click_handler_6*/
        A[43]
      ), t = !0);
    },
    p(o, c) {
      l === (l = s(o)) && i ? i.p(o, c) : (i.d(1), i = l(o), i && (i.c(), i.m(e, null)));
    },
    d(o) {
      o && M(e), i.d(), t = !1, n();
    }
  };
}
function sA(A) {
  let e, t, n = (
    /*internalMode*/
    A[13]
  ), s, l, i, o = (
    /*internalMode*/
    A[13]
  ), c, r, d = pt(A), w = mt(A);
  return {
    c() {
      e = f("button"), t = f("div"), d.c(), s = H(), l = f("button"), i = f("div"), w.c(), m(t, "class", "ButtonTextWrapper svelte-1m851ap"), m(e, "type", "button"), m(e, "class", "ActionButton primary svelte-1m851ap"), e.disabled = /*internalLoading*/
      A[16], m(i, "class", "ButtonTextWrapper svelte-1m851ap"), m(l, "type", "button"), m(l, "class", "ActionButton outline svelte-1m851ap"), l.disabled = /*internalLoading*/
      A[16];
    },
    m(b, v) {
      R(b, e, v), a(e, t), d.m(t, null), R(b, s, v), R(b, l, v), a(l, i), w.m(i, null), c || (r = [
        de(e, "click", function() {
          Ge(
            /*internalMode*/
            A[13] === "confirmReject" ? (
              /*click_handler_2*/
              A[39]
            ) : (
              /*click_handler_3*/
              A[40]
            )
          ) && /*internalMode*/
          (A[13] === "confirmReject" ? (
            /*click_handler_2*/
            A[39]
          ) : (
            /*click_handler_3*/
            A[40]
          )).apply(this, arguments);
        }),
        de(l, "click", function() {
          Ge(
            /*internalMode*/
            A[13] === "confirmReject" ? (
              /*click_handler_4*/
              A[41]
            ) : (
              /*click_handler_5*/
              A[42]
            )
          ) && /*internalMode*/
          (A[13] === "confirmReject" ? (
            /*click_handler_4*/
            A[41]
          ) : (
            /*click_handler_5*/
            A[42]
          )).apply(this, arguments);
        })
      ], c = !0);
    },
    p(b, v) {
      A = b, v[0] & /*internalMode*/
      8192 && Le(n, n = /*internalMode*/
      A[13]) ? (d.d(1), d = pt(A), d.c(), d.m(t, null)) : d.p(A, v), v[0] & /*internalLoading*/
      65536 && (e.disabled = /*internalLoading*/
      A[16]), v[0] & /*internalMode*/
      8192 && Le(o, o = /*internalMode*/
      A[13]) ? (w.d(1), w = mt(A), w.c(), w.m(i, null)) : w.p(A, v), v[0] & /*internalLoading*/
      65536 && (l.disabled = /*internalLoading*/
      A[16]);
    },
    d(b) {
      b && (M(e), M(s), M(l)), d.d(b), w.d(b), c = !1, ct(r);
    }
  };
}
function iA(A) {
  let e = (
    /*$_*/
    A[15]("OK") + ""
  ), t;
  return {
    c() {
      t = P(e);
    },
    m(n, s) {
      R(n, t, s);
    },
    p(n, s) {
      s[0] & /*$_*/
      32768 && e !== (e = /*$_*/
      n[15]("OK") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function lA(A) {
  let e = (
    /*$_*/
    A[15]("Continue") + ""
  ), t;
  return {
    c() {
      t = P(e);
    },
    m(n, s) {
      R(n, t, s);
    },
    p(n, s) {
      s[0] & /*$_*/
      32768 && e !== (e = /*$_*/
      n[15]("Continue") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function rA(A) {
  let e = (
    /*$_*/
    A[15]("BackToGame") + ""
  ), t;
  return {
    c() {
      t = P(e);
    },
    m(n, s) {
      R(n, t, s);
    },
    p(n, s) {
      s[0] & /*$_*/
      32768 && e !== (e = /*$_*/
      n[15]("BackToGame") + "") && X(t, e);
    },
    d(n) {
      n && M(t);
    }
  };
}
function pt(A) {
  let e, t = (
    /*internalMode*/
    (A[13] === "confirmReject" ? (
      /*$_*/
      A[15]("KeepPrize")
    ) : (
      /*$_*/
      A[15]("Accept")
    )) + ""
  ), n;
  return {
    c() {
      e = f("span"), n = P(t), m(e, "class", "svelte-1m851ap");
    },
    m(s, l) {
      R(s, e, l), a(e, n);
    },
    p(s, l) {
      l[0] & /*internalMode, $_*/
      40960 && t !== (t = /*internalMode*/
      (s[13] === "confirmReject" ? (
        /*$_*/
        s[15]("KeepPrize")
      ) : (
        /*$_*/
        s[15]("Accept")
      )) + "") && X(n, t);
    },
    d(s) {
      s && M(e);
    }
  };
}
function mt(A) {
  let e, t = (
    /*internalMode*/
    (A[13] === "confirmReject" ? (
      /*$_*/
      A[15]("RejectPrize")
    ) : (
      /*$_*/
      A[15]("Reject")
    )) + ""
  ), n;
  return {
    c() {
      e = f("span"), n = P(t), m(e, "class", "svelte-1m851ap");
    },
    m(s, l) {
      R(s, e, l), a(e, n);
    },
    p(s, l) {
      l[0] & /*internalMode, $_*/
      40960 && t !== (t = /*internalMode*/
      (s[13] === "confirmReject" ? (
        /*$_*/
        s[15]("RejectPrize")
      ) : (
        /*$_*/
        s[15]("Reject")
      )) + "") && X(n, t);
    },
    d(s) {
      s && M(e);
    }
  };
}
function aA(A) {
  let e, t, n = (
    /*activeGame*/
    A[9] && Ke(A)
  ), s = (
    /*isMessageShown*/
    A[11] && it(A)
  );
  return {
    c() {
      e = f("div"), n && n.c(), t = H(), s && s.c(), m(e, "class", "PrizeDetailsContent svelte-1m851ap");
    },
    m(l, i) {
      R(l, e, i), n && n.m(e, null), a(e, t), s && s.m(e, null), A[44](e);
    },
    p(l, i) {
      /*activeGame*/
      l[9] ? n ? n.p(l, i) : (n = Ke(l), n.c(), n.m(e, t)) : n && (n.d(1), n = null), /*isMessageShown*/
      l[11] ? s ? (s.p(l, i), i[0] & /*isMessageShown*/
      2048 && Me(s, 1)) : (s = it(l), s.c(), Me(s, 1), s.m(e, null)) : s && (s.d(1), s = null);
    },
    i(l) {
      Me(s);
    },
    o: Xe,
    d(l) {
      l && M(e), n && n.d(), s && s.d(), A[44](null);
    }
  };
}
let oA = null;
function pA(A, e, t) {
  let n, s, l, i, o, c, r;
  Qt(A, xt, (p) => t(15, r = p));
  let { data: d = null } = e, { endpoint: w = "" } = e, { session: b = "" } = e, { lang: v = "en" } = e, { clientstyling: C = "" } = e, { clientstylingurl: O = "" } = e, { translationurl: V = "" } = e, { mbsource: L = "" } = e, { twostepdraw: K = "false" } = e, { luckywheelsize: ie = 324 } = e, { luckywheelmobilesize: me = 240 } = e, { programs: ee = [] } = e, u = null, J;
  const le = Tt(window.navigator.userAgent);
  let E = !1, j = "", T = null, Z = !1, D = !1, F = "", Ae = "", N = !1, I = Date.now(), W = null;
  const y = (p, g) => {
    if (!p)
      return "";
    const k = new Date(p).getTime() - g;
    if (k <= 0)
      return "00d:00h:00m";
    const B = Math.floor(k / (1e3 * 60 * 60 * 24)), pe = Math.floor(k % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), re = Math.floor(k % (1e3 * 60 * 60) / (1e3 * 60));
    return `${B.toString().padStart(2, "0")}d:${pe.toString().padStart(2, "0")}h:${re.toString().padStart(2, "0")}m`;
  }, x = (p) => [
    "",
    r("Monday"),
    r("Tuesday"),
    r("Wednesday"),
    r("Thursday"),
    r("Friday"),
    r("Saturday"),
    r("Sunday")
  ][p] || "", oe = (p) => {
    const g = ["th", "st", "nd", "rd"], Q = p % 100;
    return p + (g[(Q - 20) % 10] || g[Q] || g[0]);
  }, be = (p) => {
    if (!p)
      return "";
    const { recurrenceType: g, frequency: Q, dayFrom: k, dayTo: B, maxImplicitTickets: pe, startTime: re, endTime: ae } = p, U = pe || 0, Be = U > 1 ? r("Spins") : r("Spin");
    let $ = `${U} ${Be}`;
    const Ce = r("Every"), ne = Q || 1;
    switch (g == null ? void 0 : g.toLowerCase()) {
      case "single":
        $ += ` ${r("InThisPeriod")}`;
        break;
      case "minute":
        const wt = ne > 1 ? r("Minutes") : r("Minute");
        $ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${wt}`;
        break;
      case "day":
        const vt = ne > 1 ? r("Days") : r("Day");
        $ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${vt}`;
        break;
      case "week":
        if (k && B)
          k === B ? $ += ` ${Ce} ${x(k)}` : $ += ` ${r("From")} ${x(k)} ${r("To")} ${x(B)} ${r("EveryWeek")}`;
        else {
          const Ze = ne > 1 ? r("Weeks") : r("Week");
          $ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${Ze}`;
        }
        break;
      case "month":
        if (k && B)
          k === B ? $ += ` ${Ce} ${oe(k)} ${r("EachMonth")}` : $ += ` ${r("From")} ${oe(k)} ${r("To")} ${oe(B)} ${r("EachMonth")}`;
        else {
          const Ze = ne > 1 ? r("Months") : r("Month");
          $ += ` ${Ce} ${ne > 1 ? ne + " " : ""}${Ze}`;
        }
        break;
      default:
        $ += ` ${r("InThisPeriod")}`;
    }
    return `${$} [${S(re)} ~ ${S(ae)}]`;
  };
  Nt();
  const ye = (p) => fe(this, null, function* () {
    try {
      const Q = yield (yield fetch(p)).json();
      Object.keys(Q).forEach((k) => {
        Se(k, Q[k]);
      });
    } catch (g) {
      console.error("[PrizeDetails] Failed to load translations", g);
    }
  });
  var q;
  (function(p) {
    p[p.Assign = 0] = "Assign", p[p.Reward = 1] = "Reward", p[p.Reject = 2] = "Reject";
  })(q || (q = {}));
  const ge = (Q, ...k) => fe(this, [Q, ...k], function* (p, g = {}) {
    const B = new URL(w + "/v1" + p);
    g.params && Object.keys(g.params).forEach((ae) => B.searchParams.append(ae, g.params[ae]));
    const re = yield (yield fetch(B.toString(), {
      method: g.method || "GET",
      headers: Pe(Pe({
        "Content-Type": "application/json",
        Accept: "text/plain"
      }, b ? { "x-SessionId": b } : {}), g.headers),
      body: g.body
    })).text();
    try {
      return JSON.parse(re);
    } catch (ae) {
      return re;
    }
  }), he = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (p) => {
    const g = Math.random() * 16 | 0;
    return (p === "x" ? g : g & 3 | 8).toString(16);
  }), we = () => fe(this, null, function* () {
    var Q;
    if (!u)
      return;
    const p = yield ge("/wof/remainingTimes", {
      params: {
        filter: `ProgramId[]=${u.program.id}`
      }
    });
    let g = 0;
    if (((Q = p == null ? void 0 : p.items) == null ? void 0 : Q.length) > 0) {
      const k = p.items.find((B) => B.programId === u.program.id);
      k && (g = +k.remainingTimes || 0);
    }
    t(9, u.current.remainingTimes = g, u), t(9, u = Pe({}, u)), t(32, d = JSON.stringify(u)), window.postMessage(
      {
        type: "PrizeGameRemainingTimesUpdated",
        data: u
      },
      "*"
    );
  }), ce = () => fe(this, null, function* () {
    if (!u)
      return;
    let p = u.next;
    if (!p) {
      let g = ee;
      if (!g || g.length === 0)
        try {
          const k = yield ge("/wof/lotteries");
          g = (k == null ? void 0 : k.items) || [];
        } catch (k) {
          console.error("[PrizeDetails] Check next program failed", k);
        }
      const Q = g == null ? void 0 : g.find((k) => k.program.id === u.program.id);
      p = Q == null ? void 0 : Q.next;
    }
    p ? (t(12, j = "show-next"), t(35, T = {
      startTime: S(p.startTime),
      name: u.program.name[v] || u.program.name["*"]
    })) : t(12, j = "no-next"), t(11, E = !0);
  }), _ = () => fe(this, null, function* () {
    var p;
    if (!(!u || Z || D || E) && ((p = u.current) == null ? void 0 : p.remainingTimes) !== 0) {
      Ae = he(), t(16, Z = !0), t(17, D = !0), t(18, N = !1), window.postMessage({ type: "PrizeGameStartAnimation" }, "*");
      try {
        const g = K === "true" ? q.Reward : q.Assign, Q = yield ge(`/wof/draw/${u.program.id}`, {
          method: "PUT",
          body: JSON.stringify({ guid: Ae, action: g })
        });
        yield ke(Q, g);
      } catch (g) {
        window.postMessage(
          {
            type: "PrizeGameResult",
            data: { error: !0 }
          },
          "*"
        ), t(12, j = "error"), t(11, E = !0), t(16, Z = !1), t(17, D = !1);
      }
    }
  }), ke = (p, g) => fe(this, null, function* () {
    var Q, k;
    if (((Q = p == null ? void 0 : p.item) == null ? void 0 : Q.state) === "fulfilled" || ((k = p == null ? void 0 : p.item) == null ? void 0 : k.state) === "drawn") {
      window.postMessage({ type: "PrizeGameResult", data: p }, "*");
      const B = u.program.wheelOfFortune.partitions[p.item.result.wheelOfFortunePartitionIndex], pe = (B == null ? void 0 : B.prizeText[v]) || (B == null ? void 0 : B.prizeText["*"]) || "", re = (B == null ? void 0 : B.name[v]) || (B == null ? void 0 : B.name["*"]) || "", ae = (B == null ? void 0 : B.prizeImage[v]) || (B == null ? void 0 : B.prizeImage["*"]) || "", U = p.item.result.outcomes.some((Be) => {
        var $;
        return (($ = Be.action) == null ? void 0 : $.type) === "noprize";
      });
      U ? (t(12, j = "noprize"), t(35, T = { text: pe, image: ae })) : (g === q.Assign && j === "gift" ? t(12, j = "success") : t(12, j = g === q.Reward ? "gift" : "success-draw"), t(35, T = {
        text: pe,
        image: ae,
        bold: re
      })), t(13, F = ""), (g !== q.Reward || U) && (yield we());
    } else
      window.postMessage(
        {
          type: "PrizeGameResult",
          data: { error: !0 }
        },
        "*"
      ), t(12, j = "error"), t(11, E = !0), t(17, D = !1);
    t(16, Z = !1);
  }), ve = (p) => fe(this, null, function* () {
    var Q;
    if (!u || Z)
      return;
    t(16, Z = !0);
    const g = p === "Assign" ? q.Assign : q.Reject;
    try {
      const k = yield ge(`/wof/draw/${u.program.id}`, {
        method: "PUT",
        body: JSON.stringify({ guid: Ae, action: g })
      });
      g === q.Assign ? yield ke(k, q.Assign) : (yield we(), t(17, D = !1), t(16, Z = !1), ((Q = u.current) == null ? void 0 : Q.remainingTimes) === 0 ? (t(13, F = ""), ce()) : (t(11, E = !1), t(13, F = ""), window.postMessage({ type: "PrizeResultClose" }, "*")));
    } catch (k) {
      window.postMessage(
        {
          type: "PrizeGameResult",
          data: { error: !0 }
        },
        "*"
      ), t(12, j = "error"), t(11, E = !0), t(16, Z = !1), t(17, D = !1);
    }
  }), Y = () => window.postMessage({ type: "BackToList" }, "*"), G = () => window.postMessage({ type: "ClosePrizeEngineDrawer" }, "*"), S = (p) => p ? new Date(p).toISOString().replace("T", " ").substring(0, 19).replace(/-/g, "/") : "", Re = (p) => {
    const { type: g, action: Q } = p.data;
    g === "PrizeGameRequestDraw" ? _() : g === "PrizeResultAction" ? ve(Q) : g === "PrizeResultClose" ? (t(11, E = !1), t(17, D = !1), t(13, F = "")) : g === "PrizeGameToggleRules" ? t(18, N = !N) : g === "PrizeGameSpinEnd" && (t(11, E = !0), t(17, D = !1));
  };
  zt(() => (W = setInterval(
    () => {
      t(36, I = Date.now());
    },
    6e4
  ), window.addEventListener("message", Re), () => {
    window.removeEventListener("message", Re), W && clearInterval(W);
  }));
  const He = () => t(18, N = !0), Qe = () => t(18, N = !1), Te = () => t(13, F = ""), ze = () => ve("Assign"), De = () => ve("Reject"), z = () => t(13, F = "confirmReject"), te = () => {
    var p;
    ((p = u == null ? void 0 : u.current) == null ? void 0 : p.remainingTimes) === 0 && ["success", "noprize", "success-draw", "error"].includes(j) ? (t(13, F = ""), ce()) : (t(11, E = !1), t(13, F = ""), window.postMessage({ type: "PrizeResultClose" }, "*"));
  };
  function We(p) {
    Wt[p ? "unshift" : "push"](() => {
      J = p, t(10, J);
    });
  }
  return A.$$set = (p) => {
    "data" in p && t(32, d = p.data), "endpoint" in p && t(0, w = p.endpoint), "session" in p && t(1, b = p.session), "lang" in p && t(2, v = p.lang), "clientstyling" in p && t(3, C = p.clientstyling), "clientstylingurl" in p && t(4, O = p.clientstylingurl), "translationurl" in p && t(5, V = p.translationurl), "mbsource" in p && t(6, L = p.mbsource), "twostepdraw" in p && t(33, K = p.twostepdraw), "luckywheelsize" in p && t(7, ie = p.luckywheelsize), "luckywheelmobilesize" in p && t(8, me = p.luckywheelmobilesize), "programs" in p && t(34, ee = p.programs);
  }, A.$$.update = () => {
    var p, g, Q, k, B, pe, re, ae;
    if (A.$$.dirty[1] & /*data*/
    2)
      if (typeof d == "string")
        try {
          t(9, u = JSON.parse(d));
        } catch (U) {
          console.error("[PrizeDetails] Parse failed", U);
        }
      else
        t(9, u = d);
    A.$$.dirty[0] & /*activeGame*/
    512 | A.$$.dirty[1] & /*now*/
    32 && t(23, n = (p = u == null ? void 0 : u.current) != null && p.expiryTime ? y(u.current.expiryTime, I) : ""), A.$$.dirty[0] & /*activeGame, lang*/
    516 && t(22, s = ((Q = (g = u == null ? void 0 : u.program) == null ? void 0 : g.termsUrl) == null ? void 0 : Q[v]) || ((B = (k = u == null ? void 0 : u.program) == null ? void 0 : k.termsUrl) == null ? void 0 : B["*"])), A.$$.dirty[0] & /*translationurl*/
    32 && V && ye(V), A.$$.dirty[0] & /*lang*/
    4 && v && Zt(v), A.$$.dirty[0] & /*activeGame*/
    512 && u != null && u.translations && Object.keys(u.translations).forEach((U) => {
      Se(U, u.translations[U]);
    }), A.$$.dirty[0] & /*clientstyling, rootContainer*/
    1032 && C && J && Pt(J, C), A.$$.dirty[0] & /*clientstylingurl, rootContainer*/
    1040 && O && J && Lt(J, O), A.$$.dirty[0] & /*mbsource, rootContainer*/
    1088 && L && J && jt(J, `${L}.Style`, oA), A.$$.dirty[0] & /*activeGame*/
    512 && t(14, l = (pe = u == null ? void 0 : u.program) == null ? void 0 : pe.type), A.$$.dirty[0] & /*activeGame*/
    512 && t(21, i = Number((ae = (re = u == null ? void 0 : u.program) == null ? void 0 : re.metadata) == null ? void 0 : ae.template) || 0), A.$$.dirty[0] & /*isMessageShown, internalMode, $_, messageMode*/
    47104 | A.$$.dirty[1] & /*messageValue*/
    16 && t(20, o = (() => {
      if (!E)
        return null;
      if (F === "confirmReject")
        return {
          key: "confirmReject",
          image: Ft,
          title: r("AreYouSure"),
          text: r("RejectWarningText")
        };
      switch (j) {
        case "error":
          return {
            key: "error",
            image: Et,
            title: r("DrawFailed")
          };
        case "noprize":
          return {
            key: "noprize",
            image: Jt,
            title: r("NoPrizeTitle"),
            text: (T == null ? void 0 : T.text) || r("NoPrize")
          };
        case "gift":
        case "success-draw":
          return {
            key: j,
            image: (T == null ? void 0 : T.image) || St,
            title: r("Congratulation"),
            text: (T == null ? void 0 : T.text) || r("Success", {
              values: { prize: (T == null ? void 0 : T.bold) || "" }
            })
          };
        case "success":
          return {
            key: "success",
            image: Ot,
            text: r("RewardIssued")
          };
        case "show-next":
          return {
            key: "show-next",
            text: r("ShowNext", {
              values: {
                startTime: T == null ? void 0 : T.startTime,
                name: T == null ? void 0 : T.name
              }
            })
          };
        case "no-next":
          return { key: "no-next", text: r("NoNext") };
        default:
          return null;
      }
    })()), A.$$.dirty[0] & /*$_, gameType, activeGame*/
    49664 && t(19, c = (() => {
      var Be;
      let U = r("Play");
      return l === "wheelOfFortune" ? U = r("Spin") : l === "flipCoin" ? U = r("FlipCoin") : l === "mysteryChest" && (U = r("OpenChest")), {
        base: U,
        count: ((Be = u == null ? void 0 : u.current) == null ? void 0 : Be.remainingTimes) || 0
      };
    })());
  }, [
    w,
    b,
    v,
    C,
    O,
    V,
    L,
    ie,
    me,
    u,
    J,
    E,
    j,
    F,
    l,
    r,
    Z,
    D,
    N,
    c,
    o,
    i,
    s,
    n,
    le,
    be,
    ce,
    _,
    ve,
    Y,
    G,
    S,
    d,
    K,
    ee,
    T,
    I,
    He,
    Qe,
    Te,
    ze,
    De,
    z,
    te,
    We
  ];
}
class mA extends Mt {
  constructor(e) {
    super(), Rt(
      this,
      e,
      pA,
      aA,
      Le,
      {
        data: 32,
        endpoint: 0,
        session: 1,
        lang: 2,
        clientstyling: 3,
        clientstylingurl: 4,
        translationurl: 5,
        mbsource: 6,
        twostepdraw: 33,
        luckywheelsize: 7,
        luckywheelmobilesize: 8,
        programs: 34
      },
      Gt,
      [-1, -1, -1]
    );
  }
  get data() {
    return this.$$.ctx[32];
  }
  set data(e) {
    this.$$set({ data: e }), se();
  }
  get endpoint() {
    return this.$$.ctx[0];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), se();
  }
  get session() {
    return this.$$.ctx[1];
  }
  set session(e) {
    this.$$set({ session: e }), se();
  }
  get lang() {
    return this.$$.ctx[2];
  }
  set lang(e) {
    this.$$set({ lang: e }), se();
  }
  get clientstyling() {
    return this.$$.ctx[3];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), se();
  }
  get clientstylingurl() {
    return this.$$.ctx[4];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), se();
  }
  get translationurl() {
    return this.$$.ctx[5];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), se();
  }
  get mbsource() {
    return this.$$.ctx[6];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), se();
  }
  get twostepdraw() {
    return this.$$.ctx[33];
  }
  set twostepdraw(e) {
    this.$$set({ twostepdraw: e }), se();
  }
  get luckywheelsize() {
    return this.$$.ctx[7];
  }
  set luckywheelsize(e) {
    this.$$set({ luckywheelsize: e }), se();
  }
  get luckywheelmobilesize() {
    return this.$$.ctx[8];
  }
  set luckywheelmobilesize(e) {
    this.$$set({ luckywheelmobilesize: e }), se();
  }
  get programs() {
    return this.$$.ctx[34];
  }
  set programs(e) {
    this.$$set({ programs: e }), se();
  }
}
customElements.define("prize-engine-details", It(mA, { data: {}, endpoint: {}, session: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, twostepdraw: {}, luckywheelsize: {}, luckywheelmobilesize: {}, programs: {} }, [], [], !0));
export {
  mA as default
};
