1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6344],{1918:(e,r,t)=>{"use strict";t.d(r,{default:()=>i});var s=t(5155),a=t(2115),n=t(4185);let o=/^(?:\+359|00359|0)\d{9}$/;function i(e){let{recaptchaSiteKey:r}=e,[t,i]=(0,a.useState)("idle"),[c,l]=(0,a.useState)(""),[d,m]=(0,a.useState)({}),[x,u]=(0,a.useState)(!1),h=(0,a.useRef)(null),p=(0,a.useRef)(null),b=(0,a.useCallback)(e=>{h.current=e},[]);async function g(e){e.preventDefault(),l(""),m({});let r=e.currentTarget,t=new FormData(r),s=function(e){let r={},t=(e.get("name")||"").trim(),s=(e.get("email")||"").trim(),a=(e.get("phone")||"").replace(/\s+/g,""),n=(e.get("subject")||"").trim(),i=(e.get("message")||"").trim();return t?t.length>100&&(r.name="ÐмеÑо не може да е повеÑе Ð¾Ñ 100 Ñимвола."):r.name="ÐолÑ, вÑведеÑе ÐаÑеÑо име.",s?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)||(r.email="ÐолÑ, вÑведеÑе валиден имейл адÑеÑ."):r.email="ÐолÑ, вÑведеÑе имейл адÑеÑ.",a?o.test(a)||(r.phone="ÐÑведеÑе валиден бÑлгаÑÑки ÑелеÑонен Ð½Ð¾Ð¼ÐµÑ (напÑ. 0888123456 или +359888123456)."):r.phone="ÐолÑ, вÑведеÑе ÑелеÑонен номеÑ.",n?n.length>200&&(r.subject="ТемаÑа не може да е повеÑе Ð¾Ñ 200 Ñимвола."):r.subject="ÐолÑ, вÑведеÑе Ñема.",i?i.length<10?r.message="СÑобÑениеÑо ÑÑÑбва да е поне 10 Ñимвола.":i.length>5e3&&(r.message="СÑобÑениеÑо не може да е повеÑе Ð¾Ñ 5000 Ñимвола."):r.message="ÐолÑ, вÑведеÑе ÑÑобÑение.",r}(t);if(Object.keys(s).length>0){m(s),i("idle"),requestAnimationFrame(()=>(function(e){for(let t of["name","email","phone","subject","message"])if(e[t]){var r;let e=null==(r=p.current)?void 0:r.querySelector('[name="'.concat(t,'"]'));null==e||e.focus();break}})(s));return}if(!(x||(m(e=>({...e,gdpr:"ТÑÑбва да Ñе ÑÑглаÑиÑе Ñ Ð¾Ð±ÑабоÑкаÑа на лиÑниÑе Ðи данни."})),0)))return;i("sending");let a=Object.fromEntries(t);h.current&&(a.recaptchaToken=h.current);try{let e=await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!e.ok){let r=await e.json().catch(()=>({}));l(r.error||"ÐÑзникна гÑеÑка. ÐолÑ, опиÑайÑе оÑново."),i("error");return}i("success"),r.reset()}catch(e){l("ÐÑма вÑÑзка ÑÑÑ ÑÑÑвÑÑа. ÐолÑ, опиÑайÑе по-кÑÑно."),i("error")}}return(0,s.jsxs)("form",{ref:p,onSubmit:g,noValidate:!0,className:"space-y-5",children:[(0,s.jsxs)("div",{className:"absolute -left-[9999px]","aria-hidden":"true",children:[(0,s.jsx)("label",{htmlFor:"website",children:"Ðе попÑлвайÑе"}),(0,s.jsx)("input",{type:"text",id:"website",name:"website",tabIndex:-1,autoComplete:"off"})]}),"success"===t&&(0,s.jsx)("div",{role:"status",className:"rounded-lg bg-success/10 border border-success/20 px-4 py-3 text-sm text-success",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,s.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),(0,s.jsx)("span",{children:"СÑобÑениеÑо е изпÑаÑено ÑÑпеÑно! Ще Ñе ÑвÑÑжем Ñ ÐÐ°Ñ Ð² най-кÑаÑÑк ÑÑок."})]})}),"error"===t&&c&&(0,s.jsx)("div",{role:"alert",className:"rounded-lg bg-error/10 border border-error/20 px-4 py-3 text-sm text-error",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,s.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),(0,s.jsx)("span",{children:c})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"contact-name",className:"mb-1.5 block text-sm font-medium text-text-main",children:["ÐаÑеÑо име ",(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("input",{id:"contact-name",name:"name",type:"text",required:!0,maxLength:100,placeholder:"Ðван Ðванов","aria-invalid":!!d.name,"aria-describedby":d.name?"error-name":void 0,className:"w-full rounded-lg border bg-background px-4 py-2.5 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary transition-colors ".concat(d.name?"border-error":"border-border")}),d.name&&(0,s.jsx)("p",{id:"error-name",role:"alert",className:"mt-1 text-xs text-error",children:d.name})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"contact-email",className:"mb-1.5 block text-sm font-medium text-text-main",children:["Ðмейл адÑÐµÑ ",(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("input",{id:"contact-email",name:"email",type:"email",required:!0,maxLength:254,placeholder:"[email protected]","aria-invalid":!!d.email,"aria-describedby":d.email?"error-email":void 0,className:"w-full rounded-lg border bg-background px-4 py-2.5 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary transition-colors ".concat(d.email?"border-error":"border-border")}),d.email&&(0,s.jsx)("p",{id:"error-email",role:"alert",className:"mt-1 text-xs text-error",children:d.email})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"contact-phone",className:"mb-1.5 block text-sm font-medium text-text-main",children:["ТелеÑон ",(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("input",{id:"contact-phone",name:"phone",type:"tel",required:!0,maxLength:20,placeholder:"0888 123 456","aria-invalid":!!d.phone,"aria-describedby":d.p
1hone?"error-phone":"phone-hint",className:"w-full rounded-lg border bg-background px-4 py-2.5 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary transition-colors ".concat(d.phone?"border-error":"border-border")}),d.phone?(0,s.jsx)("p",{id:"error-phone",role:"alert",className:"mt-1 text-xs text-error",children:d.phone}):(0,s.jsx)("p",{id:"phone-hint",className:"mt-1 text-xs text-text-muted",children:"ФоÑмаÑ: 0888123456 или +359888123456"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"contact-subject",className:"mb-1.5 block text-sm font-medium text-text-main",children:["Тема ",(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("input",{id:"contact-subject",name:"subject",type:"text",required:!0,maxLength:200,placeholder:"ÐÑноÑно...","aria-invalid":!!d.subject,"aria-describedby":d.subject?"error-subject":void 0,className:"w-full rounded-lg border bg-background px-4 py-2.5 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary transition-colors ".concat(d.subject?"border-error":"border-border")}),d.subject&&(0,s.jsx)("p",{id:"error-subject",role:"alert",className:"mt-1 text-xs text-error",children:d.subject})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"contact-message",className:"mb-1.5 block text-sm font-medium text-text-main",children:["СÑобÑение ",(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("textarea",{id:"contact-message",name:"message",required:!0,minLength:10,maxLength:5e3,rows:6,placeholder:"ÐаÑеÑо ÑÑобÑение...","aria-invalid":!!d.message,"aria-describedby":d.message?"error-message":"message-hint",className:"w-full rounded-lg border bg-background px-4 py-2.5 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary transition-colors resize-y ".concat(d.message?"border-error":"border-border")}),d.message?(0,s.jsx)("p",{id:"error-message",role:"alert",className:"mt-1 text-xs text-error",children:d.message}):(0,s.jsx)("p",{id:"message-hint",className:"mt-1 text-xs text-text-muted",children:"ÐинимÑм 10 Ñимвола"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("input",{id:"contact-gdpr",type:"checkbox",checked:x,onChange:e=>{u(e.target.checked),e.target.checked&&m(e=>({...e,gdpr:void 0}))},"aria-invalid":!!d.gdpr,"aria-describedby":d.gdpr?"error-gdpr":void 0,className:"mt-0.5 h-4 w-4 shrink-0 cursor-pointer accent-primary"}),(0,s.jsxs)("label",{htmlFor:"contact-gdpr",className:"text-sm text-text-main leading-snug cursor-pointer",children:["СÑглаÑен/а ÑÑм лиÑниÑе ми данни да бÑÐ´Ð°Ñ Ð¾Ð±ÑабоÑени за ÑелиÑе на запиÑванеÑо ÑÑглаÑно"," ",(0,s.jsx)("a",{href:"/privacy",className:"text-primary underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-primary rounded",children:"ÐолиÑикаÑа за повеÑиÑелноÑÑ"})," ","и изиÑкваниÑÑа на GDPR. ",(0,s.jsx)("span",{className:"text-error",children:"*"})]})]}),d.gdpr&&(0,s.jsx)("p",{id:"error-gdpr",role:"alert",className:"mt-1 text-xs text-error",children:d.gdpr})]}),r&&(0,s.jsx)(n.A,{siteKey:r,onToken:b}),(0,s.jsx)("button",{type:"submit",disabled:"sending"===t,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-6 py-3 text-sm font-semibold text-white shadow-sm hover:bg-primary-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-60 transition-colors",children:"sending"===t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"ÐзпÑаÑанеâ¦"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,s.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),"ÐзпÑаÑи ÑÑобÑение"]})}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"ÐаÑиÑе данни Ñе бÑÐ´Ð°Ñ Ð¸Ð·Ð¿Ð¾Ð»Ð·Ð²Ð°Ð½Ð¸ единÑÑвено за оÑÐ³Ð¾Ð²Ð¾Ñ Ð½Ð° запиÑванеÑо и нÑма да бÑÐ´Ð°Ñ ÑподелÑни Ñ ÑÑеÑи ÑÑÑани."})]})}},4185:(e,r,t)=>{"use strict";t.d(r,{A:()=>c});var s=t(5155),a=t(2115);let n=!1,o=!1,i=[];function c(e){let{siteKey:r,onToken:t}=e,c=(0,a.useRef)(null),l=(0,a.useRef)(null),d=(0,a.useRef)(!1),m=(0,a.useCallback)(()=>{var e;c.current&&!d.current&&(null==(e=window.grecaptcha)?void 0:e.render)&&(d.current=!0,l.current=window.grecaptcha.render(c.current,{sitekey:r,callback:e=>t(e),"expired-callback":()=>t(null)}))},[r,t]);return(0,a.useEffect)(()=>
1(n?m():(i.push(m),!function(){if(n){i.forEach(e=>e()),i.length=0;return}if(o)return;o=!0,window.onRecaptchaLoaded=()=>{n=!0,o=!1,i.forEach(e=>e()),i.length=0};let e=document.createElement("script");e.src="https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit",e.async=!0,e.defer=!0,document.head.appendChild(e)}()),()=>{let e=i.indexOf(m);e>=0&&i.splice(e,1)}),[m]),(0,s.jsx)("div",{ref:c,className:"mt-2"})}},7916:(e,r,t)=>{Promise.resolve().then(t.bind(t,1918)),Promise.resolve().then(t.t.bind(t,2619,23))}},e=>{e.O(0,[2619,8441,1255,7358],()=>e(e.s=7916)),_N_E=e.O()}]);
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.