1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2946],{32141:function(t,e,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/portal/[portal]/dashboard/evaluations/[moduleId]/edit/[id]",function(){return a(47952)}])},99445:function(t,e,a){"use strict";a.d(e,{Z:function(){return useFetchEvaluation}});var i=a(75271),s=a(32091);function useFetchEvaluation(t){let{id:e,fromIndicators:a=!1}=t,[l,n]=(0,i.useState)({}),[u,o]=(0,i.useState)(),[r,d]=(0,i.useState)(!0),fetchEvaluation=t=>{let e=a?s.p.moduleShowPublic(t):s.p.show(t);e.then(t=>{n(t.data.data)}).catch(t=>o(t)).finally(()=>d(!1))};return(0,i.useEffect)(()=>{fetchEvaluation(e)},[]),{evaluation:l,error:u,isFetching:r}}},47952:function(t,e,a){"use strict";a.r(e),a.d(e,{__N_SSP:function(){return E}});var i=a(52676),s=a(34090),l=a(57394),n=a.n(l),u=a(63534),o=a(91750),r=a(99445),d=a(1629),c=a(41501),h=a(75271),v=a(31785),f=a(86754),x=a(78619),p=a(32091),g=a(90394),m=a(42474);let EditEvaluation=()=>{let t=(0,d.useRouter)(),{handlePermission:e}=(0,m.a)({middleware:["auth"]}),{id:a,moduleId:s}=t.query,{evaluation:l,isFetching:E,error:N}=(0,r.Z)({id:a}),{alert:j,isOpen:_,showAlert:b}=(0,c.ZP)(),{newNotification:w}=(0,h.useContext)(v.u),{t:S}=(0,x.$G)(),[y,O]=(0,h.useState)(!1),T=[{title:S("evaluations.evaluations.pageTitle"),href:"/dashboard/evaluations/".concat(s)},{title:S("evaluations.edit.pageTitle"),href:"/dashboard/evaluations/".concat(s,"/edit/").concat(a)}];return(0,h.useEffect)(()=>{e(["evaluation.update"])||t.push("/dashboard")},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n(),{children:(0,i.jsx)("title",{children:S("evaluations.edit.pageTitle")})}),(0,i.jsx)("div",{className:"max-w-screen-2xl mx-auto",children:(0,i.jsxs)("div",{className:"bg-white overflow-hidden shadow-sm rounded-lg",children:[(0,i.jsxs)("div",{className:"flex flex-col pt-6 pl-6",children:[(0,i.jsx)("div",{className:"bg-white font-bold text-xl sm:text-2xl text-black",children:S("evaluations.edit.pageTitle")}),(0,i.jsx)("div",{children:(0,i.jsx)(u.Z,{routes:T})})]}),(0,i.jsxs)("div",{className:"p-6",children:[_&&j(),N?"":E?(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(o.g,{className:"flex justify-center"})}):(0,i.jsx)(f.Z,{defaultValues:l,onSubmit:(e,i)=>{var l;O(!0);let n={title:JSON.stringify(e.title),logo:e.logo?e.logo:null,year:e.year,module_id:s,categories:null===(l=e.categories)||void 0===l?void 0:l.map(t=>({title:JSON.stringify(t.title),subcategories:t.subcategories.map(t=>({title:JSON.stringify(t.title),indicators:t.indicators.map(t=>{var e;return{title:JSON.stringify(t.title),route:t.route,status:null!==(e=t.status)&&void 0!==e&&e}})}))}))};p.p.update(n,a).then(()=>{w("success",S("common.successOperation")),t.push("/dashboard/evaluations/".concat(s))}).catch(t=>{var e;O(!1),(0,g.xg)((null===(e=t.response)||void 0===e?void 0:e.data)||t,i,b)})},loading:y})]})]})})]})};EditEvaluation.getLayout=function(t){return(0,i.jsx)(s.Z,{isTenant:!0,children:t})};var E=!0;e.default=EditEvaluation}},function(t){t.O(0,[3043,4497,2771,5423,4090,3889,9774,2888,179],function(){return t(t.s=32141)}),_N_E=t.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.