1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7239],{54737:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/smaregiCustomerCodeRules/edit",function(){return t(3161)}])},3161:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return g}});var r=t(85893),o=t(67294),l=t(1778),i=t(74665),n=t(39202),a=t(85835);let u=e=>{let[s,t]=(0,o.useState)("0000123"),u=i._P.l0.useWatch("prefix",e.form),m=s?"".concat(null!=u?u:"").concat(s):"";return(0,r.jsx)(l.M,{title:e.pageTitle,children:(0,r.jsx)(i._P.Ar,{children:e.loading?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.c,{routes:e.routes}),(0,r.jsx)(i.mr,{title:e.pageTitle}),(0,r.jsxs)(i._P.Ar.Content,{...n.o8,children:[(0,r.jsx)(i._P.bZ,{type:"info",showIcon:!0,style:{marginBottom:16},message:e.t("smaregiCustomerCodeRules:description")}),(0,r.jsxs)(i._P.l0,{...n.dY,form:e.form,onFinish:e.onPressSubmit,autoComplete:"off",children:[(0,r.jsx)(i._P.l0.Item,{name:"prefix",label:e.t("smaregiCustomerCodeRules:prefix"),children:(0,r.jsx)(i._P.II,{placeholder:e.t("smaregiCustomerCodeRules:prefixPlaceholder")})}),(0,r.jsx)(i._P.l0.Item,{label:e.t("smaregiCustomerCodeRules:test"),children:(0,r.jsxs)(i._P.T,{direction:"vertical",style:{width:"100%"},children:[(0,r.jsx)(i._P.II,{addonBefore:e.t("smaregiCustomerCodeRules:testInput"),value:s,onChange:e=>t(e.target.value)}),(0,r.jsxs)(i._P.Vp,{color:"success",children:[e.t("smaregiCustomerCodeRules:testResult"),": ",m]})]})}),(0,r.jsx)(i._P.l0.Item,{label:" ",colon:!1,children:(0,r.jsxs)(i._P.T,{children:[(0,r.jsx)(i._P.zx,{onClick:e.onPressCancel,children:e.t("common:pages.edit.cancelButton")}),(0,r.jsx)(i._P.zx,{type:"primary",htmlType:"submit",loading:e.isUploading,children:e.submitButtonLabel})]})})]})]})]})})})};var m=t(11163),c=t(26982),d=t(31567);let C=()=>{let[e,s]=(0,o.useState)(!1),{loading:t,data:r,refetch:l}=(0,c.nkl)(),[n]=(0,c.XTI)(),[a]=(0,c.o6D)(),[u]=i._P.l0.useForm(),C=(0,m.useRouter)(),[g,h]=(0,o.useState)("new"),{t:_}=(0,d.$)(["common","smaregiCustomerCodeRules"]),f=_("common:pages.edit.editTitle",{typeLabel:_("smaregiCustomerCodeRules:label")}),p=_("common:pages.edit.editSubmitButton"),x=[{path:"/",breadcrumbName:_("common:pages.root.home")},{path:"",breadcrumbName:f}];(0,o.useEffect)(()=>{r&&r.smaregiCustomerCodeRules&&r.smaregiCustomerCodeRules.length>0&&(h("edit"),u.setFieldsValue(r.smaregiCustomerCodeRules[0]))},[u,r]);let b=(0,o.useCallback)(async e=>{s(!0);try{"edit"===g?await a({variables:{id:r.smaregiCustomerCodeRules[0].id,changes:{...e}}}):await n({variables:{object:{...e}}}),l(),i._P.yw.success(_("common:messages.formSubmitSuccess",{pageTitle:f}))}catch(e){i._P.yw.error(_("common:messages.formSubmitFailure",{pageTitle:f,message:String(e.message)}))}finally{s(!1)}},[g,l,_,f,a,r,n]);return{type:g,form:u,loading:t,isUploading:e,onPressSubmit:b,onPressCancel:()=>C.back(),pageTitle:f,submitButtonLabel:p,routes:x,t:_}};var g=()=>(0,r.jsx)(u,{...C()})},1778:function(e,s,t){"use strict";t.d(s,{M:function(){return r.M}});var r=t(98930)}},function(e){e.O(0,[712,1664,3827,2888,9774,179],function(){return e(e.s=54737)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.