import{isNotNil}from"../../../utils/type-guards";import{borderRadiusMap,borderWidthMap,paddingMap}from"./maps";export var getSlots=function(a){return(Array.isArray(a)?a:[a]).filter(function(a){return isNotNil(a)&&!1!==a})};var borderToCss=function(a){return a?"solid":"none"};export var getBorderStyle=function(a,b){return"default"===b?"solid ".concat(borderToCss(borderWidthMap[a][1])," solid ").concat(borderToCss(borderWidthMap[a][0])):"none"};var paddingToCss=function(a){return"increased"===a?"calc(var(--field-control-layout-space) * 1.6)":"var(--field-control-layout-space)"};export var getPadding=function(a,b){return"default"===b?"0px ".concat(paddingToCss(paddingMap[a][1])," 0px ").concat(paddingToCss(paddingMap[a][0])):"1px 0px 1px 0px"};var borderRadiusToCss=function(a){return"default"===a?"var(--control-radius)":"round"===a?"calc(var(--field-control-layout-height) / 2)":"0px"};export var getBorderRadius=function(a,b){return"default"===b?borderRadiusMap[a].map(borderRadiusToCss).join(" "):"0px 0px 0px 0px"};export var getBorderColor=function(a,b,c,d){return d?"transparent":a?"var(--color-control-bg-border-focus)":b?"var(--color-control-bg-border-default-hover)":c?"var(--color-bg-".concat(c,")"):"var(--color-control-bg-border-default)"};export var getBgColor=function(a,b){return"default"===a&&b?"var(--color-control-bg-disable)":"default"===a?"var(--color-bg-default)":void 0};export var getSlotsWidthStyles=function(a,b){for(var c={},d=0;d<a.length;d++)c["--field-control-layout-".concat(b,"-slot-content-width-").concat(d)]="".concat(a[d],"px");return c["--field-control-layout-".concat(b,"-slot-contents-width")]="".concat(a.length?a.reduce(function(c,a){return c+a}):0,"px"),c["--field-control-layout-".concat(b,"-slots-length")]="".concat(a.length),c};export var formGuard=function(a){return"clearClear"===a?"clear":a};
//# sourceMappingURL=helpers.js.map