1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3647],{25539:function(e,t,i){"use strict";var a;!function(l){if("function"!=typeof n){var n=function(e){return e};n.nonNative=!0}let r=n("plaintext"),o=n("html"),s=n("comment"),u=/<(\w*)>/g,m=/<\/?([^\s\/>]+)/;function c(e,t,i){return x(e=e||"",d(t=t||[],i=i||""))}function d(e,t){return{allowable_tags:e=function(e){let t=new Set;if("string"==typeof e){let i;for(;i=u.exec(e);)t.add(i[1])}else n.nonNative||"function"!=typeof e[n.iterator]?"function"==typeof e.forEach&&e.forEach(t.add,t):t=new Set(e);return t}(e),tag_replacement:t,state:r,tag_buffer:"",depth:0,in_quote_char:""}}function x(e,t){if("string"!=typeof e)throw TypeError("'html' parameter must be a string");let i=t.allowable_tags,a=t.tag_replacement,l=t.state,n=t.tag_buffer,u=t.depth,c=t.in_quote_char,d="";for(let t=0,x=e.length;t<x;t++){let x=e[t];if(l===r)"<"===x?(l=o,n+=x):d+=x;else if(l===o)switch(x){case"<":if(c)break;u++;break;case">":if(c)break;if(u){u--;break}c="",l=r,n+=">",i.has(function(e){let t=m.exec(e);return t?t[1].toLowerCase():null}(n))?d+=n:d+=a,n="";break;case'"':case"'":c=x===c?"":c||x,n+=x;break;case"-":"<!-"===n&&(l=s),n+=x;break;case" ":case"\n":if("<"===n){l=r,d+="< ",n="";break}n+=x;break;default:n+=x}else l===s&&(">"===x?("--"==n.slice(-2)&&(l=r),n=""):n+=x)}return t.state=l,t.tag_buffer=n,t.depth=u,t.in_quote_char=c,d}c.init_streaming_mode=function(e,t){let i=d(e=e||[],t=t||"");return function(e){return x(e||"",i)}},void 0===(a=(function(){return c}).call(t,i,t,e))||(e.exports=a)}(0)},48197:e=>{e.exports={pageTitle:"AskQuestion_pageTitle__K5ZmC",subtitle:"AskQuestion_subtitle__0Pa7q",customTextArea:"AskQuestion_customTextArea__ZSbgv",fadeIn:"AskQuestion_fadeIn__KNbgB",fadeOut:"AskQuestion_fadeOut__SC_hW",rotation:"AskQuestion_rotation__5bnjG"}},78520:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/magazine/lingua_italiana/domande_e_risposte/fai_una_domanda",function(){return i(94828)}])},94828:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>A});var a=i(6029),l=i(79637),n=i(34837),r=i(19307),o=i(44316),s=i(31607),u=i(82826),m=i(80051),c=i(48197),d=i.n(c),x=i(99943),h=i(1909),f=i(28824),b=i(24696),g=i(44981),_=i(21941),p=i(55729),v=i(65750),j=i(25937);let A=()=>{var e,t,i,c;let{onSubmit:g,formData:_,successMessageVisible:p,setSuccessMessageVisible:v,errors:j,formError:A,setFormError:N}=k();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{blok:{title:"Fai una domanda - Treccani"}}),(0,a.jsx)(r.A,{blok:{title:"Fai una domanda",description:"",colors:["#385153","#000000"]}}),(0,a.jsxs)(l.A,{children:[(0,a.jsx)(n.A,{mb:24,children:(0,a.jsx)(o.Ay,{item:!0,container:!0,direction:"column",xs:12,lg:8,sx:{marginX:"auto"},gap:4,children:(0,a.jsx)("div",{className:d().subtitle,children:"Invia una domanda sulla Lingua Italiana alla redazione di Treccani. Ti risponderemo il prima possibile, compatibilmente con le attivit\xe0 del portale."})})}),(0,a.jsx)(h.Op,{..._,children:(0,a.jsxs)("form",{noValidate:!0,onSubmit:g,children:[(0,a.jsx)(n.A,{mb:24,children:(0,a.jsx)(o.Ay,{item:!0,lg:8,xs:12,sx:{marginX:"auto"},children:(0,a.jsx)(o.Ay,{item:!0,lg:4,xs:12,children:(0,a.jsx)(f.Y,{label:"Nome",name:"firstName",error:!!(null==A?void 0:A.firstName)||!!j.firstName,helperText:(null==A?void 0:A.firstName)?null==A?void 0:A.firstName:null==(e=j.firstName)?void 0:e.message})})})}),(0,a.jsx)(n.A,{mb:24,children:(0,a.jsx)(o.Ay,{item:!0,lg:8,xs:12,sx:{marginX:"auto"},children:(0,a.jsx)(o.Ay,{item:!0,lg:4,xs:12,children:(0,a.jsx)(f.Y,{label:"Cognome",name:"lastName",error:!!(null==A?void 0:A.lastName)||!!j.lastName,helperText:(null==A?void 0:A.lastName)?null==A?void 0:A.lastName:null==(t=j.lastName)?void 0:t.message})})})}),(0,a.jsx)(n.A,{mb:24,children:(0,a.jsx)(o.Ay,{item:!0,lg:8,xs:12,sx:{marginX:"auto"},children:(0,a.jsx)(o.Ay,{item:!0,lg:4,xs:12,children:(0,a.jsx)(b.f,{label:"Email",name:"email",autoComplete:"email",error:!!(null==A?void 0:A.email)||!!j.email,helperText:(null==A?void 0:A.email)?null==A?void 0:A.email:null==(i=j.email)?void 0:i.message})})})}),(0,a.jsx)(n.A,{mb:24,children:(0,a.jsx)(o.Ay,{item:!0,lg:8,xs:12,sx:{marginX:"auto"},children:(0,a.jsx)(o.Ay,{item:!0,lg:4,xs:12,children:(0,a.jsx)(f.Y,{label:"Testo della domanda",name:"text",multiline:!0,rows:3,error:!!(null==A?void 0:A.text)||!!j.text,helperText:(null==A?void 0:A.text)?null==A?void 0:A.text:null==(c=j.text)?void 0:c.message,InputProps:{className:d().customTextArea}})})})}),(0,a.jsx)(n.A,{mt:32,mb:36,children:(0,a.jsx)(o.Ay,{item:!0,lg:8,xs:12,sx:{marginX:"auto"},children:(0,a.jsx)(o.Ay,{item:!0,xs:4,children:(0,a.jsx)(s.A,{type:"submit",size:"small",children:"Invia richiesta"})})})}),(0,a.jsx)(u.A,{open:p,autoHideDuration:6e3,onClose:()=>v(!1),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,a.jsx)(m.A,{variant:"filled",onClose:()=>v(!1),severity:"success",children:"Richiesta inviata correttamente"})}),(null==A?void 0:A.submit)&&(0,a.jsx)(u.A,{open:!!(null==A?void 0:A.submit),autoHideDuration:6e3,onClose:()=>N(e=>e?{...e,submit:null}:null),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,a.jsx)(m.A,{variant:"filled",onClose:()=>N(e=>e?{...e,submit:null}:null),severity:"error",children:A.submit})})]})})]})]})},N=_.Ik().shape({firstName:_.Yj().required("Il campo nome \xe8 obbligatorio"),lastName:_.Yj().required("Il campo cognome \xe8 obbligatorio"),email:_.Yj().required("Il campo email \xe8 obbligatorio").email("Inserisci un indirizzo email valido").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Inserisci un indirizzo email valido"),text:_.Yj().required("Il campo testo \xe8 obbligatorio")}),k=()=>{let{executeRecaptcha:e}=(0,v._Y)(),[t,i]=(0,p.useState)(!1),[a,l]=(0,p.useState)(null),n=(0,h.mN)({mode:"onSubmit",defaultValues:{firstName:"",lastName:"",email:"",text:""},resolver:(0,g.t)(N)}),{handleSubmit:r,formState:o,reset:s,trigger:u}=n,{errors:m}=o;return{onSubmit:(0,p.useMemo)(()=>async t=>{t.preventDefault(),await u()&&r(async t=>{try{if(!e)throw Error("Recaptcha not available");let a=await e("askQuestionFormSubmit");await (0,j.b)("form/qa",t,{headers:{"X-Recaptcha-Token":a}}).catch(e=>e.response),i(!0),setTimeout(()=>{i(!1),s()},8e3)}catch(e){console.error("Error while submitting question:",e),l({submit:"Si \xe8 verificato un errore durante l'invio del modulo"})}})(t)},[e,r,s,u]),formData:n,successMessageVisible:t,setSuccessMessageVisible:i,errors:m,formError:a,setFormError:l}}},95669:(e,t,i)=>{e.exports=i(97186)}},e=>{var t=t=>e(e.s=t);e.O(0,[3710,6743,8990,9694,4316,6238,2940,6485,9307,1261,636,6593,8792],()=>t(78520)),_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.