import{LitElement as t,html as e,css as i}from"lit";import{classMap as c}from"lit/directives/class-map.js";import{iconRemixInformationFill as n}from"./assets/cc-remix.icons.js";import{skeletonStyles as s}from"./styles/skeleton.js";import{ccLink as o,linkStyles as l}from"./templates/cc-link/cc-link.js";import{i18n as r}from"./translation.js";import"./cc-block-section.js";import"./cc-block.js";import"./cc-icon.js";import"./cc-img.js";import"./cc-notice.js";class a extends t{static get properties(){return{state:{type:Object}}}constructor(){super(),this.state={type:"loading"}}render(){if("error"===this.state.type)return e`<cc-notice intent=warning message=${r("cc-jenkins-info.error")}></cc-notice>`;const t="loading"===this.state.type,i="loaded"===this.state.type?this.state.jenkinsLink:null,s="loaded"===this.state.type?this.state.jenkinsManageLink:null,l="loaded"===this.state.type?this.state.versions:{current:null,available:null},a=l.current!==l.available;return e`<cc-block><div slot=ribbon>${r("cc-jenkins-info.info")}</div><div slot=header class=info-text>${r("cc-jenkins-info.text")}</div><cc-block-section slot=content-body><div slot=title>${r("cc-jenkins-info.open-jenkins.title")}</div><div slot=info>${r("cc-jenkins-info.open-jenkins.text")}</div><div class=one-line-form>${o(i,e`<cc-img src=${"https://assets.clever-cloud.com/logos/jenkins.svg"}></cc-img><span class=${c({skeleton:t})}>${r("cc-jenkins-info.open-jenkins.link")}</span>`)}</div></cc-block-section><cc-block-section slot=content-body><div slot=title>${r("cc-jenkins-info.update.title")}</div><div slot=info>${r("cc-jenkins-info.update.text")}</div><div class=one-line-form>${o(s,e`<cc-icon size=lg .icon=${n}></cc-icon><span class=${c({skeleton:t})}>${a?r("cc-jenkins-info.update.new-version",{version:l.available}):r("cc-jenkins-info.update.up-to-date")}</span>`)}</div></cc-block-section><div slot=footer-right>${o("https://www.clever-cloud.com/doc/deploy/addon/jenkins/",e`<cc-icon .icon=${n}></cc-icon>${r("cc-jenkins-info.documentation.text")}`)}</div></cc-block>`}static get styles(){return[l,s,i`:host{--cc-gap:1em;display:block}.cc-link{align-items:center;display: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}.skeleton{background-color:#bbb}`]}}window.customElements.define("cc-jenkins-info",a);export{a as CcJenkinsInfo};
//# sourceMappingURL=cc-jenkins-info.js.map
