import{r as i,h as o,a as s,H as t}from"./p-e97fde0a.js";import{s as e}from"./p-6a753ae1.js";import"./p-03631502.js";import"./p-9dbc54d6.js";import"./p-6b5d827f.js";import"./p-53e7f7d7.js";import"./p-d3366af3.js";import"./p-401e165e.js";import"./p-830ab1a3.js";import"./p-ec182234.js";import"./p-3f6362a4.js";import"./p-95325ec5.js";import"./p-4df6e0c5.js";import"./p-30eb50ff.js";import"./p-93127aa7.js";import"./p-1712c78c.js";import"./p-1f60f497.js";import"./p-75e76c8c.js";import"./p-dd3464cd.js";const r=":host{display:block}.sc-product-donation-choices{display:grid;gap:2em;position:relative;--columns:4}.sc-product-donation-choices__form{display:grid;gap:var(--sc-spacing-small)}.sc-donation-recurring-choices{display:grid;gap:var(--sc-spacing-small);position:relative;--columns:2}";const n=r;const c=class{constructor(o){i(this,o);this.productId=undefined;this.label=undefined;this.recurring=undefined}state(){return e[this.productId]}updateState(i){e[this.productId]={...e[this.productId],...i}}render(){var i,s,e,r;const n=(((e=(s=(i=this.state())===null||i===void 0?void 0:i.product)===null||s===void 0?void 0:s.prices)===null||e===void 0?void 0:e.data)||[]).filter((i=>this.recurring?(i===null||i===void 0?void 0:i.recurring_interval)&&(i===null||i===void 0?void 0:i.ad_hoc):!(i===null||i===void 0?void 0:i.recurring_interval)&&(i===null||i===void 0?void 0:i.ad_hoc))).filter((i=>!(i===null||i===void 0?void 0:i.archived)));if(!(n===null||n===void 0?void 0:n.length)){return o(t,{style:{display:"none"}})}return o("sc-recurring-price-choice-container",{prices:n.sort(((i,o)=>(i===null||i===void 0?void 0:i.position)-(o===null||o===void 0?void 0:o.position))),product:(r=this.state())===null||r===void 0?void 0:r.product,selectedPrice:this.state().selectedPrice,showDetails:false,showAmount:false,onScChange:i=>{var o,s;const t=(((s=(o=this.state().product)===null||o===void 0?void 0:o.prices)===null||s===void 0?void 0:s.data)||[]).find((({id:o})=>o==i.detail));this.updateState({selectedPrice:t})},"aria-label":this.recurring?wp.i18n.__("If you want to make your donation recurring then Press Tab once & select the recurring interval from the dropdown. ","surecart"):wp.i18n.__("If you want to make your donation once then Press Enter. ","surecart"),style:{"--sc-recurring-price-choice-white-space":"wrap","--sc-recurring-price-choice-text-align":"left"}},o("slot",null,this.label))}get el(){return s(this)}};c.style=n;export{c as sc_product_donation_choices};
//# sourceMappingURL=p-83c40139.entry.js.map