/*!
 * Crafted with ❤ by Salla
 */
import{r as s,h as a,H as t,a as l}from"./p-Cb4NFvMH.js";const i=class{constructor(a){s(this,a),this.apps=salla.config.get("store.apps"),this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML||'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />',salla.onReady((()=>{this.apps=salla.config.get("store.apps")})),salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(!Array.isArray(s)||s.length)return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_apps_icons}