'use strict';
import { apiGetWithOData } from '../../../../fd-toolbox/api/api-client.js';
import { oDataOperators } from '../../../../fd-toolbox/enums/enums.js';
import { getNewUuid } from '../../../../fd-toolbox/uuids.js';

var __defProp=Object['defineProperty'],__name=(_0x2a66a8,_0xdfd178)=>__defProp(_0x2a66a8,'name',{'value':_0xdfd178,'configurable':!![]});async function loadEditLinkRelatedResource(_0x202004,_0x3bab43,_0x391928,_0xf30c4a,_0x3327c0){if(!_0xf30c4a)return;if(!_0x202004)return;if(_0x3327c0)return;const _0x1b8937={'leftSide':_0xf30c4a['relatedPropertyName'],'rightSide':_0x3bab43,'operator':oDataOperators['equal']},_0x1ff8a1=(await apiGetWithOData(_0xf30c4a['relatedResourceName'],{'filters':[_0x1b8937]}))['data'];if(_0x1ff8a1)_0x391928(_0x1ff8a1);}__name(loadEditLinkRelatedResource,'loadEditLinkRelatedResource');function addEditLinkNewResource(_0x4c8c79,_0x20f31e){const _0x3b4338=getNewUuid();_0x4c8c79(_0x6255b9=>_0x6255b9&&[{'id':_0x3b4338},..._0x6255b9]),_0x20f31e(_0x4e3850=>[..._0x4e3850,_0x3b4338]);}__name(addEditLinkNewResource,'addEditLinkNewResource');function deleteEditLinkResource(_0x57da82,_0x2c3d8b){_0x57da82(_0x5dd890=>{if(!_0x5dd890)return _0x5dd890;const _0x1dd749=Array['from'](_0x5dd890),_0x1e47db=_0x5dd890['findIndex'](_0x3147fb=>_0x3147fb['id']===_0x2c3d8b);return _0x1dd749['splice'](_0x1e47db,-0x49f*-0x1+-0x218a+0x1cec),_0x1dd749;});}__name(deleteEditLinkResource,'deleteEditLinkResource');

export { addEditLinkNewResource, deleteEditLinkResource, loadEditLinkRelatedResource };
