import{LitElement as o,html as t,css as i}from"lit";import{classMap as c}from"lit/directives/class-map.js";import{iconRemixInformationFill as e}from"./assets/cc-remix.icons.js";import{skeletonStyles as s}from"./styles/skeleton.js";import{ccLink as n,linkStyles as m}from"./templates/cc-link/cc-link.js";import{i18n as l}from"./translation.js";import"./cc-block-section.js";import"./cc-block.js";import"./cc-icon.js";import"./cc-img.js";import"./cc-notice.js";const r={matomoUrl:null,phpUrl:null,mysqlUrl:null,redisUrl:null};class a extends o{static get properties(){return{state:{type:Object}}}constructor(){super(),this.state={type:"loading"}}render(){const o="loading"===this.state.type,{matomoUrl:i,phpUrl:c,mysqlUrl:s,redisUrl:n}="loaded"===this.state.type?this.state:r;return"error"===this.state.type?t`<cc-notice intent=warning message=${l("cc-matomo-info.error")}></cc-notice>`:t`<cc-block ribbon=${l("cc-matomo-info.info")} no-head><div class=info-text>${l("cc-matomo-info.heading")}</div><cc-block-section><div slot=title>${l("cc-matomo-info.open-matomo.title")}</div><div slot=info>${l("cc-matomo-info.open-matomo.text")}</div><div>${this._renderImageLink("https://assets.clever-cloud.com/logos/matomo.svg",i,l("cc-matomo-info.open-matomo.link"),o)}</div></cc-block-section><cc-block-section><div slot=title>${l("cc-matomo-info.documentation.title")}</div><div slot=info>${l("cc-matomo-info.documentation.text")}</div><div>${this._renderIconLink(e,"https://www.clever-cloud.com/doc/deploy/addon/matomo/",l("cc-matomo-info.documentation.link"))}</div></cc-block-section><cc-block-section><div slot=title>${l("cc-matomo-info.about.title")}</div><div slot=info>${l("cc-matomo-info.about.text")}</div><div class=application-list>${this._renderImageLink("https://assets.clever-cloud.com/logos/php.svg",c,l("cc-matomo-info.link.php"),o)} ${this._renderImageLink("https://assets.clever-cloud.com/logos/mysql.svg",s,l("cc-matomo-info.link.mysql"),o)} ${this._renderImageLink("https://assets.clever-cloud.com/logos/redis.svg",n,l("cc-matomo-info.link.redis"),o)}</div></cc-block-section></cc-block>`}_renderImageLink(o,i,e,s){return t`<div>${n(i,t`<cc-img src=${o}></cc-img><span class=${c({skeleton:s})}>${e}</span>`)}</div>`}_renderIconLink(o,i,c){return t`<div>${n(i,t`<cc-icon size=lg .icon=${o}></cc-icon><span>${c}</span>`)}</div>`}static get styles(){return[s,m,i`:host{--cc-gap:1em;display:block}[slot=info] p:first-child{margin-top:0}[slot=info] p:last-child{margin-bottom:0}.cc-link{align-items:center;display:inline-flex}cc-img{border-radius:var(--cc-border-radius-default,.25em);flex:0 0 auto;height:1.5em;margin-right:.5em;width:1.5em}cc-icon{flex:0 0 auto;margin-right:.5em}.application-list>*{margin-bottom:.5em}`]}}window.customElements.define("cc-matomo-info",a);export{a as CcMatomoInfo};
//# sourceMappingURL=cc-matomo-info.js.map
