import{r as s,c as i,h as e,F as c,g as t}from"./p-dfbe004d.js";import{o}from"./p-d63f2554.js";import{g as r}from"./p-afcbd440.js";const l=class{constructor(e){s(this,e),this.scRemoveLineItem=i(this,"scRemoveLineItem",7),this.scUpdateLineItem=i(this,"scUpdateLineItem",7),this.columns=1,this.required=!0}handleChange(){this.el.querySelectorAll("sc-price-choice").forEach((s=>{var i;const e=s.querySelector("sc-choice")||s.querySelector("sc-choice-container");if(null==e?void 0:e.checked){const c=r(null===(i=this.order)||void 0===i?void 0:i.line_items,e.value);this.scUpdateLineItem.emit({price_id:s.priceId,quantity:(null==c?void 0:c.quantity)||(null==s?void 0:s.quantity)||1})}else this.scRemoveLineItem.emit({price_id:s.priceId,quantity:s.quantity})}))}render(){return e(c,null,e("sc-choices",{label:this.label,required:this.required,class:"loaded price-selector",style:{"--columns":this.columns.toString()}},e("slot",null)))}get el(){return t(this)}};o(l,["order"],!1),l.style="sc-price-choices{display:block;position:relative}sc-block-ui{z-index:9}";export{l as sc_price_choices}