"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get Button () {
        return Button;
    },
    get ButtonAccent () {
        return ButtonAccent;
    },
    get LinkButton () {
        return LinkButton;
    },
    get Resizer () {
        return Resizer;
    },
    get ScrollableWrapper () {
        return ScrollableWrapper;
    },
    get StyledCheckbox () {
        return StyledCheckbox;
    },
    get StyledDivider () {
        return StyledDivider;
    },
    get Table () {
        return Table;
    },
    get Tbody () {
        return Tbody;
    },
    get Th () {
        return Th;
    },
    get Thead () {
        return Thead;
    },
    get Tr () {
        return Tr;
    },
    get base () {
        return base;
    }
});
const _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
const _engines = require("../../engines");
const _Checkbox = require("../Checkbox");
const _Divider = require("../Divider");
const _Button = require("../Button");
const _LinkButton = require("../LinkButton");
const _Tabletokens = require("./Table.tokens");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
const mergedCheckboxConfig = (0, _engines.mergeConfig)(_Checkbox.checkboxConfig);
const Checkbox = (0, _engines.component)(mergedCheckboxConfig);
const mergedButtonConfig = (0, _engines.mergeConfig)(_Button.buttonConfig);
const ButtonBase = (0, _engines.component)(mergedButtonConfig);
const mergedDividerConfig = (0, _engines.mergeConfig)(_Divider.dividerConfig);
const Divider = (0, _engines.component)(mergedDividerConfig);
const mergedLinkButtonConfig = (0, _engines.mergeConfig)(_LinkButton.linkButtonConfig);
const LinkButtonBase = (0, _engines.component)(mergedLinkButtonConfig);
const base = (0, _styledcomponents.css)([
    `display:inline-flex;flex-direction:column;align-items:flex-start;`
]);
const ScrollableWrapper = _styledcomponents.default.div.withConfig({
    displayName: "Table.styles__ScrollableWrapper",
    componentId: "sc-d6f30174-0"
})([
    `overflow-y:auto;max-height:`,
    `;`
], ({ maxHeight })=>maxHeight || 'none');
const Table = _styledcomponents.default.table.withConfig({
    displayName: "Table.styles__Table",
    componentId: "sc-d6f30174-1"
})([
    `width:fit-content;font-family:var(`,
    `);font-size:var(`,
    `);font-style:var(`,
    `);font-weight:var(`,
    `);letter-spacing:var(`,
    `);line-height:var(`,
    `);border-collapse:collapse;border-width:0;border-style:solid;border-color:`,
    `;`
], _Tabletokens.tableTokens.fontFamily, _Tabletokens.tableTokens.fontSize, _Tabletokens.tableTokens.fontStyle, _Tabletokens.tableTokens.fontWeight, _Tabletokens.tableTokens.letterSpacing, _Tabletokens.tableTokens.lineHeight, ({ borderVariant })=>borderVariant === 'all' ? `var(${_Tabletokens.tableTokens.borderColor})` : 'transparent');
const Tr = _styledcomponents.default.tr.withConfig({
    displayName: "Table.styles__Tr",
    componentId: "sc-d6f30174-2"
})([
    `box-sizing:content-box;width:fit-content;background-color:`,
    `;`
], ({ selected })=>selected ? 'var(--surface-transparent-accent)' : 'transparent');
const Thead = _styledcomponents.default.thead.withConfig({
    displayName: "Table.styles__Thead",
    componentId: "sc-d6f30174-3"
})([
    `position:`,
    `;top:0;background:`,
    `;z-index:10;box-shadow:`,
    `;`,
    `{background:transparent;}`
], ({ stickyHeader })=>stickyHeader ? 'sticky' : 'static', ({ stickyHeader })=>stickyHeader ? 'var(--background-primary)' : 'transparent', ({ view, borderVariant })=>// eslint-disable-next-line no-nested-ternary
    view === 'clear' ? 'none' : borderVariant === 'header' || borderVariant === 'rows' ? `inset 0 -1px 0 0 var(${_Tabletokens.tableTokens.borderColor})` : `inset 0 1px 0 0 var(${_Tabletokens.tableTokens.borderColor}), inset 0 -1px 0 0 var(${_Tabletokens.tableTokens.borderColor})`, Tr);
