(function(){"use strict";u8.Crm.FavoritesSelector=function(e){this.RecordSelector(e)};u8.Crm.FavoritesSelector.makeClass({name:"FavoritesSelector",deriveFrom:u8.Crm.RecordSelector});$.extend(u8.Crm.FavoritesSelector.prototype,{_showSelector:function(){var e=$.extend({},this.from,{favorites:{showQuickLinks:false},parent:this,onClose:this._onSelectorClose.bind(this)});var r=new u8.Crm.Widgets.FavoritesPopup(u8.application.getMainWindow(),e);r.open()},_getUsing:function(){return u8.using.merge(this.RecordSelector__getUsing(),{types:["FavoritesPopup"]})}});u8.services.ready("selectors",function(){u8.services.selectors.register("selectFavorite",{execute:function(e,r){var t=new u8.Crm.FavoritesSelector(e);t.execute(r);return t},prepareOptions:function(e,r){var t=e;if(r){if(!t.from){var i=r.schema;$assert(i,"Required field schema information missing for record selector.");t.from={infoAreaId:i.link.destinationInfoAreaId}}if(!t.target){t.target={infoAreaId:r.infoAreaId,uid:r.uid,linkFieldSchema:r.schema,fieldId:r.fieldId};if(t.target.linkFieldSchema){t.target.addLink=true}}t.target.adapter=r.adapter}return t}})})})();