"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServerSideProps = void 0;
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 footer_1 = __importDefault(require("components/landing/footer"));
const header_1 = __importDefault(require("components/landing/header"));
const head_1 = __importDefault(require("components/landing/head"));
const with_customize_1 = __importDefault(require("lib/with-customize"));
const customize_1 = require("lib/customize");
const index_list_1 = __importDefault(require("components/landing/index-list"));
const A_1 = __importDefault(require("components/misc/A"));
const antd_1 = require("antd");
const dataSourceCoCalcCom = [
    {
        link: "/policies/terms",
        title: "Terms of service",
        logo: "thumbs-up",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/terms", children: "Terms of Service" }), " govern use of CoCalc."] })),
    },
    {
        link: "/policies/copyright",
        title: "Copyright policies",
        logo: "dot-circle",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/copyright", children: "Copyright Policy" }), " explains how SageMath, Inc. respects copyright policies, and provides a site that does not infringe on others' copyright."] })),
    },
    {
        link: "/policies/privacy",
        title: "Privacy",
        logo: "user-secret",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/privacy", children: "Privacy Policy" }), " describes how SageMath, Inc. respects the privacy of its users."] })),
    },
    {
        link: "/policies/thirdparties",
        title: "Third parties",
        logo: "users",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Our ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/thirdparties", children: "List of third parties" }), " ", "enumerates what is used to provide CoCalc."] })),
    },
    {
        link: "/policies/ferpa",
        title: "FERPA compliance statement",
        logo: "graduation-cap",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/ferpa", children: "CoCalc's FERPA Compliance statement" }), " ", "explains how we address FERPA requirements at US educational instituations."] })),
    },
    {
        link: "/policies/accessibility",
        title: "Accessibility",
        logo: "eye",
        description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["CoCalc's", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/policies/accessibility", children: "Voluntary Product Accessibility Template (VPAT)" }), " ", "describes how we address accessibility issues."] })),
    },
];
function Policies({ customize }) {
    function dataSourceOnPrem() {
        const ret = [];
        if (customize.imprint) {
            ret.push({
                link: "/policies/imprint",
                title: "Imprint",
                logo: "dot-circle",
                description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}),
            });
        }
        if (customize.policies) {
            ret.push({
                link: "/policies/policies",
                title: "Policies",
                logo: "thumbs-up",
                description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}),
            });
        }
        return ret;
    }
    const dataSource = customize.onCoCalcCom
        ? dataSourceCoCalcCom
        : dataSourceOnPrem();
    const description = customize.onCoCalcCom
        ? "SageMath, Inc.'s terms of service, copyright, privacy and other policies."
        : "";
    return ((0, jsx_runtime_1.jsxs)(customize_1.Customize, { value: customize, children: [(0, jsx_runtime_1.jsx)(head_1.default, { title: "Policies" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout, { children: [(0, jsx_runtime_1.jsx)(header_1.default, { page: "policies" }), (0, jsx_runtime_1.jsx)(index_list_1.default, { title: `${customize.siteName} Policies`, description: description, dataSource: dataSource }), (0, jsx_runtime_1.jsx)(footer_1.default, {}), " "] })] }));
}
exports.default = Policies;
async function getServerSideProps(context) {
    return await (0, with_customize_1.default)({ context });
}
exports.getServerSideProps = getServerSideProps;
//# sourceMappingURL=index.js.map