PageSourceSearch

https://kuriu.it/_next/static/chunks/pages/settings/[setting]-629b956aa30cfa68.js

js kuriu.it collected 2026-10-02 00:22:31 UTC 77,391 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4899],{89523:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/[setting]",function(){return l(33752)}])},52713:function(e,t,l){"use strict";var s=l(85893),i=l(25751),n=l(67294),a=l(63878),r=l(12902),o=l(15103),d=l(48583),c=l(46673),u=l(896),m=l(11163),h=l(22825);let p=" bg-gray-100 active:bg-gray-50 hover:bg-gray-200 transition-colors ",x=(0,o.cn)(!1);t.Z=e=>{let{dataSurvey:t={balloonNumber:null,description:"",id:"",identificationCode:"",imageIdExample:"",imageTemplateId:"",carouselApiUrl:null,questions:[],title:"",language:""},setSurveyQIG:l=()=>{},redirect:o=!1,currentModal:p=()=>{},nextModal:g=()=>{}}=e,[f,v]=(0,n.useState)(t.questions.map(e=>{var t,l;return{multi:null!==(t=e.isMultiSelect)&&void 0!==t&&t,answer:[],type:null!==(l=e.type)&&void 0!==l?l:"Number",text:""}})),w=(0,u.t)(e=>e.user.id),b=(0,d.b9)(x),j=(0,m.useRouter)(),[y,N]=(0,n.useState)(!1),getHandleSelection=e=>t=>{let l=f[e];if(!l)return;let s=l.answer.findIndex(e=>e==t);l.multi?v((0,r.ZP)(l=>{s>-1?l[e].answer.splice(s,1):l[e].answer.push(t)})):v((0,r.ZP)(l=>{s>-1?l[e].answer=[]:l[e].answer=[t]}))},checkIndexFreeTextRIP=(e,t)=>{if("RIP"!==e.identificationCode)return!1;{let l=-1;for(let t of e.questions)for(let e=0;e<t.answers.length;e++)if("Altro"===t.answers[e]||"Other"===t.answers[e]){l=e;break}return l>-1&&void 0!==t.find(e=>e.answer.includes(l))}},checkAnswers=e=>e.every(l=>"Number"==l.type||"Phrases"==l.type?l.multi?l.answer.length>0:1===l.answer.length:"FreeText"!=l.type||!("RIP"===t.identificationCode&&checkIndexFreeTextRIP(t,e))||l.text.length>3),handleSubmit=async(e,t)=>{let l=e.map(e=>"Number"===e.type||"Phrases"===e.type?e.answer.map(e=>e.toString()):"FreeText"===e.type?[e.text]:[""]);await a.Z.post.survey(t,l)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h1",{className:"mt-4 text-4xl font-semibold",children:t.title}),(0,s.jsx)("p",{className:"mt-2",children:t.description}),t.questions.map((e,t)=>{let l={answers:e.answers,selected:f[t].answer,setSelected:getHandleSelection(t),title:e.text,className:"mt-5",setOtherAnswer:N};switch(e.type){case"Number":return(0,s.jsx)(RangeCard,{...l});case"Phrases":return(0,s.jsx)(AnswerCard,{...l});case"FreeText":return(0,s.jsx)(FreeTextCard,{className:"mt-5",title:e.text,setText:e=>{v((0,r.ZP)(l=>{l[t].text=e}))},text:f[t].text,active:y},t);default:return null}}),(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)("div",{className:"mt-5 w-[50%] px-6 text-center",children:(0,s.jsx)(h.F6,{className:"!rounded-middle text-korange-500 w-full max-w-xs py-3",onClick:()=>{g(!0),p(!1)},children:(0,i.t)("Onboarding.skip")})}),(0,s.jsx)("div",{className:"mt-5 w-[50%] px-6 text-center",children:(0,s.jsx)("button",{className:"btn-primary rounded-middle w-full max-w-xs py-3",disabled:!checkAnswers(f),onClick:async()=>{if(checkAnswers(f))try{b(!0),await handleSubmit(f,t.identificationCode),c.G.getState().createNotification("","SUCCESS","Questionario inviato con successo!",2e3),l(!0),p(!1),g(!0),o&&j.replace("/profile/"+w+"#trophies")}catch(e){c.G.getState().createNotification("","ERROR","Errore nell'inoltro del questionario",2e3)}finally{b(!1)}},children:(0,i.t)("Survey.sendAnswers")})})]})]})};let RangeCard=e=>{let{title:t="",setSelected:l,selected:i=[],answers:n=[],className:a=""}=e;return(0,s.jsx)(CardLayout,{className:a,title:t,children:(0,s.jsx)("div",{className:"mt-4 flex w-full flex-wrap justify-center gap-4 md:justify-start",children:Array.from({length:n.length}).map((e,t)=>(0,s.jsx)("button",{className:(i.includes(t)?"bg-korange-500 text-white ":p)+"focus:outline-kblue h-16 w-16  rounded-full text-lg font-medium",onClick:()=>l(t),children:t+1},t))})})},CardLayout=e=>{let{children:t=null,title:l="",className:i=""}=e;return(0,s.jsxs)("div",{className:i+" rounded-middle bg-white px-4 pb-4 pt-6 drop-shadow-lg",children:[l&&(0,s.jsx)("p",{className:"whitespace-pre-wrap text-xl font-semibold",children:l}),t]})},AnswerCard=e=>{let{title:t="",setSelected:l,selected:i=[],answers:n=[],className:a="",setOtherAnswer:r=()=>{}}=e;return(0,s.jsx)(CardLayout,{className:a,title:t,children:(0,s.jsx)("div",{className:"mb-4 flex w-full flex-col gap-4",children:n.map((e,t)=>(0,s.jsx)("button",{className:(i.includes(t)?"bg-korange-500 text-white":p)+" focus:outline-kblue h-16 w-full rounded-md bg-white pl-8 pr-4 text-left text-sm font-medium sm:text-base md:text-lg",onClick:()=>{l(t),"Altro"===e||"Other"===e?r(!0):r(!1)},children:(0,s.jsx)("li",{className:"",children:e})},t))})})},FreeTextCard=e=>{let{title:t="",text:l="",setText:n=()=>{},className:a="",active:r=!1}=e;return(0,s.jsx)(CardLayout,{className:a,title:t,children:(0,s.jsx)("textarea",{disabled:!r,value:l,onCh
1ange:e=>n(e.currentTarget.value),className:"focus:outline-kyellow/70 min-h-[100px] w-full resize-none rounded-md bg-gray-100 px-3 pt-2 outline-none placeholder:italic placeholder:text-black focus:outline ",placeholder:(0,i.t)("Survey.surveyTimeWriteHere")})})}},6182:function(e,t,l){"use strict";var s=l(67294),i=l(73935);t.Z=e=>{let[t,l]=(0,s.useState)(!1);return(0,s.useEffect)(()=>(l(!0),()=>l(!1)),[]),t?(0,i.createPortal)(e.children,document.querySelector("#modal-root")):null}},41706:function(e,t,l){"use strict";var s=l(85893),i=l(6182),n=l(79726),a=l(47522),r=l(8951);t.Z=e=>{let{onOverlayClick:t=a.ZT,children:l=null}=null!=e?e:{};return(0,r.Z)(),(0,s.jsx)(i.Z,{children:(0,s.jsx)("div",{className:"overlay-modal custom-scroll-black",onClick:()=>t(),children:(0,s.jsx)("div",{className:n.j+"flex h-full items-center justify-center",children:l})})})}},79726:function(e,t,l){"use strict";l.d(t,{j:function(){return s}});let s="w-11/12 md:w-[72%] mx-auto max-w-screen-2xl "},8951:function(e,t,l){"use strict";l.d(t,{Z:function(){return useModalNoScroll}});var s=l(67294);function useModalNoScroll(){(0,s.useEffect)(()=>{var e;let t=window.scrollY;if(null===(e=document)||void 0===e?void 0:e.body){if(document.body.scrollHeight<=window.innerHeight)document.body.classList.add("modal-open");else{document.body.classList.add("modal-open-scroll"),document.body.style.top="-".concat(t,"px");let e=document.getElementById("modal-root");e&&(e.style.top=t+"px");let l=document.getElementById("alert-root");l&&(l.style.top=t+"px")}}return()=>{var e;if(null===(e=document)||void 0===e?void 0:e.body){document.body.classList.remove("modal-open"),document.body.classList.remove("modal-open-scroll"),document.body.style.top="auto";let e=document.getElementById("modal-root"),l=document.getElementById("alert-root");e&&(e.style.top="auto"),l&&(l.style.top="auto"),window.scroll({top:t})}}},[])}},88124:function(e,t,l){"use strict";l.d(t,{T:function(){return n}});var s=l(16097);let i="/user-social-activity",n={namespace:i,get:{getNotifyRead:e=>s.Ud.get(i+"/notify-read",{params:{...null!=e?e:{},ungroupedInteractions:"FOLLOW,MODIFIED_travel,COMMUNICATION"}}),getNotifyUnread:e=>s.Ud.get(i+"/notify-unread",{params:{...null!=e?e:{},ungroupedInteractions:"FOLLOW,MODIFIED_travel,COMMUNICATION"}}),getActivites:e=>s.Ud.get(i+"/activity",{params:{...null!=e?e:{}}}),getFollowerByUserId:(e,t)=>s.Ud.get(i+"/followers/by-user/"+e,{params:{...t}}),getFollowingByUserId:function(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return s.Ud.get(i+"/following/by-user/"+e,{params:{...t,sortByDate:l}})},getBlockedUsers:e=>s.Ud.get(i+"/social-interaction/blocked",{params:{...null!=e?e:{}}})},put:{readAllNotifications:()=>s.Ud.put(i+"/read-notification/all"),readNotification:e=>s.Ud.put(i+"/read-notification/"+e),saveSocialInteraction:e=>s.Ud.put(i+"/social-interaction",e)},post:{saveFirebaseToken:e=>s.Ud.post(i+"/save-token",{token:e})},delete:{deleteFirebaseToken:e=>s.Ud.delete(i+"/delete-token",{data:{token:e}})}}},10904:function(e,t,l){"use strict";l.d(t,{b:function(){return useQueryWalletByUserId},k:function(){return r}});var s=l(36492),i=l(69460),n=l(16097),a={get:{walletByUserId:async e=>{var t,l,s,a;let{data:r}=await n.Ud.get(i.x+"/wallet/by-user/"+e);return{balanceAmount:null!==(t=r.balanceAmount)&&void 0!==t?t:0,id:null!==(l=r.id)&&void 0!==l?l:"",userId:null!==(s=r.userId)&&void 0!==s?s:"",rewardHistory:null!==(a=r.rewardHistory)&&void 0!==a?a:[]}}}};let r={all:["wallet"],byUserId:e=>[...r.all,e]},useQueryWalletByUserId=e=>{let t=r.byUserId(e),l=(0,s.a)(t,()=>a.get.walletByUserId(e),{staleTime:3e4,refetchOnMount:!0,refetchOnWindowFocus:!1});return{...l,queryKey:t}}},33752:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return ep}});var s,i,n=l(85893),a=l(25751),r=l(9008),o=l.n(r),d=l(41664),c=l.n(d),u=l(11163),m=l(67294),h=l(12258),p=l(82729),x=l(82175),g=l(16927),UI_SettingTextField=e=>{let{className:t="",label:l="",infoText:s="",type:i="text",errorMessage:a="",showHide:r=!1,...o}=null!=e?e:{},[d,c,u]=(0,x.U$)(o),[h,p]=(0,m.useState)(!1);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:t+" flex items-baseline justify-between",children:[(0,n.jsx)("p",{className:"w-48 shrink-0 font-semibold text-black",children:l}),(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsxs)("div",{className:"relative w-full",children:[(0,n.jsx)("input",{className:"w-full border-b border-gray-300 px-1 py-1 pb-1 outline-none focus:border-gray-600",...d,...o,type:h?"text":i}),r&&(0,n.jsxs)("button",{type:"button",className:"text-kgray absolute right-1 h-7 w-7 pb-0.5 pt-1.5 hover:text-gray-500",onClick:()=>p(!h),children:[h&&(0,n.jsx)(g.fn,{className:"h-full w-full fill-current"}),!h&&(0,n.jsx)(g.ZN,{className:"h-full w-full fill-current"})]})]}),(0,n.jsx)("p",{className:"mt-1 whitespace-pre-line text-xs text-gray-500",children:s}),c.error&&c.touched&&(0,n.jsx)("p",{className:"mt-1 text-xs text-red-500",children:c.error})]})]})})},UI_SettingTextFieldValue=e=>{let{className:t="",label:l="",text:s=""}=null!=e?e:{};return(0,n.jsxs)("div",{className:t+" flex items-center justify-between",children:[(0,n.jsx)("p",{className:"w-40 font-semibold text-black lg:w-48 lg:shrink-0",children:l}),(0,n.jsx)("div",{className:"w-full",children:(0,n.jsx)("p",{className:"h-9 w-full border-b border-gray-300 px-1 py-1 pb-1 outline-none",children:s})})]})},f=l(47522),Layout_SettingLayout=e=>{let{className:t="",title:l="",subtitle:s="",children:i=(0,n.jsx)(n.Fragment,{}),editable:r=!1,onModifyClick:o=f.ZT,onBackClick:d=f.ZT}=null!=e?e:{};
1return(0,n.jsxs)("div",{className:t+" rounded-middle bg-white px-4 py-6",children:[(0,n.jsxs)("div",{className:"flex w-full gap-2",children:[(0,n.jsxs)("div",{className:"relative h-28 w-full overflow-hidden",style:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,n.jsx)("button",{className:"rounded-middle bg-kbluelight shadow-light absolute h-9 w-9 p-1 2xl:hidden",onClick:()=>d(),children:(0,n.jsx)(g.uh,{className:"h-full w-full",icon:g.Tu.ArrowLeft})}),(0,n.jsx)("h2",{className:"w-full text-center text-4xl font-semibold 2xl:text-left",children:l}),(0,n.jsx)("h3",{className:"text-kgray2 w-full",children:s})]}),r&&(0,n.jsxs)("button",{className:"bg-kyellow hidden h-12 items-center justify-center gap-2 rounded-full px-4 2xl:flex",onClick:()=>o(),children:[(0,n.jsx)(g.yl,{className:"inline-block h-6 w-6",fill:"none",stroke:"black",strokeWidth:"1.5"}),(0,n.jsx)("p",{className:"hidden text-sm xl:inline-block",children:(0,a.t)("Button.modifyButton")})]})]}),i]})},v=l(74231),w=l(896),b=l(6734),j=l(37282);function _templateObject(){let e=(0,p._)(["^(?=.{8,}$)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*W).*$"],["^(?=.{8,}$)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\W).*$"]);return _templateObject=function(){return e},e}var settingsPage_SettingCredentials=e=>{let{oldEmail:t="",onBackClick:l=f.ZT,onChangePassword:s=f.ZT,onChangeEmail:i=f.ZT,provider:r=null,business:o=!1,setDeletionModal:d=()=>{}}=null!=e?e:{},[c,h]=(0,m.useState)(!1),p=(0,w.t)(e=>e.language),[y,N]=(0,m.useState)(p),k=(0,u.useRouter)();return(0,n.jsxs)(Layout_SettingLayout,{className:"flex h-full w-full flex-col",title:(0,a.t)("Settings.manageAccount"),subtitle:(0,a.t)("Settings.manageAccountDescr"),editable:!c,onModifyClick:()=>h(!0),onBackClick:()=>{h(!1),l()},children:[(0,n.jsx)("div",{className:"mt-4 h-full",children:c&&!r?(0,n.jsxs)(n.Fragment,{children:[!o&&(0,n.jsx)(x.J9,{initialValues:{email:"",emailConfirm:""},onSubmit:async(e,l)=>{let{resetForm:s}=l;try{await i({oldemail:t,newemail:e.email,confirmnewemail:e.emailConfirm})}catch(e){console.error(e),s()}},children:(0,n.jsxs)(x.l0,{children:[(0,n.jsx)(UI_SettingTextField,{className:"mt-4",label:(0,a.t)("Form.email")+"*",type:"text",name:"email"}),(0,n.jsx)(UI_SettingTextField,{className:"mt-4",label:(0,a.t)("Signup.confirmEmail")+"*",type:"text",name:"emailConfirm"}),(0,n.jsxs)("div",{className:"mt-4 flex justify-end gap-3",children:[(0,n.jsx)("button",{type:"button",className:"text-kbluedark h-10 w-36 px-2 py-1",onClick:()=>h(!1),children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})}),(0,n.jsx)("button",{type:"submit",className:"rounded-middle bg-kblue shadow-light h-10 w-36 px-2 py-1 text-white",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.saveButton")})})]})]})}),(0,n.jsx)(x.J9,{initialValues:{oldPassword:"",newPassword:"",newPasswordConfirm:""},validationSchema:v.Ry({newPassword:v.Z_().matches(new RegExp(String.raw(_templateObject()))).required("Required"),newPasswordConfirm:v.Z_().oneOf([v.iH("newPassword"),null],"Password must match").required("Required"),oldPassword:v.Z_().required("Required")}),onSubmit:async(e,t)=>{let{resetForm:l}=t;try{await s({newpassword:e.newPassword,confirmnewpassword:e.newPasswordConfirm,oldpassword:e.oldPassword}),h(!1)}catch(e){console.error(e),l()}},children:(0,n.jsxs)(x.l0,{children:[(0,n.jsx)(UI_SettingTextField,{className:"mt-4",label:(0,a.t)("Form.oldPw")+"*",type:"password",name:"oldPassword",showHide:!0}),(0,n.jsx)(UI_SettingTextField,{className:"mt-4",label:(0,a.t)("Form.newPw")+"*",type:"password",name:"newPassword",errorMessage:"La password inserita non \xe8 valida",infoText:(0,a.t)("Signup.pwRules")}),(0,n.jsx)(UI_SettingTextField,{className:"mt-4",label:(0,a.t)("Signup.confirmPw")+"*",type:"password",errorMessage:(0,a.t)("Signup.newPwSameOldPw"),name:"newPasswordConfirm"}),(0,n.jsxs)("div",{className:"mt-4 flex justify-end gap-3",children:[(0,n.jsx)("button",{type:"button",className:"text-kbluedark h-10 w-36 px-2 py-1",onClick:()=>h(!1),children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})}),(0,n.jsx)("button",{type:"submit",className:"rounded-middle bg-kblue shadow-light h-10 w-36 px-2 py-1 text-white",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.saveButton")})})]})]})})]}
1):(0,n.jsxs)(n.Fragment,{children:[!o&&(0,n.jsx)(UI_SettingTextFieldValue,{className:"mt-4",label:(0,a.t)("Form.email"),text:t}),(0,n.jsx)(UI_SettingTextFieldValue,{className:"mt-4",label:(0,a.t)("Form.pw"),text:"••••••••••"}),r&&(0,n.jsx)("p",{className:"mt-4 text-sm text-red-500",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.accountSocialAdvice")})}),!r&&(0,n.jsx)("div",{className:"mt-4 flex w-full justify-end text-right 2xl:hidden",children:(0,n.jsxs)("button",{className:"bg-kyellow flex h-12 w-48 items-center justify-center gap-2 rounded-full px-4 text-right",onClick:()=>h(!0),children:[(0,n.jsx)(g.yl,{className:"inline-block h-6 w-6",fill:"none",stroke:"black",strokeWidth:"1.5"}),(0,n.jsx)("p",{className:"inline-block text-sm",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.modifyButton")})})]})})]})}),(0,n.jsxs)("div",{className:"mt-8 h-full",children:[(0,n.jsxs)("div",{className:" flex items-center justify-between",children:[(0,n.jsx)("p",{className:"w-40 font-semibold text-black lg:w-48 lg:shrink-0",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Generic.language")})}),(0,n.jsx)("div",{className:"w-full",children:(0,n.jsxs)("select",{value:y,onChange:e=>{N(e.currentTarget.value)},className:"min-w-1/2 h-9 w-full border-b border-gray-300 px-1 py-1 pb-1 outline-none",children:[(0,n.jsx)("option",{value:"default",disabled:!0,children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Generic.language")})}),(0,n.jsx)("option",{value:j.b.it,children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Generic.italianLang")})}),(0,n.jsx)("option",{value:j.b.en,children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Generic.englishLang")})})]})})]}),(0,n.jsx)("hr",{className:"my-12"}),(0,n.jsxs)("div",{className:"mt-4 flex justify-end gap-3",children:[(0,n.jsx)("button",{className:"text-kbluedark h-10 w-36 px-2 py-1",onClick:()=>N(p),children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})}),(0,n.jsx)("button",{type:"submit",disabled:y==p,className:(y==p?" opacity-50":"")+" rounded-middle bg-kyellow shadow-light h-10 w-36 px-2 py-1",onClick:()=>{w.t.setState({language:y}),k.reload()},children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.saveButton")})})]}),!o&&(0,n.jsxs)("div",{children:[(0,n.jsx)("button",{className:"h-12 font-semibold text-red-500",onClick:()=>{d(!0)},children:(0,n.jsx)(b.cC,{t:a.t,ns:"translation",i18nKey:"Settings.deleteAccount",components:[(0,n.jsx)("span",{},0)]})}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.deleteAccountDescription")})})]})]})]})},y=l(39332),N=l(85945),k=l(78647),S=l(17337),C=l(70215),T=l(6270),P=l(22825),F=l(17237),U=l(59020),E=l(69460),M=l(16097),L={post:{mediaTicket:async(e,t,l)=>{var s,i;let{data:n}=await M.Ud.post(E.x+"/media/ticket",e,{signal:null==l?void 0:l.signal,onUploadProgress:e=>{var l;let s=Math.round(100*e.loaded/(null!==(l=e.total)&&void 0!==l?l:0));t&&t(s)},headers:{"Content-Type":"multipart/form-data"},timeout:3e6});return{filePath:null!==(s=null==n?void 0:n.filePath)&&void 0!==s?s:"",fileName:null!==(i=null==n?void 0:n.fileName)&&void 0!==i?i:""}},newMediaTicket:async(e,t,l)=>{var s;let{data:i}=await M.Ud.post(E.x+"/new-ticket/media",e,{signal:null==l?void 0:l.signal,onUploadProgress:e=>{var l;let s=Math.round(100*e.loaded/(null!==(l=e.total)&&void 0!==l?l:0));t&&t(s)},headers:{"Content-Type":"multipart/form-data"},timeout:3e6});return{fileKey:null!==(s=null==i?void 0:i.fileKey)&&void 0!==s?s:""}}}};async function handleUpload(e,t,l){let s=new FormData;return s.append("title",e.name),s.append("data",e),await L.post.newMediaTicket(s,t,l)}var chat_ChatImageUpload=e=>{let{file:t,type:l,uniqid:s,status:i,onClickRemove:a=()=>{},setMedia:r=()=>{},onlineInfo:o}=e,[d,c]=(0,m.useState)("COMPLETED"!==i?0:100),[u,h]=(0,m.useState)("");return(0,m.useEffect)(()=>{let e=new AbortController;return h(URL.createObjectURL(t)),"IDLE"===i&&(handleUpload(t,c,e).then(e=>{r({file:t,status:"COMPLETED",type:l,uniqid:s,onlineInfo:{fileName:t.name,fileKey:e.fileKey}})}).catch(i=>{e.signal.aborted||(r({file:t,status:"ERROR",type:l,uniqid:s,onlineInfo:o}),(0,C.x2)(i))}),r({file:t,status:"UPLOADING",type:l,uniqid:s,onlineInfo:o}
1)),()=>{e.abort(),URL.revokeObjectURL(u)}},[]),(0,n.jsxs)("div",{className:"relative h-16 w-16 shrink-0 rounded-xl bg-gray-300",children:[(0,n.jsx)("img",{src:u,className:"h-full w-full rounded-xl object-cover"}),"COMPLETED"!==i&&(0,n.jsxs)("div",{className:"absolute left-0 top-0 flex h-full w-full items-center justify-center rounded-xl bg-black/20",children:["UPLOADING"===i&&(0,n.jsx)(U.Z,{height:30,width:30,strokeWidth:4,progress:null!=d?d:0}),"ERROR"===i&&(0,n.jsx)("button",{type:"button",className:"h-10 w-10 rounded-3xl bg-black/20 p-2 backdrop-blur-md",tabIndex:-1,children:(0,n.jsx)(g.M1,{fill:"none",className:"h-full w-full",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})]}),(0,n.jsx)("button",{type:"button",onClick:()=>a(),className:"absolute -right-1.5 -top-1.5 h-5 w-5 rounded-full border-2 border-black bg-white px-1",tabIndex:-1,children:(0,n.jsx)(T.kL,{className:"h-full w-full stroke-[3px]"})})]})},I=l(29238),A=l(92520),R=l(25675),B=l.n(R),D=l(96480),_=l(85054),Z=l(78497);let MessageBoxR=e=>{let{className:t="",body:l="",creationDate:s=new Date(Date.now()).toISOString(),authorId:i="",onMount:a=()=>{},attachments:r}=e,o=(0,m.useMemo)(()=>formatHours(s),[s]),[d,c]=(0,m.useState)(null),u=(0,m.useMemo)(()=>(0,I.sanitize)(l),[l]);return(0,m.useEffect)(()=>{a()},[]),(0,n.jsxs)("div",{"data-chat-type":"message",className:t+" bg-kgray flex w-full min-w-[240px] rounded-l-3xl",children:[(0,n.jsxs)("div",{className:"bg-kpurple-500 w-full rounded-2xl rounded-br-none px-3 pt-2 text-white",children:[(0,n.jsx)("p",{children:u}),(null==r?void 0:r.length)>0&&r.map(e=>{let t=(0,D.r$)("ticket",e.fileKey);return(0,n.jsx)(A.E.div,{onClick:()=>{c(t)},className:"relative mb-2 h-40 w-full max-w-xs rounded-2xl",children:(0,n.jsx)(Z.Z,{className:"h-full w-full rounded-2xl object-cover",url:t,unoptimized:!0})},e.fileKey)}),(0,n.jsx)("p",{className:"py-2 text-xs",children:o}),d&&(0,n.jsx)(A.E.div,{onClick:()=>{c(null)},className:"fixed left-0 top-0 z-10 h-full w-full bg-black/50 py-20",children:(0,n.jsx)("div",{className:"relative h-full w-full",children:(0,n.jsx)(B(),{alt:"",className:"h-full w-full object-contain object-center",src:d,fill:!0,unoptimized:!0})})})]}),(0,n.jsx)("div",{className:"bg-kpurple-500",children:(0,n.jsx)("div",{className:"bg-kgray-300 flex h-full w-full items-end justify-end rounded-bl-3xl pl-5",children:(0,n.jsx)("div",{className:"relative h-8 w-8 rounded-full bg-gray-500",children:(0,n.jsx)(_.Z,{className:"!border-none",src:(0,D.kT)(i,220,220)})})})})]})},MessageBoxL=e=>{let{className:t="",body:l="",creationDate:s=new Date(Date.now()).toISOString(),onMount:i=()=>{},attachments:a}=e,r=(0,m.useMemo)(()=>formatHours(s),[s]);(0,m.useEffect)(()=>{i()},[]);let[o,d]=(0,m.useState)(null),c=(0,m.useMemo)(()=>(0,I.sanitize)(l),[l]),{imageKeys:u,pdfKeys:h}=(0,m.useMemo)(()=>{let e=[],t=[];return a.forEach(l=>{l.type.startsWith("image/")?e.push(l.fileKey):"application/pdf"===l.type&&t.push(l.fileKey)}),{imageKeys:e,pdfKeys:t}},[a]);return(0,n.jsxs)("div",{"data-chat-type":"message",className:t+" bg-kgray-300 flex w-full min-w-[240px] rounded-l-3xl",children:[(0,n.jsx)("div",{className:"bg-korange-500 shrink-0 ",children:(0,n.jsx)("div",{className:"bg-kgray-300 flex h-full w-full items-end justify-end rounded-br-3xl pr-5",children:(0,n.jsx)("div",{className:"relative h-8 w-8 rounded-full border-4 border-white bg-white",children:(0,n.jsx)(B(),{alt:"",src:"/assets/logos/logo-balloon.png",className:"h-full w-full object-contain",fill:!0})})})}),(0,n.jsxs)("div",{className:"bg-korange-500 w-full rounded-2xl rounded-bl-none px-3 pt-2 text-white",children:[(0,n.jsx)("p",{children:c}),h.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-3 py-2",children:h.map(e=>{let t=(0,D.r$)("ticket",e);return(0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"relative block h-20 w-20 rounded-2xl bg-white/30 p-2 hover:bg-white/20",children:(0,n.jsx)(Z.Z,{className:"h-full w-full rounded-2xl object-contain",url:"/assets/file-type/pdf-icon.png"})},e)})}),u.length>0&&u.map(e=>{let t=(0,D.r$)("ticket",e);return(0,n.jsx)(A.E.div,{onClick:()=>{d(t)},className:"relative mb-2 h-40 w-full max-w-xs rounded-2xl",children:(0,n.jsx)(Z.Z,{className:"h-full w-full rounded-2xl object-cover",url:t,unoptimized:!0})},e)}),(0,n.jsx)("p",{className:"py-2 text-xs",children:r}),o&&(0,n.jsx)(A.E.div,{onClick:()=>{d(null)},className:"fixed left-0 top-0 z-10 h-full w-full bg-black/50 py-20",children:(0,n.jsx)("div",{className:"relative h-full w-full",children:(0,n.jsx)(B(),{alt:"",className:"h-full w-full object-contain object-center",src:o,fill:!0,unoptimized:!0})})})]})]})};function formatHours(e){let t=new Date(e),l=t.getHours(),s=t.getMinutes();return"".concat((l<10?"0":"")+l,":").concat((s<10?"0":"")+s)}var chat=e=>{let{chatId:t="",className:l=""}=e,{myId:s,username:i}=(0,w.t)(e=>({myId:e.user.id,username:e.user.nickname})),{queryKey:a,data:r,fetchNextPage:o,hasNextPage:d,isFetching:c,isInitialLoading:u}=(0,S.j$)({id:t,enabled:!0,immutable:!0,query:{size:12}}),h=(0,m.useMemo)(()=>{var e,t;return null!==(t=null==r?void 0:null===(e=r.pages)||void 0===e?void 0:e.map(e=>e.content.map(e=>e)).flat(2).reverse())&&void 0!==t?t:[]},[r]);(0,m.useEffect)(()=>{u||b()},[u]);let p=(0,m.useMemo)(()=>{let e=0,t="initial",l=h.map((l,i)=>{let a;let r=new Date(l.creationDate);if(r.getTime()>e){let l=r.toLocaleDateString(void 0,{year:"numeric",month:"2-digit",day:"2-digit"});l!==t&&(a=l,t=l,e=r.getTime())}return l.ownMessage?(0,n.jsxs)(n.Fragment,{children:[a&&(0,n.jsx)("div",{className:"sticky top-0 z-10 text-center text-gray-500",children:(0,n.jsx)("span",{className:"w-fit roun
1ded-full bg-white px-2 py-1",children:a})},a),(0,n.jsx)(MessageBoxR,{authorId:s,...l,className:"pl-8"},l.messageId)]}):(0,n.jsxs)(n.Fragment,{children:[a&&(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("span",{className:"sticky top-0 w-fit rounded-full bg-white px-2 py-1",children:a})},a),(0,n.jsx)(MessageBoxL,{...l,className:"pr-8"},l.messageId)]})});return l},[h]),x=(0,m.useRef)(null),g=(0,N.NL)(),{mutateAsync:f,isLoading:v}=(0,S.Wq)({queryClient:g,queryKey:a}),b=(0,m.useCallback)(()=>{var e;null===(e=x.current)||void 0===e||e.scrollTo({top:x.current.scrollHeight,left:0,behavior:"smooth"})},[x.current]);return(0,n.jsxs)("div",{className:l+" flex h-full flex-col overflow-y-hidden",children:[(0,n.jsxs)("div",{ref:x,className:"custom-scroll-black chat-column bg-kgray-300 relative flex h-full min-w-[320px] flex-col gap-3 overflow-y-scroll pb-2 pl-3 pr-2 pt-2",children:[c&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"flex h-10 items-center justify-center",children:(0,n.jsx)(F.Z,{circleClassName:"w-2 h-8",className:"!gap-2"})})}),d&&!c&&(0,n.jsx)("div",{className:"text-center",children:(0,n.jsx)(P.KM,{className:"h-10 text-xs",onClick:()=>o(),children:(0,n.jsx)(T.D6,{className:"h-6 w-6 rotate-90 stroke-white"})})}),p]}),(0,n.jsx)(SendMessageForm,{userId:s,loading:v,onSubmit:e=>{f({message:e,ticketId:+t}).catch(e=>(0,C.x2)(e)),setTimeout(()=>b(),50)}})]})};let SendMessageForm=e=>{let{userId:t="",onSubmit:l=()=>{},loading:s=!1,className:i=""}=e,[a,r]=(0,m.useState)(""),[o,d]=(0,m.useState)([]),c=(0,m.useMemo)(()=>!!(o.length>0&&o.every(e=>!!e.onlineInfo)||a&&o.every(e=>!!e.onlineInfo)),[o,a]);return(0,n.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!c)return;let t={messageId:Date.now(),ownMessage:!0,creationDate:new Date(Date.now()).toISOString(),body:a,attachments:o.map(e=>{var t,l;return{fileKey:null!==(l=null===(t=e.onlineInfo)||void 0===t?void 0:t.fileKey)&&void 0!==l?l:"",type:e.file.type}})};l({...t}),r(""),d([])},className:i+" bg-kgray-300 shadow-upper",children:[(0,n.jsx)("div",{className:(o.length>0?"h-20 py-3":"h-0")+" flex gap-4 overflow-hidden overflow-x-auto px-6 transition-all duration-500",children:o.map(e=>(0,n.jsx)(chat_ChatImageUpload,{setMedia:t=>{let l=o.findIndex(t=>t.uniqid===e.uniqid);l>-1&&d(e=>{let s=[...e];return s[l]=t,s})},onClickRemove:()=>{let t=o.findIndex(t=>t.uniqid===e.uniqid);t>-1&&d(e=>{let l=[...e];return l.splice(t,1),l})},...e},e.uniqid))}),(0,n.jsxs)("div",{className:"flex h-12 w-full items-center gap-2 px-3 py-2",children:[(0,n.jsxs)("label",{className:(o.length>=4?"cursor-not-allowed opacity-50":"")+" text-korange-500 h-8 w-8 shrink-0 !rounded-full !p-2 hover:bg-gray-200 active:bg-gray-100",children:[(0,n.jsx)("input",{disabled:o.length>=4,onChange:e=>{let t=e.target.files;t&&(Array.from(t).forEach(e=>{let t={uniqid:(0,k.x0)(5),file:e,status:"IDLE",type:"IMAGE"};d(e=>[t,...e].slice(0,4))}),e.target.value="")},accept:"image/*",className:"hidden",type:"file",multiple:!0}),(0,n.jsx)(g.SC,{className:"h-full w-full stroke-current stroke-2"})]}),(0,n.jsx)("input",{value:a,onChange:e=>{r(e.currentTarget.value)},type:"text",className:"h-full w-full rounded-full bg-white px-2"}),(0,n.jsx)(P.KM,{disabled:s||!c,type:"submit",className:"h-8 w-8 shrink-0 !p-1.5",children:(0,n.jsx)(T.hJ,{className:"mr-0.5 mt-0.5 h-full w-full fill-current stroke-2"})})]})]})};var O=l(2659),H=l(75337),z=l(4609),W=l(9654);let getTicketTextStatus=e=>{switch(e){case"Closed":return(0,a.t)("Report.ticketClosed");case"Open":return(0,a.t)("Report.ticketOpen");case"Resolved":return(0,a.t)("Report.ticketSolvedByPool");default:return""}};var UI_ModalTicket=e=>{let{onCloseClick:t=()=>{}}=e,{data:l}=(0,S.C1)({enabled:!0,immutable:!0,query:{size:10}}),s=(0,m.useMemo)(()=>{var e;return null!==(e=null==l?void 0:l.pages.map(e=>e.content).flat(2))&&void 0!==e?e:[]},[l]);return(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center py-4",children:(0,n.jsxs)("div",{className:"rounded-middle bg-kbackground w-full max-w-2xl py-4",children:[(0,n.jsxs)("div",{className:"flex w-full justify-between px-4",children:[(0,n.jsx)("div",{className:"w-7"}),(0,n.jsx)("h3",{className:"text-kgray text-center text-2xl font-semibold",children:"Le tue segnalazioni"}),(0,n.jsx)("div",{className:"h-7 w-7 cursor-pointer rounded-full bg-white p-2 text-black",onClick:()=>t(),children:(0,n.jsx)(g.uh,{className:"h-full w-full",icon:g.Tu.Close})})]}),(0,n.jsx)("div",{className:" custom-scroll-black max-h-770px flex h-full min-h-[200px] w-full flex-col items-center gap-4 overflow-y-scroll py-4",children:s.map(e=>(0,n.jsx)(TicketBox,{onClick:()=>t(),...e},e.ticketId))})]})})};let TicketBox=e=>{let{creationDate:t="",ticketId:l="",subject:s="",onClick:i=()=>{},status:r="unknown"}=e,o=(0,u.useRouter)();return(0,n.jsxs)("div",{className:"relative w-full",children:[(0,n.jsxs)("div",{className:"flex w-full cursor-pointer flex-col px-6 hover:bg-black/5",onClick:()=>{o.push({pathname:"/settings/help",query:{ticketId:l}},void 0,{shallow:!0}),i()},children:[(0,n.jsxs)("div",{className:"flex justify-between pr-4",children:[(0,n.jsxs)("p",{children:[(0,a.t)("Report.state"),(0,n.jsx)("span",{className:(()=>{switch(r){case"Resolved":return"text-emerald-500";case"Open":return"text-blue-500";case"Closed":case"Deleted":return"text-red-500";case"Archived":return"text-gray-500";default:return""}})()+" font-semibold",children:getTicketTextStatus(r)})]}),(0,n.jsxs)("p",{children:[(0,a.t)("Report.date")," ",(0,n.jsx)("span",{className:"font-semibold",children:new Date(t).toLocaleDateString()})]})]}),(0,n.jsxs)("p",{className:"mb-3 mt-2",children:[(0,n.jsx)("p",{className:"font-semibold",children:(0,a.t)("Report.reportType")}),(0,n.jsx)("p",{className:" line-clamp-3",children:s})]}),(0,n.jsx)("hr",{})]}),(0,n.jsx)("div",{className:"absolute right-6 top-1/2 h-8 w-8 p-0.5",children:(0,n.jsx)(g.uh,{className:"absolute right-0 -mt-3 h-6 w-6",icon:g.Tu.ArrowRight})})]})};var settingsPage_SettingHelp=e=>{let{onBackClick:t=f.ZT,setDeletionModal:l=f.ZT}=null!=e?e:{},[s,i]=(0,m.useState)(!1),[r,o]=(0,m.useState)(!1),d=(0,u.useRouter)(),h=(0,w.t)(e=>e.user.id);return(0,n.jsxs)(Layout_SettingLayout,{className:"h-full w-full",title:(0,a.t)("Settings.assistance"),subtitle:(0,a.t)("Report.oldReportDescription"),editable:!1,onBackClick:()=>t(),children:[(0,n.jsxs)("div",{className:"mt-2 h-full",children:[(0,n.jsxs)("div",{className:"rounded-middle flex h-12 min-w-72 select-none items-center justify-between px-1 font-semibold hover:bg-gray-100 active:bg-gray-200",onClick:()=>i(!0),children:[(0,n.jsx)("p",{children:(0,a.t)("Settings.problemTitle")}),(0,n.jsx)(g.uh,{className:"h-8 w-8",icon:g.Tu.ArrowRight})]}
1),(0,n.jsxs)("div",{className:"rounded-middle mt-8 flex h-12 min-w-72 select-none items-center justify-between px-1 font-semibold hover:bg-gray-100 active:bg-gray-200",onClick:()=>o(!0),children:[(0,n.jsx)("p",{children:(0,a.t)("Report.oldReports")}),(0,n.jsx)(g.uh,{className:"h-8 w-8",icon:g.Tu.ArrowRight})]}),(0,n.jsxs)("div",{className:"mt-18",children:[(0,n.jsx)("h3",{className:" text-3xl font-semibold",children:(0,a.t)("Settings.contactUs")}),(0,n.jsx)("p",{className:" mt-3 text-sm text-gray-500",children:(0,a.t)("Settings.contactUsDescr")}),(0,n.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,n.jsxs)("a",{href:"tel:+393499305336",className:"shadow-light whitespace-nowrap rounded-lg px-4 pt-3 text-center align-middle",children:[(0,n.jsx)(g.nt,{className:"mr-2 inline-block h-6  w-6 stroke-current text-black",strokeWidth:1.5}),(0,a.t)("Settings.callClientService")]}),(0,n.jsx)(c(),{legacyBehavior:!0,href:H.g9,children:(0,n.jsx)("a",{className:" w-56",target:"_blank",rel:"noopener noreferrer",children:(0,n.jsx)("img",{className:"object-contain",src:"/assets/social/WhatsAppButtonGreenMedium.png"})})})]})]})]}),s&&(0,n.jsx)(O.Z,{open:s,children:(0,n.jsx)(W.y,{userId:h,itemType:z.r6.report,ticketStatus:z.hG.NEW,itemId:"",ticketType:z.zK.BUG,onCloseClick:()=>i(!1)})}),r&&(0,n.jsx)(O.Z,{open:r,children:(0,n.jsx)(UI_ModalTicket,{onCloseClick:()=>o(!1)})}),(0,n.jsx)(ChatWrapper,{onClickClose:()=>{d.replace({pathname:"/settings/help",query:{}},void 0,{shallow:!0})},onClickBack:()=>{o(!0)}})]})};let ChatWrapper=e=>{let{onClickClose:t=()=>{},onClickBack:l=()=>{}}=e,s=(0,y.useSearchParams)();(0,u.useRouter)();let i=(0,m.useMemo)(()=>s.get("ticketId"),[s]);return(0,n.jsx)(O.Z,{className:"",open:!!i,children:(0,n.jsx)("div",{className:"h-[calc(100vh-200px)] min-h-[500px] w-full max-w-2xl",children:(0,n.jsxs)("div",{className:"bg-kgray-300 flex h-full flex-col overflow-hidden rounded-b-2xl rounded-t-2xl pb-4",children:[(0,n.jsxs)("div",{className:"bg-kgray-300 relative z-10 py-2 shadow-lg",children:[(0,n.jsx)("p",{className:"text-center text-2xl font-semibold",children:"Assistenza"}),(0,n.jsx)(P.Uj,{onClick:()=>{t()},className:"absolute right-2 top-2 h-8 w-8 !p-2",children:(0,n.jsx)(T.kL,{className:"h-full w-full stroke-white"})}),(0,n.jsx)(P.F6,{onClick:()=>{t(),l()},className:"absolute left-2 top-2 h-8 w-8 !rounded-full !p-0.5",children:(0,n.jsx)(T.D6,{className:"h-full w-full stroke-current"})})]}),i&&(0,n.jsx)(chat,{className:"w-full",chatId:i},i)]})})})};var q=l(50672),settingsPage_SettingNotification=e=>{let{onBackClick:t=f.ZT,notifications:l={acceptFollowVisualization:!1,pushAnswers:!1,pushComments:!1,pushLikes:!1,pushNewFollowers:!1,pushQuestions:!1,pushCommentsLike:!1,pushCommentsAnswer:!1,pushLoyalty:!1,checkSurvey:!1,id:0,inappAnswers:!1,inappMissionEnded:!1,showNameAndUsername:!1,emailLoyalty:!1,inappLoyalty:!1,pushExperiencePublished:!1,pushFollowingPublishedExperience:!1,pushFollowingModifiedExperience:!1,inappFollowingModifiedExperience:!1,inappFollowingPublishedExperience:!1,pushTravelUserInvitation:!1,pushFollowingModifiedTravel:!1,pushTravelRemoved:!1,pushResponseUserInvitation:!1,pushTravelExperienceDeleted:!1,pushTravelPublished:!1,pushTravelChange:!1,pushTravelUserLeave:!1,pushTravelDeleted:!1,pushFollowingPublishedTravel:!1,pushMentionsComments:!1,pushMissionEnded:!1,showNameAndSurname:!1,inappLikes:!1,inappTravelUserLeave:!1,inappCommentsLike:!1,inappComments:!1,inappCommentsAnswer:!1,inappMentionsComments:!1,inappNewFollowers:!1,inappExperiencePublished:!1,inappTravelPublished:!1,inappTravelChange:!1,inappFollowingPublishedTravel:!1,inappFollowingModifiedTravel:!1,inappTravelUserInvitation:!1,inappResponseUserInvitation:!1,pushTravelUserRemoved:!1,inappTravelUserRemoved:!1,inappTravelDeleted:!1,pushTourPublished:!1,inappTourPublished:!1,version:-1,inappReminderFavouriteExperience:!1,pushReminderFavouriteExperience:!1},onSubmit:s=()=>{},version:i=""}=e,[r,o]=(0,m.useState)({}),d=(0,m.useMemo)(()=>Object.keys(r).length>0,[r]),c=[{id:"pushLikes",text:(0,a.t)("Settings.reactionsReceived"),subText:"Push"},{id:"pushComments",text:(0,a.t)("Settings.commentsReceived"),subText:"Push"},{id:"pushCommentsAnswer",text:(0,a.t)("Settings.pushCommentsAnswerButton"),subText:"Push"},{id:"pushMentionsComments",text:(0,a.t)("Generic.mentions"),subText:"Push"},{id:"pushNewFollowers",text:(0,a.t)("Settings.newFollowers"),subText:"Push"}],u=[{id:"pushExperiencePublished",text:(0,a.t)("Settings.pushExperiencePublishedButton"),subText:"Push"},{id:"pushTourPublished",text:(0,a.t)("Settings.pushTourPublishedButton"),subText:"Push"}],h=[{id:"pushFollowingModifiedExperience",text:(0,a.t)("Settings.pushNotifications"),subText:(0,a.t)("Settings.disablingPushNotificationMessage")},{id:"inappFollowingModifiedExperience",text:"Notifiche in App",subText:(0,a.t)("Settings.disablingPlatformNotificationMessage")}],p=[{id:"pushFollowingPublishedExperience",text:(0,a.t)("Settings.pushNotifications"),subText:(0,a.t)("Settings.disablingPushNotificationMessage")},{id:"inappFollowingPublishedExperience",text:"Notifiche in App",subText:(0,a.t)("Settings.disablingPlatformNotificationMessage")}],x=[{id:"pushReminderFavouriteExperience",text:(0,a.t)("Settings.pushReminderFavouriteExperience"),subText:(0,a.t)("Settings.disablingPushNotificationMessage")},{id:"inappReminderFavouriteExperience",text:"Notifiche in App",subText:(0,a.t)("Settings.disablingPlatformNotificationMessage")}];function mapNotificationField(e,t){return(0,n.jsx)(NotificationField,{notificationProps:e,active:void 0!==r[e.id]?r[e.id]:l[e.id],onClick:()=>
1{if(void 0!==r[e.id]){let{[e.id]:t,...l}=r;o(l)}else o({...r,[e.id]:!l[e.id]})},...t},e.id)}return(0,a.t)("Notification.pushNotificationPublishTravel"),(0,a.t)("Settings.notificationFollowingModifiedTravel"),(0,a.t)("Settings.notificationFollowingPublishedTravel"),(0,a.t)("Settings.notificationFollowingModifiedTravel"),(0,a.t)("Notification.pushNotificationJoinTravel"),(0,a.t)("Notification.pushNotificationReplyJoinTravel"),(0,a.t)("Notification.pushNotificationRemoveJoinTravel"),(0,a.t)("Notification.pushNotificationUserLeftTravel"),(0,a.t)("Notification.pushNotificationRemoveTravel"),(0,n.jsx)("div",{className:"h-full w-full pl-2",children:(0,n.jsxs)("div",{className:"h-full",children:[(0,n.jsxs)(Layout_SettingLayout,{title:(0,a.t)("Settings.notifications"),onBackClick:()=>t(),children:[(0,n.jsx)("h3",{className:"-mt-12 text-lg font-semibold",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.settingsFeedbackComments")})}),(0,n.jsx)("p",{className:"mb-4 mt-2 text-xs text-gray-500",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.settingsFeedbackCommentsDescr")})}),(0,n.jsx)("div",{className:"rounded-middle mt-2 flex flex-col gap-3 bg-white pb-2 pt-1",children:c.map(e=>mapNotificationField(e))})]}),(0,n.jsx)("h3",{className:"mt-5 text-lg font-semibold",children:(0,a.t)("Settings.settingsExperiencesTour")}),(0,n.jsxs)("div",{className:"rounded-middle mt-2 flex flex-col gap-3 bg-white px-3 pb-2 pt-1",children:[u.map(e=>mapNotificationField(e)),(0,n.jsx)(NotificationAccordion,{title:(0,a.t)("Settings.pushReminderFavouriteExperience"),subText:"In App e Push",notificationFieldList:x.map(e=>mapNotificationField(e,{textSm:!0}))}),(0,n.jsx)(NotificationAccordion,{title:(0,a.t)("Settings.pushFollowingPublishedExperienceButton"),subText:"In App e Push",notificationFieldList:p.map(e=>mapNotificationField(e,{textSm:!0}))}),(0,n.jsx)(NotificationAccordion,{title:(0,a.t)("Settings.pushFollowingModifiedExperience"),subText:"In App e Push",notificationFieldList:h.map(e=>mapNotificationField(e,{textSm:!0}))})]}),(0,n.jsx)("div",{className:"mt-5 flex justify-end gap-3 ",children:(0,n.jsx)("button",{className:(d?"cursor-pointer":" cursor-not-allowed opacity-50")+" rounded-middle bg-kblue shadow-light h-10 w-36 px-2 py-1 text-white",disabled:!d,onClick:()=>{if(d)try{s({...r,version:i})}catch(e){console.error(e)}},children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.saveButton")})})})]})})};let NotificationAccordion=e=>{let{notificationFieldList:t=[],title:l="",subText:s="prova"}=e,[i,a]=(0,m.useState)(!1),r=(0,m.useMemo)(()=>(48*t.length).toString()+"px",[]);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex h-12 min-w-72 items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-semibold",children:l}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:s})]}),(0,n.jsx)("div",{className:"mr-2 h-8 w-8 cursor-pointer select-none",onClick:()=>a(!i),children:(0,n.jsx)(g.uh,{className:(i?"rotate-90":"rotate-0")+" h-full w-full transition-transform",icon:g.Tu.ArrowRight})})]}),(0,n.jsx)("div",{className:"w-full overflow-hidden pl-6",style:{height:i?r:"0px",transition:"ease-in height 0.3s"},children:t})]})},NotificationField=e=>{let{id:t="",text:l="",subText:s=""}=e.notificationProps,{onClick:i=f.ZT,className:a="",active:r=!1,textSm:o=!1}=e;return(0,n.jsxs)("div",{className:"flex h-12 min-w-72 items-center justify-between",children:[(0,n.jsxs)("div",{className:"w-full truncate",children:[(0,n.jsx)("p",{className:(o?"text-sm":"")+" font-semibold",children:l}),s&&(0,n.jsx)("p",{className:"truncate text-xs text-gray-500",children:s})]}),(0,n.jsx)(q.Z,{onClick:()=>i(),active:r})]},t)};var K=l(64147),G=l(80115),V=l(76899),Y=l(83938),settings_ModalHiddenExp=e=>{let{open:t=!1,onClickClose:l=()=>{}}=e;return(0,n.jsx)(O.Z,{open:t,children:(0,n.jsx)(HiddenExpList,{onClickClose:()=>l()})})};let HiddenExpList=e=>{let{onClickClose:t=()=>{}}=e,l=(0,N.NL)(),{data:s,queryKey:i,isFetching:r}=(0,K.w6)({size:200}),[o,d]=(0,m.useState)(void 0),{mutateAsync:c}=(0,K.WC)({queryClient:l,queryKey:i}),u=(0,m.useMemo)(()=>null==s?void 0:s.pages.map((e,t)=>e.content.map((e,l)=>(0,n.jsx)(ExpHiddenPreview,{...e,onClickShow:()=>d({id:e.id,page:t,index:l})},e.id))),[null==s?void 0:s.pages]),h=(0,m.useMemo)(()=>!r&&(!s||s.pages[0].totalCount<=0),[r,s,u]);return(0,n.jsxs)("div",{className:"relative flex h-[900px] max-h-[90vh] min-h-[500px] w-full max-w-3xl flex-col gap-3 rounded-2xl bg-white px-4 py-6",children:[(0,n.jsx)("div",{className:"absolute right-3 top-3",children:(0,n.jsx)(P.hO,{className:"h-8 w-8 !rounded-full",onClick:()=>t(),children:(0,n.jsx)(T.kL,{className:"stroke-white",strokeWidth:2})})}),(0,n.jsx)("p",{className:"text-center text-lg font-bold sm:text-2xl",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.hiddenExperiencesTitle")})}),(0,n.jsxs)("div",{className:"custom-scroll-black flex h-full w-full flex-col gap-3 overflow-y-scroll pl-1 pr-2 pt-2",children:[u,r&&[void 0,void 0,void 0].map((e,t)=>(0,n.jsx)(ExpHiddenPreviewSkeleton,{},t)),h&&(0,n.jsx)(Y.Z,{children:(0,n.jsx)("p",{className:"text-kblack2 text-center text-xl font-semibold md:text-2xl",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.hiddenExpEmpty")})})})]}),(0,n.jsx)(G.Z,{open:!!o,title:(0,a.t)("Settings.hiddenConfirmation"),children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"mt-4 text-center text-lg",children:(0,a.t)("Settings.hiddenConfirmationText")}),(0,n.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>d(void 0),className:" text-kpurple-500 hover:bg-kgray-300 active:bg-kgray-200 h-12 w-full !rou
1nded-full py-2 font-semibold transition-colors",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})}),(0,n.jsx)(P.KM,{onClick:async()=>{if(!o)return;let{id:e,page:t,index:l}=o;c({index:l,page:t,expId:e}).then(()=>{}).catch(e=>{(0,C.x2)(e)}),d(void 0)},className:"w-full",children:(0,a.t)("Button.confirmButton")})]})]})})]})},ExpHiddenPreview=e=>{var t,l,s;let{title:i,locations:a,id:r,media:o,version:d=0,onClickShow:c=()=>{}}=e,u=(0,m.useMemo)(()=>{var e;return null==o?void 0:null===(e=o.filter(e=>"IMAGE"===e.type))||void 0===e?void 0:e[0]},[]);return(0,n.jsx)(V.Z,{ratioPercentage:"25%",className:" min-h-[80px]",children:(0,n.jsxs)("div",{className:"shadow-light flex h-full w-full rounded-2xl",children:[(0,n.jsx)("div",{className:"bg-kgray-500 relative h-full w-1/4 shrink-0 rounded-2xl",children:(0,n.jsx)(ExpThumbnail,{src:(0,D.k7)(null!=r?r:"",null!==(l=null==u?void 0:u.fileId)&&void 0!==l?l:"",1200,d)})}),(0,n.jsxs)("div",{className:"flex w-full flex-col justify-between rounded-r-2xl bg-white px-2 py-2",children:[(0,n.jsx)("p",{className:" line-clamp-1 text-xl font-semibold sm:line-clamp-2 md:line-clamp-3 md:text-2xl",children:i}),(0,n.jsxs)("div",{className:"flex items-end justify-between",children:[(0,n.jsxs)("p",{children:["\uD83D\uDCCD",(0,n.jsx)("span",{className:"ml-1 font-bold",children:null!==(s=null==a?void 0:null===(t=a[0])||void 0===t?void 0:t.name)&&void 0!==s?s:""})]}),(0,n.jsx)(P.KM,{onClick:()=>c(),className:"h-10 w-10",children:(0,n.jsx)(T.ct,{strokeWidth:2,className:"stroke-current"})})]})]})]})})},ExpHiddenPreviewSkeleton=()=>(0,n.jsx)(V.Z,{ratioPercentage:"25%",className:" min-h-[80px]",children:(0,n.jsxs)("div",{className:"bg-kgray-300 flex h-full w-full animate-pulse rounded-2xl",children:[(0,n.jsx)("div",{className:"relative h-full w-1/4 shrink-0 rounded-2xl"}),(0,n.jsx)("div",{className:"flex w-full flex-col justify-between rounded-r-2xl px-2 py-2"})]})}),ExpThumbnail=e=>{let{src:t=""}=e,[l,s]=(0,m.useState)(t);return(0,n.jsx)(B(),{className:"h-full w-full rounded-2xl object-cover",src:l,alt:"",onError:()=>{s("/assets/various/no-media.svg")},fill:!0,unoptimized:!0})};var $=l(15843),settings_ModalBlockedUser=e=>{let{open:t=!1,onClickClose:l=()=>{}}=e;return(0,n.jsx)(O.Z,{open:t,children:(0,n.jsx)(HiddenBlocked,{onClickClose:()=>l()})})};let HiddenBlocked=e=>{let{onClickClose:t=()=>{}}=e,l=(0,N.NL)(),{data:s,queryKey:i,isFetching:r}=(0,$.TN)({size:200}),[o,d]=(0,m.useState)(void 0),{mutateAsync:c}=(0,$.eB)({queryClient:l,queryKey:i}),u=(0,m.useMemo)(()=>null==s?void 0:s.pages.map((e,t)=>e.content.map((e,l)=>(0,n.jsx)(UserBlockedPreview,{...e,onClickFollow:()=>d({userblocked:e,page:t,index:l})},l))),[null==s?void 0:s.pages]),h=(0,m.useMemo)(()=>!r&&(!s||s.pages[0].totalCount<=0),[r,s,u]);return(0,n.jsxs)("div",{className:"relative flex h-[900px] max-h-[90vh] min-h-[500px] w-full max-w-lg flex-col gap-3 rounded-2xl bg-white px-4 py-6",children:[(0,n.jsx)("div",{className:"absolute right-3 top-3",children:(0,n.jsx)(P.hO,{className:"h-8 w-8 !rounded-full",onClick:()=>t(),children:(0,n.jsx)(T.kL,{className:"stroke-white",strokeWidth:2})})}),(0,n.jsx)("p",{className:"text-center text-lg font-bold sm:text-2xl",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.blockedUsersTitle")})}),(0,n.jsxs)("div",{className:"custom-scroll-black flex h-full w-full flex-col gap-3 overflow-y-scroll pl-1 pr-2 pt-2",children:[u,r&&[void 0,void 0,void 0].map((e,t)=>(0,n.jsx)(UserBlockedPreviewSkeleton,{},t)),h&&(0,n.jsx)(Y.Z,{children:(0,n.jsx)("p",{className:"text-kblack2 text-center text-xl font-semibold md:text-2xl",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.userBlockedEmpty")})})})]}),(0,n.jsx)(G.Z,{open:!!o,title:(0,a.t)("Settings.blockConfirmation",{0:null==o?void 0:o.userblocked.userName}),children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"mt-4 text-center text-lg",children:(0,a.t)("Settings.blockConfirmationText")}),(0,n.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>d(void 0),className:" text-kpurple-500 hover:bg-kgray-300 active:bg-kgray-200 h-12 w-full !rou
1nded-full py-2 font-semibold transition-colors",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})}),(0,n.jsx)(P.KM,{onClick:async()=>{if(!o)return;let{userblocked:e,page:t,index:l}=o;c({index:l,page:t,userInfo:{block:!1,userIdReceiver:e.userId,userNameReceiver:e.userName}}).then(()=>{}).catch(e=>{(0,C.x2)(e)}),d(void 0)},className:"w-full",children:(0,a.t)("Button.confirmButton")})]})]})})]})},UserBlockedPreview=e=>{let{followedByMe:t,name:l,surname:s,userId:i,userName:r,onClickFollow:o=()=>{}}=e;return(0,n.jsx)(V.Z,{ratioPercentage:"25%",className:"min-h-[60px]",children:(0,n.jsxs)("div",{className:"shadow-light flex h-full w-full rounded-full",children:[(0,n.jsx)("div",{className:"relative h-full w-1/4 shrink-0 rounded-2xl",children:(0,n.jsx)(_.Z,{src:(0,D.kT)(i,220,220),className:"!border-4"})}),(0,n.jsxs)("div",{className:"flex w-3/4 items-center justify-between gap-3",children:[(0,n.jsx)("div",{className:"w-full items-center justify-between truncate px-4 text-xl font-semibold",children:r&&(0,n.jsx)(n.Fragment,{children:r})}),(0,n.jsx)("div",{className:"flex w-20 shrink-0 items-center justify-end px-4",children:(0,n.jsx)(P.eg,{complementary:t,onClick:()=>o(),className:"w-20 shrink-0 whitespace-nowrap font-semibold !transition-all",children:(0,n.jsx)(n.Fragment,{children:t?(0,a.t)("Profile.alreadyFollow"):(0,a.t)("Profile.unBlockProfile")})})})]})]})})},UserBlockedPreviewSkeleton=()=>(0,n.jsx)(V.Z,{ratioPercentage:"25%",className:" min-h-[80px]",children:(0,n.jsxs)("div",{className:"bg-kgray-300 flex h-full w-full animate-pulse rounded-full",children:[(0,n.jsx)("div",{className:"relative h-full w-1/4 shrink-0 rounded-2xl"}),(0,n.jsx)("div",{className:"flex w-full flex-col justify-between rounded-r-2xl px-2 py-2"})]})});var Q=l(53766),J=l(29996),settingsPage_SettingPrivacy=e=>{let{onSubmit:t=f.ZT,onBackClick:l=f.ZT,onSubmitUnblock:s,version:i=-1,notifications:a={acceptFollowVisualization:!1,pushAnswers:!1,pushComments:!1,pushLikes:!1,pushNewFollowers:!1,pushQuestions:!1,pushCommentsLike:!1,pushCommentsAnswer:!1,pushExperiencePublished:!1,pushFollowingPublishedExperience:!1,pushFollowingModifiedExperience:!1,inappFollowingModifiedExperience:!1,inappFollowingPublishedExperience:!1,pushTravelUserInvitation:!1,pushTravelRemoved:!1,pushResponseUserInvitation:!1,pushTravelExperienceDeleted:!1,pushTravelPublished:!1,pushTravelChange:!1,pushTravelUserLeave:!1,pushTravelDeleted:!1,pushFollowingPublishedTravel:!1,pushMentionsComments:!1,pushMissionEnded:!1,showNameAndSurname:!1,version:-1}}=e,[r,o]=(0,m.useState)(a),[d,c]=(0,m.useState)(!1),[u,h]=(0,m.useState)(!1),[p,x]=(0,m.useState)(!1),[v,j]=(0,m.useState)(!1),{t:y,i18n:N}=(0,b.$G)(),k="it"===N.language,{name:S,surname:T,privacy:F,terms:U,profiling:E,marketingKuriu:M,marketingPartner:L,tracking:I,logout:A,getUserInfo:R}=(0,w.t)(e=>({name:e.user.name,surname:e.user.surname,privacy:e.consent.privacy,terms:e.consent.terms,profiling:e.consent.profiling,marketingKuriu:e.consent.marketingKuriu,marketingPartner:e.consent.marketingPartner,tracking:e.consent.tracking,logout:e.logout,getUserInfo:e.getUserInfo})),B=[{codex:Q.L.profiling},{codex:Q.L.marketingKuriu},{codex:Q.L.marketingPartner},{codex:Q.L.tracking}],D=!0===E&&!0===M&&!0===L&&!0===I,enableAllOptionalTreatments=async()=>{j(!0);try{await J.Z.patch.saveUserConsent(B.map(e=>{let{codex:t}=e;return{codex:t,readAndCheck:!0}})),await R()}catch(e){(0,C.x2)(e)}finally{j(!1)}},removeAllOptionalTreatments=async()=>{j(!0);try{await J.Z.patch.saveUserConsent(B.map(e=>{let{codex:t}=e;return{codex:t,readAndCheck:!1}})),await A(),window.location.href="/"}catch(e){(0,C.x2)(e)}finally{j(!1)}};return(0,n.jsxs)(Layout_SettingLayout,{className:"flex h-full w-full flex-col",title:y("Settings.privacyManagement"),subtitle:y("Settings.privacyManagementDescription"),editable:!1,onBackClick:()=>l(),children:[(0,n.jsxs)("div",{className:"mt-4 h-full whitespace-nowrap",children:[(0,n.jsxs)("div",{className:"rounded-middle flex h-12 min-w-72 select-none items-center justify-between px-1 hover:bg-gray-100 active:bg-gray-200",onClick:()=>c(!0),children:[(0,n.jsx)("p",{children:y("Settings.blockedUsers")}),(0,n.jsx)(g.uh,{className:"h-8 w-8",icon:g.Tu.ArrowRight})]}),(0,n.jsxs)("div",{className:"rounded-middle flex h-12 min-w-72 select-none items-center justify-between px-1 hover:bg-gray-100 active:bg-gray-200",onClick:()=>h(!0),children:[(0,n.jsx)("p",{children:y("Settings.hiddenExperiencesTitleView")}),(0,n.jsx)(g.uh,{className:"h-8 w-8",icon:g.Tu.ArrowRight})]}),(0,n.jsxs)("div",{className:"flex h-28 min-w-72 items-center justify-between px-1 "+(S||T?"":"opacity-20"),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"",children:y("Settings.showFirstLastName")}
1),(0,n.jsx)("p",{className:"mt-1 whitespace-pre-wrap pr-12 text-xs text-gray-500",children:y("Settings.showFirstLastNameDescription")})]}),(0,n.jsx)(q.Z,{active:r.showNameAndSurname,onClick:()=>{o(e=>({...e,showNameAndSurname:!r.showNameAndSurname}))},disabled:!S&&!T})]}),(0,n.jsx)("div",{className:"mt-4 rounded-3xl bg-gray-100 px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex-1 pr-4",children:[(0,n.jsx)("p",{className:"font-medium",children:k?"Accetto i Termini e dichiaro di aver preso visione della Privacy Policy":"I accept the Terms and declare that I have read the Privacy Policy"}),(0,n.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:k?"Disattivando il permesso verrai disconnesso da tutte le piattaforme KuriU.":"Disabling the permission will log you out from all KuriU platforms."})]}),(0,n.jsx)(q.Z,{active:D,onClick:()=>{D?x(!0):enableAllOptionalTreatments()},disabled:v})]})}),(0,n.jsx)("div",{className:"mt-8 flex justify-end gap-3",children:(0,n.jsx)("button",{className:"rounded-middle bg-kblue shadow-light h-10 w-36 px-2 py-1 text-white",onClick:()=>{try{t({...r,version:i})}catch(e){console.error(e)}},children:y("Button.saveButton")})})]}),(0,n.jsx)(G.Z,{open:p,title:y("Settings.removePermissionTitle"),children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mt-5 text-center",children:(0,n.jsx)("p",{children:y("Settings.removePermissionMessage")})}),(0,n.jsxs)("div",{className:"mt-6 flex w-full gap-3",children:[(0,n.jsx)(P.kq,{onClick:()=>{x(!1)},disabled:v,className:"h-12 w-full px-3 py-1 text-sm",children:(0,n.jsx)(n.Fragment,{children:y("Button.cancelButton")})}),(0,n.jsx)(P.KM,{onClick:()=>{removeAllOptionalTreatments()},disabled:v,className:"h-12 w-full py-1",children:(0,n.jsx)(n.Fragment,{children:v?y("Alert.loadingMessage"):"Ok"})})]})]})}),d&&(0,n.jsx)(settings_ModalBlockedUser,{open:d,onClickClose:()=>c(!1)}),(0,n.jsx)(settings_ModalHiddenExp,{open:u,onClickClose:()=>h(!1)})]})};function mapNotificationResponse(e){var t,l,s,i,n,a,r,o,d,c,u,m,h,p,x,g,f,v,w,b,j,y,N,k,S,C,T,P,F,U,E,M,L,I,A,R,B,D,_,Z,O,H,z,W,q,K,G,V,Y,$,Q,J,X,ee,et,el;return{id:null!==(t=e.id)&&void 0!==t?t:0,checkSurvey:null!==(l=e.checkSurvey)&&void 0!==l&&l,inappAnswers:null!==(s=e.inappAnswers)&&void 0!==s&&s,inappMissionEnded:null!==(i=e.inappMissionEnded)&&void 0!==i&&i,pushLoyalty:null!==(n=e.pushLoyalty)&&void 0!==n&&n,showNameAndUsername:null!==(a=e.showNameAndSurname)&&void 0!==a&&a,acceptFollowVisualization:null!==(r=e.acceptFollowVisualization)&&void 0!==r&&r,pushAnswers:null!==(o=e.pushAnswers)&&void 0!==o&&o,pushComments:null!==(d=e.pushComments)&&void 0!==d&&d,pushLikes:null!==(c=e.pushLikes)&&void 0!==c&&c,pushNewFollowers:null!==(u=e.pushNewFollowers)&&void 0!==u&&u,pushQuestions:null!==(m=e.pushQuestions)&&void 0!==m&&m,pushCommentsLike:null!==(h=e.pushCommentsLike)&&void 0!==h&&h,pushCommentsAnswer:null!==(p=e.pushCommentsAnswer)&&void 0!==p&&p,pushExperiencePublished:null!==(x=e.pushExperiencePublished)&&void 0!==x&&x,pushFollowingPublishedExperience:null!==(g=e.pushFollowingPublishedExperience)&&void 0!==g&&g,pushFollowingModifiedExperience:null!==(f=e.pushFollowingModifiedExperience)&&void 0!==f&&f,pushMissionEnded:null!==(v=e.pushMissionEnded)&&void 0!==v&&v,pushMentionsComments:null!==(w=e.pushMentionsComments)&&void 0!==w&&w,inappFollowingPublishedExperience:null!==(b=e.inappFollowingPublishedExperience)&&void 0!==b&&b,inappFollowingModifiedExperience:null!==(j=e.inappFollowingModifiedExperience)&&void 0!==j&&j,pushTourPublished:null!==(y=e.pushTourPublished)&&void 0!==y&&y,showNameAndSurname:null!==(N=e.showNameAndSurname)&&void 0!==N&&N,pushTravelUserInvitation:null!==(k=e.pushTravelUserInvitation)&&void 0!==k&&k,pushFollowingModifiedTravel:null!==(S=e.pushFollowingModifiedTravel)&&void 0!==S&&S,pushTravelRemoved:null!==(C=e.pushTravelRemoved)&&void 0!==C&&C,inappLoyalty:null!==(T=e.inappLoyalty)&&void 0!==T&&T,emailLoyalty:null!==(P=e.emailLoyalty)&&void 0!==P&&P,pushResponseUserInvitation:null!==(F=e.pushResponseUserInvitation)&&void 0!==F&&F,pushTravelExperienceDeleted:null!==(U=e.pushTravelExperienceDeleted)&&void 0!==U&&U,pushTravelPublished:null!==(E=e.pushTravelPublished)&&void 0!==E&&E,pushTravelChange:null!==(M=e.pushTravelChange)&&void 0!==M&&M,pushTravelUserLeave:null!==(L=e.pushTravelUserLeave)&&void 0!==L&&L,pushTravelDeleted:null!==(I=e.pushTravelDeleted)&&void 0!==I&&I,pushFollowingPublishedTravel:null!==(A=e.pushFollowingPublishedTravel)&&void 0!==A&&A,inappLikes:null!==(R=e.inappLikes)&&void 0!==R&&R,inappTravelUserLeave:null!==(B=e.inappTravelUserLeave)&&void 0!==B&&B,inappCommentsLike:null!==(D=e.inappCommentsLike)&&void 0!==D&&D,inappComments:null!==(_=e.inappComments)&&void 0!==_&&_,inappCommentsAnswer:null!==(Z=e.inappCommentsAnswer)&&void 0!==Z&&Z,inappMentionsComments:null!==(O=e.inappMentionsComments)&&void 0!==O&&O,inappNewFollowers:null!==(H=e.inappNewFollowers)&&void 0!==H&&H,inappExperiencePublished:null!==(z=e.inappExperiencePublished)&&void 0!==z&&z,inappTravelPublished:null!==(W=e.inappTravelPublished)&&void 0!==W&&W,inappTravelChange:null!==(q=e.inappTravelChange)&&void 0!==q&&q,inappFollowingPublishedTravel:null!==(K=e.inappFollowingPublishedTravel)&&void 0!==K&&K,inappFollowingModifiedTravel:null!==(G=e.inappFollowingModifiedTravel)&&void 0!==G&&G,inappTravelUserInvitation:null!==(V=e.inappTravelUserInvitation)&&void 0!==V&&V,inappResponseUserInvitation:null!==(Y=e.inappResponseUserInvitation)&&void 0!==Y&&Y,pushTravelUserRemoved:null!==($=e.pushTravelUserRemoved)&&void 0!==$&&$,inappTravelUserRemoved:null!==(Q=e.inappTravelUserRemoved)&&void 0!==Q&&Q,inappTourPublished:null!==(J=e.inappTourPublished)&&void 0!==J&&J,inappTravelDeleted:null!==(X=e.inappTravelDeleted)&&void 0!==X&&X,version:null!==(ee=e.version)&&void 0!==ee?ee:-1,inappReminderFavouriteExperience:null!==(et=e.inappReminderFavouriteExperience)&&void 0!==et&&et,pushReminderFavouriteExperience:null!==(el=e.pu
1shReminderFavouriteExperience)&&void 0!==el&&el}}var settingsPage_SettingTerms=e=>{let{onBackClick:t=f.ZT,link:l}=null!=e?e:{};return(0,n.jsxs)("div",{className:"rounded-middle shadow-light flex h-full flex-col bg-white px-4 py-6",children:[(0,n.jsx)("div",{className:"flex w-full gap-2",children:(0,n.jsxs)("div",{className:"relative w-full overflow-hidden whitespace-nowrap",style:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,n.jsx)("button",{className:"rounded-middle bg-kbluelight shadow-light absolute h-9 w-9 p-1 xl:hidden",onClick:()=>t(),children:(0,n.jsx)(g.uh,{className:"h-full w-full",icon:g.Tu.ArrowLeft})}),(0,n.jsx)("h2",{className:"w-full text-center text-4xl font-semibold xl:text-left",children:(0,a.t)("Settings.serviceTerms")})]})}),(0,n.jsx)("div",{className:"mt-2 h-full w-full",children:(0,n.jsx)("iframe",{className:"h-full w-full",src:l})})]})},X=l(41706),ee=l(88124),et=l(87066),el=l(26791);let es="/user-manager",ei={post:{signup:e=>et.default.post(H.Y4+"/api"+es+"/signup",e),login:(e,t)=>t?et.default.post(H.Y4+"/api/back-office-management/login",e):et.default.post(H.Y4+"/api"+es+"/login",e),logout:()=>(console.log(M.Ud.defaults.headers),M.Ud.post(es+"/user-logout")),forgotWithMail:e=>et.default.post(H.Y4+"/api"+es+"/password-recovery",{email:e}),forgotWithOTP:e=>et.default.post(H.Y4+"/api"+es+"/password-recovery/confirm",e),changePassword:e=>e.business?M.Ud.post(el.f+"/current-user/password",e):M.Ud.post(es+"/current-user/password",e),changeEmail:e=>M.Ud.post(es+"/current-user/email",e)},put:{currentUser:e=>M.Ud.put(es+"/current-user",e),deleteCurrentUser:()=>M.Ud.put(es+"/current-user/delete-request"),verifyMail:e=>M.Ud.put(es+"/verify-existence/email",{param:e})},patch:{updateLinks:e=>M.Ud.patch(es+"/current-user/profile/links",{links:e}),currentUserSettings:e=>M.Ud.patch(es+"/current-user/settings",e),profilePersonalInfo:e=>M.Ud.patch(es+"/current-user/profile/personal-info",e,{timeout:6e4}),saveUserConsent:e=>M.Ud.patch(es+"/treatment",{treatments:e})},get:{currentUser:()=>M.Ud.get(es+"/current-user"),getUserByName:(e,t)=>M.Ud.get(es+"/search/user/"+e,{params:{...t}}),getUser:(e,t)=>M.Ud.get(es+"/by-username/"+e+"/profile")}};var en=l(50396);l(20548);var ea=l(35684),er=l(10904),SettingsHistoryPoints=e=>{let{onBackClick:t=()=>{},setDeletionModal:l=()=>{}}=null!=e?e:{},[s,i]=(0,m.useState)(!1),[r,o]=(0,m.useState)(!1),d=(0,w.t)(e=>e.user.id),{data:c,isFetching:u,refetch:h}=(0,er.b)(d),p=(0,m.useMemo)(()=>null==c?void 0:c.rewardHistory.map((e,t)=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"py-2",children:[(0,n.jsx)("p",{children:(0,a.t)("Settings.rewardType",{0:e.interactionType})}),(0,n.jsx)("p",{className:"font-medium",children:e.interactionTitle}),(0,n.jsx)("p",{children:new Date(e.creationDate).toLocaleDateString()}),(0,n.jsx)("p",{children:(0,a.t)("Settings.earnedPoints",{0:e.rewards})})]},t),(null==c?void 0:c.rewardHistory.length)>t+1&&(0,n.jsx)("hr",{})]})),[c]);return(0,n.jsx)(Layout_SettingLayout,{className:"h-full w-full",title:(0,a.t)("Settings.pointsHistory"),subtitle:(0,a.t)("Settings.historyPointsTitle"),editable:!1,onBackClick:()=>t(),children:p})},eo=l(15103),ed=l(48583),ec=l(63878),eu=l(52713);let em=(0,eo.cn)(!1);var survey_SurveyWrapper=e=>{let{redirect:t=!1,surveyId:l="",currentModal:s=()=>{},nextModal:i=()=>{}}=e,[a,r]=(0,m.useState)(),o=(0,w.t)(e=>e.language),d=(0,ed.b9)(em);return(0,m.useEffect)(()=>{d(!0),ec.Z.get.surveyById("RIP",{language:null!=o?o:"IT"}).then(e=>{r(e)}).catch(e=>console.error(e)).finally(()=>d(!1))},[]),(0,n.jsx)(n.Fragment,{children:a&&(0,n.jsx)(eu.Z,{dataSurvey:a,redirect:t,currentModal:s,nextModal:i})})},eh=l(41590);(s=i||(i={})).CREDENTIALS="credentials",s.MANAGE_ACCOUNT="manage",s.NOTIFICATIONS="notifications",s.MANAGE_PRIVACY="manage_privacy",s.HELP="help",s.TERMS="terms",s.PRIVACY="privacy",s.LOYALTY="loyalty_terms",s.HISTORY_POINTS="storico_punti";let SettingsPage=()=>{var e,t,l;let[s,r]=(0,m.useState)("credentials"),d=(0,u.useRouter)(),{provider:p,userType:x,setUserVersion:f,language:v}=(0,w.t)(e=>({provider:e.user.provider,userType:e.user.userType,setUserVersion:e.setUserVersion,language:e.language})),[b,j]=(0,m.useState)({name:"",nickname:"",referralFriendCode:"false",surname:"",userData:{birthDate:"",city:"",gender:"",version:-1},version:-1}),[y,N]=(0,m.useState)(!1),[k,S]=(0,m.useState)(!1),[C,T]=(0,m.useState)(!1),[P,F]=(0,m.useState)(""),[U,E]=(0,m.useState)({acceptFollowVisualization:!1,pushAnswers:!1,pushComments:!1,pushLikes:!1,pushNewFollowers:!1,pushQuestions:!1,pushCommentsLike:!1,pushCommentsAnswer:!1,pushExperiencePublished:!1,pushFollowingPublishedExperience:!1,pushFollowingModifiedExperience:!1,inappFollowingModifiedExperience:!1,inappFollowingPublishedExperience:!1,pushTravelUserInvitation:!1,showNameAndUsername:!1,inappMissionEnded:!1,inappAnswers:!1,checkSurvey:!1,id:0,pushFollowingModifiedTravel:!1,pushTravelRemoved:!1,pushResponseUserInvitation:!1,pushTravelExperienceDeleted:!1,pushTravelPublished:!1,pushLoyalty:!1,pushTravelChange:!1,pushTravelUserLeave:!1,pushTravelDeleted:!1,pushFollowingPublishedTravel:!1,pushMentionsComments:!1,pushMissionEnded:!1,showNameAndSurn
1ame:!1,inappLoyalty:!1,emailLoyalty:!1,inappLikes:!1,inappTravelUserLeave:!1,inappCommentsLike:!1,inappComments:!1,inappCommentsAnswer:!1,inappMentionsComments:!1,inappNewFollowers:!1,inappExperiencePublished:!1,inappTravelPublished:!1,inappTravelChange:!1,inappFollowingPublishedTravel:!1,inappFollowingModifiedTravel:!1,inappTravelUserInvitation:!1,inappResponseUserInvitation:!1,pushTravelUserRemoved:!1,inappTravelUserRemoved:!1,inappTravelDeleted:!1,pushTourPublished:!1,inappTourPublished:!1,version:-1,inappReminderFavouriteExperience:!1,pushReminderFavouriteExperience:!1}),[M,L]=(0,m.useState)([]),[I,A]=(0,m.useState)(!0),[R,B]=(0,m.useState)(""),[D,_]=(0,m.useState)(!0),[Z,O]=(0,m.useState)(!1),[H,z]=(0,m.useState)(!1),[W,q]=(0,m.useState)(!1),[K,G]=(0,m.useState)(!1),[V,Y]=(0,m.useState)(!1),menuEl=(e,t,l)=>(0,n.jsx)("div",{className:(l?"rounded-middle bg-kbluelight pl-3 font-bold hover:bg-blue-100":" cursor-pointer border-b border-gray-200 hover:bg-gray-100")+" mt-2 w-full text-sm",onClick:()=>_(!1),children:(0,n.jsx)(c(),{legacyBehavior:!0,href:e,children:(0,n.jsx)("a",{children:(0,n.jsxs)("div",{className:"flex h-12 items-center justify-between gap-2",children:[(0,n.jsx)("p",{children:t}),(0,n.jsx)(g.uh,{className:"h-8 w-8",icon:g.Tu.ArrowRight})]})})})},e),mapUserInfo=e=>{var t,l,s,i,n,a,r,o,d,c,u,m;let h={name:null!==(n=null==e?void 0:e.name)&&void 0!==n?n:"",nickname:null!==(a=null==e?void 0:e.nickname)&&void 0!==a?a:"",surname:null!==(r=e.surname)&&void 0!==r?r:"",userData:{birthDate:null!==(o=null==e?void 0:null===(t=e.userData)||void 0===t?void 0:t.birthDate)&&void 0!==o?o:"",city:null!==(d=null==e?void 0:null===(l=e.userData)||void 0===l?void 0:l.city)&&void 0!==d?d:"",gender:null!==(c=null==e?void 0:null===(s=e.userData)||void 0===s?void 0:s.gender)&&void 0!==c?c:"",version:null!==(u=null==e?void 0:null===(i=e.userData)||void 0===i?void 0:i.version)&&void 0!==u?u:-1},version:null!==(m=null==e?void 0:e.version)&&void 0!==m?m:-1};j(e=>({...e,...h}))},handleSubmitNotification=e=>(N(!0),new Promise((t,l)=>ei.patch.currentUserSettings({...e}).then(e=>{let l=mapNotificationResponse(e.data);E(l),f(l.version),N(!1),S(!0),t()}).catch(e=>{console.error(e),T(!0),N(!1),l(e)}))),handleDeletion=()=>(N(!0),new Promise((e,t)=>ei.put.deleteCurrentUser().then(()=>{N(!1),e()}).catch(e=>{console.error(e),N(!1),T(!0),t(e)}))),handleChangeEmail=e=>(N(!0),new Promise((t,l)=>ei.post.changeEmail(e).then(e=>{console.log(e.data),N(!1),z(!0),t()}).catch(e=>{console.error(e),T(!0),N(!1),z(!1),l(e)}))),handleChangePassword=e=>(N(!0),new Promise((t,l)=>ei.post.changePassword({...e,business:"Redazione"==x}).then(e=>{console.log(e.data),N(!1),S(!0),t()}).catch(e=>{console.error(e),T(!0),N(!1),l(e)}))),handleSubmitUnblock=e=>(N(!0),Promise.all(e.map(e=>ee.T.put.saveSocialInteraction(e))).then(()=>{N(!1),S(!0)}).catch(e=>{console.error(e),T(!0),N(!1)})),handleSubmitUsername=e=>(N(!0),new Promise((t,l)=>ei.put.currentUser({...b,nickname:e}).then(e=>{console.log(e.data),N(!1),S(!0),mapUserInfo(e.data),t()}).catch(e=>{console.error(e),T(!0),N(!1),l(e)}))),$=(0,m.useMemo)(()=>{let e="/settings/manage_privacy"===d.asPath||"manage_privacy"===s;if("Redazione"==x){let t=[{id:"manage",text:(0,a.t)("Settings.manageAccount")},{id:"storico_punti",text:(0,a.t)("Settings.pointsHistory")}];return e||t.splice(1,0,{id:"manage_privacy",text:(0,a.t)("Settings.privacyManagement")}),t}{let e=[{id:"manage",text:(0,a.t)("Settings.manageAccount")},{id:"notifications",text:(0,a.t)("Settings.notifications")},{id:"manage_privacy",text:(0,a.t)("Settings.privacyManagement")},{id:"storico_punti",text:(0,a.t)("Settings.pointsHistory")}];return e}},[x,d.asPath,s]),mapPageSettings=e=>{var t,l,s,i,n,a,r,o,d,c,u,m,h,p,x,g,f,v,w,b,y,N,k,S,C,T;if(!e)return;let P={name:null!==(g=null===(t=e.user)||void 0===t?void 0:t.name)&&void 0!==g?g:"",nickname:null!==(f=null===(l=e.user)||void 0===l?void 0:l.nickname)&&void 0!==f?f:"",referralFriendCode:null!==(v=e.referralFriendCode)&&void 0!==v&&v,surname:null!==(w=null===(s=e.user)||void 0===s?void 0:s.surname)&&void 0!==w?w:"",userData:{birthDate:null!==(b=null===(n=e.user)||void 0===n?void 0:null===(i=n.userData)||void 0===i?void 0:i.birthDate)&&void 0!==b?b:"",city:null!==(y=null===(r=e.user)||void 0===r?void 0:null===(a=r.userData)||void 0===a?void 0:a.city)&&void 0!==y?y:"",gender:null!==(N=null===(d=e.user)||void 0===d?void 0:null===(o=d.userData)||void 0===o?void 0:o.gender)&&void 0!==N?N:"",version:null!==(k=null===(u=e.user)||void 0===u?void 0:null===(c=u.userData)||void 0===c?void 0:c.version)&&void 0!==k?k:-1},version:null!==(S=null===(m=e.user)||void 0===m?void 0:m.version)&&void 0!==S?S:-1},U=null===(p=e.user)||void 0===p?void 0:null===(h=p.treatments)||void 0===h?void 0:h.filter(e=>!0===e.readAndCheck).map(e=>{var t;return null===(t=e.key)||void 0===t?void 0:t.codex}),M=mapNotificationResponse({...e.user.settings,version:null===(x=e.user)||void 0===x?void 0:x.version});L(null!=U?U:[]),F(null!==(C=e.referralCode)&&void 0!==C?C:""),E(M),j(P),B(null!==(T=e.email)&&void 0!==T?T:"")};(0,m.useEffect)(()=>{let e=Object.values(i).find(e=>e==d.query.setting);e&&r(e)},[d.query]),(0,m.useEffect)(()=>{ei.get.currentUser().then(e=>{mapPageSettings(e.data),A(!1)}).catch(e=>console.error(e))},[]);let Q=(0,m.useMemo)(()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(eh.Z,{open:!0,onClickClose:G,className:"max-w-2xl",title:"",loading:V,children:(0,n.jsx)(survey_SurveyWrapper,{redirect:!1,surveyId:"RIP",currentModal:G,nextModal:q})})}),[V]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{children:(0,n.jsx)("title",{children:"Impostazioni - KuriU"})}),(0,n.jsxs)("div",{className:en.EF+"mt-14 overflow-hidden px-1 sm:mt-0",children:[(0,n.jsxs)("div",{className:"mt-1 flex items-stretch justify-center 2xl:gap-3",children:[(0,n.jsxs)("div",{className:(D?" w-80 px-4 md:w-96":"w-0")+" rounded-middle flex flex-col self-start truncate bg-white py-6 transition-all duration-300 2xl:w-80 2xl:shrink-0 2xl:px-4",children:[(0,n.jsx)("h1",{className:"text-center text-3xl font-semibold 2xl:text-left",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.settings")})}),(0,n.jsx)("h3",{className:"text-xl",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Generic.account")}
1)}),(0,n.jsxs)(h.q,{children:[$.map(e=>menuEl(e.id,e.text,e.id===s)),(0,n.jsx)("h3",{className:"mb-4 mt-4 text-xl",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.legal")})}),menuEl("help",(0,a.t)("Settings.assistance"),"help"===s),menuEl("terms",(null==v?void 0:null===(e=v.toLowerCase)||void 0===e?void 0:e.call(v))==="it"?"Termini e condizioni d'uso":"Terms of use","terms"===s),menuEl("privacy",(null==v?void 0:null===(t=v.toLowerCase)||void 0===t?void 0:t.call(v))==="it"?"Informativa Privacy":"Privacy Policy","privacy"===s),menuEl("loyalty_terms",(null==v?void 0:null===(l=v.toLowerCase)||void 0===l?void 0:l.call(v))==="it"?"Contratto di Loyalty":"Loyalty Agreement","loyalty_terms"===s)]}),(0,n.jsx)("button",{className:"text-kbluedark mt-2 w-16 whitespace-nowrap text-left",onClick:()=>{O(!0)},children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Generic.logout")})})]}),(0,n.jsx)("div",{className:"w-0 bg-gray-200 2xl:w-0.5"}),(0,n.jsx)("div",{className:(D?"w-0 overflow-hidden":"w-full overflow-visible")+" transition-all duration-300 2xl:w-full 2xl:overflow-visible",children:(e=>{if(I)return(0,n.jsx)("div",{className:"rounded-middle shadow-light flex h-full w-full items-center justify-center",children:(0,n.jsx)(g.f4,{className:"h-18 w-18 text-kyellow animate-spin",fill:"none"})});switch(e){case"manage":return(0,n.jsx)(settingsPage_SettingCredentials,{oldEmail:null!=R?R:"",business:"Redazione"==x,onChangeEmail:handleChangeEmail,setDeletionModal:G,onSubmitUsername:handleSubmitUsername,onChangePassword:handleChangePassword,onBackClick:()=>_(!0),provider:p});case"notifications":return(0,n.jsx)(settingsPage_SettingNotification,{version:U.version,notifications:U,onSubmit:handleSubmitNotification,onBackClick:()=>{_(!0)}});case"storico_punti":return(0,n.jsx)(SettingsHistoryPoints,{onBackClick:()=>_(!0)});case"terms":return(0,n.jsx)(settingsPage_SettingTerms,{onBackClick:()=>_(!0),link:(0,a.t)("URL.termsLink")});case"help":return(0,n.jsx)(settingsPage_SettingHelp,{onBackClick:()=>_(!0)});case"privacy":return(0,n.jsx)(settingsPage_SettingTerms,{onBackClick:()=>_(!0),link:(0,a.t)("URL.privacyLink")});case"loyalty_terms":var t;return(0,n.jsx)(settingsPage_SettingTerms,{onBackClick:()=>_(!0),link:(null==v?void 0:null===(t=v.toLowerCase)||void 0===t?void 0:t.call(v))==="it"?"https://www.kuriu.it/documents/it/loyalty/6554885f9985e47b92097663/index.html":"https://www.kuriu.it/documents/en/loyalty/6554885f9985e47b92097663/index.html"});case"manage_privacy":return(0,n.jsx)(settingsPage_SettingPrivacy,{notifications:U,onSubmit:handleSubmitNotification,version:U.version,onBackClick:()=>_(!0),onSubmitUnblock:handleSubmitUnblock});default:n.Fragment}})(s)})]}),y&&(0,n.jsx)(X.Z,{children:(0,n.jsxs)("div",{className:" w-2xl -mt-20 text-center",children:[(0,n.jsx)(g.f4,{className:"text-kyellow mt-12 inline-block h-20 w-20 animate-spin",fill:"transparent"}),(0,n.jsx)("h3",{className:"mt-12 w-full text-4xl font-bold text-white",children:(0,a.t)("Settings.savingMessage")})]})}),K&&Q,W&&(0,n.jsx)(X.Z,{children:(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center ",children:(0,n.jsxs)("div",{className:"backdrop-opacity-poly rounded-middle bg-kblue flex w-80 flex-col items-center px-4 py-4 text-center text-white backdrop-blur-md",children:[(0,n.jsx)("h3",{className:" text-lg font-bold",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.deleteUserTitle")})}),(0,n.jsx)("p",{className:"mt-2 text-sm",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Settings.deleteUserDescription")})}),(0,n.jsxs)("div",{className:"mt-3 h-10 w-full gap-2 text-center text-white",children:[(0,n.jsx)("button",{className:(V?"cursor-wait opacity-50":"")+" rounded-middle bg-kyellow h-full w-1/2 text-sm text-black",onClick:()=>{q(!1)},children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})}),(0,n.jsx)("button",{className:(V?"cursor-wait opacity-50":"")+" rounded-middle h-full w-1/2 font-semibold text-red-500",onClick:async()=>{V||Y(!0);try{await handleDeletion(),await w.t.getState().localLogout(),window.location.href="/"}catch(e){Y(!1),q(!1)}},children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.deleteButton")})})]})]})})}),H&&(0,n.jsx)(X.Z,{children:(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center ",children:(0,n.jsxs)("div",{className:"backdrop-opacity-poly rounded-middle bg-kblue flex w-80 flex-col items-center   px-4 py-4 text-center text-white backdrop-blur-md",children:[(0,n.jsxs)("h3",{className:" text-ellipsis whitespace-nowrap text-lg font-bold",children:[(0,a.t)("Generic.checkYourEmail")," "]}),(0,n.jsx)("p",{className:"mt-2 text-sm",children:(0,a.t)("Settings.changeEmailMessage")}),(0,n.jsx)("div",{className:"mt-3 h-10 w-full gap-2 text-center text-white",children:(0,n.jsx)("button",{className:(V?"cursor-wait opacity-50":"")+" rounded-middle bg-kyellow h-full w-1/2 text-sm text-black",onClick:()=>{Y(!0),w.t.getState().localLogout().then(()=>{window.location.href="/"}).finally(()=>Y(!1))},children:"Ok"})})]})})}),Z&&(0,n.jsx)(X.Z,{children:(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center ",children:(0,n.jsxs)("div",{className:"backdrop-opacity-poly rounded-middle bg-kblue flex flex-col items-center   px-4 py-4 text-center text-white backdrop-blur-md",children:[(0,n.jsx)("h3",{className:" text-ellipsis whitespace-nowrap text-lg font-bold",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Alert.confirmLogoutMessage1")})}),(0,n.jsx)("p",{className:"mt-2 text-sm",children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Alert.confirmLogoutMessage")})}),(0,n.jsxs)("div",{className:"mt-3 flex h-10 w-full gap-2 text-white",children:[(0,n.jsx)("button",{className:(V?"cursor-wait opacity-50":"")+" rounded-middle bg-kyellow h-full w-1/2 text-sm text-black",onClick:()=>{Y(!0),w.t.getState().localLogout().then(()=>{window.location.href="/",O(!1)}).finally(()=>Y(!1))},children:(0,a.t)("Generic.logout")}),(0,n.jsx)("button",{className:(V?"cursor-wait opacity-50":"")+" rounded-middle h-full w-1/2 bg-red-500 text-sm",onClick:()=>{Y(!0),w.t.getState().logout().then(()=>{console.log("logged out successfully"),Y(!1),window.location.href="/",O(!1)}).catch(e=>{Y(!1),alert("Si \xe8 verificato un errore durante il processo di logout"),console.error(e)})},children:(0,a.t)("Button.logoutEverywhere")})]}),(0,n.jsx)("div",{className:"mt-2 h-10 w-full text-center text-white",children:(0,n.jsx)("button",{className:(V?"cursor-wait opacity-50":"")+" rounded-middle h-full w-1/2",onClick:()=>{O(!1)},children:(0,n.jsx)(n.Fragment,{children:(0,a.t)("Button.cancelButton")})})})]})})}),k&&(0,n.jsx)(X.Z,{children:(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center ",children:(0,n.jsxs)("div",{className:"backdrop-opacity-poly rounded-middle bg-kblue flex w-80 flex-col items-center   px-4 py-4 text-center text-white backdrop-blur-md",children:[(0,n.jsx)("h3",{className:" text-lg font-bold",children:(0,a.t)("Alert.savedChangesTitle")}),(0,n.jsx)("div",{className:"bg-kyellow mt-4 flex h-12 w-12 items-center justify-center rounded-full",children:(0,n.jsx)(g.uh,{className:"text-kblue h-7 w-7",icon:g.Tu.Check})}),(0,n.jsx)("p",{className:"mt-4",children:(0,a.t)("Alert.updateSuccess")}),(0,n.jsxs)("button",{className:"text-kgray rounded-middle bg-kyellow mt-4 w-36 px-1 py-1",onClick:()=>S(!1),children:[(0,a.t)("Button.continueButton")," "]})]})})}),C&&(0,n.jsx)(X.Z,{children:(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center ",children:(0,n.jsxs)("div",{className:"backdrop-opacity-poly rounded-middle bg-kblue flex w-80 flex-col items-center   px-4 py-4 text-center text-white backdrop-blur-md",children:[(0,n.jsx)("h3",{className:" text-lg font-bold",children:(0,a.t)("Alert.updateFailTitle")}),(0,n.jsx)("div",{className:"mt-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-500",children:(0,n.jsx)(g.uh,{className:"h-7 w-7 text-white",icon:g.Tu.Close})}),(0,n.jsxs)("p",{className:"mt-4",children:[(0,a.t)("Alert.updateFail")," "]}),(0,n.jsx)("button",{className:"text-kgray rounded-middle bg-kyellow mt-4 w-36 px-1 py-1",onClick:()=>T(!1),children:(0,a.t)("Button.continueButton")})]})})})]})]})};SettingsPage.getLayout=e=>(0,n.jsx)(ea.Z,{children:e}),SettingsPage.auth=!0;var ep=SettingsPage}},function(e){e.O(0,[7910,9654,9774,3426,2888,179],function(){return e(e.s=89523)}),_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.