1import{u as w,l as y,r,j as e,N as d,i as j,F as m,S,M as x,s as k,G as E}from"./index-BghHNOje.js";import{C}from"./check-Cs64SJZX.js";const z=()=>{const b=w(),{toast:a}=y(),[l,p]=r.useState(""),[i,h]=r.useState(""),[n,g]=r.useState(""),[o,c]=r.useState(!1),[f,N]=r.useState(!1),v=async t=>{if(t.preventDefault(),!l||!i||!n){a({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}c(!0);try{const{data:s,error:u}=await k.functions.invoke("newsletter-signup",{body:{email:l.toLowerCase().trim(),firstName:i.trim(),lastName:n.trim()}});if((s==null?void 0:s.error)==="already_subscribed"){a({title:"Already subscribed",description:"This email address is already on our newsletter list. You'll continue receiving our updates â no action needed!"});return}if(u)throw u;E("newsletter_signup","newsletter"),N(!0),a({title:"Welcome to our newsletter!",description:"You've been successfully subscribed to our updates."})}catch(s){console.error("Newsletter signup error:",s),a({title:"Error",description:s instanceof Error?s.message:"Failed to sign up for newsletter. Please try again.",variant:"destructive"})}finally{c(!1)}};return f?e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50",children:[e.jsx(d,{}),e.jsx("div",{className:"pt-32 pb-20 lg:pt-40 lg:pb-32",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-6 text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-8",children:e.jsx(C,{className:"w-10 h-10 text-green-600"})}),e.jsx("h1",{className:"text-4xl lg:text-5xl font-bold text-gray-900 mb-6",children:"Welcome to Our Newsletter!"}),e.jsx("p",{className:"text-xl text-gray-600 mb-8",children:"Thank you for subscribing! You'll receive the latest updates about innovations, success stories, and events from Technopark Luzern."}),e.jsxs("button",{onClick:()=>b("/news"),className:"px-8 py-4 bg-blue-600 text-white font-semibold rounded-2xl hover:bg-blue-700 transition-colors flex items-center gap-3 mx-auto",children:[e.jsx(j,{className:"w-5 h-5"}),"Back to News"]})]})}),e.jsx(m,{})]}):e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50",children:[e.jsx(S,{title:"Newsletter Signup â Technopark Luzern",description:"Subscribe to the Technopark Luzern newsletter for deep tech news, startup stories and event invitations from Central Switzerland's innovation hub.",canonicalUrl:"https://technopark-luzern.ch/newsletter-signup"}),e.jsx(d,{}),e.jsx("section",{className:"pt-32 pb-20 lg:pt-40 lg:pb-32",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-6",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-2xl flex items-center justify-center mx-auto mb-6",children:e.jsx(x,{className:"w-8 h-8 text-white"})}),e.jsx("h1",{className:"text-4xl lg:text-5xl font-bold text-gray-900 mb-6",children:"Join Our Newsletter"}),e.jsx("p",{className:"text-xl text-gray-600",children:"Stay updated with the latest innovations, success stories, and events from Switzerland's most dynamic startup ecosystem."})]}),e.jsxs("form",{onSubmit:v,className:"bg-white rounded-3xl p-8 shadow-xl",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700 mb-2",children:"First Name *"}),e.jsx("input",{type:"text",id:"firstName",value:i,onChange:t=>h(t.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your first name",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700 mb-2",children:"Last Name *"}),e.jsx("input",{type:"text",id:"lastName",value:n,onChange:t=>g(t.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your last name",required:!0})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address *"}
1),e.jsx("input",{type:"email",id:"email",value:l,onChange:t=>p(t.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your email address",required:!0})]}),e.jsxs("button",{type:"submit",disabled:o,className:`w-full py-4 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-semibold rounded-xl transition-all duration-500 flex items-center justify-center space-x-2 ${o?"opacity-70 cursor-not-allowed":"hover:scale-105 hover:shadow-2xl hover:shadow-blue-500/25"}`,children:[e.jsx(x,{className:"w-5 h-5"}),e.jsx("span",{children:o?"Subscribing...":"Subscribe to Newsletter"})]})]}),e.jsx("p",{className:"text-gray-500 text-sm text-center mt-6",children:"We respect your privacy. Unsubscribe at any time."})]})]})}),e.jsx(m,{})]})};export{z 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.