import * as U from "react";
import r, { useContext as z, useCallback as O, useState as T, createRef as He, useEffect as x, Fragment as $e, useMemo as p } from "react";
import { L as ge, a as ze } from "./common-0d4cd6e8.mjs";
import { A as Be } from "./Alert-1277e378.mjs";
import { Trans as B } from "react-i18next";
import { u as We } from "./useHeaderAlerts-206faff0.mjs";
import { u as P, a as me, h as ye } from "./index-28007ca6.mjs";
import { u as Ie, c as Oe, h as W, e as Y, i as Ve } from "./useRoutes-367960a3.mjs";
import { A as D, a as ee } from "./ArrowIcon-afdb4626.mjs";
import { I as xe, a as Se, b as ke, d as Ke } from "./default-item-image-4bef31eb.mjs";
import { F as j, u as H, W as Ce, c as V, O as Ye, d as Qe } from "./Env-92498313.mjs";
import I from "classnames";
import J from "react-lines-ellipsis";
import { _ as qe, a as Je, i as Xe, b as Ue } from "./isObjectLike-a62f2bf0.mjs";
import { L as Q } from "./index-35107a02.mjs";
import X from "react-slick";
import { U as Ze, a as be, d as De, H as et, O as tt, A as te, C as nt } from "./currency-ctx-3eb457d3.mjs";
import { Platform as M, PlatformClient as de, OrderStatus as Ee } from "@accelbyte/sdk-platform";
import rt from "react-player";
import { P as Re, R as F, u as fe } from "./usePendingOrders-515ff6cf.mjs";
import { L as Te } from "./LauncherLink-a04d50bf.mjs";
import { a as q } from "./LoadingPage-d6d2cc0b.mjs";
import { a as pe } from "./useOrderProcess-555cab8c.mjs";
import { IamUserAuthorizationClient as at } from "@accelbyte/sdk-iam";
import { UrlHelper as ne } from "@accelbyte/sdk";
import { toast as re } from "react-toastify";
import { U as it } from "./UrlUtils-1bad2fa2.mjs";
import "@accelbyte/sdk-legal";
import "react-dom";
import "react-feather";
import "buffer";
import "zod";
import "@accelbyte/sdk-gdpr";
import "@accelbyte/sdk-basic";
import "flat";
import "i18next";
import "date-fns";
import "./utils.mjs";
import "uuid";
import "./EcommTypes-beac1085.mjs";
import "axios";
import "./merge-78dc87d6.mjs";
var st = qe, ct = function() {
  return st.Date.now();
}, ot = ct, lt = /\s/;
function ut(n) {
  for (var e = n.length; e-- && lt.test(n.charAt(e)); )
    ;
  return e;
}
var mt = ut, dt = mt, ft = /^\s+/;
function pt(n) {
  return n && n.slice(0, dt(n) + 1).replace(ft, "");
}
var gt = pt, yt = Je, bt = Xe, Et = "[object Symbol]";
function vt(n) {
  return typeof n == "symbol" || bt(n) && yt(n) == Et;
}
var ht = vt, wt = gt, ve = Ue, Lt = ht, he = 0 / 0, Nt = /^[-+]0x[0-9a-f]+$/i, It = /^0b[01]+$/i, Ot = /^0o[0-7]+$/i, xt = parseInt;
function St(n) {
  if (typeof n == "number")
    return n;
  if (Lt(n))
    return he;
  if (ve(n)) {
    var e = typeof n.valueOf == "function" ? n.valueOf() : n;
    n = ve(e) ? e + "" : e;
  }
  if (typeof n != "string")
    return n === 0 ? n : +n;
  n = wt(n);
  var s = It.test(n);
  return s || Ot.test(n) ? xt(n.slice(2), s ? 2 : 8) : Nt.test(n) ? he : +n;
}
var kt = St, Ct = Ue, Z = ot, we = kt, Ut = "Expected a function", Rt = Math.max, Tt = Math.min;
function At(n, e, s) {
  var a, i, t, o, c, l, m = 0, g = !1, u = !1, d = !0;
  if (typeof n != "function")
    throw new TypeError(Ut);
  e = we(e) || 0, Ct(s) && (g = !!s.leading, u = "maxWait" in s, t = u ? Rt(we(s.maxWait) || 0, e) : t, d = "trailing" in s ? !!s.trailing : d);
  function b(h) {
    var k = a, v = i;
    return a = i = void 0, m = h, o = n.apply(v, k), o;
  }
  function w(h) {
    return m = h, c = setTimeout(y, e), g ? b(h) : o;
  }
  function E(h) {
    var k = h - l, v = h - m, _ = e - k;
    return u ? Tt(_, t - v) : _;
  }
  function f(h) {
    var k = h - l, v = h - m;
    return l === void 0 || k >= e || k < 0 || u && v >= t;
  }
  function y() {
    var h = Z();
    if (f(h))
      return L(h);
    c = setTimeout(y, E(h));
  }
  function L(h) {
    return c = void 0, d && a ? b(h) : (a = i = void 0, o);
  }
  function C() {
    c !== void 0 && clearTimeout(c), m = 0, a = l = i = c = void 0;
  }
  function S() {
    return c === void 0 ? o : L(Z());
  }
  function A() {
    var h = Z(), k = f(h);
    if (a = arguments, i = this, l = h, k) {
      if (c === void 0)
        return w(l);
      if (u)
        return clearTimeout(c), c = setTimeout(y, e), b(l);
    }
    return c === void 0 && (c = setTimeout(y, e)), o;
  }
  return A.cancel = C, A.flush = S, A;
}
var _t = At;
function K(n) {
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? K = function(s) {
    return typeof s;
  } : K = function(s) {
    return s && typeof Symbol == "function" && s.constructor === Symbol && s !== Symbol.prototype ? "symbol" : typeof s;
  }, K(n);
}
function ae() {
  return ae = Object.assign || function(n) {
    for (var e = 1; e < arguments.length; e++) {
      var s = arguments[e];
      for (var a in s)
        Object.prototype.hasOwnProperty.call(s, a) && (n[a] = s[a]);
    }
    return n;
  }, ae.apply(this, arguments);
}
function Mt(n, e) {
  if (n == null)
    return {};
  var s = Ft(n, e), a, i;
  if (Object.getOwnPropertySymbols) {
    var t = Object.getOwnPropertySymbols(n);
    for (i = 0; i < t.length; i++)
      a = t[i], !(e.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(n, a) && (s[a] = n[a]);
  }
  return s;
}
function Ft(n, e) {
  if (n == null)
    return {};
  var s = {}, a = Object.keys(n), i, t;
  for (t = 0; t < a.length; t++)
    i = a[t], !(e.indexOf(i) >= 0) && (s[i] = n[i]);
  return s;
}
function jt(n, e) {
  if (!(n instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Le(n, e) {
  for (var s = 0; s < e.length; s++) {
    var a = e[s];
    a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(n, a.key, a);
  }
}
function Gt(n, e, s) {
  return e && Le(n.prototype, e), s && Le(n, s), n;
}
function Pt(n, e) {
  return e && (K(e) === "object" || typeof e == "function") ? e : Ae(n);
}
function ie(n) {
  return ie = Object.setPrototypeOf ? Object.getPrototypeOf : function(s) {
    return s.__proto__ || Object.getPrototypeOf(s);
  }, ie(n);
}
function Ae(n) {
  if (n === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return n;
}
function Ht(n, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function");
  n.prototype = Object.create(e && e.prototype, { constructor: { value: n, writable: !0, configurable: !0 } }), e && se(n, e);
}
function se(n, e) {
  return se = Object.setPrototypeOf || function(a, i) {
    return a.__proto__ = i, a;
  }, se(n, e);
}
var Ne = r, $t = _t, zt = typeof window < "u";
function Bt() {
  var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 150, e = arguments.length > 1 ? arguments[1] : void 0;
  return function(s) {
    var a = /* @__PURE__ */ function(i) {
      Ht(t, i);
      function t(o) {
        var c;
        return jt(this, t), c = Pt(this, ie(t).call(this, o)), c.state = {
          winWidth: zt ? window.innerWidth : 0
        }, c.onResize = $t(c.onResize.bind(Ae(c)), n, e), c;
      }
      return Gt(t, [{
        key: "componentDidMount",
        value: function() {
          window.addEventListener("resize", this.onResize);
        }
      }, {
        key: "componentWillUnmount",
        value: function() {
          window.removeEventListener("resize", this.onResize), this.onResize.cancel();
        }
      }, {
        key: "onResize",
        value: function() {
          this.setState({
            winWidth: window.innerWidth
          });
        }
      }, {
        key: "render",
        value: function() {
          var c = this.props, l = c.innerRef, m = Mt(c, ["innerRef"]);
          return Ne.createElement(s, ae({
            ref: l
          }, m, this.state));
        }
      }]), t;
    }(Ne.Component);
    return a.displayName = "Responsive(".concat(s.displayName || s.name, ")"), a.defaultProps = {
      innerRef: function() {
      }
    }, a;
  };
}
var Wt = Bt;
const ce = {
  bannerItemList: null,
  bannerContentList: null,
  currencyMap: null,
  bannerError: null,
  bannerFetchStatus: j.IDLE
}, Vt = (n) => Oe("banner", n ?? ce);
function Kt() {
  var c, l, m, g, u;
  const [n] = H(), e = z($), s = (d) => d.data.map((w) => {
    const E = xe.getFilteredImageUrlByTag(w.images, Se.heroBanner) || null;
    return {
      bannerItem: w,
      mainBackground: E
      // TODO on-eject will fail with null mainBackground
    };
  }), [a, i] = Ie(
    Vt({
      ...ce,
      bannerItemList: ((c = e == null ? void 0 : e.multipleGame) == null ? void 0 : c.bannerItem) ?? null,
      currencyMap: (l = e == null ? void 0 : e.multipleGame) != null && l.currencyObject ? new Map(Object.entries((m = e == null ? void 0 : e.multipleGame) == null ? void 0 : m.currencyObject)) : null,
      bannerContentList: (g = e == null ? void 0 : e.multipleGame) != null && g.bannerItem ? s((u = e == null ? void 0 : e.multipleGame) == null ? void 0 : u.bannerItem) : null
    })
  ), t = O(() => {
    i(ce);
  }, []), o = O(
    async (d) => {
      let b = null, w = null, E = null, f = null;
      try {
        return i({ bannerError: E, bannerFetchStatus: j.FETCHING }), b = await M.ItemApi(n).getItemsByCriteria({
          limit: 5,
          tags: "banner",
          region: d
        }), w = await de.getCurrencyMap(n), f = s(b), {
          data: {
            bannerItemList: b,
            currencyMap: w,
            bannerContentList: f
          }
        };
      } catch (y) {
        return E = Ce.getErrorType(y), { error: E };
      } finally {
        i({
          bannerItemList: b,
          currencyMap: w,
          bannerContentList: f,
          bannerError: E,
          bannerFetchStatus: j.IDLE
        });
      }
    },
    [n]
  );
  return {
    state: a,
    mutations: {
      resetState: t,
      fetchBennerItems: o
    }
  };
}
const Yt = (n) => {
  const { mainBackground: e } = n, s = Ze.safeParse(e);
  if (e && s.success)
    switch (s.data.type) {
      case be.YOUTUBE_VIDEO:
      case be.URL_VIDEO:
        return /* @__PURE__ */ r.createElement("div", { className: "banner-video-wrapper" }, /* @__PURE__ */ r.createElement(
          rt,
          {
            key: s.data.content,
            className: "react-player",
            controls: !1,
            url: s.data.content,
            playing: !0,
            loop: !0,
            volume: 0
          }
        ));
      default:
        return /* @__PURE__ */ r.createElement(
          "img",
          {
            key: s.data.content,
            alt: s.data.content,
            src: s.data.content,
            className: "bannerImage"
          }
        );
    }
  let a;
  switch (typeof e) {
    case "string": {
      a = e;
      break;
    }
    case "object": {
      a = e == null ? void 0 : e.content;
      break;
    }
  }
  return /* @__PURE__ */ r.createElement("img", { className: "bannerImage", src: a || De, alt: "" });
}, Qt = (n) => {
  const { regionData: e, currencyMap: s } = n;
  if (!s)
    return null;
  const a = Re.makePaymentOptionList(e, s), i = F.isFree(a.map((t) => t.regionData));
  return /* @__PURE__ */ r.createElement("div", { className: "bannerPriceContainer" }, a.map(({ finalPrice: t, originalPrice: o, regionData: c, currencySymbol: l }) => /* @__PURE__ */ r.createElement("div", { key: c.currencyCode, className: "bannerPrice" }, i && /* @__PURE__ */ r.createElement(B, { i18nKey: "BannerPrice.freeItem" }, "FREE"), !i && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
    "span",
    {
      className: I("finalPrice", {
        virtual: F.isCurrencyTypeVirtual(c)
      })
    },
    `${l} ${t}`
  ), F.isDiscounted(c) && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("s", { className: "priceStrikethrough" }, /* @__PURE__ */ r.createElement("span", { className: "beforeDiscount" }, `${l} ${o}`)), /* @__PURE__ */ r.createElement("span", { className: "discountPercentage" }, `-${F.calculateDiscountPercentage(c)}%`))))));
}, qt = typeof J == "object" ? J.default : J, Jt = typeof X == "object" ? X.default : X, Xt = Wt()(qt), Zt = () => {
  var w, E;
  const n = {
    dots: !1,
    infinite: !0,
    speed: 500,
    slideToShow: 1,
    slideToScroll: 1,
    arrows: !1,
    adaptiveHeight: !0
  }, [e, s] = T(0), { state: a, mutations: i } = Kt(), { state: t } = W(), o = He(), { state: c } = V(), l = (w = c.user) == null ? void 0 : w.country, m = a.bannerItemList && a.bannerItemList.data, g = m ? e % m.length : 0;
  x(() => {
    l && i.fetchBennerItems(l);
  }, [l]);
  const u = () => {
    const f = o.current;
    f && f.slickPrev(), s(e - 1);
  }, d = () => {
    const f = o.current;
    f && f.slickNext(), s(e + 1);
  }, b = (f) => {
    const y = o.current;
    y && y.slickPrev(), s(f);
  };
  return /* @__PURE__ */ r.createElement("section", { className: "banner bannerHeight" }, a.bannerItemList && a.currencyMap && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(Jt, { ref: o, ...n, afterChange: (f) => b(f) }, (E = a.bannerContentList) == null ? void 0 : E.map((f) => /* @__PURE__ */ r.createElement("div", { key: f.bannerItem.itemId, className: "bannerHeight" }, /* @__PURE__ */ r.createElement(Yt, { mainBackground: f.mainBackground }), /* @__PURE__ */ r.createElement(
    Q,
    {
      to: ke.getItemDetailRoute(t, f.bannerItem),
      className: "bannerItemContainer bannerGradient"
    },
    /* @__PURE__ */ r.createElement("div", { className: "bannerDetail" }, /* @__PURE__ */ r.createElement("p", { className: I("title", Ye.TITLE_FONT) }, f.bannerItem.title), /* @__PURE__ */ r.createElement("div", { className: "description" }, /* @__PURE__ */ r.createElement(
      Xt,
      {
        text: f.bannerItem.description,
        maxLine: 2,
        ellipsis: "...",
        trimRight: !0,
        basedOn: "letters"
      }
    )), /* @__PURE__ */ r.createElement("div", { className: "price" }, f.bannerItem.regionData && a.currencyMap && /* @__PURE__ */ r.createElement(Qt, { regionData: f.bannerItem.regionData, currencyMap: a.currencyMap })), /* @__PURE__ */ r.createElement("div", { className: "btn big btn-primary ctaButton" }, /* @__PURE__ */ r.createElement(B, { i18nKey: "HomePage.banner.learnMore" }, "Learn more")))
  ))))), m && m.length > 1 && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", { className: "pagination" }, m.map((f, y) => y !== g ? /* @__PURE__ */ r.createElement("div", { key: f.itemId, className: "carouselBullet", onClick: () => b(y) }) : /* @__PURE__ */ r.createElement("div", { key: f.itemId, className: "carouselBullet active" }))), /* @__PURE__ */ r.createElement("button", { className: "bannerHeight arrowLeftButton", onClick: u, "aria-label": "Arrow Left" }, /* @__PURE__ */ r.createElement("div", { className: "arrowIconContainer" }, /* @__PURE__ */ r.createElement(D, { className: ee.left }))), /* @__PURE__ */ r.createElement("button", { className: "bannerHeight arrowRightButton", onClick: d, "aria-label": "Arrow Right" }, /* @__PURE__ */ r.createElement("div", { className: "arrowIconContainer" }, /* @__PURE__ */ r.createElement(D, { className: ee.right }))))));
};
const Dt = (n) => {
  const { regionData: e, currencyMap: s } = n;
  if (!s)
    return null;
  const a = Re.makePaymentOptionList(e, s), i = F.isFree(e || []);
  return /* @__PURE__ */ r.createElement(r.Fragment, null, i && /* @__PURE__ */ r.createElement(B, { i18nKey: "FeaturedGamesPrice.freeItem" }, "FREE"), !i && a.map(({ finalPrice: t, originalPrice: o, regionData: c, currencySymbol: l }, m) => {
    const g = F.isCurrencyTypeVirtual(c);
    return /* @__PURE__ */ r.createElement(r.Fragment, { key: `${c.currencyCode}-${m}` }, g && /* @__PURE__ */ r.createElement("span", { className: "divider" }, "/"), /* @__PURE__ */ r.createElement("span", { key: c.currencyCode, className: "featuredGamePriceItem" }, /* @__PURE__ */ r.createElement(
      "div",
      {
        className: I({
          virtual: g
        })
      },
      l,
      " ",
      t
    ), F.isDiscounted(c) && /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement("s", { className: "priceStrikethrough" }, /* @__PURE__ */ r.createElement("span", { className: "beforeDiscount" }, `${l} ${o}`)))));
  }));
}, oe = (n) => {
  const { gameList: e, currencyMap: s } = n, { state: a } = W();
  return /* @__PURE__ */ U.createElement("div", { className: "featuredGamesItemContainer" }, e && e.map((i) => {
    const t = xe.getFilteredImageUrlByTag(i.images, Se.productCover) || Ke;
    return /* @__PURE__ */ U.createElement(
      Q,
      {
        to: ke.getItemDetailRoute(a, i),
        className: "featuredGamesItem",
        style: {
          backgroundImage: `url(${t})`
        },
        key: i.itemId
      },
      /* @__PURE__ */ U.createElement("div", { className: "featuredGamesOverlayBackground" }, /* @__PURE__ */ U.createElement("div", { className: "featuredGamesContent" }, /* @__PURE__ */ U.createElement("h2", { className: "featuredGamesTitle" }, i.title), /* @__PURE__ */ U.createElement("div", { className: "featuredGamesPrice" }, i && i.regionData && /* @__PURE__ */ U.createElement(Dt, { regionData: i.regionData, currencyMap: s }))), /* @__PURE__ */ U.createElement("div", { className: "featuredGameLearnMoreText" }, /* @__PURE__ */ U.createElement("div", { className: "featuredGameLearnMoreTextContainer" }, /* @__PURE__ */ U.createElement("span", { className: "learnMoreText" }, /* @__PURE__ */ U.createElement(B, { i18nKey: "FeaturedGames.learnMore" }, "Learn more")), /* @__PURE__ */ U.createElement(D, { className: I(ee.right, "arrowSize") }))))
    );
  }));
}, le = {
  featuredGameList: null,
  currencyMap: null,
  featuredGameError: null,
  featuredGameFetchStatus: j.IDLE
}, en = (n) => Oe("featured-games", n ?? le);
function tn() {
  var o, c, l;
  const [n] = H(), e = z($), [s, a] = Ie(
    en({
      ...le,
      featuredGameList: ((o = e == null ? void 0 : e.multipleGame) == null ? void 0 : o.featuredGames) ?? null,
      currencyMap: (c = e == null ? void 0 : e.multipleGame) != null && c.currencyObject ? new Map(Object.entries((l = e == null ? void 0 : e.multipleGame) == null ? void 0 : l.currencyObject)) : null
    })
  ), i = O(() => {
    a(le);
  }, []), t = O(
    async (m) => {
      let g = null, u = null, d = null;
      try {
        a({ featuredGameError: d, featuredGameFetchStatus: j.FETCHING });
        const [b, w] = await Promise.all([
          M.CurrencyApi(n).getCurrencies(),
          M.ItemApi(n).getItemsByCriteria({
            tags: "featured",
            limit: 5,
            region: m
          })
        ]);
        u = /* @__PURE__ */ new Map();
        for (const E of b)
          u.set(E.currencyCode, E);
        return g = w, {
          data: {
            currencyMap: u,
            featuredGameList: g
          }
        };
      } catch (b) {
        return d = Ce.getErrorType(b), { error: b };
      } finally {
        a({ featuredGameList: g, currencyMap: u, featuredGameError: d, featuredGameFetchStatus: j.IDLE });
      }
    },
    [n]
  );
  return {
    state: s,
    mutations: {
      resetState: i,
      fetchFeaturedGames: t
    }
  };
}
const nn = () => {
  var o, c;
  const { state: n } = V(), e = (o = n.user) == null ? void 0 : o.country, { state: s, mutations: a } = tn(), i = (c = s.featuredGameList) == null ? void 0 : c.data, t = 4;
  return x(() => {
    e && a.fetchFeaturedGames(e);
  }, [e]), /* @__PURE__ */ r.createElement("section", { className: "featuredGames" }, !!i && /* @__PURE__ */ r.createElement(r.Fragment, null, (() => i.length >= t ? /* @__PURE__ */ r.createElement(rn, { gameList: i, currencyMap: s.currencyMap }) : /* @__PURE__ */ r.createElement(oe, { gameList: i, currencyMap: s.currencyMap }))()));
}, rn = ({
  gameList: n,
  currencyMap: e
}) => /* @__PURE__ */ r.createElement($e, null, /* @__PURE__ */ r.createElement(oe, { gameList: n.slice(0, 2), currencyMap: e }), /* @__PURE__ */ r.createElement(oe, { gameList: n.slice(2), currencyMap: e }));
function an({ children: n }) {
  const {
    state: { playerPortalConfigData: e }
  } = P(), s = p(() => e == null ? void 0 : e.homepage.data, [e]), a = p(() => s == null ? void 0 : s.background, [s]);
  return /* @__PURE__ */ r.createElement(
    "div",
    {
      style: { backgroundImage: a != null && a.url && !a.videoUrl ? `url(${a == null ? void 0 : a.url})` : "none" },
      className: I("relative min-h-[calc(100vh-72px)] w-full overflow-hidden bg-no-repeat", {
        "bg-od-rgb-background": !(a != null && a.url),
        "bg-cover bg-top": !!(a != null && a.url)
      })
    },
    (a == null ? void 0 : a.videoUrl) && /* @__PURE__ */ r.createElement("video", { id: "bg-video", autoPlay: !0, loop: !0, muted: !0, className: I("h-full w-full", "absolute inset-0 z-[1] object-cover") }, /* @__PURE__ */ r.createElement("source", { src: a == null ? void 0 : a.videoUrl, type: "video/mp4" })),
    (a == null ? void 0 : a.isOverlay) && /* @__PURE__ */ r.createElement(
      "div",
      {
        id: "bg-overlay",
        style: { opacity: Number(a.opacity) / 100 },
        className: I("min-h-screen w-full", "absolute inset-0 z-[2]", {
          "from-od-rgba-overlay bg-gradient-to-t to-transparent": (a == null ? void 0 : a.type) === "gradient",
          "bg-od-rgba-overlay": (a == null ? void 0 : a.type) === "full"
        })
      }
    ),
    /* @__PURE__ */ r.createElement(
      "div",
      {
        id: "intro-container",
        className: I(
          "relative z-10 grid place-items-center",
          "min-h-screen w-full",
          "px-[40px] pt-[8px] pb-[60px]",
          "sm:px-[60px] sm:pt-[28px] sm:pb-[80px]",
          "md:px-[110px] md:pb-[110px] md:pt-[110px]"
        )
      },
      n
    )
  );
}
function sn({ children: n }) {
  const {
    state: { playerPortalConfigData: e }
  } = P(), [s, a] = T(0), i = p(() => e == null ? void 0 : e.homepage.data, [e]), t = p(() => i == null ? void 0 : i.intro, [i]), o = p(
    () => t ? {
      "items-center": ["top", "mid", "bottom"].includes(t.align),
      "items-start": ["top-left", "left", "bottom-left"].includes(t.align),
      "items-end": ["top-right", "right", "bottom-right"].includes(t.align)
    } : {},
    [t == null ? void 0 : t.align]
  ), c = p(
    () => t ? {
      "justify-center": ["left", "mid", "right"].includes(t.align),
      "justify-start": ["top-left", "top", "top-right"].includes(t.align),
      "justify-end": ["bottom-left", "bottom", "bottom-right"].includes(t.align)
    } : {},
    [t == null ? void 0 : t.align]
  ), l = p(
    () => t ? {
      "justify-center": ["top", "mid", "bottom"].includes(t.align),
      "justify-start": ["top-left", "left", "bottom-left"].includes(t.align),
      "justify-end": ["top-right", "right", "bottom-right"].includes(t.align)
    } : {},
    [t == null ? void 0 : t.align]
  ), m = p(
    () => t ? {
      "text-center": ["mid", "top", "bottom"].includes(t.align),
      "text-left": ["top-left", "left", "bottom-left"].includes(t.align),
      "text-right": ["top-right", "right", "bottom-right"].includes(t.align)
    } : {},
    [t == null ? void 0 : t.align]
  ), g = p(
    () => t ? {
      "self-start": ["top-left", "top", "top-right"].includes(t.align),
      "self-center": ["left", "mid", "right"].includes(t.align),
      "self-end": ["bottom-left", "bottom", "bottom-right"].includes(t.align)
    } : {},
    [t == null ? void 0 : t.align]
  ), u = p(
    () => t ? {
      // 'w-[536px]': ['default'].includes(homePageIntro.logoImageSize),
      "scale-[0.5]": t.logoImageSize === "s",
      "scale-[1.5]": t.logoImageSize === "l",
      "scale-[2.0]": t.logoImageSize === "xl"
    } : {},
    [t == null ? void 0 : t.logoImageSize]
  ), d = p(
    () => t ? {
      "origin-center": ["top", "mid", "bottom"].includes(t.align),
      "origin-left": ["top-left", "left", "bottom-left"].includes(t.align),
      "origin-right": ["top-right", "right", "bottom-right"].includes(t.align)
    } : {},
    [t == null ? void 0 : t.align]
  ), b = p(
    () => t ? {
      "text-[48px]": t.titleSize === "default",
      "text-[36px]": t.titleSize === "s",
      "text-[64px]": t.titleSize === "l",
      "text-[72px]": t.titleSize === "xl"
    } : {},
    [t == null ? void 0 : t.titleSize]
  ), w = p(
    () => t ? {
      "text-[16px]": t.messageSize === "default",
      "text-[14px]": t.messageSize === "s",
      "text-[20px]": ["l", "xl"].includes(t.messageSize)
    } : {},
    [t == null ? void 0 : t.messageSize]
  ), E = {
    xl: 2,
    l: 1.5,
    s: 0.5,
    default: 1
  }, f = p(() => t ? E[t == null ? void 0 : t.logoImageSize] : 1, [t == null ? void 0 : t.logoImageSize]);
  return x(() => {
    var L;
    if (!window)
      return;
    window.__homePageData = i;
    const y = () => {
      var S;
      const C = new Image();
      C.src = ((S = i == null ? void 0 : i.intro) == null ? void 0 : S.logoImageUrl) ?? "", C.onload = () => {
        const h = C.height / C.width * 536;
        a(h);
      };
    };
    (L = i == null ? void 0 : i.intro) != null && L.logoImageUrl && y();
  }, [i]), t ? /* @__PURE__ */ r.createElement("div", { className: I("flex w-full flex-col", { ...o, ...c, ...g }) }, t.isActive && /* @__PURE__ */ r.createElement(
    "div",
    {
      id: "intro",
      className: I("mb-12 flex flex-col justify-center", {
        ...o
      }),
      style: t != null && t.logoImageUrl ? { height: `${s * f}px` } : void 0
    },
    t.logoImageUrl ? /* @__PURE__ */ r.createElement(
      "img",
      {
        className: I("w-[536px]", { ...d, ...u }),
        src: t.logoImageUrl,
        alt: "intro logo"
      }
    ) : /* @__PURE__ */ r.createElement(r.Fragment, null, t.title && /* @__PURE__ */ r.createElement(
      "h1",
      {
        id: "intro-title",
        className: I("mb-6 font-medium leading-[115.625%]", {
          ...b,
          ...m
        })
      },
      t.title
    ), t.message && /* @__PURE__ */ r.createElement(
      "p",
      {
        id: "intro-message",
        className: I("leading-[140%]", {
          ...w,
          ...m
        })
      },
      t.message
    ))
  ), /* @__PURE__ */ r.createElement("div", { className: I("flex w-full flex-col gap-6", { ...o }) }, n, t.isShowPlatforms && /* @__PURE__ */ r.createElement(
    "div",
    {
      id: "intro-platform",
      className: I("flex w-full flex-col p-3", {
        ...o,
        ...c
      })
    },
    /* @__PURE__ */ r.createElement("h5", { className: I("mb-2 text-lg font-medium", { ...m }) }, " Also Available On:"),
    /* @__PURE__ */ r.createElement("div", { className: I("flex w-full flex-wrap gap-4", { ...l }) }, t.platforms.map((y, L) => /* @__PURE__ */ r.createElement(et, { platform: y, key: `${y.title}-${L}` })))
  ))) : /* @__PURE__ */ r.createElement(r.Fragment, null, n);
}
function _e({ title: n, children: e, footer: s, beforeContent: a }) {
  return /* @__PURE__ */ r.createElement("div", { id: "modal-overlay", className: "bg-od-rgb-overlay fixed inset-0 z-[51] grid place-items-center bg-opacity-[0.85] p-4" }, /* @__PURE__ */ r.createElement("div", { id: "modal-container", className: "bg-od-rgb-card text-od-rgb-text w-full max-w-[400px] rounded" }, n && /* @__PURE__ */ r.createElement("div", { id: "modal-title", className: "p-4 text-center font-medium leading-6" }, n), a && /* @__PURE__ */ r.createElement(r.Fragment, null, a), e && /* @__PURE__ */ r.createElement("div", { id: "modal-content", className: "p-6" }, e), s && /* @__PURE__ */ r.createElement("div", { id: "modal-footer", className: "p-6 pt-4" }, s)));
}
function ue({ children: n, disabled: e, variant: s = "primary", className: a, ...i }) {
  return /* @__PURE__ */ r.createElement(
    "button",
    {
      ...i,
      disabled: e,
      className: I(
        "text-od-rgb-text min-w-[170px] rounded py-1.5 text-center text-[13px]",
        {
          "bg-od-rgb-primary": s === "primary",
          "bg-none": s === "ghost",
          "text-neutral-80 pointer-events-none cursor-not-allowed	bg-neutral-100": e
        },
        a
      )
    },
    n
  );
}
function cn({ onClickClose: n }) {
  const {
    mutations: { fetchLauncherConfigs: e }
  } = P(), {
    state: { discoveryConfigData: s }
  } = me(), [a] = H(), [i, t] = T();
  return x(() => {
    if (!a)
      return;
    async function o() {
      var m;
      if (!s)
        return;
      const c = await e(s), l = await Te.getLauncherDownloadLink((m = c == null ? void 0 : c.data) == null ? void 0 : m.launcherUpdateUrl.data.value);
      t(l);
    }
    i || o();
  }, [a, s]), /* @__PURE__ */ r.createElement(
    _e,
    {
      title: "Download Launcher",
      footer: /* @__PURE__ */ r.createElement("div", { className: "flex justify-between font-medium" }, /* @__PURE__ */ r.createElement(ue, { variant: "ghost", onClick: n }, "CLOSE"), i ? /* @__PURE__ */ r.createElement(
        "a",
        {
          target: "_blank",
          rel: "noreferrer",
          href: i,
          className: "text-od-rgb-text bg-od-rgb-primary min-w-[170px] rounded py-1.5 text-center text-[13px]"
        },
        "DOWNLOAD NOW"
      ) : /* @__PURE__ */ r.createElement(q, null))
    },
    /* @__PURE__ */ r.createElement("div", { className: "grid place-items-center text-[13px]" }, "Download and play now!")
  );
}
function on({ returnUrl: n, onClickCancel: e, onOrderCreated: s }) {
  const {
    state: { user: a }
  } = V(), {
    state: { prepurchaseInformation: i },
    mutations: { purchase: t }
  } = pe(), {
    state: { pendingOrders: o }
  } = fe(), [c] = H(), { state: l } = W(), { state: m } = Y(), [g, u] = T(!1), [d, b] = T(!1), [w, E] = T(!1), f = z($), y = p(() => f == null ? void 0 : f.singleGame, []), L = p(() => {
    var N;
    return (N = i == null ? void 0 : i.purchaseConstraint) == null ? void 0 : N.paymentConstraints;
  }, [i]), C = p(() => {
    var N;
    return ((N = i == null ? void 0 : i.availableItemInfo) == null ? void 0 : N.availableCount) === 0;
  }, [i]), S = p(
    () => {
      var N, R;
      return !(i != null && i.purchaseConstraint && ((R = (N = i == null ? void 0 : i.purchaseConstraint) == null ? void 0 : N.paymentConstraints) == null ? void 0 : R.length) > 0);
    },
    [i]
  ), A = p(() => {
    var G;
    const N = ((G = i == null ? void 0 : i.availableItemInfo) == null ? void 0 : G.userPurchaseLimit) === 0, R = tt.doesUserMeetPurchaseCondition(
      a == null ? void 0 : a.userId,
      (i == null ? void 0 : i.purchaseConditionValidation) ?? null
    );
    return N || !R;
  }, [i]), h = p(() => {
    var R;
    const N = (R = y == null ? void 0 : y.itemLocale.images) == null ? void 0 : R.find((G) => G.as === "game-icon");
    return N ? N.smallImageUrl : "";
  }, [f]), k = p(() => {
    if (!L || (L == null ? void 0 : L.length) === 0)
      return "-";
    const N = L[0].paymentOption;
    return Number(N.finalPrice) === 0 ? "Free" : `${N.currencySymbol} ${N.finalPrice.toFixed(N.decimals)}`;
  }, [L]), v = p(() => {
    if (!(!L || (L == null ? void 0 : L.length) === 0))
      return L[0].paymentOption.regionData;
  }, [L]);
  x(() => {
    !o || o.length === 0 || b(!0);
  }, [o]), x(() => {
    S && E(
      "COMING_SOON"
      /* COMING_SOON */
    ), A && E(
      "UNAVAILABLE"
      /* UNAVAILABLE */
    ), C && E(
      "OUT_OF_STOCK"
      /* OUT_OF_STOCK */
    );
  }, [S, A, C]);
  const _ = O(() => {
    switch (w) {
      case "OUT_OF_STOCK":
        return "Sorry, this item is currently out of stock.";
      case "COMING_SOON":
      case "UNAVAILABLE":
      default:
        return "Sorry, this item cannot be purchased yet.";
    }
  }, [w]), Me = O(() => {
    if (!w)
      return "CONTINUE TO PAYMENT";
    switch (w) {
      case "COMING_SOON":
        return "COMING SOON";
      case "OUT_OF_STOCK":
      case "UNAVAILABLE":
      default:
        return "UNAVAILABLE";
    }
  }, [w]), Fe = O(() => {
    E(!1);
  }, []), je = O(() => {
    b(!1);
  }, []), Ge = O(() => {
    if (!location)
      return;
    const N = new at(c).createLoginURL(m.location.pathname);
    location.href = N;
  }, [m]), Pe = O(async () => {
    if (o && (o == null ? void 0 : o.length) > 0 && m.push(
      l.orders.detail.makePath({
        params: { orderNo: o[0].orderNo },
        state: { referrer: m.location.pathname }
      })
    ), !a)
      return Ge();
    if (!v)
      return re.error("Failed to get prepurchase information");
    if (!y || !window)
      return;
    u(!0);
    const N = n || ne.combineURLPaths(window.location.origin), { data: R, error: G } = await t({
      item: y.itemLocale,
      userId: a.userId,
      regionData: v,
      quantity: 1,
      returnUrl: N
    });
    R && s && s(R), G && re.error("Failed to order item!"), u(!1);
  }, [y, a, v, o, m, l]);
  return /* @__PURE__ */ r.createElement(
    _e,
    {
      title: "Checkout",
      footer: g ? /* @__PURE__ */ r.createElement("div", { className: "grid place-items-center gap-2" }, /* @__PURE__ */ r.createElement(q, { loadingType: "BAR" })) : /* @__PURE__ */ r.createElement("div", { className: "flex justify-between font-medium" }, /* @__PURE__ */ r.createElement(ue, { variant: "ghost", onClick: e }, "CANCEL"), /* @__PURE__ */ r.createElement(ue, { variant: "primary", onClick: Pe, disabled: !!w }, Me())),
      beforeContent: w ? /* @__PURE__ */ r.createElement(te, { onClose: Fe, variant: "ERROR" }, _()) : o && d && /* @__PURE__ */ r.createElement(te, { onClose: je }, "You already have another pending order that contains this item. Please complete that order before making another purchase.", " ", /* @__PURE__ */ r.createElement(
        Q,
        {
          to: l.orders.detail.makePath({
            params: { orderNo: o[0].orderNo }
          })
        },
        "Continue to Payment"
      ))
    },
    /* @__PURE__ */ r.createElement("div", { className: "flex items-start gap-3" }, h && /* @__PURE__ */ r.createElement("img", { src: h, alt: y == null ? void 0 : y.itemLocale.title, className: "aspect-square w-8 rounded object-contain object-center" }), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement("div", { className: "text-[13px] leading-5" }, y == null ? void 0 : y.itemLocale.title), /* @__PURE__ */ r.createElement("div", { className: "text-[11px] leading-4" }, k))),
    /* @__PURE__ */ r.createElement("hr", { className: "my-6 w-full border border-white border-opacity-[0.15]" }),
    /* @__PURE__ */ r.createElement("div", { className: "flex justify-between" }, /* @__PURE__ */ r.createElement("div", { className: "text-opacity-65 text-white" }, "Amount to Pay"), /* @__PURE__ */ r.createElement("div", { className: "font-medium" }, k))
  );
}
function ln() {
  const {
    state: { playerPortalConfigData: n }
  } = P(), {
    state: { prepurchaseInformation: e, prepurchaseInformationFetchStatus: s },
    mutations: { prepareOrderProcess: a, resetState: i }
  } = pe(), {
    mutations: { fetchPendingOrders: t }
  } = fe(), {
    state: { user: o }
  } = V(), { state: c } = W(), { state: l } = Y(), m = z($), g = p(() => n == null ? void 0 : n.homepage.data, [n]), u = p(() => g == null ? void 0 : g.CTAButton, [g]), d = p(() => m == null ? void 0 : m.singleGame, []), b = p(() => d ? new Map(Object.entries(d.currencyObject)) : /* @__PURE__ */ new Map(), [d]), w = p(() => {
    var v;
    return !!((v = e == null ? void 0 : e.itemOwnership) != null && v.owned);
  }, [e]), E = p(() => {
    var v;
    return (v = e == null ? void 0 : e.purchaseConstraint) == null ? void 0 : v.paymentConstraints;
  }, [e]), f = p(() => !E || (E == null ? void 0 : E.length) === 0 ? !1 : Number(E[0].paymentOption.finalPrice) === 0, [E]), [y, L] = T(""), [C, S] = T(!1);
  x(() => {
    if (!window)
      return;
    const v = new URLSearchParams();
    v.append(
      "cta",
      "launcher-download"
      /* LAUNCHER_DOWNLOAD */
    );
    const _ = ne.combineURLPaths(window.location.origin, `?${v.toString()}`);
    L(_);
  }, []), x(() => () => i(), []), x(() => {
    new URLSearchParams(l.location.search).get(
      "cta"
      /* CTA */
    ) === "launcher-download" && S(
      "DOWNLOAD"
      /* DOWNLOAD */
    );
  }, [l]);
  const A = O(() => {
    if ((u == null ? void 0 : u.purchaseGameType) === "detailed-page") {
      const v = c.store.apps.detail.makePath({ params: { itemId: (d == null ? void 0 : d.itemLocale.itemId) ?? "" } });
      l.push(v);
    } else
      S(
        f ? "DOWNLOAD" : "PURCHASE"
        /* DOWNLOAD */
      );
  }, [l, c, d, f]), h = O(() => {
    if (S(!1), !window || !new URLSearchParams(l.location.search).get(
      "cta"
      /* CTA */
    ))
      return;
    const v = ne.removeQueryParam(
      window.location.href,
      "cta"
      /* CTA */
    ), _ = new URL(v).pathname;
    l.replace(_);
  }, [l]), k = O(
    (v) => {
      !d || !o || (v.status === Ee.enum.INIT && l.push(
        c.orders.detail.makePath({
          params: { orderNo: v.orderNo },
          state: { referrer: l.location.pathname }
        })
      ), v.status === Ee.enum.FULFILLED && (a({ currencyMap: b, item: d == null ? void 0 : d.itemLocale, userId: o.userId }), t({ itemId: d == null ? void 0 : d.itemLocale.itemId, userId: o.userId }), S(
        "DOWNLOAD"
        /* DOWNLOAD */
      ), re.success("Purchase Success!")));
    },
    [d, b, o, a, l, c]
  );
  return u && !u.isActive ? null : /* @__PURE__ */ r.createElement(r.Fragment, null, C === "DOWNLOAD" && /* @__PURE__ */ r.createElement(cn, { onClickClose: h }), C === "PURCHASE" && /* @__PURE__ */ r.createElement(on, { onClickCancel: h, onOrderCreated: k, returnUrl: y }), u != null && u.isActive && s === j.IDLE ? u.actionType === "custom" || u.actionType === "download-launcher" || w ? /* @__PURE__ */ r.createElement(un, { homepageCTAData: u, isOwnedGame: w }) : u.actionType === "purchase-game" && /* @__PURE__ */ r.createElement(
    "button",
    {
      onClick: A,
      className: "bg-od-rgb-primary text-od-rgb-text grid min-w-[215px] place-items-center rounded px-6 py-3"
    },
    u == null ? void 0 : u.label
  ) : /* @__PURE__ */ r.createElement(q, null));
}
function un({
  homepageCTAData: n,
  isOwnedGame: e
}) {
  const {
    mutations: { fetchLauncherConfigs: s }
  } = P(), {
    state: { discoveryConfigData: a }
  } = me(), [i] = H(), [t, o] = T("");
  x(() => {
    if (!i)
      return;
    async function g() {
      var b;
      if (!a)
        return;
      const u = await s(a), d = await Te.getLauncherDownloadLink((b = u == null ? void 0 : u.data) == null ? void 0 : b.launcherUpdateUrl.data.value);
      o(d);
    }
    !t && (n.actionType === "download-launcher" || e) && g();
  }, [i, a, n]);
  const c = p(() => {
    if (e)
      return t;
    switch (n.actionType) {
      case "download-launcher":
        return t;
      case "custom":
      default:
        return n.customUrl;
    }
  }, [t, n]), l = p(() => n.isOpenNewWindow || n.actionType === "download-launcher" || e ? "_blank" : "_self", [n]);
  return p(
    () => (e || n.actionType === ye.enum["download-launcher"]) && !t && n.actionType !== ye.enum.custom,
    [e, n, t]
  ) ? /* @__PURE__ */ r.createElement(q, null) : /* @__PURE__ */ r.createElement(
    "a",
    {
      href: c,
      rel: "noreferrer",
      target: l,
      className: "bg-od-rgb-primary text-od-rgb-text grid min-w-[215px] place-items-center rounded px-6 py-3"
    },
    n.label
  );
}
function mn({ children: n }) {
  const {
    state: { user: e }
  } = V(), {
    mutations: { prepareOrderProcess: s }
  } = pe(), {
    state: { pendingOrders: a },
    mutations: { fetchPendingOrders: i }
  } = fe(), { state: t } = W(), [o] = H(), c = z($), l = p(() => c == null ? void 0 : c.singleGame, []), m = p(() => l ? new Map(Object.entries(l.currencyObject)) : /* @__PURE__ */ new Map(), [l]), [g, u] = T(!1);
  x(() => {
    var b;
    !(l != null && l.currencyObject) || !(l != null && l.itemLocale) || !o || (e != null && e.userId && i({ itemId: (b = l == null ? void 0 : l.itemLocale) == null ? void 0 : b.itemId, userId: e.userId }), s({
      item: l == null ? void 0 : l.itemLocale,
      userId: e == null ? void 0 : e.userId,
      currencyMap: m
    }));
  }, [e == null ? void 0 : e.userId, o]), x(() => {
    !a || a.length === 0 || u(!0);
  }, [a]);
  const d = O(() => {
    u(!1);
  }, []);
  return /* @__PURE__ */ r.createElement(r.Fragment, null, a && g && /* @__PURE__ */ r.createElement(te, { onClose: d }, "You already have another pending order that contains this item. Please complete that order before making another purchase.", " ", /* @__PURE__ */ r.createElement(
    Q,
    {
      to: t.orders.detail.makePath({
        params: { orderNo: a[0].orderNo }
      })
    },
    "Continue to Payment"
  )), n);
}
const dn = () => {
  const { state: n } = Y(), {
    state: { isSingleGame: e }
  } = me(), { mutations: s } = We();
  x(() => {
    var o;
    const i = new URLSearchParams((o = n.location) == null ? void 0 : o.search), t = i.get(ge);
    t && t === ze.success && (a(), i.delete(ge), n.replace(`${n.location.pathname}?${i.toString()}`));
  }, [n.location]);
  const a = () => {
    s.push({
      type: Be.success,
      element: /* @__PURE__ */ r.createElement(B, { i18nKey: "LinkPlatformAccountPage.notification.accountLinked" }, "Account linked"),
      autoDismiss: !0
    });
  };
  return /* @__PURE__ */ r.createElement("main", { className: "homePage" }, e ? /* @__PURE__ */ r.createElement(pn, null) : /* @__PURE__ */ r.createElement(fn, null));
}, fn = () => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Zt, null), /* @__PURE__ */ r.createElement(nn, null)), pn = () => /* @__PURE__ */ r.createElement(mn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(sn, null, /* @__PURE__ */ r.createElement(ln, null)))), $ = r.createContext({});
function ar({ basePath: n, initialData: e }) {
  var c, l, m;
  const {
    state: { playerPortalConfigData: s }
  } = P(), { state: a } = Y(), [i] = Qe(), t = (c = s == null ? void 0 : s.homepage) == null ? void 0 : c.data;
  if (x(() => {
    if (t != null && t.isDisabled && t.redirectionURL && (i != null && i.baseURL)) {
      const g = it.getRouterRedirection(t == null ? void 0 : t.redirectionURL, i == null ? void 0 : i.baseURL);
      if (g && g !== "/") {
        const u = n ? g.replace(n, "") : g;
        a.replace(u);
      } else
        window.location.href = t.redirectionURL;
    }
  }, [t == null ? void 0 : t.isDisabled, t == null ? void 0 : t.redirectionURL, i]), t != null && t.isDisabled && t.redirectionURL)
    return null;
  const o = new Map(Object.entries(((l = e == null ? void 0 : e.singleGame) == null ? void 0 : l.currencyObject) ?? ((m = e == null ? void 0 : e.multipleGame) == null ? void 0 : m.currencyObject) ?? {}));
  return /* @__PURE__ */ r.createElement(nt.Provider, { value: o }, /* @__PURE__ */ r.createElement($.Provider, { value: e }, /* @__PURE__ */ r.createElement(dn, null)));
}
const gn = async ({ sdk: n, country: e }) => {
  const s = M.ItemApi(n).getItemsByCriteria({
    limit: 5,
    tags: "banner",
    region: e
  }), a = de.getCurrencyMap(n), i = M.ItemApi(n).getItemsByCriteria({
    tags: "featured",
    limit: 5,
    region: e
  }), [t, o, c] = await Promise.all([s, a, i]);
  return {
    bannerItem: t,
    currencyObject: Object.fromEntries(o.entries()),
    // Map isn't supported in json
    featuredGames: c
  };
}, yn = async ({ sdk: n, appId: e, country: s }) => {
  const a = Ve.language, i = await M.ItemApi(n).getItemsByAppId({ appId: e }), t = i == null ? void 0 : i.itemId, [o, c, l] = await Promise.all([
    M.ItemApi(n).getLocale_ByItemId(t, {
      region: s,
      language: a
    }),
    M.ItemApi(n).getAppLocale_ByItemId(t),
    de.getCurrencyMap(n)
  ]);
  return {
    itemLocale: o,
    appInfo: c,
    currencyObject: Object.fromEntries(l.entries())
    // Map isn't supported in json
  };
}, ir = async ({
  sdk: n,
  country: e,
  isSingleGame: s,
  appId: a
}) => {
  const i = {};
  return s ? a && (i.singleGame = await yn({ sdk: n, appId: a, country: e })) : i.multipleGame = await gn({ sdk: n, country: e }), i;
};
export {
  $ as HomePageContext,
  ar as HomePageWidget,
  ir as homePageFetcher,
  gn as multiGameFetcher,
  yn as singleGameFetcher
};
