fcf.module({
  name:         "fcfControls:templates/menu.receive.js",
  dependencies: [],
  lazy:         [],
  module: function() {
    return class Handler {
      async receive(a_fields, a_files){
        let result = {};
        await fcf.each(a_fields.items, async (a_key, a_uri)=>{
          let node = await fcf.application.getRouter().getMenuNode(a_uri, 1);
          result[a_uri] = [];
          fcf.each(node.childsOrder, (a_key, a_uriChild)=>{
            result[a_uri].push({
              uri:   a_uriChild,
              title: node.childs[a_uriChild].title,
            });
          });
        })
        return result;
      }
    }
  }
});
