PageSourceSearch

https://opravdovezlociny.cz/assets/Checkout-m0noIr24.js

js opravdovezlociny.cz collected 2026-09-24 18:56:19 UTC 23,558 bytes, 1 lines download raw bytes

1import{u as Se,b3 as Te,l as Fe,b as Oe,a as qe,r as m,s as w,m as A,j as e,L as Ne,k as $,aY as te,B as Z,d as P,I as S,x as Ee,G as De,ap as Re}from"./index-5ZAWLHa7.js";import{u as Ke}from"./useEshopDiscount-pPee1Oxr.js";import{P as B}from"./package-B3mUj7PH.js";import{T as be}from"./truck-CiGAK9ox.js";import{C as ze}from"./credit-card-DEGk0FvZ.js";const W={cz:"+420",sk:"+421",de:"+49",at:"+43",pl:"+48",hu:"+36",ro:"+40",bg:"+359",hr:"+385",si:"+386",it:"+39",fr:"+33",es:"+34",pt:"+351",nl:"+31",be:"+32",se:"+46",dk:"+45",fi:"+358",ie:"+353",lt:"+370",lv:"+371",ee:"+372",gr:"+30",cy:"+357",mt:"+356",lu:"+352"},Ve="ozlociny",se=[4,6],Ze=[{id:3300,name:"On-line platba kartou",price:0}];function Le(){m.useEffect(()=>{if(document.getElementById("packeta-widget-script"))return;const h=document.createElement("script");h.id="packeta-widget-script",h.src="https://widget.packeta.com/v6/www/js/library.js",h.async=!0,document.head.appendChild(h)},[])}function Ge(){var ye,ge;Se("Pokladna","Dokončení objednávky v e-shopu Opravdových zločinů.");const{items:h,totalPrice:ae,clearCart:_e,voucher:T,discountedTotal:we,dbCartId:N,isLoadingFromDb:L}=Te(),{user:p,profile:g}=Fe(),{hasDiscount:re,discountPercent:ie,rankName:ne}=Ke(),{toast:q}=Oe(),oe=qe(),[b,E]=m.useState("shipping"),[ce,le]=m.useState(!1),[I,de]=m.useState(17),[n,D]=m.useState(null),U=m.useRef(null),R=m.useRef(!1),me=m.useRef(!1);Le();const[o,F]=m.useState({firstName:"",lastName:"",email:"",phone:"",street:"",city:"",zip:"",note:""}),K=m.useCallback(t=>{N&&(U.current&&clearTimeout(U.current),U.current=setTimeout(async()=>{var s,r;try{await w.from("oz1_eshop_carts").update({doprava_id:t.shippingId,zeme_id:t.countryId,packeta_id:((s=t.packetaPoint)==null?void 0:s.id)||null,packeta_name:((r=t.packetaPoint)==null?void 0:r.name)||null,packeta_place:t.packetaPoint?t.packetaPoint.place||`${t.packetaPoint.street}, ${t.packetaPoint.city} ${t.packetaPoint.zip}`:null,email:t.form.email||null,phone:t.form.phone||null,firstname_postal:t.form.firstName||null,surname_postal:t.form.lastName||null,street_postal:t.form.street||null,city_postal:t.form.city||null,zip_postal:t.form.zip||null,poznamka:t.form.note||null,platba_id:3300,naposled:Math.floor(Date.now()/1e3)}).eq("cart_id",N)}catch(a){console.error("Failed to save checkout data:",a)}},600))},[N]),{data:u,isFetching:ue}=A({queryKey:["checkout-cart-restore",N],enabled:!!N&&!R.current,gcTime:0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:async()=>{const{data:t}=await w.from("oz1_eshop_carts").select("doprava_id, zeme_id, packeta_id, packeta_name, packeta_place, email, phone, firstname_postal, surname_postal, street_postal, city_postal, zip_postal, poznamka, platba_id").eq("cart_id",N).maybeSingle();return t}});m.useEffect(()=>{if(!R.current&&!L){if(!N){R.current=!0;return}ue||u===void 0||(R.current=!0,u&&(u.zeme_id&&de(u.zeme_id),u.doprava_id&&H(u.doprava_id),u.packeta_id&&u.packeta_name&&D({id:u.packeta_id,name:u.packeta_name,place:u.packeta_place||"",street:"",city:"",zip:"",country:""}),F(t=>({firstName:u.firstname_postal||t.firstName,lastName:u.surname_postal||t.lastName,email:t.email||u.email||"",phone:u.phone||t.phone,street:u.street_postal||t.street,city:u.city_postal||t.city,zip:u.zip_postal||t.zip,note:u.poznamka||t.note}))))}},[u,L,N,ue]);const{data:Y}=A({queryKey:["checkout-user-address",p==null?void 0:p.id],enabled:!!(p!=null&&p.id),staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:async()=>{const{data:t}=await w.from("oz1_users").select("firstname_invoice, surname_invoice, phone, telefon, street_invoice, city_invoice, zip_invoice, email").eq("supabase_uid",p.id).maybeSingle();return t}});m.useEffect(()=>{me.current||p!=null&&p.id&&Y===void 0||(me.current=!0,F(t=>{var r;const s=Y;return{firstName:t.firstName||(s==null?void 0:s.firstname_invoice)||(g==null?void 0:g.first_name)||"",lastName:t.lastName||(s==null?void 0:s.surname_invoice)||(g==null?void 0:g.last_name)||"",email:(p==null?void 0:p.email)||(g==null?void 0:g.email)||t.email||"",phone:t.phone||(s==null?void 0:s.phone)||(s==null?void 0:s.telefon)||W[((r=c==null?void 0:c.code)==null?void 0:r.toLowerCase())||"cz"]||"+420",street:t.street||(s==null?void 0:s.street_invoice)||"",city:t.city||(s==null?void 0:s.city_invoice)||"",zip:t.zip||(s==null?void 0:s.zip_invoice)||"",note:t.note}}))},[Y,g,p]);const{data:G=[]}=A({queryKey:["checkout-countries"],queryFn:async()=>{const{data:t}=await w.from("oz1_zeme_id").select("id, nazev, code, packeta_code, packeta_group").eq("packeta_yn",1).order("packeta_group",{ascending:!0});return(t||[]).sort((s,r)=>s.id===17?-1:r.id===17?1:s.id===16?-1:r.id===16?1:s.nazev.localeCompare(r.nazev,"cs"))}}),{data:pe=[]}=A({queryKey:["checkout-shipping"],queryFn:async()=>{const{data:t}=await w.from("oz1_eshop_doprava").select("id, nazev, cena_out, packeta_group").eq("aktivni",1).order("id",{ascending:!0});return t||[]}}),c=G.find(t=>
1t.id===I),xe=(c==null?void 0:c.packeta_group)||1,O=m.useMemo(()=>pe.filter(t=>t.packeta_group===xe),[pe,xe]),[j,H]=m.useState(null),Pe=t=>{H(t);const s=t!==null&&!se.includes(t),r=s?null:n;s&&(D(null),F(a=>({...a,street:"",city:"",zip:""}))),K({shippingId:t,countryId:I,packetaPoint:r,form:o})};m.useEffect(()=>{O.length>0&&R.current&&(O.find(s=>s.id===j)||(H(O[0].id),D(null)))},[O,j]);const Ie=t=>{Pe(t)},k=j!==null&&se.includes(j),he=m.useCallback(()=>{var r;const t=window.Packeta;if(!((r=t==null?void 0:t.Widget)!=null&&r.pick)){q({variant:"destructive",title:"Widget se nenačetl",description:"Zkus to prosím znovu za chvíli."});return}const s=(c==null?void 0:c.packeta_code)||"cz";t.Widget.pick(Ve,a=>{if(a){const x={id:a.id,name:a.name,place:a.place||a.nameStreet||"",street:a.street||"",city:a.city||"",zip:a.zip||"",country:a.country||s};D(x);const v=`${a.street||""}, ${a.city||""}`.replace(/^,\s*/,"").replace(/,\s*$/,""),y=a.city||"",i=a.zip||"";F(l=>{const ke={...l,street:v,city:y,zip:i};return K({shippingId:j,countryId:I,packetaPoint:x,form:ke}),ke})}},{country:s,language:"cs"})},[c,q,j,I,o,K]),z=O.find(t=>t.id===j),J=(z==null?void 0:z.cena_out)||0,fe=we+J+0,_=(t,s)=>{F(r=>{const a={...r,[t]:s};return K({shippingId:j,countryId:I,packetaPoint:n,form:a}),a})},[f,ve]=m.useState({}),C=t=>ve(s=>({...s,[t]:!0})),d=m.useMemo(()=>{var x,v;const t={};o.firstName.trim()||(t.firstName="Vyplňte jméno"),o.lastName.trim()||(t.lastName="Vyplňte příjmení"),o.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(o.email.trim())||(t.email="Neplatný formát e-mailu"):t.email="Vyplňte e-mail";const s=o.phone.replace(/[\s\-()]/g,""),r=Object.values(W).includes(s);if(!s||r)t.phone="Vyplňte telefonní číslo";else{const y=((x=c==null?void 0:c.code)==null?void 0:x.toLowerCase())||"cz";y==="cz"?/^(\+420)?[1-9]\d{8}$/.test(s)||(t.phone="Zadejte české číslo ve formátu +420 xxx xxx xxx"):y==="sk"?/^(\+421)?[1-9]\d{8}$/.test(s)||(t.phone="Zadejte slovenské číslo ve formátu +421 xxx xxx xxx"):/^\+\d{7,15}$/.test(s)||(t.phone="Zadejte telefon s předvolbou (např. +49...)")}o.street.trim()?!(k&&n)&&!/\d/.test(o.street)&&(t.street="Ulice musí obsahovat číslo popisné"):t.street="Vyplňte ulici a číslo popisné",o.city.trim()||(t.city="Vyplňte město");const a=o.zip.replace(/\s/g,"");if(!a)t.zip="Vyplňte PSČ";else{const y=((v=c==null?void 0:c.code)==null?void 0:v.toLowerCase())||"cz";(y==="cz"||y==="sk")&&!/^\d{5}$/.test(a)?t.zip="PSČ musí mít 5 číslic":/^[\dA-Za-z\-\s]{3,10}$/.test(o.zip.trim())||(t.zip="Neplatný formát PSČ")}return t},[o,c]),Q=Object.keys(d).length===0,X=j!==null&&(!k||n!==null),[V,je]=m.useState({loading:!1,errors:[]}),M=m.useCallback(async()=>{je({loading:!0,errors:[]});const t=[];try{const s=h.filter(i=>i.pvId),r=h.filter(i=>!i.pvId),[a,x]=await Promise.all([s.length>0?w.from("oz1_eshop_products_var").select("pv_id, stock, aktivni").in("pv_id",s.map(i=>i.pvId)):{data:[]},r.length>0?w.from("oz1_eshop_products_safe").select("db_id, stock, stock_yn, active_yn").in("db_id",r.map(i=>i.dbId)):{data:[]}]),v=new Map((a.data||[]).map(i=>[i.pv_id,i])),y=new Map((x.data||[]).map(i=>[i.db_id,i]));for(const i of h)if(i.pvId){const l=v.get(i.pvId);!l||l.aktivni!==1?t.push(`${i.title} (${i.variantName}) již není dostupný.`):l.stock<i.quantity&&t.push(`${i.title} (${i.variantName}): skladem pouze ${l.stock} ks, v košíku máš ${i.quantity}.`)}else{const l=y.get(i.dbId);!l||l.active_yn!==1?t.push(`${i.title} již není aktivní.`):l.stock_yn===1&&l.stock<i.quantity&&t.push(`${i.title}: skladem pouze ${l.stock} ks, v košíku máš ${i.quantity}.`)}}catch(s){console.error("Stock revalidation error:",s)}return je({loading:!1,errors:t}),t.length===0},[h]);m.useEffect(()=>{b==="summary"&&M()},[b,M]);const ee=m.useRef(!1);if(!ee.current&&!L&&h.length>0&&(ee.current=!0),!ee.current&&L)return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"container py-16 text-center",children:[e.jsx(Ne,{className:"h-8 w-8 mx-auto mb-3 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"Načítám košík…"})]})});if(h.length===0)return oe("/kosik",{replace:!0}),null;const Ce=async()=>{var s,r;if(!await M()){q({variant:"destructive",title:"Nedostupné zboží",description:"Některé položky v košíku již nejsou skladem. Zkontroluj prosím košík."});return}le(!0);try{const{data:a,error:x}=await w.functions.invoke("create-eshop-order",{body:{items:h.map(v=>({dbId:v.dbId,pvId:v.pvId,quantity:v.quantity,price:v.price})),shipping:{id:j,price:J,name:z==null?void 0:z.nazev},payment:{id:3300,price:0},address:{...o,countryId:I},totalPrice:fe,voucher:T?{code:T.code,hodnota:T.hodnota}:null,klubDiscount:re?{percent:ie,rankName:ne}:null,cartId:N,packetaPoint:n?{id:n.id,name:n.name,place:n.place,street:n.street,city:n.city,zip:n.zip,country:n.country}:null}});if(x){if((s=x.message)!=null&&s.includes("out_of_stock")||(r=x.message)!=null&&r.includes("409")){q({variant:"destructive",title:"Vyprodáno",description:"Některé položky se mezitím vyprodaly. Zkontrolujte košík."}),await M();return}throw x}_e(!0),a!=null&&a.redirectUrl?(localStorage.setItem("oz_payment_return",`/objednavka/${(a==null?void 0:a.orderToken)||(a==null?void 0:a.orderId)||"ok"}`),window.location.href=a.redirectUrl):oe(`/objednavka/${(a==null?void 0:a.orderToken)||(a==null?void 0:a.orderId)||"ok"}`)}catch(a){console.error("Order error:",a),q({variant:"destructive",title:"Chyba",description:"Ob
1jednávku se nepodařilo vytvořit."})}finally{le(!1)}},$e=[{key:"shipping",label:"Doprava",icon:be},{key:"address",label:"Adresa",icon:te},{key:"summary",label:"Shrnutí",icon:Re}];return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"container py-8 max-w-3xl",children:[e.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Pokladna"}),e.jsx("div",{className:"flex gap-3 mb-10",children:$e.map((t,s)=>{const r=t.key==="shipping"||t.key==="address"&&(b==="address"||b==="summary")||t.key==="summary"&&b==="summary";return e.jsxs("button",{onClick:()=>{t.key==="shipping"&&E("shipping"),t.key==="address"&&X&&E("address"),t.key==="summary"&&Q&&X&&E("summary")},className:$("flex-1 flex items-center justify-center gap-2 py-3 rounded-xl text-sm font-medium transition-all",b===t.key?"bg-primary/10 text-primary":r?"text-foreground/60 hover:text-foreground":"text-muted-foreground"),children:[e.jsx(t.icon,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:t.label}),e.jsx("span",{className:"sm:hidden",children:s+1})]},t.key)})}),b==="shipping"&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-3",children:"Země doručení"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:I,onChange:t=>{var v,y;const s=Number(t.target.value);de(s),D(null);const r=G.find(i=>i.id===s),a=W[((v=r==null?void 0:r.code)==null?void 0:v.toLowerCase())||""]||"",x=W[((y=c==null?void 0:c.code)==null?void 0:y.toLowerCase())||""]||"";F(i=>{let l=i.phone.trim();return x&&l.startsWith(x)&&(l=l.slice(x.length).trim()),a&&!l.startsWith("+")?l=a+" "+l:a&&l.startsWith("+")&&!l.startsWith(a)&&(l=a+" "+l.replace(/^\+\d+\s*/,"")),{...i,phone:l.trim()}}),K({shippingId:j,countryId:s,packetaPoint:null,form:o})},className:"w-full p-4 rounded-xl bg-card text-foreground text-sm font-medium appearance-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary/30 border-0",children:G.map(t=>e.jsx("option",{value:t.id,children:t.nazev},t.id))}),e.jsx(te,{className:"absolute right-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"})]})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-3",children:"Způsob dopravy"}),e.jsx("div",{className:"space-y-2",children:O.map(t=>{const s=se.includes(t.id),r=j===t.id;return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>Ie(t.id),className:$("w-full flex items-center justify-between p-4 rounded-xl transition-all text-left",r?"bg-primary/10 ring-1 ring-primary/30":"bg-card hover:bg-secondary/60"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:$("h-4 w-4 rounded-full border-2 flex items-center justify-center transition-colors",r?"border-primary":"border-muted-foreground/40"),children:r&&e.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[s?e.jsx(B,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(be,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-medium text-sm",children:t.nazev})]})]}),e.jsxs("span",{className:"font-semibold text-sm",children:[t.cena_out," Kč"]})]}),r&&s&&e.jsx("div",{className:"mt-2 ml-10 p-4 rounded-xl bg-muted/30",children:n?e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(te,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-semibold text-foreground",children:n.name}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:n.place||`${n.street}, ${n.city} ${n.zip}`})]})]}),e.jsx(Z,{variant:"ghost",size:"sm",className:"text-primary",onClick:he,children:"Změnit"})]}):e.jsxs(Z,{variant:"ghost",className:"w-full gap-2 text-primary hover:text-primary/80",onClick:he,children:[e.jsx(B,{className:"h-4 w-4"}),"Vybrat výdejní místo"]})})]},t.id)})})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-3",children:"Způsob platby"}),Ze.map(t=>e.jsxs("div",{className:"w-full flex items-center justify-between p-4 rounded-xl bg-primary/10 ring-1 ring-primary/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 roun
1ded-full border-2 border-primary flex items-center justify-center",children:e.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-medium text-sm",children:t.name})]})]}),e.jsx("span",{className:"font-semibold text-sm text-primary",children:"zdarma"})]},t.id))]}),e.jsx(Z,{className:"w-full rounded-xl",size:"lg",disabled:!X,onClick:()=>E("address"),children:k&&!n?"Nejprve vyber výdejní místo":"Pokračovat k adrese"})]}),b==="address"&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(P,{htmlFor:"firstName",children:"Jméno *"}),e.jsx(S,{id:"firstName",value:o.firstName,onChange:t=>_("firstName",t.target.value),onBlur:()=>C("firstName"),className:f.firstName&&d.firstName?"border-destructive":""}),f.firstName&&d.firstName&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.firstName})]}),e.jsxs("div",{children:[e.jsx(P,{htmlFor:"lastName",children:"Příjmení *"}),e.jsx(S,{id:"lastName",value:o.lastName,onChange:t=>_("lastName",t.target.value),onBlur:()=>C("lastName"),className:f.lastName&&d.lastName?"border-destructive":""}),f.lastName&&d.lastName&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.lastName})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(P,{htmlFor:"email",children:"E-mail *"}),e.jsx(S,{id:"email",type:"email",value:o.email,onChange:t=>_("email",t.target.value),onBlur:()=>C("email"),disabled:!!p,className:$(p?"bg-muted cursor-not-allowed":"",f.email&&d.email?"border-destructive":"")}),p&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"E-mail je svázán s tvým účtem"}),!p&&f.email&&d.email&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.email})]}),e.jsxs("div",{children:[e.jsx(P,{htmlFor:"phone",children:"Telefon *"}),e.jsx(S,{id:"phone",type:"tel",value:o.phone,onChange:t=>_("phone",t.target.value),onBlur:()=>C("phone"),placeholder:"číslo bez mezer",className:f.phone&&d.phone?"border-destructive":""}),f.phone&&d.phone&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.phone})]})]}),k&&n&&e.jsx("div",{className:"p-3 rounded-lg bg-muted/30 border border-border mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{children:"Doručovací adresa je výdejní místo"})]})}),e.jsxs("div",{children:[e.jsx(P,{htmlFor:"street",children:"Ulice a č.p. *"}),e.jsx(S,{id:"street",value:o.street,onChange:t=>_("street",t.target.value),onBlur:()=>C("street"),placeholder:"např. Národní 25",disabled:!!(k&&n),className:$(k&&n?"bg-muted cursor-not-allowed":"",f.street&&d.street?"border-destructive":"")}),f.street&&d.street&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.street})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(P,{htmlFor:"city",children:"Město *"}),e.jsx(S,{id:"city",value:o.city,onChange:t=>_("city",t.target.value),onBlur:()=>C("city"),disabled:!!(k&&n),className:$(k&&n?"bg-muted cursor-not-allowed":"",f.city&&d.city?"border-destructive":"")}),f.city&&d.city&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.city})]}),e.jsxs("div",{children:[e.jsx(P,{htmlFor:"zip",children:"PSČ *"}),e.jsx(S,{id:"zip",value:o.zip,onChange:t=>_("zip",t.target.value),onBlur:()=>C("zip"),placeholder:((ye=c==null?void 0:c.code)==null?void 0:ye.toLowerCase())==="cz"||((ge=c==null?void 0:c.code)==null?void 0:ge.toLowerCase())==="sk"?"12345":"",disabled:!!(k&&n),className:$(k&&n?"bg-muted cursor-not-allowed":"",f.zip&&d.zip?"border-destructive":"")}),f.zip&&d.zip&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d.zip})]})]}),e.jsxs("div",{children:[e.jsx(P,{htmlFor:"note",children:"Poznámka k objednávce"}),e.jsx(Ee,{id:"note",value:o.note,onChange:t=>_("note",t.target.value),rows:3})]}),e.jsx(Z,{className:"w-full mt-2 rounded-xl",size:"lg",disabled:!Q,onClick:()=>{ve({firstName:!0,lastName:!0,email:!0,phone:!0,street:!0,city:!0,zip:!0}),Q&&E("summary")}
1,children:"Pokračovat ke shrnutí"})]}),b==="summary"&&e.jsxs("div",{className:"space-y-6",children:[n&&e.jsxs("div",{className:"p-4 rounded-lg bg-card border border-border",children:[e.jsxs("h2",{className:"font-semibold mb-3 flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4"})," Výdejní místo"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.name,e.jsx("br",{}),n.place||`${n.street}, ${n.city} ${n.zip}`]})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-card border border-border",children:[e.jsx("h2",{className:"font-semibold mb-3",children:"Doručovací adresa"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.firstName," ",o.lastName,e.jsx("br",{}),o.street,e.jsx("br",{}),o.zip," ",o.city,", ",(c==null?void 0:c.nazev)||"Česko",e.jsx("br",{}),o.email," · ",o.phone]}),o.note&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-2 italic",children:["Poznámka: ",o.note]})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-card border border-border",children:[e.jsxs("h2",{className:"font-semibold mb-3",children:["Položky (",h.length,")"]}),e.jsx("div",{className:"space-y-2",children:h.map(t=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[t.title,t.variantName&&t.variantName!=="ks"&&` (${t.variantName})`," × ",t.quantity]}),e.jsxs("span",{className:"font-medium",children:[t.price*t.quantity," Kč"]})]},`${t.dbId}-${t.pvId}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-card border border-border space-y-2",children:[re&&e.jsxs("div",{className:"flex items-center gap-2 mb-2 px-3 py-1.5 rounded-lg bg-primary/10 border border-primary/30",children:[e.jsx(De,{className:"h-3.5 w-3.5 text-primary"}),e.jsxs("span",{className:"text-xs font-medium text-primary",children:["Klubová sleva −",ie,"% (",ne,") započtena"]})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Mezisoučet"}),e.jsxs("span",{children:[ae," Kč"]})]}),T&&e.jsxs("div",{className:"flex justify-between text-sm text-primary",children:[e.jsxs("span",{children:["Poukaz (",T.code,")"]}),e.jsxs("span",{className:"font-bold",children:["−",Math.min(T.hodnota,ae)," Kč"]})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:(z==null?void 0:z.nazev)||"Doprava"}),e.jsxs("span",{children:[J," Kč"]})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Platba"}),e.jsx("span",{children:"zdarma"})]}),e.jsxs("div",{className:"border-t border-border pt-2 flex justify-between",children:[e.jsx("span",{className:"font-semibold",children:"Celkem"}),e.jsxs("span",{className:"text-xl font-bold text-primary",children:[fe," Kč"]})]})]}),V.loading&&e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50 border border-border text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(Ne,{className:"h-4 w-4 animate-spin"}),"Ověřuji dostupnost zboží…"]}),V.errors.length>0&&e.jsxs("div",{className:"p-4 rounded-lg bg-destructive/10 border border-destructive/30 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-destructive",children:"Některé položky nejsou dostupné:"}),V.errors.map((t,s)=>e.jsxs("p",{className:"text-sm text-destructive/80",children:["• ",t]},s)),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Uprav prosím košík před odesláním objednávky."})]}),e.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Při pokračování v nákupu souhlasíš a potvrzuješ, že jsi se seznámil(a) s"," ",e.jsx("a",{href:"/obchodni-podminky-osobni-udaje#vop-eshop",target:"_blank",rel:"noopener noreferrer",className:"underline text-primary hover:text-primary/80",children:"obchodními podmínkami"}),"."]}),e.jsxs(Z,{className:"w-full gap-2 uppercase tracking-wide",size:"lg",disabled:ce||V.loading||V.errors.length>0,onClick:Ce,children:[e.jsx(ze,{className:"h-5 w-5"}),ce?"Zpracovávám…":e.jsxs("span",{className:"text-center leading-tight",children:["ODESLAT OBJEDNÁVKU",e.jsx("br",{}),e.jsx("span",{className:"text-xs font-normal normal-case",children:"závazně k platbě"})]})]})]})]})})}export{Ge 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.