import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{d as defineCustomElement$3}from"./sc-format-number2.js";import{d as defineCustomElement$2}from"./sc-price-range2.js";import{d as defineCustomElement$1}from"./sc-visually-hidden2.js";const scProductItemPriceCss=":host{display:block;line-height:1}.product-price{padding-top:var(--sc-product-price-padding-top, 0);padding-bottom:var(--sc-product-price-padding-bottom, 0);padding-left:var(--sc-product-price-padding-left, 0);padding-right:var(--sc-product-price-padding-right, 0);margin-top:var(--sc-product-price-margin-top, 0);margin-bottom:var(--sc-product-price-margin-bottom, 0);margin-left:var(--sc-product-price-margin-left, 0);margin-right:var(--sc-product-price-margin-right, 0);text-align:var(--sc-product-price-align);font-size:var(--sc-product-price-font-size);font-weight:var(--sc-product-price-font-weight);color:var(--sc-product-price-text-color)}",ScProductItemPriceStyle0=scProductItemPriceCss,ScProductItemPrice=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.prices=void 0,this.range=!0,this.metrics=void 0}componentWillLoad(){var e,t,r,i,c,s;this.range&&(null===(e=this.metrics)||void 0===e?void 0:e.min_price_amount)!==(null===(t=this.metrics)||void 0===t?void 0:t.max_price_amount)&&(this.prices=[{amount:null===(r=this.metrics)||void 0===r?void 0:r.min_price_amount,currency:null===(i=this.metrics)||void 0===i?void 0:i.currency},{amount:null===(c=this.metrics)||void 0===c?void 0:c.max_price_amount,currency:null===(s=this.metrics)||void 0===s?void 0:s.currency}])}render(){var e;const t=(this.prices||[]).sort(((e,t)=>(null==e?void 0:e.position)-(null==t?void 0:t.position))).find((e=>!(null==e?void 0:e.archived)));return h("div",{key:"86430f460e43cb75a3e07b4ff40f379ea028fd15",class:"product-price",part:"base"},!this.range&&(null===(e=this.prices)||void 0===e?void 0:e.length)?h("sc-format-number",{type:"currency",currency:(null==t?void 0:t.currency)||"usd",value:null==t?void 0:t.amount}):h("sc-price-range",{prices:this.prices}))}static get style(){return ScProductItemPriceStyle0}},[1,"sc-product-item-price",{prices:[16],range:[4],metrics:[16]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-product-item-price","sc-format-number","sc-price-range","sc-visually-hidden"].forEach((e=>{switch(e){case"sc-product-item-price":customElements.get(e)||customElements.define(e,ScProductItemPrice);break;case"sc-format-number":customElements.get(e)||defineCustomElement$3();break;case"sc-price-range":customElements.get(e)||defineCustomElement$2();break;case"sc-visually-hidden":customElements.get(e)||defineCustomElement$1()}}))}export{ScProductItemPrice as S,defineCustomElement as d};