PageSourceSearch

https://beamish-maamoul-a3c725.netlify.app/assets/NewsletterPage-BgdT6lKC.js

js beamish-maamoul-a3c725.netlify.app collected 2026-10-03 10:29:33 UTC 11,194 bytes, 1 lines download raw bytes

1import{j as e,s as a}from"./index-B-01gp8C.js";import{r as s}from"./vendor-react-7UJKJIhU.js";import{u as t,l as r,M as o,G as n,C as d,f as i,z as l}from"./vendor-ui-DJKmmfZX.js";import{C as c}from"./calendar-AQTVilM2.js";import{c as m}from"./cs-FWuxrkYj.js";import"./vendor-supabase-CDTnsVBO.js";function p(){const[p,x]=s.useState({name:"",email:"",dateOfBirth:"",gdprConsent:!1}),[h,b]=s.useState(!1),[u,v]=s.useState(!1),[j,f]=s.useState(!1),[g,k]=s.useState(void 0);return u?e.jsx("div",{className:"min-h-screen bg-parchment-100 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full text-center",children:e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-8 space-y-6",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-copper-100 rounded-full p-4",children:e.jsx(t,{className:"w-16 h-16 text-copper-600"})})}),e.jsx("h1",{className:"text-h1 font-heading font-bold text-oak-900",children:"Děkujeme za registraci!"}),e.jsxs("p",{className:"text-body-lg text-oak-700",children:["Na váš e-mail jsme odeslali ",e.jsx("span",{className:"font-semibold text-copper-600",children:"potvrzovací odkaz"}),". Klikněte na něj pro dokončení registrace a získání slevového kódu."]}),e.jsx("div",{className:"bg-copper-50 border-2 border-copper-300 rounded-vintage p-4",children:e.jsxs("p",{className:"text-sm text-oak-700 font-body",children:[e.jsx("strong",{children:"Tip:"})," Zkontrolujte také složku spam, pokud email nedorazí do 5 minut."]})}),e.jsx("div",{className:"pt-4",children:e.jsxs("a",{href:"/",className:"btn-vintage inline-flex items-center gap-2",children:[e.jsx(r,{className:"w-4 h-4"}),"Zpět na hlavní stránku"]})})]})})}):e.jsx("div",{className:"min-h-screen bg-parchment-100 py-12 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"bg-copper-600 rounded-vintage p-4 border-2 border-copper-700",children:e.jsx(o,{className:"w-12 h-12 text-parchment-50"})})}),e.jsx("h1",{className:"text-display font-heading font-bold text-oak-900 mb-4",children:"Přihlaste se k newsletteru"}),e.jsx("p",{className:"text-body-lg text-oak-700 max-w-2xl mx-auto",children:"Získejte 10% slevu na první návštěvu a buďte jako první informováni o novinkách, akcích a speciálních nabídkách."})]}),e.jsxs("div",{className:"hidden md:grid md:grid-cols-3 gap-6 mb-12",children:[e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-6 text-center hover:shadow-vintage-lg transition-shadow",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"bg-copper-100 rounded-vintage p-3 border border-copper-300",children:e.jsx(n,{className:"w-8 h-8 text-copper-600"})})}),e.jsx("h3",{className:"font-heading font-bold text-lg mb-2 text-oak-900",children:"10% sleva"}),e.jsx("p",{className:"text-oak-600 text-sm font-body",children:"Okamžitě po registraci získáte slevový kód s QR kódem"})]}),e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-6 text-center hover:shadow-vintage-lg transition-shadow",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"bg-copper-100 rounded-vintage p-3 border border-copper-300",children:e.jsx(o,{className:"w-8 h-8 text-copper-600"})})}),e.jsx("h3",{className:"font-heading font-bold text-lg mb-2 text-oak-900",children:"Týdenní menu"}),e.jsx("p",{className:"text-oak-600 text-sm font-body",children:"Pravidelně vám pošleme aktuální týdenní nabídku"})]}),e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-6 text-center hover:shadow-vintage-lg transition-shadow",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"bg-copper-100 rounded-vintage p-3 border border-copper-300",children:e.jsx(d,{className:"w-8 h-8 text-copper-600"})})}),e.jsx("h3",{className:"font-heading font-bold text-lg mb-2 text-oak-900",children:"Narozeninová přání"}),e.jsx("p",{className:"text-oak-600 text-sm font-body",children:"Zadejte den a měsíc narození a dostanete od nás přání s milým překvapením"})]})]}),e.jsx("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-8 md:p-12 mb-8",children:e.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),p.gdprConsent){b(!0);try{const e=p.name.trim(),t=p.email.trim().toLowerCase(),{data:r,error:o}=await a.rpc("subscribe_newsletter",{p_name:e,p_email:t,p_date_of_birth:p.dateOfBirth||null,p_gdpr_consent:p.gdprConsent});if(o)throw o;const n=null==r?void 0:r[0];if(!n)throw new Error("No response from subscribe_newsletter");if("already_subscribed"===n.status)return void l.error("Tento email je již přihlášen k odběru newsletteru");const d=n.subscriber_id,i=n.verification_token,c=n.unsubscribe_token;try{const a=await fetch("https://ywyxgkacawjjsqhdfhay.supabase.co/functions/v1/send-newsletter-verification",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inl3eXhna2FjYXdqanNxaGRmaGF5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM5NzUwOTgsImV4cCI6MjA3OTU1MTA5OH0.zPvyfUG4z0tYqFpuzHO20i2s9DXHg-yZyUzlvFNgHUQ"},body:JSON.stringify({subscriber_id:d,name:e,email:t,verification_token:i,unsubscribe_token:c})});if(!a.ok)return void l.error("Registrace proběhla, ale nepodařilo se odeslat ověřovací email. Kontaktujte nás prosím.");if(!(await a.json()).success)return void l.error("Registrace proběhla, ale nepodařilo se odeslat ověřovací email. Kontaktujte nás prosím.")}catch(s){return void l.error("Registrace proběhla, ale nepodařilo se odeslat ověřovací email. Kontaktujte nás prosím.")}v(!0),l.success("Děkujeme! Na váš e-mail jsme odeslali potvrzovací odkaz.")}catch(t){l.error("Nepodařilo se přihlásit k odběru. Zkuste to prosím znovu.")}finally{b(!1)}}else l.error("Musíte souhlasit se zpracováním osobních údajů")},className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-body font-semibold text-oak-800 mb
1-2",children:"Jméno a příjmení *"}),e.jsx("input",{type:"text",id:"name",required:!0,value:p.name,onChange:e=>x({...p,name:e.target.value}),className:"w-full px-4 py-3 border-2 border-oak-300 rounded-vintage focus:ring-2 focus:ring-copper-500 focus:border-copper-500 transition-all font-body",placeholder:"Jan Novák"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-body font-semibold text-oak-800 mb-2",children:"Email *"}),e.jsx("input",{type:"email",id:"email",required:!0,value:p.email,onChange:e=>x({...p,email:e.target.value}),className:"w-full px-4 py-3 border-2 border-oak-300 rounded-vintage focus:ring-2 focus:ring-copper-500 focus:border-copper-500 transition-all font-body",placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dateOfBirth",className:"block text-sm font-body font-semibold text-oak-800 mb-2",children:"Den a měsíc narození (volitelné)"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",readOnly:!0,value:p.dateOfBirth?i(new Date(p.dateOfBirth),"d. MMMM",{locale:m}):"",onClick:()=>f(!j),className:"w-full px-4 py-3 border-2 border-oak-300 rounded-vintage focus:ring-2 focus:ring-copper-500 focus:border-copper-500 transition-all cursor-pointer font-body",placeholder:"Vyberte den a měsíc"}),j&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>f(!1)}),e.jsx("div",{className:"absolute top-full left-0 mt-2 z-50 bg-parchment-50 rounded-vintage border-2 border-oak-300 shadow-vintage-lg p-4",children:e.jsx(c,{mode:"single",selected:g,onSelect:e=>{if(e){const a=new Date(2e3,e.getMonth(),e.getDate());k(a),x({...p,dateOfBirth:i(a,"yyyy-MM-dd")}),f(!1)}},locale:m,className:"rounded-vintage",defaultMonth:new Date(2e3,0),startMonth:new Date(2e3,0),endMonth:new Date(2e3,11),formatters:{formatCaption:e=>i(e,"LLLL",{locale:m})}})})]})]}),e.jsx("p",{className:"mt-2 text-sm text-oak-600 font-body",children:"Pro zasílání přání k narozeninám s milým překvapením"})]}),e.jsx("div",{className:"bg-parchment-200 rounded-vintage p-4 border-2 border-oak-300",children:e.jsxs("label",{className:"flex items-start space-x-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",required:!0,checked:p.gdprConsent,onChange:e=>x({...p,gdprConsent:e.target.checked}),className:"mt-1 w-5 h-5 text-copper-600 border-oak-300 rounded focus:ring-copper-500"}),e.jsx("span",{className:"text-sm text-oak-800 font-body",children:"Souhlasím se zpracováním osobních údajů pro účely zasílání newsletteru a marketingových sdělení. Můj souhlas mohu kdykoli odvolat kliknutím na odkaz v emailu. *"})]})}),e.jsx("button",{type:"submit",disabled:h,className:"w-full btn-vintage py-4 text-lg disabled:opacity-50 disabled:cursor-not-allowed",children:h?"PřihlaÅ¡uji...":"Přihlásit se k odběru"}),e.jsx("p",{className:"text-center text-sm text-oak-600 font-body",children:"Odesláním formuláře souhlasíte s naÅ¡imi podmínkami zpracování osobních údajů."})]})}),e.jsxs("div",{className:"md:hidden grid grid-cols-3 gap-3 mb-8",children:[e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-3 text-center",children:[e.jsx("div",{className:"flex justify-center mb-2",children:e.jsx("div",{className:"bg-copper-100 rounded-vintage p-2 border border-copper-300",children:e.jsx(n,{className:"w-5 h-5 text-copper-600"})})}),e.jsx("h3",{className:"font-heading font-bold text-xs mb-1 text-oak-900",children:"10% sleva"}),e.jsx("p",{className:"text-oak-600 text-[10px] leading-tight font-body",children:"Slevový kód s QR"})]}),e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-3 text-center",children:[e.jsx("div",{className:"flex justify-center mb-2",children:e.jsx("div",{className:"bg-copper-100 rounded-vintage p-2 border border-copper-300",children:e.jsx(o,{className:"w-5 h-5 text-copper-600"})})}),e.jsx("h3",{className:"font-heading font-bold text-xs mb-1 text-oak-900",children:"Týdenní menu"}),e.jsx("p",{className:"text-oak-600 text-[10px] leading-tight font-body",children:"Aktuální nabídka"})]}),e.jsxs("div",{className:"paper-card rounded-vintage border-2 border-oak-300 p-3 text-center",children:[e.jsx("div",{className:"flex justify-center mb-2",children:e.jsx("div",{className:"bg-copper-100 rounded-vintage p-2 border border-copper-300",children:e.jsx(d,{className:"w-5 h-5 text-copper-600"})})}),e.jsx("h3",{className:"font-heading font-bold text-xs mb-1 text-oak-900",children:"Narozeniny"}),e.jsx("p",{className:"text-oak-600 text-[10px] leading-tight font-body",children:"Milé překvapení"})]})]}),e.jsx("div",{className:"mt-8 text-center",children:e.jsxs("a",{href:"/",className:"inline-flex items-center gap-2 text-copper-600 hover:text-copper-700 font-body font-semibold",children:[e.jsx(r,{className:"w-4 h-4"}),"Zpět na hlavní stránku"]})})]})})}export{p 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.