'use strict';
import { isNullOrUndefined } from '../../../fd-toolbox/functions/value-checking-functions.js';
import { getObjectValues } from '../../../fd-toolbox/lib/utils.js';
import { relationTypes } from '../../../fd-toolbox/enums/enums.js';
import { getManyToManySecondResourceName } from '../relations/meta-relations.js';
import { join } from 'path';
import { oDataQueryParams } from '../../../fd-toolbox/constants/odata-query-params.js';

var __defProp=Object['defineProperty'],__name=(_0x264b5f,_0x1a639c)=>__defProp(_0x264b5f,'name',{'value':_0x1a639c,'configurable':!![]});function getODataExpandParam(_0x5c5eba){const _0x458c87=[{'name':oDataQueryParams['expand'],'value':_0x5c5eba['join'](',')}];return _0x458c87;}__name(getODataExpandParam,'getODataExpandParam');function getODataExpandIfExpandForDescription(_0x4633af){let _0x1dd5b4=[];for(let _0x1cadea of getObjectValues(_0x4633af['properties'])){if(!isNullOrUndefined(_0x1cadea['relation'])&&_0x1cadea['relation']['expandForDescription']&&!_0x1dd5b4['includes'](_0x1cadea['relation']['expandPropertyName'])){if(_0x1cadea['relation']['type']===relationTypes['manyToMany']){const _0xa8a9ac=getManyToManySecondResourceName(_0x4633af['resourceName'],_0x1cadea);_0xa8a9ac&&_0x1dd5b4['push'](join(_0x1cadea['name'],_0xa8a9ac));}else _0x1dd5b4['push'](_0x1cadea['relation']['expandPropertyName']);}}return _0x1dd5b4;}__name(getODataExpandIfExpandForDescription,'getODataExpandIfExpandForDescription');

export { getODataExpandIfExpandForDescription, getODataExpandParam };
