import{proxyCustomElement as e,HTMLElement as t,createEvent as r,h as i,transformTag as n}from"@stencil/core/internal/client";import{d as c}from"./currency-picker.js";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=r(this,"change",7),this.getOptionValue=e=>e.value,this.getAffixValue=e=>{if(e.value)return[e.value]},this.handleChangeOptions=(e,t=e=>e)=>r=>{r.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{options:Object.assign(Object.assign({maximumFractionDigits:0},this.value.options),{[e]:t(r.detail)||void 0})}))},this.handleChangeAffix=e=>t=>{t.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{[e]:this.getAffixValue(t.detail)}))}}render(){return[this.renderNotation(),this.renderCurrency(),this.renderCurrencyDisplay(),this.renderAffix("prefix"),this.renderAffix("suffix")]}renderCurrency(){var e;return i("limebb-currency-picker",{platform:this.platform,context:this.context,label:"Currency",value:null===(e=this.value.options)||void 0===e?void 0:e.currency,onChange:this.handleChangeOptions("currency")})}renderCurrencyDisplay(){const e=[{text:"ISO currency code",value:"code"},{text:"Localized currency symbol",value:"symbol"},{text:"Localized currency name",value:"name"}],t=e.find((e=>{var t;return e.value===(null===(t=this.value.options)||void 0===t?void 0:t.currencyDisplay)}));return i("limel-select",{label:"Currency display",options:e,value:t,onChange:this.handleChangeOptions("currencyDisplay",this.getOptionValue)})}renderNotation(){const e=[{text:"Standard",value:"standard"},{text:"Compact",value:"compact"}],t=e.find((e=>{var t;return e.value===(null===(t=this.value.options)||void 0===t?void 0:t.notation)}));return i("limel-select",{label:"Notation",helperText:"The formatting that should be displayed for the number",options:e,value:t,onChange:this.handleChangeOptions("notation",this.getOptionValue)})}renderAffix(e){const t=[{text:"",value:""},{text:"Compact notation",value:"compact"},{text:"Currency",value:"currency"}],r=t.find((t=>{var r;return t.value&&(null===(r=this.value[e])||void 0===r?void 0:r.includes(t.value))}));return i("limel-select",{label:e.charAt(0).toUpperCase()+e.slice(1),options:t,value:r,onChange:this.handleChangeAffix(e)})}},[1,"limebb-info-tile-currency-format",{platform:[16],context:[16],value:[16]}]),s=o,l=function(){"undefined"!=typeof customElements&&["limebb-info-tile-currency-format","limebb-currency-picker"].forEach((e=>{switch(e){case"limebb-info-tile-currency-format":customElements.get(n(e))||customElements.define(n(e),o);break;case"limebb-currency-picker":customElements.get(n(e))||c()}}))};export{s as LimebbInfoTileCurrencyFormat,l as defineCustomElement}