1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1764],{21443:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/self-diagnosis/sub-categories/new",function(){return t(57258)}])},45:function(e,s,t){"use strict";t.d(s,{Z:function(){return Wrapper}});var a=t(85893),i=t(80166);function Wrapper(e){let{title:s,children:t,subTitle:n,show:r=!0,url:l}=e;return(0,a.jsxs)("div",{className:"table_Total",children:[(0,a.jsx)("div",{className:"table_Title",children:(0,a.jsxs)("div",{className:"table_Title_Diagnosis ",children:[(0,a.jsxs)("h1",{className:"titulo-pagina flex gap-[0.5rem] items-center",children:[s,(0,a.jsx)(i.Z,{url:l,show:r})]}),n&&(0,a.jsx)("h1",{className:"titulo-pagina mt-[0.5rem]",children:n})]})}),(0,a.jsx)("hr",{className:"border-1 my-6 mt-1"}),(0,a.jsx)("div",{className:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,a.jsx)("div",{className:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8",children:(0,a.jsx)("div",{className:"border-b border-gray-200 sm:rounded-lg",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("div",{className:"bg-white px-[3rem]",children:t})})})})})]})}},98054:function(e,s,t){"use strict";t.d(s,{Z:function(){return CategoriesForm}});var a=t(85893),i=t(42746),n=t(99971),r=t(15333),l=t(25724);function CategoriesForm(e){let{dataLoading:s,save:t,isLoading:o,set:d,payload:c,edit:u=!1,category:v,subHeadings:m,setCategoryID:g,errors:p}=e,x=(0,i.useTranslations)("tables"),h=(0,i.useTranslations)("sideBar"),f=(0,i.useTranslations)("buttons");return(0,a.jsx)("form",{onSubmit:t,className:"mt-[2rem] p-10",children:!1===s?(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-[1rem]",children:[!0===v&&(0,a.jsx)(r.Ph,{error:null==p?void 0:p.subHeadingId,flex:!0,label:h("subHeadings"),value:u?null==c?void 0:c.subHeadingId:void 0,onChange:e=>{u?d(e):g(e.target.value)},name:"subHeadingId",options:null==m?void 0:m.map(e=>({value:e.id,name:e.description})),twClass:"w-1/2",children:" "}),!1===v&&(0,a.jsx)(r.Ph,{error:null==p?void 0:p.categoryId,flex:!0,label:h("categories"),value:u?null==c?void 0:c.categoryId:void 0,onChange:e=>{u?d(e):g(e.target.value)},name:"categoryId",options:null==m?void 0:m.map(e=>({value:e.id,name:e.description})),twClass:"w-1/2",children:" "}),(0,a.jsx)(r.II,{type:"text",onChange:d,label:x("description"),value:null==c?void 0:c.description,name:"description",twClass:"inputFormClass",error:null==p?void 0:p.description})]}),(0,a.jsx)("div",{className:"pt-4 flex w-2/4 justify-end",children:(0,a.jsx)(n.z,{action:()=>{},name:f("save"),twClass:"!text-white !text-base drop-shadow-xl",loading:o})})]}):(0,a.jsx)(l.Z,{})})}},80166:function(e,s,t){"use strict";var a=t(85893),i=t(42746),n=t(25675),r=t.n(n),l=t(11163);s.Z=e=>{let{show:s,url:t}=e,n=(0,l.useRouter)(),o=(0,i.useTranslations)("buttons"),handleClick=()=>{t?n.replace(t):n.back()};return s?(0,a.jsx)("button",{onClick:()=>{handleClick()},className:"text-green-500 hover:text-green-700",title:o("return"),children:(0,a.jsx)(r(),{width:20,height:15,src:"/icon/redirectDark.svg",alt:"SVG",className:"!text-pink-500"})}):null}},57258:function(e,s,t){"use strict";t.r(s);var a=t(85893),i=t(67294),n=t(11163),r=t(4023),l=t(30727),o=t(45),d=t(22920),c=t(35773),u=t(42746),v=t(98054);s.default=()=>{let e=(0,u.useTranslations)("titles"),s=(0,u.useTranslations)("toast"),{token:t,APIURL:m}=(0,r.qD)(),[g,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(""),[f,b]=(0,i.useState)([]),[j,y]=(0,i.useState)({description:""}),[w,N]=(0,i.useState)({}),C={categoryId:s("mandatoryError"),description:s("mandatoryError")},_=(0,i.useMemo)(()=>new l.Z(m,t),[t]),k=(0,n.useRouter)(),save=async e=>{e.preventDefault();let t={};if("string"==typeof j.description&&""===j.description.trim()?t.description=C.description:delete C.description,"string"==typeof x&&""===x.trim()?t.categoryId=C.categoryId:delete C.categoryId,N(t),0===Object.keys(t).length){p(!0);try{await (null==_?void 0:_.postObject("categories",j,[],x,"sub-categories").then(e=>{p(!1),(0,d.Am)(s("createDone")),k.back()}))}catch(e){var a,i,n,r,l,o,c,u,v;p(!1),d.Am.error((null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:null===(i=n.errorsDetails)||void 0===i?void 0:null===(a=i.debugMessage[0])||void 0===a?void 0:a.message)||(null===(c=e.response)||void 0===c?void 0:null===(o=c.data)||void 0===o?void 0:null===(l=o.errorsDetails)||void 0===l?void 0:l.debugMessage)||(null===(v=e.response)||void 0===v?void 0:null===(u=v.data)||void 0===u?void 0:u.message))}}};return(0,i.useEffect)(()=>{null==_||_.getList("categories").then(e=>{b(e.data.content)})},[_,k.query.id]),(0,a.jsxs)(o.Z,{title:e("createSubCategory"),children:[(0,a.jsx)(v.Z,{dataLoading:!1,isLoading:g,category:!1,errors:w,save:save,payload:j,subHeadings:f,setCategoryID:h,set
1:e=>{y(s=>((0,c.F1)(s,e.target.name,e.target.value),s))}})," "]})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=21443)}),_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.