function deepFind(items, predicate) {
    for (const item of items){
        if (predicate(item)) return item;
        if (item.children) {
            const found = deepFind(item.children, predicate);
            if (found) return found;
        }
    }
}
function recursivelyExpand(itemsToExpand) {
    if (!itemsToExpand || 0 === itemsToExpand.length) return [];
    return itemsToExpand.filter((item)=>!item.disabled).map((item)=>item.id).concat(itemsToExpand.flatMap((item)=>recursivelyExpand(item.children)));
}
export { deepFind, recursivelyExpand };
