import{r as i,h as t}from"./p-e97fde0a.js";import{s as l}from"./p-f09ee70b.js";import{h as e}from"./p-28d98d61.js";import{i as o}from"./p-88aed607.js";import{u as n,r as d}from"./p-edd617b4.js";import{f as s}from"./p-ff10bfbf.js";import{g as a}from"./p-1b470883.js";import"./p-03631502.js";import"./p-9dbc54d6.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-1f60f497.js";import"./p-addaf7a4.js";import"./p-d9fa04f9.js";const r=":host{display:block}:slotted(*~*){margin-top:20px}.line-items{display:grid;gap:var(--sc-form-row-spacing)}.line-item{display:grid;gap:var(--sc-spacing-small)}.fee__description{opacity:0.75}";const p=r;const u=class{constructor(t){i(this,t);this.editable=undefined;this.removable=undefined}isEditable(i){var t;if(((t=i===null||i===void 0?void 0:i.price)===null||t===void 0?void 0:t.ad_hoc)||(i===null||i===void 0?void 0:i.bump_amount)||(i===null||i===void 0?void 0:i.locked)){return false}return this.editable}render(){var i,r,p,u,v;if(!!s()&&!((p=(r=(i=l===null||l===void 0?void 0:l.checkout)===null||i===void 0?void 0:i.line_items)===null||r===void 0?void 0:r.data)===null||p===void 0?void 0:p.length)){return t("sc-line-item",null,t("sc-skeleton",{style:{width:"50px",height:"50px","--border-radius":"0"},slot:"image"}),t("sc-skeleton",{slot:"title",style:{width:"120px",display:"inline-block"}}),t("sc-skeleton",{slot:"description",style:{width:"60px",display:"inline-block"}}),t("sc-skeleton",{style:{width:"120px",display:"inline-block"},slot:"price"}),t("sc-skeleton",{style:{width:"60px",display:"inline-block"},slot:"price-description"}))}return t("div",{class:"line-items",part:"base",tabindex:"0"},(((v=(u=l===null||l===void 0?void 0:l.checkout)===null||u===void 0?void 0:u.line_items)===null||v===void 0?void 0:v.data)||[]).map((i=>{var s,r,p,u,v,m,c,_;const y=a((s=i===null||i===void 0?void 0:i.price)===null||s===void 0?void 0:s.product,i===null||i===void 0?void 0:i.variant);return t("div",{class:"line-item"},t("sc-product-line-item",{key:i.id,image:i===null||i===void 0?void 0:i.image,name:(p=(r=i===null||i===void 0?void 0:i.price)===null||r===void 0?void 0:r.product)===null||p===void 0?void 0:p.name,priceName:(u=i===null||i===void 0?void 0:i.price)===null||u===void 0?void 0:u.name,variantLabel:((i===null||i===void 0?void 0:i.variant_options)||[]).filter(Boolean).join(" / ")||null,purchasableStatusDisplay:i===null||i===void 0?void 0:i.purchasable_status_display,...y?{max:y}:{},editable:this.isEditable(i),removable:!(i===null||i===void 0?void 0:i.locked)&&this.removable,quantity:i.quantity,fees:(v=i===null||i===void 0?void 0:i.fees)===null||v===void 0?void 0:v.data,setupFeeTrialEnabled:(m=i===null||i===void 0?void 0:i.price)===null||m===void 0?void 0:m.setup_fee_trial_enabled,amount:i.ad_hoc_amount!==null?i.ad_hoc_amount:i.subtotal_amount,scratchAmount:i.ad_hoc_amount==null&&(i===null||i===void 0?void 0:i.scratch_amount),scratchDisplayAmount:i===null||i===void 0?void 0:i.scratch_display_amount,currency:(c=l===null||l===void 0?void 0:l.checkout)===null||c===void 0?void 0:c.currency,displayAmount:i.ad_hoc_amount!==null?i.ad_hoc_display_amount:i.subtotal_display_amount,trialDurationDays:(_=i===null||i===void 0?void 0:i.price)===null||_===void 0?void 0:_.trial_duration_days,interval:!!(i===null||i===void 0?void 0:i.price)&&o(i===null||i===void 0?void 0:i.price,{showOnce:e(l===null||l===void 0?void 0:l.checkout)}),onScUpdateQuantity:t=>n({id:i.id,data:{quantity:t.detail}}),onScRemove:()=>d(i===null||i===void 0?void 0:i.id),exportparts:"base:line-item, product-line-item, image:line-item__image, text:line-item__text, title:line-item__title, suffix:line-item__suffix, price:line-item__price, price__amount:line-item__price-amount, price__description:line-item__price-description, price__scratch:line-item__price-scratch, static-quantity:line-item__static-quantity, remove-icon__base:line-item__remove-icon, quantity:line-item__quantity, quantity__minus:line-item__quantity-minus, quantity__minus-icon:line-item__quantity-minus-icon, quantity__plus:line-item__quantity-plus, quantity__plus-icon:line-item__quantity-plus-icon, quantity__input:line-item__quantity-input, line-item__price-description:line-item__price-description"}))})))}};u.style=p;export{u as sc_line_items};
//# sourceMappingURL=p-281d44dd.entry.js.map