(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[624],{3397:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cariere",function(){return a(9576)}])},9576:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSG:function(){return w},default:function(){return S}});var r=a(5893),n=a(7294),l=a(7357),o=a(5861),i=a(1737),s=a(6886),c=a(4398),d=a(480),u=a(5071),m=a(5582),p=a(6858),h=a(1163),g=a(9008),x=a.n(g),f=a(4853),j=a(8901),_=a(497),y=a(7048),b=a(9593),Z=a(1575),w=!0;function S(e){let{data:t}=e,a=(0,h.useRouter)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(x(),{children:[(0,r.jsx)("title",{children:"".concat(t.careers_page.meta_title," | ").concat("Fermele Moraru")}),(0,r.jsx)("meta",{property:"og:description",content:t.careers_page.meta_description}),(0,r.jsx)("meta",{name:"description",content:t.careers_page.meta_description})]}),(0,r.jsxs)(_.Z,{meta:t.meta,children:[(0,r.jsx)(y.Z,{title:t.careers_page.title,heading:t.careers_page.heading,extraPaddingTop:!0,scrollIndicator:!0,fullHeight:!0,image:"".concat("https://api.fermelemoraru.ro/","/storage/").concat(t.careers_page.image),illustration_right:"".concat("https://api.fermelemoraru.ro/","/storage/").concat(t.careers_page.illustration),recipe_hero:!0}),(0,r.jsx)(m.Z,{maxWidth:"md",sx:{pt:{xs:8,md:12,lg:14},pb:{xs:8,md:12,lg:16}},children:(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(Z.M,{children:(0,r.jsx)(o.Z,{variant:"title",component:"h2",align:"center",sx:{mb:{xs:5,md:10}},children:t.careers_page.title_2})}),(0,r.jsx)(e=>{let[t,o]=n.useState(!1),[m,h]=n.useState(!1),[g,x]=n.useState(null),[_,y]=n.useState(null),[w,S]=n.useState(!1),[C,P]=n.useState({firstName:"",lastName:"",phone:"",email:"",message:""}),k={firstName:null,lastName:null,phone:null,email:null,message:null},[M,N]=n.useState(k),v=n.createRef(),[T,F]=n.useState(null),A=n.useCallback(e=>{e.length>0&&(e[0],F(e[0]))},[]),{getRootProps:E,getInputProps:D,isDragActive:I}=(0,j.uI)({onDrop:A,accept:".pdf, .doc, .docx"}),z=async e=>{e.preventDefault(),N(k),y(null),x(null);let t=await v.current.executeAsync();if(!w){y(!1),x("ro"==a.locale?"Trebuie să fii de acord cu Termenii și Condițiile pentru a putea continua.":"You must first agree with the Terms and Conditions.");return}h(!0);let r=new FormData;T&&r.append("cv",T,{headers:{"Content-Type":"multipart/form-data"}}),Object.entries(C).forEach(e=>{let[t,a]=e;r.append(t,a)}),r.append("g-recaptcha-response",t),b.Z.post("/careers",r).then(e=>{e.data.success?(y(!0),x(e.data.message)):(y(!1),x(e.data.message?e.data.message:null),N({...M,...e.data.field_errors&&e.data.field_errors})),h(!1)}).catch(e=>{x(e.response&&e.response.data&&e.response.data.message?e.response.data.message:"Something went wrong. Please try again later."),h(!1)})},H=e=>{t||o(!0),P({...C,[e.target.name]:e.target.value}),N({...M,[e.target.name]:null})},W=[{type:"text",name:"lastName",label:"ro"==a.locale?"Nume":"Last name",placeHolder:"ro"==a.locale?"Popescu":"Johnson"},{type:"text",name:"firstName",label:"ro"==a.locale?"Prenume":"First name",placeHolder:"ro"==a.locale?"Ioan":"John"},{type:"text",name:"phone",label:"ro"==a.locale?"Telefon":"Phone number",placeHolder:"ro"==a.locale?"Nr. tău de telefon":"Your phone number"},{type:"email",name:"email",label:"Email",placeHolder:"ro"==a.locale?"exemplu@mail.com":"example@mail.com"},{type:"textarea",name:"message",label:"ro"==a.locale?"Mesaj":"Message",placeHolder:"ro"==a.locale?"Mesajul tău...":"Your message..."}];return(0,r.jsx)(l.Z,{component:"form",onSubmit:z,children:_?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(i.Z,{severity:"success",children:g})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z.M,{delay:.1,children:(0,r.jsxs)(s.ZP,{container:!0,spacing:3,rowSpacing:2,sx:{mt:2},children:[W.map((e,t)=>(0,n.createElement)(s.ZP,{item:!0,xs:12,..."textarea"!=e.type&&{md:6},key:t},(0,r.jsx)(c.Z,{type:e.type,id:e.name,name:e.name,label:e.label,placeholder:e.placeHolder,value:C[e.name],variant:"standard",fullWidth:!0,error:!!M[e.name],helperText:M[e.name],multiline:"textarea"==e.type,rows:4,onChange:H,required:!0,sx:{"& .MuiInputLabel-root":{fontWeight:400},"& .MuiInput-root":{color:"white",fontWeight:400,"&:before":{borderColor:"rgba(255, 255, 255, 0.5) !important"}}}}))),(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsxs)(l.Z,{...E(),sx:{background:e=>e.palette.neutral.light,padding:e=>e.spacing(2,3),textAlign:"center",border:"2px dashed rgba(255, 255, 255, 0.75)",fontWeight:400,cursor:"pointer",mt:2},children:[(0,r.jsx)(l.Z,{component:"input",...D()}),I?(0,r.jsx)("p",{children:"Drop the files here ..."}):(0,r.jsx)("p",{children:T?"".concat("ro"==a.locale?"Fișier selectat":"Selected file",": ").concat(T.name," (").concat(T.size/1024>=1024?"".concat((T.size/1048576).toFixed(2),"MB"):"".concat((T.size/1024).toFixed(2),"KB"),")"):"ro"==a.locale?"Atașează CV-ul tău aici (PDF sau DOC, 5MB)":"Drop your CV here (PDF or DOC, 5MB)"})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsx)(d.Z,{control:(0,r.jsx)(u.Z,{onChange:e=>{S(e.target.checked),x(null),N(k)},checked:w,sx:{"& .MuiTypography-root":{fontWeight:400},"&:not(.Mui-checked) .MuiSvgIcon-root":{color:"white"}}}),label:"ro"==a.locale?"Am citit și sunt de acord cu Termenii și Condițiile site-ului.":"I read and agree with the Terms and Conditions."})}),!!g&&(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsx)(i.Z,{severity:_?"warning":"error",children:g||"Something went wrong. Please try again later."})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsx)(p.Z,{size:"large",variant:"primary",type:"submit",sx:{display:"flex","& .MuiLoadingButton-loadingIndicator":{color:"white"},"&:after":{display:"none"},"&:hover":{color:"white"},mt:3},loading:m,children:"ro"==a.locale?"Trimite":"Send"})})]})}),t&&(0,r.jsx)(f.Z,{ref:v,size:"invisible",sitekey:"6LcSybwpAAAAACSqWKsZzAifkEkeVK7kPkCje7y0",onChange:e=>{e&&v.current.reset()}})," "]})})},{})]})})]})]})}}},function(e){e.O(0,[294,803,852,901,917,774,888,179],function(){return e(e.s=3397)}),_N_E=e.O()}]);