import { Button as d } from "./accelbyte-widgets107.mjs";
import { Dialog as L, DialogBody as P, DialogFooter as N } from "./accelbyte-widgets235.mjs";
import { ArrowIcon as E, ArrowIconStyles as h } from "./accelbyte-widgets125.mjs";
import { SuccessFlatIcon as A } from "./accelbyte-widgets542.mjs";
import { LauncherDownloadButton as M } from "./accelbyte-widgets543.mjs";
import { t as f } from "./accelbyte-widgets58.mjs";
import { ItemType as s } from "./accelbyte-widgets185.mjs";
import { AccPath as y } from "./accelbyte-widgets34.mjs";
import { EcomPath as C } from "./accelbyte-widgets59.mjs";
import b from "classnames";
import { DesktopChecker as i } from "@accelbyte/sdk";
import e from "react";
import { Trans as t } from "react-i18next";
import { Link as g } from "react-router-dom";
import { OpenLibraryLauncherButton as k } from "./accelbyte-widgets219.mjs";
import "./accelbyte-widgets541.mjs";
const m = (a) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.content" }, /* @__PURE__ */ e.createElement("p", { className: "claimSuccessMessage" }, "Congratulations! You have successfully claimed")), /* @__PURE__ */ e.createElement("p", { className: "claumSuccessTitle" }, a.title)), K = (a) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(m, { title: a.title }), /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.downloadLauncherMessage" }, /* @__PURE__ */ e.createElement("p", { className: "downloadLauncherMessage" }, "You can play this game using Launcher. Don't have Launcher? Click ", /* @__PURE__ */ e.createElement("strong", null, "here"), " to download and install."))), T = (a) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.content" }, /* @__PURE__ */ e.createElement("p", { className: "claimSuccessMessage" }, "Congratulations! You have successfully claimed")), /* @__PURE__ */ e.createElement("p", { className: "inline font-medium text-[color:rgb(var(--od-rgba-text))]" }, a.title, "."), " ", /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.startShoppingMessage" }, /* @__PURE__ */ e.createElement("p", { className: "startShoppingMessage" }, "Let's start shopping!"))), w = () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimCodeMessage.code.description" }, /* @__PURE__ */ e.createElement("p", { className: "claimCodeMessage above" }, "Your product key has been sent to your email. You can also see"), /* @__PURE__ */ e.createElement("p", { className: "claimCodeMessage bottom" }, "the key by clicking the See My Keys button below, or going to")), /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimCodeMessage.code.goToMyPurchasedItem" }, /* @__PURE__ */ e.createElement("p", { className: "goToPurchasedItem" }, /* @__PURE__ */ e.createElement("span", null, "My Account"), /* @__PURE__ */ e.createElement(E, { className: b("arrow", h.right) }), /* @__PURE__ */ e.createElement("span", null, "Purchased Items"), /* @__PURE__ */ e.createElement(E, { className: b("arrow", h.right) }), /* @__PURE__ */ e.createElement("span", null, "Product Keys")))), I = (a) => /* @__PURE__ */ e.createElement(
  "a",
  {
    className: "btn small btn-primary launcherDownloadButton big",
    title: a.miniLauncherLink,
    target: "_blank",
    rel: "noreferrer",
    download: !0,
    href: a.miniLauncherLink
  },
  a.children
);
class J extends e.Component {
  constructor() {
    super(...arguments), this.renderLauncherGoToLibraryButton = () => {
      const { item: n, renderLauncherGoToLibraryButton: l } = this.props;
      return l ? l() : /* @__PURE__ */ e.createElement(k, { item: n });
    };
  }
  render() {
    const { item: n, itemPublishingContent: l, onCloseDialog: S } = this.props, r = n.itemType === s.enum.COINS, o = n.itemType === s.enum.APP, u = n.itemType === s.enum.CODE, D = n.itemType === s.enum.OPTIONBOX, c = n.title ? n.title : "DEFAULT_ITEM_TITLE", p = l && l.miniLauncherUrl || "";
    return /* @__PURE__ */ e.createElement(L, { title: f("AppDetailPage.dialog.claimSuccess.title"), isOpen: !0, className: "claimStatusDialog" }, /* @__PURE__ */ e.createElement(P, null, /* @__PURE__ */ e.createElement(A, { className: "successIcon" }), o && /* @__PURE__ */ e.createElement(e.Fragment, null, !i.isDesktopApp() && (p && /* @__PURE__ */ e.createElement(m, { title: c }) || /* @__PURE__ */ e.createElement(K, { title: c })), i.isDesktopApp() && /* @__PURE__ */ e.createElement(m, { title: c })), r && /* @__PURE__ */ e.createElement(T, { title: c }), u && /* @__PURE__ */ e.createElement(w, null), !(o || r || u) && /* @__PURE__ */ e.createElement(m, { title: c })), /* @__PURE__ */ e.createElement(N, { className: `dialogFooterSuccess ${!o && !r ? "center" : "end"}` }, /* @__PURE__ */ e.createElement("button", { onClick: S, className: "btn big btnOk" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.ok" }, "OK")), !i.isDesktopApp() && o && (p && /* @__PURE__ */ e.createElement(I, { miniLauncherLink: p }, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.downloadNow" }, "Download Now")) || /* @__PURE__ */ e.createElement(M, { className: "big btnGetLauncher" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimSuccess.getLauncherButton" }, "Get Launcher"))), i.isDesktopApp() && o && this.renderLauncherGoToLibraryButton(), r && /* @__PURE__ */ e.createElement(g, { to: C.Store.makePath(), className: "btn big btn-primary btnGoToStore" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "ClaimSuccessDialog.goStore" }, "Go To Store")), u && /* @__PURE__ */ e.createElement(g, { to: y.PurchasedKeys.makePath() }, /* @__PURE__ */ e.createElement(d, { className: "btn big btn-primary btnSeeKeys" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimCodeSuccess.button.seeMyKeys" }, "See My Keys"))), D && /* @__PURE__ */ e.createElement(g, { to: y.PurchasedOptionbox.makePath() }, /* @__PURE__ */ e.createElement(d, { className: "btn big btn-primary btnSeeKeys" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "AppDetailPage.dialog.claimOptionboxSuccess.button.seeMyItem" }, "See My Option box")))));
  }
}
export {
  J as ClaimSuccessDialog
};
