import{F as O,aw as B,af as D,ag as N,m as a,P as n,_ as P,R as E,a1 as m,X as c,a2 as F,a0 as L}from"./vendor-d3O24IFR.js";import{a3 as M,a_ as z,bG as g,f as G}from"./index-_wj2lNU2.js";import{u as H}from"./useCheckout-BCh0YaHp.js";/* empty css                                                                      */import"./address-type.enum-CGCAFS3X.js";/* empty css                                                         */const Y=O({__name:"index",setup(U){const h=B(),s=D(),{t:e}=N(),{themeContext:v}=M(),{loading:_,changing:b,allItemsAreDigital:l,forceFetch:x}=z(),{loading:f,changing:k,placedOrder:o,allOrderItemsAreDigital:C,canPayNow:w,initialize:y}=H(),i=a(()=>_.value||f.value),I=a(()=>b.value||k.value),r=a(()=>{const t=[];return o.value?t.push({icon:"arrow-left-bold",route:{name:"OrderDetails",params:{orderId:o.value.id},replace:!0},text:e("common.buttons.back_to_order_details")}):s.params.cartId?t.push({icon:"arrow-left-bold",route:{name:g.CART_ID.NAME,params:{cartId:s.params.cartId},replace:!0},text:e("common.buttons.back_to_cart")}):t.push({icon:"arrow-left-bold",route:{name:g.CART.NAME,replace:!0},text:e("common.buttons.back_to_cart")}),v.value?.settings?.checkout_multistep_enabled&&t.push({id:"Shipping",route:{name:"Shipping",replace:!0},text:e("pages.checkout.steps.shipping"),disabled:!!o.value,hidden:C.value??l.value},{id:"Billing",route:{name:"Billing",replace:!0},text:e("pages.checkout.steps.billing"),disabled:!!o.value},{id:"Review",text:e("pages.checkout.steps.review"),disabled:!!o.value}),t.push({id:"CheckoutPayment",text:e("pages.checkout.steps.payment"),hidden:!w.value},{id:"CheckoutPaymentResult",text:e("pages.checkout.steps.completed")}),t}),u=a(()=>s.name),p=a(()=>r.value.findIndex(t=>t.id===u.value)),d=a(()=>r.value[p.value]?.text);return G({title:a(()=>[e("pages.checkout.meta.title"),d.value])}),(async()=>(await x(),s.name==="Checkout"&&(await y(),await h.push({name:l.value?"Billing":"Shipping",replace:!0}))))(),(t,X)=>{const V=n("VcTypography"),S=n("VcSteps"),R=n("VcLoaderOverlay"),T=n("router-view"),A=n("VcContainer");return E(),P(A,null,{default:m(()=>[c(V,{tag:"h1",class:"mb-5 print:mb-0"},{default:m(()=>[F(L(d.value),1)]),_:1}),c(S,{steps:r.value,"current-step-index":p.value,"start-step-index":0,disabled:i.value||I.value,class:"mb-5"},null,8,["steps","current-step-index","disabled"]),c(R,{visible:i.value||!u.value,"fixed-spinner":""},null,8,["visible"]),c(T)]),_:1})}}});export{Y as default};
//# sourceMappingURL=index-CJFfNX4F.js.map
