import { adminPortalAssets } from '../../../../../internal/assets/dist/index.mjs';
import React__default from 'react';
import { Instruction } from '../components/Instruction.mjs';
import { InstructionSet } from '../components/InstructionSet.mjs';
import { PaddedContainer } from '../components/PaddedContainer.mjs';
import { Screenshot } from '../shared/components/Screenshot.mjs';
import { useProjectName } from '../utils/useProjectName.mjs';
import { getIdpAndConnectionInfo } from './IdpInfo.mjs';

const OktaSamlInstructions$2 = ()=>{
    const projectName = useProjectName();
    return /*#__PURE__*/ React__default.createElement(InstructionSet, null, /*#__PURE__*/ React__default.createElement(Instruction, null, "In the Okta Admin Dashboard navigate to ", /*#__PURE__*/ React__default.createElement("b", null, "Applications"), " on the left hand side, and select", ' ', /*#__PURE__*/ React__default.createElement("b", null, "Create App Integration"), "."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.oktaCreateAppIntegration,
        alt: "Okta Create App Integration"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Select ", /*#__PURE__*/ React__default.createElement("b", null, "SAML 2.0"), " and continue to the the General Settings form, setting ", projectName, " or similar as the name of the application before continuing on to the ", /*#__PURE__*/ React__default.createElement("b", null, "Configure SAML"), " page."));
};
const EntraSamlInstructions$2 = ()=>{
    const projectName = useProjectName();
    return /*#__PURE__*/ React__default.createElement(InstructionSet, null, /*#__PURE__*/ React__default.createElement(Instruction, null, "Log into the ", /*#__PURE__*/ React__default.createElement("b", null, "Microsoft Entra Admin Center"), " and navigate to ", /*#__PURE__*/ React__default.createElement("b", null, "Applications → Enterprise applications"), ' ', "on the left hand navigation bar."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.entraCreateNewApplication,
        alt: "Entra Create New Application"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Within the All Applications tab, select ", /*#__PURE__*/ React__default.createElement("b", null, "New Application"), " and then from within the Microsoft Entra Gallery page select the ", /*#__PURE__*/ React__default.createElement("b", null, "Create your own application"), " option."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.entraCreateOwnApp,
        alt: "Entra Create Own App"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Name your application ", projectName, " or something similar, and choose", ' ', /*#__PURE__*/ React__default.createElement("b", null, "Integrate any other application you don't find in the gallery (Non-gallery)"), " from the toggle options."), /*#__PURE__*/ React__default.createElement(Instruction, null, "Click ", /*#__PURE__*/ React__default.createElement("b", null, "Create"), "."));
};
const GoogleSamlInstructions$1 = ()=>{
    const projectName = useProjectName();
    return /*#__PURE__*/ React__default.createElement(InstructionSet, null, /*#__PURE__*/ React__default.createElement(Instruction, null, "In the ", /*#__PURE__*/ React__default.createElement("b", null, "Google Workspace Admin Console"), " select ", /*#__PURE__*/ React__default.createElement("b", null, "Apps → Web and mobile apps"), " from the left-hand side navigation."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.googleAppsTab,
        alt: "Google Apps Tab"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Select ", /*#__PURE__*/ React__default.createElement("b", null, "Add custom app"), " from the ", /*#__PURE__*/ React__default.createElement("b", null, "Add app"), " dropdown."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.googleAddSamlApp,
        alt: "Google Add SAML App"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Name your application ", projectName, " or something similar and an optional description. Click ", /*#__PURE__*/ React__default.createElement("b", null, "Continue"), "."));
};
const OktaOidcInstructions$1 = ()=>{
    return /*#__PURE__*/ React__default.createElement(InstructionSet, null, /*#__PURE__*/ React__default.createElement("div", null, /*#__PURE__*/ React__default.createElement(Instruction, null, "In the Okta Admin Dashboard navigate to ", /*#__PURE__*/ React__default.createElement("b", null, "Applications"), " on the left hand side, and select", ' ', /*#__PURE__*/ React__default.createElement("b", null, "Create App Integration"), "."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.oktaCreateAppIntegration,
        alt: "Okta Create App Integration"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "On the following page, select the following options:"), /*#__PURE__*/ React__default.createElement(PaddedContainer, null, /*#__PURE__*/ React__default.createElement(Instruction, null, "Sign-in method: OIDC - OpenID Connect"), /*#__PURE__*/ React__default.createElement(Instruction, null, "Application type: Web Application"), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.oktaOidcAppType,
        alt: "Okta OIDC app type"
    }))), /*#__PURE__*/ React__default.createElement(Instruction, null, "Click Next."));
};
const EntraOidcInstructions$1 = ()=>{
    const projectName = useProjectName();
    return /*#__PURE__*/ React__default.createElement(InstructionSet, null, /*#__PURE__*/ React__default.createElement(Instruction, null, "Log into the ", /*#__PURE__*/ React__default.createElement("b", null, "Microsoft Entra Admin Center"), " and navigate to ", /*#__PURE__*/ React__default.createElement("b", null, "Applications → App registrations"), " on the left hand navigation bar."), /*#__PURE__*/ React__default.createElement(Instruction, null, "Within the App registrations tab, select ", /*#__PURE__*/ React__default.createElement("b", null, "New Registration"), " from the top navigation."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.entraOidcAppRegistrations,
        alt: "Entra OIDC App Registrations"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Name your application ", projectName, " or something similar, and select", ' ', /*#__PURE__*/ React__default.createElement("b", null, "Accounts in this organizational directory only (Default Directory only - Single tenant)"), " for", ' ', /*#__PURE__*/ React__default.createElement("b", null, "Supported account types"), "."), /*#__PURE__*/ React__default.createElement(Screenshot, {
        src: adminPortalAssets.entraOidcRegisterApp,
        alt: "Entra OIDC Register App"
    }), /*#__PURE__*/ React__default.createElement(Instruction, null, "Click ", /*#__PURE__*/ React__default.createElement("b", null, "Register"), "."));
};
const CreateApplication = ({ connection: connectionProp })=>{
    const { connection, type } = getIdpAndConnectionInfo(connectionProp);
    if (type === 'saml') {
        switch(connection.identity_provider){
            case 'okta':
                return /*#__PURE__*/ React__default.createElement(OktaSamlInstructions$2, null);
            case 'microsoft-entra':
                return /*#__PURE__*/ React__default.createElement(EntraSamlInstructions$2, null);
            case 'google-workspace':
                return /*#__PURE__*/ React__default.createElement(GoogleSamlInstructions$1, null);
        }
    }
    if (type === 'oidc') {
        switch(connection.identity_provider){
            case 'okta':
                return /*#__PURE__*/ React__default.createElement(OktaOidcInstructions$1, null);
            case 'microsoft-entra':
                return /*#__PURE__*/ React__default.createElement(EntraOidcInstructions$1, null);
        }
    }
    return /*#__PURE__*/ React__default.createElement(React__default.Fragment, null);
};

export { CreateApplication };
//# sourceMappingURL=CreateApplication.mjs.map
