"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[69395],{69875:(e,s,a)=>{a.d(s,{A:()=>n});a(65043);const n=a.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,s,a)=>{a.d(s,{A:()=>u});a(65043);var n=a(67784),t=a(4701),l=a(17392),i=a(10155),o=a(70579);const r=(0,t.A)({}),d=e=>{let{onClick:s}=e;return(0,o.jsx)(l.A,{onClick:s,children:(0,o.jsx)(i.A,{})})},u=e=>{const s=r();return(0,o.jsx)(n.A,{InputProps:{...s,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},69395:(e,s,a)=>{a.r(s),a.d(s,{default:()=>I});var n=a(65043),t=a(11906),l=a(68903),i=a(38624),o=a(96446),r=a(24659),d=(a(69875),a(63516)),u=a(14556),c=a(73033),m=a(73216),h=a(66675),v=a(11852),x=a(96801),p=(a(17115),a(70579));const A=(0,x.Gq)("enuseloc"),j=(A&&Object.keys(A).length>0&&A.user_id,{reasonName:"",statusID:""}),b=c.Ik().shape({reasonName:c.Yj("Enter Reason Name").required("Reason Name is required"),statusID:c.Ik().nullable().required("Select Status")});const I=function(e){const s=(0,m.zy)(),a=(null===s||void 0===s?void 0:s.state)._original;console.log("milestoneTypeData",a);const[c,x]=(0,n.useState)(!1),A=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],I=n.useRef(null),[N,g]=(0,n.useState)(j),f=(0,u.wA)(),D=(0,m.Zp)();(0,n.useEffect)((()=>{a&&g({...N,reasonName:null===a||void 0===a?void 0:a.reason_name,statusID:{id:null===a||void 0===a?void 0:a.status,name:null===a||void 0===a?void 0:a.status}})}),[a]),console.log("milestoneTypeData",a);const y=()=>{const{reasonName:e,...s}=j;g({...N,...s})};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"common-header-label-bold",children:[(0,p.jsx)(t.A,{onClick:()=>{D(-1)},children:(0,p.jsx)(h.A,{})}),"Update Applicability Reason"]}),(0,p.jsx)("div",{className:"component-list",children:(0,p.jsx)(d.l1,{enableReinitialize:!0,innerRef:I,validationSchema:b,initialValues:N,onSubmit:async(e,s)=>{var n,t;const l={reasonID:null===a||void 0===a?void 0:a.id,reasonName:e.reasonName,status:null!==(n=e.statusID)&&void 0!==n&&n.id?null===(t=e.statusID)||void 0===t?void 0:t.id:""};console.log("finalPayload",l),s.setSubmitting(!0),await f((0,v.Mjx)(l)),y(),D("/bd-masters/LiaisonProcessApplicabilityReason")},children:e=>{let{errors:s,handleSubmit:a,handleChange:n,handleBlur:u,setFieldValue:c,isSubmitting:m,isValid:h,touched:v,values:x}=e;return(0,p.jsx)(d.lV,{onSubmit:a,children:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,p.jsxs)(l.Ay,{container:!0,children:[(0,p.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,p.jsx)(r.A,{fullWidth:!0,label:"Reason Name*",name:"reasonName",onBlur:u,value:x.reasonName,onChange:(e,s)=>{c("reasonName",s),g({...N,reasonName:e.target.value})},variant:"outlined",size:"small",helperText:v.reasonName&&s.reasonName,error:v.reasonName&&Boolean(s.reasonName)})}),(0,p.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,p.jsx)(i.A,{name:"statusID",value:x.statusID,fullWidth:!0,options:A||[],onBlur:u,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{c("statusID",s),g({...N,statusID:s})},renderInput:e=>(0,p.jsx)(r.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:s.statusID&&s.statusID,error:s.statusID&&Boolean(s.statusID)})})})]})}),(0,p.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,p.jsx)(o.A,{children:(0,p.jsx)(t.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}}}]);
//# sourceMappingURL=69395.d70019a7.chunk.js.map