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CACLiX,YAAaP,EAAKO,YAClBiB,KAAI,UAAExB,EAAKU,YAAYnP,MAAMyQ,GAAmC,SAAVA,EAAE1Y,aAApD,aAAE,EAAmEb,MACzEgZ,KAAI,UAAEzB,EAAKU,YAAYnP,MAAMyQ,GAAmC,SAAVA,EAAE1Y,aAApD,aAAE,EAAmEb,MACzEiZ,KAAI,UAAE1B,EAAKU,YAAYnP,MAAMyQ,GAAmC,SAAVA,EAAE1Y,aAApD,aAAE,EAAmEb,aAG7E8G,I,uSCvLF0S,EAAgB,SAAU1T,EAAO2T,GACjC,MAA4B,kBAAdA,EAA0BA,GAAa3T,GAKzD,QAHgB,SAAU4T,GACtB,OAAO,IAAAC,YAAWH,EAAeE","sources":["webpack://grafana/./public/app/features/dashboard/components/PanelEditor/utils.ts","webpack://grafana/./public/app/features/inspector/DetailText.tsx","webpack://grafana/./public/app/features/inspector/InspectDataOptions.tsx","webpack://grafana/./public/app/features/inspector/InspectDataTab.tsx","webpack://grafana/./public/app/features/inspector/InspectErrorTab.tsx","webpack://grafana/./public/app/features/inspector/InspectJSONTab.tsx","webpack://grafana/./public/app/features/inspector/InspectStatsTable.tsx","webpack://grafana/./public/app/features/inspector/InspectStatsTab.tsx","webpack://grafana/./public/app/features/inspector/QueryInspector.tsx","webpack://grafana/./public/app/features/inspector/styles.ts","webpack://grafana/./public/app/features/query/components/QueryEditorRows.tsx","webpack://grafana/./public/app/plugins/datasource/zipkin/utils/transforms.ts","webpack://grafana/./.yarn/__virtual__/react-use-virtual-ca2705900f/3/opt/drone/yarncache/react-use-npm-17.2.4-c702db5427-3c885c3798.zip/node_modules/react-use/esm/useToggle.js"],"sourcesContent":["import { omit } from 'lodash';\nimport { FieldConfigSource, PanelPlugin } from '@grafana/data';\nimport { PanelModel } from '../../state/PanelModel';\nimport { DisplayMode } from './types';\nimport { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from 'app/core/constants';\n\nexport function calculatePanelSize(mode: DisplayMode, width: number, height: number, panel: PanelModel) {\n  if (mode === DisplayMode.Fill) {\n    return { width, height };\n  }\n  const panelPadding = 8 * 6;\n  const sidebarWidth = 60;\n\n  const colWidth = (window.innerWidth - sidebarWidth - GRID_CELL_VMARGIN * 4) / GRID_COLUMN_COUNT;\n  const pWidth = colWidth * panel.gridPos.w;\n  const pHeight = GRID_CELL_HEIGHT * panel.gridPos.h + panelPadding;\n  const scale = Math.min(width / pWidth, height / pHeight);\n\n  if (pWidth <= width && pHeight <= height) {\n    return {\n      width: pWidth,\n      height: pHeight,\n    };\n  }\n\n  return {\n    width: pWidth * scale,\n    height: pHeight * scale,\n  };\n}\n\nexport function supportsDataQuery(plugin: PanelPlugin | undefined | null): boolean {\n  return plugin?.meta.skipDataQuery === false;\n}\n\nexport const updateDefaultFieldConfigValue = (\n  config: FieldConfigSource,\n  name: string,\n  value: any,\n  isCustom?: boolean\n) => {\n  let defaults = { ...config.defaults };\n  const remove = value == null || value === '';\n\n  if (isCustom) {\n    if (defaults.custom) {\n      if (remove) {\n        defaults.custom = omit(defaults.custom, name);\n      } else {\n        defaults.custom = setOptionImmutably(defaults.custom, name, value);\n      }\n    } else if (!remove) {\n      defaults.custom = setOptionImmutably(defaults.custom, name, value);\n    }\n  } else if (remove) {\n    defaults = omit(defaults, name);\n  } else {\n    defaults = setOptionImmutably(defaults, name, value);\n  }\n\n  return {\n    ...config,\n    defaults,\n  };\n};\n\nexport function setOptionImmutably<T extends object>(options: T, path: string | string[], value: any): T {\n  const splat = !Array.isArray(path) ? path.split('.') : path;\n\n  const key = splat.shift()!;\n  if (key.endsWith(']')) {\n    const idx = key.lastIndexOf('[');\n    const index = +key.substring(idx + 1, key.length - 1);\n    const propKey = key.substr(0, idx);\n    let current = (options as Record<string, any>)[propKey];\n    const arr = Array.isArray(current) ? [...current] : [];\n    if (splat.length) {\n      current = arr[index];\n      if (current == null || typeof current !== 'object') {\n        current = {};\n      }\n      value = setOptionImmutably(current, splat, value);\n    }\n    arr[index] = value;\n    return { ...options, [propKey]: arr };\n  }\n\n  if (!splat.length) {\n    return { ...options, [key]: value };\n  }\n\n  let current = (options as Record<string, any>)[key];\n\n  if (current == null || typeof current !== 'object') {\n    current = {};\n  }\n\n  return { ...options, [key]: setOptionImmutably(current, splat, value) };\n}\n","import React, { FC } from 'react';\nimport { useStyles } from '@grafana/ui';\nimport { GrafanaTheme } from '@grafana/data';\nimport { css } from '@emotion/css';\n\nconst getStyles = (theme: GrafanaTheme) => css`\n  margin: 0;\n  margin-left: ${theme.spacing.md};\n  font-size: ${theme.typography.size.sm};\n  color: ${theme.colors.textWeak};\n`;\n\nexport const DetailText: FC = ({ children }) => {\n  const collapsedTextStyles = useStyles(getStyles);\n  return <p className={collapsedTextStyles}>{children}</p>;\n};\n","import React, { FC } from 'react';\nimport { DataFrame, DataTransformerID, getFrameDisplayName, SelectableValue } from '@grafana/data';\nimport { Field, HorizontalGroup, Select, Switch, VerticalGroup } from '@grafana/ui';\nimport { getPanelInspectorStyles } from './styles';\nimport { GetDataOptions } from 'app/features/query/state/PanelQueryRunner';\nimport { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { DetailText } from 'app/features/inspector/DetailText';\n\ninterface Props {\n  options: GetDataOptions;\n  dataFrames: DataFrame[];\n  transformId: DataTransformerID;\n  transformationOptions: Array<SelectableValue<DataTransformerID>>;\n  selectedDataFrame: number | DataTransformerID;\n  downloadForExcel: boolean;\n  onDataFrameChange: (item: SelectableValue<DataTransformerID | number>) => void;\n  toggleDownloadForExcel: () => void;\n  data?: DataFrame[];\n  panel?: PanelModel;\n  onOptionsChange?: (options: GetDataOptions) => void;\n}\n\nexport const InspectDataOptions: FC<Props> = ({\n  options,\n  onOptionsChange,\n  panel,\n  data,\n  dataFrames,\n  transformId,\n  transformationOptions,\n  selectedDataFrame,\n  onDataFrameChange,\n  downloadForExcel,\n  toggleDownloadForExcel,\n}) => {\n  const styles = getPanelInspectorStyles();\n\n  const panelTransformations = panel?.getTransformations();\n  const showPanelTransformationsOption =\n    Boolean(panelTransformations?.length) && (transformId as any) !== 'join by time';\n  const showFieldConfigsOption = panel && !panel.plugin?.fieldConfigRegistry.isEmpty();\n\n  let dataSelect = dataFrames;\n  if (selectedDataFrame === DataTransformerID.seriesToColumns) {\n    dataSelect = data!;\n  }\n\n  const choices = dataSelect.map((frame, index) => {\n    return {\n      value: index,\n      label: `${getFrameDisplayName(frame)} (${index})`,\n    } as SelectableValue<number>;\n  });\n\n  const selectableOptions = [...transformationOptions, ...choices];\n\n  function getActiveString() {\n    let activeString = '';\n\n    if (!data) {\n      return activeString;\n    }\n\n    const parts: string[] = [];\n\n    if (selectedDataFrame === DataTransformerID.seriesToColumns) {\n      parts.push('Series joined by time');\n    } else if (data.length > 1) {\n      parts.push(getFrameDisplayName(data[selectedDataFrame as number]));\n    }\n\n    if (options.withTransforms || options.withFieldConfig) {\n      if (options.withTransforms) {\n        parts.push('Panel transforms');\n      }\n\n      if (options.withTransforms && options.withFieldConfig) {\n      }\n\n      if (options.withFieldConfig) {\n        parts.push('Formatted data');\n      }\n    }\n\n    if (downloadForExcel) {\n      parts.push('Excel header');\n    }\n\n    return parts.join(', ');\n  }\n\n  return (\n    <div className={styles.dataDisplayOptions}>\n      <QueryOperationRow\n        id=\"Data options\"\n        index={0}\n        title=\"Data options\"\n        headerElement={<DetailText>{getActiveString()}</DetailText>}\n        isOpen={false}\n      >\n        <div className={styles.options} data-testid=\"dataOptions\">\n          <VerticalGroup spacing=\"none\">\n            {data!.length > 1 && (\n              <Field label=\"Show data frame\">\n                <Select\n                  menuShouldPortal\n                  options={selectableOptions}\n                  value={selectedDataFrame}\n                  onChange={onDataFrameChange}\n                  width={30}\n                  aria-label=\"Select dataframe\"\n                />\n              </Field>\n            )}\n\n            <HorizontalGroup>\n              {showPanelTransformationsOption && onOptionsChange && (\n                <Field\n                  label=\"Apply panel transformations\"\n                  description=\"Table data is displayed with transformations defined in the panel Transform tab.\"\n                >\n                  <Switch\n                    value={!!options.withTransforms}\n                    onChange={() => onOptionsChange({ ...options, withTransforms: !options.withTransforms })}\n                  />\n                </Field>\n              )}\n              {showFieldConfigsOption && onOptionsChange && (\n                <Field\n                  label=\"Formatted data\"\n                  description=\"Table data is formatted with options defined in the Field and Override tabs.\"\n                >\n                  <Switch\n                    id=\"formatted-data-toggle\"\n                    value={!!options.withFieldConfig}\n                    onChange={() => onOptionsChange({ ...options, withFieldConfig: !options.withFieldConfig })}\n                  />\n                </Field>\n              )}\n              <Field label=\"Download for Excel\" description=\"Adds header to CSV for use with Excel\">\n                <Switch id=\"excel-toggle\" value={downloadForExcel} onChange={toggleDownloadForExcel} />\n              </Field>\n            </HorizontalGroup>\n          </VerticalGroup>\n        </div>\n      </QueryOperationRow>\n    </div>\n  );\n};\n","import React, { PureComponent } from 'react';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport {\n  applyFieldOverrides,\n  applyRawFieldOverrides,\n  CSVConfig,\n  DataFrame,\n  DataTransformerID,\n  dateTimeFormat,\n  dateTimeFormatISO,\n  MutableDataFrame,\n  SelectableValue,\n  toCSV,\n  transformDataFrame,\n  TimeZone,\n} from '@grafana/data';\nimport { Button, Container, Spinner, Table } from '@grafana/ui';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { InspectDataOptions } from './InspectDataOptions';\nimport { getPanelInspectorStyles } from './styles';\nimport { config } from 'app/core/config';\nimport { saveAs } from 'file-saver';\nimport { css } from '@emotion/css';\nimport { GetDataOptions } from 'app/features/query/state/PanelQueryRunner';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { dataFrameToLogsModel } from 'app/core/logs_model';\nimport { transformToJaeger } from 'app/plugins/datasource/jaeger/responseTransform';\nimport { transformToZipkin } from 'app/plugins/datasource/zipkin/utils/transforms';\nimport { transformToOTLP } from 'app/plugins/datasource/tempo/resultTransformer';\n\ninterface Props {\n  isLoading: boolean;\n  options: GetDataOptions;\n  timeZone: TimeZone;\n  data?: DataFrame[];\n  panel?: PanelModel;\n  onOptionsChange?: (options: GetDataOptions) => void;\n}\n\ninterface State {\n  /** The string is seriesToColumns transformation. Otherwise it is a dataframe index */\n  selectedDataFrame: number | DataTransformerID;\n  transformId: DataTransformerID;\n  dataFrameIndex: number;\n  transformationOptions: Array<SelectableValue<DataTransformerID>>;\n  transformedData: DataFrame[];\n  downloadForExcel: boolean;\n}\n\nexport class InspectDataTab extends PureComponent<Props, State> {\n  constructor(props: Props) {\n    super(props);\n\n    this.state = {\n      selectedDataFrame: 0,\n      dataFrameIndex: 0,\n      transformId: DataTransformerID.noop,\n      transformationOptions: buildTransformationOptions(),\n      transformedData: props.data ?? [],\n      downloadForExcel: false,\n    };\n  }\n\n  componentDidUpdate(prevProps: Props, prevState: State) {\n    if (!this.props.data) {\n      this.setState({ transformedData: [] });\n      return;\n    }\n\n    if (this.props.options.withTransforms) {\n      this.setState({ transformedData: this.props.data });\n      return;\n    }\n\n    if (prevProps.data !== this.props.data || prevState.transformId !== this.state.transformId) {\n      const currentTransform = this.state.transformationOptions.find((item) => item.value === this.state.transformId);\n\n      if (currentTransform && currentTransform.transformer.id !== DataTransformerID.noop) {\n        const selectedDataFrame = this.state.selectedDataFrame;\n        const dataFrameIndex = this.state.dataFrameIndex;\n        const subscription = transformDataFrame([currentTransform.transformer], this.props.data).subscribe((data) => {\n          this.setState({ transformedData: data, selectedDataFrame, dataFrameIndex }, () => subscription.unsubscribe());\n        });\n        return;\n      }\n\n      this.setState({ transformedData: this.props.data });\n      return;\n    }\n  }\n\n  exportCsv = (dataFrame: DataFrame, csvConfig: CSVConfig = {}) => {\n    const { panel } = this.props;\n    const { transformId } = this.state;\n\n    const dataFrameCsv = toCSV([dataFrame], csvConfig);\n\n    const blob = new Blob([String.fromCharCode(0xfeff), dataFrameCsv], {\n      type: 'text/csv;charset=utf-8',\n    });\n    const displayTitle = panel ? panel.getDisplayTitle() : 'Explore';\n    const transformation = transformId !== DataTransformerID.noop ? '-as-' + transformId.toLocaleLowerCase() : '';\n    const fileName = `${displayTitle}-data${transformation}-${dateTimeFormat(new Date())}.csv`;\n    saveAs(blob, fileName);\n  };\n\n  exportLogsAsTxt = () => {\n    const { data, panel } = this.props;\n    const logsModel = dataFrameToLogsModel(data || [], undefined);\n    let textToDownload = '';\n\n    logsModel.meta?.forEach((metaItem) => {\n      const string = `${metaItem.label}: ${JSON.stringify(metaItem.value)}\\n`;\n      textToDownload = textToDownload + string;\n    });\n    textToDownload = textToDownload + '\\n\\n';\n\n    logsModel.rows.forEach((row) => {\n      const newRow = dateTimeFormatISO(row.timeEpochMs) + '\\t' + row.entry + '\\n';\n      textToDownload = textToDownload + newRow;\n    });\n\n    const blob = new Blob([textToDownload], {\n      type: 'text/plain;charset=utf-8',\n    });\n    const displayTitle = panel ? panel.getDisplayTitle() : 'Explore';\n    const fileName = `${displayTitle}-logs-${dateTimeFormat(new Date())}.txt`;\n    saveAs(blob, fileName);\n  };\n\n  exportTracesAsJson = () => {\n    const { data, panel } = this.props;\n    if (!data) {\n      return;\n    }\n\n    for (const df of data) {\n      // Only export traces\n      if (df.meta?.preferredVisualisationType !== 'trace') {\n        continue;\n      }\n\n      switch (df.meta?.custom?.traceFormat) {\n        case 'jaeger': {\n          let res = transformToJaeger(new MutableDataFrame(df));\n          this.saveTraceJson(res, panel);\n          break;\n        }\n        case 'zipkin': {\n          let res = transformToZipkin(new MutableDataFrame(df));\n          this.saveTraceJson(res, panel);\n          break;\n        }\n        case 'otlp':\n        default: {\n          let res = transformToOTLP(new MutableDataFrame(df));\n          this.saveTraceJson(res, panel);\n          break;\n        }\n      }\n    }\n  };\n\n  saveTraceJson = (json: any, panel?: PanelModel) => {\n    const blob = new Blob([JSON.stringify(json)], {\n      type: 'application/json',\n    });\n    const displayTitle = panel ? panel.getDisplayTitle() : 'Explore';\n    const fileName = `${displayTitle}-traces-${dateTimeFormat(new Date())}.json`;\n    saveAs(blob, fileName);\n  };\n\n  onDataFrameChange = (item: SelectableValue<DataTransformerID | number>) => {\n    this.setState({\n      transformId:\n        item.value === DataTransformerID.seriesToColumns ? DataTransformerID.seriesToColumns : DataTransformerID.noop,\n      dataFrameIndex: typeof item.value === 'number' ? item.value : 0,\n      selectedDataFrame: item.value!,\n    });\n  };\n\n  toggleDownloadForExcel = () => {\n    this.setState((prevState) => ({\n      downloadForExcel: !prevState.downloadForExcel,\n    }));\n  };\n\n  getProcessedData(): DataFrame[] {\n    const { options, panel, timeZone } = this.props;\n    const data = this.state.transformedData;\n\n    if (!options.withFieldConfig || !panel) {\n      return applyRawFieldOverrides(data);\n    }\n\n    // We need to apply field config even though it was already applied in the PanelQueryRunner.\n    // That's because transformers create new fields and data frames, so i.e. display processor is no longer there\n    return applyFieldOverrides({\n      data,\n      theme: config.theme2,\n      fieldConfig: panel.fieldConfig,\n      timeZone,\n      replaceVariables: (value: string) => {\n        return value;\n      },\n    });\n  }\n\n  render() {\n    const { isLoading, options, data, panel, onOptionsChange } = this.props;\n    const { dataFrameIndex, transformId, transformationOptions, selectedDataFrame, downloadForExcel } = this.state;\n    const styles = getPanelInspectorStyles();\n\n    if (isLoading) {\n      return (\n        <div>\n          <Spinner inline={true} /> Loading\n        </div>\n      );\n    }\n\n    const dataFrames = this.getProcessedData();\n\n    if (!dataFrames || !dataFrames.length) {\n      return <div>No Data</div>;\n    }\n\n    // let's make sure we don't try to render a frame that doesn't exists\n    const index = !dataFrames[dataFrameIndex] ? 0 : dataFrameIndex;\n    const dataFrame = dataFrames[index];\n    const hasLogs = dataFrames.some((df) => df?.meta?.preferredVisualisationType === 'logs');\n    const hasTraces = dataFrames.some((df) => df?.meta?.preferredVisualisationType === 'trace');\n\n    return (\n      <div className={styles.dataTabContent} aria-label={selectors.components.PanelInspector.Data.content}>\n        <div className={styles.actionsWrapper}>\n          <InspectDataOptions\n            data={data}\n            panel={panel}\n            options={options}\n            dataFrames={dataFrames}\n            transformId={transformId}\n            transformationOptions={transformationOptions}\n            selectedDataFrame={selectedDataFrame}\n            downloadForExcel={downloadForExcel}\n            onOptionsChange={onOptionsChange}\n            onDataFrameChange={this.onDataFrameChange}\n            toggleDownloadForExcel={this.toggleDownloadForExcel}\n          />\n          <Button\n            variant=\"primary\"\n            onClick={() => this.exportCsv(dataFrames[dataFrameIndex], { useExcelHeader: this.state.downloadForExcel })}\n            className={css`\n              margin-bottom: 10px;\n            `}\n          >\n            Download CSV\n          </Button>\n          {hasLogs && (\n            <Button\n              variant=\"primary\"\n              onClick={this.exportLogsAsTxt}\n              className={css`\n                margin-bottom: 10px;\n                margin-left: 10px;\n              `}\n            >\n              Download logs\n            </Button>\n          )}\n          {hasTraces && (\n            <Button\n              variant=\"primary\"\n              onClick={this.exportTracesAsJson}\n              className={css`\n                margin-bottom: 10px;\n                margin-left: 10px;\n              `}\n            >\n              Download traces\n            </Button>\n          )}\n        </div>\n        <Container grow={1}>\n          <AutoSizer>\n            {({ width, height }) => {\n              if (width === 0) {\n                return null;\n              }\n\n              return (\n                <div style={{ width, height }}>\n                  <Table width={width} height={height} data={dataFrame} showTypeIcons={true} />\n                </div>\n              );\n            }}\n          </AutoSizer>\n        </Container>\n      </div>\n    );\n  }\n}\n\nfunction buildTransformationOptions() {\n  const transformations: Array<SelectableValue<DataTransformerID>> = [\n    {\n      value: DataTransformerID.seriesToColumns,\n      label: 'Series joined by time',\n      transformer: {\n        id: DataTransformerID.seriesToColumns,\n        options: { byField: 'Time' },\n      },\n    },\n  ];\n\n  return transformations;\n}\n","import React from 'react';\nimport { DataQueryError } from '@grafana/data';\nimport { JSONFormatter } from '@grafana/ui';\n\ninterface InspectErrorTabProps {\n  error?: DataQueryError;\n}\n\nexport const InspectErrorTab: React.FC<InspectErrorTabProps> = ({ error }) => {\n  if (!error) {\n    return null;\n  }\n  if (error.data) {\n    return (\n      <>\n        <h3>{error.data.message}</h3>\n        <JSONFormatter json={error} open={2} />\n      </>\n    );\n  }\n  return <div>{error.message}</div>;\n};\n","import React, { PureComponent } from 'react';\nimport { chain } from 'lodash';\nimport { AppEvents, PanelData, SelectableValue } from '@grafana/data';\nimport { Button, CodeEditor, Field, Select } from '@grafana/ui';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { appEvents } from 'app/core/core';\nimport { DashboardModel, PanelModel } from 'app/features/dashboard/state';\nimport { getPanelInspectorStyles } from '../inspector/styles';\n\nenum ShowContent {\n  PanelJSON = 'panel',\n  DataJSON = 'data',\n  DataStructure = 'structure',\n}\n\nconst options: Array<SelectableValue<ShowContent>> = [\n  {\n    label: 'Panel JSON',\n    description: 'The model saved in the dashboard JSON that configures how everything works.',\n    value: ShowContent.PanelJSON,\n  },\n  {\n    label: 'Data',\n    description: 'The raw model passed to the panel visualization',\n    value: ShowContent.DataJSON,\n  },\n  {\n    label: 'DataFrame structure',\n    description: 'Response info without any values',\n    value: ShowContent.DataStructure,\n  },\n];\n\ninterface Props {\n  onClose: () => void;\n  dashboard?: DashboardModel;\n  panel?: PanelModel;\n  data?: PanelData;\n}\n\ninterface State {\n  show: ShowContent;\n  text: string;\n}\n\nexport class InspectJSONTab extends PureComponent<Props, State> {\n  hasPanelJSON: boolean;\n\n  constructor(props: Props) {\n    super(props);\n    this.hasPanelJSON = !!(props.panel && props.dashboard);\n    // If we are in panel, we want to show PanelJSON, otherwise show DataJSON\n    this.state = {\n      show: this.hasPanelJSON ? ShowContent.PanelJSON : ShowContent.DataJSON,\n      text: this.hasPanelJSON ? getPrettyJSON(props.panel!.getSaveModel()) : getPrettyJSON(props.data),\n    };\n  }\n\n  onSelectChanged = (item: SelectableValue<ShowContent>) => {\n    const show = this.getJSONObject(item.value!);\n    const text = getPrettyJSON(show);\n    this.setState({ text, show: item.value! });\n  };\n\n  // Called onBlur\n  onTextChanged = (text: string) => {\n    this.setState({ text });\n  };\n\n  getJSONObject(show: ShowContent) {\n    const { data, panel } = this.props;\n    if (show === ShowContent.DataJSON) {\n      return data;\n    }\n\n    if (show === ShowContent.DataStructure) {\n      const series = data?.series;\n      if (!series) {\n        return { note: 'Missing Response Data' };\n      }\n      return data!.series.map((frame) => {\n        const { table, fields, ...rest } = frame as any; // remove 'table' from arrow response\n        return {\n          ...rest,\n          fields: frame.fields.map((field) => {\n            return chain(field).omit('values').omit('state').omit('display').value();\n          }),\n        };\n      });\n    }\n\n    if (this.hasPanelJSON && show === ShowContent.PanelJSON) {\n      return panel!.getSaveModel();\n    }\n\n    return { note: `Unknown Object: ${show}` };\n  }\n\n  onApplyPanelModel = () => {\n    const { panel, dashboard, onClose } = this.props;\n    if (this.hasPanelJSON) {\n      try {\n        if (!dashboard!.meta.canEdit) {\n          appEvents.emit(AppEvents.alertError, ['Unable to apply']);\n        } else {\n          const updates = JSON.parse(this.state.text);\n          dashboard!.shouldUpdateDashboardPanelFromJSON(updates, panel!);\n          panel!.restoreModel(updates);\n          panel!.refresh();\n          appEvents.emit(AppEvents.alertSuccess, ['Panel model updated']);\n        }\n      } catch (err) {\n        console.error('Error applying updates', err);\n        appEvents.emit(AppEvents.alertError, ['Invalid JSON text']);\n      }\n\n      onClose();\n    }\n  };\n\n  render() {\n    const { dashboard } = this.props;\n    const { show, text } = this.state;\n    const jsonOptions = this.hasPanelJSON ? options : options.slice(1, options.length);\n    const selected = options.find((v) => v.value === show);\n    const isPanelJSON = show === ShowContent.PanelJSON;\n    const canEdit = dashboard && dashboard.meta.canEdit;\n    const styles = getPanelInspectorStyles();\n\n    return (\n      <>\n        <div className={styles.toolbar} aria-label={selectors.components.PanelInspector.Json.content}>\n          <Field label=\"Select source\" className=\"flex-grow-1\">\n            <Select\n              inputId=\"select-source-dropdown\"\n              options={jsonOptions}\n              value={selected}\n              onChange={this.onSelectChanged}\n              menuShouldPortal\n            />\n          </Field>\n          {this.hasPanelJSON && isPanelJSON && canEdit && (\n            <Button className={styles.toolbarItem} onClick={this.onApplyPanelModel}>\n              Apply\n            </Button>\n          )}\n        </div>\n        <div className={styles.content}>\n          <AutoSizer disableWidth>\n            {({ height }) => (\n              <CodeEditor\n                width=\"100%\"\n                height={height}\n                language=\"json\"\n                showLineNumbers={true}\n                showMiniMap={(text && text.length) > 100}\n                value={text || ''}\n                readOnly={!isPanelJSON}\n                onBlur={this.onTextChanged}\n              />\n            )}\n          </AutoSizer>\n        </div>\n      </>\n    );\n  }\n}\n\nfunction getPrettyJSON(obj: any): string {\n  return JSON.stringify(obj, null, 2);\n}\n","import React from 'react';\nimport {\n  FieldType,\n  formattedValueToString,\n  getDisplayProcessor,\n  GrafanaTheme2,\n  QueryResultMetaStat,\n  TimeZone,\n} from '@grafana/data';\nimport { stylesFactory, useTheme2 } from '@grafana/ui';\nimport { css } from '@emotion/css';\n\ninterface InspectStatsTableProps {\n  timeZone: TimeZone;\n  name: string;\n  stats: QueryResultMetaStat[];\n}\n\nexport const InspectStatsTable: React.FC<InspectStatsTableProps> = ({ timeZone, name, stats }) => {\n  const theme = useTheme2();\n  const styles = getStyles(theme);\n\n  if (!stats || !stats.length) {\n    return null;\n  }\n\n  return (\n    <div className={styles.wrapper}>\n      <div className=\"section-heading\">{name}</div>\n      <table className=\"filter-table width-30\">\n        <tbody>\n          {stats.map((stat, index) => {\n            return (\n              <tr key={`${stat.displayName}-${index}`}>\n                <td>{stat.displayName}</td>\n                <td className={styles.cell}>{formatStat(stat, timeZone, theme)}</td>\n              </tr>\n            );\n          })}\n        </tbody>\n      </table>\n    </div>\n  );\n};\n\nfunction formatStat(stat: QueryResultMetaStat, timeZone: TimeZone, theme: GrafanaTheme2): string {\n  const display = getDisplayProcessor({\n    field: {\n      type: FieldType.number,\n      config: stat,\n    },\n    theme,\n    timeZone,\n  });\n  return formattedValueToString(display(stat.value));\n}\n\nconst getStyles = stylesFactory((theme: GrafanaTheme2) => {\n  return {\n    wrapper: css`\n      padding-bottom: ${theme.spacing(2)};\n    `,\n    cell: css`\n      text-align: right;\n    `,\n  };\n});\n","import { PanelData, QueryResultMetaStat, TimeZone } from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { InspectStatsTable } from './InspectStatsTable';\nimport React from 'react';\n\ninterface InspectStatsTabProps {\n  data: PanelData;\n  timeZone: TimeZone;\n}\n\nexport const InspectStatsTab: React.FC<InspectStatsTabProps> = ({ data, timeZone }) => {\n  if (!data.request) {\n    return null;\n  }\n\n  let stats: QueryResultMetaStat[] = [];\n\n  const requestTime = data.request.endTime ? data.request.endTime - data.request.startTime : -1;\n  const processingTime = data.timings?.dataProcessingTime || -1;\n  let dataRows = 0;\n\n  for (const frame of data.series) {\n    dataRows += frame.length;\n  }\n\n  if (requestTime > 0) {\n    stats.push({ displayName: 'Total request time', value: requestTime, unit: 'ms' });\n  }\n  if (processingTime > 0) {\n    stats.push({ displayName: 'Data processing time', value: processingTime, unit: 'ms' });\n  }\n  stats.push({ displayName: 'Number of queries', value: data.request.targets.length });\n  stats.push({ displayName: 'Total number rows', value: dataRows });\n\n  let dataStats: QueryResultMetaStat[] = [];\n\n  for (const series of data.series) {\n    if (series.meta && series.meta.stats) {\n      dataStats = dataStats.concat(series.meta.stats);\n    }\n  }\n\n  return (\n    <div aria-label={selectors.components.PanelInspector.Stats.content}>\n      <InspectStatsTable timeZone={timeZone} name={'Stats'} stats={stats} />\n      <InspectStatsTable timeZone={timeZone} name={'Data source stats'} stats={dataStats} />\n    </div>\n  );\n};\n","import React, { PureComponent } from 'react';\nimport { Button, JSONFormatter, LoadingPlaceholder } from '@grafana/ui';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { AppEvents, DataFrame } from '@grafana/data';\n\nimport appEvents from 'app/core/app_events';\nimport { CopyToClipboard } from 'app/core/components/CopyToClipboard/CopyToClipboard';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { getPanelInspectorStyles } from './styles';\nimport { supportsDataQuery } from 'app/features/dashboard/components/PanelEditor/utils';\nimport { config, RefreshEvent } from '@grafana/runtime';\nimport { css } from '@emotion/css';\nimport { Subscription } from 'rxjs';\nimport { backendSrv } from 'app/core/services/backend_srv';\n\ninterface DsQuery {\n  isLoading: boolean;\n  response: {};\n}\n\ninterface ExecutedQueryInfo {\n  refId: string;\n  query: string;\n  frames: number;\n  rows: number;\n}\n\ninterface Props {\n  data: DataFrame[];\n  onRefreshQuery: () => void;\n  panel?: PanelModel;\n}\n\ninterface State {\n  allNodesExpanded: boolean | null;\n  isMocking: boolean;\n  mockedResponse: string;\n  dsQuery: DsQuery;\n  executedQueries: ExecutedQueryInfo[];\n}\n\nexport class QueryInspector extends PureComponent<Props, State> {\n  private formattedJson: any;\n  private subs = new Subscription();\n\n  constructor(props: Props) {\n    super(props);\n    this.state = {\n      executedQueries: [],\n      allNodesExpanded: null,\n      isMocking: false,\n      mockedResponse: '',\n      dsQuery: {\n        isLoading: false,\n        response: {},\n      },\n    };\n  }\n\n  componentDidMount() {\n    const { panel } = this.props;\n\n    this.subs.add(\n      backendSrv.getInspectorStream().subscribe({\n        next: (response) => this.onDataSourceResponse(response),\n      })\n    );\n\n    if (panel) {\n      this.subs.add(panel.events.subscribe(RefreshEvent, this.onPanelRefresh));\n      this.updateQueryList();\n    }\n  }\n\n  componentDidUpdate(oldProps: Props) {\n    if (this.props.data !== oldProps.data) {\n      this.updateQueryList();\n    }\n  }\n\n  /**\n   * Find the list of executed queries\n   */\n  updateQueryList() {\n    const { data } = this.props;\n    const executedQueries: ExecutedQueryInfo[] = [];\n\n    if (data?.length) {\n      let last: ExecutedQueryInfo | undefined = undefined;\n\n      data.forEach((frame, idx) => {\n        const query = frame.meta?.executedQueryString;\n\n        if (query) {\n          const refId = frame.refId || '?';\n\n          if (last?.refId === refId) {\n            last.frames++;\n            last.rows += frame.length;\n          } else {\n            last = {\n              refId,\n              frames: 0,\n              rows: frame.length,\n              query,\n            };\n            executedQueries.push(last);\n          }\n        }\n      });\n    }\n\n    this.setState({ executedQueries });\n  }\n\n  componentWillUnmount() {\n    this.subs.unsubscribe();\n  }\n\n  onPanelRefresh = () => {\n    this.setState((prevState) => ({\n      ...prevState,\n      dsQuery: {\n        isLoading: true,\n        response: {},\n      },\n    }));\n  };\n\n  onDataSourceResponse(response: any) {\n    // ignore silent requests\n    if (response.config?.hideFromInspector) {\n      return;\n    }\n\n    response = { ...response }; // clone - dont modify the response\n\n    if (response.headers) {\n      delete response.headers;\n    }\n\n    if (response.config) {\n      response.request = response.config;\n\n      delete response.config;\n      delete response.request.transformRequest;\n      delete response.request.transformResponse;\n      delete response.request.paramSerializer;\n      delete response.request.jsonpCallbackParam;\n      delete response.request.headers;\n      delete response.request.requestId;\n      delete response.request.inspect;\n      delete response.request.retry;\n      delete response.request.timeout;\n    }\n\n    if (response.data) {\n      response.response = response.data;\n\n      delete response.config;\n      delete response.data;\n      delete response.status;\n      delete response.statusText;\n      delete response.ok;\n      delete response.url;\n      delete response.redirected;\n      delete response.type;\n      delete response.$$config;\n    }\n\n    this.setState((prevState) => ({\n      ...prevState,\n      dsQuery: {\n        isLoading: false,\n        response: response,\n      },\n    }));\n  }\n\n  setFormattedJson = (formattedJson: any) => {\n    this.formattedJson = formattedJson;\n  };\n\n  getTextForClipboard = () => {\n    return JSON.stringify(this.formattedJson, null, 2);\n  };\n\n  onClipboardSuccess = () => {\n    appEvents.emit(AppEvents.alertSuccess, ['Content copied to clipboard']);\n  };\n\n  onToggleExpand = () => {\n    this.setState((prevState) => ({\n      ...prevState,\n      allNodesExpanded: !this.state.allNodesExpanded,\n    }));\n  };\n\n  onToggleMocking = () => {\n    this.setState((prevState) => ({\n      ...prevState,\n      isMocking: !this.state.isMocking,\n    }));\n  };\n\n  getNrOfOpenNodes = () => {\n    if (this.state.allNodesExpanded === null) {\n      return 3; // 3 is default, ie when state is null\n    } else if (this.state.allNodesExpanded) {\n      return 20;\n    }\n    return 1;\n  };\n\n  setMockedResponse = (evt: any) => {\n    const mockedResponse = evt.target.value;\n    this.setState((prevState) => ({\n      ...prevState,\n      mockedResponse,\n    }));\n  };\n\n  renderExecutedQueries(executedQueries: ExecutedQueryInfo[]) {\n    if (!executedQueries.length) {\n      return null;\n    }\n\n    const styles = {\n      refId: css`\n        font-weight: ${config.theme.typography.weight.semibold};\n        color: ${config.theme.colors.textBlue};\n        margin-right: 8px;\n      `,\n    };\n\n    return (\n      <div>\n        {executedQueries.map((info) => {\n          return (\n            <div key={info.refId}>\n              <div>\n                <span className={styles.refId}>{info.refId}:</span>\n                {info.frames > 1 && <span>{info.frames} frames, </span>}\n                <span>{info.rows} rows</span>\n              </div>\n              <pre>{info.query}</pre>\n            </div>\n          );\n        })}\n      </div>\n    );\n  }\n\n  render() {\n    const { allNodesExpanded, executedQueries } = this.state;\n    const { panel, onRefreshQuery } = this.props;\n    const { response, isLoading } = this.state.dsQuery;\n    const openNodes = this.getNrOfOpenNodes();\n    const styles = getPanelInspectorStyles();\n    const haveData = Object.keys(response).length > 0;\n\n    if (panel && !supportsDataQuery(panel.plugin)) {\n      return null;\n    }\n\n    return (\n      <>\n        <div aria-label={selectors.components.PanelInspector.Query.content}>\n          <h3 className=\"section-heading\">Query inspector</h3>\n          <p className=\"small muted\">\n            Query inspector allows you to view raw request and response. To collect this data Grafana needs to issue a\n            new query. Click refresh button below to trigger a new query.\n          </p>\n        </div>\n        {this.renderExecutedQueries(executedQueries)}\n        <div className={styles.toolbar}>\n          <Button\n            icon=\"sync\"\n            onClick={onRefreshQuery}\n            aria-label={selectors.components.PanelInspector.Query.refreshButton}\n          >\n            Refresh\n          </Button>\n\n          {haveData && allNodesExpanded && (\n            <Button icon=\"minus\" variant=\"secondary\" className={styles.toolbarItem} onClick={this.onToggleExpand}>\n              Collapse all\n            </Button>\n          )}\n          {haveData && !allNodesExpanded && (\n            <Button icon=\"plus\" variant=\"secondary\" className={styles.toolbarItem} onClick={this.onToggleExpand}>\n              Expand all\n            </Button>\n          )}\n\n          {haveData && (\n            <CopyToClipboard\n              text={this.getTextForClipboard}\n              onSuccess={this.onClipboardSuccess}\n              elType=\"div\"\n              className={styles.toolbarItem}\n            >\n              <Button icon=\"copy\" variant=\"secondary\">\n                Copy to clipboard\n              </Button>\n            </CopyToClipboard>\n          )}\n          <div className=\"flex-grow-1\" />\n        </div>\n        <div className={styles.contentQueryInspector}>\n          {isLoading && <LoadingPlaceholder text=\"Loading query inspector...\" />}\n          {!isLoading && haveData && (\n            <JSONFormatter json={response} open={openNodes} onDidRender={this.setFormattedJson} />\n          )}\n          {!isLoading && !haveData && (\n            <p className=\"muted\">No request and response collected yet. Hit refresh button</p>\n          )}\n        </div>\n      </>\n    );\n  }\n}\n","import { css } from '@emotion/css';\nimport { config } from 'app/core/config';\nimport { stylesFactory } from '@grafana/ui';\n\nexport const getPanelInspectorStyles = stylesFactory(() => {\n  return {\n    wrap: css`\n      display: flex;\n      flex-direction: column;\n      height: 100%;\n      width: 100%;\n      flex: 1 1 0;\n    `,\n    toolbar: css`\n      display: flex;\n      width: 100%;\n      flex-grow: 0;\n      align-items: center;\n      justify-content: flex-end;\n      margin-bottom: ${config.theme.spacing.sm};\n    `,\n    toolbarItem: css`\n      margin-left: ${config.theme.spacing.md};\n    `,\n    content: css`\n      flex-grow: 1;\n      height: 100%;\n      padding-bottom: 16px;\n    `,\n    contentQueryInspector: css`\n      flex-grow: 1;\n      padding: ${config.theme.spacing.md} 0;\n    `,\n    editor: css`\n      font-family: monospace;\n      height: 100%;\n      flex-grow: 1;\n    `,\n    viewer: css`\n      overflow: scroll;\n    `,\n    dataFrameSelect: css`\n      flex-grow: 2;\n    `,\n    tabContent: css`\n      height: 100%;\n      display: flex;\n      flex-direction: column;\n    `,\n    dataTabContent: css`\n      display: flex;\n      flex-direction: column;\n      height: 100%;\n      width: 100%;\n    `,\n    actionsWrapper: css`\n      display: flex;\n    `,\n    leftActions: css`\n      display: flex;\n      flex-grow: 1;\n\n      max-width: 85%;\n      @media (max-width: 1345px) {\n        max-width: 75%;\n      }\n    `,\n    options: css`\n      padding-top: ${config.theme.spacing.sm};\n    `,\n    dataDisplayOptions: css`\n      flex-grow: 1;\n      min-width: 300px;\n      margin-right: ${config.theme.spacing.sm};\n    `,\n    selects: css`\n      display: flex;\n      > * {\n        margin-right: ${config.theme.spacing.sm};\n      }\n    `,\n  };\n});\n","// Libraries\nimport React, { PureComponent } from 'react';\n\n// Types\nimport {\n  CoreApp,\n  DataQuery,\n  DataSourceInstanceSettings,\n  EventBusExtended,\n  HistoryItem,\n  PanelData,\n} from '@grafana/data';\nimport { QueryEditorRow } from './QueryEditorRow';\nimport { DragDropContext, Droppable, DropResult } from 'react-beautiful-dnd';\nimport { getDataSourceSrv } from '@grafana/runtime';\n\ninterface Props {\n  // The query configuration\n  queries: DataQuery[];\n  dsSettings: DataSourceInstanceSettings;\n\n  // Query editing\n  onQueriesChange: (queries: DataQuery[]) => void;\n  onAddQuery: (query: DataQuery) => void;\n  onRunQueries: () => void;\n\n  // Query Response Data\n  data: PanelData;\n\n  // Misc\n  app?: CoreApp;\n  history?: Array<HistoryItem<DataQuery>>;\n  eventBus?: EventBusExtended;\n}\n\nexport class QueryEditorRows extends PureComponent<Props> {\n  onRemoveQuery = (query: DataQuery) => {\n    this.props.onQueriesChange(this.props.queries.filter((item) => item !== query));\n  };\n\n  onChangeQuery(query: DataQuery, index: number) {\n    const { queries, onQueriesChange } = this.props;\n\n    // update query in array\n    onQueriesChange(\n      queries.map((item, itemIndex) => {\n        if (itemIndex === index) {\n          return query;\n        }\n        return item;\n      })\n    );\n  }\n\n  onDataSourceChange(dataSource: DataSourceInstanceSettings, index: number) {\n    const { queries, onQueriesChange } = this.props;\n\n    onQueriesChange(\n      queries.map((item, itemIndex) => {\n        if (itemIndex !== index) {\n          return item;\n        }\n\n        if (item.datasource) {\n          const previous = getDataSourceSrv().getInstanceSettings(item.datasource);\n\n          if (previous?.type === dataSource.type) {\n            return {\n              ...item,\n              datasource: { uid: dataSource.uid },\n            };\n          }\n        }\n\n        return {\n          refId: item.refId,\n          hide: item.hide,\n          datasource: { uid: dataSource.uid },\n        };\n      })\n    );\n  }\n\n  onDragEnd = (result: DropResult) => {\n    const { queries, onQueriesChange } = this.props;\n\n    if (!result || !result.destination) {\n      return;\n    }\n\n    const startIndex = result.source.index;\n    const endIndex = result.destination.index;\n    if (startIndex === endIndex) {\n      return;\n    }\n\n    const update = Array.from(queries);\n    const [removed] = update.splice(startIndex, 1);\n    update.splice(endIndex, 0, removed);\n    onQueriesChange(update);\n  };\n\n  render() {\n    const { dsSettings, data, queries, app, history, eventBus } = this.props;\n\n    return (\n      <DragDropContext onDragEnd={this.onDragEnd}>\n        <Droppable droppableId=\"transformations-list\" direction=\"vertical\">\n          {(provided) => {\n            return (\n              <div ref={provided.innerRef} {...provided.droppableProps}>\n                {queries.map((query, index) => {\n                  const dataSourceSettings = getDataSourceSettings(query, dsSettings);\n                  const onChangeDataSourceSettings = dsSettings.meta.mixed\n                    ? (settings: DataSourceInstanceSettings) => this.onDataSourceChange(settings, index)\n                    : undefined;\n\n                  return (\n                    <QueryEditorRow\n                      id={query.refId}\n                      index={index}\n                      key={query.refId}\n                      data={data}\n                      query={query}\n                      dataSource={dataSourceSettings}\n                      onChangeDataSource={onChangeDataSourceSettings}\n                      onChange={(query) => this.onChangeQuery(query, index)}\n                      onRemoveQuery={this.onRemoveQuery}\n                      onAddQuery={this.props.onAddQuery}\n                      onRunQuery={this.props.onRunQueries}\n                      queries={queries}\n                      app={app}\n                      history={history}\n                      eventBus={eventBus}\n                    />\n                  );\n                })}\n                {provided.placeholder}\n              </div>\n            );\n          }}\n        </Droppable>\n      </DragDropContext>\n    );\n  }\n}\n\nconst getDataSourceSettings = (\n  query: DataQuery,\n  groupSettings: DataSourceInstanceSettings\n): DataSourceInstanceSettings => {\n  if (!query.datasource) {\n    return groupSettings;\n  }\n  const querySettings = getDataSourceSrv().getInstanceSettings(query.datasource);\n  return querySettings || groupSettings;\n};\n","import { identity } from 'lodash';\nimport { ZipkinAnnotation, ZipkinEndpoint, ZipkinSpan } from '../types';\nimport { DataFrame, FieldType, MutableDataFrame, TraceKeyValuePair, TraceLog, TraceSpanRow } from '@grafana/data';\n\n/**\n * Transforms response to Grafana trace data frame.\n */\nexport function transformResponse(zSpans: ZipkinSpan[]): DataFrame {\n  const spanRows = zSpans.map(transformSpan);\n  const frame = new MutableDataFrame({\n    fields: [\n      { name: 'traceID', type: FieldType.string },\n      { name: 'spanID', type: FieldType.string },\n      { name: 'parentSpanID', type: FieldType.string },\n      { name: 'operationName', type: FieldType.string },\n      { name: 'serviceName', type: FieldType.string },\n      { name: 'serviceTags', type: FieldType.other },\n      { name: 'startTime', type: FieldType.number },\n      { name: 'duration', type: FieldType.number },\n      { name: 'logs', type: FieldType.other },\n      { name: 'tags', type: FieldType.other },\n    ],\n    meta: {\n      preferredVisualisationType: 'trace',\n      custom: {\n        traceFormat: 'zipkin',\n      },\n    },\n  });\n\n  for (const span of spanRows) {\n    frame.add(span);\n  }\n\n  return frame;\n}\n\nfunction transformSpan(span: ZipkinSpan): TraceSpanRow {\n  const row = {\n    traceID: span.traceId,\n    spanID: span.id,\n    parentSpanID: span.parentId,\n    operationName: span.name,\n    serviceName: span.localEndpoint?.serviceName || span.remoteEndpoint?.serviceName || 'unknown',\n    serviceTags: serviceTags(span),\n    startTime: span.timestamp / 1000,\n    duration: span.duration / 1000,\n    logs: span.annotations?.map(transformAnnotation) ?? [],\n    tags: Object.keys(span.tags || {}).reduce<TraceKeyValuePair[]>((acc, key) => {\n      // If tag is error we remap it to simple boolean so that the trace ui will show an error icon.\n      if (key === 'error') {\n        acc.push({\n          key: 'error',\n          value: true,\n        });\n\n        acc.push({\n          key: 'errorValue',\n          value: span.tags!['error'],\n        });\n        return acc;\n      }\n      acc.push({ key, value: span.tags![key] });\n      return acc;\n    }, []),\n  };\n\n  if (span.kind) {\n    row.tags = [\n      {\n        key: 'kind',\n        value: span.kind,\n      },\n      ...(row.tags ?? []),\n    ];\n  }\n\n  if (span.shared) {\n    row.tags = [\n      {\n        key: 'shared',\n        value: span.shared,\n      },\n      ...(row.tags ?? []),\n    ];\n  }\n\n  return row;\n}\n\n/**\n * Maps annotations as a log as that seems to be the closest thing.\n * See https://zipkin.io/zipkin-api/#/default/get_trace__traceId_\n */\nfunction transformAnnotation(annotation: ZipkinAnnotation): TraceLog {\n  return {\n    timestamp: annotation.timestamp,\n    fields: [\n      {\n        key: 'annotation',\n        value: annotation.value,\n      },\n    ],\n  };\n}\n\nfunction serviceTags(span: ZipkinSpan): TraceKeyValuePair[] {\n  const endpoint = span.localEndpoint || span.remoteEndpoint;\n  if (!endpoint) {\n    return [];\n  }\n  return [\n    valueToTag('ipv4', endpoint.ipv4),\n    valueToTag('ipv6', endpoint.ipv6),\n    valueToTag('port', endpoint.port),\n    valueToTag('endpointType', span.localEndpoint ? 'local' : 'remote'),\n  ].filter(identity) as TraceKeyValuePair[];\n}\n\nfunction valueToTag<T>(key: string, value: T): TraceKeyValuePair<T> | undefined {\n  if (!value) {\n    return undefined;\n  }\n  return {\n    key,\n    value,\n  };\n}\n\n/**\n * Transforms data frame to Zipkin response\n */\nexport const transformToZipkin = (data: MutableDataFrame): ZipkinSpan[] => {\n  let response: ZipkinSpan[] = [];\n\n  for (let i = 0; i < data.length; i++) {\n    const span = data.get(i);\n    response.push({\n      traceId: span.traceID,\n      parentId: span.parentSpanID,\n      name: span.operationName,\n      id: span.spanID,\n      timestamp: span.startTime * 1000,\n      duration: span.duration * 1000,\n      ...getEndpoint(span),\n      annotations: span.logs.length\n        ? span.logs.map((l: TraceLog) => ({ timestamp: l.timestamp, value: l.fields[0].value }))\n        : undefined,\n      tags: span.tags.length\n        ? span.tags\n            .filter((t: TraceKeyValuePair) => t.key !== 'kind' && t.key !== 'endpointType' && t.key !== 'shared')\n            .reduce((tags: { [key: string]: string }, t: TraceKeyValuePair) => {\n              if (t.key === 'error') {\n                return {\n                  ...tags,\n                  [t.key]: span.tags.find((t: TraceKeyValuePair) => t.key === 'errorValue').value || '',\n                };\n              }\n              return { ...tags, [t.key]: t.value };\n            }, {})\n        : undefined,\n      kind: span.tags.find((t: TraceKeyValuePair) => t.key === 'kind')?.value,\n      shared: span.tags.find((t: TraceKeyValuePair) => t.key === 'shared')?.value,\n    });\n  }\n\n  return response;\n};\n\n// Returns remote or local endpoint object\nconst getEndpoint = (span: any): { [key: string]: ZipkinEndpoint } | undefined => {\n  const key =\n    span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'endpointType')?.value === 'local'\n      ? 'localEndpoint'\n      : 'remoteEndpoint';\n  return span.serviceName !== 'unknown'\n    ? {\n        [key]: {\n          serviceName: span.serviceName,\n          ipv4: span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'ipv4')?.value,\n          ipv6: span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'ipv6')?.value,\n          port: span.serviceTags.find((t: TraceKeyValuePair) => t.key === 'port')?.value,\n        },\n      }\n    : undefined;\n};\n","import { useReducer } from 'react';\nvar toggleReducer = function (state, nextValue) {\n    return typeof nextValue === 'boolean' ? nextValue : !state;\n};\nvar useToggle = function (initialValue) {\n    return useReducer(toggleReducer, initialValue);\n};\nexport default useToggle;\n"],"names":["calculatePanelSize","mode","width","height","panel","DisplayMode","pWidth","window","innerWidth","GRID_CELL_VMARGIN","GRID_COLUMN_COUNT","gridPos","w","pHeight","GRID_CELL_HEIGHT","h","scale","Math","min","supportsDataQuery","plugin","meta","skipDataQuery","updateDefaultFieldConfigValue","config","name","value","isCustom","defaults","remove","custom","omit","setOptionImmutably","options","path","splat","Array","isArray","split","key","shift","endsWith","idx","lastIndexOf","index","substring","length","propKey","substr","current","arr","getStyles","theme","css","spacing","md","typography","size","sm","colors","textWeak","DetailText","children","collapsedTextStyles","useStyles","className","InspectDataOptions","onOptionsChange","data","dataFrames","transformId","transformationOptions","selectedDataFrame","onDataFrameChange","downloadForExcel","toggleDownloadForExcel","styles","getPanelInspectorStyles","panelTransformations","getTransformations","showPanelTransformationsOption","Boolean","showFieldConfigsOption","fieldConfigRegistry","isEmpty","dataSelect","DataTransformerID","selectableOptions","map","frame","label","getFrameDisplayName","dataDisplayOptions","QueryOperationRow","id","title","headerElement","parts","push","withTransforms","withFieldConfig","join","getActiveString","isOpen","VerticalGroup","Field","Select","menuShouldPortal","onChange","HorizontalGroup","description","Switch","InspectDataTab","PureComponent","constructor","props","super","dataFrame","csvConfig","this","state","dataFrameCsv","toCSV","blob","Blob","String","fromCharCode","type","fileName","getDisplayTitle","toLocaleLowerCase","dateTimeFormat","Date","saveAs","logsModel","dataFrameToLogsModel","undefined","textToDownload","forEach","metaItem","string","JSON","stringify","rows","row","newRow","dateTimeFormatISO","timeEpochMs","entry","df","preferredVisualisationType","traceFormat","res","transformToJaeger","MutableDataFrame","saveTraceJson","transformToZipkin","transformToOTLP","json","item","setState","dataFrameIndex","prevState","buildTransformationOptions","transformedData","componentDidUpdate","prevProps","currentTransform","find","transformer","subscription","transformDataFrame","subscribe","unsubscribe","getProcessedData","timeZone","applyFieldOverrides","fieldConfig","replaceVariables","applyRawFieldOverrides","render","isLoading","Spinner","inline","hasLogs","some","hasTraces","dataTabContent","selectors","actionsWrapper","Button","variant","onClick","exportCsv","useExcelHeader","exportLogsAsTxt","exportTracesAsJson","Container","grow","style","Table","showTypeIcons","byField","InspectErrorTab","error","message","JSONFormatter","open","ShowContent","PanelJSON","DataJSON","DataStructure","InspectJSONTab","text","getPrettyJSON","getJSONObject","show","dashboard","onClose","hasPanelJSON","canEdit","updates","parse","shouldUpdateDashboardPanelFromJSON","restoreModel","refresh","appEvents","AppEvents","err","console","getSaveModel","series","rest","fields","field","chain","note","jsonOptions","slice","selected","v","isPanelJSON","toolbar","inputId","onSelectChanged","toolbarItem","onApplyPanelModel","content","disableWidth","CodeEditor","language","showLineNumbers","showMiniMap","readOnly","onBlur","onTextChanged","obj","InspectStatsTable","stats","useTheme2","wrapper","stat","displayName","cell","formatStat","display","getDisplayProcessor","FieldType","formattedValueToString","stylesFactory","InspectStatsTab","request","requestTime","endTime","startTime","processingTime","timings","dataProcessingTime","dataRows","unit","targets","dataStats","concat","QueryInspector","Subscription","dsQuery","response","formattedJson","allNodesExpanded","isMocking","evt","mockedResponse","target","executedQueries","componentDidMount","subs","add","backendSrv","next","onDataSourceResponse","events","RefreshEvent","onPanelRefresh","updateQueryList","oldProps","last","query","executedQueryString","refId","frames","componentWillUnmount","hideFromInspector","headers","transformRequest","transformResponse","paramSerializer","jsonpCallbackParam","requestId","inspect","retry","timeout","status","statusText","ok","url","redirected","$$config","renderExecutedQueries","info","onRefreshQuery","openNodes","getNrOfOpenNodes","haveData","Object","keys","icon","onToggleExpand","getTextForClipboard","onSuccess","onClipboardSuccess","elType","contentQueryInspector","LoadingPlaceholder","onDidRender","setFormattedJson","wrap","editor","viewer","dataFrameSelect","tabContent","leftActions","selects","QueryEditorRows","onQueriesChange","queries","filter","result","destination","startIndex","source","endIndex","update","from","removed","splice","onChangeQuery","itemIndex","onDataSourceChange","dataSource","datasource","previous","getDataSourceSrv","getInstanceSettings","uid","hide","dsSettings","app","history","eventBus","onDragEnd","droppableId","direction","provided","ref","innerRef","droppableProps","dataSourceSettings","getDataSourceSettings","onChangeDataSourceSettings","mixed","settings","onChangeDataSource","onRemoveQuery","onAddQuery","onRunQuery","onRunQueries","placeholder","groupSettings","zSpans","spanRows","transformSpan","span","traceID","traceId","spanID","parentSpanID","parentId","operationName","serviceName","localEndpoint","remoteEndpoint","serviceTags","timestamp","duration","logs","annotations","transformAnnotation","tags","reduce","acc","kind","shared","annotation","endpoint","valueToTag","ipv4","ipv6","port","identity","i","get","getEndpoint","l","t","toggleReducer","nextValue","initialValue","useReducer"],"sourceRoot":""}