import{s as state,g as getCheckout}from"./mutations-6f9b9a86.js";import{i as isAddressComplete}from"./address-b892540d.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,s;return((null===(s=null===(t=state.checkout)||void 0===t?void 0:t.line_items)||void 0===s?void 0:s.data)||[]).find((t=>{var s,d;return(null===(d=null===(s=null==t?void 0:t.price)||void 0===s?void 0:s.product)||void 0===d?void 0:d.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)},getCompleteAddress=(e="shipping")=>{var t,s;if(!isAddressComplete(null===(t=state.checkout)||void 0===t?void 0:t[`${e}_address`]))return;const{line_1:d,line_2:i,...r}=(null===(s=state.checkout)||void 0===s?void 0:s.shipping_address)||{};return{line1:d,line2:i,...r}};export{checkoutIsLocked as a,getCompleteAddress as b,currentCheckout as c,fullShippingAddressRequired as f,getLineItemByProductId as g,shippingAddressRequired as s};