'use strict';
import { internalTableColumnTypes, tableCustomActionPositions } from '../table-models.js';

var __defProp=Object['defineProperty'],__name=(_0x3933ce,_0x312eb2)=>__defProp(_0x3933ce,'name',{'value':_0x312eb2,'configurable':!![]});const paddingQuantity=0xda3+0x1d*-0x1b+0x16*-0x7b,actionGap=-0x3e2+-0x2386+0x2770,actionPadding=0x21*0x11b+-0x2426+-0x51,minColumnWidth=-0x13cc+0x23b*0xe+-0xaa6;function calculateAndSetColumnDimensions(_0x3ee7f7,_0x3a8edf,_0x46225e){const _0x36331b=getActionWidth(_0x3ee7f7);let _0x48b6cb=_0x3ee7f7['filter'](_0x39e49b=>_0x39e49b['type']===internalTableColumnTypes['checkBox'])['length'],_0x41b54b=_0x3ee7f7['filter'](_0x4268b5=>(_0x4268b5['actionPosition']===tableCustomActionPositions['default']||!_0x4268b5['actionPosition'])&&_0x4268b5['type']===internalTableColumnTypes['action']||_0x4268b5['type']===internalTableColumnTypes['customHeaderAction'])['length'],_0x457aec=_0x3ee7f7['length']-_0x48b6cb-_0x41b54b;const _0x445c6b=_0x36331b*_0x46225e+actionGap*(_0x46225e-(0xc43+0x24ea+-0x832*0x6))+actionPadding*paddingQuantity;let _0x37d06f=_0x48b6cb*_0x445c6b,_0x419b23=_0x41b54b*_0x445c6b,_0x4e3b8a=_0x3a8edf-_0x37d06f-_0x419b23,_0x286291;_0x457aec>=0x4*-0x41c+0x1*0xa24+0x21b*0x3?_0x286291=_0x4e3b8a/_0x457aec:_0x286291=Math['min'](_0x4e3b8a/_0x457aec,minColumnWidth);let _0x5f4c28=0x182b+0x1c99+-0x266*0x16;for(let _0x124980 of _0x3ee7f7){if(_0x124980['type']===internalTableColumnTypes['checkBox']){const _0x15e83a=pxToPercentage(_0x3a8edf,_0x37d06f);_0x124980['width']=_0x15e83a,_0x5f4c28+=_0x15e83a;}else {if(_0x124980['type']===internalTableColumnTypes['action']||_0x124980['type']===internalTableColumnTypes['customHeaderAction']){const _0x42439c=pxToPercentage(_0x3a8edf,_0x419b23);_0x124980['width']=_0x42439c,_0x5f4c28+=_0x42439c;}else {if(_0x124980['index']===_0x3ee7f7['length']-(0x23f*0xa+-0x33a*-0x7+-0x1*0x2d0b))_0x124980['width']=0x11*-0x123+-0x1*-0x194b+0xe*-0x66-_0x5f4c28;else {const _0x205ab3=pxToPercentage(_0x3a8edf,_0x286291);_0x124980['width']=_0x205ab3,_0x5f4c28+=_0x205ab3;}}}}}__name(calculateAndSetColumnDimensions,'calculateAndSetColumnDimensions');function calculateDefaultSize(_0x1cb9db){return Math['ceil'](_0x1cb9db);}__name(calculateDefaultSize,'calculateDefaultSize');function pxToPercentage(_0x362a3d,_0x5e094a){return Math['round'](_0x5e094a/_0x362a3d*(0xaca*0x3+-0x178b*0x1+-0x11*0x7f));}__name(pxToPercentage,'pxToPercentage');function getActionWidth(_0x4cc0c6){const _0x38b06d=_0x4cc0c6['filter'](_0x306e56=>_0x306e56['type']===internalTableColumnTypes['customHeaderAction'])['length'];return _0x38b06d>0x1073*0x2+0x1*-0x5a4+-0x1b42?-0x18*0x178+-0x188c+0x3be8:-0x1205+-0x4c*0x58+0x2c35;}__name(getActionWidth,'getActionWidth');

export { calculateAndSetColumnDimensions, calculateDefaultSize };
