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