import styled from "@emotion/styled";
import { addFocus, applyEllipsis } from "../../../../../../mixins";
import { component, mergeConfig } from "../../../../../../engines";
import { classes, tokens, constants } from "../../../../Select.tokens";
import { checkboxConfig, checkboxTokens } from "../../../../../Checkbox";
import { cellConfig, cellTokens } from "../../../../../Cell";
import { indicatorConfig, indicatorTokens } from "../../../../../Indicator";
import { IconDisclosureRightCentered, IconDone } from "../../../../../_Icon";
export const ItemWrapper = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g0",
    label: "ItemWrapper"
})();
const mergedCheckboxConfig = mergeConfig(checkboxConfig);
const Checkbox = component(mergedCheckboxConfig);
const mergedCellConfig = mergeConfig(cellConfig);
const Cell = component(mergedCellConfig);
const mergedIndicatorConfig = mergeConfig(indicatorConfig);
const Indicator = component(mergedIndicatorConfig);
// TODO: #1548
export const StyledCell = /*#__PURE__*/ styled(Cell, {
    target: "e1ja1k0g1",
    label: "StyledCell"
})(cellTokens.cellTitleColor, ":var(", constants.cellTitleColor, ");", cellTokens.cellBackgroundColor, ":var(", constants.cellBackgroundColor, ");", cellTokens.cellPadding, ":var(", tokens.cellPadding, ");", cellTokens.cellPaddingLeftContent, ":var(", tokens.cellPaddingLeftContent, ");", cellTokens.cellPaddingContent, ":var(", tokens.cellPaddingContent, ");", cellTokens.cellPaddingRightContent, ":var(", tokens.cellPaddingRightContent, ");", cellTokens.cellTextboxGap, ":var(", tokens.cellTextboxGap, ");", cellTokens.cellGap, ":var(", tokens.cellGap, ");", cellTokens.cellTitleFontFamily, ":var(", tokens.cellTitleFontFamily, ");", cellTokens.cellTitleFontSize, ":var(", tokens.cellTitleFontSize, ");", cellTokens.cellTitleFontStyle, ":var(", tokens.cellTitleFontStyle, ");", cellTokens.cellTitleFontWeight, ":var(", tokens.cellTitleFontWeight, ");", cellTokens.cellTitleLetterSpacing, ":var(", tokens.cellTitleLetterSpacing, ");", cellTokens.cellTitleLineHeight, ":var(", tokens.cellTitleLineHeight, ");flex:1;min-width:0;& *{min-width:0;}&.", classes.singleLineMode, " .cell-textbox-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}");
export const StyledCheckbox = /*#__PURE__*/ styled(Checkbox, {
    target: "e1ja1k0g2",
    label: "StyledCheckbox"
})(checkboxTokens.triggerSize, ":var(", tokens.checkboxTriggerSize, ");", checkboxTokens.triggerBorderRadius, ":var(", tokens.checkboxTriggerBorderRadius, ");", checkboxTokens.fillColor, ":var(", tokens.checkboxFillColor, ");", checkboxTokens.iconColor, ":var(", tokens.checkboxIconColor, ");", checkboxTokens.triggerBorderWidth, ":var(", tokens.checkboxTriggerBorderWidth, ");", checkboxTokens.triggerBorderColor, ":var(", tokens.checkboxTriggerBorderColor, ");", checkboxTokens.triggerBorderCheckedColor, ":var(", tokens.checkboxTriggerBorderCheckedColor, ");");
export const StyledIndicator = /*#__PURE__*/ styled(Indicator, {
    target: "e1ja1k0g3",
    label: "StyledIndicator"
})(indicatorTokens.size, ":var(", tokens.indicatorSize, ");", indicatorTokens.color, ":var(", tokens.itemIconColor, ");");
// TODO: Удалить после поддержки JS переменных в конфиге компонент
export const sizeMap = {
    xs: '1rem',
    s: '1.5rem'
};
export const StyledArrowLeft = /*#__PURE__*/ styled(IconDisclosureRightCentered, {
    target: "e1ja1k0g4",
    label: "StyledArrowLeft"
})("width:", ({ size = 'xs' })=>`var(${tokens.disclosureIconSize}, ${sizeMap[size]})`, ";height:", ({ size = 'xs' })=>`var(${tokens.disclosureIconSize}, ${sizeMap[size]})`, ";&.", classes.arrowInverse, "{transform:rotate(90deg);}");
export const StyledArrowRight = /*#__PURE__*/ styled(IconDisclosureRightCentered, {
    target: "e1ja1k0g5",
    label: "StyledArrowRight"
})("width:", ({ size = 'xs' })=>`var(${tokens.disclosureIconSize}, ${sizeMap[size]})`, ";height:", ({ size = 'xs' })=>`var(${tokens.disclosureIconSize}, ${sizeMap[size]})`, ";transform:rotate(90deg);&.", classes.arrowInverse, "{transform:rotate(-90deg);}");
export const StyledIconDone = /*#__PURE__*/ styled(IconDone, {
    target: "e1ja1k0g6",
    label: "StyledIconDone"
})("width:", ({ size = 'xs' })=>`var(${tokens.disclosureIconSize}, ${sizeMap[size]})`, ";height:", ({ size = 'xs' })=>`var(${tokens.disclosureIconSize}, ${sizeMap[size]})`, ";");
export const DisclosureIconWrapper = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g7",
    label: "DisclosureIconWrapper"
})("line-height:0;color:var(", tokens.disclosureNestedIconColor, ",var(", tokens.disclosureIconColor, "));visibility:", ({ visibility })=>visibility || 'visible', ";&:hover{color:var(", tokens.disclosureNestedIconColorHover, ",var(", tokens.disclosureIconColorHover, "));}");
export const IconWrapper = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g8",
    label: "IconWrapper"
})("display:flex;align-items:center;justify-content:center;flex:none;width:", ({ variant })=>`var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`, ";height:", ({ variant })=>`var(${variant === 'tight' ? tokens.itemIconSizeTight : tokens.itemIconSize})`, ";line-height:0;color:var(", tokens.itemIconColor, ");");
export const StyledText = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g9",
    label: "StyledText"
})(applyEllipsis(), ";flex:1;");
export const Wrapper = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g10",
    label: "Wrapper"
})("display:flex;align-items:center;gap:var(", tokens.itemGap, ");min-height:var(", tokens.itemHeight, ");margin:0;box-sizing:content-box;padding:", ({ variant })=>`var(${variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding})`, ";font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.fontLetterSpacing, ");line-height:var(", tokens.fontLineHeight, ");background-color:var(", constants.itemBackground, ");color:var(--text-primary);border-radius:calc(var(", tokens.borderRadius, ") - 0.125rem - var(", tokens.dropdownBorderWidth, ",0rem));user-select:none;background-clip:padding-box;&:hover:not(.", classes.dropdownItemIsDisabled, "){cursor:pointer;background-color:var(", tokens.itemBackgroundHover, ");}&.", classes.dropdownItemIsActive, "{background-color:var(", tokens.itemBackgroundHover, ");}&.", classes.dropdownItemIsDisabled, "{opacity:", constants.opacity, ";cursor:not-allowed;}:focus{outline:none;}", addFocus({
    outlineSize: '0',
    outlineOffset: '0',
    outlineColor: `var(${constants.focusColor})`,
    outlineRadius: `calc(var(${tokens.borderRadius}) - 0.125rem - var(${tokens.dropdownBorderWidth}, 0rem))`,
    hasTransition: false,
    customFocusRules: `
            &.${classes.dropdownItemIsFocused}:before {
                outline: none;
                box-shadow: inset 0 0 0 0.0625rem var(${constants.focusColor});
            }
        `
}), ";");
export const StyledCheckboxWrapper = /*#__PURE__*/ styled("span", {
    target: "e1ja1k0g11",
    label: "StyledCheckboxWrapper"
})();
export const ChildItems = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g12",
    label: "ChildItems"
})();
export const Offset = /*#__PURE__*/ styled("div", {
    target: "e1ja1k0g13",
    label: "Offset"
})("width:calc(", ({ depth })=>depth || 0, " * var(", tokens.itemTreeOffsetWidth, "));flex:none;margin-right:calc(var(", tokens.itemGap, ") * -1);");
