import{s as state,g as getCheckout}from"./mutations-6bbbe793.js";import"./address-6bd346f2.js";const currentCheckout=()=>getCheckout(state.formId,state.mode),checkoutIsLocked=(e="")=>{var t;return e?state.locks.some((t=>t===e)):!!(null===(t=state.locks)||void 0===t?void 0:t.length)},getLineItemByProductId=e=>{var t,i;return((null===(i=null===(t=state.checkout)||void 0===t?void 0:t.line_items)||void 0===i?void 0:i.data)||[]).find((t=>{var i,s;return(null===(s=null===(i=null==t?void 0:t.price)||void 0===i?void 0:i.product)||void 0===s?void 0:s.id)===e}))},fullShippingAddressRequired=()=>{var e;return"full"===(null===(e=state.checkout)||void 0===e?void 0:e.shipping_address_accuracy_requirement)},shippingAddressRequired=()=>{var e,t;return"full"===(null===(e=state.checkout)||void 0===e?void 0:e.shipping_address_accuracy_requirement)||"tax"===(null===(t=state.checkout)||void 0===t?void 0:t.shipping_address_accuracy_requirement)},getResolvedBillingAddress=e=>{const t=e||state.checkout,i=!1===(null==t?void 0:t.billing_matches_shipping)&&(null==t?void 0:t.billing_address)?t.billing_address:void 0,s=(null==i?void 0:i.line_1)?i:null==t?void 0:t.shipping_address;if(null==s?void 0:s.line_1)return s},toStripeAddress=e=>{if(!(null==e?void 0:e.line_1))return;const{line_1:t,line_2:i,city:s,state:d,country:r,postal_code:l}=e;return{line1:t,line2:i,city:s,state:d,postal_code:l,country:r}};export{checkoutIsLocked as a,getResolvedBillingAddress as b,currentCheckout as c,fullShippingAddressRequired as f,getLineItemByProductId as g,shippingAddressRequired as s,toStripeAddress as t};