PageSourceSearch

https://www.rosebikes.de/_nuxt/checkout-BCgT29iu.js

js rosebikes.de collected 2026-10-02 06:18:47 UTC 3,788 bytes, 1 lines download raw bytes

1import{s as T}from"./nuxt-CkSXpG-a.js";import{c as U,d as i,l as W}from"./error-o1lvrPwZ.js";import{a as I}from"./pinia-C2EHZkDm.js";import{Ht as r,Rt as m,_t as q,a as b,n as D}from"./app/api/graphql/generated/graphql.ts-CstZYwUw.js";import{t as C}from"./fragment-masking-BkexAerc.js";import"./all-Drsx3IW_.js";import{t as e}from"./RouteEnum-CQbj0FUZ.js";import{G}from"#entry";import{t as j}from"./QuoteStore-DYrKRG7j.js";import{n as s,t as H}from"./CheckoutProgressStore-xWCcZFSA.js";import{t as O}from"./useBikesCount-xJ8DSxc4.js";var S=t=>Object.values(e).includes(t),re=W(async(t,M)=>{let d,l;if(t.meta.layout==="checkout"){if(t.path.endsWith("/"))return i(t.path.slice(0,-1));const v=G(),{getAddresses:B}=v,{isCustomerLoggedIn:R,isGuestLoggedIn:Y}=I(v);if(!R.value&&!Y.value)return i({path:e.Login,query:{targetUrl:t.path}});const{setCurrentStep:a,setStepDisabled:P,setStepDone:g}=H(),A=j();[d,l]=T(()=>B()),await d,l();const h=([d,l]=T(()=>A.getQuote()),d=await d,l(),d),{allValid:N,addressesValid:p,paymentValid:c,paymentDetailsValid:k}=I(A),{hasInvalidFlag:n,hasInvalidFlags:x}=A;if(!h.value)return U("Missing Quote");const{oneClickCheckoutPossible:L,billingAddress:F,shippingAddress:V,availableShippingTargets:f}=h.value,y=C(q,h.value.priceInfo);if(!y?.totalQuantity||y?.totalQuantity<1)return i(e.Cart);const _=C(D,F),E=C(D,V),{bikesCount:w}=O(h.value);if(t.path===e.CheckoutIndex)return L?i(e.CheckoutSummary):i(e.CheckoutAddressIndex);if(g(s.ADDRESS,p.value),P(s.PAYMENT,!p.value),g(s.PAYMENT,p.value&&c.value&&k.value&&!n(r.Troubleshooting)),P(s.SUMMARY,!p.value||!c.value||!k.value||n(r.Troubleshooting)),g(s.SUMMARY,N.value),S(t.path)&&t.path.startsWith(e.CheckoutAddressIndex)&&a(s.ADDRESS),S(t.path)&&t.path.startsWith(e.CheckoutPayment)&&a(s.PAYMENT),t.path===e.CheckoutSummary&&a(s.SUMMARY),!n(r.BillingAddressInvalid)&&t.path===e.CheckoutAddressBillingAdd)return i(e.CheckoutAddressIndex);if(x([r.BillingAddressInvalid,r.ShippingAddressInvalid],!0)&&t.path!==e.CheckoutAddressBillingAdd)return a(s.ADDRESS),i(e.CheckoutAddressBillingAdd);if(n(r.BillingAddressInvalid)&&!n(r.ShippingAddressInvalid)){if(a(s.ADDRESS),_){if(t.path!==e.CheckoutAddressBillingEdit)return i(e.CheckoutAddressBillingEdit)}else if(t.path!==e.CheckoutAddressBillingAdd)return i(e.CheckoutAddressBillingAdd)}if(!n(r.BillingAddressInvalid)&&n(r.ShippingAddressInvalid)){if(a(s.ADDRESS),E){let u;switch(t.path){case e.CheckoutAddressShippingEdit:u=f?.find(o=>o?.shippingTarget===m.CustomAddress)?.isAvailable;break;case e.CheckoutAddressShippingEditPackstation:u=f?.find(o=>o?.shippingTarget===m.Packstation)?.isAvailable;break;case e.CheckoutAddressShippingEditSelfPickup:u=f?.find(o=>o?.shippingTarget===m.Selfpickup)?.isAvailable;break;default:u=!1}return u?void 0:i(e.CheckoutAddressShippingEdit)}else if(t.path!==e.CheckoutAddressShippingAdd)return i(e.CheckoutAddressShippingAdd)}const Q=[e.Cart,e.CheckoutAddressShippingAdd,e.CheckoutAddressBillingAdd,e.Login,e.Register];if(w>0&&t.path===e.CheckoutAddressIndex&&Q.includes(M.path))switch(E?.type){case b.SelfPickup:return i(e.CheckoutAddressShippingEditSelfPickup);case b.Packstation:return i(e.CheckoutAddressShippingEditPackstation);default:return i(e.CheckoutAddressShippingEdit)}if(!c.value&&S(t.path)&&t.path.startsWith(e.CheckoutPaymentLeasingProviders))return a(s.PAYMENT),i(e.CheckoutPayment);if(!c.value&&t.path===e.CheckoutSummary)return a(s.PAYMENT),i(e.CheckoutPayment);if(!k.value&&t.path===e.CheckoutSummary)return a(s.PAYMENT),i(e.CheckoutPaymentLeasingProviders);if(n(r.Troubleshooting)&&t.path===e.CheckoutSummary)return a(s.PAYMENT),i(e.CheckoutPaymentLeasingTroubleshooting);if(n(r.BikeleasingInvalidCart)&&t.path===e.CheckoutSummary)return a(s.PAYMENT),i(e.CheckoutPaymentLeasingProviders)}},1);export{re as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.