import { L as LinkedAccountsErrorAlert } from "./LinkedAccountsErrorAlert.js";
import { D as DesktopChecker, av as LauncherHelper, U as UrlUtils, a as Ctx, j as Alert, h as AlertType, i as CommonError, aC as UserHelper, a3 as Dialog, T as Trans, a4 as DialogBody, a5 as DialogFooter, f as Button, a6 as ButtonType, a7 as ButtonStyle, m as mod, aB as LinkedPlatformId, A as ArrowIcon, t, aJ as LoadingBarIcon, aO as LinkingProgressStatus, ak as gaSendErrorEvent, E as ErrorHelper, Q as IpcChannels, L as Loading, aP as LinkedAccountGroup } from "./index.js";
import React__default from "react";
import { c as classNames } from "./reactSlick.js";
import { A as AccountMainSection, b as AccountMainSectionHeader, a as AccountMainSectionBody } from "./AccountMainSection.js";
import { W as WarningIcon } from "./WarningIcon.js";
import { g as getThirdPartyPlatformIcon } from "./PlatformIcon.js";
import "./dateFns.js";
import "./validator.js";
import "./reactPlayer.js";
import "react-router-dom";
const PlusSignIcon = () => /* @__PURE__ */ React__default.createElement("svg", {
  width: "20",
  height: "20",
  viewBox: "0 0 20 20",
  fill: "none",
  xmlns: "http://www.w3.org/2000/svg"
}, /* @__PURE__ */ React__default.createElement("path", {
  fillRule: "evenodd",
  clipRule: "evenodd",
  d: "M10 4.375C10.3452 4.375 10.625 4.65482 10.625 5V15C10.625 15.3452 10.3452 15.625 10 15.625C9.65482 15.625 9.375 15.3452 9.375 15V5C9.375 4.65482 9.65482 4.375 10 4.375Z",
  fill: "white"
}), /* @__PURE__ */ React__default.createElement("path", {
  fillRule: "evenodd",
  clipRule: "evenodd",
  d: "M15.625 10C15.625 10.3452 15.3452 10.625 15 10.625L5 10.625C4.65482 10.625 4.375 10.3452 4.375 10C4.375 9.65482 4.65482 9.375 5 9.375L15 9.375C15.3452 9.375 15.625 9.65482 15.625 10Z",
  fill: "white"
}));
const linkAccountConfirmDialog = "linkAccountConfirmDialog _linkAccountConfirmDialog_34b5b";
const textWarning = "textWarning _textWarning_aa19d";
const warningIcon = "warningIcon _warningIcon_a1a3e";
var styles = {
  linkAccountConfirmDialog,
  textWarning,
  warningIcon
};
class LinkAccountConfirmDialog extends React__default.Component {
  constructor(props) {
    super(props);
    this.redirectToThirdPartyLogin = (url) => {
      if (DesktopChecker.isDesktopApp()) {
        LauncherHelper.openExternalBrowser(url);
        return;
      }
      window.location.href = url;
    };
    this.loginPlatform = async (platformConfig) => {
      var _a, _b;
      const redirectURI = await UrlUtils.getRedirectUrl(Ctx.getAppState().sdkOptions.redirectURI, (_b = (_a = Ctx.getAppState().state.appHistory) == null ? void 0 : _a.location) == null ? void 0 : _b.pathname);
      const clientId = Ctx.getAppState().sdkOptions.clientId;
      try {
        this.setState({
          fetchThirdPartyLoginUrlError: null,
          isFetching: true
        });
        const result = await this.sdk.IAM.User().getThirdPartyURL({
          platformId: platformConfig.PlatformId,
          queryParams: { clientId, redirectUri: redirectURI }
        });
        if (result.error)
          throw result.error;
        this.setState({ isFetched: true });
        this.redirectToThirdPartyLogin(result.response.data.third_party_url);
      } catch (error) {
        console.error(error);
        this.setState({ fetchThirdPartyLoginUrlError: error });
      } finally {
        this.setState({ isFetching: false });
      }
    };
    this.state = {
      fetchThirdPartyLoginUrlError: null,
      isFetching: false,
      isFetched: false
    };
    this.sdk = Ctx.getAppState().getSdk();
  }
  renderError() {
    const { fetchThirdPartyLoginUrlError: error } = this.state;
    if (!error)
      return;
    return /* @__PURE__ */ React__default.createElement(Alert, {
      className: "my-6",
      type: AlertType.danger
    }, /* @__PURE__ */ React__default.createElement(CommonError, {
      error
    }));
  }
  render() {
    const { onCancel, platformConfig } = this.props;
    const { isFetching, isFetched } = this.state;
    const { PlatformId } = platformConfig;
    const platformName = UserHelper.getPlatformName(PlatformId);
    return /* @__PURE__ */ React__default.createElement(Dialog, {
      className: styles.linkAccountConfirmDialog,
      title: /* @__PURE__ */ React__default.createElement(Trans, {
        i18nKey: "LinkedAccountPage.confirmLinkDialog.title"
      }, "Linking to your ", /* @__PURE__ */ React__default.createElement("span", {
        className: "capitalize"
      }, { platformName }), " Account"),
      isOpen: true
    }, /* @__PURE__ */ React__default.createElement(DialogBody, null, this.renderError(), /* @__PURE__ */ React__default.createElement("p", {
      className: "dialogPlatformBodyText"
    }, isFetched ? /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.confirmLinkDialog.redirecting"
    }, "Redirecting to the ", /* @__PURE__ */ React__default.createElement("span", {
      className: "capitalize"
    }, { platformName }), " login page. Please open your browser to finish the process.") : /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.confirmLinkDialog.linkConfirm"
    }, "Link to ", /* @__PURE__ */ React__default.createElement("span", {
      className: "capitalize"
    }, { platformName }), " Account will allow you to share your profile, game progression, and earned game content with your AccelByte account.", /* @__PURE__ */ React__default.createElement("div", {
      className: classNames("my-4 flex", styles.textWarning)
    }, /* @__PURE__ */ React__default.createElement("div", {
      className: "mr-3"
    }, /* @__PURE__ */ React__default.createElement(WarningIcon, {
      defaultColor: false,
      className: styles.warningIcon
    })), /* @__PURE__ */ React__default.createElement("div", null, "Once you have linked your ", /* @__PURE__ */ React__default.createElement("span", {
      className: "capitalize"
    }, { platformName }), " to your AccelByte account, you will not be able to link a different ", /* @__PURE__ */ React__default.createElement("span", null, { platformName }), " account to it")), "You will be redirected to the ", { platformName }, " login page to finish the link account process."))), /* @__PURE__ */ React__default.createElement(DialogFooter, null, /* @__PURE__ */ React__default.createElement("div", {
      className: "flex justify-end"
    }, /* @__PURE__ */ React__default.createElement(Button, {
      className: "btn btn-ghost mr-2 uppercase",
      buttonType: ButtonType.TEXT,
      buttonStyle: ButtonStyle.NONE,
      onClick: onCancel
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.linkAccount.modal.action.cancel"
    }, "Cancel")), !isFetched && /* @__PURE__ */ React__default.createElement(Button, {
      className: "btn btn-primary uppercase",
      isLoading: isFetching,
      onClick: () => {
        this.loginPlatform(platformConfig);
      }
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.linkAccount.modal.action.continue"
    }, "Continue")))));
  }
}
var LinkedAccountsPage$1 = "";
const AllowedThirdPartyClient = mod.enum([
  LinkedPlatformId.enum.steamopenid,
  LinkedPlatformId.enum.epicgames,
  LinkedPlatformId.enum.ps4web,
  LinkedPlatformId.enum.xblweb,
  LinkedPlatformId.enum.facebook,
  LinkedPlatformId.enum.google,
  LinkedPlatformId.enum.twitch,
  LinkedPlatformId.enum.apple,
  LinkedPlatformId.enum.stadiaweb,
  LinkedPlatformId.enum.discord
]);
class LinkAccountDialog extends React__default.Component {
  constructor(props) {
    super(props);
    this.fetchThirdPartyLoginConfig = async () => {
      if (this.state.isFetchingThirdPartyLoginConfig)
        return;
      this.setState({ isFetchingThirdPartyLoginConfig: true, fetchThirdPartyLoginConfigError: null });
      try {
        const thirdPartyCredentialService = Ctx.getAppState().getSdk().IAM.ThirdPartyCredential();
        const result = await thirdPartyCredentialService.getThirdPartyPlatformInfo();
        if (result.error)
          throw result.error;
        const thirdPartyLoginConfig = result.response.data.filter((config) => !!AllowedThirdPartyClient.enum[config.PlatformId] && config.IsActive);
        this.setState({ thirdPartyLoginConfig });
      } catch (error) {
        console.error(error);
        this.setState({ fetchThirdPartyLoginConfigError: error });
      } finally {
        this.setState({ isFetchingThirdPartyLoginConfig: false });
      }
    };
    this.renderPlatformList = () => {
      const { thirdPartyLoginConfig } = this.state;
      if (thirdPartyLoginConfig.length < 1) {
        return /* @__PURE__ */ React__default.createElement("div", {
          className: "platformBox disabled text-center"
        }, /* @__PURE__ */ React__default.createElement(Trans, {
          i18nKey: "LinkedAccountPage.linkAccount.modal.noPlatformConfig"
        }, "No third party platform available"));
      }
      return thirdPartyLoginConfig.map((platformConfig) => {
        const disabled = this.props.linkedPlatform.has(platformConfig.PlatformId);
        if (disabled || !platformConfig.IsActive)
          return null;
        return /* @__PURE__ */ React__default.createElement("div", {
          onClick: () => {
            this.props.openConfirmLinkToPlatformDialog(platformConfig);
          },
          role: "button",
          key: platformConfig.PlatformId,
          className: "platformBox"
        }, /* @__PURE__ */ React__default.createElement("span", {
          className: "platform flex items-center capitalize"
        }, getThirdPartyPlatformIcon(platformConfig.PlatformId)), !disabled && /* @__PURE__ */ React__default.createElement(ArrowIcon, null), disabled && /* @__PURE__ */ React__default.createElement("span", {
          className: "text-green-40 uppercase"
        }, /* @__PURE__ */ React__default.createElement(Trans, {
          i18nKey: "LinkAccountDialog.linked"
        }, "Linked")));
      });
    };
    this.state = {
      thirdPartyLoginConfig: [],
      isFetchingThirdPartyLoginConfig: false,
      fetchThirdPartyLoginConfigError: null,
      fetchThirdPartyLoginUrlError: null
    };
  }
  componentDidMount() {
    this.fetchThirdPartyLoginConfig();
  }
  render() {
    const { onClose } = this.props;
    const { isFetchingThirdPartyLoginConfig, fetchThirdPartyLoginConfigError, fetchThirdPartyLoginUrlError } = this.state;
    const publisherName = t("Common.publisherName");
    return /* @__PURE__ */ React__default.createElement(Dialog, {
      className: "purchaseDialog",
      title: t("LinkedAccountPage.title"),
      isOpen: true,
      onClose: () => {
        if (onClose) {
          onClose();
        }
      }
    }, /* @__PURE__ */ React__default.createElement(DialogBody, null, /* @__PURE__ */ React__default.createElement("div", {
      className: "dialogPlatformBodyText"
    }, isFetchingThirdPartyLoginConfig && /* @__PURE__ */ React__default.createElement("div", {
      className: "text-center"
    }, /* @__PURE__ */ React__default.createElement(LoadingBarIcon, null)), !isFetchingThirdPartyLoginConfig && !!fetchThirdPartyLoginConfigError && /* @__PURE__ */ React__default.createElement("div", {
      className: "text-center"
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.linkAccount.modal.fetchConfigFail"
    }, "Unable to get third party platform information ", /* @__PURE__ */ React__default.createElement("br", null), /* @__PURE__ */ React__default.createElement("a", {
      role: "button",
      onClick: this.fetchThirdPartyLoginConfig
    }, "Try Again"))), !isFetchingThirdPartyLoginConfig && !fetchThirdPartyLoginConfigError && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, fetchThirdPartyLoginUrlError && /* @__PURE__ */ React__default.createElement(Alert, {
      className: "mb-6",
      type: AlertType.danger
    }, /* @__PURE__ */ React__default.createElement(CommonError, {
      error: fetchThirdPartyLoginUrlError
    })), /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.linkAccountDialog"
    }, "Select the platform you want to link to your ", { publisherName }, " account."), /* @__PURE__ */ React__default.createElement("div", {
      className: "dialogPlatformList"
    }, this.renderPlatformList())))));
  }
}
class UnlinkAccountConfirmDialog extends React__default.Component {
  constructor(props) {
    super(props);
  }
  render() {
    const { onCancel, onConfirm, platformId } = this.props;
    const platformName = UserHelper.getPlatformName(platformId);
    const publisherName = t("Common.publisherName");
    return /* @__PURE__ */ React__default.createElement(Dialog, {
      className: "purchaseDialog",
      title: t("LinkedAccountPage.confirmUnlinkDialog.title"),
      isOpen: true
    }, /* @__PURE__ */ React__default.createElement(DialogBody, null, /* @__PURE__ */ React__default.createElement("p", {
      className: "dialogPlatformBodyText"
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.confirmUnlinkDialog.unlinkConfirm"
    }, "Do you want to unlink your ", /* @__PURE__ */ React__default.createElement("span", {
      className: "capitalize"
    }, { platformName }), " account from", { publisherName }, "?"))), /* @__PURE__ */ React__default.createElement(DialogFooter, null, /* @__PURE__ */ React__default.createElement("div", {
      className: "flex justify-end"
    }, /* @__PURE__ */ React__default.createElement(Button, {
      className: "btn btn-ghost mr-2 uppercase",
      buttonType: ButtonType.TEXT,
      buttonStyle: ButtonStyle.NONE,
      onClick: () => {
        if (onCancel)
          onCancel();
      }
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkAccountPage.cancel"
    }, "Cancel")), /* @__PURE__ */ React__default.createElement(Button, {
      className: "btn btn-primary uppercase",
      onClick: () => {
        if (onConfirm) {
          onConfirm();
        }
      }
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkAccountPage.unlink"
    }, "Unlink")))));
  }
}
class LinkedAccountsPage extends React__default.Component {
  constructor(props) {
    var _a;
    super(props);
    this.getUserDistinctLinkedPlatform = async () => {
      if (!this.userId)
        return;
      await this.linkedAccountsManager.getUserDistinctLinkedPlatform(this.userId);
    };
    this.refreshUI = () => {
      this.setState({});
    };
    this.linkIfGivenParameter = async (url) => {
      const searchParams = url ? new URL(url).search : window.location.search;
      const requestId = UrlUtils.silentSearchParamsBuilder(searchParams).get("requestId");
      const { appHistory } = Ctx.getAppState().state;
      this.setState({ isOpenLinkAccountDialog: false, selectedPlatformToLink: null });
      if (requestId && this.userId) {
        this.clearAlertStatus();
        try {
          const result = await this.linkedAccountsManager.requestStatus(requestId);
          if (result && result.status === LinkingProgressStatus.enum.SUCCESS) {
            this.setState({ accountLinkingSuccessful: true });
            this.appState.updateUserCustomAttribute(this.userId, result.payload.platformId);
          }
        } catch (error) {
          this.setState({ accountLinkError: error });
        }
      }
      await this.getUserDistinctLinkedPlatform();
      appHistory.replace(appHistory.location.pathname);
    };
    this.clearAlertStatus = () => {
      this.linkedAccountsManager.setState({ error: null, accountConflictInformation: null });
      this.setState({
        accountUnlinkingSuccessful: false,
        accountLinkingSuccessful: false,
        accountUnlinkError: null,
        accountLinkError: null
      });
    };
    this.openLinkAccountDialog = () => {
      this.setState({ isOpenLinkAccountDialog: true });
    };
    this.openConfirmLinkDialog = (platform) => {
      this.setState({ selectedPlatformToLink: platform });
    };
    this.openConfirmUnlinkDialog = (platformName) => {
      this.setState({ selectedUnlinkAblePlatformName: platformName });
    };
    this.onConfirmUnlinkAccount = async (platformName) => {
      this.clearAlertStatus();
      try {
        await this.linkedAccountsManager.unLinkAccount(platformName);
        this.setState({ accountUnlinkingSuccessful: true });
      } catch (error) {
        this.setState({ accountLinkError: error });
      } finally {
        this.setState({ selectedUnlinkAblePlatformName: null });
        await this.getUserDistinctLinkedPlatform();
      }
    };
    this.renderListPlatform = (platform) => {
      const { platformName, details } = platform;
      const displayName = details[0].displayName || "";
      const { isLinking } = this.linkedAccountsManager.state;
      if (!platformName)
        return null;
      return /* @__PURE__ */ React__default.createElement("tr", {
        key: platformName
      }, /* @__PURE__ */ React__default.createElement("td", {
        className: "text-left font-medium capitalize"
      }, /* @__PURE__ */ React__default.createElement("span", {
        className: "platform flex items-center"
      }, getThirdPartyPlatformIcon(platformName))), /* @__PURE__ */ React__default.createElement("td", {
        className: "text-left"
      }, !displayName && /* @__PURE__ */ React__default.createElement(Trans, {
        i18nKey: "LinkedAccountPage.connected"
      }, "Connected"), !!displayName && /* @__PURE__ */ React__default.createElement(Trans, {
        i18nKey: "LinkedAccountPage.connectedTo"
      }, "Connected to ", { displayName })), /* @__PURE__ */ React__default.createElement("td", {
        className: "text-right"
      }, /* @__PURE__ */ React__default.createElement("span", {
        className: classNames("action", isLinking && "text-[color:rgb(var(--od-rgb-text),0.65)]"),
        onClick: () => {
          if (!isLinking) {
            this.openConfirmUnlinkDialog(platformName);
          }
        }
      }, /* @__PURE__ */ React__default.createElement(Trans, {
        i18nKey: "LinkedAccountsPage.disconnect"
      }, "Unlink"))));
    };
    this.renderAlerts = () => {
      const { accountUnlinkingSuccessful, accountLinkingSuccessful, accountLinkError, accountUnlinkError } = this.state;
      const { error, accountConflictInformation } = this.linkedAccountsManager.state;
      if (accountLinkingSuccessful) {
        return /* @__PURE__ */ React__default.createElement(Alert, {
          className: "mb-6",
          type: AlertType.success,
          onDismiss: () => this.clearAlertStatus()
        }, /* @__PURE__ */ React__default.createElement(Trans, {
          i18nKey: "LinkedAccountPage.linkSuccess"
        }, "Cool! Your account is now linked."));
      }
      if (accountUnlinkingSuccessful) {
        return /* @__PURE__ */ React__default.createElement(Alert, {
          className: "mb-6",
          type: AlertType.info,
          onDismiss: () => this.clearAlertStatus()
        }, /* @__PURE__ */ React__default.createElement(Trans, {
          i18nKey: "LinkedAccountPage.unlinkSuccess"
        }, "Your account has been unlinked."));
      }
      if (error || accountLinkError || accountUnlinkError || accountConflictInformation) {
        if (accountLinkError) {
          gaSendErrorEvent({ eventCategory: "LinkAccountError", eventLabel: ErrorHelper.errorToString(accountLinkError) });
        }
        if (accountUnlinkError) {
          gaSendErrorEvent({
            eventCategory: "UnlinkAccountError",
            eventLabel: ErrorHelper.errorToString(accountUnlinkError)
          });
        }
        return /* @__PURE__ */ React__default.createElement(LinkedAccountsErrorAlert, {
          error: error || accountLinkError || accountUnlinkError,
          accountConflictInformation,
          onDismiss: this.clearAlertStatus
        });
      }
      return null;
    };
    this.linkedAccountsManager = Ctx.getAppState().linkAccountManager;
    this.linkedAccountsManager.subscribe(this.refreshUI);
    this.appState = Ctx.getAppState();
    this.userId = (_a = Ctx.getAppState().getUser()) == null ? void 0 : _a.userId;
    this.state = {
      isOpenLinkAccountDialog: false,
      selectedUnlinkAblePlatformName: null,
      selectedPlatformToLink: null,
      accountUnlinkingSuccessful: false,
      accountLinkingSuccessful: false,
      accountUnlinkError: null,
      accountLinkError: null,
      platformNamespace: ""
    };
  }
  componentDidMount() {
    this.linkIfGivenParameter();
    if (DesktopChecker.isDesktopApp()) {
      Device.receive(IpcChannels.OPEN_URL, (url) => {
        this.linkIfGivenParameter(url);
      });
    }
  }
  componentWillUnmount() {
    if (DesktopChecker.isDesktopApp()) {
      Device.remove(IpcChannels.OPEN_URL);
    }
  }
  render() {
    const { isOpenLinkAccountDialog, selectedUnlinkAblePlatformName, selectedPlatformToLink } = this.state;
    const { linkedPlatform, isFetching, isLinking } = this.linkedAccountsManager.state;
    return /* @__PURE__ */ React__default.createElement(AccountMainSection, {
      className: "linkedAccountsPage"
    }, /* @__PURE__ */ React__default.createElement(AccountMainSectionHeader, null, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountsPage.title"
    }, "Linked Accounts")), /* @__PURE__ */ React__default.createElement(AccountMainSectionBody, null, this.renderAlerts(), isFetching && /* @__PURE__ */ React__default.createElement("div", {
      className: "flex"
    }, /* @__PURE__ */ React__default.createElement(Loading, {
      className: "justify-center"
    })), linkedPlatform && /* @__PURE__ */ React__default.createElement("table", {
      className: "w-full"
    }, /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", {
      className: "text-left"
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountsPage.paymentAccounts.platform"
    }, "Platform")), /* @__PURE__ */ React__default.createElement("th", {
      className: "text-left"
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountsPage.paymentAccounts.status"
    }, "Status")), /* @__PURE__ */ React__default.createElement("th", null))), /* @__PURE__ */ React__default.createElement("tbody", {
      className: "border-gray-80 border-b border-solid"
    }, linkedPlatform.length >= 0 && linkedPlatform.map((platform) => this.renderListPlatform(platform)), linkedPlatform && linkedPlatform.length === 0 && /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", {
      colSpan: 3,
      className: "text-center"
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.noLinkedAccount"
    }, "You have no linked accounts."))))), /* @__PURE__ */ React__default.createElement(Button, {
      loadingIndicator: "SPINNER",
      disabled: isLinking || !linkedPlatform,
      className: "btn btn-primary connectButtonPlatform",
      isLoading: isLinking,
      onClick: this.openLinkAccountDialog
    }, /* @__PURE__ */ React__default.createElement(Trans, {
      i18nKey: "LinkedAccountPage.btn.LinkAccount"
    }, "Link Account"), /* @__PURE__ */ React__default.createElement("span", {
      className: "ml-2"
    }, /* @__PURE__ */ React__default.createElement(PlusSignIcon, null))), isOpenLinkAccountDialog && linkedPlatform && /* @__PURE__ */ React__default.createElement(LinkAccountDialog, {
      openConfirmLinkToPlatformDialog: this.openConfirmLinkDialog,
      onClose: () => this.setState({ isOpenLinkAccountDialog: false }),
      linkedPlatform: new Set(linkedPlatform.map((linked) => {
        switch (true) {
          case linked.platformName === LinkedPlatformId.enum.steam:
            return LinkedPlatformId.enum.steamopenid;
          case linked.platformName === LinkedAccountGroup.enum.psn:
            return LinkedPlatformId.enum.ps4web;
          case linked.platformName === LinkedPlatformId.enum.live:
          case linked.platformName === LinkedPlatformId.enum.xblweb:
            return LinkedPlatformId.enum.xblweb;
          case linked.platformName === LinkedPlatformId.enum.stadia:
          case linked.platformName === LinkedPlatformId.enum.stadiaweb:
            return LinkedPlatformId.enum.stadiaweb;
          case linked.platformName === LinkedPlatformId.enum.facebook:
            return LinkedPlatformId.enum.facebook;
          case linked.platformName === LinkedPlatformId.enum.apple:
            return LinkedPlatformId.enum.apple;
          default:
            return linked.platformName;
        }
      }).filter((id) => !!id))
    }), selectedUnlinkAblePlatformName && /* @__PURE__ */ React__default.createElement(UnlinkAccountConfirmDialog, {
      platformId: selectedUnlinkAblePlatformName,
      onCancel: () => this.setState({ selectedUnlinkAblePlatformName: null }),
      onConfirm: () => this.onConfirmUnlinkAccount(selectedUnlinkAblePlatformName)
    }), selectedPlatformToLink && /* @__PURE__ */ React__default.createElement(LinkAccountConfirmDialog, {
      platformConfig: selectedPlatformToLink,
      onCancel: () => this.setState({ selectedPlatformToLink: null })
    })));
  }
}
export { LinkedAccountsPage as default };
