1var e=Object.defineProperty,s=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,n=(s,r,a)=>r in s?e(s,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[r]=a,i=(e,s,r)=>new Promise(((a,t)=>{var l=e=>{try{i(r.next(e))}catch(s){t(s)}},n=e=>{try{i(r.throw(e))}catch(s){t(s)}},i=e=>e.done?a(e.value):Promise.resolve(e.value).then(l,n);i((r=r.apply(e,s)).next())}));import{j as d}from"./ui-vendor-Bh7_beny.js";import{e as o,R as c,r as m,N as x}from"./react-vendor-BoSAEcqU.js";import{cJ as h,cR as p,p as u,u as b,cK as g,d as j}from"./index-IinEbi41.js";import{j as f,i as y}from"./firebase-vendor-DblBUUbW.js";import"./fabric-vendor-T6PTpD9i.js";const v=()=>{const{project:e,projectSlug:v}=h(),{publicProjectId:N,resolving:w}=p(),{isAuthenticated:C,isInitialized:k,isLoading:_}=u(),S=o(),{t:P}=b("contact"),[F,O]=c.useState(!1),[q,H]=c.useState(!1),[W,I]=c.useState(!0),[T,$]=c.useState({addressStreet:"",addressPostalCode:"",addressCity:"",addressCountry:"",phone:"",email:"",openingHoursWeekdays:"",openingHoursWeekend:""}),[z,E]=m.useState({name:"",email:"",phone:"",subject:"",message:"",honeypot:""}),[A,D]=m.useState(!1),[J,M]=m.useState("idle"),[R,B]=m.useState("");c.useEffect((()=>{O(!1),i(null,null,(function*(){var e,s;if(N)try{const r=yield f(y(j,"public_projects",N));if(r.exists()){const a=r.data();H(!!(null==(e=null==a?void 0:a.restrictedPages)?void 0:e.contact)),I(!1!==(null==(s=null==a?void 0:a.enabledModules)?void 0:s.contact)),$({addressStreet:a.addressStreet||"",addressPostalCode:a.addressPostalCode||"",addressCity:a.addressCity||"",addressCountry:a.addressCountry||"",phone:a.phone||"",email:a.email||"",openingHoursWeekdays:a.openingHoursWeekdays||"",openingHoursWeekend:a.openingHoursWeekend||""})}}catch(r){}finally{O(!0)}}))}),[N]);const K={title:P("page_title"),description:P("meta_description",{projectName:(null==e?void 0:e.name)||v}),ogType:"website"};if(w||!F||!k||_)return d.jsx(g,{meta:K,children:d.jsx("div",{className:"min-h-[400px] flex items-center justify-center",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})});if(!W)return d.jsx(x,{to:`/${v}/test`,replace:!0});if(q&&!C)return d.jsx(x,{to:"/login",replace:!0,state:{redirect:S.pathname}});const L=e=>{const{name:i,value:d}=e.target;E((e=>{return o=((e,s)=>{for(var r in s||(s={}))t.call(s,r)&&n(e,r,s[r]);if(a)for(var r of a(s))l.call(s,r)&&n(e,r,s[r]);return e})({},e),s(o,r({[i]:d}));var o}))};return d.jsx(g,{meta:K,children:d.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 sm:py-12",children:[d.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[d.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 mb-3 sm:mb-4",children:P("header.title")}),d.jsx("p",{className:"text-base sm:text-lg text-gray-600 max-w-2xl mx-auto",children:P("header.subtitle",{projectName:(null==e?void 0:e.name)||v})})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 lg:gap-8",children:[d.jsxs("div",{className:"lg:col-span-1 space-y-4 sm:space-y-6",children:[(T.addressStreet||T.addressCity)&&d.jsx("div",{className:"bg-white rounded-2xl shadow-lg p-6 hover:shadow-xl transition-shadow",children:d.jsxs("div",{className:"flex items-start",children:[d.jsx("div",{className:"flex-shrink-0",children:d.jsx("div",{className:"w-12 h-12 bg-blue-100 rounded-xl flex items-center justify-center",children:d.jsx("span",{className:"material-symbols-outlined text-blue-600 text-2xl",children:"location_on"})})}),d.jsxs("div",{className:"ml-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:P("info_cards.address")}),d.jsxs("address",{className:"not-italic text-gray-600 text-sm leading-relaxed",children:[T.addressStreet&&d.jsxs(d.Fragment,{children:[T.addressStreet,d.jsx("br",{})]}),T.addressPostalCode&&T.addressCity&&d.jsxs(d.Fragment,{children:[`${T.addressPostalCode} ${T.addressCity}`,d.jsx("br",{})]}),T.addressCountry&&d.jsx(d.Fragment,{children:T.addressCountry})]})]})]})}),T.phone&&d.jsx("div",{className:"bg-white rounded-2xl shadow-lg p-6 hover:shadow-xl transition-shadow",children:d.jsxs("div",{className:"flex items-start",children:[d.jsx("div",{className:"flex-shrink-0",children:d.jsx("div",{className:"w-12 h-12 bg-green-100 rounded-xl flex items-center justify-center",children:d.jsx("span",{className:"material-symbols-outlined text-green-600 text-2xl",children:"call"})})}),d.jsxs("div",{className:"ml-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:P("info_cards.phone")}),d.jsx("a",{href:`tel:${T.phone}`,className:"text-gray-600 hover:text-green-600 transition-colors text-sm",children:T.phone})]})]})}),T.email&&d.jsx("div",{className:"bg-white rounded-2xl shadow-lg p-6 hover:shadow-xl transition-shadow",children:d.jsxs("div",{className:"flex items-start",children:[d.jsx("div",{className:"flex-shrink-0",children:d.jsx("div",{className:"w-12 h-12 bg-purple-100 rounded-xl flex items-center justify-center",children:d.jsx("span",{className:"material-symbols-outlined text-purple-600 text-2xl",children:"mail"})})}),d.jsxs("div",{className:"ml-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:P("info_cards.email")}),d.jsx("a",{href:`mailto:${T.email}`,className:"text-gray-600 hover:text-purple-600 transition-colors text-sm break-all",children:T.email})]})]})})]}),d.jsx("div",{className:"lg:col-span-2",children:d.jsxs("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[d.jsxs("div",{className:"mb-6",children:[d.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-2",children:P("form.title")}),d.jsx("p",{className:"text-gray-600",children:P("form.subtitle")})]}),"success"===J&&d.jsx("div",{className:"mb-6 p-4 bg-green-50 border border-green-200 rounded-xl",children:d.jsxs("div",{className:"flex items-start",children:[d.jsx("span",{className:"material-symbols-outlined text-green-600 mr-3",children:"check_circle"}),d.jsxs("div",{children:[d.jsx("h4",{className:"font-semibold text-green-900 mb-1",children:P("messages.success_title")}),d.jsx("p",{className:"text-sm text-green-700",children:P("messages.success_text")})]})]})}),"error"===J&&d.jsx("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-xl",children:d.jsxs("div",{className:"flex items-start",children:[d.jsx("span",{className:"material-symbols-outlined text-red-600 mr-3",children:"error"}),d.jsxs("div",{children:[d.jsx("h4",{className:"font-semibold text-red-900 mb-1",children:P("messages.error_title")}),d.jsx("p",{className:"text-sm text-red-700",children:R||P("messages.error_text")})]})]})}),d.jsxs("form",{onSubmit:e=>i(null,null,(function*(){if(e.preventDefault(),z.honeypot&&z.honeypot.trim().length>
10)return M("success"),void E({name:"",email:"",phone:"",subject:"",message:"",honeypot:""});if(!N)return B(P("messages.project_not_found")),void M("error");D(!0),M("idle"),B("");try{if(!(yield fetch("https://us-central1-floorplan-138cc.cloudfunctions.net/sendContactForm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:N,name:z.name,email:z.email,phone:z.phone,subject:z.subject,message:z.message,honeypot:z.honeypot||""})})).ok)throw new Error(P("messages.send_error"));M("success"),E({name:"",email:"",phone:"",subject:"",message:"",honeypot:""}),setTimeout((()=>{M("idle")}),5e3)}catch(s){B(s instanceof Error?s.message:P("messages.send_error")),M("error")}finally{D(!1)}})),className:"space-y-6",children:[d.jsxs("div",{className:"hidden","aria-hidden":"true",children:[d.jsx("label",{htmlFor:"company",className:"block text-sm font-semibold text-gray-700 mb-1",children:"Company"}),d.jsx("input",{type:"text",id:"company",name:"honeypot",value:z.honeypot,onChange:L,autoComplete:"off",tabIndex:-1})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"name",className:"block text-sm font-semibold text-gray-700 mb-2",children:[P("form.fields.name")," ",d.jsx("span",{className:"text-red-500",children:P("form.required_field")})]}),d.jsx("input",{type:"text",id:"name",name:"name",value:z.name,onChange:L,required:!0,className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all min-h-[44px]",placeholder:P("form.placeholders.name"),disabled:A})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"email",className:"block text-sm font-semibold text-gray-700 mb-2",children:[P("form.fields.email")," ",d.jsx("span",{className:"text-red-500",children:P("form.required_field")})]}),d.jsx("input",{type:"email",id:"email",name:"email",value:z.email,onChange:L,required:!0,className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all min-h-[44px]",placeholder:P("form.placeholders.email"),disabled:A})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"phone",className:"block text-sm font-semibold text-gray-700 mb-2",children:P("form.fields.phone")}),d.jsx("input",{type:"tel",id:"phone",name:"phone",value:z.phone,onChange:L,className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all min-h-[44px]",placeholder:P("form.placeholders.phone"),disabled:A})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"subject",className:"block text-sm font-semibold text-gray-700 mb-2",children:P("form.fields.subject")}),d.jsx("input",{type:"text",id:"subject",name:"subject",value:z.subject,onChange:L,className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all min-h-[44px]",placeholder:P("form.placeholders.subject"),disabled:A})]})]}),d.jsxs("div",{children:[d.jsxs("label",{htmlFor:"message",className:"block text-sm font-semibold text-gray-700 mb-2",children:[P("form.fields.message")," ",d.jsx("span",{className:"text-red-500",children:P("form.required_field")})]}),d.jsx("textarea",{id:"message",name:"message",value:z.message,onChange:L,required:!0,rows:6,className:"w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all resize-none",placeholder:P("form.placeholders.message"),disabled:A})]}),d.jsx("div",{children:d.jsx("button",{type:"submit",disabled:A,className:"w-full sm:w-auto min-w-[200px] bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white font-semibold py-3 px-8 rounded-xl shadow-lg hover:shadow-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center min-h-[44px]",style:{WebkitTapHighlightColor:"transparent"},children:A?d.jsxs(d.Fragment,{children:[d.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),P("form.submitting")]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"material-symbols-outlined mr-2",children:"send"}),P("form.submit")]})})}),d.jsxs("p",{className:"text-xs text-gray-500 mt-4",children:[d.jsx("span",{className:"text-red-500",children:P("form.required_field")})," ",P("form.required")]})]})]})})]})]})})};export{v as default}; 2//# sourceMappingURL=ContactPage-Cbagcdtr.js.map
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.