import{r as o,d as l,B as t,h as a}from"./p-9b6cc562.js";import{f as e}from"./p-cf4a3445.js";const i=class{constructor(t){o(this,t),this.fireenjinFetch=l(this,"fireenjinFetch",7),this.totallerId=void 0,this.totals=void 0,this.totaller=void 0}async onSuccess(o){var l,t;"findTotaller"===o.detail.endpoint&&(this.totaller=(null===(t=null===(l=null==o?void 0:o.detail)||void 0===l?void 0:l.data)||void 0===t?void 0:t.totaller)||null)}formatValue(o,l){return"usd"===(null==l?void 0:l.format)?e(o):o}async fetchTotaller(){this.fireenjinFetch.emit({endpoint:"findTotaller",params:{id:this.totallerId}})}async componentDidLoad(){(null==t?void 0:t.isBrowser)&&this.fetchTotaller()}render(){var o;return a("div",{class:"flex-container"},Object.entries((null===(o=this.totaller)||void 0===o?void 0:o.sums)||{}).map((([o,l])=>{var t;return a("ion-card",{class:"card"},a("h2",null,null==l?void 0:l.name),a("h3",null,null==l?void 0:l.description),a("h1",null,this.formatValue((null===(t=this.totals)||void 0===t?void 0:t[o])||0,l)))})))}};i.style="floodteam-totaller-cards .flex-container{display:flex;flex-wrap:wrap}floodteam-totaller-cards ion-card{min-width:6rem;max-width:10rem;min-height:6rem;padding:0px 10px 10px 10px;flex-basis:18%}floodteam-totaller-cards h1{font-size:1rem;color:var(--ion-text-color)}floodteam-totaller-cards h2{font-size:.8rem;color:var(--ion-text-color)}floodteam-totaller-cards h3{font-size:.6rem}@media only screen and (max-width:415.9px){floodteam-totaller-cards .flex-container{justify-content:space-evenly}}";export{i as floodteam_totaller_cards}