(function(){window.CommunityService=function(context){const communityRepository=new CommunityRepository(context);this.get=function(){return communityRepository.get()};this.saveSpaceHomepage=function(community){return communityRepository.save(community)};this.saveCharter=function(community,parameters){return sp.promise.whenAllResolved([communityRepository.save(community),communityRepository.saveDisplayCharterOnSpaceHomepageParameter(parameters.displayCharterOnSpaceHomepage)]).then(function(results){return results[0]})}};
const CommunityOfUsers=function(){this.type="CommunityOsUsers";this.$onInit=function(){}};const CommunityRepository=function(context){const baseUri=webContext+"/services/community/"+context.componentInstanceId;const baseAdapter=RESTAdapter.get(baseUri,CommunityOfUsers);const ctlBaseUri=webContext+"/Rcommunity/"+context.componentInstanceId;const ctlBaseAdapter=RESTAdapter.get(ctlBaseUri,function(){});this.get=function(){return baseAdapter.find()};this.save=function(community){return baseAdapter.put(community)};
this.saveDisplayCharterOnSpaceHomepageParameter=function(value){const formData=new FormData;formData.set("value",!!value);return ctlBaseAdapter.post(ctlBaseAdapter.url+"/parameters/displayCharterOnSpaceHomepage",formData)}}})();