"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[706],{24659:(e,n,a)=>{a.d(n,{A:()=>d});a(65043);var i=a(67784),t=a(4701),l=a(17392),s=a(10155),r=a(70579);const o=(0,t.A)({}),m=e=>{let{onClick:n}=e;return(0,r.jsx)(l.A,{onClick:n,children:(0,r.jsx)(s.A,{})})},d=e=>{const n=o();return(0,r.jsx)(i.A,{InputProps:{...n,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(m,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},706:(e,n,a)=>{a.r(n),a.d(n,{default:()=>g});var i=a(65043),t=a(68903),l=a(11906),s=a(96446),r=a(24659),o=a(63516),m=a(73033),d=a(14556),u=a(73216),c=a(66675),x=a(11852),h=a(80884),v=(a(75766),a(96801)),A=a(70579);const y={name:"",taxAmount:"",salaryLimit:""},p=m.Ik().shape({name:m.Yj().required("Display Name is required"),taxAmount:m.Yj().required(" Tax Amount is required"),salaryLimit:m.Yj().required(" Minimum Salary  is required")}),j=(0,v.Gq)("enuseloc"),f=j&&Object.keys(j).length>0?j.user_id:null,b=[];const g=function(e){const[n,a]=(0,i.useState)(y),m=i.useRef(null),v=(0,d.wA)(),j=(0,u.Zp)(),[g,L]=(0,i.useState)([]),S=(0,d.d4)((e=>{var n;return null===(n=e.bd.getFunctionalityPermissionDetail)||void 0===n?void 0:n.data})),k=(0,i.useRef)("NO"),C=(0,i.useRef)("NO");(0,i.useEffect)((()=>{const e={userID:f,functionalityID:484,functionalityItemIDs:b};return v((0,x.P8M)(e)),()=>{v((0,x.qo7)())}}),[]),(0,i.useEffect)((()=>(S&&484===(null===S||void 0===S?void 0:S.functionalityID)&&(L(S),k.current=null===S||void 0===S?void 0:S.permission_report,C.current=null===S||void 0===S?void 0:S.permission_admin),()=>{L([]),k.current="NO",C.current="NO"})),[S]);const N=()=>{j(-1)};return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{className:"component-list",style:{marginTop:"20px"},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)(l.A,{onClick:N,children:(0,A.jsx)(c.A,{})}),"Add Professional Tax"]})}),g&&Object.keys(g).length>0&&484===(null===g||void 0===g?void 0:g.functionalityID)&&("YES"===(null===g||void 0===g?void 0:g.permission_admin)||"YES"===(null===g||void 0===g?void 0:g.AddAPFQuery))?(0,A.jsx)(o.l1,{enableReinitialize:!0,innerRef:m,initialValues:n,validationSchema:p,onSubmit:async(e,n)=>{const a={name:(null===e||void 0===e?void 0:e.name)||"",taxAmount:(null===e||void 0===e?void 0:e.taxAmount)||"",salaryLimit:(null===e||void 0===e?void 0:e.salaryLimit)||""};n.setSubmitting(!0),await v((0,h.aG7)(a)),n.resetForm({}),N()},children:e=>{let{errors:i,handleSubmit:m,handleChange:d,handleBlur:u,setFieldValue:c,isSubmitting:x,isValid:h,touched:v,values:p}=e;return(0,A.jsx)(o.lV,{onSubmit:m,children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"component-form",children:[(0,A.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(r.A,{name:"name",fullWidth:!0,id:"name",placeholder:"Display Name*",type:"text",onBlur:u,value:p.name,onChange:(e,i)=>{c("name",i),a({...n,name:e.target.value})},error:v.name&&Boolean(i.name),helperText:v.name&&i.name,size:"small",label:"Display Name*",variant:"outlined"})}),(0,A.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(r.A,{name:"taxAmount",fullWidth:!0,id:"taxAmount",placeholder:"Tax Amount*",type:"number",onBlur:u,value:p.taxAmount,onChange:(e,i)=>{c("taxAmount",i),a({...n,taxAmount:e.target.value})},error:v.taxAmount&&Boolean(i.taxAmount),helperText:v.taxAmount&&i.taxAmount,size:"small",label:" Tax Amount*",variant:"outlined"})}),(0,A.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(r.A,{name:"salaryLimit",fullWidth:!0,id:"salaryLimit",placeholder:"Minimum Salary  *",type:"number",onBlur:u,value:p.salaryLimit,onChange:(e,i)=>{c("salaryLimit",i),a({...n,salaryLimit:e.target.value})},error:v.salaryLimit&&Boolean(i.salaryLimit),helperText:v.salaryLimit&&i.salaryLimit,size:"small",label:"Minimum Salary *",variant:"outlined"})})]}),(0,A.jsxs)(t.Ay,{className:"d-flex justify-content-center",p:2,children:[(0,A.jsxs)(s.A,{mx:2,children:[" ",(0,A.jsx)(l.A,{text:"CANCEL",variant:"contained",color:"secondary",size:"medium",type:"reset",onClick:()=>{a({...y})},children:"RESET"})]}),(0,A.jsx)(s.A,{children:(0,A.jsx)(l.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:x,children:"Add"})})]})]})})}}):(0,A.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)),l=a(70579);n.A=(0,t.default)((0,l.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)),l=a(70579);n.A=(0,t.default)((0,l.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")},75766:()=>{}}]);
//# sourceMappingURL=706.e7df350a.chunk.js.map