'use strict';
import { convertFromCamelToPascalCase } from '../../../../../fd-toolbox/strings/casing-converter.js';
import { getAllResources } from '../../../../meta/server/meta-core/constants/resource-ids.js';
import { resourceNames } from '../../../../../fd-toolbox/resources/resource-names.js';
import { getResourcesByName, createResourceDirectlyInDb, deleteResource } from '../../../../meta/server/db/db.js';

var __defProp=Object['defineProperty'],__name=(_0x334d9f,_0x57306d)=>__defProp(_0x334d9f,'name',{'value':_0x57306d,'configurable':!![]});async function seedResourcesDirectlyInDb(_0x40aa4b){const _0x5a3e22=await getAllResources(),_0x13f0b8=[...Object['keys'](_0x5a3e22)['map'](_0x2b0f56=>[_0x5a3e22[_0x2b0f56],convertFromCamelToPascalCase(_0x2b0f56)]),..._0x40aa4b??[]],_0xf366e8=await getResourcesByName(resourceNames['resource']),_0x1011d7=_0xf366e8['map'](_0x51d2da=>_0x51d2da['id']);for(const [_0x228faf,_0x39a214]of _0x13f0b8['filter'](([_0x305e2f])=>!_0x1011d7['includes'](_0x305e2f))){await createResourceDirectlyInDb({'id':_0x228faf,'name':_0x39a214},resourceNames['resource']);}for(const _0x5223cb of _0x1011d7['filter'](_0x51fe95=>!_0x13f0b8['map'](([_0x1a7725])=>_0x1a7725)['includes'](_0x51fe95))){await deleteResource(_0x5223cb,resourceNames['resource']);}}__name(seedResourcesDirectlyInDb,'seedResourcesDirectlyInDb');

export { seedResourcesDirectlyInDb };
