(function(){"use strict";u8.Crm.MenuSearchProvider=function(e){$.extend(this,u8.Crm.MenuSearchProvider.defaults,e)};u8.Crm.MenuSearchProvider.defaults={menuName:"$Main"};$.extend(u8.Crm.MenuSearchProvider.prototype,{abort:function(e){e.abort=true},canExecute:function(e){e(this,{canExecute:true})},search:function(e,r){e=(e||"").toString();var t={};var n=new RegExp(e.escapeRegExpWithWildcards(),"i");var u=this.maxRows||Number.Inifinity;u8.services.menus.load(this.menuName,function(e,a){if(t.abort){return r({abort:true})}var i=a.menu;var c=[];var s=false;if(i){i.find(function(e){if(!e.children&&e.label&&n.test(e.label)){if(c.length>=u){s=true;return true}c.push({key:e.name,text:e.label})}})}r({items:c,moreRowsExist:s})});return t},execute:function(e){u8.services.actions.execute(e)}});u8.Crm.MenuSearchProvider.makeClass({name:"MenuSearchProvider",events:["Create"]})})();