import{LitElement as o,html as t,css as i}from"lit";import{iconRemixAlertFill as n}from"./assets/cc-remix.icons.js";import{dispatchCustomEvent as s}from"./lib/events.js";import{ccAddonEncryptionAtRestOption as a}from"./templates/cc-addon-encryption-at-rest-option/cc-addon-encryption-at-rest-option.js";import{i18n as c}from"./translation.js";import"./cc-addon-option-form.js";class e extends o{static get properties(){return{options:{type:Array}}}constructor(){super(),this.options=[]}_onFormOptionsSubmit({detail:o}){s(this,"submit",o)}_getApmOption({enabled:o,flavor:i}){return{title:"APM",logo:"https://assets.clever-cloud.com/logos/elasticsearch-apm.svg",description:t`<div class=option-details>${c("cc-addon-elasticsearch-options.description.apm")}</div><div class=option-warning><cc-icon .icon=${n} a11y-name=${c("cc-addon-elasticsearch-options.error.icon-a11y-name")} class=icon-warning></cc-icon><p>${c("cc-addon-elasticsearch-options.warning.apm")} ${null!=i?t`${c("cc-addon-elasticsearch-options.warning.apm.details",i)}`:""}</p></div>`,enabled:o,name:"apm"}}_getKibanaOption({enabled:o,flavor:i}){return{title:"Kibana",logo:"https://assets.clever-cloud.com/logos/elasticsearch-kibana.svg",description:t`<div class=option-details>${c("cc-addon-elasticsearch-options.description.kibana")}</div><div class=option-warning><cc-icon .icon=${n} a11y-name=${c("cc-addon-elasticsearch-options.error.icon-a11y-name")} class=icon-warning></cc-icon><p>${c("cc-addon-elasticsearch-options.warning.kibana")} ${null!=i?t`${c("cc-addon-elasticsearch-options.warning.kibana.details",i)}`:""}</p></div>`,enabled:o,name:"kibana"}}_getFormOptions(){return this.options.map((o=>{switch(o.name){case"apm":return this._getApmOption(o);case"kibana":return this._getKibanaOption(o);case"encryption":return a(o);default:return null}})).filter((o=>null!=o))}render(){const o=this._getFormOptions(),i=c("cc-addon-elasticsearch-options.title");return t`<cc-addon-option-form title=${i} .options=${o} @cc-addon-option-form:submit=${this._onFormOptionsSubmit}><div slot=description>${c("cc-addon-elasticsearch-options.description")}</div></cc-addon-option-form>`}static get styles(){return[i`:host{display:block}`]}}window.customElements.define("cc-addon-elasticsearch-options",e);export{e as CcAddonElasticsearchOptions};
//# sourceMappingURL=cc-addon-elasticsearch-options.js.map
