"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[21510],{24659:(e,n,a)=>{a.d(n,{A:()=>u});a(65043);var i=a(67784),t=a(4701),s=a(17392),l=a(10155),o=a(70579);const r=(0,t.A)({}),d=e=>{let{onClick:n}=e;return(0,o.jsx)(s.A,{onClick:n,children:(0,o.jsx)(l.A,{})})},u=e=>{const n=r();return(0,o.jsx)(i.A,{InputProps:{...n,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},99129:(e,n,a)=>{a.r(n),a.d(n,{default:()=>N});var i=a(65043),t=a(68903),s=a(11906),l=a(96446),o=a(63516),r=a(24659),d=a(73216),u=a(66675),c=a(14556),m=a(96801),v=a(11852),h=a(67954),x=a(73033),k=a(70579);const j={makeName:""},A=x.Ik().shape({makeName:x.Yj().required("Make Name is Required")}),p=(0,m.Gq)("enuseloc"),f=p&&Object.keys(p).length>0?p.user_id:null,y=[];const N=function(e){const n=(0,c.wA)(),a=(0,c.d4)((e=>{var n,a;return null===e||void 0===e||null===(n=e.bd)||void 0===n||null===(a=n.getLiaisonProcess)||void 0===a?void 0:a.data})),m=((0,c.d4)((e=>{var n,a;return null===e||void 0===e||null===(n=e.bd)||void 0===n||null===(a=n.getLiaisonProcessCategory)||void 0===a?void 0:a.data})),(0,c.d4)((e=>{var n;return null===e||void 0===e||null===(n=e.bd)||void 0===n?void 0:n.user})),(0,c.d4)((e=>{var n,a;return null===e||void 0===e||null===(n=e.bd)||void 0===n||null===(a=n.getBankCategory)||void 0===a?void 0:a.data})),i.useRef(null)),[x,p]=(0,i.useState)(j),[N,b]=(0,i.useState)(""),[g,S]=(0,i.useState)(""),[C,z]=(0,i.useState)();console.log(g,"statusValue");const E=(0,d.Zp)(),[I,V]=(0,i.useState)([]),M=(0,c.d4)((e=>{var n;return null===(n=e.bd.getFunctionalityPermissionDetail)||void 0===n?void 0:n.data})),O=(0,i.useRef)("NO"),P=(0,i.useRef)("NO");return(0,i.useEffect)((()=>{const e={userID:f,functionalityID:433,functionalityItemIDs:y};return n((0,v.P8M)(e)),()=>{n((0,v.qo7)())}}),[]),(0,i.useEffect)((()=>(M&&433===(null===M||void 0===M?void 0:M.functionalityID)&&(V(M),O.current=null===M||void 0===M?void 0:M.permission_report,P.current=null===M||void 0===M?void 0:M.permission_admin),()=>{V([]),O.current="NO",P.current="NO"})),[M]),console.log(a,"getLiaisonProcess"),(0,k.jsxs)("div",{className:"component-list",children:[(0,k.jsx)(t.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,k.jsx)(t.Ay,{item:!0,className:"common-header-label",children:(0,k.jsxs)(s.A,{onClick:()=>{E(-1)},children:[(0,k.jsx)(u.A,{}),"Add Asset Make"]})})}),I&&Object.keys(I).length>0&&433===(null===I||void 0===I?void 0:I.functionalityID)&&"YES"===(null===I||void 0===I?void 0:I.permission_admin)?(0,k.jsx)(o.l1,{enableReinitialize:!0,innerRef:m,initialValues:x,validationSchema:A,onSubmit:async(e,a)=>{const i={makeName:e.makeName?e.makeName:""};console.log("finalPayload",i),a.setSubmitting(!0),await n((0,h.oes)(i)),a.resetForm({}),E("/account/asset-make")},children:e=>{let{errors:n,handleSubmit:a,handleChange:i,setFieldValue:d,handleBlur:u,isSubmitting:c,isValid:m,touched:v,values:h}=e;return(0,k.jsx)(o.lV,{onSubmit:a,children:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(t.Ay,{container:!0,children:(0,k.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,k.jsx)(r.A,{name:"makeName",fullWidth:!0,onBlur:u,onChange:i,value:h.makeName,error:v.makeName&&Boolean(n.makeName),helperText:v.makeName&&n.makeName,type:"Type",id:"makeName",size:"small",label:"Asset Make Name *",variant:"outlined"})})}),(0,k.jsxs)(t.Ay,{className:"d-flex justify-content-end",p:2,children:[(0,k.jsxs)(l.A,{mx:2,children:[" ",(0,k.jsx)(s.A,{text:"CANCEL",variant:"contained",size:"medium",type:"reset",color:"secondary",onClick:()=>{p({...j})},children:"RESET"})]}),(0,k.jsx)(l.A,{children:(0,k.jsx)(s.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:c,children:"SAVE"})})]})]})})}}):(0,k.jsx)("div",{className:"common-header-label-bold",children:"You don't have permission to access this page!"})]})}},10155:(e,n,a)=>{var i=a(24994);n.A=void 0;var t=i(a(40039)),s=a(70579);n.A=(0,t.default)((0,s.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},66675:(e,n,a)=>{var i=a(24994);n.A=void 0;var t=i(a(40039)),s=a(70579);n.A=(0,t.default)((0,s.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")}}]);
//# sourceMappingURL=21510.3e8aaa52.chunk.js.map