import{r as s,h as o,e as t}from"./p-9babd345.js";const a=class{constructor(o){s(this,o),this.resiliance=0,this.care=0,this.compassData={}}componentDidLoad(){}componentWillUpdate(){console.log("Component will update and re-render")}async renderCompass(s){for(var o={},t=0;t<s.length;t++)s[t]&&s[t].extraData&&s[t].extraData.compass&&(void 0===o[s[t].extraData.compass]&&(o[s[t].extraData.compass]=0),o[s[t].extraData.compass]+=s[t].response||0);for(var a in o)o[a]=Math.floor(.25*o[a]);console.log(o)}loadOldData(){}submitPost(){}getTokenData(){let s=window.localStorage.currentUser;if(s){let o=JSON.parse(s);if(o=JSON.parse(o),new Date(o.Expiration).getTime()>(new Date).getTime())return o}return null}renderUserInfo(){var s=this.getTokenData();return null!=s&&s.Token?o("ion-avatar",{class:"header-avatar",slot:"end"},o("img",s.ProfileImageUrl?{src:s.ProfileImageUrl}:{src:"/assets/img/avatar.png"})):o("ion-button",{slot:"end",href:"/login"},"Login to Post")}render(){const s=this.renderUserInfo();return o("div",{class:"compass-post"},o("div",{class:"compass-post-header"},"Bulletin Board",s),o("div",{class:"compass-post-body"},o("form",null,o("ion-item",null,o("ion-label",null,"Public"),o("ion-radio",{class:"IsPublic",slot:"end",color:"primary",value:"IsPublic",name:"IsPublic"})),o("gi-compass",null),o("ion-item",{class:"footer"},o("div",null,o("div",{class:"error"},this.errorMessage),o("div",{class:"success"},this.successMessage)),o("ion-button",{slot:"end",size:"default",onClick:()=>this.submitPost(),disabled:null==this.getTokenData()},"Post")))))}get el(){return t(this)}};a.style="gi-compass-post .compass-post{padding-top:10px}gi-compass-post .compass-post-header{padding:15px;background-color:rgba(213, 213, 213, 0.5);text-transform:uppercase;display:flex;justify-content:space-between;align-items:center}gi-compass-post .compass-post-header ion-avatar{width:32px;height:32px}gi-compass-post .compass-post-header h3{color:#333;padding-top:0px;padding-bottom:0px;margin:0px}gi-compass-post .compass-post-body{padding:15px;background-color:#fff}gi-compass-post .error{color:red}gi-compass-post .success{color:green}gi-compass-post .footer{display:flex;justify-content:space-between}";export{a as sparkle_compass_post}