export function moveNodesToGroupNode(e,n,o=[]){console.debug(`Moving nodes '${e.map(e=>e.label).join(", ")}' into group '${null==n?void 0:n.label}'. Tree nodes are`,n);let l=function o(l){return l.map(l=>{if(e.some(e=>l.id===e.id))return console.debug("Removed the node from original position."),null;let i=Object.assign({},l);return i.children&&(i.children=o(i.children).filter(e=>null!==e)),n&&l.id===(null==n?void 0:n.id)&&e.forEach(e=>{i.children=i.children?[...i.children,e]:[e]}),i}).filter(e=>null!==e)}(o);return n||l.push(...e),l}