const Tbody = _styledcomponents.default.tbody.withConfig({
    displayName: "Table.styles__Tbody",
    componentId: "sc-d6f30174-4"
})([
    ``
]);
const Resizer = _styledcomponents.default.div.withConfig({
    displayName: "Table.styles__Resizer",
    componentId: "sc-d6f30174-5"
})([
    `display:`,
    `;position:absolute;z-index:1;top:-0.0625rem;bottom:0;right:-0.125rem;width:0.1875rem;background:var(--outline-accent);cursor:col-resize;user-select:none;touch-action:none;`
], ({ isResizing })=>isResizing ? 'block' : 'none');
const Th = _styledcomponents.default.th.withConfig({
    displayName: "Table.styles__Th",
    componentId: "sc-d6f30174-6"
})([
    `padding:`,
    `;position:relative;font-weight:600;text-align:left;height:var(`,
    `);background-color:transparent;color:inherit;box-sizing:content-box;border-width:0.0625rem;border-top-width:0;border-bottom-width:0;border-style:solid;border-color:`,
    `;box-sizing:border-box;&:hover{`,
    `{display:block;}}`
], ({ selectionCell })=>selectionCell ? `var(${_Tabletokens.tableTokens.checkboxCellPadding})` : `var(${_Tabletokens.tableTokens.cellPadding})`, _Tabletokens.tableTokens.headerRowHeight, ({ borderVariant })=>borderVariant === 'all' ? `var(${_Tabletokens.tableTokens.borderColor})` : 'transparent', Resizer);
const StyledCheckbox = (0, _styledcomponents.default)(Checkbox).withConfig({
    displayName: "Table.styles__StyledCheckbox",
    componentId: "sc-d6f30174-7"
})([
    ``,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`
], _Checkbox.checkboxTokens.triggerSize, _Tabletokens.tableTokens.checkboxTriggerSize, _Checkbox.checkboxTokens.triggerBorderRadius, _Tabletokens.tableTokens.checkboxTriggerBorderRadius, _Checkbox.checkboxTokens.fillColor, _Tabletokens.tableTokens.checkboxFillColor, _Checkbox.checkboxTokens.iconColor, _Tabletokens.tableTokens.checkboxTriggerIconColor, _Checkbox.checkboxTokens.triggerBorderCheckedColor, _Tabletokens.tableTokens.checkboxTriggerBorderCheckedColor, _Checkbox.checkboxTokens.triggerBorderWidth, _Tabletokens.tableTokens.checkboxTriggerBorderWidth, _Checkbox.checkboxTokens.triggerBorderColor, _Tabletokens.tableTokens.checkboxTriggerBorderColor);
const StyledDivider = (0, _styledcomponents.default)(Divider).withConfig({
    displayName: "Table.styles__StyledDivider",
    componentId: "sc-d6f30174-8"
})([
    ``,
    `:0.0625rem;`,
    `:var(--surface-transparent-tertiary);`,
    `:0.0625rem;`
], _Divider.dividerTokens.baseSideSize, _Divider.dividerTokens.background, _Divider.dividerTokens.borderRadius);
const Button = (0, _styledcomponents.default)(ButtonBase).withConfig({
    displayName: "Table.styles__Button",
    componentId: "sc-d6f30174-9"
})([
    ``,
    `:var(`,
    `);`,
    `:0.4;`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`
], _Button.buttonTokens.buttonHeight, _Tabletokens.tableTokens.buttonHeight, _Button.buttonTokens.buttonDisabledOpacity, _Button.buttonTokens.buttonFontFamily, _Tabletokens.tableTokens.buttonFontFamily, _Button.buttonTokens.buttonFontSize, _Tabletokens.tableTokens.buttonFontSize, _Button.buttonTokens.buttonFontStyle, _Tabletokens.tableTokens.buttonFontStyle, _Button.buttonTokens.buttonFontWeight, _Tabletokens.tableTokens.buttonFontWeight, _Button.buttonTokens.buttonLetterSpacing, _Tabletokens.tableTokens.buttonLetterSpacing, _Button.buttonTokens.buttonLineHeight, _Tabletokens.tableTokens.buttonLineHeight);
const ButtonAccent = (0, _styledcomponents.default)(Button).withConfig({
    displayName: "Table.styles__ButtonAccent",
    componentId: "sc-d6f30174-10"
})([
    ``,
    `:var(--on-dark-text-primary);`,
    `:var(--on-dark-text-secondary);`,
    `:var(--surface-accent);`,
    `:var(--surface-accent-hover);`,
    `:var(--surface-accent-active);`
], _Button.buttonTokens.buttonColor, _Button.buttonTokens.buttonValueColor, _Button.buttonTokens.buttonBackgroundColor, _Button.buttonTokens.buttonBackgroundColorHover, _Button.buttonTokens.buttonBackgroundColorActive);
const LinkButton = (0, _styledcomponents.default)(LinkButtonBase).withConfig({
    displayName: "Table.styles__LinkButton",
    componentId: "sc-d6f30174-11"
})([
    ``,
    `:var(--text-primary);`,
    `:var(--text-primary);`,
    `:var(--surface-transparent-clear);`,
    `:var(--text-primary-hover);`,
    `:var(--text-primary-active);`,
    `:var(--text-primary-hover);`,
    `:var(--text-primary-active);`,
    `:var(--surface-accent);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`,
    `:var(`,
    `);`
], _LinkButton.linkButtonTokens.linkButtonIconColor, _LinkButton.linkButtonTokens.linkButtonTextColor, _LinkButton.linkButtonTokens.linkButtonBackgroundColor, _LinkButton.linkButtonTokens.linkButtonIconColorHover, _LinkButton.linkButtonTokens.linkButtonIconColorActive, _LinkButton.linkButtonTokens.linkButtonTextColorHover, _LinkButton.linkButtonTokens.linkButtonTextColorActive, _LinkButton.linkButtonTokens.linkButtonFocusColor, _LinkButton.linkButtonTokens.linkButtonFontFamily, _Tabletokens.tableTokens.linkButtonFontFamily, _LinkButton.linkButtonTokens.linkButtonFontSize, _Tabletokens.tableTokens.linkButtonFontSize, _LinkButton.linkButtonTokens.linkButtonFontStyle, _Tabletokens.tableTokens.linkButtonFontStyle, _LinkButton.linkButtonTokens.linkButtonFontWeight, _Tabletokens.tableTokens.linkButtonFontWeight, _LinkButton.linkButtonTokens.linkButtonLetterSpacing, _Tabletokens.tableTokens.linkButtonLetterSpacing, _LinkButton.linkButtonTokens.linkButtonLineHeight, _Tabletokens.tableTokens.linkButtonLineHeight);
