"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[15075],{24659:(e,t,n)=>{n.d(t,{A:()=>u});n(65043);var s=n(67784),i=n(4701),a=n(17392),l=n(10155),r=n(70579);const d=(0,i.A)({}),o=e=>{let{onClick:t}=e;return(0,r.jsx)(a.A,{onClick:t,children:(0,r.jsx)(l.A,{})})},u=e=>{const t=d();return(0,r.jsx)(s.A,{InputProps:{...t,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(o,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},15075:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var s=n(65043),i=n(68903),a=n(11906),l=n(38624),r=n(96446),d=n(63516),o=n(24659),u=n(73216),c=n(66675),m=n(14556),v=n(73033),h=n(67954),x=n(70579);const A={status:""},j=v.Ik().shape({status:v.Ik().nullable().required("Select Status")});const p=function(e){const t=(0,m.wA)(),n=[{id:"1",name:"Active"},{id:"0",name:"In Active"}],v=s.useRef(null),[p,f]=(0,s.useState)(A),b=(0,u.Zp)(),g=(0,u.zy)().state._original;(0,s.useEffect)((()=>{g&&f({...p,status:{id:null===g||void 0===g?void 0:g.is_active,name:1==(null===g||void 0===g?void 0:g.is_active)?"Active":"In Active"}})}),[g]),console.log(g,"RetentionPersentageData");const k=()=>{b(-1)};return(0,x.jsxs)("div",{className:"component-list",children:[(0,x.jsx)(i.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,x.jsxs)(i.Ay,{item:!0,className:"common-header-label",children:[(0,x.jsx)(a.A,{onClick:k,children:(0,x.jsx)(c.A,{})}),"Update Retention Percentage"]})}),(0,x.jsx)(d.l1,{enableReinitialize:!0,innerRef:v,initialValues:p,validationSchema:j,onSubmit:async(e,n)=>{var s,i;const a={retentionPercentageID:null===g||void 0===g?void 0:g.id,status:null!==e&&void 0!==e&&null!==(s=e.status)&&void 0!==s&&s.id?null===e||void 0===e||null===(i=e.status)||void 0===i?void 0:i.id:""};n.setSubmitting(!0),await t((0,h.jRX)(a)),n.resetForm({}),k()},children:e=>{let{errors:t,handleSubmit:s,handleChange:u,setFieldValue:c,handleBlur:m,isSubmitting:v,isValid:h,touched:A,values:j}=e;return(0,x.jsx)(d.lV,{onSubmit:s,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i.Ay,{container:!0,className:"component-form",children:(0,x.jsx)(i.Ay,{container:!0,children:(0,x.jsx)(i.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(l.A,{name:"status",value:j.status,fullWidth:!0,options:n,onBlur:m,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,t)=>{c("status",t),f({...p,status:t})},renderInput:e=>(0,x.jsx)(o.A,{...e,fullWidth:!0,label:"Status *",name:"status",variant:"outlined",helperText:t.status&&t.status,error:t.status&&Boolean(t.status)})})})})}),(0,x.jsx)(i.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(r.A,{children:(0,x.jsx)(a.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:v,children:"SAVE"})})})]})})}})]})}},10155:(e,t,n)=>{var s=n(24994);t.A=void 0;var i=s(n(40039)),a=n(70579);t.A=(0,i.default)((0,a.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,t,n)=>{var s=n(24994);t.A=void 0;var i=s(n(40039)),a=n(70579);t.A=(0,i.default)((0,a.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=15075.0bf941fb.chunk.js.map