import{F as O,aw as B,ag as D,ai as N,m as a,P as s,_ as P,R as E,a1 as m,X as c,a2 as F,a0 as L}from"./vendor-Dd8T34zR.js";import{a8 as M,b8 as z,h as H,bu as g}from"./index-Vd7lvnU9.js";import{u as U}from"./useCheckout-OiXWgHHw.js";import"./address-type.enum-CGCAFS3X.js";const Q=O({__name:"index",setup(X){const h=B(),o=D(),{t:e}=N(),{themeContext:v}=M(),{loading:_,changing:b,allItemsAreDigital:r,forceFetch:x}=z(),{loading:f,changing:k,placedOrder:n,allOrderItemsAreDigital:C,canPayNow:w,initialize:y}=U(),i=a(()=>_.value||f.value),I=a(()=>b.value||k.value),l=a(()=>{const t=[];return n.value?t.push({icon:"arrow-left-bold",route:{name:"OrderDetails",params:{orderId:n.value.id},replace:!0},text:e("common.buttons.back_to_order_details")}):o.params.cartId?t.push({icon:"arrow-left-bold",route:{name:g.CART_ID.NAME,params:{cartId:o.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:!!n.value,hidden:C.value??r.value},{id:"Billing",route:{name:"Billing",replace:!0},text:e("pages.checkout.steps.billing"),disabled:!!n.value},{id:"Review",text:e("pages.checkout.steps.review"),disabled:!!n.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(()=>o.name),p=a(()=>l.value.findIndex(t=>t.id===u.value)),d=a(()=>l.value[p.value]?.text);return H({title:a(()=>[e("pages.checkout.meta.title"),d.value])}),(async()=>(await x(),o.name==="Checkout"&&(await y(),await h.push({name:r.value?"Billing":"Shipping",replace:!0}))))(),(t,j)=>{const V=s("VcTypography"),S=s("VcSteps"),R=s("VcLoaderOverlay"),T=s("router-view"),A=s("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:l.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{Q as default};
//# sourceMappingURL=index-BWuj6T4u.js.map
