"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[75960],{24659:(e,s,n)=>{n.d(s,{A:()=>u});n(65043);var a=n(67784),t=n(4701),i=n(17392),l=n(10155),r=n(70579);const o=(0,t.A)({}),d=e=>{let{onClick:s}=e;return(0,r.jsx)(i.A,{onClick:s,children:(0,r.jsx)(l.A,{})})},u=e=>{const s=o();return(0,r.jsx)(a.A,{InputProps:{...s,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},75960:(e,s,n)=>{n.r(s),n.d(s,{default:()=>N});var a=n(65043),t=n(68903),i=n(11906),l=n(38624),r=n(96446),o=n(63516),d=n(24659),u=n(73216),c=n(66675),m=n(14556),v=n(96801),h=n(73033),x=n(6994),A=n(70579);const j={reasonName:"",statusID:""},p=h.Ik().shape({reasonName:h.Yj().required("Reason Name is required"),statusID:h.Ik().nullable().required("Select Status")}),I=(0,v.Gq)("enuseloc");I&&Object.keys(I).length>0&&I.user_id;const N=function(e){const s=(0,m.wA)(),n=(0,u.Zp)(),v=a.useRef(null),[h,I]=(0,a.useState)(j),N=(0,u.zy)(),f=null===N||void 0===N?void 0:N.state,b=null===f||void 0===f?void 0:f._original,y=()=>{n(-1)},g=[{id:"1",name:"Active"},{id:"0",name:"In Active"}];return(0,a.useEffect)((()=>{b&&I({...h,reasonName:null===b||void 0===b?void 0:b.face_name,statusID:{id:b.is_active,name:1==(null===b||void 0===b?void 0:b.is_active)?"Active":"InActive"}})}),[b]),(0,A.jsxs)("div",{className:"component-list",children:[(0,A.jsx)(t.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,A.jsxs)(t.Ay,{item:!0,className:"common-header-label",children:[(0,A.jsx)(i.A,{onClick:y,children:(0,A.jsx)(c.A,{})}),"Update Site Face"]})}),(0,A.jsx)(o.l1,{enableReinitialize:!0,innerRef:v,initialValues:h,validationSchema:p,onSubmit:async(e,n)=>{var a;const t={siteFaceID:null!==b&&void 0!==b&&b.id?null===b||void 0===b?void 0:b.id:"",faceName:null!==e&&void 0!==e&&e.reasonName?null===e||void 0===e?void 0:e.reasonName:"",isActive:null!==e&&void 0!==e&&e.statusID.id?null===e||void 0===e||null===(a=e.statusID)||void 0===a?void 0:a.id:""};n.setSubmitting(!0),await s((0,x.Jc4)(t)),n.resetForm({}),y()},children:e=>{let{errors:s,handleSubmit:n,handleChange:u,setFieldValue:c,handleBlur:m,isSubmitting:v,isValid:h,touched:x,values:j}=e;return(0,A.jsx)(o.lV,{onSubmit:n,children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(t.Ay,{container:!0,className:"component-form",children:(0,A.jsxs)(t.Ay,{container:!0,children:[(0,A.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{fullWidth:!0,name:"reasonName",onBlur:m,onChange:u,value:j.reasonName,error:x.reasonName&&Boolean(s.reasonName),helperText:x.reasonName&&s.reasonName,id:"reasonName",size:"small",label:"Face Name *",variant:"outlined"})}),(0,A.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(l.A,{disablePortal:!0,id:"statusID",options:g||[],name:"statusID",value:j.statusID,size:"small",getOptionLabel:e=>(null===e||void 0===e?void 0:e.name)||"",renderOption:(e,s)=>(0,a.createElement)("li",{...e,style:{textAlign:"left"},key:null===s||void 0===s?void 0:s.id},null===s||void 0===s?void 0:s.name),onChange:(e,s)=>{c("statusID",s)},renderInput:e=>(0,A.jsx)(d.A,{...e,label:"Status",size:"small",helperText:s.statusID&&s.StatusValuesID,error:s.statusID&&Boolean(s.statusID)})})})]})}),(0,A.jsx)(t.Ay,{className:"d-flex justify-content-center",p:2,children:(0,A.jsx)(r.A,{children:(0,A.jsx)(i.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:v,children:"SAVE"})})})]})})}})]})}},10155:(e,s,n)=>{var a=n(24994);s.A=void 0;var t=a(n(40039)),i=n(70579);s.A=(0,t.default)((0,i.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,s,n)=>{var a=n(24994);s.A=void 0;var t=a(n(40039)),i=n(70579);s.A=(0,t.default)((0,i.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=75960.084fa57b.chunk.js.map