"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HeaderSupport = HeaderSupport;
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("../core");
const menu_1 = __importDefault(require("../menu"));
const context_1 = require("./context");
/** Supporting internal component to avoid code duplication. */
function ListContent({ links = [] }) {
    const styles = (0, core_1.useStyleConfig)('Header', (0, context_1.useHeaderContext)()).services;
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(menu_1.default.Item, Object.assign({ isTruncated: true, linkProps: { href: 'https://support.veracity.com/' }, text: "Veracity support", title: "Veracity support" }, styles.item), "veracity-support"), (0, jsx_runtime_1.jsx)(menu_1.default.Item, Object.assign({ isTruncated: true, linkProps: { href: 'https://id.veracity.com/terms-of-use' }, text: "Veracity terms", title: "Veracity terms" }, styles.item), "veracity-terms"), (0, jsx_runtime_1.jsx)(menu_1.default.Item, Object.assign({ isTruncated: true, linkProps: { href: 'https://services.veracity.com/PrivacyStatement' }, text: "Privacy", title: "Privacy" }, styles.item), "privacy"), links.length > 0 &&
                links.map(({ text, url }, index) => ((0, jsx_runtime_1.jsx)(menu_1.default.Item, Object.assign({ isTruncated: true, linkProps: { href: url }, text: text, title: text }, styles.item), index)))] }));
}
/** Displays a list of services available to the user. */
function HeaderSupport(props) {
    const { links = [] } = props, rest = __rest(props, ["links"]);
    const styles = (0, core_1.useStyleConfig)('Header', (0, context_1.useHeaderContext)()).services;
    const isTablet = (0, core_1.useDown)('lg');
    const offsetX = isTablet ? 162 : 135;
    return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(menu_1.default, Object.assign({ isLazy: false, offset: [offsetX, 16], placement: "bottom-end", size: "lg" }, rest, { children: [(0, jsx_runtime_1.jsx)(menu_1.default.Button, Object.assign({ className: "vui-app-info-trigger", color: styles.button.color, icon: "falQuestionCircle", ml: 1, size: "lg", title: "Support" }, styles.button)), (0, jsx_runtime_1.jsx)(menu_1.default.List, Object.assign({ maxH: 295, right: 0, w: isTablet ? 280 : 320 }, styles.list, { children: (0, jsx_runtime_1.jsx)(ListContent, { links: links }) }))] })) }));
}
HeaderSupport.displayName = 'HeaderSupport';
exports.default = HeaderSupport;
//# sourceMappingURL=headerSupport.js.map