var ProfileCards=new Class({options:{delayToShow:1000},initialize:function(){this.elemsById=[];this.profileCard=null;document.addEvent("click",function(){if(this.profileCard){this.profileCard.close()}}.bind(this))},setupCard:function(c,d){var b=function(){if(this.elemsById[d]===undefined){var f=new ApiClient({apimethod:"igloo/widgets/27/render",postdata:{paramList:"idList",paramTypes:"string"},queryparams:{idList:d},onRequest:function(){},onSuccess:function(h,j){var i=JSON.decode(h,true);if(i===null){return false}var g=JSON.decode(i.response.items[2].value);if(g===null){return false}$each(g,function(l,k){this.elemsById[k]=l}.bind(this));if(this.spinnerId!==undefined){this.spinnerId=igLoadingCursor.removeLoader(this.spinnerId);this.drawProfileCard(c,d)}}.bind(this)})}}.bind(this);var a=function(f,g){if(this.elemsById[g]!==undefined){this.drawProfileCard(f,g)}else{this.spinnerId=igLoadingCursor.addLoader()}};var e;c.addEvent("mouseenter",function(){b();e=a.delay(this.options.delayToShow,this,[c,d])}.bind(this));c.addEvent("mouseleave",function(){window.clearTimeout(e)})},drawProfileCard:function(c,a){var b=this.elemsById[a];if(this.profileCard){this.profileCard.close()}this.profileCard=new Minimodal({injectat:"top",injectpoint:document.body,trigger:c,"x-offset":-10,"y-offset":-10,customclass:"ig-minimodal-profile",width:350});var d=new Element("div",{"class":"ig-profilecard-wrapper clearfix vcard",html:b}).inject(this.profileCard.contentformnobr,"top");d.getElements("img").addEvent("load",function(){this.profileCard.resize()}.bindWithEvent(this));this.profileCard.minimodalform.addEvent("click",function(e){e.stopPropagation()});this.profileCard.shadow();bootstrap(d)}});var PC=new ProfileCards();window.addEvent("bootstrap4finished",function(){if(window.dependents.ProfileCards){window.dependents.ProfileCards.each(function(a){if(a.dataobj){var c=$type(a.dataobj)=="string"?JSON.decode(a.dataobj):a.dataobj;if(c&&c.ProfileCards&&c.ProfileCards.UserId){var b=c.ProfileCards.UserId.replace(/\{/g,"").replace(/\}/g,"");PC.setupCard(a,b)}}})}});window.addEvent("domready",function(){if(Igloo.asset_ProfileCards){$each(Igloo.asset_ProfileCards,function(b,a){if(b.UserId){var c=$(a);if(c){PC.setupCard(c,b.UserId)}}})}});
