import{s as state,g as getCheckout}from"./mutations-017e8c92.js";import{s as state$1}from"./store-ac90a769.js";import"./address-b8e2e4c8.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},getResolvedBillingEmail=e=>{var t;const i=e||state.checkout;return(null==i?void 0:i.email)||(null===(t=null==i?void 0:i.customer)||void 0===t?void 0:t.email)||(null==state$1?void 0:state$1.email)||void 0},toStripeAddress=e=>{if(!(null==e?void 0:e.line_1))return;const{line_1:t,line_2:i,city:s,state:d,country:l,postal_code:o}=e;return{line1:t,line2:i,city:s,state:d,postal_code:o,country:l}};export{checkoutIsLocked as a,getResolvedBillingEmail as b,currentCheckout as c,getResolvedBillingAddress as d,fullShippingAddressRequired as f,getLineItemByProductId as g,shippingAddressRequired as s,toStripeAddress as t};