"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[5942],{25942(T,_,e){e.d(_,{RenameByRegexTransformerEditor:()=>R});var r=e(74848),t=e(96540),f=e(85453),l=e(52358),d=e(72480),c=e(16244);function g(o){try{return o&&(0,f.dO)(o),!0}catch{return!1}}const R=(0,t.memo)(function(x){const{options:s,onChange:m}=x,[E,v]=(0,t.useState)(s.regex),[p,P]=(0,t.useState)(s.renamePattern),[u,i]=(0,t.useState)(!0),B=a=>{const n=a.currentTarget.value;v(n),i(g(n))},C=a=>{P(a.currentTarget.value)},M=a=>{const n=a.currentTarget.value,h=g(n);i(h),h&&m({...s,regex:n})},O=a=>{m({...s,renamePattern:a.currentTarget.value})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.I,{label:(0,l.t)("transformers.rename-by-regex-transformer-editor.label-match","Match"),labelWidth:16,invalid:!u,error:u?void 0:"Invalid pattern",children:(0,r.jsx)(c.p,{placeholder:(0,l.t)("transformers.rename-by-regex-transformer-editor.placeholder-regular-expression-pattern","Regular expression pattern"),value:E||"",onChange:B,onBlur:M,width:25})}),(0,r.jsx)(d.I,{label:(0,l.t)("transformers.rename-by-regex-transformer-editor.label-replace","Replace"),labelWidth:16,children:(0,r.jsx)(c.p,{placeholder:(0,l.t)("transformers.rename-by-regex-transformer-editor.placeholder-replacement-pattern","Replacement pattern"),value:p||"",onChange:C,onBlur:O,width:25})})]})})}}]);

//# sourceMappingURL=5942.6a9e09161fdb87071afa.js.map