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