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