'use strict';
import { tableCustomActionTypes } from '../../table/table-models.js';
import { iconNames } from '../../../fd-component-toolbox/icon/Icon.js';
import { changeRelationName, unassignActionName } from '../../view/view-constants.js';
import { isManyToOneRelation } from '../../relations/meta-relations.js';
import { getODataBuilder } from '../../../../fd-toolbox/odata/odata-builder-funcs.js';
import { getObjectValues } from '../../../../fd-toolbox/lib/utils.js';
import { tableDisplayModes } from '../../../../fd-toolbox/enums/enums.js';

var __defProp=Object['defineProperty'],__name=(_0x247491,_0x283afa)=>__defProp(_0x247491,'name',{'value':_0x283afa,'configurable':!![]});function getMultilistResourceListConfig(_0x1ebbdf,_0x2dab67,_0x74d383,_0x193791,_0x47657f){let _0xd83d0b;const _0x48d087={..._0x1ebbdf['tableConfig']};_0x48d087['displayMode']=tableDisplayModes['minimal'];!_0x48d087['customActions']?.['length']&&(_0x48d087['customActions']=[]);_0x47657f&&_0x2dab67['parentResourcePropertyMeta']&&isManyToOneRelation(_0x2dab67['parentResourcePropertyMeta'])&&_0x48d087['customActions']['push']({'displayName':changeRelationName,'shouldTableRefreshAfter':!![],'actionType':tableCustomActionTypes['template'],'getTemplate':__name(_0x3b1973=>_0x74d383(_0x3b1973,_0x2dab67,_0x47657f),'getTemplate')});const _0x4c8349=getODataBuilder()['build']();_0x4c8349['filters']=getObjectValues(_0x2dab67['filters']),_0xd83d0b={'resourceName':_0x2dab67['resourceName'],'tableConfig':_0x48d087,'oDataConfig':_0x4c8349,'showFilters':![],'tableRequired':![],'pluralName':_0x2dab67['displayName'],'hideBackButton':!![],'hideResourceListDropdownMenu':!![]};if(!_0x2dab67['isRequiredRelation'])return _0xd83d0b;return _0x48d087['customActions']['push']({'icon':iconNames['linkBreak1Icon'],'displayName':unassignActionName,'onCellAction':__name(_0x5e798f=>_0x193791?.(_0x5e798f,_0x2dab67),'onCellAction'),'shouldTableRefreshAfter':!![],'actionType':tableCustomActionTypes['icon']}),{..._0xd83d0b,'tableConfig':_0x48d087};}__name(getMultilistResourceListConfig,'getMultilistResourceListConfig');

export { getMultilistResourceListConfig };
