System.register(["./p-5e377a26.system.js","./p-a0c1f16a.system.js","./p-db5487c5.system.js","./p-0bbf3c73.system.js","./p-da593370.system.js","./p-512597e1.system.js","./p-17ac6394.system.js","./p-8293eefa.system.js","./p-175b60af.system.js","./p-58f2f536.system.js","./p-7a93391b.system.js","./p-942ebda3.system.js","./p-61f711e3.system.js","./p-34aaddc8.system.js","./p-ac291838.system.js","./p-a1a7dc06.system.js","./p-d548b705.system.js","./p-02dbbe4e.system.js","./p-f8bf4b87.system.js","./p-01d3bf86.system.js","./p-b70120a8.system.js","./p-cb044807.system.js","./p-9e8049b8.system.js","./p-b1e4c9f9.system.js","./p-90b7d919.system.js","./p-417ebfe3.system.js","./p-704a1960.system.js","./p-83a23a40.system.js","./p-91343653.system.js","./p-8e4283bf.system.js","./p-fe1f76a3.system.js","./p-66d9c61b.system.js"],(function(s){"use strict";var t,n,e,i,o,r,a,f,c;return{setters:[function(s){t=s.r;n=s.c;e=s.h;i=s.H},function(s){o=s.I},function(){},function(){},function(){},function(s){r=s.c},function(s){a=s.g},function(s){f=s.m},function(s){c=s.g},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var u=s("mentornity_follow_button",function(){function s(s){var e=this;t(this,s);this.action=n(this,"action",7);this.invalidation=n(this,"invalidation",7);this.isProgressing=false;this.toggleFollowStatus=function(){var s=e.item.subscription;var t=(s===null||s===void 0?void 0:s.isFollowing)||false;e.isProgressing=true;if(s){r(f,c().headers).followUnfollowSubscription(s._id,t?"unfollow":"follow").then((function(){e.invalidation.emit(new o("mentornity-follow-button","mentornity-user-detail-page"))})).finally((function(){return e.isProgressing=false}))}else{var n=e.data.mentornityCookieContext,i=n.groupId,a=n.userId;var u=!!i;var l=e.item.mentorship;var p=l.organisation;r(f,c().headers).createSubscription({organisation:{_type:"reference",_class:"organisations",_id:p._id},subscribed:{_type:"reference",_class:"users",_id:a},subscriber:{_type:"reference",_class:u?"groups":"users",_id:u?i:a},createdBy:{_type:"reference",_class:"users",_id:a},mentorship:{_type:"reference",_class:"mentorships",_id:l._id},status:"active",isFollowing:true}).then((function(){e.invalidation.emit(new o("mentornity-follow-button","mentornity-user-detail-page"))})).finally((function(){return e.isProgressing=false}))}}}s.prototype.render=function(){var s,t;var n=((s=this.item.subscription)===null||s===void 0?void 0:s.isFollowing)||false;var o=((t=this.data)===null||t===void 0?void 0:t.language)||"en";return e(i,{class:"d-flex"},e("dvn-button",{disabled:this.isProgressing,onClick:this.toggleFollowStatus,tint:"primary",view:"flat"},a(o,n?"unfollow":"follow")))};return s}())}}}));