"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
/*
 *  This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
const antd_1 = require("antd");
const A_1 = __importDefault(require("components/misc/A"));
const base_path_1 = __importDefault(require("lib/base-path"));
const customize_1 = require("lib/customize");
const router_1 = require("next/router");
const path_1 = require("path");
const STYLE = {
    textAlign: "center",
    padding: "30px 15px 0 15px",
};
function SignIn({ startup, hideFree }) {
    const { anonymousSignup, siteName, account } = (0, customize_1.useCustomize)();
    const router = (0, router_1.useRouter)();
    if (account != null) {
        return ((0, jsx_runtime_1.jsx)("div", { style: STYLE, children: (0, jsx_runtime_1.jsxs)(A_1.default, { className: "ant-btn", href: (0, path_1.join)(base_path_1.default, "projects"), external: true, style: { margin: "15px", fontSize: "14pt" }, title: `Open the ${siteName} app and view your projects`, children: ["View Your ", siteName, " Projects..."] }) }));
    }
    return ((0, jsx_runtime_1.jsxs)("div", { style: STYLE, children: [anonymousSignup && ((0, jsx_runtime_1.jsxs)(antd_1.Button, { size: "large", type: "primary", style: { margin: "10px" }, title: "Try now without creating an account!", onClick: () => router.push("/auth/try"), children: ["Try\u00A0", startup ?? siteName, "\u00A0Now"] })), (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "large", style: { margin: "10px" }, title: "Either create a new account or sign into an existing account.", onClick: () => router.push("/auth/sign-in"), children: "Sign In" }), (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "large", style: { margin: "10px" }, title: "Create a new account.", onClick: () => router.push("/auth/sign-up"), children: "Sign Up" }), !hideFree && ((0, jsx_runtime_1.jsx)("div", { style: { padding: "15px 0 30px 0" }, children: "Start free today. Upgrade later." }))] }));
}
exports.default = SignIn;
//# sourceMappingURL=sign-in.js.map