"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[13377],{24659:(e,t,s)=>{s.d(t,{A:()=>c});s(65043);var a=s(67784),n=s(4701),i=s(17392),r=s(10155),l=s(70579);const o=(0,n.A)({}),u=e=>{let{onClick:t}=e;return(0,l.jsx)(i.A,{onClick:t,children:(0,l.jsx)(r.A,{})})},c=e=>{const t=o();return(0,l.jsx)(a.A,{InputProps:{...t,endAdornment:(0,l.jsxs)(l.Fragment,{children:[" ",e.iscross&&(0,l.jsx)(u,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},13377:(e,t,s)=>{s.r(t),s.d(t,{default:()=>p});var a=s(65043),n=s(68903),i=s(11906),r=s(96446),l=s(63516),o=s(24659),u=s(73216),c=s(66675),d=s(11852),m=s(73033),h=s(14556),v=s(96801),x=s(70579);const j={courtCaseStatusName:""},S=m.Ik().shape({courtCaseStatusName:m.Yj("Enter Status Name").required("Status Name is required")}),A=[],C=(0,v.Gq)("enuseloc"),N=C&&Object.keys(C).length>0?C.user_id:null;const p=function(e){const t=a.useRef(null),[s,m]=(0,a.useState)(j),v=(0,u.Zp)(),C=(0,h.wA)(),[p,f]=(0,a.useState)([]),y=(0,h.d4)((e=>{var t;return null===(t=e.bd.getFunctionalityPermissionDetail)||void 0===t?void 0:t.data})),b=a.useRef("No"),k=a.useRef("No");return(0,a.useEffect)((()=>{const e={userID:N,functionalityID:132,functionalityItemIDs:A};return C((0,d.P8M)(e)),()=>{C((0,d.qo7)())}}),[]),(0,a.useEffect)((()=>(y&&132===(null===y||void 0===y?void 0:y.functionalityID)&&(f(y),b.current=null===y||void 0===y?void 0:y.permission_report,k.current=null===y||void 0===y?void 0:y.permission_admin),()=>{f([]),b.current="NO",k.current="NO"})),[y]),(0,x.jsxs)("div",{className:"component-list",children:[(0,x.jsx)(n.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,x.jsxs)(n.Ay,{item:!0,className:"common-header-label",children:[(0,x.jsx)(i.A,{onClick:()=>{v(-1)},children:(0,x.jsx)(c.A,{})}),"Add Court Case Status"]})}),p&&Object.keys(p).length>0&&132===(null===p||void 0===p?void 0:p.functionalityID)&&"YES"===(null===p||void 0===p?void 0:p.permission_admin)?(0,x.jsx)(l.l1,{enableReinitialize:!0,innerRef:t,initialValues:s,validationSchema:S,onSubmit:async(e,t)=>{const s={courtCaseStatusName:null!==e&&void 0!==e&&e.courtCaseStatusName?null===e||void 0===e?void 0:e.courtCaseStatusName:""};t.setSubmitting(!0),await C((0,d.l5N)(s)),t.resetForm({}),v("/bd-masters/CourtCaseStatus")},children:e=>{let{errors:t,handleSubmit:s,handleChange:a,setFieldValue:u,handleBlur:c,isSubmitting:d,isValid:h,touched:v,values:S}=e;return(0,x.jsx)(l.lV,{onSubmit:s,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(n.Ay,{container:!0,className:"component-form",children:(0,x.jsx)(n.Ay,{container:!0,children:(0,x.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(o.A,{name:"courtCaseStatusName",fullWidth:!0,onBlur:c,onChange:a,value:S.courtCaseStatusName,error:t.courtCaseStatusName&&Boolean(t.courtCaseStatusName),helperText:t.courtCaseStatusName&&t.courtCaseStatusName,id:"courtCaseStatusName",size:"small",label:"Status Name*",variant:"outlined"})})})}),(0,x.jsxs)(n.Ay,{className:"d-flex justify-content-start",p:2,children:[(0,x.jsxs)(r.A,{mx:2,children:[" ",(0,x.jsx)(i.A,{text:"CANCEL",variant:"contained",color:"secondary",size:"medium",type:"reset",onClick:()=>{m({...j})},children:"RESET"})]}),(0,x.jsx)(r.A,{children:(0,x.jsx)(i.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:d,children:"SAVE"})})]})]})})}}):(0,x.jsx)("div",{className:"common-header-label-bold",children:"You don't have permission to access this page!"})]})}},10155:(e,t,s)=>{var a=s(24994);t.A=void 0;var n=a(s(40039)),i=s(70579);t.A=(0,n.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,t,s)=>{var a=s(24994);t.A=void 0;var n=a(s(40039)),i=s(70579);t.A=(0,n.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=13377.66e8a34b.chunk.js.map