System.register(["./p-343b3b10.system.js","./p-a0c1f16a.system.js","./p-ece63a69.system.js","./p-5f7bc72e.system.js","./p-da593370.system.js","./p-5ba1db18.system.js","./p-4ec8ba7a.system.js","./p-a56cdd14.system.js","./p-fa86b497.system.js","./p-86f17250.system.js","./p-9817db3f.system.js","./p-b3db1eb6.system.js","./p-6e679e9d.system.js","./p-abcb59d4.system.js","./p-ebdd1444.system.js","./p-6c3e6bdc.system.js","./p-356c131c.system.js","./p-0aeb0fcc.system.js","./p-dd468f04.system.js","./p-97c19fd0.system.js","./p-90b7d919.system.js","./p-7e6f8eaa.system.js","./p-da38856a.system.js","./p-dd9cd9b3.system.js","./p-d33249d4.system.js","./p-fe1f76a3.system.js","./p-66d9c61b.system.js","./p-83b75450.system.js","./p-577b99c3.system.js","./p-451fa62c.system.js","./p-520803d3.system.js","./p-48ea6857.system.js","./p-b0e93f3a.system.js","./p-b3cf23d4.system.js","./p-a6ad0410.system.js","./p-d254e73a.system.js","./p-27f59a1b.system.js"],(function(s){"use strict";var t,n,i,e,o,c,a,r,u;return{setters:[function(s){t=s.r;n=s.c;i=s.h;e=s.H},function(s){o=s.I},function(){},function(){},function(){},function(s){c=s.c;a=s.g;r=s.m},function(s){u=s.a},function(){},function(){},function(){},function(){},function(){},function(){},function(){},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 f=s("mentornity_follow_button",function(){function s(s){var i=this;t(this,s);this.action=n(this,"action",7);this.invalidation=n(this,"invalidation",7);this.isProgressing=false;this.isFollowing=false;this.subscription=undefined;this.toggleFollowStatus=function(){var s=i.subscription;i.isProgressing=true;if(s){c(r,a().headers).followUnfollowSubscription(s._id,(i===null||i===void 0?void 0:i.isFollowing)?"unfollow":"follow").then((function(){i.isFollowing=!i.isFollowing;i.invalidation.emit(new o("mentornity-follow-button","mentornity-user-detail-page"))})).finally((function(){return i.isProgressing=false}))}else{var t=i.data.mentornityCookieContext,n=t.groupId,e=t.userId;var u=!!n;var f=i.item.mentorship;var l=f.organisation;var d={organisation:{_type:"reference",_class:"organisations",_id:l._id},subscribed:{_type:"reference",_class:"users",_id:e},subscriber:{_type:"reference",_class:u?"groups":"users",_id:u?n:e},createdBy:{_type:"reference",_class:"users",_id:e},mentorship:{_type:"reference",_class:"mentorships",_id:f._id},status:"active",isFollowing:true};c(r,a().headers).createSubscription(d).then((function(s){i.subscription=Object.assign(Object.assign({},d),s);i.isFollowing=true;i.invalidation.emit(new o("mentornity-follow-button","mentornity-user-detail-page"))})).finally((function(){return i.isProgressing=false}))}}}s.prototype.componentWillLoad=function(){var s;this.subscription=this.item.subscription;this.isFollowing=((s=this.item.subscription)===null||s===void 0?void 0:s.isFollowing)||false};s.prototype.render=function(){var s,t;var n=((s=this.data)===null||s===void 0?void 0:s.isOnUserList)||false;var o=((t=this.data)===null||t===void 0?void 0:t.language)||"en";return i(e,{class:n?"d-inline":"d-flex"},i("dvn-button",{disabled:this.isProgressing,onClick:this.toggleFollowStatus,tint:"primary",view:this.isFollowing?"outline":"solid",scale:n?"small":undefined,leaned:true},u(o,this.isFollowing?"unfollow":"follow")))};return s}())}}}));