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