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