import { ItemImageTag as i } from "./accelbyte-widgets192.mjs";
import { EcomPath as o } from "./accelbyte-widgets59.mjs";
import { ItemHelper as n } from "./accelbyte-widgets398.mjs";
import r from "./accelbyte-widgets553.mjs";
import { ItemInfo as s } from "@accelbyte/sdk-platform";
import t from "react";
import { ExtendedLink as c } from "./accelbyte-widgets549.mjs";
import a from "./accelbyte-widgets554.mjs";
import { Ctx as g } from "./accelbyte-widgets33.mjs";
const d = ({ item: e }) => /* @__PURE__ */ t.createElement("div", { className: a.gameItem }, /* @__PURE__ */ t.createElement("div", { className: a.imageContainer }, /* @__PURE__ */ t.createElement("img", { alt: e.title, src: r, loading: "lazy" })), /* @__PURE__ */ t.createElement("div", { className: a.title }, e.title)), I = ({ item: e }) => {
  const m = g.getAppState().isSingleGame();
  if (!e)
    return null;
  const l = n.getFilteredImageUrlByTag(e.images, i.productCover) || r;
  return /* @__PURE__ */ t.createElement("div", { className: a.gameItem }, /* @__PURE__ */ t.createElement(
    c,
    {
      to: o.GameItem.makePath({
        itemId: e.itemId
      }),
      isDisabled: m
    },
    /* @__PURE__ */ t.createElement("div", { className: a.imageContainer }, /* @__PURE__ */ t.createElement("img", { alt: e.title, src: l, loading: "lazy" })),
    /* @__PURE__ */ t.createElement("div", { className: a.title }, e.title)
  ));
}, S = ({ item: e }) => {
  if (!e)
    return null;
  const m = s.safeParse(e);
  return m.success ? /* @__PURE__ */ t.createElement(I, { item: m.data }) : /* @__PURE__ */ t.createElement(d, { item: e });
};
export {
  S as GameItem
};
