"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[402],{87508(v,P,t){t.d(P,{G:()=>M});var e=t(74848),f=t(22803),d=t(96540),i=t(33100),E=t(87748),c=t(49439),u=t(33143);const g=Object.values(u.jt).map(({label:n,description:r,path:l})=>({label:n,description:r,value:l})),M=({value:n,onChange:r,context:l,item:m})=>{const D=(0,c.of)(O),[a,o]=(0,d.useState)(),h=m.settings;(0,d.useEffect)(()=>{async function s(){const _=await(0,u.q3)(n);o(_)}s()},[n,o]);const{current:x,options:p}=(0,d.useMemo)(()=>{let s=h?.options?[...h.options]:[...g],_=s?.find(L=>L.value===a?.path);return!_&&a&&(_={label:a.path,value:a.path},s.push(_)),{options:s,current:_}},[a,h?.options]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(E.l6,{value:x,options:p,onChange:s=>r(s.value),allowCustomValue:!0,formatCreateLabel:s=>`Load from URL: ${s}`}),a&&(0,e.jsxs)(e.Fragment,{children:[a.error&&(0,e.jsx)(i.F,{title:a.error,severity:"warning"}),a.count&&(0,e.jsxs)("div",{className:D.keys,children:[(0,e.jsxs)("b",{children:["(",a.count,")"]}),a.examples(10).map(s=>(0,e.jsxs)("span",{children:[s,","]},s)),a.count>10&&" ..."]})]})]})},O=n=>({keys:(0,f.css)({marginTop:n.spacing(.5),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","> span":{marginLeft:n.spacing(.5)}})})},10402(v,P,t){t.d(P,{FieldLookupTransformerEditor:()=>O});var e=t(74848),f=t(96540),d=t(17727),i=t(52358),E=t(72480),c=t(6634),u=t(12592),g=t(87508);const M={settings:{}},O=({input:n,options:r,onChange:l})=>{const m={settings:{width:30,filter:o=>o.type===d.PU.string,placeholderText:(0,i.t)("transformers.field-lookup-transformer-editor.field-name-picker-settings.placeholderText.select-text-field","Select text field"),noFieldsMessage:(0,i.t)("transformers.field-lookup-transformer-editor.field-name-picker-settings.noFieldsMessage.no-text-fields-found","No text fields found")},name:"",id:"",editor:()=>null},D=(0,f.useCallback)(o=>{l({...r,lookupField:o})},[l,r]),a=(0,f.useCallback)(o=>{l({...r,gazetteer:o})},[l,r]);return(0,e.jsxs)("div",{children:[(0,e.jsx)(c.C,{children:(0,e.jsx)(E.I,{label:(0,i.t)("transformers.field-lookup-transformer-editor.label-field","Field"),labelWidth:12,children:(0,e.jsx)(u.O,{context:{data:n},value:r?.lookupField??"",onChange:D,item:m})})}),(0,e.jsx)(c.C,{children:(0,e.jsx)(E.I,{label:(0,i.t)("transformers.field-lookup-transformer-editor.label-lookup","Lookup"),labelWidth:12,children:(0,e.jsx)(g.G,{value:r?.gazetteer??"",context:{data:n},item:M,onChange:a})})})]})}}}]);

//# sourceMappingURL=402.43170005d1884f17c600.js.map