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W,MAAhB0P,EAAEq2B,OAAOvxC,GACZ,EAAG,CAEFwL,EADUgmC,KACIG,UACU,MAAhBz2B,EAAEq2B,OAAOvxC,MAAgBA,GAGpCqxC,EAAI,KACJ,MACD,IAAK,IACJrxC,IACAwL,EAASgmC,IACT,MACD,QAEC,IADAC,EAAMzxC,IACCA,EAAIoxC,GAAO,QAAQz7B,KAAKuF,EAAEq2B,OAAOvxC,KACxCA,IACA,IAAI4xC,EAAM12B,EAAEw2B,UAAUD,EAAKzxC,GAC3B,GAAI,SAAS2V,KAAKo7B,GACjBvlC,EAASqmC,WAAWD,QAGpB,QAAsB,KADtBpmC,EAAS2lC,EAASS,IACiB,MAAM,IAAI7sC,MAAM,sBAAwB6sC,GAG9E,OAAOpmC,EAzCD,IA6CRihC,EAAQqF,SAAW,SAAS52B,EAAG62B,GAC9B,IACC,OAAOtF,EAAQjR,MAAMtgB,GACpB,MAAO82B,GACR,OAAOD,IA3IV,CA+IoCtF","sources":["webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/language.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/dynamic-labels/language.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/metric-math/language.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/XrayLinkConfig.tsx","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/TemplateTag/TemplateTag.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/inlineArrayTransformer/inlineArrayTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/stripIndentTransformer/stripIndentTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/trimResultTransformer/trimResultTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/commaLists/commaLists.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/commaListsAnd/commaListsAnd.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/commaListsOr/commaListsOr.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/html/html.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/replaceSubstitutionTransformer/replaceSubstitutionTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/safeHtml/safeHtml.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/replaceResultTransformer/replaceResultTransformer.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/oneLine/oneLine.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/oneLineTrim/oneLineTrim.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/oneLineCommaLists/oneLineCommaLists.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/oneLineCommaListsOr/oneLineCommaListsOr.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/oneLineCommaListsAnd/oneLineCommaListsAnd.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/inlineLists/inlineLists.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/oneLineInlineLists/oneLineInlineLists.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/stripIndent/stripIndent.js","webpack://grafana/../../opt/drone/yarncache/common-tags-npm-1.8.2-2c30ba69b3-767a6255a8.zip/node_modules/common-tags/es/stripIndents/stripIndents.js","webpack://grafana/./public/app/plugins/datasource/cloudwatch/syntax.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/LogsCheatSheet.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/guards.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/utils/utils.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/Dimensions/FilterItem.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/Dimensions/Dimensions.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/Forms.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/aws_url.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/CloudWatchLink.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/utils/query/getStatsGroups.ts","webpack://grafana/./.yarn/__virtual__/react-use-virtual-00326e70ba/3/opt/drone/yarncache/react-use-npm-17.3.2-a032cbeb01-7379460f51.zip/node_modules/react-use/esm/useCustomCompareEffect.js","webpack://grafana/./.yarn/__virtual__/react-use-virtual-00326e70ba/3/opt/drone/yarncache/react-use-npm-17.3.2-a032cbeb01-7379460f51.zip/node_modules/react-use/esm/misc/isDeepEqual.js","webpack://grafana/./.yarn/__virtual__/react-use-virtual-00326e70ba/3/opt/drone/yarncache/react-use-npm-17.3.2-a032cbeb01-7379460f51.zip/node_modules/react-use/esm/useDeepCompareEffect.js","webpack://grafana/./public/app/plugins/datasource/cloudwatch/hooks.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MetricsQueryEditor/MetricsQueryHeader.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/QueryHeader.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/LogsQueryField.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/LogsQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/expressions.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/SQLGenerator.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/utils.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/SQLBuilderSelectRow.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/SQLFilter.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/SQLGroupBy.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/SQLOrderByGroup.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/SQLBuilderEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/metric-math/definition.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/monarch/commands.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/monarch/register.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MathExpressionQueryField.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/definition.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/SQLCodeEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/monarch/LinkedToken.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/monarch/linkedTokenBuilder.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/monarch/types.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/dynamic-labels/definition.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/DynamicLabelsField.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/dynamic-labels/CompletionItemProvider.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MetricsQueryEditor/Alias.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/migrations/metricQueryMigrations.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MetricsQueryEditor/usePreparedMetricsQuery.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MetricsQueryEditor/MetricsQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/PanelQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/annotationSupport.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/monarch/CompletionItemProvider.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/completion/types.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/completion/statementPosition.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/completion/suggestionKind.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/completion/tokenUtils.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/cloudwatch-sql/completion/CompletionItemProvider.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/ThrottlingErrorMessage.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/language_provider.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/memoizedDebounce.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/metric-math/completion/types.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/metric-math/completion/statementPosition.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/metric-math/completion/suggestionKind.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/metric-math/completion/CompletionItemProvider.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/utils/datalinks.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/utils/logsRetry.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/utils/rxjs/increasingInterval.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/migrations/variableQueryMigrations.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/VariableQueryEditor/MultiFilterItem.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/VariableQueryEditor/MultiFilter.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/VariableQueryEditor/VariableQueryField.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/VariableQueryEditor/VariableTextField.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/VariableQueryEditor/VariableQueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/variables.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/datasource.ts","webpack://grafana/./public/app/plugins/datasource/cloudwatch/module.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/ConfigEditor.tsx","webpack://grafana/./public/app/plugins/datasource/cloudwatch/components/MetaInspector.tsx","webpack://grafana/../../opt/drone/yarncache/@grafana-aws-sdk-npm-0.0.36-8ab4b07904-c243f7c900.zip/node_modules/@grafana/aws-sdk/dist/index.production.js","webpack://grafana/../../opt/drone/yarncache/@grafana-aws-sdk-npm-0.0.36-8ab4b07904-c243f7c900.zip/node_modules/@grafana/aws-sdk/index.js","webpack://grafana/../../opt/drone/yarncache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/react.js","webpack://grafana/../../opt/drone/yarncache/jsurl-npm-0.1.5-9e17f93783-50b614908d.zip/node_modules/jsurl/index.js","webpack://grafana/../../opt/drone/yarncache/jsurl-npm-0.1.5-9e17f93783-50b614908d.zip/node_modules/jsurl/lib/jsurl.js"],"sourcesContent":["import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\n\ninterface CloudWatchLanguage extends monacoType.languages.IMonarchLanguage {\n keywords: string[];\n operators: string[];\n builtinFunctions: string[];\n}\n\nexport const SELECT = 'SELECT';\nexport const FROM = 'FROM';\nexport const WHERE = 'WHERE';\nexport const GROUP = 'GROUP';\nexport const ORDER = 'ORDER';\nexport const BY = 'BY';\nexport const DESC = 'DESC';\nexport const ASC = 'ASC';\nexport const LIMIT = 'LIMIT';\nexport const WITH = 'WITH';\nexport const SCHEMA = 'SCHEMA';\n\nexport const KEYWORDS = [SELECT, FROM, WHERE, GROUP, ORDER, BY, DESC, ASC, LIMIT, WITH, SCHEMA];\nexport const STATISTICS = ['AVG', 'COUNT', 'MAX', 'MIN', 'SUM'];\n\nexport const AND = 'AND';\nexport const LOGICAL_OPERATORS = [AND];\n\nexport const EQUALS = '=';\nexport const NOT_EQUALS = '!=';\nexport const COMPARISON_OPERATORS = [EQUALS, NOT_EQUALS];\n\nexport const language: CloudWatchLanguage = {\n defaultToken: '',\n tokenPostfix: '.sql',\n ignoreCase: true,\n brackets: [\n { open: '[', close: ']', token: 'delimiter.square' },\n { open: '(', close: ')', token: 'delimiter.parenthesis' },\n ],\n keywords: KEYWORDS,\n operators: LOGICAL_OPERATORS,\n builtinFunctions: STATISTICS,\n tokenizer: {\n root: [\n [/\\$[a-zA-Z0-9-_]+/, 'variable'],\n { include: '@comments' },\n { include: '@whitespace' },\n { include: '@numbers' },\n { include: '@strings' },\n { include: '@complexIdentifiers' },\n [/[;,.]/, 'delimiter'],\n [/[()]/, '@brackets'],\n [\n /[\\w@#$]+/,\n {\n cases: {\n '@keywords': 'keyword',\n '@operators': 'operator',\n '@builtinFunctions': 'predefined',\n '@default': 'identifier',\n },\n },\n ],\n [/[=!%&+\\-*/|~^]/, 'operator'], // TODO: strip these options\n ],\n whitespace: [[/\\s+/, 'white']],\n comments: [[/--+.*/, 'comment']],\n comment: [\n [/[^*/]+/, 'comment'],\n [/./, 'comment'],\n ],\n numbers: [\n [/0[xX][0-9a-fA-F]*/, 'number'],\n [/[$][+-]*\\d*(\\.\\d*)?/, 'number'],\n [/((\\d+(\\.\\d*)?)|(\\.\\d+))([eE][\\-+]?\\d+)?/, 'number'],\n ],\n strings: [\n [/N'/, { token: 'string', next: '@string' }],\n [/'/, { token: 'string', next: '@string' }],\n [/\"/, { token: 'type', next: '@string_double' }],\n ],\n string: [\n [/[^']+/, 'string'],\n [/''/, 'string'],\n [/'/, { token: 'string', next: '@pop' }],\n ],\n string_double: [\n [/[^\\\\\"]+/, 'type'],\n [/\"/, 'type', '@pop'],\n ],\n complexIdentifiers: [\n [/\\[/, { token: 'identifier.quote', next: '@bracketedIdentifier' }],\n [/\"/, { token: 'identifier.quote', next: '@quotedIdentifier' }],\n ],\n bracketedIdentifier: [\n [/[^\\]]+/, 'identifier'],\n [/]]/, 'identifier'],\n [/]/, { token: 'identifier.quote', next: '@pop' }],\n ],\n quotedIdentifier: [\n [/[^\"]+/, 'identifier'],\n [/\"\"/, 'identifier'],\n [/\"/, { token: 'identifier.quote', next: '@pop' }],\n ],\n },\n};\n\nexport const conf: monacoType.languages.LanguageConfiguration = {\n comments: {\n lineComment: '--',\n blockComment: ['/*', '*/'],\n },\n brackets: [\n ['{', '}'],\n ['[', ']'],\n ['(', ')'],\n ],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n};\n","import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\n\n// Dynamic labels: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html\nexport const DYNAMIC_LABEL_PATTERNS = [\n '${DATAPOINT_COUNT}',\n '${FIRST}',\n '${FIRST_LAST_RANGE}',\n '${FIRST_LAST_TIME_RANGE}',\n '${FIRST_TIME}',\n '${FIRST_TIME_RELATIVE}',\n '${LABEL}',\n '${LAST}',\n '${LAST_TIME}',\n '${LAST_TIME_RELATIVE}',\n '${MAX}',\n '${MAX_TIME}',\n '${MAX_TIME_RELATIVE}',\n '${MIN}',\n '${MIN_MAX_RANGE}',\n '${MIN_MAX_TIME_RANGE}',\n '${MIN_TIME}',\n '${MIN_TIME_RELATIVE}',\n \"${PROP('AccountId')}\",\n \"${PROP('MetricName')}\",\n \"${PROP('Namespace')}\",\n \"${PROP('Period')}\",\n \"${PROP('Region')}\",\n \"${PROP('Stat')}\",\n '${SUM}',\n];\n\nexport const language: monacoType.languages.IMonarchLanguage = {\n id: 'dynamicLabels',\n ignoreCase: false,\n tokenizer: {\n root: [\n { include: '@whitespace' },\n { include: '@builtInFunctions' },\n { include: '@string' },\n [/\\$\\{PROP\\('Dim.[a-zA-Z0-9-_]?.*'\\)\\}+/, 'predefined'], //custom handling for dimension patterns\n ],\n builtInFunctions: [[DYNAMIC_LABEL_PATTERNS.map(escapeRegExp).join('|'), 'predefined']],\n whitespace: [[/\\s+/, 'white']],\n string: [],\n },\n};\n\nexport const conf: monacoType.languages.LanguageConfiguration = {};\n\nfunction escapeRegExp(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n","import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\n\n// Metric Math: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html\nexport const METRIC_MATH_FNS = [\n 'ABS',\n 'ANOMALY_DETECTION_BAND',\n 'AVG',\n 'CEIL',\n 'DATAPOINT_COUNT',\n 'DIFF',\n 'DIFF_TIME',\n 'FILL',\n 'FIRST',\n 'LAST',\n 'FLOOR',\n 'IF',\n 'INSIGHT_RULE_METRIC',\n 'LOG',\n 'LOG10',\n 'MAX',\n 'METRIC_COUNT',\n 'METRICS',\n 'MIN',\n 'MINUTE',\n 'HOUR',\n 'DAY',\n 'DATE',\n 'MONTH',\n 'YEAR',\n 'EPOCH',\n 'PERIOD',\n 'RATE',\n 'REMOVE_EMPTY',\n 'RUNNING_SUM',\n 'SEARCH',\n 'SERVICE_QUOTA',\n 'SLICE',\n 'SORT',\n 'STDDEV',\n 'SUM',\n 'TIME_SERIES',\n];\n\nexport const METRIC_MATH_STATISTIC_KEYWORD_STRINGS = ['Average', 'Maximum', 'Minimum', 'Sum', 'SampleCount']; // second arguments to SEARCH function\n\nexport const METRIC_MATH_KEYWORDS = ['REPEAT', 'LINEAR', 'ASC', 'DSC']; // standalone magic arguments to functions\n\nexport const METRIC_MATH_OPERATORS = [\n '+',\n '-',\n '*',\n '/',\n '^',\n '==',\n '!=',\n '<=',\n '>=',\n '<',\n '>',\n 'AND',\n '&&',\n 'OR',\n '||',\n];\n\nexport const METRIC_MATH_PERIODS = [10, 60, 300, 900, 3000, 21600, 86400];\n\nexport const language: monacoType.languages.IMonarchLanguage = {\n id: 'metricMath',\n ignoreCase: false,\n brackets: [\n { open: '[', close: ']', token: 'delimiter.square' },\n { open: '(', close: ')', token: 'delimiter.parenthesis' },\n { open: '{', close: '}', token: 'delimiter.curly' },\n ],\n tokenizer: {\n root: [{ include: '@nonNestableStates' }, { include: '@strings' }],\n nonNestableStates: [\n { include: '@variables' },\n { include: '@whitespace' },\n { include: '@numbers' },\n { include: '@assignment' },\n { include: '@keywords' },\n { include: '@operators' },\n { include: '@builtInFunctions' },\n [/[;,.]/, 'delimiter'],\n [/[(){}\\[\\]]/, '@brackets'], // [], (), {} are all brackets\n ],\n keywords: [[METRIC_MATH_KEYWORDS.map(escapeRegExp).join('|'), 'keyword']],\n operators: [[METRIC_MATH_OPERATORS.map(escapeRegExp).join('|'), 'operator']],\n builtInFunctions: [[METRIC_MATH_FNS.map(escapeRegExp).join('|'), 'predefined']],\n variables: [\n [/\\$[a-zA-Z0-9-_]+/, 'variable'], // $ followed by any letter/number we assume could be grafana template variable\n ],\n whitespace: [[/\\s+/, 'white']],\n assignment: [[/=/, 'tag']],\n numbers: [\n [/0[xX][0-9a-fA-F]*/, 'number'],\n [/[$][+-]*\\d*(\\.\\d*)?/, 'number'],\n [/((\\d+(\\.\\d*)?)|(\\.\\d+))([eE][\\-+]?\\d+)?/, 'number'],\n ],\n // states that start other states (aka nested states):\n strings: [\n [/'/, { token: 'string', next: '@string' }],\n [/\"/, { token: 'type', next: '@string_double' }],\n ],\n string: [\n [/{/, { token: 'delimiter.curly', next: '@nestedCurly' }], // escape out of string and into nestedCurly\n [/\\(/, { token: 'delimiter.parenthesis', next: '@nestedParens' }], // escape out of string and into nestedCurly\n [/\"/, { token: 'type', next: '@string_double' }], // jump into double string\n [/'/, { token: 'string', next: '@pop' }], // stop being a string\n { include: '@nonNestableStates' },\n [/[^']/, 'string'], // anything that is not a quote, is marked as string\n ],\n string_double: [\n [/[^\"]/, 'type'], // mark anything not a quote as a \"type\" (different type of string for visual difference)\n [/\"/, { token: 'type', next: '@pop' }], // mark also as a type and stop being in the double string state\n ],\n nestedCurly: [\n [/}/, { token: 'delimiter.curly', next: '@pop' }], // escape out of string and into braces\n [/'/, { token: 'string', next: '@string' }], // go to string if see start of string\n [/\"/, { token: 'type', next: '@string_double' }], // go to string_double if see start of double string\n ],\n nestedParens: [\n [/\\)/, { token: 'delimiter.parenthesis', next: '@pop' }], // escape out of string and into braces\n [/'/, { token: 'string', next: '@string' }], // go to string if see start of string\n [/\"/, { token: 'type', next: '@string_double' }], // go to string_double if see start of double string\n ],\n },\n};\n\nexport const conf: monacoType.languages.LanguageConfiguration = {\n brackets: [\n ['{', '}'],\n ['[', ']'],\n ['(', ')'],\n ],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n};\n\nfunction escapeRegExp(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { DataSourcePicker } from '@grafana/runtime';\nimport { Alert, InlineField, useStyles2 } from '@grafana/ui';\nimport { getDatasourceSrv } from 'app/features/plugins/datasource_srv';\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n infoText: css`\n padding-bottom: ${theme.spacing(2)};\n color: ${theme.colors.text.secondary};\n `,\n});\n\ninterface Props {\n datasourceUid?: string;\n onChange: (uid: string) => void;\n}\n\nconst xRayDsId = 'grafana-x-ray-datasource';\n\nexport function XrayLinkConfig({ datasourceUid, onChange }: Props) {\n const hasXrayDatasource = Boolean(getDatasourceSrv().getList({ pluginId: xRayDsId }).length);\n\n const styles = useStyles2(getStyles);\n\n return (\n <>\n <h3 className=\"page-heading\">X-ray trace link</h3>\n\n <div className={styles.infoText}>\n Grafana will automatically create a link to a trace in X-ray data source if logs contain @xrayTraceId field\n </div>\n\n {!hasXrayDatasource && (\n <Alert\n title={\n 'There is no X-ray datasource to link to. First add an X-ray data source and then link it to Cloud Watch. '\n }\n severity=\"info\"\n />\n )}\n\n <div className=\"gf-form-group\">\n <InlineField\n htmlFor=\"data-source-picker\"\n label=\"Data source\"\n labelWidth={28}\n tooltip=\"X-ray data source containing traces\"\n >\n <DataSourcePicker\n pluginId={xRayDsId}\n onChange={(ds) => onChange(ds.uid)}\n current={datasourceUid}\n noDefault={true}\n />\n </InlineField>\n </div>\n </>\n );\n}\n","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _templateObject = _taggedTemplateLiteral(['', ''], ['', '']);\n\nfunction _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class TemplateTag\n * @classdesc Consumes a pipeline of composable transformer plugins and produces a template tag.\n */\nvar TemplateTag = function () {\n /**\n * constructs a template tag\n * @constructs TemplateTag\n * @param {...Object} [...transformers] - an array or arguments list of transformers\n * @return {Function} - a template tag\n */\n function TemplateTag() {\n var _this = this;\n\n for (var _len = arguments.length, transformers = Array(_len), _key = 0; _key < _len; _key++) {\n transformers[_key] = arguments[_key];\n }\n\n _classCallCheck(this, TemplateTag);\n\n this.tag = function (strings) {\n for (var _len2 = arguments.length, expressions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n expressions[_key2 - 1] = arguments[_key2];\n }\n\n if (typeof strings === 'function') {\n // if the first argument passed is a function, assume it is a template tag and return\n // an intermediary tag that processes the template using the aforementioned tag, passing the\n // result to our tag\n return _this.interimTag.bind(_this, strings);\n }\n\n if (typeof strings === 'string') {\n // if the first argument passed is a string, just transform it\n return _this.transformEndResult(strings);\n }\n\n // else, return a transformed end result of processing the template with our tag\n strings = strings.map(_this.transformString.bind(_this));\n return _this.transformEndResult(strings.reduce(_this.processSubstitutions.bind(_this, expressions)));\n };\n\n // if first argument is an array, extrude it as a list of transformers\n if (transformers.length > 0 && Array.isArray(transformers[0])) {\n transformers = transformers[0];\n }\n\n // if any transformers are functions, this means they are not initiated - automatically initiate them\n this.transformers = transformers.map(function (transformer) {\n return typeof transformer === 'function' ? transformer() : transformer;\n });\n\n // return an ES2015 template tag\n return this.tag;\n }\n\n /**\n * Applies all transformers to a template literal tagged with this method.\n * If a function is passed as the first argument, assumes the function is a template tag\n * and applies it to the template, returning a template tag.\n * @param {(Function|String|Array<String>)} strings - Either a template tag or an array containing template strings separated by identifier\n * @param {...*} ...expressions - Optional list of substitution values.\n * @return {(String|Function)} - Either an intermediary tag function or the results of processing the template.\n */\n\n\n _createClass(TemplateTag, [{\n key: 'interimTag',\n\n\n /**\n * An intermediary template tag that receives a template tag and passes the result of calling the template with the received\n * template tag to our own template tag.\n * @param {Function} nextTag - the received template tag\n * @param {Array<String>} template - the template to process\n * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template\n * @return {*} - the final processed value\n */\n value: function interimTag(previousTag, template) {\n for (var _len3 = arguments.length, substitutions = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n substitutions[_key3 - 2] = arguments[_key3];\n }\n\n return this.tag(_templateObject, previousTag.apply(undefined, [template].concat(substitutions)));\n }\n\n /**\n * Performs bulk processing on the tagged template, transforming each substitution and then\n * concatenating the resulting values into a string.\n * @param {Array<*>} substitutions - an array of all remaining substitutions present in this template\n * @param {String} resultSoFar - this iteration's result string so far\n * @param {String} remainingPart - the template chunk after the current substitution\n * @return {String} - the result of joining this iteration's processed substitution with the result\n */\n\n }, {\n key: 'processSubstitutions',\n value: function processSubstitutions(substitutions, resultSoFar, remainingPart) {\n var substitution = this.transformSubstitution(substitutions.shift(), resultSoFar);\n return ''.concat(resultSoFar, substitution, remainingPart);\n }\n\n /**\n * Iterate through each transformer, applying the transformer's `onString` method to the template\n * strings before all substitutions are processed.\n * @param {String} str - The input string\n * @return {String} - The final results of processing each transformer\n */\n\n }, {\n key: 'transformString',\n value: function transformString(str) {\n var cb = function cb(res, transform) {\n return transform.onString ? transform.onString(res) : res;\n };\n return this.transformers.reduce(cb, str);\n }\n\n /**\n * When a substitution is encountered, iterates through each transformer and applies the transformer's\n * `onSubstitution` method to the substitution.\n * @param {*} substitution - The current substitution\n * @param {String} resultSoFar - The result up to and excluding this substitution.\n * @return {*} - The final result of applying all substitution transformations.\n */\n\n }, {\n key: 'transformSubstitution',\n value: function transformSubstitution(substitution, resultSoFar) {\n var cb = function cb(res, transform) {\n return transform.onSubstitution ? transform.onSubstitution(res, resultSoFar) : res;\n };\n return this.transformers.reduce(cb, substitution);\n }\n\n /**\n * Iterates through each transformer, applying the transformer's `onEndResult` method to the\n * template literal after all substitutions have finished processing.\n * @param {String} endResult - The processed template, just before it is returned from the tag\n * @return {String} - The final results of processing each transformer\n */\n\n }, {\n key: 'transformEndResult',\n value: function transformEndResult(endResult) {\n var cb = function cb(res, transform) {\n return transform.onEndResult ? transform.onEndResult(res) : res;\n };\n return this.transformers.reduce(cb, endResult);\n }\n }]);\n\n return TemplateTag;\n}();\n\nexport default TemplateTag;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9UZW1wbGF0ZVRhZy9UZW1wbGF0ZVRhZy5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInRyYW5zZm9ybWVycyIsInRhZyIsInN0cmluZ3MiLCJleHByZXNzaW9ucyIsImludGVyaW1UYWciLCJiaW5kIiwidHJhbnNmb3JtRW5kUmVzdWx0IiwibWFwIiwidHJhbnNmb3JtU3RyaW5nIiwicmVkdWNlIiwicHJvY2Vzc1N1YnN0aXR1dGlvbnMiLCJsZW5ndGgiLCJBcnJheSIsImlzQXJyYXkiLCJ0cmFuc2Zvcm1lciIsInByZXZpb3VzVGFnIiwidG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Nmb3JtZXJzLnJlZHVjZShjYiwgc3Vic3RpdHV0aW9uKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBJdGVyYXRlcyB0aHJvdWdoIGVhY2ggdHJhbnNmb3JtZXIsIGFwcGx5aW5nIHRoZSB0cmFuc2Zvcm1lcidzIGBvbkVuZFJlc3VsdGAgbWV0aG9kIHRvIHRoZVxuICAgKiB0ZW1wbGF0ZSBsaXRlcmFsIGFmdGVyIGFsbCBzdWJzdGl0dXRpb25zIGhhdmUgZmluaXNoZWQgcHJvY2Vzc2luZy5cbiAgICogQHBhcmFtICB7U3RyaW5nfSBlbmRSZXN1bHQgLSBUaGUgcHJvY2Vzc2VkIHRlbXBsYXRlLCBqdXN0IGJlZm9yZSBpdCBpcyByZXR1cm5lZCBmcm9tIHRoZSB0YWdcbiAgICogQHJldHVybiB7U3RyaW5nfSAgICAgICAgICAgLSBUaGUgZmluYWwgcmVzdWx0cyBvZiBwcm9jZXNzaW5nIGVhY2ggdHJhbnNmb3JtZXJcbiAgICovXG4gIHRyYW5zZm9ybUVuZFJlc3VsdChlbmRSZXN1bHQpIHtcbiAgICBjb25zdCBjYiA9IChyZXMsIHRyYW5zZm9ybSkgPT5cbiAgICAgIHRyYW5zZm9ybS5vbkVuZFJlc3VsdCA/IHRyYW5zZm9ybS5vbkVuZFJlc3VsdChyZXMpIDogcmVzO1xuICAgIHJldHVybiB0aGlzLnRyYW5zZm9ybWVycy5yZWR1Y2UoY2IsIGVuZFJlc3VsdCk7XG4gIH1cbn1cbiJdfQ==","var defaults = {\n separator: '',\n conjunction: '',\n serial: false\n};\n\n/**\n * Converts an array substitution to a string containing a list\n * @param {String} [opts.separator = ''] - the character that separates each item\n * @param {String} [opts.conjunction = ''] - replace the last separator with this\n * @param {Boolean} [opts.serial = false] - include the separator before the conjunction? (Oxford comma use-case)\n *\n * @return {Object} - a TemplateTag transformer\n */\nvar inlineArrayTransformer = function inlineArrayTransformer() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults;\n return {\n onSubstitution: function onSubstitution(substitution, resultSoFar) {\n // only operate on arrays\n if (Array.isArray(substitution)) {\n var arrayLength = substitution.length;\n var separator = opts.separator;\n var conjunction = opts.conjunction;\n var serial = opts.serial;\n // join each item in the array into a string where each item is separated by separator\n // be sure to maintain indentation\n var indent = resultSoFar.match(/(\\n?[^\\S\\n]+)$/);\n if (indent) {\n substitution = substitution.join(separator + indent[1]);\n } else {\n substitution = substitution.join(separator + ' ');\n }\n // if conjunction is set, replace the last separator with conjunction, but only if there is more than one substitution\n if (conjunction && arrayLength > 1) {\n var separatorIndex = substitution.lastIndexOf(separator);\n substitution = substitution.slice(0, separatorIndex) + (serial ? separator : '') + ' ' + conjunction + substitution.slice(separatorIndex + 1);\n }\n }\n return substitution;\n }\n };\n};\n\nexport default inlineArrayTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVBcnJheVRyYW5zZm9ybWVyL2lubGluZUFycmF5VHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsiZGVmYXVsdHMiLCJzZXBhcmF0b3IiLCJjb25qdW5jdGlvbiIsInNlcmlhbCIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJvcHRzIiwib25TdWJzdGl0dXRpb24iLCJzdWJzdGl0dXRpb24iLCJyZXN1bHRTb0ZhciIsIkFycmF5IiwiaXNBcnJheSIsImFycmF5TGVuZ3RoIiwibGVuZ3RoIiwiaW5kZW50IiwibWF0Y2giLCJqb2luIiwic2VwYXJhdG9ySW5kZXgiLCJsYXN0SW5kZXhPZiIsInNsaWNlIl0sIm1hcHBpbmdzIjoiQUFBQSxJQUFNQSxXQUFXO0FBQ2ZDLGFBQVcsRUFESTtBQUVmQyxlQUFhLEVBRkU7QUFHZkMsVUFBUTtBQUhPLENBQWpCOztBQU1BOzs7Ozs7OztBQVFBLElBQU1DLHlCQUF5QixTQUF6Q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yArXG4gICAgICAgICAgY29uanVuY3Rpb24gK1xuICAgICAgICAgIHN1YnN0aXR1dGlvbi5zbGljZShzZXBhcmF0b3JJbmRleCArIDEpO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc3Vic3RpdHV0aW9uO1xuICB9LFxufSk7XG5cbmV4cG9ydCBkZWZhdWx0IGlubGluZUFycmF5VHJhbnNmb3JtZXI7XG4iXX0=","function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/**\n * strips indentation from a template literal\n * @param {String} type = 'initial' - whether to remove all indentation or just leading indentation. can be 'all' or 'initial'\n * @return {Object} - a TemplateTag transformer\n */\nvar stripIndentTransformer = function stripIndentTransformer() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial';\n return {\n onEndResult: function onEndResult(endResult) {\n if (type === 'initial') {\n // remove the shortest leading indentation from each line\n var match = endResult.match(/^[^\\S\\n]*(?=\\S)/gm);\n var indent = match && Math.min.apply(Math, _toConsumableArray(match.map(function (el) {\n return el.length;\n })));\n if (indent) {\n var regexp = new RegExp('^.{' + indent + '}', 'gm');\n return endResult.replace(regexp, '');\n }\n return endResult;\n }\n if (type === 'all') {\n // remove all indentation from each line\n return endResult.replace(/^[^\\S\\n]+/gm, '');\n }\n throw new Error('Unknown type: ' + type);\n }\n };\n};\n\nexport default stripIndentTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudFRyYW5zZm9ybWVyL3N0cmlwSW5kZW50VHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsic3RyaXBJbmRlbnRUcmFuc2Zvcm1lciIsInR5cGUiLCJvbkVuZFJlc3VsdCIsImVuZFJlc3VsdCIsIm1hdGNoIiwiaW5kZW50IiwiTWF0aCIsIm1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XG5dKy9nbSwgJycpO1xuICAgIH1cbiAgICB0aHJvdyBuZXcgRXJyb3IoYFVua25vd24gdHlwZTogJHt0eXBlfWApO1xuICB9LFxufSk7XG5cbmV4cG9ydCBkZWZhdWx0IHN0cmlwSW5kZW50VHJhbnNmb3JtZXI7XG4iXX0=","/**\n * TemplateTag transformer that trims whitespace on the end result of a tagged template\n * @param {String} side = '' - The side of the string to trim. Can be 'start' or 'end' (alternatively 'left' or 'right')\n * @return {Object} - a TemplateTag transformer\n */\nvar trimResultTransformer = function trimResultTransformer() {\n var side = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n return {\n onEndResult: function onEndResult(endResult) {\n if (side === '') {\n return endResult.trim();\n }\n\n side = side.toLowerCase();\n\n if (side === 'start' || side === 'left') {\n return endResult.replace(/^\\s*/, '');\n }\n\n if (side === 'end' || side === 'right') {\n return endResult.replace(/\\s*$/, '');\n }\n\n throw new Error('Side not supported: ' + side);\n }\n };\n};\n\nexport default trimResultTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90cmltUmVzdWx0VHJhbnNmb3JtZXIvdHJpbVJlc3VsdFRyYW5zZm9ybWVyLmpzIl0sIm5hbWVzIjpbInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInNpZGUiLCJvbkVuZFJlc3VsdCIsImVuZFJlc3VsdCIsInRyaW0iLCJ0b0xvd2VyQ2FzZSIsInJlcGxhY2UiLCJFcnJvciJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0EsSUFBTUEsd0JBQXdCLFNBQXhCQSxxQkFBd0I7QUFBQSxNQUFDQyxJQUFELHVFQUFRLEVBQVI7QUFBQSxTQUFnQjtBQUM1Q0MsZUFENEMsdUJBQ2hDQyxTQURnQyxFQUNyQjtBQUNyQixVQUFJRixTQUFTLEVBQWIsRUFBaUI7QUFDZixlQUFPRSxVQUFVQyxJQUFWLEVB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ICAgfVxuXG4gICAgc2lkZSA9IHNpZGUudG9Mb3dlckNhc2UoKTtcblxuICAgIGlmIChzaWRlID09PSAnc3RhcnQnIHx8IHNpZGUgPT09ICdsZWZ0Jykge1xuICAgICAgcmV0dXJuIGVuZFJlc3VsdC5yZXBsYWNlKC9eXFxzKi8sICcnKTtcbiAgICB9XG5cbiAgICBpZiAoc2lkZSA9PT0gJ2VuZCcgfHwgc2lkZSA9PT0gJ3JpZ2h0Jykge1xuICAgICAgcmV0dXJuIGVuZFJlc3VsdC5yZXBsYWNlKC9cXHMqJC8sICcnKTtcbiAgICB9XG5cbiAgICB0aHJvdyBuZXcgRXJyb3IoYFNpZGUgbm90IHN1cHBvcnRlZDogJHtzaWRlfWApO1xuICB9LFxufSk7XG5cbmV4cG9ydCBkZWZhdWx0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lcjtcbiJdfQ==","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\n\nvar commaLists = new TemplateTag(inlineArrayTransformer({ separator: ',' }), stripIndentTransformer, trimResultTransformer);\n\nexport default commaLists;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzL2NvbW1hTGlzdHMuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJzdHJpcEluZGVudFRyYW5zZm9ybWVyIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsImNvbW1hTGlzdHMiLCJzZXBhcmF0b3IiXSwibWFwcGluZ3MiOiJBQUFBLE9BQU9BLFdBQVAsTUFBd0IsZ0JBQXhCO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0MscUJBQVAsTUFBa0MsMEJBQWxDOztBQUVBLElBQU1DLGFBQWEsSUFBSUosV0FBSixDQUNqQkUsdUJBQXVCLEVBQUVHLFdBQVcsR0FBYixFQUF2QixDQURpQixFQUVqQkosc0JBRmlCLEVBR2pCRSxxQkFIaUIsQ0FBbkI7O0FBTUEsZUFBZUMsVUFBZiIsImZpbGUiOiJjb21tYUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJztcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInO1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcic7XG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcic7XG5cbmNvbnN0IGNvbW1hTGlzdHMgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIoeyBzZXBhcmF0b3I6ICcsJyB9KSxcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcixcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyLFxuKTtcblxuZXhwb3J0IGRlZmF1bHQgY29tbWFMaXN0cztcbiJdfQ==","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\n\nvar commaListsAnd = new TemplateTag(inlineArrayTransformer({ separator: ',', conjunction: 'and' }), stripIndentTransformer, trimResultTransformer);\n\nexport default commaListsAnd;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjp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9ybWVyKHsgc2VwYXJhdG9yOiAnLCcsIGNvbmp1bmN0aW9uOiAnYW5kJyB9KSxcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcixcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyLFxuKTtcblxuZXhwb3J0IGRlZmF1bHQgY29tbWFMaXN0c0FuZDtcbiJdfQ==","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\n\nvar commaListsOr = new TemplateTag(inlineArrayTransformer({ separator: ',', conjunction: 'or' }), stripIndentTransformer, trimResultTransformer);\n\nexport default commaListsOr;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzT3IvY29tbWFMaXN0c09yLmpzIl0sIm5hbWVzIjpbIlRlbXBsYXRlVGFnIiwic3RyaXBJbmRlbnRUcmFuc2Zvcm1lciIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJjb21tYUxpc3RzT3IiLCJzZXBhcmF0b3IiLCJjb25qdW5jdGlvbiJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsZUFBZSxJQUFJSixXQUFKLENBQ25CRSx1QkFBdUIsRUFBRUcsV0FBVyxHQUFiLEVBQWtCQyxhQUFhLElBQS9CLEVBQXZCLENBRG1CLEVBRW5CTCxzQkFGbUIsRUFHbkJFLHFCQUhtQixDQUFyQjs7QUFNQSxlQUFlQyxZQUFmIiwiZmlsZSI6ImNvbW1hTGlzdHNPci5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZyc7XG5pbXBvcnQgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciBmcm9tICcuLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJztcbmltcG9ydCBpbmxpbmVBcnJheVRyYW5zZm9ybWVyIGZyb20gJy4uL2lubGluZUFycmF5VHJhbnNmb3JtZXInO1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInO1xuXG5jb25zdCBjb21tYUxpc3RzT3IgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIoeyBzZXBhcmF0b3I6ICcsJywgY29uanVuY3Rpb246ICdvcicgfSksXG4gIHN0cmlwSW5kZW50VHJhbnNmb3JtZXIsXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lcixcbik7XG5cbmV4cG9ydCBkZWZhdWx0IGNvbW1hTGlzdHNPcjtcbiJdfQ==","var splitStringTransformer = function splitStringTransformer(splitBy) {\n return {\n onSubstitution: function onSubstitution(substitution, resultSoFar) {\n if (splitBy != null && typeof splitBy === 'string') {\n if (typeof substitution === 'string' && substitution.includes(splitBy)) {\n substitution = substitution.split(splitBy);\n }\n } else {\n throw new Error('You need to specify a string character to split by.');\n }\n return substitution;\n }\n };\n};\n\nexport default splitStringTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyL3NwbGl0U3RyaW5nVHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsic3BsaXRTdHJpbmdUcmFuc2Zvcm1lciIsIm9uU3Vic3RpdHV0aW9uIiwic3Vic3RpdHV0aW9uIiwic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iAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdZb3UgbmVlZCB0byBzcGVjaWZ5IGEgc3RyaW5nIGNoYXJhY3RlciB0byBzcGxpdCBieS4nKTtcbiAgICB9XG4gICAgcmV0dXJuIHN1YnN0aXR1dGlvbjtcbiAgfSxcbn0pO1xuXG5leHBvcnQgZGVmYXVsdCBzcGxpdFN0cmluZ1RyYW5zZm9ybWVyO1xuIl19","var isValidValue = function isValidValue(x) {\n return x != null && !Number.isNaN(x) && typeof x !== 'boolean';\n};\n\nvar removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer() {\n return {\n onSubstitution: function onSubstitution(substitution) {\n if (Array.isArray(substitution)) {\n return substitution.filter(isValidValue);\n }\n if (isValidValue(substitution)) {\n return substitution;\n }\n return '';\n }\n };\n};\n\nexport default removeNonPrintingValuesTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyL3JlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsiaXNWYWxpZFZhbHVlIiwieCIsIk51bWJlciIsImlzTmFOIiwicmVtb3ZlTm9uUHJpbnRpbmdWYWx1ZXNUcmFuc2Zvcm1lciIsIm9uU3Vic3RpdHV0aW9uIiwic3Vic3RpdHV0aW9uIiwiQXJyYXkiLCJpc0FycmF5IiwiZmlsdGVyIl0sIm1hcHBpbmdzIjoiQUFBQSxJQUFNQSxlQUFlLFNBQWZBLFlBQWU7QUFBQSxTQUNuQkMsS0FBSyxJQUFMLElBQWEsQ0FBQ0MsT0FBT0MsS0FBUCxDQUFhRixDQUFiLENBQWQsSUFBaUMsT0FBT0EsQ0FBUCxLQUFhLFNBRDNCO0FBQUEsQ0FBckI7O0FBR0EsSUFBTUcscUNBQXFDLFNBQXJDQSxrQ0FBcUM7QUFBQSxTQUFPO0FBQ2hEQyxrQkFEZ0QsMEJBQ2pDQyxZQURpQyxFQUNuQjtBQUMzQixVQUFJQyxNQUFNQyxPQUFOLENBQWNGLFlBQWQsQ0FBSixFQUFpQztBQUMvQixlQUFPQSxhQUFhRyxNQUFiLENBQW9CVCxZQUFwQixDQUFQO0FBQ0Q7QUFDRCxVQUFJQSxhQUFhTSxZQUFiLENBQUosRUFBZ0M7QUFDOUIsZUFBT0EsWUFBUDtBQUNEO0FBQ0QsYUFBTyxFQUFQO0FBQ0Q7QUFUK0MsR0FBUDtBQUFBLENBQTNDOztBQVlBLGVBQWVGLGtDQUFmIiwiZmlsZSI6InJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBpc1ZhbGlkVmFsdWUgPSB4ID0+XG4gIHggIT0gbnVsbCAmJiAhTnVtYmVyLmlzTmFOKHgpICYmIHR5cGVvZiB4ICE9PSAnYm9vbGVhbic7XG5cbmNvbnN0IHJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIgPSAoKSA9PiAoe1xuICBvblN1YnN0aXR1dGlvbihzdWJzdGl0dXRpb24pIHtcbiAgICBpZiAoQXJyYXkuaXNBcnJheShzdWJzdGl0dXRpb24pKSB7XG4gICAgICByZXR1cm4gc3Vic3RpdHV0aW9uLmZpbHRlcihpc1ZhbGlkVmFsdWUpO1xuICAgIH1cbiAgICBpZiAoaXNWYWxpZFZhbHVlKHN1YnN0aXR1dGlvbikpIHtcbiAgICAgIHJldHVybiBzdWJzdGl0dXRpb247XG4gICAgfVxuICAgIHJldHVybiAnJztcbiAgfSxcbn0pO1xuXG5leHBvcnQgZGVmYXVsdCByZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyO1xuIl19","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport splitStringTransformer from '../splitStringTransformer';\nimport removeNonPrintingValuesTransformer from '../removeNonPrintingValuesTransformer';\n\nvar html = new TemplateTag(splitStringTransformer('\\n'), removeNonPrintingValuesTransformer, inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);\n\nexport default html;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9odG1sL2h0bWwuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJzdHJpcEluZGVudFRyYW5zZm9ybWVyIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInNwbGl0U3RyaW5nVHJhbnNmb3JtZXIiLCJyZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyIiwiaHRtbCJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxrQ0FBUCxNQUErQyx1Q0FBL0M7O0FBRUEsSUFBTUMsT0FBTyxJQUFJTixXQUFKLENBQ1hJLHVCQUF1QixJQUF2QixDQURXLEVBRVhDLGtDQUZXLEVBR1hILHNCQUhXLEVBSVhELHNCQUpXLEVBS1hFLHFCQUxXLENBQWI7O0FBUUEsZUFBZUcsSUFBZiIsImZpbGUiOiJodG1sLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJztcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInO1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcic7XG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcic7XG5pbXBvcnQgc3BsaXRTdHJpbmdUcmFuc2Zvcm1lciBmcm9tICcuLi9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyJztcbmltcG9ydCByZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyIGZyb20gJy4uL3JlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXInO1xuXG5jb25zdCBodG1sID0gbmV3IFRlbXBsYXRlVGFnKFxuICBzcGxpdFN0cmluZ1RyYW5zZm9ybWVyKCdcXG4nKSxcbiAgcmVtb3ZlTm9uUHJpbnRpbmdWYWx1ZXNUcmFuc2Zvcm1lcixcbiAgaW5saW5lQXJyYXlUcmFuc2Zvcm1lcixcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcixcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyLFxuKTtcblxuZXhwb3J0IGRlZmF1bHQgaHRtbDtcbiJdfQ==","var replaceSubstitutionTransformer = function replaceSubstitutionTransformer(replaceWhat, replaceWith) {\n return {\n onSubstitution: function onSubstitution(substitution, resultSoFar) {\n if (replaceWhat == null || replaceWith == null) {\n throw new Error('replaceSubstitutionTransformer requires at least 2 arguments.');\n }\n\n // Do not touch if null or undefined\n if (substitution == null) {\n return substitution;\n } else {\n return substitution.toString().replace(replaceWhat, replaceWith);\n }\n }\n };\n};\n\nexport default replaceSubstitutionTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZ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B7XG4gICAgaWYgKHJlcGxhY2VXaGF0ID09IG51bGwgfHwgcmVwbGFjZVdpdGggPT0gbnVsbCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAncmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyIHJlcXVpcmVzIGF0IGxlYXN0IDIgYXJndW1lbnRzLicsXG4gICAgICApO1xuICAgIH1cblxuICAgIC8vIERvIG5vdCB0b3VjaCBpZiBudWxsIG9yIHVuZGVmaW5lZFxuICAgIGlmIChzdWJzdGl0dXRpb24gPT0gbnVsbCkge1xuICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbjtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbi50b1N0cmluZygpLnJlcGxhY2UocmVwbGFjZVdoYXQsIHJlcGxhY2VXaXRoKTtcbiAgICB9XG4gIH0sXG59KTtcblxuZXhwb3J0IGRlZmF1bHQgcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyO1xuIl19","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport splitStringTransformer from '../splitStringTransformer';\nimport replaceSubstitutionTransformer from '../replaceSubstitutionTransformer';\n\nvar safeHtml = new TemplateTag(splitStringTransformer('\\n'), inlineArrayTransformer, stripIndentTransformer, trimResultTransformer, replaceSubstitutionTransformer(/&/g, '&'), replaceSubstitutionTransformer(/</g, '<'), replaceSubstitutionTransformer(/>/g, '>'), replaceSubstitutionTransformer(/\"/g, '"'), replaceSubstitutionTransformer(/'/g, '''), replaceSubstitutionTransformer(/`/g, '`'));\n\nexport default safeHtml;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zYWZlSHRtbC9zYWZlSHRtbC5qcyJdLCJuYW1l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==","/**\n * Replaces tabs, newlines and spaces with the chosen value when they occur in sequences\n * @param {(String|RegExp)} replaceWhat - the value or pattern that should be replaced\n * @param {*} replaceWith - the replacement value\n * @return {Object} - a TemplateTag transformer\n */\nvar replaceResultTransformer = function replaceResultTransformer(replaceWhat, replaceWith) {\n return {\n onEndResult: function onEndResult(endResult) {\n if (replaceWhat == null || replaceWith == null) {\n throw new Error('replaceResultTransformer requires at least 2 arguments.');\n }\n return endResult.replace(replaceWhat, replaceWith);\n }\n };\n};\n\nexport default replaceResultTransformer;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIvcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyLmpzIl0sIm5hbWVzIjpbInJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciIsInJlcGxhY2VXaGF0IiwicmVwbGFjZVdpdGgiLCJvbkVuZFJlc3VsdCIsImVuZFJlc3VsdCIsIkVycm9yIiwicmVwbGFjZSJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztBQU1BLElBQU1BLDJCQUEyQixTQUEzQkEsd0JBQTJCLENBQUNDLFdBQUQsRUFBY0MsV0FBZDtBQUFBLFNBQStCO0FBQzlEQyxlQUQ4RCx1QkFDbERDLFNBRGtELEVBQ3ZDO0FBQ3JCLFVBQUlILGVBQWUsSUFBZixJQUF1QkMsZUFBZSxJQUExQyxFQUFnRDtBQUM5QyxjQUFNLElBQUlHLEtBQUosQ0FDSix5REFESSxDQUFOO0FBR0Q7QUFDRCxhQUFPRCxVQUFVRSxPQUFWLENBQWtCTCxXQUFsQixFQUErQkMsV0FBL0IsQ0FBUDtBQUNEO0FBUjZELEdBQS9CO0FBQUEsQ0FBakM7O0FBV0EsZUFBZUYsd0JBQWYiLCJmaWxlIjoicmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBSZXBsYWNlcyB0YWJzLCBuZXdsaW5lcyBhbmQgc3BhY2VzIHdpdGggdGhlIGNob3NlbiB2YWx1ZSB3aGVuIHRoZXkgb2NjdXIgaW4gc2VxdWVuY2VzXG4gKiBAcGFyYW0gIHsoU3RyaW5nfFJlZ0V4cCl9IHJlcGxhY2VXaGF0IC0gdGhlIHZhbHVlIG9yIHBhdHRlcm4gdGhhdCBzaG91bGQgYmUgcmVwbGFjZWRcbiAqIEBwYXJhbSAgeyp9ICAgICAgICAgICAgICAgcmVwbGFjZVdpdGggLSB0aGUgcmVwbGFjZW1lbnQgdmFsdWVcbiAqIEByZXR1cm4ge09iamVjdH0gICAgICAgICAgICAgICAgICAgICAgLSBhIFRlbXBsYXRlVGFnIHRyYW5zZm9ybWVyXG4gKi9cbmNvbnN0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciA9IChyZXBsYWNlV2hhdCwgcmVwbGFjZVdpdGgpID0+ICh7XG4gIG9uRW5kUmVzdWx0KGVuZFJlc3VsdCkge1xuICAgIGlmIChyZXBsYWNlV2hhdCA9PSBudWxsIHx8IHJlcGxhY2VXaXRoID09IG51bGwpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgJ3JlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciByZXF1aXJlcyBhdCBsZWFzdCAyIGFyZ3VtZW50cy4nLFxuICAgICAgKTtcbiAgICB9XG4gICAgcmV0dXJuIGVuZFJlc3VsdC5yZXBsYWNlKHJlcGxhY2VXaGF0LCByZXBsYWNlV2l0aCk7XG4gIH0sXG59KTtcblxuZXhwb3J0IGRlZmF1bHQgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyO1xuIl19","import TemplateTag from '../TemplateTag';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\n\nvar oneLine = new TemplateTag(replaceResultTransformer(/(?:\\n(?:\\s*))+/g, ' '), trimResultTransformer);\n\nexport default oneLine;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lL29uZUxpbmUuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJvbmVMaW5lIl0sIm1hcHBpbmdzIjoiQUFBQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyxVQUFVLElBQUlILFdBQUosQ0FDZEUseUJBQXlCLGlCQUF6QixFQUE0QyxHQUE1QyxDQURjLEVBRWRELHFCQUZjLENBQWhCOztBQUtBLGVBQWVFLE9BQWYiLCJmaWxlIjoib25lTGluZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZyc7XG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcic7XG5pbXBvcnQgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3JlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcic7XG5cbmNvbnN0IG9uZUxpbmUgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcigvKD86XFxuKD86XFxzKikpKy9nLCAnICcpLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXIsXG4pO1xuXG5leHBvcnQgZGVmYXVsdCBvbmVMaW5lO1xuIl19","import TemplateTag from '../TemplateTag';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\n\nvar oneLineTrim = new TemplateTag(replaceResultTransformer(/(?:\\n\\s*)/g, ''), trimResultTransformer);\n\nexport default oneLineTrim;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lVHJpbS9vbmVMaW5lVHJpbS5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciIsIm9uZUxpbmVUcmltIl0sIm1hcHBpbmdzIjoiQUFBQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyxjQUFjLElBQUlILFdBQUosQ0FDbEJFLHlCQUF5QixZQUF6QixFQUF1QyxFQUF2QyxDQURrQixFQUVsQkQscUJBRmtCLENBQXBCOztBQUtBLGVBQWVFLFdBQWYiLCJmaWxlIjoib25lTGluZVRyaW0uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnO1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInO1xuaW1wb3J0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXInO1xuXG5jb25zdCBvbmVMaW5lVHJpbSA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyKC8oPzpcXG5cXHMqKS9nLCAnJyksXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lcixcbik7XG5cbmV4cG9ydCBkZWZhdWx0IG9uZUxpbmVUcmltO1xuIl19","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\n\nvar oneLineCommaLists = new TemplateTag(inlineArrayTransformer({ separator: ',' }), replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\n\nexport default oneLineCommaLists;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0cy9vbmVMaW5lQ29tbWFMaXN0cy5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJvbmVMaW5lQ29tbWFMaXN0cyIsInNlcGFyYXRvciJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7QUFDQSxPQUFPQyx3QkFBUCxNQUFxQyw2QkFBckM7O0FBRUEsSUFBTUMsb0JBQW9CLElBQUlKLFdBQUosQ0FDeEJDLHVCQUF1QixFQUFFSSxXQUFXLEdBQWIsRUFBdkIsQ0FEd0IsRUFFeEJGLHlCQUF5QixVQUF6QixFQUFxQyxHQUFyQyxDQUZ3QixFQUd4QkQscUJBSHdCLENBQTFCOztBQU1BLGVBQWVFLGlCQUFmIiwiZmlsZSI6Im9uZUxpbmVDb21tYUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJztcbmltcG9ydCBpbmxpbmVBcnJheVRyYW5zZm9ybWVyIGZyb20gJy4uL2lubGluZUFycmF5VHJhbnNmb3JtZXInO1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInO1xuaW1wb3J0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXInO1xuXG5jb25zdCBvbmVMaW5lQ29tbWFMaXN0cyA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgaW5saW5lQXJyYXlUcmFuc2Zvcm1lcih7IHNlcGFyYXRvcjogJywnIH0pLFxuICByZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIoLyg/OlxccyspL2csICcgJyksXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lcixcbik7XG5cbmV4cG9ydCBkZWZhdWx0IG9uZUxpbmVDb21tYUxpc3RzO1xuIl19","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\n\nvar oneLineCommaListsOr = new TemplateTag(inlineArrayTransformer({ separator: ',', conjunction: 'or' }), replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\n\nexport default oneLineCommaListsOr;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0c09yL29uZUxpbmVDb21tYUxpc3RzT3IuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJpbmxpbmVBcnJheVRyYW5zZm9ybWVyIiwidHJpbVJlc3VsdFRyYW5zZm9ybWVyIiwicmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIiwib25lTGluZUNvbW1hTGlzdHNPciIsInNlcGFyYXRvciIsImNvbmp1bmN0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mYXVsdCBvbmVMaW5lQ29tbWFMaXN0c09yO1xuIl19","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\n\nvar oneLineCommaListsAnd = new TemplateTag(inlineArrayTransformer({ separator: ',', conjunction: 'and' }), replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\n\nexport default oneLineCommaListsAnd;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0c0FuZC9vbmVMaW5lQ29tbWFMaXN0c0FuZC5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJvbmVMaW5lQ29tbWFMaXN0c0FuZCIsInNlcGFyYXRvciIsImNvbmp1bmN0aW9uIl0sIm1hcHBpbmdzIjoiQUFBQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHNCQUFQLE1BQW1DLDJCQUFuQztBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyx1QkFBdUIsSUFBSUosV0FBSixDQUMzQkMsdUJBQXVCLEVBQUVJLFdBQVcsR0FBYixFQUFrQkMsYUFBYSxLQUEvQixFQUF2QixDQUQyQixFQUUzQkgseUJBQXlCLFVBQXpCLEVBQXFDLEdBQXJDLENBRjJCLEVBRzNCRCxxQkFIMkIsQ0FBN0I7O0FBTUEsZUFBZUUsb0JBQWYiLCJmaWxlIjoib25lTGluZUNvbW1hTGlzdHNBbmQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnO1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcic7XG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcic7XG5pbXBvcnQgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3JlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcic7XG5cbmNvbnN0IG9uZUxpbmVDb21tYUxpc3RzQW5kID0gbmV3IFRlbXBsYXRlVGFnKFxuICBpbmxpbmVBcnJheVRyYW5zZm9ybWVyKHsgc2VwYXJhdG9yOiAnLCcsIGNvbmp1bmN0aW9uOiAnYW5kJyB9KSxcbiAgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyKC8oPzpcXHMrKS9nLCAnICcpLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXIsXG4pO1xuXG5leHBvcnQgZGVmYXVsdCBvbmVMaW5lQ29tbWFMaXN0c0FuZDtcbiJdfQ==","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\n\nvar inlineLists = new TemplateTag(inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);\n\nexport default inlineLists;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVMaXN0cy9pbmxpbmVMaXN0cy5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInN0cmlwSW5kZW50VHJhbnNmb3JtZXIiLCJpbmxpbmVBcnJheVRyYW5zZm9ybWVyIiwidHJpbVJlc3VsdFRyYW5zZm9ybWVyIiwiaW5saW5lTGlzdHMiXSwibWFwcGluZ3MiOiJBQUFBLE9BQU9BLFdBQVAsTUFBd0IsZ0JBQXhCO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0MscUJBQVAsTUFBa0MsMEJBQWxDOztBQUVBLElBQU1DLGNBQWMsSUFBSUosV0FBSixDQUNsQkUsc0JBRGtCLEVBRWxCRCxzQkFGa0IsRUFHbEJFLHFCQUhrQixDQUFwQjs7QUFNQSxlQUFlQyxXQUFmIiwiZmlsZSI6ImlubGluZUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJztcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInO1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcic7XG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcic7XG5cbmNvbnN0IGlubGluZUxpc3RzID0gbmV3IFRlbXBsYXRlVGFnKFxuICBpbmxpbmVBcnJheVRyYW5zZm9ybWVyLFxuICBzdHJpcEluZGVudFRyYW5zZm9ybWVyLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXIsXG4pO1xuXG5leHBvcnQgZGVmYXVsdCBpbmxpbmVMaXN0cztcbiJdfQ==","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\n\nvar oneLineInlineLists = new TemplateTag(inlineArrayTransformer, replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\n\nexport default oneLineInlineLists;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lSW5saW5lTGlzdHMvb25lTGluZUlubGluZUxpc3RzLmpzIl0sIm5hbWVzIjpbIlRlbXBsYXRlVGFnIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciIsIm9uZUxpbmVJbmxpbmVMaXN0cyJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7QUFDQSxPQUFPQyx3QkFBUCxNQUFxQyw2QkFBckM7O0FBRUEsSUFBTUMscUJBQXFCLElBQUlKLFdBQUosQ0FDekJDLHNCQUR5QixFQUV6QkUseUJBQXlCLFVBQXpCLEVBQXFDLEdBQXJDLENBRnlCLEVBR3pCRCxxQkFIeUIsQ0FBM0I7O0FBTUEsZUFBZUUsa0JBQWYiLCJmaWxlIjoib25lTGluZUlubGluZUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJztcbmltcG9ydCBpbmxpbmVBcnJheVRyYW5zZm9ybWVyIGZyb20gJy4uL2lubGluZUFycmF5VHJhbnNmb3JtZXInO1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInO1xuaW1wb3J0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXInO1xuXG5jb25zdCBvbmVMaW5lSW5saW5lTGlzdHMgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIsXG4gIHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcigvKD86XFxzKykvZywgJyAnKSxcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyLFxuKTtcblxuZXhwb3J0IGRlZmF1bHQgb25lTGluZUlubGluZUxpc3RzO1xuIl19","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\n\nvar stripIndent = new TemplateTag(stripIndentTransformer, trimResultTransformer);\n\nexport default stripIndent;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudC9zdHJpcEluZGVudC5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInN0cmlwSW5kZW50VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJzdHJpcEluZGVudCJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsY0FBYyxJQUFJSCxXQUFKLENBQ2xCQyxzQkFEa0IsRUFFbEJDLHFCQUZrQixDQUFwQjs7QUFLQSxlQUFlQyxXQUFmIiwiZmlsZSI6InN0cmlwSW5kZW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJztcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInO1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInO1xuXG5jb25zdCBzdHJpcEluZGVudCA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcixcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyLFxuKTtcblxuZXhwb3J0IGRlZmF1bHQgc3RyaXBJbmRlbnQ7XG4iXX0=","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\n\nvar stripIndents = new TemplateTag(stripIndentTransformer('all'), trimResultTransformer);\n\nexport default stripIndents;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudHMvc3RyaXBJbmRlbnRzLmpzIl0sIm5hbWVzIjpbIlRlbXBsYXRlVGFnIiwic3RyaXBJbmRlbnRUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInN0cmlwSW5kZW50cyJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsZUFBZSxJQUFJSCxXQUFKLENBQ25CQyx1QkFBdUIsS0FBdkIsQ0FEbUIsRUFFbkJDLHFCQUZtQixDQUFyQjs7QUFLQSxlQUFlQyxZQUFmIiwiZmlsZSI6InN0cmlwSW5kZW50cy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZyc7XG5pbXBvcnQgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciBmcm9tICcuLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJztcbmltcG9ydCB0cmltUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vdHJpbVJlc3VsdFRyYW5zZm9ybWVyJztcblxuY29uc3Qgc3RyaXBJbmRlbnRzID0gbmV3IFRlbXBsYXRlVGFnKFxuICBzdHJpcEluZGVudFRyYW5zZm9ybWVyKCdhbGwnKSxcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyLFxuKTtcblxuZXhwb3J0IGRlZmF1bHQgc3RyaXBJbmRlbnRzO1xuIl19","import { Grammar } from 'prismjs';\n\nimport { CompletionItem } from '@grafana/ui';\n\nexport const QUERY_COMMANDS: CompletionItem[] = [\n {\n label: 'fields',\n documentation: 'Retrieves the specified fields from log events',\n },\n { label: 'display', documentation: 'Specifies which fields to display in the query results' },\n {\n label: 'filter',\n documentation: 'Filters the results of a query based on one or more conditions',\n },\n {\n label: 'stats',\n documentation: 'Calculates aggregate statistics based on the values of log fields',\n },\n { label: 'sort', documentation: 'Sorts the retrieved log events' },\n { label: 'limit', documentation: 'Specifies the number of log events returned by the query' },\n {\n label: 'parse',\n documentation:\n 'Extracts data from a log field, creating one or more ephemeral fields that you can process further in the query',\n },\n];\n\nexport const COMPARISON_OPERATORS = ['=', '!=', '<', '<=', '>', '>='];\nexport const ARITHMETIC_OPERATORS = ['+', '-', '*', '/', '^', '%'];\n\nexport const NUMERIC_OPERATORS = [\n {\n label: 'abs',\n detail: 'abs(a)',\n documentation: 'Absolute value.',\n },\n {\n label: 'ceil',\n detail: 'ceil(a)',\n documentation: 'Round to ceiling (the smallest integer that is greater than the value of a).',\n },\n {\n label: 'floor',\n detail: 'floor(a)',\n documentation: 'Round to floor (the largest integer that is smaller than the value of a).',\n },\n {\n label: 'greatest',\n detail: 'greatest(a,b, ... z)',\n documentation: 'Returns the largest value.',\n },\n {\n label: 'least',\n detail: 'least(a, b, ... z)',\n documentation: 'Returns the smallest value.',\n },\n {\n label: 'log',\n detail: 'log(a)',\n documentation: 'Natural logarithm.',\n },\n {\n label: 'sqrt',\n detail: 'sqrt(a)',\n documentation: 'Square root.',\n },\n];\n\nexport const GENERAL_FUNCTIONS = [\n {\n label: 'ispresent',\n detail: 'ispresent(fieldname)',\n documentation: 'Returns true if the field exists.',\n },\n {\n label: 'coalesce',\n detail: 'coalesce(fieldname1, fieldname2, ... fieldnamex)',\n documentation: 'Returns the first non-null value from the list.',\n },\n];\n\nexport const STRING_FUNCTIONS = [\n {\n label: 'isempty',\n detail: 'isempty(fieldname)',\n documentation: 'Returns true if the field is missing or is an empty string.',\n },\n {\n label: 'isblank',\n detail: 'isblank(fieldname)',\n documentation: 'Returns true if the field is missing, an empty string, or contains only white space.',\n },\n {\n label: 'concat',\n detail: 'concat(string1, string2, ... stringz)',\n documentation: 'Concatenates the strings.',\n },\n {\n label: 'ltrim',\n detail: 'ltrim(string) or ltrim(string1, string2)',\n documentation:\n 'Remove white space from the left of the string. If the function has a second string argument, it removes the characters of string2 from the left of string1.',\n },\n {\n label: 'rtrim',\n detail: 'rtrim(string) or rtrim(string1, string2)',\n documentation:\n 'Remove white space from the right of the string. If the function has a second string argument, it removes the characters of string2 from the right of string1.',\n },\n {\n label: 'trim',\n detail: 'trim(string) or trim(string1, string2)',\n documentation:\n 'Remove white space from both ends of the string. If the function has a second string argument, it removes the characters of string2 from both sides of string1.',\n },\n {\n label: 'strlen',\n detail: 'strlen(string)',\n documentation: 'Returns the length of the string in Unicode code points.',\n },\n {\n label: 'toupper',\n detail: 'toupper(string)',\n documentation: 'Converts the string to uppercase.',\n },\n {\n label: 'tolower',\n detail: 'tolower(string)',\n documentation: 'Converts the string to lowercase.',\n },\n {\n label: 'substr',\n detail: 'substr(string1, x), or substr(string1, x, y)',\n documentation:\n 'Returns a substring from the index specified by the number argument to the end of the string. If the function has a second number argument, it contains the length of the substring to be retrieved.',\n },\n {\n label: 'replace',\n detail: 'replace(string1, string2, string3)',\n documentation: 'Replaces all instances of string2 in string1 with string3.',\n },\n {\n label: 'strcontains',\n detail: 'strcontains(string1, string2)',\n documentation: 'Returns 1 if string1 contains string2 and 0 otherwise.',\n },\n];\n\nexport const DATETIME_FUNCTIONS = [\n {\n label: 'bin',\n detail: 'bin(period)',\n documentation: 'Rounds the value of @timestamp to the given period and then truncates.',\n },\n {\n label: 'datefloor',\n detail: 'datefloor(a, period)',\n documentation: 'Truncates the timestamp to the given period.',\n },\n {\n label: 'dateceil',\n detail: 'dateceil(a, period)',\n documentation: 'Rounds up the timestamp to the given period and then truncates.',\n },\n {\n label: 'fromMillis',\n detail: 'fromMillis(fieldname)',\n documentation:\n 'Interprets the input field as the number of milliseconds since the Unix epoch and converts it to a timestamp.',\n },\n {\n label: 'toMillis',\n detail: 'toMillis(fieldname)',\n documentation:\n 'Converts the timestamp found in the named field into a number representing the milliseconds since the Unix epoch.',\n },\n];\n\nexport const IP_FUNCTIONS = [\n {\n label: 'isValidIp',\n detail: 'isValidIp(fieldname)',\n documentation: 'Returns true if the field is a valid v4 or v6 IP address.',\n },\n {\n label: 'isValidIpV4',\n detail: 'isValidIpV4(fieldname)',\n documentation: 'Returns true if the field is a valid v4 IP address.',\n },\n {\n label: 'isValidIpV6',\n detail: 'isValidIpV6(fieldname)',\n documentation: 'Returns true if the field is a valid v6 IP address.',\n },\n {\n label: 'isIpInSubnet',\n detail: 'isIpInSubnet(fieldname, string)',\n documentation: 'Returns true if the field is a valid v4 or v6 IP address within the specified v4 or v6 subnet.',\n },\n {\n label: 'isIpv4InSubnet',\n detail: 'isIpv4InSubnet(fieldname, string)',\n documentation: 'Returns true if the field is a valid v4 IP address within the specified v4 subnet.',\n },\n {\n label: 'isIpv6InSubnet',\n detail: 'isIpv6InSubnet(fieldname, string)',\n documentation: 'Returns true if the field is a valid v6 IP address within the specified v6 subnet.',\n },\n];\n\nexport const BOOLEAN_FUNCTIONS = [\n {\n label: 'ispresent',\n detail: 'ispresent(fieldname)',\n documentation: 'Returns true if the field exists.',\n },\n {\n label: 'isempty',\n detail: 'isempty(fieldname)',\n documentation: 'Returns true if the field is missing or is an empty string.',\n },\n {\n label: 'isblank',\n detail: 'isblank(fieldname)',\n documentation: 'Returns true if the field is missing, an empty string, or contains only white space.',\n },\n {\n label: 'strcontains',\n detail: 'strcontains(string1, string2)',\n documentation: 'Returns 1 if string1 contains string2 and 0 otherwise.',\n },\n ...IP_FUNCTIONS,\n];\n\nexport const AGGREGATION_FUNCTIONS_STATS = [\n {\n label: 'avg',\n detail: 'avg(NumericFieldname)',\n documentation: 'The average of the values in the specified field.',\n },\n {\n label: 'count',\n detail: 'count(fieldname) or count(*)',\n documentation: 'Counts the log records.',\n },\n {\n label: 'count_distinct',\n detail: 'count_distinct(fieldname)',\n documentation: 'Returns the number of unique values for the field.',\n },\n {\n label: 'max',\n detail: 'max(fieldname)',\n documentation: 'The maximum of the values for this log field in the queried logs.',\n },\n {\n label: 'min',\n detail: 'min(fieldname)',\n documentation: 'The minimum of the values for this log field in the queried logs.',\n },\n {\n label: 'pct',\n detail: 'pct(fieldname, value)',\n documentation: 'A percentile indicates the relative standing of a value in a datas.',\n },\n {\n label: 'stddev',\n detail: 'stddev(NumericFieldname)',\n documentation: 'The standard deviation of the values in the specified field.',\n },\n {\n label: 'sum',\n detail: 'sum(NumericFieldname)',\n documentation: 'The sum of the values in the specified field.',\n },\n];\n\nexport const NON_AGGREGATION_FUNCS_STATS = [\n {\n label: 'earliest',\n detail: 'earliest(fieldname)',\n documentation:\n 'Returns the value of fieldName from the log event that has the earliest time stamp in the queried logs.',\n },\n {\n label: 'latest',\n detail: 'latest(fieldname)',\n documentation:\n 'Returns the value of fieldName from the log event that has the latest time stamp in the queried logs.',\n },\n {\n label: 'sortsFirst',\n detail: 'sortsFirst(fieldname)',\n documentation: 'Returns the value of fieldName that sorts first in the queried logs.',\n },\n {\n label: 'sortsLast',\n detail: 'sortsLast(fieldname)',\n documentation: 'Returns the value of fieldName that sorts last in the queried logs.',\n },\n];\n\nexport const STATS_FUNCS = [...AGGREGATION_FUNCTIONS_STATS, ...NON_AGGREGATION_FUNCS_STATS];\n\nexport const KEYWORDS = ['as', 'like', 'by', 'in', 'desc', 'asc'];\nexport const FIELD_AND_FILTER_FUNCTIONS = [\n ...NUMERIC_OPERATORS,\n ...GENERAL_FUNCTIONS,\n ...STRING_FUNCTIONS,\n ...DATETIME_FUNCTIONS,\n ...IP_FUNCTIONS,\n];\n\nexport const FUNCTIONS = [...FIELD_AND_FILTER_FUNCTIONS, ...STATS_FUNCS];\n\nconst tokenizer: Grammar = {\n comment: {\n pattern: /^#.*/,\n greedy: true,\n },\n backticks: {\n pattern: /`.*?`/,\n alias: 'string',\n greedy: true,\n },\n quote: {\n pattern: /\".*?\"/,\n alias: 'string',\n greedy: true,\n },\n regex: {\n pattern: /\\/.*?\\/(?=\\||\\s*$|,)/,\n greedy: true,\n },\n 'query-command': {\n pattern: new RegExp(`\\\\b(?:${QUERY_COMMANDS.map((command) => command.label).join('|')})\\\\b`, 'i'),\n alias: 'function',\n },\n function: {\n pattern: new RegExp(`\\\\b(?:${FUNCTIONS.map((f) => f.label).join('|')})\\\\b`, 'i'),\n },\n keyword: {\n pattern: new RegExp(`(\\\\s+)(${KEYWORDS.join('|')})(?=\\\\s+)`, 'i'),\n lookbehind: true,\n },\n // 'log-group-name': {\n // pattern: /[\\.\\-_/#A-Za-z0-9]+/,\n // },\n 'field-name': {\n pattern: /(@?[_a-zA-Z]+[_.0-9a-zA-Z]*)|(`((\\\\`)|([^`]))*?`)/,\n greedy: true,\n },\n number: /\\b-?\\d+((\\.\\d*)?([eE][+-]?\\d+)?)?\\b/,\n 'command-separator': {\n pattern: /\\|/,\n alias: 'punctuation',\n },\n 'comparison-operator': {\n pattern: /([<>]=?)|(!?=)/,\n },\n punctuation: /[{}()`,.]/,\n whitespace: /\\s+/,\n};\n\nexport default tokenizer;\n","import { css, cx } from '@emotion/css';\nimport { stripIndent, stripIndents } from 'common-tags';\nimport Prism from 'prismjs';\nimport React, { PureComponent } from 'react';\n\nimport { QueryEditorHelpProps } from '@grafana/data';\nimport { flattenTokens } from '@grafana/ui/src/slate-plugins/slate-prism';\n\nimport tokenizer from '../syntax';\nimport { CloudWatchQuery } from '../types';\n\ninterface QueryExample {\n category: string;\n examples: Array<{\n title: string;\n expr: string;\n }>;\n}\n\nconst CLIQ_EXAMPLES: QueryExample[] = [\n {\n category: 'Lambda',\n examples: [\n {\n title: 'View latency statistics for 5-minute intervals',\n expr: stripIndents`filter @type = \"REPORT\" |\n stats avg(@duration), max(@duration), min(@duration) by bin(5m)`,\n },\n {\n title: 'Determine the amount of overprovisioned memory',\n expr: stripIndent`\n filter @type = \"REPORT\" |\n stats max(@memorySize / 1024 / 1024) as provisonedMemoryMB,\n min(@maxMemoryUsed / 1024 / 1024) as smallestMemoryRequestMB,\n avg(@maxMemoryUsed / 1024 / 1024) as avgMemoryUsedMB,\n max(@maxMemoryUsed / 1024 / 1024) as maxMemoryUsedMB,\n provisonedMemoryMB - maxMemoryUsedMB as overProvisionedMB`,\n },\n {\n title: 'Find the most expensive requests',\n expr: stripIndents`filter @type = \"REPORT\" |\n fields @requestId, @billedDuration |\n sort by @billedDuration desc`,\n },\n ],\n },\n\n {\n category: 'VPC Flow Logs',\n examples: [\n {\n title: 'Average, min, and max byte transfers by source and destination IP addresses',\n expr: `stats avg(bytes), min(bytes), max(bytes) by srcAddr, dstAddr`,\n },\n {\n title: 'IP addresses using UDP transfer protocol',\n expr: 'filter protocol=17 | stats count(*) by srcAddr',\n },\n {\n title: 'Top 10 byte transfers by source and destination IP addresses',\n expr: stripIndents`stats sum(bytes) as bytesTransferred by srcAddr, dstAddr |\n sort bytesTransferred desc |\n limit 10`,\n },\n {\n title: 'Top 20 source IP addresses with highest number of rejected requests',\n expr: stripIndents`filter action=\"REJECT\" |\n stats count(*) as numRejections by srcAddr |\n sort numRejections desc |\n limit 20`,\n },\n ],\n },\n {\n category: 'CloudTrail',\n examples: [\n {\n title: 'Number of log entries by service, event type, and region',\n expr: 'stats count(*) by eventSource, eventName, awsRegion',\n },\n\n {\n title: 'Number of log entries by region and EC2 event type',\n expr: stripIndents`filter eventSource=\"ec2.amazonaws.com\" |\n stats count(*) as eventCount by eventName, awsRegion |\n sort eventCount desc`,\n },\n\n {\n title: 'Regions, usernames, and ARNs of newly created IAM users',\n expr: stripIndents`filter eventName=\"CreateUser\" |\n fields awsRegion, requestParameters.userName, responseElements.user.arn`,\n },\n ],\n },\n {\n category: 'Common Queries',\n examples: [\n {\n title: '25 most recently added log events',\n expr: stripIndents`fields @timestamp, @message |\n sort @timestamp desc |\n limit 25`,\n },\n {\n title: 'Number of exceptions logged every 5 minutes',\n expr: stripIndents`filter @message like /Exception/ |\n stats count(*) as exceptionCount by bin(5m) |\n sort exceptionCount desc`,\n },\n {\n title: 'List of log events that are not exceptions',\n expr: 'fields @message | filter @message not like /Exception/',\n },\n ],\n },\n {\n category: 'Route 53',\n examples: [\n {\n title: 'Number of requests received every 10 minutes by edge location',\n expr: 'stats count(*) by queryType, bin(10m)',\n },\n {\n title: 'Number of unsuccessful requests by domain',\n expr: 'filter responseCode=\"SERVFAIL\" | stats count(*) by queryName',\n },\n {\n title: 'Number of requests received every 10 minutes by edge location',\n expr: 'stats count(*) as numRequests by resolverIp | sort numRequests desc | limit 10',\n },\n ],\n },\n {\n category: 'AWS AppSync',\n examples: [\n {\n title: 'Number of unique HTTP status codes',\n expr: stripIndents`fields ispresent(graphQLAPIId) as isApi |\n filter isApi |\n filter logType = \"RequestSummary\" |\n stats count() as statusCount by statusCode |\n sort statusCount desc`,\n },\n {\n title: 'Top 10 resolvers with maximum latency',\n expr: stripIndents`fields resolverArn, duration |\n filter logType = \"Tracing\" |\n sort duration desc |\n limit 10`,\n },\n {\n title: 'Most frequently invoked resolvers',\n expr: stripIndents`fields ispresent(resolverArn) as isRes |\n stats count() as invocationCount by resolverArn |\n filter isRes |\n filter logType = \"Tracing\" |\n sort invocationCount desc |\n limit 10`,\n },\n {\n title: 'Resolvers with most errors in mapping templates',\n expr: stripIndents`fields ispresent(resolverArn) as isRes |\n stats count() as errorCount by resolverArn, logType |\n filter isRes and (logType = \"RequestMapping\" or logType = \"ResponseMapping\") and fieldInError |\n sort errorCount desc |\n limit 10`,\n },\n {\n title: 'Field latency statistics',\n expr: stripIndents`fields requestId, latency |\n filter logType = \"RequestSummary\" |\n sort latency desc |\n limit 10`,\n },\n {\n title: 'Resolver latency statistics',\n expr: stripIndents`fields ispresent(resolverArn) as isRes |\n filter isRes |\n filter logType = \"Tracing\" |\n stats min(duration), max(duration), avg(duration) as avgDur by resolverArn |\n sort avgDur desc |\n limit 10`,\n },\n {\n title: 'Top 10 requests with maximum latency',\n expr: stripIndents`fields requestId, latency |\n filter logType = \"RequestSummary\" |\n sort latency desc |\n limit 10`,\n },\n ],\n },\n];\n\nfunction renderHighlightedMarkup(code: string, keyPrefix: string) {\n const grammar = tokenizer;\n const tokens = flattenTokens(Prism.tokenize(code, grammar));\n const spans = tokens\n .filter((token) => typeof token !== 'string')\n .map((token, i) => {\n return (\n <span\n className={`prism-token token ${token.types.join(' ')} ${token.aliases.join(' ')}`}\n key={`${keyPrefix}-token-${i}`}\n >\n {token.content}\n </span>\n );\n });\n\n return <div className=\"slate-query-field\">{spans}</div>;\n}\n\nconst exampleCategory = css`\n margin-top: 5px;\n`;\n\nexport default class LogsCheatSheet extends PureComponent<\n QueryEditorHelpProps<CloudWatchQuery>,\n { userExamples: string[] }\n> {\n onClickExample(query: CloudWatchQuery) {\n this.props.onClickExample(query);\n }\n\n renderExpression(expr: string, keyPrefix: string) {\n return (\n <div\n className=\"cheat-sheet-item__example\"\n key={expr}\n onClick={() =>\n this.onClickExample({\n refId: this.props.query.refId ?? 'A',\n expression: expr,\n queryMode: 'Logs',\n region: this.props.query.region,\n id: this.props.query.refId ?? 'A',\n logGroupNames: 'logGroupNames' in this.props.query ? this.props.query.logGroupNames : [],\n })\n }\n >\n <pre>{renderHighlightedMarkup(expr, keyPrefix)}</pre>\n </div>\n );\n }\n\n renderLogsCheatSheet() {\n return (\n <div>\n <h2>CloudWatch Logs Cheat Sheet</h2>\n {CLIQ_EXAMPLES.map((cat, i) => (\n <div key={`${cat.category}-${i}`}>\n <div className={`cheat-sheet-item__title ${cx(exampleCategory)}`}>{cat.category}</div>\n {cat.examples.map((item, j) => (\n <div className=\"cheat-sheet-item\" key={`item-${j}`}>\n <h4>{item.title}</h4>\n {this.renderExpression(item.expr, `item-${j}`)}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n }\n\n render() {\n return (\n <div>\n <h3>CloudWatch Logs cheat sheet</h3>\n {CLIQ_EXAMPLES.map((cat, i) => (\n <div key={`cat-${i}`}>\n <div className={`cheat-sheet-item__title ${cx(exampleCategory)}`}>{cat.category}</div>\n {cat.examples.map((item, j) => (\n <div className=\"cheat-sheet-item\" key={`item-${j}`}>\n <h4>{item.title}</h4>\n {this.renderExpression(item.expr, `item-${j}`)}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n }\n}\n","import { AnnotationQuery } from '@grafana/data';\n\nimport { CloudWatchAnnotationQuery, CloudWatchLogsQuery, CloudWatchMetricsQuery, CloudWatchQuery } from './types';\n\nexport const isCloudWatchLogsQuery = (cloudwatchQuery: CloudWatchQuery): cloudwatchQuery is CloudWatchLogsQuery =>\n cloudwatchQuery.queryMode === 'Logs';\n\nexport const isCloudWatchMetricsQuery = (cloudwatchQuery: CloudWatchQuery): cloudwatchQuery is CloudWatchMetricsQuery =>\n cloudwatchQuery.queryMode === 'Metrics' || !cloudwatchQuery.hasOwnProperty('queryMode'); // in early versions of this plugin, queryMode wasn't defined in a CloudWatchMetricsQuery\n\nexport const isCloudWatchAnnotationQuery = (\n cloudwatchQuery: CloudWatchQuery\n): cloudwatchQuery is CloudWatchAnnotationQuery => cloudwatchQuery.queryMode === 'Annotations';\n\nexport const isCloudWatchAnnotation = (query: unknown): query is AnnotationQuery<CloudWatchAnnotationQuery> =>\n (query as AnnotationQuery<CloudWatchAnnotationQuery>).target?.queryMode === 'Annotations';\n","import { SelectableValue } from '@grafana/data';\n\nimport { CloudWatchDatasource } from './../datasource';\n\nexport const toOption = (value: string) => ({ label: value, value });\n\nexport const appendTemplateVariables = (datasource: CloudWatchDatasource, values: SelectableValue[]) => [\n ...values,\n { label: 'Template Variables', options: datasource.getVariables().map(toOption) },\n];\n","import { css, cx } from '@emotion/css';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { useAsyncFn } from 'react-use';\n\nimport { GrafanaTheme2, SelectableValue, toOption } from '@grafana/data';\nimport { AccessoryButton, InputGroup } from '@grafana/experimental';\nimport { Select, stylesFactory, useTheme2 } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../../datasource';\nimport { Dimensions, MetricStat } from '../../types';\nimport { appendTemplateVariables } from '../../utils/utils';\n\nimport { DimensionFilterCondition } from './Dimensions';\n\nexport interface Props {\n metricStat: MetricStat;\n datasource: CloudWatchDatasource;\n filter: DimensionFilterCondition;\n dimensionKeys: Array<SelectableValue<string>>;\n disableExpressions: boolean;\n onChange: (value: DimensionFilterCondition) => void;\n onDelete: () => void;\n}\n\nconst wildcardOption = { value: '*', label: '*' };\n\nconst excludeCurrentKey = (dimensions: Dimensions, currentKey: string | undefined) =>\n Object.entries(dimensions ?? {}).reduce<Dimensions>((acc, [key, value]) => {\n if (key !== currentKey) {\n return { ...acc, [key]: value };\n }\n return acc;\n }, {});\n\nexport const FilterItem: FunctionComponent<Props> = ({\n filter,\n metricStat: { region, namespace, metricName, dimensions },\n datasource,\n dimensionKeys,\n disableExpressions,\n onChange,\n onDelete,\n}) => {\n const dimensionsExcludingCurrentKey = useMemo(\n () => excludeCurrentKey(dimensions ?? {}, filter.key),\n [dimensions, filter]\n );\n\n const loadDimensionValues = async () => {\n if (!filter.key) {\n return [];\n }\n\n return datasource\n .getDimensionValues(region, namespace, metricName, filter.key, dimensionsExcludingCurrentKey)\n .then((result: Array<SelectableValue<string>>) => {\n if (result.length && !disableExpressions) {\n result.unshift(wildcardOption);\n }\n return appendTemplateVariables(datasource, result);\n });\n };\n\n const [state, loadOptions] = useAsyncFn(loadDimensionValues, [filter.key, dimensions]);\n const theme = useTheme2();\n const styles = getOperatorStyles(theme);\n\n return (\n <div data-testid=\"cloudwatch-dimensions-filter-item\">\n <InputGroup>\n <Select\n aria-label=\"Dimensions filter key\"\n inputId=\"cloudwatch-dimensions-filter-item-key\"\n width=\"auto\"\n value={filter.key ? toOption(filter.key) : null}\n allowCustomValue\n options={dimensionKeys}\n onChange={(change) => {\n if (change.label) {\n onChange({ key: change.label, value: undefined });\n }\n }}\n />\n\n <span className={cx(styles.root)}>=</span>\n\n <Select\n aria-label=\"Dimensions filter value\"\n inputId=\"cloudwatch-dimensions-filter-item-value\"\n onOpenMenu={loadOptions}\n width=\"auto\"\n value={filter.value ? toOption(filter.value) : null}\n allowCustomValue\n isLoading={state.loading}\n options={state.value}\n onChange={(change) => {\n if (change.value) {\n onChange({ ...filter, value: change.value });\n }\n }}\n />\n <AccessoryButton aria-label=\"remove\" icon=\"times\" variant=\"secondary\" onClick={onDelete} type=\"button\" />\n </InputGroup>\n </div>\n );\n};\n\nconst getOperatorStyles = stylesFactory((theme: GrafanaTheme2) => ({\n root: css({\n padding: theme.spacing(0, 1),\n alignSelf: 'center',\n }),\n}));\n","import { isEqual } from 'lodash';\nimport React, { useMemo, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { EditorList } from '@grafana/experimental';\n\nimport { CloudWatchDatasource } from '../../datasource';\nimport { Dimensions as DimensionsType, MetricStat } from '../../types';\n\nimport { FilterItem } from './FilterItem';\n\nexport interface Props {\n metricStat: MetricStat;\n onChange: (dimensions: DimensionsType) => void;\n datasource: CloudWatchDatasource;\n dimensionKeys: Array<SelectableValue<string>>;\n disableExpressions: boolean;\n}\n\nexport interface DimensionFilterCondition {\n key?: string;\n operator?: string;\n value?: string;\n}\n\nconst dimensionsToFilterConditions = (dimensions: DimensionsType | undefined) =>\n Object.entries(dimensions ?? {}).reduce<DimensionFilterCondition[]>((acc, [key, value]) => {\n if (value && typeof value === 'string') {\n const filter = {\n key,\n value,\n operator: '=',\n };\n return [...acc, filter];\n }\n return acc;\n }, []);\n\nconst filterConditionsToDimensions = (filters: DimensionFilterCondition[]) => {\n return filters.reduce<DimensionsType>((acc, { key, value }) => {\n if (key && value) {\n return { ...acc, [key]: value };\n }\n return acc;\n }, {});\n};\n\nexport const Dimensions: React.FC<Props> = ({\n metricStat,\n datasource,\n dimensionKeys,\n disableExpressions,\n onChange,\n}) => {\n const dimensionFilters = useMemo(() => dimensionsToFilterConditions(metricStat.dimensions), [metricStat.dimensions]);\n const [items, setItems] = useState<DimensionFilterCondition[]>(dimensionFilters);\n const onDimensionsChange = (newItems: Array<Partial<DimensionFilterCondition>>) => {\n setItems(newItems);\n\n // The onChange event should only be triggered in the case there is a complete dimension object.\n // So when a new key is added that does not yet have a value, it should not trigger an onChange event.\n const newDimensions = filterConditionsToDimensions(newItems);\n if (!isEqual(newDimensions, metricStat.dimensions)) {\n onChange(newDimensions);\n }\n };\n\n return (\n <EditorList\n items={items}\n onChange={onDimensionsChange}\n renderItem={makeRenderFilter(datasource, metricStat, dimensionKeys, disableExpressions)}\n />\n );\n};\n\nfunction makeRenderFilter(\n datasource: CloudWatchDatasource,\n metricStat: MetricStat,\n dimensionKeys: Array<SelectableValue<string>>,\n disableExpressions: boolean\n) {\n function renderFilter(\n item: DimensionFilterCondition,\n onChange: (item: DimensionFilterCondition) => void,\n onDelete: () => void\n ) {\n return (\n <FilterItem\n filter={item}\n onChange={(item) => onChange(item)}\n datasource={datasource}\n metricStat={metricStat}\n disableExpressions={disableExpressions}\n dimensionKeys={dimensionKeys}\n onDelete={onDelete}\n />\n );\n }\n\n return renderFilter;\n}\n","import React, { InputHTMLAttributes, FunctionComponent } from 'react';\n\nimport { InlineFormLabel } from '@grafana/ui';\n\nexport interface Props extends InputHTMLAttributes<HTMLInputElement> {\n label: string;\n tooltip?: string;\n children?: React.ReactNode;\n}\n\nexport const QueryField: FunctionComponent<Partial<Props>> = ({ label, tooltip, children }) => (\n <>\n <InlineFormLabel width={8} className=\"query-keyword\" tooltip={tooltip}>\n {label}\n </InlineFormLabel>\n {children}\n </>\n);\n\nexport const QueryInlineField: FunctionComponent<Props> = ({ ...props }) => {\n return (\n <div className={'gf-form-inline'}>\n <QueryField {...props} />\n <div className=\"gf-form gf-form--grow\">\n <div className=\"gf-form-label gf-form-label--grow\" />\n </div>\n </div>\n );\n};\n","const JSURL = require('jsurl');\n\nexport interface AwsUrl {\n end: string;\n start: string;\n timeType?: 'ABSOLUTE' | 'RELATIVE';\n tz?: 'local' | 'UTC';\n unit?: string;\n editorString: string;\n isLiveTail: boolean;\n source: string[];\n}\n\nexport function encodeUrl(obj: AwsUrl, region: string): string {\n return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logs-insights:queryDetail=${JSURL.stringify(\n obj\n )}`;\n}\n","import React, { Component } from 'react';\n\nimport { PanelData } from '@grafana/data';\nimport { Icon } from '@grafana/ui';\n\nimport { encodeUrl, AwsUrl } from '../aws_url';\nimport { CloudWatchDatasource } from '../datasource';\nimport { CloudWatchLogsQuery } from '../types';\n\ninterface Props {\n query: CloudWatchLogsQuery;\n panelData?: PanelData;\n datasource: CloudWatchDatasource;\n}\n\ninterface State {\n href: string;\n}\n\nexport default class CloudWatchLink extends Component<Props, State> {\n state: State = { href: '' };\n\n async componentDidUpdate(prevProps: Props) {\n const { panelData: panelDataNew } = this.props;\n const { panelData: panelDataOld } = prevProps;\n\n if (panelDataOld !== panelDataNew && panelDataNew?.request) {\n const href = this.getExternalLink();\n this.setState({ href });\n }\n }\n\n getExternalLink(): string {\n const { query, panelData, datasource } = this.props;\n\n const range = panelData?.request?.range;\n\n if (!range) {\n return '';\n }\n\n const start = range.from.toISOString();\n const end = range.to.toISOString();\n\n const urlProps: AwsUrl = {\n end,\n start,\n timeType: 'ABSOLUTE',\n tz: 'UTC',\n editorString: query.expression ?? '',\n isLiveTail: false,\n source: query.logGroupNames ?? [],\n };\n\n return encodeUrl(urlProps, datasource.getActualRegion(query.region));\n }\n\n render() {\n const { href } = this.state;\n return (\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n <Icon name=\"share-alt\" /> CloudWatch Logs Insights\n </a>\n );\n }\n}\n","const byRE = /\\s+by\\s+/im;\n\n/**\n * groups look like this: (@a.foo)( as )(bar),\n * group 1 is the field, group 2 is \" as \" and group 3 is the alias\n * this regex will not advance past any non-identifier or whitespace characters, e.g. |\n */\nconst groupsRE = /([\\w$@().]+)(?:(\\s+as\\s+)([\\w$]+))?\\s*,?\\s*/iy;\n\nexport function getStatsGroups(query: string): string[] {\n let groups = [];\n\n // find \" by \"\n let b;\n if ((b = query.match(byRE))) {\n // continue incremental scanning from there for groups & aliases\n groupsRE.lastIndex = b.index! + b[0].length;\n\n let g;\n while ((g = groupsRE.exec(query))) {\n groups.push(g[2] ? g[3] : g[1]);\n groupsRE.lastIndex = g.index + g[0].length;\n }\n }\n\n return groups;\n}\n","import { useEffect, useRef } from 'react';\nvar isPrimitive = function (val) { return val !== Object(val); };\nvar useCustomCompareEffect = function (effect, deps, depsEqual) {\n if (process.env.NODE_ENV !== 'production') {\n if (!(deps instanceof Array) || !deps.length) {\n console.warn('`useCustomCompareEffect` should not be used with no dependencies. Use React.useEffect instead.');\n }\n if (deps.every(isPrimitive)) {\n console.warn('`useCustomCompareEffect` should not be used with dependencies that are all primitive values. Use React.useEffect instead.');\n }\n if (typeof depsEqual !== 'function') {\n console.warn('`useCustomCompareEffect` should be used with depsEqual callback for comparing deps list');\n }\n }\n var ref = useRef(undefined);\n if (!ref.current || !depsEqual(deps, ref.current)) {\n ref.current = deps;\n }\n useEffect(effect, ref.current);\n};\nexport default useCustomCompareEffect;\n","import isDeepEqualReact from 'fast-deep-equal/react';\nexport default isDeepEqualReact;\n","import useCustomCompareEffect from './useCustomCompareEffect';\nimport isDeepEqual from './misc/isDeepEqual';\nvar isPrimitive = function (val) { return val !== Object(val); };\nvar useDeepCompareEffect = function (effect, deps) {\n if (process.env.NODE_ENV !== 'production') {\n if (!(deps instanceof Array) || !deps.length) {\n console.warn('`useDeepCompareEffect` should not be used with no dependencies. Use React.useEffect instead.');\n }\n if (deps.every(isPrimitive)) {\n console.warn('`useDeepCompareEffect` should not be used with dependencies that are all primitive values. Use React.useEffect instead.');\n }\n }\n useCustomCompareEffect(effect, deps, isDeepEqual);\n};\nexport default useDeepCompareEffect;\n","import { useEffect, useState } from 'react';\nimport { useDeepCompareEffect } from 'react-use';\n\nimport { SelectableValue, toOption } from '@grafana/data';\n\nimport { CloudWatchDatasource } from './datasource';\nimport { Dimensions } from './types';\nimport { appendTemplateVariables } from './utils/utils';\n\nexport const useRegions = (datasource: CloudWatchDatasource): [Array<SelectableValue<string>>, boolean] => {\n const [regionsIsLoading, setRegionsIsLoading] = useState<boolean>(false);\n const [regions, setRegions] = useState<Array<SelectableValue<string>>>([{ label: 'default', value: 'default' }]);\n\n useEffect(() => {\n setRegionsIsLoading(true);\n\n const variableOptionGroup = {\n label: 'Template Variables',\n options: datasource.getVariables().map(toOption),\n };\n\n datasource\n .getRegions()\n .then((regions: Array<SelectableValue<string>>) => setRegions([...regions, variableOptionGroup]))\n .finally(() => setRegionsIsLoading(false));\n }, [datasource]);\n\n return [regions, regionsIsLoading];\n};\n\nexport const useNamespaces = (datasource: CloudWatchDatasource) => {\n const [namespaces, setNamespaces] = useState<Array<SelectableValue<string>>>([]);\n useEffect(() => {\n datasource.getNamespaces().then((namespaces) => {\n setNamespaces(appendTemplateVariables(datasource, namespaces));\n });\n }, [datasource]);\n\n return namespaces;\n};\n\nexport const useMetrics = (datasource: CloudWatchDatasource, region: string, namespace: string | undefined) => {\n const [metrics, setMetrics] = useState<Array<SelectableValue<string>>>([]);\n useEffect(() => {\n datasource.getMetrics(namespace, region).then((result: Array<SelectableValue<string>>) => {\n setMetrics(appendTemplateVariables(datasource, result));\n });\n }, [datasource, region, namespace]);\n\n return metrics;\n};\n\nexport const useDimensionKeys = (\n datasource: CloudWatchDatasource,\n region: string,\n namespace: string | undefined,\n metricName: string | undefined,\n dimensionFilter?: Dimensions\n) => {\n const [dimensionKeys, setDimensionKeys] = useState<Array<SelectableValue<string>>>([]);\n\n // doing deep comparison to avoid making new api calls to list metrics unless dimension filter object props changes\n useDeepCompareEffect(() => {\n datasource\n .getDimensionKeys(namespace, region, dimensionFilter, metricName)\n .then((result: Array<SelectableValue<string>>) => {\n setDimensionKeys(appendTemplateVariables(datasource, result));\n });\n }, [datasource, region, namespace, metricName, dimensionFilter]);\n\n return dimensionKeys;\n};\n","import React, { useCallback, useState } from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineSelect, FlexItem } from '@grafana/experimental';\nimport { Button, ConfirmModal, RadioButtonGroup } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../../datasource';\nimport { CloudWatchMetricsQuery, CloudWatchQuery, MetricEditorMode, MetricQueryType } from '../../types';\n\ninterface MetricsQueryHeaderProps {\n query: CloudWatchMetricsQuery;\n datasource: CloudWatchDatasource;\n onChange: (query: CloudWatchQuery) => void;\n onRunQuery: () => void;\n sqlCodeEditorIsDirty: boolean;\n}\n\nconst metricEditorModes: Array<SelectableValue<MetricQueryType>> = [\n { label: 'Metric Search', value: MetricQueryType.Search },\n { label: 'Metric Query', value: MetricQueryType.Query },\n];\n\nconst editorModes = [\n { label: 'Builder', value: MetricEditorMode.Builder },\n { label: 'Code', value: MetricEditorMode.Code },\n];\n\nconst MetricsQueryHeader: React.FC<MetricsQueryHeaderProps> = ({\n query,\n sqlCodeEditorIsDirty,\n onChange,\n onRunQuery,\n}) => {\n const { metricEditorMode, metricQueryType } = query;\n const [showConfirm, setShowConfirm] = useState(false);\n\n const onEditorModeChange = useCallback(\n (newMetricEditorMode: MetricEditorMode) => {\n if (\n sqlCodeEditorIsDirty &&\n metricQueryType === MetricQueryType.Query &&\n metricEditorMode === MetricEditorMode.Code\n ) {\n setShowConfirm(true);\n return;\n }\n onChange({ ...query, metricEditorMode: newMetricEditorMode });\n },\n [setShowConfirm, onChange, sqlCodeEditorIsDirty, query, metricEditorMode, metricQueryType]\n );\n\n return (\n <>\n <InlineSelect\n aria-label=\"Metric editor mode\"\n value={metricEditorModes.find((m) => m.value === metricQueryType)}\n options={metricEditorModes}\n onChange={({ value }) => {\n onChange({ ...query, metricQueryType: value });\n }}\n />\n <FlexItem grow={1} />\n\n <RadioButtonGroup options={editorModes} size=\"sm\" value={metricEditorMode} onChange={onEditorModeChange} />\n\n {query.metricQueryType === MetricQueryType.Query && query.metricEditorMode === MetricEditorMode.Code && (\n <Button variant=\"secondary\" size=\"sm\" onClick={() => onRunQuery()}>\n Run query\n </Button>\n )}\n\n <ConfirmModal\n isOpen={showConfirm}\n title=\"Are you sure?\"\n body=\"You will lose manual changes done to the query if you go back to the visual builder.\"\n confirmText=\"Yes, I am sure.\"\n dismissText=\"No, continue editing the query manually.\"\n icon=\"exclamation-triangle\"\n onConfirm={() => {\n setShowConfirm(false);\n onChange({ ...query, metricEditorMode: MetricEditorMode.Builder });\n }}\n onDismiss={() => setShowConfirm(false)}\n />\n </>\n );\n};\n\nexport default MetricsQueryHeader;\n","import { pick } from 'lodash';\nimport React from 'react';\n\nimport { SelectableValue, ExploreMode } from '@grafana/data';\nimport { EditorHeader, InlineSelect } from '@grafana/experimental';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { useRegions } from '../hooks';\nimport { CloudWatchQuery, CloudWatchQueryMode } from '../types';\n\nimport MetricsQueryHeader from './MetricsQueryEditor/MetricsQueryHeader';\n\ninterface QueryHeaderProps {\n query: CloudWatchQuery;\n datasource: CloudWatchDatasource;\n onChange: (query: CloudWatchQuery) => void;\n onRunQuery: () => void;\n sqlCodeEditorIsDirty: boolean;\n onRegionChange?: (region: string) => Promise<void>;\n}\n\nconst apiModes: Array<SelectableValue<CloudWatchQueryMode>> = [\n { label: 'CloudWatch Metrics', value: 'Metrics' },\n { label: 'CloudWatch Logs', value: 'Logs' },\n];\n\nconst QueryHeader: React.FC<QueryHeaderProps> = ({\n query,\n sqlCodeEditorIsDirty,\n datasource,\n onChange,\n onRunQuery,\n onRegionChange,\n}) => {\n const { queryMode, region } = query;\n\n const [regions, regionIsLoading] = useRegions(datasource);\n\n const onQueryModeChange = ({ value }: SelectableValue<CloudWatchQueryMode>) => {\n if (value !== queryMode) {\n const commonProps = pick(query, 'id', 'region', 'namespace', 'refId', 'hide', 'key', 'queryType', 'datasource');\n onChange({\n ...commonProps,\n queryMode: value,\n } as CloudWatchQuery);\n }\n };\n\n const onRegion = async ({ value }: SelectableValue<string>) => {\n if (onRegionChange) {\n await onRegionChange(value ?? 'default');\n }\n onChange({\n ...query,\n region: value,\n } as CloudWatchQuery);\n };\n\n return (\n <EditorHeader>\n <InlineSelect\n label=\"Region\"\n value={region}\n placeholder=\"Select region\"\n allowCustomValue\n onChange={({ value: region }) => region && onRegion({ value: region })}\n options={regions}\n isLoading={regionIsLoading}\n />\n\n <InlineSelect aria-label=\"Query mode\" value={queryMode} options={apiModes} onChange={onQueryModeChange} />\n\n {queryMode === ExploreMode.Metrics && (\n <MetricsQueryHeader\n query={query}\n datasource={datasource}\n onChange={onChange}\n onRunQuery={onRunQuery}\n sqlCodeEditorIsDirty={sqlCodeEditorIsDirty}\n />\n )}\n </EditorHeader>\n );\n};\n\nexport default QueryHeader;\n","import { css } from '@emotion/css';\nimport { debounce, intersectionBy, unionBy } from 'lodash';\nimport { LanguageMap, languages as prismLanguages } from 'prismjs';\nimport React, { ReactNode } from 'react';\nimport { Editor, Node, Plugin } from 'slate';\n\nimport { AbsoluteTimeRange, QueryEditorProps, SelectableValue } from '@grafana/data';\nimport {\n BracesPlugin,\n LegacyForms,\n MultiSelect,\n QueryField,\n SlatePrism,\n TypeaheadInput,\n TypeaheadOutput,\n} from '@grafana/ui';\nimport { InputActionMeta } from '@grafana/ui/src/components/Select/types';\nimport { notifyApp } from 'app/core/actions';\nimport { createErrorNotification } from 'app/core/copy/appNotification';\nimport { dispatch } from 'app/store/store';\nimport { ExploreId } from 'app/types';\n// Utils & Services\n// dom also includes Element polyfills\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { CloudWatchLanguageProvider } from '../language_provider';\nimport syntax from '../syntax';\nimport { CloudWatchJsonData, CloudWatchLogsQuery, CloudWatchQuery } from '../types';\nimport { getStatsGroups } from '../utils/query/getStatsGroups';\nimport { appendTemplateVariables } from '../utils/utils';\n\nimport QueryHeader from './QueryHeader';\n\nexport interface CloudWatchLogsQueryFieldProps\n extends QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData> {\n absoluteRange: AbsoluteTimeRange;\n onLabelsRefresh?: () => void;\n ExtraFieldElement?: ReactNode;\n exploreId: ExploreId;\n allowCustomValue?: boolean;\n}\n\nconst containerClass = css`\n flex-grow: 1;\n min-height: 35px;\n`;\n\nconst rowGap = css`\n gap: 3px;\n`;\n\ninterface State {\n selectedLogGroups: Array<SelectableValue<string>>;\n availableLogGroups: Array<SelectableValue<string>>;\n loadingLogGroups: boolean;\n invalidLogGroups: boolean;\n hint:\n | {\n message: string;\n fix: {\n label: string;\n action: () => void;\n };\n }\n | undefined;\n}\n\nexport class CloudWatchLogsQueryField extends React.PureComponent<CloudWatchLogsQueryFieldProps, State> {\n state: State = {\n selectedLogGroups:\n (this.props.query as CloudWatchLogsQuery).logGroupNames?.map((logGroup) => ({\n value: logGroup,\n label: logGroup,\n })) ?? [],\n availableLogGroups: [],\n invalidLogGroups: false,\n loadingLogGroups: false,\n hint: undefined,\n };\n\n plugins: Plugin[];\n\n constructor(props: CloudWatchLogsQueryFieldProps, context: React.Context<any>) {\n super(props, context);\n\n this.plugins = [\n BracesPlugin(),\n SlatePrism(\n {\n onlyIn: (node: Node) => node.object === 'block' && node.type === 'code_block',\n getSyntax: (node: Node) => 'cloudwatch',\n },\n { ...(prismLanguages as LanguageMap), cloudwatch: syntax }\n ),\n ];\n }\n\n fetchLogGroupOptions = async (region: string, logGroupNamePrefix?: string) => {\n try {\n const logGroups: string[] = await this.props.datasource.describeLogGroups({\n refId: this.props.query.refId,\n region,\n logGroupNamePrefix,\n });\n\n return logGroups.map((logGroup) => ({\n value: logGroup,\n label: logGroup,\n }));\n } catch (err) {\n let errMessage = 'unknown error';\n if (typeof err !== 'string') {\n try {\n errMessage = JSON.stringify(err);\n } catch (e) {}\n } else {\n errMessage = err;\n }\n dispatch(notifyApp(createErrorNotification(errMessage)));\n return [];\n }\n };\n\n onLogGroupSearch = (searchTerm: string, region: string, actionMeta: InputActionMeta) => {\n if (actionMeta.action !== 'input-change') {\n return Promise.resolve();\n }\n\n // No need to fetch matching log groups if the search term isn't valid\n // This is also useful for preventing searches when a user is typing out a log group with template vars\n // See https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_LogGroup.html for the source of the pattern below\n const logGroupNamePattern = /^[\\.\\-_/#A-Za-z0-9]+$/;\n if (!logGroupNamePattern.test(searchTerm)) {\n return Promise.resolve();\n }\n\n this.setState({\n loadingLogGroups: true,\n });\n\n return this.fetchLogGroupOptions(region, searchTerm)\n .then((matchingLogGroups) => {\n this.setState((state) => ({\n availableLogGroups: unionBy(state.availableLogGroups, matchingLogGroups, 'value'),\n }));\n })\n .finally(() => {\n this.setState({\n loadingLogGroups: false,\n });\n });\n };\n\n onLogGroupSearchDebounced = debounce(this.onLogGroupSearch, 300);\n\n componentDidMount = () => {\n const { query, onChange } = this.props;\n\n this.setState({\n loadingLogGroups: true,\n });\n\n query.region &&\n this.fetchLogGroupOptions(query.region).then((logGroups) => {\n this.setState((state) => {\n const selectedLogGroups = state.selectedLogGroups;\n if (onChange) {\n const nextQuery = {\n ...query,\n logGroupNames: selectedLogGroups.map((group) => group.value!),\n };\n\n onChange(nextQuery);\n }\n\n return {\n loadingLogGroups: false,\n availableLogGroups: logGroups,\n selectedLogGroups,\n };\n });\n });\n };\n\n onChangeQuery = (value: string) => {\n // Send text change to parent\n const { query, onChange } = this.props;\n const { selectedLogGroups } = this.state;\n\n if (onChange) {\n const nextQuery = {\n ...query,\n expression: value,\n logGroupNames: selectedLogGroups?.map((logGroupName) => logGroupName.value!) ?? [],\n statsGroups: getStatsGroups(value),\n };\n onChange(nextQuery);\n }\n };\n\n setSelectedLogGroups = (selectedLogGroups: Array<SelectableValue<string>>) => {\n this.setState({\n selectedLogGroups,\n });\n\n const { onChange, query } = this.props;\n onChange?.({\n ...(query as CloudWatchLogsQuery),\n logGroupNames: selectedLogGroups.map((logGroupName) => logGroupName.value!) ?? [],\n });\n };\n\n setCustomLogGroups = (v: string) => {\n const customLogGroup: SelectableValue<string> = { value: v, label: v };\n const selectedLogGroups = [...this.state.selectedLogGroups, customLogGroup];\n this.setSelectedLogGroups(selectedLogGroups);\n };\n\n onRegionChange = async (v: string) => {\n this.setState({\n loadingLogGroups: true,\n });\n const logGroups = await this.fetchLogGroupOptions(v);\n this.setState((state) => {\n const selectedLogGroups = intersectionBy(state.selectedLogGroups, logGroups, 'value');\n const { onChange, query } = this.props;\n if (onChange) {\n const nextQuery = {\n ...query,\n logGroupNames: selectedLogGroups.map((group) => group.value!),\n };\n\n onChange(nextQuery);\n }\n return {\n availableLogGroups: logGroups,\n selectedLogGroups: selectedLogGroups,\n loadingLogGroups: false,\n };\n });\n };\n\n onTypeahead = async (typeahead: TypeaheadInput): Promise<TypeaheadOutput> => {\n const { datasource, query } = this.props;\n const { selectedLogGroups } = this.state;\n\n if (!datasource.languageProvider) {\n return { suggestions: [] };\n }\n\n const cloudwatchLanguageProvider = datasource.languageProvider as CloudWatchLanguageProvider;\n const { history, absoluteRange } = this.props;\n const { prefix, text, value, wrapperClasses, labelKey, editor } = typeahead;\n\n return await cloudwatchLanguageProvider.provideCompletionItems(\n { text, value, prefix, wrapperClasses, labelKey, editor },\n {\n history,\n absoluteRange,\n logGroupNames: selectedLogGroups.map((logGroup) => logGroup.value!),\n region: query.region,\n }\n );\n };\n\n onQueryFieldClick = (_event: Event, _editor: Editor, next: () => any) => {\n const { selectedLogGroups, loadingLogGroups } = this.state;\n\n const queryFieldDisabled = loadingLogGroups || selectedLogGroups.length === 0;\n\n if (queryFieldDisabled) {\n this.setState({\n invalidLogGroups: true,\n });\n }\n\n next();\n };\n\n onOpenLogGroupMenu = () => {\n this.setState({\n invalidLogGroups: false,\n });\n };\n\n render() {\n const { onRunQuery, onChange, ExtraFieldElement, data, query, datasource, allowCustomValue } = this.props;\n const { selectedLogGroups, availableLogGroups, loadingLogGroups, hint, invalidLogGroups } = this.state;\n\n const showError = data && data.error && data.error.refId === query.refId;\n const cleanText = datasource.languageProvider ? datasource.languageProvider.cleanText : undefined;\n\n const MAX_LOG_GROUPS = 20;\n\n return (\n <>\n <QueryHeader\n query={query}\n onRunQuery={onRunQuery}\n datasource={datasource}\n onChange={onChange}\n sqlCodeEditorIsDirty={false}\n onRegionChange={this.onRegionChange}\n />\n <div className={`gf-form gf-form--grow flex-grow-1 ${rowGap}`}>\n <LegacyForms.FormField\n label=\"Log Groups\"\n labelWidth={6}\n className=\"flex-grow-1\"\n inputEl={\n <MultiSelect\n aria-label=\"Log Groups\"\n allowCustomValue={allowCustomValue}\n options={appendTemplateVariables(datasource, unionBy(availableLogGroups, selectedLogGroups, 'value'))}\n value={selectedLogGroups}\n onChange={(v) => {\n this.setSelectedLogGroups(v);\n }}\n onCreateOption={(v) => {\n this.setCustomLogGroups(v);\n }}\n onBlur={this.props.onRunQuery}\n className={containerClass}\n closeMenuOnSelect={false}\n isClearable={true}\n invalid={invalidLogGroups}\n isOptionDisabled={() => selectedLogGroups.length >= MAX_LOG_GROUPS}\n placeholder=\"Choose Log Groups\"\n maxVisibleValues={4}\n noOptionsMessage=\"No log groups available\"\n isLoading={loadingLogGroups}\n onOpenMenu={this.onOpenLogGroupMenu}\n onInputChange={(value, actionMeta) => {\n this.onLogGroupSearchDebounced(value, query.region, actionMeta);\n }}\n />\n }\n />\n </div>\n <div className=\"gf-form-inline gf-form-inline--nowrap flex-grow-1\">\n <div className=\"gf-form gf-form--grow flex-shrink-1\">\n <QueryField\n additionalPlugins={this.plugins}\n query={(query as CloudWatchLogsQuery).expression ?? ''}\n onChange={this.onChangeQuery}\n onClick={this.onQueryFieldClick}\n onRunQuery={this.props.onRunQuery}\n onTypeahead={this.onTypeahead}\n cleanText={cleanText}\n placeholder=\"Enter a CloudWatch Logs Insights query (run with Shift+Enter)\"\n portalOrigin=\"cloudwatch\"\n disabled={loadingLogGroups || selectedLogGroups.length === 0}\n />\n </div>\n {ExtraFieldElement}\n </div>\n {hint && (\n <div className=\"query-row-break\">\n <div className=\"text-warning\">\n {hint.message}\n <a className=\"text-link muted\" onClick={hint.fix.action}>\n {hint.fix.label}\n </a>\n </div>\n </div>\n )}\n {showError ? (\n <div className=\"query-row-break\">\n <div className=\"prom-query-field-info text-error\">{data?.error?.message}</div>\n </div>\n ) : null}\n </>\n );\n }\n}\n","// Libraries\nimport { css } from '@emotion/css';\nimport React, { memo } from 'react';\n\n// Types\nimport { AbsoluteTimeRange, QueryEditorProps } from '@grafana/data';\nimport { InlineFormLabel } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { CloudWatchJsonData, CloudWatchLogsQuery, CloudWatchQuery } from '../types';\n\nimport CloudWatchLink from './CloudWatchLink';\nimport { CloudWatchLogsQueryField } from './LogsQueryField';\n\ntype Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData> & {\n allowCustomValue?: boolean;\n};\n\nconst labelClass = css`\n margin-left: 3px;\n flex-grow: 0;\n`;\n\nexport const CloudWatchLogsQueryEditor = memo(function CloudWatchLogsQueryEditor(props: Props) {\n const { query, data, datasource, onRunQuery, onChange, exploreId, allowCustomValue = false } = props;\n\n let absolute: AbsoluteTimeRange;\n if (data?.request?.range?.from) {\n const { range } = data.request;\n absolute = {\n from: range.from.valueOf(),\n to: range.to.valueOf(),\n };\n } else {\n absolute = {\n from: Date.now() - 10000,\n to: Date.now(),\n };\n }\n\n return (\n <CloudWatchLogsQueryField\n exploreId={exploreId}\n datasource={datasource}\n query={query}\n onChange={onChange}\n onRunQuery={onRunQuery}\n history={[]}\n data={data}\n absoluteRange={absolute}\n allowCustomValue={allowCustomValue}\n ExtraFieldElement={\n <InlineFormLabel className={`gf-form-label--btn ${labelClass}`} width=\"auto\" tooltip=\"Link to Graph in AWS\">\n <CloudWatchLink query={query as CloudWatchLogsQuery} panelData={data} datasource={datasource} />\n </InlineFormLabel>\n }\n />\n );\n});\n\nexport default CloudWatchLogsQueryEditor;\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { EditorField, EditorFieldGroup, EditorRow, EditorRows, EditorSwitch } from '@grafana/experimental';\nimport { Select } from '@grafana/ui';\n\nimport { Dimensions } from '..';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { useDimensionKeys, useMetrics, useNamespaces } from '../../hooks';\nimport { MetricStat } from '../../types';\nimport { appendTemplateVariables, toOption } from '../../utils/utils';\n\nexport type Props = {\n refId: string;\n metricStat: MetricStat;\n datasource: CloudWatchDatasource;\n disableExpressions?: boolean;\n onChange: (value: MetricStat) => void;\n onRunQuery: () => void;\n};\n\nexport function MetricStatEditor({\n refId,\n metricStat,\n datasource,\n disableExpressions = false,\n onChange,\n onRunQuery,\n}: React.PropsWithChildren<Props>) {\n const { region, namespace, metricName, dimensions } = metricStat;\n const namespaces = useNamespaces(datasource);\n const metrics = useMetrics(datasource, region, namespace);\n const dimensionKeys = useDimensionKeys(datasource, region, namespace, metricName, dimensions ?? {});\n\n const onMetricStatChange = (metricStat: MetricStat) => {\n onChange(metricStat);\n onRunQuery();\n };\n\n const onNamespaceChange = async (metricStat: MetricStat) => {\n const validatedQuery = await validateMetricName(metricStat);\n onMetricStatChange(validatedQuery);\n };\n\n const validateMetricName = async (metricStat: MetricStat) => {\n let { metricName, namespace, region } = metricStat;\n if (!metricName) {\n return metricStat;\n }\n await datasource.getMetrics(namespace, region).then((result: Array<SelectableValue<string>>) => {\n if (!result.find((metric) => metric.value === metricName)) {\n metricName = '';\n }\n });\n return { ...metricStat, metricName };\n };\n\n return (\n <EditorRows>\n <EditorRow>\n <EditorFieldGroup>\n <EditorField label=\"Namespace\" width={26}>\n <Select\n aria-label=\"Namespace\"\n value={metricStat.namespace}\n allowCustomValue\n options={namespaces}\n onChange={({ value: namespace }) => {\n if (namespace) {\n onNamespaceChange({ ...metricStat, namespace });\n }\n }}\n />\n </EditorField>\n <EditorField label=\"Metric name\" width={16}>\n <Select\n aria-label=\"Metric name\"\n value={metricStat.metricName || null}\n allowCustomValue\n options={metrics}\n onChange={({ value: metricName }) => {\n if (metricName) {\n onMetricStatChange({ ...metricStat, metricName });\n }\n }}\n />\n </EditorField>\n\n <EditorField label=\"Statistic\" width={16}>\n <Select\n inputId={`${refId}-metric-stat-editor-select-statistic`}\n allowCustomValue\n value={toOption(metricStat.statistic ?? datasource.standardStatistics[0])}\n options={appendTemplateVariables(\n datasource,\n datasource.standardStatistics.filter((s) => s !== metricStat.statistic).map(toOption)\n )}\n onChange={({ value: statistic }) => {\n if (\n !statistic ||\n (!datasource.standardStatistics.includes(statistic) &&\n !/^p\\d{2}(?:\\.\\d{1,2})?$/.test(statistic) &&\n !statistic.startsWith('$'))\n ) {\n return;\n }\n\n onMetricStatChange({ ...metricStat, statistic });\n }}\n />\n </EditorField>\n </EditorFieldGroup>\n </EditorRow>\n\n <EditorRow>\n <EditorField label=\"Dimensions\">\n <Dimensions\n metricStat={metricStat}\n onChange={(dimensions) => onMetricStatChange({ ...metricStat, dimensions })}\n dimensionKeys={dimensionKeys}\n disableExpressions={disableExpressions}\n datasource={datasource}\n />\n </EditorField>\n </EditorRow>\n {!disableExpressions && (\n <EditorRow>\n <EditorField\n label=\"Match exact\"\n optional={true}\n tooltip=\"Only show metrics that exactly match all defined dimension names.\"\n >\n <EditorSwitch\n id={`${refId}-cloudwatch-match-exact`}\n value={!!metricStat.matchExact}\n onChange={(e) => {\n onMetricStatChange({\n ...metricStat,\n matchExact: e.currentTarget.checked,\n });\n }}\n />\n </EditorField>\n </EditorRow>\n )}\n </EditorRows>\n );\n}\n","export enum QueryEditorPropertyType {\n String = 'string',\n}\n\nexport interface QueryEditorProperty {\n type: QueryEditorPropertyType;\n name?: string;\n}\n\nexport type QueryEditorOperatorType = string | boolean | number;\ntype QueryEditorOperatorValueType = QueryEditorOperatorType | QueryEditorOperatorType[];\n\nexport interface QueryEditorOperator<T extends QueryEditorOperatorValueType> {\n name?: string;\n value?: T;\n}\n\nexport interface QueryEditorOperatorExpression {\n type: QueryEditorExpressionType.Operator;\n property: QueryEditorProperty;\n operator: QueryEditorOperator<QueryEditorOperatorValueType>;\n}\n\nexport interface QueryEditorArrayExpression {\n type: QueryEditorExpressionType.And | QueryEditorExpressionType.Or;\n expressions: QueryEditorExpression[] | QueryEditorArrayExpression[];\n}\n\nexport interface QueryEditorPropertyExpression {\n type: QueryEditorExpressionType.Property;\n property: QueryEditorProperty;\n}\n\nexport enum QueryEditorExpressionType {\n Property = 'property',\n Operator = 'operator',\n Or = 'or',\n And = 'and',\n GroupBy = 'groupBy',\n Function = 'function',\n FunctionParameter = 'functionParameter',\n}\n\nexport type QueryEditorExpression =\n | QueryEditorArrayExpression\n | QueryEditorPropertyExpression\n | QueryEditorGroupByExpression\n | QueryEditorFunctionExpression\n | QueryEditorFunctionParameterExpression\n | QueryEditorOperatorExpression;\n\nexport interface QueryEditorGroupByExpression {\n type: QueryEditorExpressionType.GroupBy;\n property: QueryEditorProperty;\n}\n\nexport interface QueryEditorFunctionExpression {\n type: QueryEditorExpressionType.Function;\n name?: string;\n parameters?: QueryEditorFunctionParameterExpression[];\n}\n\nexport interface QueryEditorFunctionParameterExpression {\n type: QueryEditorExpressionType.FunctionParameter;\n name?: string;\n}\n","import { getTemplateSrv, TemplateSrv } from 'app/features/templating/template_srv';\n\nimport {\n QueryEditorArrayExpression,\n QueryEditorExpression,\n QueryEditorExpressionType,\n QueryEditorFunctionExpression,\n QueryEditorOperatorExpression,\n QueryEditorPropertyExpression,\n} from '../expressions';\nimport { SQLExpression } from '../types';\n\nexport default class SQLGenerator {\n constructor(private templateSrv: TemplateSrv = getTemplateSrv()) {}\n\n expressionToSqlQuery({\n select,\n from,\n where,\n groupBy,\n orderBy,\n orderByDirection,\n limit,\n }: SQLExpression): string | undefined {\n if (!from || !select?.name || !select?.parameters?.length) {\n return undefined;\n }\n\n let parts: string[] = [];\n this.appendSelect(select, parts);\n this.appendFrom(from, parts);\n this.appendWhere(where, parts, true, where?.expressions?.length ?? 0);\n this.appendGroupBy(groupBy, parts);\n this.appendOrderBy(orderBy, orderByDirection, parts);\n this.appendLimit(limit, parts);\n\n return parts.join(' ');\n }\n\n private appendSelect(select: QueryEditorFunctionExpression | undefined, parts: string[]) {\n parts.push('SELECT');\n this.appendFunction(select, parts);\n }\n\n private appendFrom(from: QueryEditorPropertyExpression | QueryEditorFunctionExpression | undefined, parts: string[]) {\n parts.push('FROM');\n from?.type === QueryEditorExpressionType.Function\n ? this.appendFunction(from, parts)\n : parts.push(this.formatValue(from?.property?.name ?? ''));\n }\n\n private appendWhere(\n filter: QueryEditorExpression | undefined,\n parts: string[],\n isTopLevelExpression: boolean,\n topLevelExpressionsCount: number\n ) {\n if (!filter) {\n return;\n }\n\n const hasChildExpressions = 'expressions' in filter && filter.expressions.length > 0;\n if (isTopLevelExpression && hasChildExpressions) {\n parts.push('WHERE');\n }\n\n if (filter.type === QueryEditorExpressionType.And) {\n const andParts: string[] = [];\n filter.expressions.map((exp) => this.appendWhere(exp, andParts, false, topLevelExpressionsCount));\n if (andParts.length === 0) {\n return;\n }\n const andCombined = andParts.join(' AND ');\n const wrapInParentheses = !isTopLevelExpression && topLevelExpressionsCount > 1 && andParts.length > 1;\n return parts.push(wrapInParentheses ? `(${andCombined})` : andCombined);\n }\n\n if (filter.type === QueryEditorExpressionType.Or) {\n const orParts: string[] = [];\n filter.expressions.map((exp) => this.appendWhere(exp, orParts, false, topLevelExpressionsCount));\n if (orParts.length === 0) {\n return;\n }\n const orCombined = orParts.join(' OR ');\n const wrapInParentheses = !isTopLevelExpression && topLevelExpressionsCount > 1 && orParts.length > 1;\n parts.push(wrapInParentheses ? `(${orCombined})` : orCombined);\n return;\n }\n\n if (filter.type === QueryEditorExpressionType.Operator) {\n return this.appendOperator(filter, parts);\n }\n }\n\n private appendGroupBy(groupBy: QueryEditorArrayExpression | undefined, parts: string[]) {\n const groupByParts: string[] = [];\n for (const expression of groupBy?.expressions ?? []) {\n if (expression?.type !== QueryEditorExpressionType.GroupBy || !expression.property.name) {\n continue;\n }\n groupByParts.push(this.formatValue(expression.property.name));\n }\n\n if (groupByParts.length > 0) {\n parts.push(`GROUP BY ${groupByParts.join(', ')}`);\n }\n }\n\n private appendOrderBy(\n orderBy: QueryEditorFunctionExpression | undefined,\n orderByDirection: string | undefined,\n parts: string[]\n ) {\n if (orderBy) {\n parts.push('ORDER BY');\n this.appendFunction(orderBy, parts);\n parts.push(orderByDirection ?? 'ASC');\n }\n }\n\n private appendLimit(limit: number | undefined, parts: string[]) {\n limit && parts.push(`LIMIT ${limit}`);\n }\n\n private appendOperator(expression: QueryEditorOperatorExpression, parts: string[], prefix?: string) {\n const { property, operator } = expression;\n\n if (!property.name || !operator.name || !operator.value) {\n return;\n }\n\n parts.push(`${this.formatValue(property.name)} ${operator.name} '${operator.value}'`);\n }\n\n private appendFunction(select: QueryEditorFunctionExpression | undefined, parts: string[]) {\n if (!select?.name) {\n return;\n }\n\n const params = (select.parameters ?? [])\n .map((p) => p.name && this.formatValue(p.name))\n .filter(Boolean)\n .join(', ');\n\n parts.push(`${select.name}(${params})`);\n }\n\n private formatValue(label: string): string {\n const specialCharacters = /[/\\s\\.-]/; // slash, space, dot or dash\n\n const interpolated = this.templateSrv.replace(label, {}, 'raw');\n if (specialCharacters.test(interpolated)) {\n return `\"${label}\"`;\n }\n\n return label;\n }\n}\n","import { SCHEMA } from '../../cloudwatch-sql/language';\nimport {\n QueryEditorExpressionType,\n QueryEditorPropertyType,\n QueryEditorFunctionParameterExpression,\n QueryEditorArrayExpression,\n QueryEditorOperatorExpression,\n QueryEditorGroupByExpression,\n} from '../../expressions';\nimport { SQLExpression, CloudWatchMetricsQuery, Dimensions } from '../../types';\n\nimport { SelectableValue } from './../../../../../../../packages/grafana-data/src/types/select';\n\nexport function getMetricNameFromExpression(selectExpression: SQLExpression['select']): string | undefined {\n return selectExpression?.parameters?.[0].name;\n}\n\nexport function getNamespaceFromExpression(fromExpression: SQLExpression['from']): string | undefined {\n // It's just a simple `FROM \"AWS/EC2\"` expression\n if (fromExpression?.type === QueryEditorExpressionType.Property) {\n return fromExpression.property.name; // PR TODO: do we need to test the type here? It can only be string?\n }\n\n // It's a more complicated `FROM SCHEMA(\"AWS/EC2\", ...)` expression\n if (fromExpression?.type === QueryEditorExpressionType.Function) {\n // TODO: do we need to test the name of the function?\n return fromExpression.parameters?.[0].name;\n }\n\n return undefined;\n}\n\nexport function getSchemaLabelKeys(fromExpression: SQLExpression['from']): string[] | undefined {\n // Schema label keys are second to n arguments in the from expression function\n if (fromExpression?.type === QueryEditorExpressionType.Function && fromExpression?.parameters?.length) {\n if (fromExpression?.parameters?.length <= 1) {\n return [];\n }\n\n // ignore the first arg (the namespace)\n const paramExpressions = fromExpression?.parameters.slice(1);\n return paramExpressions.reduce<string[]>((acc, curr) => (curr.name ? [...acc, curr.name] : acc), []);\n }\n\n return undefined;\n}\n\nexport function isUsingWithSchema(fromExpression: SQLExpression['from']): boolean {\n return fromExpression?.type === QueryEditorExpressionType.Function && fromExpression.name === SCHEMA;\n}\n\n/** Given a partial operator expression, return a non-partial if it's valid, or undefined */\nexport function sanitizeOperator(\n expression: Partial<QueryEditorOperatorExpression>\n): QueryEditorOperatorExpression | undefined {\n const key = expression.property?.name;\n const value = expression.operator?.value;\n const operator = expression.operator?.name;\n\n if (key && value && operator) {\n return {\n type: QueryEditorExpressionType.Operator,\n property: {\n type: QueryEditorPropertyType.String,\n name: key,\n },\n operator: {\n value,\n name: operator,\n },\n };\n }\n\n return undefined;\n}\n\n/**\n * Given an array of Expressions, flattens them to the leaf Operator expressions.\n * Note, this loses context of any nested ANDs or ORs, so will not be useful once we support nested conditions */\nfunction flattenOperatorExpressions(\n expressions: QueryEditorArrayExpression['expressions']\n): QueryEditorOperatorExpression[] {\n return expressions.flatMap((expression) => {\n if (expression.type === QueryEditorExpressionType.Operator) {\n return expression;\n }\n\n if (expression.type === QueryEditorExpressionType.And || expression.type === QueryEditorExpressionType.Or) {\n return flattenOperatorExpressions(expression.expressions);\n }\n\n // Expressions that we don't expect to find in the WHERE filter will be ignored\n return [];\n });\n}\n\n/** Returns a flattened list of WHERE filters, losing all context of nested filters or AND vs OR. Not suitable\n * if the UI supports nested conditions\n */\nexport function getFlattenedFilters(sql: SQLExpression): QueryEditorOperatorExpression[] {\n const where = sql.where;\n return flattenOperatorExpressions(where?.expressions ?? []);\n}\n\n/**\n * Given an array of Expressions, flattens them to the leaf Operator expressions.\n * Note, this loses context of any nested ANDs or ORs, so will not be useful once we support nested conditions */\nfunction flattenGroupByExpressions(\n expressions: QueryEditorArrayExpression['expressions']\n): QueryEditorGroupByExpression[] {\n return expressions.flatMap((expression) => {\n if (expression.type === QueryEditorExpressionType.GroupBy) {\n return expression;\n }\n\n // Expressions that we don't expect to find in the GROUP BY will be ignored\n return [];\n });\n}\n\n/** Returns a flattened list of GROUP BY expressions, losing all context of nested filters or AND vs OR.\n */\nexport function getFlattenedGroupBys(sql: SQLExpression): QueryEditorGroupByExpression[] {\n const groupBy = sql.groupBy;\n return flattenGroupByExpressions(groupBy?.expressions ?? []);\n}\n\n/** Converts a string array to a Dimensions object with null values **/\nexport function stringArrayToDimensions(arr: string[]): Dimensions {\n return arr.reduce((acc, curr) => {\n if (curr) {\n return { ...acc, [curr]: null };\n }\n return acc;\n }, {});\n}\n\nexport function setSql(query: CloudWatchMetricsQuery, sql: SQLExpression): CloudWatchMetricsQuery {\n return {\n ...query,\n sql: {\n ...(query.sql ?? {}),\n ...sql,\n },\n };\n}\n\nexport function setNamespace(query: CloudWatchMetricsQuery, namespace: string | undefined): CloudWatchMetricsQuery {\n const sql = query.sql ?? {};\n //updating `namespace` props for CloudWatchMetricsQuery\n query.namespace = namespace ? namespace : '';\n\n if (namespace === undefined) {\n return setSql(query, {\n from: undefined,\n });\n }\n\n // It's just a simple `FROM \"AWS/EC2\"` expression\n if (!sql.from || sql.from.type === QueryEditorExpressionType.Property) {\n return setSql(query, {\n from: {\n type: QueryEditorExpressionType.Property,\n property: {\n type: QueryEditorPropertyType.String,\n name: namespace,\n },\n },\n });\n }\n\n // It's a more complicated `FROM SCHEMA(\"AWS/EC2\", ...)` expression\n if (sql.from.type === QueryEditorExpressionType.Function) {\n const namespaceParam: QueryEditorFunctionParameterExpression = {\n type: QueryEditorExpressionType.FunctionParameter,\n name: namespace,\n };\n\n const labelKeys = (sql.from.parameters ?? []).slice(1);\n\n return setSql(query, {\n from: {\n type: QueryEditorExpressionType.Function,\n name: SCHEMA,\n parameters: [namespaceParam, ...labelKeys],\n },\n });\n }\n\n // TODO: do the with schema bit\n return query;\n}\n\nexport function setSchemaLabels(\n query: CloudWatchMetricsQuery,\n schemaLabels: Array<SelectableValue<string>> | SelectableValue<string>\n): CloudWatchMetricsQuery {\n const sql = query.sql ?? {};\n schemaLabels = Array.isArray(schemaLabels) ? schemaLabels.map((l) => l.value) : [schemaLabels.value];\n\n // schema labels are the second parameter in the schema function. `... FROM SCHEMA(\"AWS/EC2\", label1, label2 ...)`\n if (sql.from?.type === QueryEditorExpressionType.Function && sql.from.parameters?.length) {\n const parameters: QueryEditorFunctionParameterExpression[] = (schemaLabels ?? []).map((label: string) => ({\n type: QueryEditorExpressionType.FunctionParameter,\n name: label,\n }));\n const namespaceParam = (sql.from.parameters ?? [])[0];\n\n return setSql(query, {\n from: {\n type: QueryEditorExpressionType.Function,\n name: SCHEMA,\n parameters: [namespaceParam, ...parameters],\n },\n });\n }\n\n return query;\n}\n\nexport function setMetricName(query: CloudWatchMetricsQuery, metricName: string): CloudWatchMetricsQuery {\n const param: QueryEditorFunctionParameterExpression = {\n type: QueryEditorExpressionType.FunctionParameter,\n name: metricName,\n };\n\n return setSql(query, {\n select: {\n type: QueryEditorExpressionType.Function,\n ...(query.sql?.select ?? {}),\n parameters: [param],\n },\n });\n}\n\nexport function removeMetricName(query: CloudWatchMetricsQuery): CloudWatchMetricsQuery {\n const queryWithNoParams = { ...query };\n delete queryWithNoParams.sql?.select?.parameters;\n\n return queryWithNoParams;\n}\n\nexport function setAggregation(query: CloudWatchMetricsQuery, aggregation: string): CloudWatchMetricsQuery {\n return setSql(query, {\n select: {\n type: QueryEditorExpressionType.Function,\n ...(query.sql?.select ?? {}),\n name: aggregation,\n },\n });\n}\n\nexport function setOrderBy(query: CloudWatchMetricsQuery, aggregation: string): CloudWatchMetricsQuery {\n return setSql(query, {\n orderBy: {\n type: QueryEditorExpressionType.Function,\n name: aggregation,\n },\n });\n}\n\nexport function setWithSchema(query: CloudWatchMetricsQuery, withSchema: boolean): CloudWatchMetricsQuery {\n const namespace = getNamespaceFromExpression((query.sql ?? {}).from);\n\n if (withSchema) {\n const namespaceParam: QueryEditorFunctionParameterExpression = {\n type: QueryEditorExpressionType.FunctionParameter,\n name: namespace,\n };\n\n return setSql(query, {\n from: {\n type: QueryEditorExpressionType.Function,\n name: SCHEMA,\n parameters: [namespaceParam],\n },\n });\n }\n\n return setSql(query, {\n from: {\n type: QueryEditorExpressionType.Property,\n property: {\n type: QueryEditorPropertyType.String,\n name: namespace,\n },\n },\n });\n}\n\n/** Sets the left hand side (InstanceId) in an OperatorExpression\n * Accepts a partial expression to use in an editor\n */\nexport function setOperatorExpressionProperty(\n expression: Partial<QueryEditorOperatorExpression>,\n property: string\n): QueryEditorOperatorExpression {\n return {\n type: QueryEditorExpressionType.Operator,\n property: {\n type: QueryEditorPropertyType.String,\n name: property,\n },\n operator: expression.operator ?? {},\n };\n}\n\n/** Sets the operator (\"==\") in an OperatorExpression\n * Accepts a partial expression to use in an editor\n */\nexport function setOperatorExpressionName(\n expression: Partial<QueryEditorOperatorExpression>,\n name: string\n): QueryEditorOperatorExpression {\n return {\n type: QueryEditorExpressionType.Operator,\n property: expression.property ?? {\n type: QueryEditorPropertyType.String,\n },\n operator: {\n ...expression.operator,\n name,\n },\n };\n}\n\n/** Sets the right hand side (\"i-abc123445\") in an OperatorExpression\n * Accepts a partial expression to use in an editor\n */\nexport function setOperatorExpressionValue(\n expression: Partial<QueryEditorOperatorExpression>,\n value: string\n): QueryEditorOperatorExpression {\n return {\n type: QueryEditorExpressionType.Operator,\n property: expression.property ?? {\n type: QueryEditorPropertyType.String,\n },\n operator: {\n ...expression.operator,\n value,\n },\n };\n}\n\n/** Creates a GroupByExpression for a specified field\n */\nexport function setGroupByField(field: string): QueryEditorGroupByExpression {\n return {\n type: QueryEditorExpressionType.GroupBy,\n property: {\n type: QueryEditorPropertyType.String,\n name: field,\n },\n };\n}\n","import React, { useEffect, useMemo } from 'react';\n\nimport { SelectableValue, toOption } from '@grafana/data';\nimport { EditorField, EditorFieldGroup, EditorSwitch } from '@grafana/experimental';\nimport { Select } from '@grafana/ui';\n\nimport { STATISTICS } from '../../cloudwatch-sql/language';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { useDimensionKeys, useMetrics, useNamespaces } from '../../hooks';\nimport { CloudWatchMetricsQuery } from '../../types';\nimport { appendTemplateVariables } from '../../utils/utils';\n\nimport {\n getMetricNameFromExpression,\n getNamespaceFromExpression,\n getSchemaLabelKeys as getSchemaLabels,\n isUsingWithSchema,\n removeMetricName,\n setAggregation,\n setMetricName,\n setNamespace,\n setSchemaLabels,\n setWithSchema,\n stringArrayToDimensions,\n} from './utils';\n\ninterface SQLBuilderSelectRowProps {\n query: CloudWatchMetricsQuery;\n datasource: CloudWatchDatasource;\n onQueryChange: (query: CloudWatchMetricsQuery) => void;\n}\n\nconst AGGREGATIONS = STATISTICS.map(toOption);\n\nconst SQLBuilderSelectRow: React.FC<SQLBuilderSelectRowProps> = ({ datasource, query, onQueryChange }) => {\n const sql = query.sql ?? {};\n\n const aggregation = sql.select?.name;\n useEffect(() => {\n if (!aggregation) {\n onQueryChange(setAggregation(query, STATISTICS[0]));\n }\n }, [aggregation, onQueryChange, query]);\n\n const metricName = getMetricNameFromExpression(sql.select);\n const namespace = getNamespaceFromExpression(sql.from);\n const schemaLabels = getSchemaLabels(sql.from);\n const withSchemaEnabled = isUsingWithSchema(sql.from);\n\n const namespaceOptions = useNamespaces(datasource);\n const metricOptions = useMetrics(datasource, query.region, namespace);\n const existingFilters = useMemo(() => stringArrayToDimensions(schemaLabels ?? []), [schemaLabels]);\n const unusedDimensionKeys = useDimensionKeys(datasource, query.region, namespace, metricName, existingFilters);\n const dimensionKeys = useMemo(\n () => (schemaLabels?.length ? [...unusedDimensionKeys, ...schemaLabels.map(toOption)] : unusedDimensionKeys),\n [unusedDimensionKeys, schemaLabels]\n );\n\n const onNamespaceChange = async (query: CloudWatchMetricsQuery) => {\n const validatedQuery = await validateMetricName(query);\n onQueryChange(validatedQuery);\n };\n\n const validateMetricName = async (query: CloudWatchMetricsQuery) => {\n let { region, sql } = query;\n await datasource.getMetrics(query.namespace, region).then((result: Array<SelectableValue<string>>) => {\n if (!result.some((metric) => metric.value === metricName)) {\n sql = removeMetricName(query).sql;\n }\n });\n return { ...query, sql };\n };\n\n return (\n <>\n <EditorFieldGroup>\n <EditorField label=\"Namespace\" width={16}>\n <Select\n aria-label=\"Namespace\"\n value={namespace ? toOption(namespace) : null}\n inputId={`${query.refId}-cloudwatch-sql-namespace`}\n options={namespaceOptions}\n allowCustomValue\n onChange={({ value }) => value && onNamespaceChange(setNamespace(query, value))}\n />\n </EditorField>\n\n <EditorField label=\"With schema\">\n <EditorSwitch\n id={`${query.refId}-cloudwatch-sql-withSchema`}\n value={withSchemaEnabled}\n onChange={(ev) =>\n ev.target instanceof HTMLInputElement && onQueryChange(setWithSchema(query, ev.target.checked))\n }\n />\n </EditorField>\n\n {withSchemaEnabled && (\n <EditorField label=\"Schema labels\" disabled={!namespace}>\n <Select\n id={`${query.refId}-cloudwatch-sql-schema-label-keys`}\n width=\"auto\"\n isMulti={true}\n value={schemaLabels ? schemaLabels.map(toOption) : null}\n options={dimensionKeys}\n allowCustomValue\n onChange={(item) => item && onQueryChange(setSchemaLabels(query, item))}\n />\n </EditorField>\n )}\n </EditorFieldGroup>\n\n <EditorFieldGroup>\n <EditorField label=\"Metric name\" width={16}>\n <Select\n aria-label=\"Metric name\"\n value={metricName ? toOption(metricName) : null}\n options={metricOptions}\n allowCustomValue\n onChange={({ value }) => value && onQueryChange(setMetricName(query, value))}\n />\n </EditorField>\n\n <EditorField label=\"Aggregation\" width={16}>\n <Select\n aria-label=\"Aggregation\"\n value={aggregation ? toOption(aggregation) : null}\n options={appendTemplateVariables(datasource, AGGREGATIONS)}\n onChange={({ value }) => value && onQueryChange(setAggregation(query, value))}\n />\n </EditorField>\n </EditorFieldGroup>\n </>\n );\n};\n\nexport default SQLBuilderSelectRow;\n","import React, { useMemo, useState } from 'react';\nimport { useAsyncFn } from 'react-use';\n\nimport { SelectableValue, toOption } from '@grafana/data';\nimport { AccessoryButton, EditorList, InputGroup } from '@grafana/experimental';\nimport { Select } from '@grafana/ui';\n\nimport { COMPARISON_OPERATORS, EQUALS } from '../../cloudwatch-sql/language';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { QueryEditorExpressionType, QueryEditorOperatorExpression, QueryEditorPropertyType } from '../../expressions';\nimport { useDimensionKeys } from '../../hooks';\nimport { CloudWatchMetricsQuery } from '../../types';\nimport { appendTemplateVariables } from '../../utils/utils';\n\nimport {\n getFlattenedFilters,\n getMetricNameFromExpression,\n getNamespaceFromExpression,\n sanitizeOperator,\n setOperatorExpressionName,\n setOperatorExpressionProperty,\n setOperatorExpressionValue,\n setSql,\n} from './utils';\n\ninterface SQLFilterProps {\n query: CloudWatchMetricsQuery;\n datasource: CloudWatchDatasource;\n onQueryChange: (query: CloudWatchMetricsQuery) => void;\n}\n\nconst OPERATORS = COMPARISON_OPERATORS.map(toOption);\n\nconst SQLFilter: React.FC<SQLFilterProps> = ({ query, onQueryChange, datasource }) => {\n const filtersFromQuery = useMemo(() => getFlattenedFilters(query.sql ?? {}), [query.sql]);\n const [filters, setFilters] = useState<QueryEditorOperatorExpression[]>(filtersFromQuery);\n\n const onChange = (newItems: Array<Partial<QueryEditorOperatorExpression>>) => {\n // As new (empty object) items come in, with need to make sure they have the correct type\n const cleaned = newItems.map(\n (v): QueryEditorOperatorExpression => ({\n type: QueryEditorExpressionType.Operator,\n property: v.property ?? { type: QueryEditorPropertyType.String },\n operator: v.operator ?? {\n name: EQUALS,\n },\n })\n );\n\n setFilters(cleaned);\n\n // Only save valid and complete filters into the query state\n const validExpressions: QueryEditorOperatorExpression[] = [];\n for (const operatorExpression of cleaned) {\n const validated = sanitizeOperator(operatorExpression);\n if (validated) {\n validExpressions.push(validated);\n }\n }\n\n const where = validExpressions.length\n ? {\n type: QueryEditorExpressionType.And as const,\n expressions: validExpressions,\n }\n : undefined;\n\n onQueryChange(setSql(query, { where }));\n };\n\n return <EditorList items={filters} onChange={onChange} renderItem={makeRenderFilter(datasource, query)} />;\n};\n\n// Making component functions in the render body is not recommended, but it works for now.\n// If some problems arise (perhaps with state going missing), consider this to be a potential cause\nfunction makeRenderFilter(datasource: CloudWatchDatasource, query: CloudWatchMetricsQuery) {\n function renderFilter(\n item: Partial<QueryEditorOperatorExpression>,\n onChange: (item: QueryEditorOperatorExpression) => void,\n onDelete: () => void\n ) {\n return <FilterItem datasource={datasource} query={query} filter={item} onChange={onChange} onDelete={onDelete} />;\n }\n\n return renderFilter;\n}\n\nexport default SQLFilter;\n\ninterface FilterItemProps {\n datasource: CloudWatchDatasource;\n query: CloudWatchMetricsQuery;\n filter: Partial<QueryEditorOperatorExpression>;\n onChange: (item: QueryEditorOperatorExpression) => void;\n onDelete: () => void;\n}\n\nconst FilterItem: React.FC<FilterItemProps> = (props) => {\n const { datasource, query, filter, onChange, onDelete } = props;\n const sql = query.sql ?? {};\n\n const namespace = getNamespaceFromExpression(sql.from);\n const metricName = getMetricNameFromExpression(sql.select);\n\n const dimensionKeys = useDimensionKeys(datasource, query.region, namespace, metricName);\n\n const loadDimensionValues = async () => {\n if (!filter.property?.name) {\n return [];\n }\n\n return datasource\n .getDimensionValues(query.region, namespace, metricName, filter.property.name, {})\n .then((result: Array<SelectableValue<string>>) => {\n return appendTemplateVariables(datasource, result);\n });\n };\n\n const [state, loadOptions] = useAsyncFn(loadDimensionValues, [\n query.region,\n namespace,\n metricName,\n filter.property?.name,\n ]);\n\n return (\n <InputGroup>\n <Select\n width=\"auto\"\n value={filter.property?.name ? toOption(filter.property?.name) : null}\n options={dimensionKeys}\n allowCustomValue\n onChange={({ value }) => value && onChange(setOperatorExpressionProperty(filter, value))}\n />\n\n <Select\n width=\"auto\"\n value={filter.operator?.name && toOption(filter.operator.name)}\n options={OPERATORS}\n onChange={({ value }) => value && onChange(setOperatorExpressionName(filter, value))}\n />\n\n <Select\n width=\"auto\"\n isLoading={state.loading}\n value={\n filter.operator?.value && typeof filter.operator?.value === 'string' ? toOption(filter.operator?.value) : null\n }\n options={state.value}\n allowCustomValue\n onOpenMenu={loadOptions}\n onChange={({ value }) => value && onChange(setOperatorExpressionValue(filter, value))}\n />\n\n <AccessoryButton aria-label=\"remove\" icon=\"times\" variant=\"secondary\" onClick={onDelete} />\n </InputGroup>\n );\n};\n","import React, { useMemo, useState } from 'react';\n\nimport { SelectableValue, toOption } from '@grafana/data';\nimport { AccessoryButton, EditorList, InputGroup } from '@grafana/experimental';\nimport { Select } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../../datasource';\nimport { QueryEditorExpressionType, QueryEditorGroupByExpression, QueryEditorPropertyType } from '../../expressions';\nimport { useDimensionKeys } from '../../hooks';\nimport { CloudWatchMetricsQuery } from '../../types';\n\nimport {\n getFlattenedGroupBys,\n getMetricNameFromExpression,\n getNamespaceFromExpression,\n setGroupByField,\n setSql,\n} from './utils';\n\ninterface SQLGroupByProps {\n query: CloudWatchMetricsQuery;\n datasource: CloudWatchDatasource;\n onQueryChange: (query: CloudWatchMetricsQuery) => void;\n}\n\nconst SQLGroupBy: React.FC<SQLGroupByProps> = ({ query, datasource, onQueryChange }) => {\n const sql = query.sql ?? {};\n const groupBysFromQuery = useMemo(() => getFlattenedGroupBys(query.sql ?? {}), [query.sql]);\n const [items, setItems] = useState<QueryEditorGroupByExpression[]>(groupBysFromQuery);\n\n const namespace = getNamespaceFromExpression(sql.from);\n const metricName = getMetricNameFromExpression(sql.select);\n\n const baseOptions = useDimensionKeys(datasource, query.region, namespace, metricName);\n const options = useMemo(\n // Exclude options we've already selected\n () => baseOptions.filter((option) => !groupBysFromQuery.some((v) => v.property.name === option.value)),\n [baseOptions, groupBysFromQuery]\n );\n\n const onChange = (newItems: Array<Partial<QueryEditorGroupByExpression>>) => {\n // As new (empty object) items come in, with need to make sure they have the correct type\n const cleaned = newItems.map(\n (v): QueryEditorGroupByExpression => ({\n type: QueryEditorExpressionType.GroupBy,\n property: {\n type: QueryEditorPropertyType.String,\n name: v.property?.name,\n },\n })\n );\n\n setItems(cleaned);\n\n // Only save complete expressions into the query state;\n const completeExpressions = cleaned.filter((v) => v.property?.name);\n\n const groupBy = completeExpressions.length\n ? {\n type: QueryEditorExpressionType.And as const,\n expressions: completeExpressions,\n }\n : undefined;\n\n onQueryChange(setSql(query, { groupBy }));\n };\n\n return <EditorList items={items} onChange={onChange} renderItem={makeRenderItem(options)} />;\n};\n\nfunction makeRenderItem(options: Array<SelectableValue<string>>) {\n function renderItem(\n item: Partial<QueryEditorGroupByExpression>,\n onChange: (item: QueryEditorGroupByExpression) => void,\n onDelete: () => void\n ) {\n return <GroupByItem options={options} item={item} onChange={onChange} onDelete={onDelete} />;\n }\n\n return renderItem;\n}\n\ninterface GroupByItemProps {\n options: Array<SelectableValue<string>>;\n item: Partial<QueryEditorGroupByExpression>;\n onChange: (item: QueryEditorGroupByExpression) => void;\n onDelete: () => void;\n}\n\nconst GroupByItem: React.FC<GroupByItemProps> = (props) => {\n const { options, item, onChange, onDelete } = props;\n const fieldName = item.property?.name;\n\n return (\n <InputGroup>\n <Select\n aria-label={`Group by ${fieldName ?? 'filter key'}`}\n width=\"auto\"\n value={fieldName ? toOption(fieldName) : null}\n options={options}\n allowCustomValue\n onChange={({ value }) => value && onChange(setGroupByField(value))}\n />\n\n <AccessoryButton aria-label=\"remove\" icon=\"times\" variant=\"secondary\" onClick={onDelete} />\n </InputGroup>\n );\n};\n\nexport default SQLGroupBy;\n","import React from 'react';\n\nimport { SelectableValue, toOption } from '@grafana/data';\nimport { AccessoryButton, EditorField, EditorFieldGroup, InputGroup } from '@grafana/experimental';\nimport { Select } from '@grafana/ui';\n\nimport { ASC, DESC, STATISTICS } from '../../cloudwatch-sql/language';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { CloudWatchMetricsQuery } from '../../types';\nimport { appendTemplateVariables } from '../../utils/utils';\n\nimport { setOrderBy, setSql } from './utils';\n\ninterface SQLBuilderSelectRowProps {\n query: CloudWatchMetricsQuery;\n datasource: CloudWatchDatasource;\n onQueryChange: (query: CloudWatchMetricsQuery) => void;\n}\n\nconst orderByDirections: Array<SelectableValue<string>> = [\n { label: ASC, value: ASC },\n { label: DESC, value: DESC },\n];\n\nconst SQLOrderByGroup: React.FC<SQLBuilderSelectRowProps> = ({ query, onQueryChange, datasource }) => {\n const sql = query.sql ?? {};\n const orderBy = sql.orderBy?.name;\n const orderByDirection = sql.orderByDirection;\n\n return (\n <EditorFieldGroup>\n <EditorField label=\"Order by\" optional width={16}>\n <InputGroup>\n <Select\n aria-label=\"Order by\"\n onChange={({ value }) => value && onQueryChange(setOrderBy(query, value))}\n options={appendTemplateVariables(datasource, STATISTICS.map(toOption))}\n value={orderBy ? toOption(orderBy) : null}\n />\n {orderBy && (\n <AccessoryButton\n aria-label=\"remove\"\n icon=\"times\"\n variant=\"secondary\"\n onClick={() => onQueryChange(setSql(query, { orderBy: undefined }))}\n />\n )}\n </InputGroup>\n </EditorField>\n\n <EditorField label=\"Direction\" disabled={!orderBy} width={16}>\n <Select\n aria-label=\"Direction\"\n inputId=\"cloudwatch-sql-order-by-direction\"\n value={orderByDirection ? toOption(orderByDirection) : orderByDirections[0]}\n options={appendTemplateVariables(datasource, orderByDirections)}\n onChange={(item) => item && onQueryChange(setSql(query, { orderByDirection: item.value }))}\n />\n </EditorField>\n </EditorFieldGroup>\n );\n};\n\nexport default SQLOrderByGroup;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { EditorField, EditorRow, EditorRows } from '@grafana/experimental';\nimport { Input } from '@grafana/ui';\n\nimport SQLGenerator from '../../cloudwatch-sql/SQLGenerator';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { CloudWatchMetricsQuery } from '../../types';\n\nimport SQLBuilderSelectRow from './SQLBuilderSelectRow';\nimport SQLFilter from './SQLFilter';\nimport SQLGroupBy from './SQLGroupBy';\nimport SQLOrderByGroup from './SQLOrderByGroup';\nimport { setSql } from './utils';\n\nexport type Props = {\n query: CloudWatchMetricsQuery;\n datasource: CloudWatchDatasource;\n onChange: (value: CloudWatchMetricsQuery) => void;\n onRunQuery: () => void;\n};\n\nexport function SQLBuilderEditor({ query, datasource, onChange, onRunQuery }: React.PropsWithChildren<Props>) {\n const sql = query.sql ?? {};\n\n const onQueryChange = useCallback(\n (query: CloudWatchMetricsQuery) => {\n const sqlGenerator = new SQLGenerator();\n const sqlString = sqlGenerator.expressionToSqlQuery(query.sql ?? {});\n const fullQuery = {\n ...query,\n sqlExpression: sqlString,\n };\n\n onChange(fullQuery);\n onRunQuery();\n },\n [onChange, onRunQuery]\n );\n\n const [sqlPreview, setSQLPreview] = useState<string | undefined>();\n useEffect(() => {\n const sqlGenerator = new SQLGenerator();\n const sqlString = sqlGenerator.expressionToSqlQuery(query.sql ?? {});\n if (sqlPreview !== sqlString) {\n setSQLPreview(sqlString);\n }\n }, [query, sqlPreview, setSQLPreview]);\n\n return (\n <EditorRows>\n <EditorRow>\n <SQLBuilderSelectRow query={query} onQueryChange={onQueryChange} datasource={datasource} />\n </EditorRow>\n\n <EditorRow>\n <EditorField label=\"Filter\" optional={true}>\n <SQLFilter query={query} onQueryChange={onQueryChange} datasource={datasource} />\n </EditorField>\n </EditorRow>\n\n <EditorRow>\n <EditorField label=\"Group by\" optional>\n <SQLGroupBy query={query} onQueryChange={onQueryChange} datasource={datasource} />\n </EditorField>\n\n <SQLOrderByGroup query={query} onQueryChange={onQueryChange} datasource={datasource}></SQLOrderByGroup>\n\n <EditorField label=\"Limit\" optional>\n <Input\n id={`${query.refId}-cloudwatch-sql-builder-editor-limit`}\n value={sql.limit}\n onChange={(e) => {\n const val = e.currentTarget.valueAsNumber;\n onQueryChange(setSql(query, { limit: isNaN(val) ? undefined : val }));\n }}\n type=\"number\"\n min={1}\n />\n </EditorField>\n </EditorRow>\n\n {sqlPreview && (\n <EditorRow>\n {process.env.NODE_ENV === 'development' && <pre>{JSON.stringify(query.sql ?? {}, null, 2)}</pre>}\n <pre>{sqlPreview ?? ''}</pre>\n </EditorRow>\n )}\n </EditorRows>\n );\n}\n","import { LanguageDefinition } from '../monarch/register';\n\nconst cloudWatchMetricMathLanguageDefinition: LanguageDefinition = {\n id: 'cloudwatch-MetricMath',\n extensions: [],\n aliases: [],\n mimetypes: [],\n loader: () => import('./language'),\n};\nexport default cloudWatchMetricMathLanguageDefinition;\n","export const TRIGGER_SUGGEST = {\n id: 'editor.action.triggerSuggest',\n title: '',\n};\n","import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\n\nimport { Monaco } from '@grafana/ui';\n\nimport { Completeable } from './types';\n\nexport type LanguageDefinition = {\n id: string;\n extensions: string[];\n aliases: string[];\n mimetypes: string[];\n loader: () => Promise<{\n language: monacoType.languages.IMonarchLanguage;\n conf: monacoType.languages.LanguageConfiguration;\n }>;\n};\n\nexport const registerLanguage = (\n monaco: Monaco,\n language: LanguageDefinition,\n completionItemProvider: Completeable\n) => {\n const { id, loader } = language;\n\n const languages = monaco.languages.getLanguages();\n if (languages.find((l) => l.id === id)) {\n return;\n }\n\n monaco.languages.register({ id });\n loader().then((monarch) => {\n monaco.languages.setMonarchTokensProvider(id, monarch.language);\n monaco.languages.setLanguageConfiguration(id, monarch.conf);\n monaco.languages.registerCompletionItemProvider(id, completionItemProvider.getCompletionProvider(monaco, language));\n });\n};\n","import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\nimport React, { useCallback, useRef } from 'react';\n\nimport { CodeEditor, Monaco } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport language from '../metric-math/definition';\nimport { TRIGGER_SUGGEST } from '../monarch/commands';\nimport { registerLanguage } from '../monarch/register';\n\nexport interface Props {\n onChange: (query: string) => void;\n onRunQuery: () => void;\n expression: string;\n datasource: CloudWatchDatasource;\n}\n\nexport function MathExpressionQueryField({\n expression: query,\n onChange,\n onRunQuery,\n datasource,\n}: React.PropsWithChildren<Props>) {\n const containerRef = useRef<HTMLDivElement>(null);\n const onEditorMount = useCallback(\n (editor: monacoType.editor.IStandaloneCodeEditor, monaco: Monaco) => {\n editor.onDidFocusEditorText(() => editor.trigger(TRIGGER_SUGGEST.id, TRIGGER_SUGGEST.id, {}));\n editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => {\n const text = editor.getValue();\n onChange(text);\n onRunQuery();\n });\n\n // auto resizes the editor to be the height of the content it holds\n // this code comes from the Prometheus query editor.\n // We may wish to consider abstracting it into the grafana/ui repo in the future\n const updateElementHeight = () => {\n const containerDiv = containerRef.current;\n if (containerDiv !== null && editor.getContentHeight() < 200) {\n const pixelHeight = Math.max(32, editor.getContentHeight());\n containerDiv.style.height = `${pixelHeight}px`;\n containerDiv.style.width = '100%';\n const pixelWidth = containerDiv.clientWidth;\n editor.layout({ width: pixelWidth, height: pixelHeight });\n }\n };\n\n editor.onDidContentSizeChange(updateElementHeight);\n updateElementHeight();\n },\n [onChange, onRunQuery]\n );\n\n return (\n <div ref={containerRef}>\n <CodeEditor\n monacoOptions={{\n // without this setting, the auto-resize functionality causes an infinite loop, don't remove it!\n scrollBeyondLastLine: false,\n\n // These additional options are style focused and are a subset of those in the query editor in Prometheus\n fontSize: 14,\n lineNumbers: 'off',\n renderLineHighlight: 'none',\n scrollbar: {\n vertical: 'hidden',\n horizontal: 'hidden',\n },\n suggestFontSize: 12,\n wordWrap: 'on',\n padding: {\n top: 6,\n },\n }}\n language={language.id}\n value={query}\n onBlur={(value) => {\n if (value !== query) {\n onChange(value);\n onRunQuery();\n }\n }}\n onBeforeEditorMount={(monaco: Monaco) =>\n registerLanguage(monaco, language, datasource.metricMathCompletionItemProvider)\n }\n onEditorDidMount={onEditorMount}\n />\n </div>\n );\n}\n","import { LanguageDefinition } from '../monarch/register';\n\nconst cloudWatchSqlLanguageDefinition: LanguageDefinition = {\n id: 'cloudwatch-sql',\n extensions: ['.cloudwatchSql'],\n aliases: ['CloudWatch', 'cloudwatch', 'CloudWatchSQL'],\n mimetypes: [],\n loader: () => import('./language'),\n};\nexport default cloudWatchSqlLanguageDefinition;\n","import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\nimport React, { FunctionComponent, useCallback, useEffect } from 'react';\n\nimport { CodeEditor, Monaco } from '@grafana/ui';\n\nimport language from '../cloudwatch-sql/definition';\nimport { CloudWatchDatasource } from '../datasource';\nimport { TRIGGER_SUGGEST } from '../monarch/commands';\nimport { registerLanguage } from '../monarch/register';\n\nexport interface Props {\n region: string;\n sql: string;\n onChange: (sql: string) => void;\n onRunQuery: () => void;\n datasource: CloudWatchDatasource;\n}\n\nexport const SQLCodeEditor: FunctionComponent<Props> = ({ region, sql, onChange, onRunQuery, datasource }) => {\n useEffect(() => {\n datasource.sqlCompletionItemProvider.setRegion(region);\n }, [region, datasource]);\n\n const onEditorMount = useCallback(\n (editor: monacoType.editor.IStandaloneCodeEditor, monaco: Monaco) => {\n editor.onDidFocusEditorText(() => editor.trigger(TRIGGER_SUGGEST.id, TRIGGER_SUGGEST.id, {}));\n editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => {\n const text = editor.getValue();\n onChange(text);\n onRunQuery();\n });\n },\n [onChange, onRunQuery]\n );\n\n return (\n <CodeEditor\n height={'150px'}\n language={language.id}\n value={sql}\n onBlur={(value) => {\n if (value !== sql) {\n onChange(value);\n }\n }}\n showMiniMap={false}\n showLineNumbers={true}\n onBeforeEditorMount={(monaco: Monaco) => registerLanguage(monaco, language, datasource.sqlCompletionItemProvider)}\n onEditorDidMount={onEditorMount}\n />\n );\n};\n","import { monacoTypes } from '@grafana/ui';\n\nimport { TokenTypes } from './types';\n\nexport class LinkedToken {\n constructor(\n public type: string,\n public value: string,\n public range: monacoTypes.IRange,\n public previous: LinkedToken | null,\n public next: LinkedToken | null,\n public tokenTypes: TokenTypes\n ) {}\n\n isKeyword(): boolean {\n return this.type === this.tokenTypes.Keyword;\n }\n\n isWhiteSpace(): boolean {\n return this.type === this.tokenTypes.Whitespace;\n }\n\n isParenthesis(): boolean {\n return this.type === this.tokenTypes.Parenthesis;\n }\n\n isIdentifier(): boolean {\n return this.type === this.tokenTypes.Identifier;\n }\n\n isString(): boolean {\n return this.type === this.tokenTypes.String;\n }\n\n isDoubleQuotedString(): boolean {\n return this.type === this.tokenTypes.Type;\n }\n\n isVariable(): boolean {\n return this.type === this.tokenTypes.Variable;\n }\n\n isFunction(): boolean {\n return this.type === this.tokenTypes.Function;\n }\n\n isNumber(): boolean {\n return this.type === this.tokenTypes.Number;\n }\n\n is(type: string, value?: string | number | boolean): boolean {\n const isType = this.type === type;\n return value !== undefined ? isType && this.value === value : isType;\n }\n\n endsWith(value: string | number | boolean): boolean {\n return this.value === value || this.value[this.value.length - 1] === value;\n }\n\n getPreviousNonWhiteSpaceToken(): LinkedToken | null {\n let curr = this.previous;\n while (curr != null) {\n if (!curr.isWhiteSpace()) {\n return curr;\n }\n curr = curr.previous;\n }\n return null;\n }\n\n getPreviousOfType(type: string, value?: string): LinkedToken | null {\n let curr = this.previous;\n while (curr != null) {\n const isType = curr.type === type;\n if (value !== undefined ? isType && curr.value === value : isType) {\n return curr;\n }\n curr = curr.previous;\n }\n return null;\n }\n\n getPreviousUntil(type: string, ignoreTypes: string[], value?: string): LinkedToken[] | null {\n let tokens: LinkedToken[] = [];\n let curr = this.previous;\n while (curr != null) {\n if (ignoreTypes.some((t) => t === curr?.type)) {\n curr = curr.previous;\n continue;\n }\n\n const isType = curr.type === type;\n if (value !== undefined ? isType && curr.value === value : isType) {\n return tokens;\n }\n if (!curr.isWhiteSpace()) {\n tokens.push(curr);\n }\n curr = curr.previous;\n }\n\n return tokens;\n }\n\n getNextUntil(type: string, ignoreTypes: string[], value?: string): LinkedToken[] | null {\n let tokens: LinkedToken[] = [];\n let curr = this.next;\n while (curr != null) {\n if (ignoreTypes.some((t) => t === curr?.type)) {\n curr = curr.next;\n continue;\n }\n\n const isType = curr.type === type;\n if (value !== undefined ? isType && curr.value === value : isType) {\n return tokens;\n }\n if (!curr.isWhiteSpace()) {\n tokens.push(curr);\n }\n curr = curr.next;\n }\n\n return tokens;\n }\n\n getPreviousKeyword(): LinkedToken | null {\n let curr = this.previous;\n while (curr != null) {\n if (curr.isKeyword()) {\n return curr;\n }\n curr = curr.previous;\n }\n return null;\n }\n\n getNextNonWhiteSpaceToken(): LinkedToken | null {\n let curr = this.next;\n while (curr != null) {\n if (!curr.isWhiteSpace()) {\n return curr;\n }\n curr = curr.next;\n }\n return null;\n }\n\n getNextOfType(type: string, value?: string): LinkedToken | null {\n let curr = this.next;\n while (curr != null) {\n const isType = curr.type === type;\n if (value !== undefined ? isType && curr.value === value : isType) {\n return curr;\n }\n curr = curr.next;\n }\n return null;\n }\n}\n","import type { monacoTypes } from '@grafana/ui';\n\nimport { LinkedToken } from './LinkedToken';\nimport { LanguageDefinition } from './register';\nimport { Monaco, TokenTypes } from './types';\n\nexport function linkedTokenBuilder(\n monaco: Monaco,\n language: LanguageDefinition,\n model: monacoTypes.editor.ITextModel,\n position: monacoTypes.IPosition,\n tokenTypes: TokenTypes\n) {\n let current: LinkedToken | null = null;\n let previous: LinkedToken | null = null;\n const tokensPerLine = monaco.editor.tokenize(model.getValue() ?? '', language.id);\n\n for (let lineIndex = 0; lineIndex < tokensPerLine.length; lineIndex++) {\n const tokens = tokensPerLine[lineIndex];\n // In case position is first column in new line, add empty whitespace token so that links are not broken\n if (!tokens.length && previous) {\n const token: monacoTypes.Token = {\n offset: 0,\n type: tokenTypes.Whitespace,\n language: language.id,\n _tokenBrand: undefined,\n };\n tokens.push(token);\n }\n\n for (let columnIndex = 0; columnIndex < tokens.length; columnIndex++) {\n const token = tokens[columnIndex];\n let endColumn =\n tokens.length > columnIndex + 1 ? tokens[columnIndex + 1].offset + 1 : model.getLineLength(lineIndex + 1) + 1;\n\n const range: monacoTypes.IRange = {\n startLineNumber: lineIndex + 1,\n startColumn: token.offset === 0 ? 0 : token.offset + 1,\n endLineNumber: lineIndex + 1,\n endColumn,\n };\n\n const value = model.getValueInRange(range);\n const newToken: LinkedToken = new LinkedToken(token.type, value, range, previous, null, tokenTypes);\n\n if (monaco.Range.containsPosition(range, position)) {\n current = newToken;\n }\n\n if (previous) {\n previous.next = newToken;\n }\n previous = newToken;\n }\n }\n\n return current;\n}\n","import { monacoTypes } from '@grafana/ui';\n\nimport { LanguageDefinition } from './register';\n\nexport interface TokenTypes {\n Parenthesis: string;\n Whitespace: string;\n Keyword: string;\n Delimiter: string;\n Operator: string;\n Identifier: string;\n Type: string;\n Function: string;\n Number: string;\n String: string;\n Variable: string;\n}\n\nexport enum StatementPosition {\n Unknown,\n // sql\n SelectKeyword,\n AfterSelectKeyword,\n AfterSelectFuncFirstArgument,\n AfterFromKeyword,\n SchemaFuncFirstArgument,\n SchemaFuncExtraArgument,\n FromKeyword,\n AfterFrom,\n WhereKey,\n WhereComparisonOperator,\n WhereValue,\n AfterWhereValue,\n AfterGroupByKeywords,\n AfterGroupBy,\n AfterOrderByKeywords,\n AfterOrderByFunction,\n AfterOrderByDirection,\n // metric math\n PredefinedFunction,\n SearchFuncSecondArg,\n SearchFuncThirdArg,\n PredefinedFuncSecondArg,\n AfterFunction,\n WithinString,\n}\n\nexport enum SuggestionKind {\n SelectKeyword,\n FunctionsWithArguments,\n Metrics,\n FromKeyword,\n SchemaKeyword,\n Namespaces,\n LabelKeys,\n WhereKeyword,\n GroupByKeywords,\n OrderByKeywords,\n FunctionsWithoutArguments,\n LimitKeyword,\n SortOrderDirectionKeyword,\n ComparisonOperators,\n LabelValues,\n LogicalOperators,\n\n // metricmath,\n KeywordArguments,\n Operators,\n Statistic,\n Period,\n}\n\nexport enum CompletionItemPriority {\n High = 'a',\n MediumHigh = 'd',\n Medium = 'g',\n MediumLow = 'k',\n Low = 'q',\n}\n\nexport interface Editor {\n tokenize: (value: string, languageId: string) => monacoTypes.Token[][];\n}\n\nexport interface Range {\n containsPosition: (range: monacoTypes.IRange, position: monacoTypes.IPosition) => boolean;\n fromPositions: (start: monacoTypes.IPosition, end?: monacoTypes.IPosition) => monacoTypes.Range;\n}\n\nexport interface Languages {\n CompletionItemInsertTextRule: {\n InsertAsSnippet: 4;\n };\n CompletionItemKind: {\n Function: 1;\n };\n}\nexport interface Monaco {\n editor: Editor;\n Range: Range;\n languages: Languages;\n}\n\nexport interface Completeable {\n getCompletionProvider(\n monaco: Monaco,\n languageDefinition: LanguageDefinition\n ): monacoTypes.languages.CompletionItemProvider;\n}\n","import { LanguageDefinition } from '../monarch/register';\n\nconst cloudWatchDynamicLabelsLanguageDefinition: LanguageDefinition = {\n id: 'cloudwatch-dynamicLabels',\n extensions: [],\n aliases: [],\n mimetypes: [],\n loader: () => import('./language'),\n};\nexport default cloudWatchDynamicLabelsLanguageDefinition;\n","import { css, cx } from '@emotion/css';\nimport type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';\nimport React, { useCallback, useRef } from 'react';\n\nimport { CodeEditor, getInputStyles, Monaco, useTheme2 } from '@grafana/ui';\n\nimport { DynamicLabelsCompletionItemProvider } from '../dynamic-labels/CompletionItemProvider';\nimport language from '../dynamic-labels/definition';\nimport { TRIGGER_SUGGEST } from '../monarch/commands';\nimport { registerLanguage } from '../monarch/register';\n\nconst dynamicLabelsCompletionItemProvider = new DynamicLabelsCompletionItemProvider();\n\nexport interface Props {\n onChange: (query: string) => void;\n onRunQuery: () => void;\n label: string;\n width: number;\n}\n\nexport function DynamicLabelsField({ label, width, onChange, onRunQuery }: Props) {\n const theme = useTheme2();\n const styles = getInputStyles({ theme, width });\n const containerRef = useRef<HTMLDivElement>(null);\n const onEditorMount = useCallback(\n (editor: monacoType.editor.IStandaloneCodeEditor, monaco: Monaco) => {\n editor.onDidFocusEditorText(() => editor.trigger(TRIGGER_SUGGEST.id, TRIGGER_SUGGEST.id, {}));\n editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => {\n const text = editor.getValue();\n onChange(text);\n onRunQuery();\n });\n\n const containerDiv = containerRef.current;\n containerDiv !== null && editor.layout({ width: containerDiv.clientWidth, height: containerDiv.clientHeight });\n },\n [onChange, onRunQuery]\n );\n\n return (\n <div ref={containerRef} className={cx(styles.wrapper)}>\n <CodeEditor\n containerStyles={css`\n border: 1px solid ${theme.colors.action.disabledBackground};\n &:hover {\n border-color: ${theme.components.input.borderColor};\n }\n `}\n monacoOptions={{\n // without this setting, the auto-resize functionality causes an infinite loop, don't remove it!\n scrollBeyondLastLine: false,\n\n // These additional options are style focused and are a subset of those in the query editor in Prometheus\n fontSize: 14,\n lineNumbers: 'off',\n renderLineHighlight: 'none',\n overviewRulerLanes: 0,\n scrollbar: {\n vertical: 'hidden',\n horizontal: 'hidden',\n },\n suggestFontSize: 12,\n padding: {\n top: 6,\n },\n }}\n language={language.id}\n value={label}\n onBlur={(value) => {\n if (value !== label) {\n onChange(value);\n onRunQuery();\n }\n }}\n onBeforeEditorMount={(monaco: Monaco) =>\n registerLanguage(monaco, language, dynamicLabelsCompletionItemProvider)\n }\n onEditorDidMount={onEditorMount}\n />\n </div>\n );\n}\n","import type { Monaco, monacoTypes } from '@grafana/ui';\n\nimport { linkedTokenBuilder } from '../monarch/linkedTokenBuilder';\nimport { LanguageDefinition } from '../monarch/register';\nimport { Completeable, CompletionItemPriority, TokenTypes } from '../monarch/types';\n\nimport { DYNAMIC_LABEL_PATTERNS } from './language';\n\ntype CompletionItem = monacoTypes.languages.CompletionItem;\n\nexport class DynamicLabelsCompletionItemProvider implements Completeable {\n tokenTypes: TokenTypes;\n\n constructor() {\n this.tokenTypes = {\n Parenthesis: 'delimiter.parenthesis.cloudwatch-dynamicLabels',\n Whitespace: 'white.cloudwatch-dynamicLabels',\n Keyword: 'keyword.cloudwatch-dynamicLabels',\n Delimiter: 'delimiter.cloudwatch-dynamicLabels',\n Operator: 'operator.cloudwatch-dynamicLabels',\n Identifier: 'identifier.cloudwatch-dynamicLabels',\n Type: 'type.cloudwatch-dynamicLabels',\n Function: 'predefined.cloudwatch-dynamicLabels',\n Number: 'number.cloudwatch-dynamicLabels',\n String: 'string.cloudwatch-dynamicLabels',\n Variable: 'variable.cloudwatch-dynamicLabels',\n };\n }\n\n // called by registerLanguage and passed to monaco with registerCompletionItemProvider\n // returns an object that implements https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.CompletionItemProvider.html\n getCompletionProvider(monaco: Monaco, languageDefinition: LanguageDefinition) {\n return {\n triggerCharacters: [' ', '$', ',', '(', \"'\"], // one of these characters indicates that it is time to look for a suggestion\n provideCompletionItems: async (model: monacoTypes.editor.ITextModel, position: monacoTypes.IPosition) => {\n const currentToken = linkedTokenBuilder(monaco, languageDefinition, model, position, this.tokenTypes);\n const invalidRangeToken = currentToken?.isWhiteSpace() || currentToken?.isParenthesis();\n const range =\n invalidRangeToken || !currentToken?.range ? monaco.Range.fromPositions(position) : currentToken?.range;\n const toCompletionItem = (value: string, rest: Partial<CompletionItem> = {}) => {\n const item: CompletionItem = {\n label: value,\n insertText: value,\n kind: monaco.languages.CompletionItemKind.Field,\n range,\n sortText: CompletionItemPriority.Medium,\n ...rest,\n };\n return item;\n };\n let suggestions: CompletionItem[] = [];\n const next = currentToken?.next;\n if (!currentToken?.isFunction() && (!next || next.isWhiteSpace())) {\n suggestions = DYNAMIC_LABEL_PATTERNS.map((val) => toCompletionItem(val));\n // always insert suggestion for dimension value and allow user to complete pattern by providing the dimension name\n suggestions.push(\n toCompletionItem(\"${PROP('Dim.')}\", {\n sortText: CompletionItemPriority.High,\n insertText: `\\${PROP('Dim.$0')} `,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n })\n );\n }\n\n return {\n suggestions,\n };\n },\n };\n }\n}\n","import { debounce } from 'lodash';\nimport React, { FunctionComponent, useState } from 'react';\n\nimport { Input } from '@grafana/ui';\n\nexport interface Props {\n onChange: (alias: any) => void;\n value: string;\n id?: string;\n}\n\nexport const Alias: FunctionComponent<Props> = ({ value = '', onChange, id }) => {\n const [alias, setAlias] = useState(value);\n\n const propagateOnChange = debounce(onChange, 1500);\n\n onChange = (e: any) => {\n setAlias(e.target.value);\n propagateOnChange(e.target.value);\n };\n\n return <Input id={id} type=\"text\" value={alias} onChange={onChange} aria-label=\"Optional alias\" />;\n};\n","import { config } from '@grafana/runtime';\n\nimport { CloudWatchMetricsQuery } from '../types';\n\n// Call this function to migrate queries from within the plugin.\nexport function migrateMetricQuery(query: CloudWatchMetricsQuery): CloudWatchMetricsQuery {\n //add metric query migrations here\n const migratedQuery = migrateAliasPatterns(query);\n return migratedQuery;\n}\n\nconst aliasPatterns: Record<string, string> = {\n metric: `PROP('MetricName')`,\n namespace: `PROP('Namespace')`,\n period: `PROP('Period')`,\n region: `PROP('Region')`,\n stat: `PROP('Stat')`,\n label: `LABEL`,\n};\n\nexport function migrateAliasPatterns(query: CloudWatchMetricsQuery): CloudWatchMetricsQuery {\n if (config.featureToggles.cloudWatchDynamicLabels && !query.hasOwnProperty('label')) {\n const regex = /{{\\s*(.+?)\\s*}}/g;\n query.label =\n query.alias?.replace(regex, (_, value) => {\n if (aliasPatterns.hasOwnProperty(value)) {\n return `\\${${aliasPatterns[value]}}`;\n }\n\n return `\\${PROP('Dim.${value}')}`;\n }) ?? '';\n }\n\n return query;\n}\n","import deepEqual from 'fast-deep-equal';\nimport { useEffect, useMemo } from 'react';\n\nimport { migrateMetricQuery } from '../../migrations/metricQueryMigrations';\nimport { CloudWatchMetricsQuery, MetricEditorMode, MetricQueryType } from '../../types';\n\nexport const DEFAULT_QUERY: Omit<CloudWatchMetricsQuery, 'refId'> = {\n queryMode: 'Metrics',\n namespace: '',\n metricName: '',\n expression: '',\n dimensions: {},\n region: 'default',\n id: '',\n statistic: 'Average',\n period: '',\n metricQueryType: MetricQueryType.Search,\n metricEditorMode: MetricEditorMode.Builder,\n sqlExpression: '',\n matchExact: true,\n};\n\nconst prepareQuery = (query: CloudWatchMetricsQuery) => {\n const withDefaults = { ...DEFAULT_QUERY, ...query };\n const migratedQuery = migrateMetricQuery(withDefaults);\n\n // If we didn't make any changes to the object, then return the original object to keep the\n // identity the same, and not trigger any other useEffects or anything.\n return deepEqual(migratedQuery, query) ? query : migratedQuery;\n};\n\n/**\n * Returns queries with some defaults + migrations, and calls onChange function to notify if it changes\n */\nconst usePreparedMetricsQuery = (\n query: CloudWatchMetricsQuery,\n onChangeQuery: (newQuery: CloudWatchMetricsQuery) => void\n) => {\n const preparedQuery = useMemo(() => prepareQuery(query), [query]);\n\n useEffect(() => {\n if (preparedQuery !== query) {\n onChangeQuery(preparedQuery);\n }\n }, [preparedQuery, query, onChangeQuery]);\n\n return preparedQuery;\n};\n\nexport default usePreparedMetricsQuery;\n","import React, { ChangeEvent, useState } from 'react';\n\nimport { QueryEditorProps } from '@grafana/data';\nimport { EditorField, EditorRow, Space } from '@grafana/experimental';\nimport { config } from '@grafana/runtime';\nimport { Input } from '@grafana/ui';\n\nimport { MathExpressionQueryField, MetricStatEditor, SQLBuilderEditor, SQLCodeEditor } from '../';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { isCloudWatchMetricsQuery } from '../../guards';\nimport {\n CloudWatchJsonData,\n CloudWatchMetricsQuery,\n CloudWatchQuery,\n MetricEditorMode,\n MetricQueryType,\n MetricStat,\n} from '../../types';\nimport { DynamicLabelsField } from '../DynamicLabelsField';\nimport QueryHeader from '../QueryHeader';\n\nimport { Alias } from './Alias';\nimport usePreparedMetricsQuery from './usePreparedMetricsQuery';\n\nexport interface Props extends QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData> {\n query: CloudWatchMetricsQuery;\n}\n\nexport const MetricsQueryEditor = (props: Props) => {\n const { query, onRunQuery, datasource } = props;\n const [sqlCodeEditorIsDirty, setSQLCodeEditorIsDirty] = useState(false);\n const preparedQuery = usePreparedMetricsQuery(query, props.onChange);\n\n const onChange = (query: CloudWatchQuery) => {\n const { onChange, onRunQuery } = props;\n onChange(query);\n onRunQuery();\n };\n\n return (\n <>\n <QueryHeader\n query={query}\n onRunQuery={onRunQuery}\n datasource={datasource}\n onChange={(newQuery) => {\n if (isCloudWatchMetricsQuery(newQuery) && newQuery.metricEditorMode !== query.metricEditorMode) {\n setSQLCodeEditorIsDirty(false);\n }\n onChange(newQuery);\n }}\n sqlCodeEditorIsDirty={sqlCodeEditorIsDirty}\n />\n <Space v={0.5} />\n\n {query.metricQueryType === MetricQueryType.Search && (\n <>\n {query.metricEditorMode === MetricEditorMode.Builder && (\n <MetricStatEditor\n {...props}\n refId={query.refId}\n metricStat={query}\n onChange={(metricStat: MetricStat) => props.onChange({ ...query, ...metricStat })}\n ></MetricStatEditor>\n )}\n {query.metricEditorMode === MetricEditorMode.Code && (\n <MathExpressionQueryField\n onRunQuery={onRunQuery}\n expression={query.expression ?? ''}\n onChange={(expression) => props.onChange({ ...query, expression })}\n datasource={datasource}\n ></MathExpressionQueryField>\n )}\n </>\n )}\n {query.metricQueryType === MetricQueryType.Query && (\n <>\n {query.metricEditorMode === MetricEditorMode.Code && (\n <SQLCodeEditor\n region={query.region}\n sql={query.sqlExpression ?? ''}\n onChange={(sqlExpression) => {\n if (!sqlCodeEditorIsDirty) {\n setSQLCodeEditorIsDirty(true);\n }\n props.onChange({ ...preparedQuery, sqlExpression });\n }}\n onRunQuery={onRunQuery}\n datasource={datasource}\n />\n )}\n\n {query.metricEditorMode === MetricEditorMode.Builder && (\n <>\n <SQLBuilderEditor\n query={query}\n onChange={props.onChange}\n onRunQuery={onRunQuery}\n datasource={datasource}\n ></SQLBuilderEditor>\n </>\n )}\n </>\n )}\n <Space v={0.5} />\n <EditorRow>\n <EditorField\n label=\"ID\"\n width={26}\n optional\n tooltip=\"ID can be used to reference other queries in math expressions. The ID can include numbers, letters, and underscore, and must start with a lowercase letter.\"\n invalid={!!query.id && !/^$|^[a-z][a-zA-Z0-9_]*$/.test(query.id)}\n >\n <Input\n id={`${query.refId}-cloudwatch-metric-query-editor-id`}\n onBlur={onRunQuery}\n onChange={(event: ChangeEvent<HTMLInputElement>) => onChange({ ...preparedQuery, id: event.target.value })}\n type=\"text\"\n value={query.id}\n />\n </EditorField>\n\n <EditorField label=\"Period\" width={26} tooltip=\"Minimum interval between points in seconds.\">\n <Input\n id={`${query.refId}-cloudwatch-metric-query-editor-period`}\n value={query.period || ''}\n placeholder=\"auto\"\n onBlur={onRunQuery}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n onChange({ ...preparedQuery, period: event.target.value })\n }\n />\n </EditorField>\n\n {config.featureToggles.cloudWatchDynamicLabels ? (\n <EditorField\n label=\"Label\"\n width={26}\n optional\n tooltip=\"Change time series legend name using Dynamic labels. See documentation for details.\"\n >\n <DynamicLabelsField\n width={52}\n onRunQuery={onRunQuery}\n label={preparedQuery.label ?? ''}\n onChange={(label) => props.onChange({ ...query, label })}\n ></DynamicLabelsField>\n </EditorField>\n ) : (\n <EditorField\n label=\"Alias\"\n width={26}\n optional\n tooltip=\"Change time series legend name using this field. See documentation for replacement variable formats.\"\n >\n <Alias\n id={`${query.refId}-cloudwatch-metric-query-editor-alias`}\n value={preparedQuery.alias ?? ''}\n onChange={(value: string) => onChange({ ...preparedQuery, alias: value })}\n />\n </EditorField>\n )}\n </EditorRow>\n </>\n );\n};\n","import React, { PureComponent } from 'react';\n\nimport { QueryEditorProps } from '@grafana/data';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { isCloudWatchMetricsQuery } from '../guards';\nimport { CloudWatchJsonData, CloudWatchQuery } from '../types';\n\nimport { MetricsQueryEditor } from '././MetricsQueryEditor/MetricsQueryEditor';\nimport LogsQueryEditor from './LogsQueryEditor';\n\nexport type Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>;\n\nexport class PanelQueryEditor extends PureComponent<Props> {\n render() {\n const { query } = this.props;\n\n return (\n <>\n {isCloudWatchMetricsQuery(query) ? (\n <MetricsQueryEditor {...this.props} query={query} />\n ) : (\n <LogsQueryEditor {...this.props} allowCustomValue />\n )}\n </>\n );\n }\n}\n","import React, { ChangeEvent } from 'react';\n\nimport { QueryEditorProps } from '@grafana/data';\nimport { EditorField, EditorHeader, EditorRow, InlineSelect, Space, EditorSwitch } from '@grafana/experimental';\nimport { Alert, Input } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { isCloudWatchAnnotationQuery } from '../guards';\nimport { useRegions } from '../hooks';\nimport { CloudWatchJsonData, CloudWatchQuery, MetricStat } from '../types';\n\nimport { MetricStatEditor } from './MetricStatEditor';\n\nexport type Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>;\n\nexport const AnnotationQueryEditor = (props: Props) => {\n const { query, onChange, datasource } = props;\n const [regions, regionIsLoading] = useRegions(datasource);\n\n if (!isCloudWatchAnnotationQuery(query)) {\n return (\n <Alert severity=\"error\" title=\"Invalid annotation query\" topSpacing={2}>\n {JSON.stringify(query, null, 4)}\n </Alert>\n );\n }\n\n return (\n <>\n <EditorHeader>\n <InlineSelect\n label=\"Region\"\n value={regions.find((v) => v.value === query.region)}\n placeholder=\"Select region\"\n allowCustomValue\n onChange={({ value: region }) => region && onChange({ ...query, region })}\n options={regions}\n isLoading={regionIsLoading}\n />\n </EditorHeader>\n <Space v={0.5} />\n <MetricStatEditor\n {...props}\n refId={query.refId}\n metricStat={query}\n disableExpressions={true}\n onChange={(metricStat: MetricStat) => onChange({ ...query, ...metricStat })}\n onRunQuery={() => {}}\n ></MetricStatEditor>\n <Space v={0.5} />\n <EditorRow>\n <EditorField label=\"Period\" width={26} tooltip=\"Minimum interval between points in seconds.\">\n <Input\n value={query.period || ''}\n placeholder=\"auto\"\n onChange={(event: ChangeEvent<HTMLInputElement>) => onChange({ ...query, period: event.target.value })}\n />\n </EditorField>\n <EditorField label=\"Enable Prefix Matching\" optional={true}>\n <EditorSwitch\n value={query.prefixMatching}\n onChange={(e) => {\n onChange({\n ...query,\n prefixMatching: e.currentTarget.checked,\n });\n }}\n />\n </EditorField>\n <EditorField label=\"Action\" optional={true} disabled={!query.prefixMatching}>\n <Input\n value={query.actionPrefix || ''}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n onChange({ ...query, actionPrefix: event.target.value })\n }\n />\n </EditorField>\n <EditorField label=\"Alarm Name\" optional={true} disabled={!query.prefixMatching}>\n <Input\n value={query.alarmNamePrefix || ''}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n onChange({ ...query, alarmNamePrefix: event.target.value })\n }\n />\n </EditorField>\n </EditorRow>\n </>\n );\n};\n","import { AnnotationQuery } from '@grafana/data';\n\nimport { AnnotationQueryEditor } from './components/AnnotationQueryEditor';\nimport { isCloudWatchAnnotation } from './guards';\nimport { CloudWatchAnnotationQuery, CloudWatchQuery, LegacyAnnotationQuery } from './types';\n\nexport const CloudWatchAnnotationSupport = {\n // converts legacy angular style queries to new format. Also sets the same default values as in the deprecated angular directive\n prepareAnnotation: (\n query: LegacyAnnotationQuery | AnnotationQuery<CloudWatchAnnotationQuery>\n ): AnnotationQuery<CloudWatchAnnotationQuery> => {\n if (isCloudWatchAnnotation(query)) {\n return query;\n }\n\n return {\n // setting AnnotationQuery props explicitly since spreading would incorrectly use props that should be on the target only\n datasource: query.datasource,\n enable: query.enable,\n iconColor: query.iconColor,\n name: query.name,\n builtIn: query.builtIn,\n hide: query.hide,\n target: {\n ...query.target,\n ...query,\n statistic: query.statistic || 'Average',\n region: query.region || 'default',\n queryMode: 'Annotations',\n refId: query.refId || 'annotationQuery',\n },\n };\n },\n // return undefined if query is not complete so that annotation query execution is quietly skipped\n prepareQuery: (anno: AnnotationQuery<CloudWatchAnnotationQuery>): CloudWatchQuery | undefined => {\n if (!anno.target) {\n return undefined;\n }\n\n const {\n prefixMatching,\n actionPrefix,\n alarmNamePrefix,\n statistic,\n namespace,\n metricName,\n dimensions = {},\n } = anno.target;\n const validPrefixMatchingQuery = !!prefixMatching && !!actionPrefix && !!alarmNamePrefix;\n const validMetricStatQuery =\n !prefixMatching && !!namespace && !!metricName && !!statistic && !!Object.values(dimensions).length;\n\n if (validPrefixMatchingQuery || validMetricStatQuery) {\n return anno.target;\n }\n\n return undefined;\n },\n QueryEditor: AnnotationQueryEditor,\n};\n","import { getTemplateSrv, TemplateSrv } from '@grafana/runtime';\nimport type { Monaco, monacoTypes } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../datasource';\n\nimport { LinkedToken } from './LinkedToken';\nimport { linkedTokenBuilder } from './linkedTokenBuilder';\nimport { LanguageDefinition } from './register';\nimport { Completeable, StatementPosition, SuggestionKind, TokenTypes } from './types';\n\ntype CompletionItem = monacoTypes.languages.CompletionItem;\n\n/*\nCompletionItemProvider is an extendable class which needs to implement :\n- tokenTypes\n- getStatementPosition\n- getSuggestionKinds\n- getSuggestions\n*/\nexport class CompletionItemProvider implements Completeable {\n templateVariables: string[];\n datasource: CloudWatchDatasource;\n templateSrv: TemplateSrv;\n tokenTypes: TokenTypes;\n\n constructor(datasource: CloudWatchDatasource, templateSrv: TemplateSrv = getTemplateSrv()) {\n this.datasource = datasource;\n this.templateSrv = templateSrv;\n this.templateVariables = this.datasource.getVariables();\n this.templateSrv = templateSrv;\n\n // implement with more specific tokens when extending this class\n this.tokenTypes = {\n Parenthesis: 'delimiter.parenthesis',\n Whitespace: 'white',\n Keyword: 'keyword',\n Delimiter: 'delimiter',\n Operator: 'operator',\n Identifier: 'identifier',\n Type: 'type',\n Function: 'predefined',\n Number: 'number',\n String: 'string',\n Variable: 'variable',\n };\n }\n\n // implemented by subclasses, given a token, returns a lexical position in a query\n getStatementPosition(currentToken: LinkedToken | null): StatementPosition {\n return StatementPosition.Unknown;\n }\n\n // implemented by subclasses, given a lexical statement position, returns potential kinds of suggestions\n getSuggestionKinds(position: StatementPosition): SuggestionKind[] {\n return [];\n }\n\n // implemented by subclasses, given potential suggestions kinds, returns suggestion objects for monaco aka \"CompletionItem\"\n getSuggestions(\n monaco: Monaco,\n currentToken: LinkedToken | null,\n suggestionKinds: SuggestionKind[],\n statementPosition: StatementPosition,\n position: monacoTypes.IPosition\n ): Promise<CompletionItem[]> {\n return Promise.reject([]);\n }\n\n // called by registerLanguage and passed to monaco with registerCompletionItemProvider\n // returns an object that implements https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.CompletionItemProvider.html\n getCompletionProvider(monaco: Monaco, languageDefinition: LanguageDefinition) {\n return {\n triggerCharacters: [' ', '$', ',', '(', \"'\"], // one of these characters indicates that it is time to look for a suggestion\n provideCompletionItems: async (model: monacoTypes.editor.ITextModel, position: monacoTypes.IPosition) => {\n const currentToken = linkedTokenBuilder(monaco, languageDefinition, model, position, this.tokenTypes);\n const statementPosition = this.getStatementPosition(currentToken);\n const suggestionKinds = this.getSuggestionKinds(statementPosition);\n const suggestions = await this.getSuggestions(\n monaco,\n currentToken,\n suggestionKinds,\n statementPosition,\n position\n );\n\n return {\n suggestions,\n };\n },\n };\n }\n}\n","import { TokenTypes } from '../../monarch/types';\n\nexport const SQLTokenTypes: TokenTypes = {\n Parenthesis: 'delimiter.parenthesis.sql',\n Whitespace: 'white.sql',\n Keyword: 'keyword.sql',\n Delimiter: 'delimiter.sql',\n Operator: 'operator.sql',\n Identifier: 'identifier.sql',\n Type: 'type.sql',\n Function: 'predefined.sql',\n Number: 'number.sql',\n String: 'string.sql',\n Variable: 'variable.sql',\n};\n","import { LinkedToken } from '../../monarch/LinkedToken';\nimport { StatementPosition } from '../../monarch/types';\nimport { AND, ASC, BY, DESC, EQUALS, FROM, GROUP, NOT_EQUALS, ORDER, SCHEMA, SELECT, WHERE } from '../language';\n\nimport { SQLTokenTypes } from './types';\n\nexport function getStatementPosition(currentToken: LinkedToken | null): StatementPosition {\n const previousNonWhiteSpace = currentToken?.getPreviousNonWhiteSpaceToken();\n const previousKeyword = currentToken?.getPreviousKeyword();\n\n const previousIsSlash = currentToken?.getPreviousNonWhiteSpaceToken()?.is(SQLTokenTypes.Operator, '/');\n if (\n currentToken === null ||\n (currentToken.isWhiteSpace() && currentToken.previous === null) ||\n (currentToken.is(SQLTokenTypes.Keyword, SELECT) && currentToken.previous === null) ||\n previousIsSlash ||\n (currentToken.isIdentifier() && (previousIsSlash || currentToken?.previous === null))\n ) {\n return StatementPosition.SelectKeyword;\n }\n\n if (previousNonWhiteSpace?.value === SELECT) {\n return StatementPosition.AfterSelectKeyword;\n }\n\n if (\n (previousNonWhiteSpace?.is(SQLTokenTypes.Parenthesis, '(') || currentToken?.is(SQLTokenTypes.Parenthesis, '()')) &&\n previousKeyword?.value === SELECT\n ) {\n return StatementPosition.AfterSelectFuncFirstArgument;\n }\n\n if (previousKeyword?.value === SELECT && previousNonWhiteSpace?.isParenthesis()) {\n return StatementPosition.FromKeyword;\n }\n\n if (previousNonWhiteSpace?.value === FROM) {\n return StatementPosition.AfterFromKeyword;\n }\n\n if (\n (previousNonWhiteSpace?.is(SQLTokenTypes.Parenthesis, '(') || currentToken?.is(SQLTokenTypes.Parenthesis, '()')) &&\n previousKeyword?.value === SCHEMA\n ) {\n return StatementPosition.SchemaFuncFirstArgument;\n }\n\n if (previousKeyword?.value === SCHEMA && previousNonWhiteSpace?.is(SQLTokenTypes.Delimiter, ',')) {\n return StatementPosition.SchemaFuncExtraArgument;\n }\n\n if (\n (previousKeyword?.value === FROM && previousNonWhiteSpace?.isDoubleQuotedString()) ||\n (previousKeyword?.value === FROM && previousNonWhiteSpace?.isVariable()) ||\n (previousKeyword?.value === SCHEMA && previousNonWhiteSpace?.is(SQLTokenTypes.Parenthesis, ')'))\n ) {\n return StatementPosition.AfterFrom;\n }\n\n if (\n previousKeyword?.value === WHERE &&\n (previousNonWhiteSpace?.isKeyword() ||\n previousNonWhiteSpace?.is(SQLTokenTypes.Parenthesis, '(') ||\n previousNonWhiteSpace?.is(SQLTokenTypes.Operator, AND))\n ) {\n return StatementPosition.WhereKey;\n }\n\n if (\n previousKeyword?.value === WHERE &&\n (previousNonWhiteSpace?.isIdentifier() || previousNonWhiteSpace?.isDoubleQuotedString())\n ) {\n return StatementPosition.WhereComparisonOperator;\n }\n\n if (\n previousKeyword?.value === WHERE &&\n (previousNonWhiteSpace?.is(SQLTokenTypes.Operator, EQUALS) ||\n previousNonWhiteSpace?.is(SQLTokenTypes.Operator, NOT_EQUALS))\n ) {\n return StatementPosition.WhereValue;\n }\n\n if (\n previousKeyword?.value === WHERE &&\n (previousNonWhiteSpace?.isString() || previousNonWhiteSpace?.is(SQLTokenTypes.Parenthesis, ')'))\n ) {\n return StatementPosition.AfterWhereValue;\n }\n\n if (\n previousKeyword?.is(SQLTokenTypes.Keyword, BY) &&\n previousKeyword?.getPreviousKeyword()?.is(SQLTokenTypes.Keyword, GROUP) &&\n (previousNonWhiteSpace?.is(SQLTokenTypes.Keyword, BY) || previousNonWhiteSpace?.is(SQLTokenTypes.Delimiter, ','))\n ) {\n return StatementPosition.AfterGroupByKeywords;\n }\n\n if (\n previousKeyword?.is(SQLTokenTypes.Keyword, BY) &&\n previousKeyword?.getPreviousKeyword()?.is(SQLTokenTypes.Keyword, GROUP) &&\n (previousNonWhiteSpace?.isIdentifier() || previousNonWhiteSpace?.isDoubleQuotedString())\n ) {\n return StatementPosition.AfterGroupBy;\n }\n\n if (\n previousNonWhiteSpace?.is(SQLTokenTypes.Keyword, BY) &&\n previousNonWhiteSpace?.getPreviousKeyword()?.is(SQLTokenTypes.Keyword, ORDER)\n ) {\n return StatementPosition.AfterOrderByKeywords;\n }\n\n if (\n previousKeyword?.is(SQLTokenTypes.Keyword, BY) &&\n previousKeyword?.getPreviousKeyword()?.is(SQLTokenTypes.Keyword, ORDER) &&\n previousNonWhiteSpace?.is(SQLTokenTypes.Parenthesis) &&\n previousNonWhiteSpace?.getPreviousNonWhiteSpaceToken()?.is(SQLTokenTypes.Function)\n ) {\n return StatementPosition.AfterOrderByFunction;\n }\n\n if (previousKeyword?.is(SQLTokenTypes.Keyword, DESC) || previousKeyword?.is(SQLTokenTypes.Keyword, ASC)) {\n return StatementPosition.AfterOrderByDirection;\n }\n\n return StatementPosition.Unknown;\n}\n","import { StatementPosition, SuggestionKind } from '../../monarch/types';\n\nexport function getSuggestionKinds(statementPosition: StatementPosition): SuggestionKind[] {\n switch (statementPosition) {\n case StatementPosition.SelectKeyword:\n return [SuggestionKind.SelectKeyword];\n case StatementPosition.AfterSelectKeyword:\n return [SuggestionKind.FunctionsWithArguments];\n case StatementPosition.AfterSelectFuncFirstArgument:\n return [SuggestionKind.Metrics];\n case StatementPosition.AfterFromKeyword:\n return [SuggestionKind.Namespaces, SuggestionKind.SchemaKeyword];\n case StatementPosition.SchemaFuncFirstArgument:\n return [SuggestionKind.Namespaces];\n case StatementPosition.SchemaFuncExtraArgument:\n return [SuggestionKind.LabelKeys];\n case StatementPosition.FromKeyword:\n return [SuggestionKind.FromKeyword];\n case StatementPosition.AfterFrom:\n return [\n SuggestionKind.WhereKeyword,\n SuggestionKind.GroupByKeywords,\n SuggestionKind.OrderByKeywords,\n SuggestionKind.LimitKeyword,\n ];\n case StatementPosition.WhereKey:\n return [SuggestionKind.LabelKeys];\n case StatementPosition.WhereComparisonOperator:\n return [SuggestionKind.ComparisonOperators];\n case StatementPosition.WhereValue:\n return [SuggestionKind.LabelValues];\n case StatementPosition.AfterWhereValue:\n return [\n SuggestionKind.LogicalOperators,\n SuggestionKind.GroupByKeywords,\n SuggestionKind.OrderByKeywords,\n SuggestionKind.LimitKeyword,\n ];\n case StatementPosition.AfterGroupByKeywords:\n return [SuggestionKind.LabelKeys];\n case StatementPosition.AfterGroupBy:\n return [SuggestionKind.OrderByKeywords, SuggestionKind.LimitKeyword];\n case StatementPosition.AfterOrderByKeywords:\n return [SuggestionKind.FunctionsWithoutArguments];\n case StatementPosition.AfterOrderByFunction:\n return [SuggestionKind.SortOrderDirectionKeyword, SuggestionKind.LimitKeyword];\n case StatementPosition.AfterOrderByDirection:\n return [SuggestionKind.LimitKeyword];\n }\n\n return [];\n}\n","import { LinkedToken } from '../../monarch/LinkedToken';\nimport { FROM, SCHEMA, SELECT } from '../language';\n\nimport { SQLTokenTypes } from './types';\n\nexport const getSelectToken = (currentToken: LinkedToken | null) =>\n currentToken?.getPreviousOfType(SQLTokenTypes.Keyword, SELECT) ?? null;\n\nexport const getSelectStatisticToken = (currentToken: LinkedToken | null) => {\n const assumedStatisticToken = getSelectToken(currentToken)?.getNextNonWhiteSpaceToken();\n return assumedStatisticToken?.isVariable() || assumedStatisticToken?.isFunction() ? assumedStatisticToken : null;\n};\n\nexport const getMetricNameToken = (currentToken: LinkedToken | null) => {\n // statistic function is followed by `(` and then an argument\n const assumedMetricNameToken = getSelectStatisticToken(currentToken)?.next?.next;\n return assumedMetricNameToken?.isVariable() || assumedMetricNameToken?.isIdentifier() ? assumedMetricNameToken : null;\n};\n\nexport const getFromKeywordToken = (currentToken: LinkedToken | null) => {\n const selectToken = getSelectToken(currentToken);\n return selectToken?.getNextOfType(SQLTokenTypes.Keyword, FROM);\n};\n\nexport const getNamespaceToken = (currentToken: LinkedToken | null) => {\n const fromToken = getFromKeywordToken(currentToken);\n const nextNonWhiteSpace = fromToken?.getNextNonWhiteSpaceToken();\n if (\n nextNonWhiteSpace?.isDoubleQuotedString() ||\n (nextNonWhiteSpace?.isVariable() && nextNonWhiteSpace?.value.toUpperCase() !== SCHEMA)\n ) {\n // schema is not used\n return nextNonWhiteSpace;\n } else if (nextNonWhiteSpace?.isKeyword() && nextNonWhiteSpace.next?.is(SQLTokenTypes.Parenthesis, '(')) {\n // schema is specified\n const assumedNamespaceToken = nextNonWhiteSpace.next?.next;\n if (assumedNamespaceToken?.isDoubleQuotedString() || assumedNamespaceToken?.isVariable()) {\n return assumedNamespaceToken;\n }\n }\n return null;\n};\n","import { uniq } from 'lodash';\n\nimport { getTemplateSrv, TemplateSrv } from '@grafana/runtime';\nimport type { Monaco, monacoTypes } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../../datasource';\nimport { CompletionItemProvider } from '../../monarch/CompletionItemProvider';\nimport { LinkedToken } from '../../monarch/LinkedToken';\nimport { TRIGGER_SUGGEST } from '../../monarch/commands';\nimport { SuggestionKind, CompletionItemPriority, StatementPosition } from '../../monarch/types';\nimport {\n BY,\n FROM,\n GROUP,\n LIMIT,\n ORDER,\n SCHEMA,\n SELECT,\n ASC,\n DESC,\n WHERE,\n COMPARISON_OPERATORS,\n LOGICAL_OPERATORS,\n STATISTICS,\n} from '../language';\n\nimport { getStatementPosition } from './statementPosition';\nimport { getSuggestionKinds } from './suggestionKind';\nimport { getMetricNameToken, getNamespaceToken } from './tokenUtils';\nimport { SQLTokenTypes } from './types';\n\ntype CompletionItem = monacoTypes.languages.CompletionItem;\n\nexport class SQLCompletionItemProvider extends CompletionItemProvider {\n region: string;\n\n constructor(datasource: CloudWatchDatasource, templateSrv: TemplateSrv = getTemplateSrv()) {\n super(datasource, templateSrv);\n this.region = datasource.getActualRegion();\n this.getStatementPosition = getStatementPosition;\n this.getSuggestionKinds = getSuggestionKinds;\n this.tokenTypes = SQLTokenTypes;\n }\n\n setRegion(region: string) {\n this.region = region;\n }\n\n async getSuggestions(\n monaco: Monaco,\n currentToken: LinkedToken | null,\n suggestionKinds: SuggestionKind[],\n statementPosition: StatementPosition,\n position: monacoTypes.IPosition\n ): Promise<CompletionItem[]> {\n let suggestions: CompletionItem[] = [];\n const invalidRangeToken = currentToken?.isWhiteSpace() || currentToken?.isParenthesis();\n const range =\n invalidRangeToken || !currentToken?.range ? monaco.Range.fromPositions(position) : currentToken?.range;\n\n const toCompletionItem = (value: string, rest: Partial<CompletionItem> = {}) => {\n const item: CompletionItem = {\n label: value,\n insertText: value,\n kind: monaco.languages.CompletionItemKind.Field,\n range,\n sortText: CompletionItemPriority.Medium,\n ...rest,\n };\n return item;\n };\n\n function addSuggestion(value: string, rest: Partial<CompletionItem> = {}) {\n suggestions = [...suggestions, toCompletionItem(value, rest)];\n }\n\n for (const suggestion of suggestionKinds) {\n switch (suggestion) {\n case SuggestionKind.SelectKeyword:\n addSuggestion(SELECT, {\n insertText: `${SELECT} $0`,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n kind: monaco.languages.CompletionItemKind.Keyword,\n command: TRIGGER_SUGGEST,\n });\n break;\n\n case SuggestionKind.FunctionsWithArguments:\n STATISTICS.map((s) =>\n addSuggestion(s, {\n insertText: `${s}($0)`,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n command: TRIGGER_SUGGEST,\n kind: monaco.languages.CompletionItemKind.Function,\n })\n );\n break;\n\n case SuggestionKind.FunctionsWithoutArguments:\n STATISTICS.map((s) =>\n addSuggestion(s, {\n insertText: `${s}() `,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n command: TRIGGER_SUGGEST,\n kind: monaco.languages.CompletionItemKind.Function,\n })\n );\n break;\n\n case SuggestionKind.Metrics:\n {\n const namespaceToken = getNamespaceToken(currentToken);\n if (namespaceToken?.value) {\n // if a namespace is specified, only suggest metrics for the namespace\n const metrics = await this.datasource.getMetrics(\n this.templateSrv.replace(namespaceToken?.value.replace(/\\\"/g, '')),\n this.templateSrv.replace(this.region)\n );\n metrics.map((m) => addSuggestion(m.value));\n } else {\n // If no namespace is specified in the query, just list all metrics\n const metrics = await this.datasource.getAllMetrics(this.templateSrv.replace(this.region));\n uniq(metrics.map((m) => m.metricName)).map((m) => addSuggestion(m, { insertText: m }));\n }\n }\n break;\n\n case SuggestionKind.FromKeyword:\n addSuggestion(FROM, {\n insertText: `${FROM} `,\n command: TRIGGER_SUGGEST,\n });\n break;\n\n case SuggestionKind.SchemaKeyword:\n addSuggestion(SCHEMA, {\n sortText: CompletionItemPriority.High,\n insertText: `${SCHEMA}($0)`,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n command: TRIGGER_SUGGEST,\n kind: monaco.languages.CompletionItemKind.Function,\n });\n break;\n\n case SuggestionKind.Namespaces:\n const metricNameToken = getMetricNameToken(currentToken);\n let namespaces = [];\n if (metricNameToken?.value) {\n // if a metric is specified, only suggest namespaces that actually have that metric\n const metrics = await this.datasource.getAllMetrics(this.region);\n const metricName = this.templateSrv.replace(metricNameToken.value);\n namespaces = metrics.filter((m) => m.metricName === metricName).map((m) => m.namespace);\n } else {\n // if no metric is specified, just suggest all namespaces\n const ns = await this.datasource.getNamespaces();\n namespaces = ns.map((n) => n.value);\n }\n namespaces.map((n) => addSuggestion(`\"${n}\"`, { insertText: `\"${n}\"` }));\n break;\n\n case SuggestionKind.LabelKeys:\n {\n const metricNameToken = getMetricNameToken(currentToken);\n const namespaceToken = getNamespaceToken(currentToken);\n if (namespaceToken?.value) {\n let dimensionFilter = {};\n let labelKeyTokens;\n if (statementPosition === StatementPosition.SchemaFuncExtraArgument) {\n labelKeyTokens = namespaceToken?.getNextUntil(this.tokenTypes.Parenthesis, [\n this.tokenTypes.Delimiter,\n this.tokenTypes.Whitespace,\n ]);\n } else if (statementPosition === StatementPosition.AfterGroupByKeywords) {\n labelKeyTokens = currentToken?.getPreviousUntil(this.tokenTypes.Keyword, [\n this.tokenTypes.Delimiter,\n this.tokenTypes.Whitespace,\n ]);\n }\n dimensionFilter = (labelKeyTokens || []).reduce((acc, curr) => {\n return { ...acc, [curr.value]: null };\n }, {});\n const keys = await this.datasource.getDimensionKeys(\n this.templateSrv.replace(namespaceToken.value.replace(/\\\"/g, '')),\n this.templateSrv.replace(this.region),\n dimensionFilter,\n metricNameToken?.value ?? ''\n );\n keys.map((m) => {\n const key = /[\\s\\.-]/.test(m.value) ? `\"${m.value}\"` : m.value;\n addSuggestion(key);\n });\n }\n }\n break;\n\n case SuggestionKind.LabelValues:\n {\n const namespaceToken = getNamespaceToken(currentToken);\n const metricNameToken = getMetricNameToken(currentToken);\n const labelKey = currentToken?.getPreviousNonWhiteSpaceToken()?.getPreviousNonWhiteSpaceToken();\n if (namespaceToken?.value && labelKey?.value && metricNameToken?.value) {\n const values = await this.datasource.getDimensionValues(\n this.templateSrv.replace(this.region),\n this.templateSrv.replace(namespaceToken.value.replace(/\\\"/g, '')),\n this.templateSrv.replace(metricNameToken.value),\n this.templateSrv.replace(labelKey.value),\n {}\n );\n values.map((o) =>\n addSuggestion(`'${o.value}'`, { insertText: `'${o.value}' `, command: TRIGGER_SUGGEST })\n );\n }\n }\n break;\n\n case SuggestionKind.LogicalOperators:\n LOGICAL_OPERATORS.map((o) =>\n addSuggestion(`${o}`, {\n insertText: `${o} `,\n command: TRIGGER_SUGGEST,\n sortText: CompletionItemPriority.MediumHigh,\n })\n );\n break;\n\n case SuggestionKind.WhereKeyword:\n addSuggestion(`${WHERE}`, {\n insertText: `${WHERE} `,\n command: TRIGGER_SUGGEST,\n sortText: CompletionItemPriority.High,\n });\n break;\n\n case SuggestionKind.ComparisonOperators:\n COMPARISON_OPERATORS.map((o) => addSuggestion(`${o}`, { insertText: `${o} `, command: TRIGGER_SUGGEST }));\n break;\n\n case SuggestionKind.GroupByKeywords:\n addSuggestion(`${GROUP} ${BY}`, {\n insertText: `${GROUP} ${BY} `,\n command: TRIGGER_SUGGEST,\n sortText: CompletionItemPriority.MediumHigh,\n });\n break;\n\n case SuggestionKind.OrderByKeywords:\n addSuggestion(`${ORDER} ${BY}`, {\n insertText: `${ORDER} ${BY} `,\n command: TRIGGER_SUGGEST,\n sortText: CompletionItemPriority.Medium,\n });\n break;\n\n case SuggestionKind.LimitKeyword:\n addSuggestion(LIMIT, { insertText: `${LIMIT} `, sortText: CompletionItemPriority.MediumLow });\n break;\n\n case SuggestionKind.SortOrderDirectionKeyword:\n [ASC, DESC].map((s) =>\n addSuggestion(s, {\n insertText: `${s} `,\n command: TRIGGER_SUGGEST,\n })\n );\n break;\n }\n }\n\n // always suggest template variables\n this.templateVariables.map((v) => {\n addSuggestion(v, {\n range,\n label: v,\n insertText: v,\n kind: monaco.languages.CompletionItemKind.Variable,\n sortText: CompletionItemPriority.Low,\n });\n });\n\n return suggestions;\n }\n}\n","import React, { FunctionComponent } from 'react';\n\nexport interface Props {\n region: string;\n}\n\nexport const ThrottlingErrorMessage: FunctionComponent<Props> = ({ region }) => (\n <p>\n Please visit the \n <a\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-link\"\n href={`https://${region}.console.aws.amazon.com/servicequotas/home?region=${region}#!/services/monitoring/quotas/L-5E141212`}\n >\n AWS Service Quotas console\n </a>\n to request a quota increase or see our \n <a\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-link\"\n href=\"https://grafana.com/docs/grafana/latest/datasources/cloudwatch/#service-quotas\"\n >\n documentation\n </a>\n to learn more.\n </p>\n);\n","import { sortedUniq } from 'lodash';\nimport Prism, { Grammar } from 'prismjs';\nimport { lastValueFrom } from 'rxjs';\n\nimport { AbsoluteTimeRange, HistoryItem, LanguageProvider } from '@grafana/data';\nimport { CompletionItemGroup, SearchFunctionType, Token, TypeaheadInput, TypeaheadOutput } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from './datasource';\nimport syntax, {\n AGGREGATION_FUNCTIONS_STATS,\n BOOLEAN_FUNCTIONS,\n DATETIME_FUNCTIONS,\n FIELD_AND_FILTER_FUNCTIONS,\n IP_FUNCTIONS,\n NUMERIC_OPERATORS,\n QUERY_COMMANDS,\n STRING_FUNCTIONS,\n} from './syntax';\nimport { CloudWatchQuery, TSDBResponse } from './types';\n\nexport type CloudWatchHistoryItem = HistoryItem<CloudWatchQuery>;\n\ntype TypeaheadContext = {\n history?: CloudWatchHistoryItem[];\n absoluteRange?: AbsoluteTimeRange;\n logGroupNames?: string[];\n region: string;\n};\n\nexport class CloudWatchLanguageProvider extends LanguageProvider {\n started = false;\n declare initialRange: AbsoluteTimeRange;\n datasource: CloudWatchDatasource;\n\n constructor(datasource: CloudWatchDatasource, initialValues?: any) {\n super();\n\n this.datasource = datasource;\n\n Object.assign(this, initialValues);\n }\n\n // Strip syntax chars\n cleanText = (s: string) => s.replace(/[()]/g, '').trim();\n\n getSyntax(): Grammar {\n return syntax;\n }\n\n request = (url: string, params?: any): Promise<TSDBResponse> => {\n return lastValueFrom(this.datasource.awsRequest(url, params));\n };\n\n start = () => {\n if (!this.startTask) {\n this.startTask = Promise.resolve().then(() => {\n this.started = true;\n return [];\n });\n }\n\n return this.startTask;\n };\n\n isStatsQuery(query: string): boolean {\n const grammar = this.getSyntax();\n const tokens = Prism.tokenize(query, grammar) ?? [];\n\n return !!tokens.find(\n (token) =>\n typeof token !== 'string' &&\n token.content.toString().toLowerCase() === 'stats' &&\n token.type === 'query-command'\n );\n }\n\n /**\n * Return suggestions based on input that can be then plugged into a typeahead dropdown.\n * Keep this DOM-free for testing\n * @param input\n * @param context Is optional in types but is required in case we are doing getLabelCompletionItems\n * @param context.absoluteRange Required in case we are doing getLabelCompletionItems\n * @param context.history Optional used only in getEmptyCompletionItems\n */\n async provideCompletionItems(input: TypeaheadInput, context?: TypeaheadContext): Promise<TypeaheadOutput> {\n const { value } = input;\n\n // Get tokens\n const tokens = value?.data.get('tokens');\n\n if (!tokens || !tokens.length) {\n return { suggestions: [] };\n }\n\n const curToken: Token = tokens.filter(\n (token: any) =>\n token.offsets.start <= value!.selection?.start?.offset && token.offsets.end >= value!.selection?.start?.offset\n )[0];\n\n const isFirstToken = !curToken.prev;\n const prevToken = prevNonWhitespaceToken(curToken);\n\n const isCommandStart = isFirstToken || (!isFirstToken && prevToken?.types.includes('command-separator'));\n if (isCommandStart) {\n return this.getCommandCompletionItems();\n }\n\n if (isInsideFunctionParenthesis(curToken)) {\n return await this.getFieldCompletionItems(context?.logGroupNames ?? [], context?.region || 'default');\n }\n\n if (isAfterKeyword('by', curToken)) {\n return this.handleKeyword(context);\n }\n\n if (prevToken?.types.includes('comparison-operator')) {\n return this.handleComparison(context);\n }\n\n const commandToken = previousCommandToken(curToken);\n if (commandToken) {\n return await this.handleCommand(commandToken, curToken, context);\n }\n\n return {\n suggestions: [],\n };\n }\n\n private fetchedFieldsCache:\n | {\n time: number;\n logGroups: string[];\n fields: string[];\n }\n | undefined;\n\n private fetchFields = async (logGroups: string[], region: string): Promise<string[]> => {\n if (\n this.fetchedFieldsCache &&\n Date.now() - this.fetchedFieldsCache.time < 30 * 1000 &&\n sortedUniq(this.fetchedFieldsCache.logGroups).join('|') === sortedUniq(logGroups).join('|')\n ) {\n return this.fetchedFieldsCache.fields;\n }\n\n const results = await Promise.all(\n logGroups.map((logGroup) => this.datasource.getLogGroupFields({ logGroupName: logGroup, region }))\n );\n\n const fields = [\n ...new Set<string>(\n results.reduce((acc: string[], cur) => acc.concat(cur.logGroupFields?.map((f) => f.name) as string[]), [])\n ).values(),\n ];\n\n this.fetchedFieldsCache = {\n time: Date.now(),\n logGroups,\n fields,\n };\n\n return fields;\n };\n\n private handleKeyword = async (context?: TypeaheadContext): Promise<TypeaheadOutput> => {\n const suggs = await this.getFieldCompletionItems(context?.logGroupNames ?? [], context?.region || 'default');\n const functionSuggestions: CompletionItemGroup[] = [\n {\n searchFunctionType: SearchFunctionType.Prefix,\n label: 'Functions',\n items: STRING_FUNCTIONS.concat(DATETIME_FUNCTIONS, IP_FUNCTIONS),\n },\n ];\n suggs.suggestions.push(...functionSuggestions);\n\n return suggs;\n };\n\n private handleCommand = async (\n commandToken: Token,\n curToken: Token,\n context?: TypeaheadContext\n ): Promise<TypeaheadOutput> => {\n const queryCommand = commandToken.content.toLowerCase();\n const prevToken = prevNonWhitespaceToken(curToken);\n const currentTokenIsFirstArg = prevToken === commandToken;\n\n if (queryCommand === 'sort') {\n return this.handleSortCommand(currentTokenIsFirstArg, curToken, context);\n }\n\n if (queryCommand === 'parse') {\n if (currentTokenIsFirstArg) {\n return await this.getFieldCompletionItems(context?.logGroupNames ?? [], context?.region || 'default');\n }\n }\n\n const currentTokenIsAfterCommandAndEmpty = isTokenType(commandToken.next, 'whitespace') && !commandToken.next?.next;\n const currentTokenIsAfterCommand =\n currentTokenIsAfterCommandAndEmpty || nextNonWhitespaceToken(commandToken) === curToken;\n\n const currentTokenIsComma = isTokenType(curToken, 'punctuation', ',');\n const currentTokenIsCommaOrAfterComma = currentTokenIsComma || isTokenType(prevToken, 'punctuation', ',');\n\n // We only show suggestions if we are after a command or after a comma which is a field separator\n if (!(currentTokenIsAfterCommand || currentTokenIsCommaOrAfterComma)) {\n return { suggestions: [] };\n }\n\n if (['display', 'fields'].includes(queryCommand)) {\n const typeaheadOutput = await this.getFieldCompletionItems(\n context?.logGroupNames ?? [],\n context?.region || 'default'\n );\n typeaheadOutput.suggestions.push(...this.getFieldAndFilterFunctionCompletionItems().suggestions);\n\n return typeaheadOutput;\n }\n\n if (queryCommand === 'stats') {\n const typeaheadOutput = this.getStatsAggCompletionItems();\n if (currentTokenIsComma || currentTokenIsAfterCommandAndEmpty) {\n typeaheadOutput?.suggestions.forEach((group) => {\n group.skipFilter = true;\n });\n }\n return typeaheadOutput;\n }\n\n if (queryCommand === 'filter' && currentTokenIsFirstArg) {\n const sugg = await this.getFieldCompletionItems(context?.logGroupNames ?? [], context?.region || 'default');\n const boolFuncs = this.getBoolFuncCompletionItems();\n sugg.suggestions.push(...boolFuncs.suggestions);\n return sugg;\n }\n return { suggestions: [] };\n };\n\n private async handleSortCommand(\n isFirstArgument: boolean,\n curToken: Token,\n context?: TypeaheadContext\n ): Promise<TypeaheadOutput> {\n if (isFirstArgument) {\n return await this.getFieldCompletionItems(context?.logGroupNames ?? [], context?.region || 'default');\n } else if (isTokenType(prevNonWhitespaceToken(curToken), 'field-name')) {\n // suggest sort options\n return {\n suggestions: [\n {\n searchFunctionType: SearchFunctionType.Prefix,\n label: 'Sort Order',\n items: [\n {\n label: 'asc',\n },\n { label: 'desc' },\n ],\n },\n ],\n };\n }\n\n return { suggestions: [] };\n }\n\n private handleComparison = async (context?: TypeaheadContext) => {\n const fieldsSuggestions = await this.getFieldCompletionItems(\n context?.logGroupNames ?? [],\n context?.region || 'default'\n );\n const comparisonSuggestions = this.getComparisonCompletionItems();\n fieldsSuggestions.suggestions.push(...comparisonSuggestions.suggestions);\n return fieldsSuggestions;\n };\n\n private getCommandCompletionItems = (): TypeaheadOutput => {\n return {\n suggestions: [{ searchFunctionType: SearchFunctionType.Prefix, label: 'Commands', items: QUERY_COMMANDS }],\n };\n };\n\n private getFieldAndFilterFunctionCompletionItems = (): TypeaheadOutput => {\n return {\n suggestions: [\n { searchFunctionType: SearchFunctionType.Prefix, label: 'Functions', items: FIELD_AND_FILTER_FUNCTIONS },\n ],\n };\n };\n\n private getStatsAggCompletionItems = (): TypeaheadOutput => {\n return {\n suggestions: [\n { searchFunctionType: SearchFunctionType.Prefix, label: 'Functions', items: AGGREGATION_FUNCTIONS_STATS },\n ],\n };\n };\n\n private getBoolFuncCompletionItems = (): TypeaheadOutput => {\n return {\n suggestions: [\n {\n searchFunctionType: SearchFunctionType.Prefix,\n label: 'Functions',\n items: BOOLEAN_FUNCTIONS,\n },\n ],\n };\n };\n\n private getComparisonCompletionItems = (): TypeaheadOutput => {\n return {\n suggestions: [\n {\n searchFunctionType: SearchFunctionType.Prefix,\n label: 'Functions',\n items: NUMERIC_OPERATORS.concat(BOOLEAN_FUNCTIONS),\n },\n ],\n };\n };\n\n private getFieldCompletionItems = async (logGroups: string[], region: string): Promise<TypeaheadOutput> => {\n const fields = await this.fetchFields(logGroups, region);\n\n return {\n suggestions: [\n {\n label: 'Fields',\n items: fields.map((field) => ({\n label: field,\n insertText: field.match(/@?[_a-zA-Z]+[_.0-9a-zA-Z]*/) ? undefined : `\\`${field}\\``,\n })),\n },\n ],\n };\n };\n}\n\nfunction nextNonWhitespaceToken(token: Token): Token | null {\n let curToken = token;\n\n while (curToken.next) {\n if (curToken.next.types.includes('whitespace')) {\n curToken = curToken.next;\n } else {\n return curToken.next;\n }\n }\n\n return null;\n}\n\nfunction prevNonWhitespaceToken(token: Token): Token | null {\n let curToken = token;\n\n while (curToken.prev) {\n if (isTokenType(curToken.prev, 'whitespace')) {\n curToken = curToken.prev;\n } else {\n return curToken.prev;\n }\n }\n\n return null;\n}\n\nfunction previousCommandToken(startToken: Token): Token | null {\n let thisToken = startToken;\n while (!!thisToken.prev) {\n thisToken = thisToken.prev;\n if (\n thisToken.types.includes('query-command') &&\n (!thisToken.prev || isTokenType(prevNonWhitespaceToken(thisToken), 'command-separator'))\n ) {\n return thisToken;\n }\n }\n return null;\n}\n\nconst funcsWithFieldArgs = [\n 'avg',\n 'count',\n 'count_distinct',\n 'earliest',\n 'latest',\n 'sortsFirst',\n 'sortsLast',\n 'max',\n 'min',\n 'pct',\n 'stddev',\n 'ispresent',\n 'fromMillis',\n 'toMillis',\n 'isempty',\n 'isblank',\n 'isValidIp',\n 'isValidIpV4',\n 'isValidIpV6',\n 'isIpInSubnet',\n 'isIpv4InSubnet',\n 'isIpv6InSubnet',\n].map((funcName) => funcName.toLowerCase());\n\n/**\n * Returns true if cursor is currently inside a function parenthesis for example `count(|)` or `count(@mess|)` should\n * return true.\n */\nfunction isInsideFunctionParenthesis(curToken: Token): boolean {\n const prevToken = prevNonWhitespaceToken(curToken);\n\n if (!prevToken) {\n return false;\n }\n\n const parenthesisToken = curToken.content === '(' ? curToken : prevToken.content === '(' ? prevToken : undefined;\n if (parenthesisToken) {\n const maybeFunctionToken = prevNonWhitespaceToken(parenthesisToken);\n if (maybeFunctionToken) {\n return (\n funcsWithFieldArgs.includes(maybeFunctionToken.content.toLowerCase()) &&\n maybeFunctionToken.types.includes('function')\n );\n }\n }\n return false;\n}\n\nfunction isAfterKeyword(keyword: string, token: Token): boolean {\n const maybeKeyword = getPreviousTokenExcluding(token, [\n 'whitespace',\n 'function',\n 'punctuation',\n 'field-name',\n 'number',\n ]);\n if (isTokenType(maybeKeyword, 'keyword', 'by')) {\n const prev = getPreviousTokenExcluding(token, ['whitespace']);\n if (prev === maybeKeyword || isTokenType(prev, 'punctuation', ',')) {\n return true;\n }\n }\n return false;\n}\n\nfunction isTokenType(token: Token | undefined | null, type: string, content?: string): boolean {\n if (!token?.types.includes(type)) {\n return false;\n }\n if (content) {\n if (token?.content.toLowerCase() !== content) {\n return false;\n }\n }\n return true;\n}\n\ntype TokenDef = string | { type: string; value: string };\nfunction getPreviousTokenExcluding(token: Token, exclude: TokenDef[]): Token | undefined | null {\n let curToken = token.prev;\n main: while (curToken) {\n for (const item of exclude) {\n if (typeof item === 'string') {\n if (curToken.types.includes(item)) {\n curToken = curToken.prev;\n continue main;\n }\n } else {\n if (curToken.types.includes(item.type) && curToken.content.toLowerCase() === item.value) {\n curToken = curToken.prev;\n continue main;\n }\n }\n }\n break;\n }\n return curToken;\n}\n","import { debounce, memoize } from 'lodash';\n\nexport default (func: (...args: any[]) => void, wait = 7000) => {\n const mem = memoize(\n (...args) =>\n debounce(func, wait, {\n leading: true,\n }),\n (...args) => JSON.stringify(args)\n );\n\n return (...args: any[]) => mem(...args)(...args);\n};\n","import { TokenTypes } from '../../monarch/types';\n\nexport const MetricMathTokenTypes: TokenTypes = {\n Parenthesis: 'delimiter.parenthesis.cloudwatch-MetricMath',\n Whitespace: 'white.cloudwatch-MetricMath',\n Keyword: 'keyword.cloudwatch-MetricMath',\n Delimiter: 'delimiter.cloudwatch-MetricMath',\n Operator: 'operator.cloudwatch-MetricMath',\n Identifier: 'identifier.cloudwatch-MetricMath',\n Type: 'type.cloudwatch-MetricMath',\n Function: 'predefined.cloudwatch-MetricMath',\n Number: 'number.cloudwatch-MetricMath',\n String: 'string.cloudwatch-MetricMath',\n Variable: 'variable.cloudwatch-MetricMath',\n};\n","import { LinkedToken } from '../../monarch/LinkedToken';\nimport { StatementPosition } from '../../monarch/types';\n\nimport { MetricMathTokenTypes } from './types';\n\nexport function getStatementPosition(currentToken: LinkedToken | null): StatementPosition {\n const previousNonWhiteSpace = currentToken?.getPreviousNonWhiteSpaceToken();\n\n if (currentToken && currentToken.isString()) {\n return StatementPosition.WithinString;\n }\n\n if (currentToken && previousNonWhiteSpace) {\n const currentFunction = currentToken.getPreviousOfType(MetricMathTokenTypes.Function);\n const isAfterComma = previousNonWhiteSpace.is(MetricMathTokenTypes.Delimiter, ',');\n const isWithinSearch = currentFunction && currentFunction.value === 'SEARCH';\n const allTokensAfterStartOfSearch =\n currentToken.getPreviousUntil(MetricMathTokenTypes.Function, [], 'SEARCH') || [];\n\n if (isWithinSearch) {\n // if there's only one ' then we're still within the first arg\n if (allTokensAfterStartOfSearch.filter(({ value }) => value === \"'\").length === 1) {\n return StatementPosition.WithinString;\n }\n\n // if there was a , before the last , and it happened after the start of SEARCH\n const lastComma = previousNonWhiteSpace.getPreviousOfType(MetricMathTokenTypes.Delimiter, ',');\n if (lastComma) {\n const lastCommaIsAfterSearch =\n lastComma.range.startColumn > currentFunction.range.startColumn &&\n lastComma.range.startLineNumber >= currentFunction.range.startLineNumber;\n if (lastCommaIsAfterSearch) {\n return StatementPosition.SearchFuncThirdArg;\n }\n }\n\n // otherwise assume it's the second arg\n return StatementPosition.SearchFuncSecondArg;\n }\n\n if (!isWithinSearch && isAfterComma) {\n return StatementPosition.PredefinedFuncSecondArg;\n }\n }\n\n if (previousNonWhiteSpace?.endsWith(')')) {\n return StatementPosition.AfterFunction;\n }\n\n if (!currentToken || !currentToken.isString()) {\n return StatementPosition.PredefinedFunction;\n }\n\n return StatementPosition.Unknown;\n}\n","import { StatementPosition, SuggestionKind } from '../../monarch/types';\n\nexport function getSuggestionKinds(statementPosition: StatementPosition): SuggestionKind[] {\n switch (statementPosition) {\n case StatementPosition.PredefinedFunction:\n return [SuggestionKind.FunctionsWithArguments];\n case StatementPosition.PredefinedFuncSecondArg:\n return [SuggestionKind.FunctionsWithArguments, SuggestionKind.KeywordArguments];\n case StatementPosition.AfterFunction:\n return [SuggestionKind.Operators];\n case StatementPosition.SearchFuncSecondArg:\n return [SuggestionKind.Statistic];\n case StatementPosition.SearchFuncThirdArg:\n return [SuggestionKind.Period];\n }\n\n return [];\n}\n","import { getTemplateSrv, TemplateSrv } from '@grafana/runtime';\nimport type { Monaco, monacoTypes } from '@grafana/ui';\n\nimport { CloudWatchDatasource } from '../../datasource';\nimport { CompletionItemProvider } from '../../monarch/CompletionItemProvider';\nimport { LinkedToken } from '../../monarch/LinkedToken';\nimport { TRIGGER_SUGGEST } from '../../monarch/commands';\nimport { SuggestionKind, CompletionItemPriority, StatementPosition } from '../../monarch/types';\nimport {\n METRIC_MATH_FNS,\n METRIC_MATH_KEYWORDS,\n METRIC_MATH_OPERATORS,\n METRIC_MATH_PERIODS,\n METRIC_MATH_STATISTIC_KEYWORD_STRINGS,\n} from '../language';\n\nimport { getStatementPosition } from './statementPosition';\nimport { getSuggestionKinds } from './suggestionKind';\nimport { MetricMathTokenTypes } from './types';\n\ntype CompletionItem = monacoTypes.languages.CompletionItem;\n\nexport class MetricMathCompletionItemProvider extends CompletionItemProvider {\n constructor(datasource: CloudWatchDatasource, templateSrv: TemplateSrv = getTemplateSrv()) {\n super(datasource, templateSrv);\n this.getStatementPosition = getStatementPosition;\n this.getSuggestionKinds = getSuggestionKinds;\n this.tokenTypes = MetricMathTokenTypes;\n }\n\n async getSuggestions(\n monaco: Monaco,\n currentToken: LinkedToken | null,\n suggestionKinds: SuggestionKind[],\n statementPosition: StatementPosition,\n position: monacoTypes.IPosition\n ): Promise<CompletionItem[]> {\n let suggestions: CompletionItem[] = [];\n const invalidRangeToken = currentToken?.isWhiteSpace() || currentToken?.isParenthesis();\n const range =\n invalidRangeToken || !currentToken?.range ? monaco.Range.fromPositions(position) : currentToken?.range;\n\n const toCompletionItem = (value: string, rest: Partial<CompletionItem> = {}) => {\n const item: CompletionItem = {\n label: value,\n insertText: value,\n kind: monaco.languages.CompletionItemKind.Field,\n range,\n sortText: CompletionItemPriority.Medium,\n ...rest,\n };\n return item;\n };\n\n function addSuggestion(value: string, rest: Partial<CompletionItem> = {}) {\n suggestions = [...suggestions, toCompletionItem(value, rest)];\n }\n\n for (const suggestion of suggestionKinds) {\n switch (suggestion) {\n case SuggestionKind.FunctionsWithArguments:\n METRIC_MATH_FNS.map((f) =>\n addSuggestion(f, {\n insertText: f === 'SEARCH' ? `${f}('$0')` : `${f}($0)`,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n command: TRIGGER_SUGGEST,\n kind: monaco.languages.CompletionItemKind.Function,\n })\n );\n break;\n\n case SuggestionKind.KeywordArguments:\n METRIC_MATH_KEYWORDS.map((s) =>\n addSuggestion(s, {\n insertText: s,\n command: TRIGGER_SUGGEST,\n kind: monaco.languages.CompletionItemKind.Keyword,\n sortText: CompletionItemPriority.MediumHigh,\n })\n );\n break;\n\n case SuggestionKind.Statistic:\n METRIC_MATH_STATISTIC_KEYWORD_STRINGS.map((s) =>\n addSuggestion(s, {\n insertText: `'${s}', `,\n command: TRIGGER_SUGGEST,\n })\n );\n break;\n\n case SuggestionKind.Operators:\n METRIC_MATH_OPERATORS.map((s) =>\n addSuggestion(s, {\n insertText: `${s} `,\n command: TRIGGER_SUGGEST,\n })\n );\n break;\n\n case SuggestionKind.Period:\n METRIC_MATH_PERIODS.map((s, idx) =>\n addSuggestion(s.toString(), {\n kind: monaco.languages.CompletionItemKind.Value,\n sortText: String.fromCharCode(97 + idx), // converts index 0, 1 to \"a\", \"b\", etc needed to show the time periods in numerical order\n })\n );\n break;\n }\n }\n\n // always suggest template variables\n this.templateVariables.map((v) => {\n addSuggestion(v, {\n range,\n label: v,\n insertText: v,\n kind: monaco.languages.CompletionItemKind.Variable,\n sortText: CompletionItemPriority.Low,\n });\n });\n\n return suggestions;\n }\n}\n","import { DataFrame, DataLink, DataQueryRequest, DataQueryResponse, ScopedVars, TimeRange } from '@grafana/data';\nimport { getDataSourceSrv } from '@grafana/runtime';\n\nimport { AwsUrl, encodeUrl } from '../aws_url';\nimport { CloudWatchLogsQuery, CloudWatchQuery } from '../types';\n\ntype ReplaceFn = (\n target?: string,\n scopedVars?: ScopedVars,\n displayErrorIfIsMultiTemplateVariable?: boolean,\n fieldName?: string\n) => string;\n\nexport async function addDataLinksToLogsResponse(\n response: DataQueryResponse,\n request: DataQueryRequest<CloudWatchQuery>,\n range: TimeRange,\n replaceFn: ReplaceFn,\n getVariableValueFn: (value: string, scopedVars: ScopedVars) => string[],\n getRegion: (region: string) => string,\n tracingDatasourceUid?: string\n): Promise<void> {\n const replace = (target: string, fieldName?: string) => replaceFn(target, request.scopedVars, true, fieldName);\n const getVariableValue = (target: string) => getVariableValueFn(target, request.scopedVars);\n\n for (const dataFrame of response.data as DataFrame[]) {\n const curTarget = request.targets.find((target) => target.refId === dataFrame.refId) as CloudWatchLogsQuery;\n const interpolatedRegion = getRegion(replace(curTarget.region ?? '', 'region'));\n\n for (const field of dataFrame.fields) {\n if (field.name === '@xrayTraceId' && tracingDatasourceUid) {\n getRegion(replace(curTarget.region ?? '', 'region'));\n const xrayLink = await createInternalXrayLink(tracingDatasourceUid, interpolatedRegion);\n if (xrayLink) {\n field.config.links = [xrayLink];\n }\n } else {\n // Right now we add generic link to open the query in xray console to every field so it shows in the logs row\n // details. Unfortunately this also creates link for all values inside table which look weird.\n field.config.links = [createAwsConsoleLink(curTarget, range, interpolatedRegion, replace, getVariableValue)];\n }\n }\n }\n}\n\nasync function createInternalXrayLink(datasourceUid: string, region: string) {\n let ds;\n try {\n ds = await getDataSourceSrv().get(datasourceUid);\n } catch (e) {\n console.error('Could not load linked xray data source, it was probably deleted after it was linked', e);\n return undefined;\n }\n\n return {\n title: ds.name,\n url: '',\n internal: {\n query: { query: '${__value.raw}', queryType: 'getTrace', region: region },\n datasourceUid: datasourceUid,\n datasourceName: ds.name,\n },\n } as DataLink;\n}\n\nfunction createAwsConsoleLink(\n target: CloudWatchLogsQuery,\n range: TimeRange,\n region: string,\n replace: (target: string, fieldName?: string) => string,\n getVariableValue: (value: string) => string[]\n) {\n const interpolatedExpression = target.expression ? replace(target.expression) : '';\n const interpolatedGroups = target.logGroupNames?.flatMap(getVariableValue) ?? [];\n\n const urlProps: AwsUrl = {\n end: range.to.toISOString(),\n start: range.from.toISOString(),\n timeType: 'ABSOLUTE',\n tz: 'UTC',\n editorString: interpolatedExpression,\n isLiveTail: false,\n source: interpolatedGroups,\n };\n\n const encodedUrl = encodeUrl(urlProps, region);\n return {\n url: encodedUrl,\n title: 'View in CloudWatch console',\n targetBlank: true,\n };\n}\n","import { Observable, Subscription } from 'rxjs';\n\nimport { DataFrame, DataFrameJSON, DataQueryError } from '@grafana/data';\nimport { FetchError, toDataQueryResponse } from '@grafana/runtime';\n\nimport { StartQueryRequest } from '../types';\n\ntype Result = { frames: DataFrameJSON[]; error?: string };\n\n/**\n * A retry strategy specifically for cloud watch logs query. Cloud watch logs queries need first starting the query\n * and the polling for the results. The start query can fail because of the concurrent queries rate limit,\n * and so we have to retry the start query call if there is already lot of queries running.\n *\n * As we send multiple queries in a single request some can fail and some can succeed and we have to also handle those\n * cases by only retrying the failed queries. We retry the failed queries until we hit the time limit or all queries\n * succeed and only then we pass the data forward. This means we wait longer but makes the code a bit simpler as we\n * can treat starting the query and polling as steps in a pipeline.\n * @param queryFun\n * @param targets\n * @param options\n */\nexport function runWithRetry(\n queryFun: (targets: StartQueryRequest[]) => Observable<DataFrame[]>,\n targets: StartQueryRequest[],\n timeoutFunc: (retry: number, startTime: number) => boolean\n): Observable<{ frames: DataFrame[]; error?: DataQueryError }> {\n const startTime = new Date();\n let retries = 0;\n let timerID: any;\n let subscription: Subscription;\n let collected = {};\n\n const retryWaitFunction = (retry: number) => {\n return Math.pow(2, retry) * 1000 + Math.random() * 100;\n };\n\n return new Observable((observer) => {\n // Run function is where the logic takes place. We have it in a function so we can call it recursively.\n function run(currentQueryParams: StartQueryRequest[]) {\n subscription = queryFun(currentQueryParams).subscribe({\n next(frames) {\n // In case we successfully finished, merge the current response with whatever we already collected.\n const collectedPreviously = toDataQueryResponse({ data: { results: collected } }).data || [];\n observer.next({ frames: [...collectedPreviously, ...frames] });\n observer.complete();\n },\n error(error: FetchError<{ results?: Record<string, Result> }> | string) {\n // In case of error we first try to figure out what kind of error it is\n\n // This means it was a generic 500 error probably so we just pass it on\n if (typeof error === 'string') {\n observer.error(error);\n return;\n }\n\n // In case of multiple queries this some can error while some may be ok\n const errorData = splitErrorData(error);\n\n if (!errorData) {\n // Not sure what happened but the error structure wasn't what we expected\n observer.error(error);\n return;\n }\n\n if (!errorData!.errors.length) {\n // So there is no limit error but some other errors so nothing to retry so we just pass it as it would be\n // otherwise.\n observer.error(error);\n return;\n }\n\n if (timeoutFunc(retries, startTime.valueOf())) {\n // We timed out but we could have started some queries\n if (Object.keys(collected).length || Object.keys(errorData.good).length) {\n const dataResponse = toDataQueryResponse({\n data: {\n results: {\n ...(errorData.good ?? {}),\n ...(collected ?? {}),\n },\n },\n });\n dataResponse.error = {\n ...(dataResponse.error ?? {}),\n message: `Some queries timed out: ${errorData.errorMessage}`,\n };\n // So we consider this a partial success and pass the data forward but also with error to be shown to\n // the user.\n observer.next({\n error: dataResponse.error,\n frames: dataResponse.data,\n });\n observer.complete();\n } else {\n // So we timed out and there was no data to pass forward so we just pass the error\n const dataResponse = toDataQueryResponse({ data: { results: error.data?.results ?? {} } });\n observer.error(dataResponse.error);\n }\n return;\n }\n\n collected = {\n ...collected,\n ...errorData!.good,\n };\n\n timerID = setTimeout(\n () => {\n retries++;\n run(errorData!.errors);\n },\n // We want to know how long to wait for the next retry. First time this will be 0.\n retryWaitFunction(retries + 1)\n );\n },\n });\n }\n run(targets);\n return () => {\n // We clear only the latest timer and subscription but the observable should complete after one response so\n // there should not be more things running at the same time.\n clearTimeout(timerID);\n subscription.unsubscribe();\n };\n });\n}\n\nfunction splitErrorData(error: FetchError<{ results?: Record<string, Result> }>) {\n const results = error.data?.results;\n if (!results) {\n return undefined;\n }\n return Object.keys(results).reduce<{\n errors: StartQueryRequest[];\n good: Record<string, Result>;\n errorMessage: string;\n }>(\n (acc, refId) => {\n if (results[refId].error?.startsWith('LimitExceededException')) {\n acc.errorMessage = results[refId].error!;\n acc.errors.push(error.config.data.queries.find((q: any) => q.refId === refId));\n } else {\n acc.good[refId] = results[refId];\n }\n return acc;\n },\n { errors: [], good: {}, errorMessage: '' }\n );\n}\n","import { SchedulerLike, Observable, SchedulerAction, Subscriber, asyncScheduler } from 'rxjs';\n\n/**\n * Creates an Observable that emits sequential numbers after increasing intervals of time\n * starting with `startPeriod`, ending with `endPeriod` and incrementing by `step`.\n */\nexport const increasingInterval = (\n { startPeriod = 0, endPeriod = 5000, step = 1000 },\n scheduler: SchedulerLike = asyncScheduler\n): Observable<number> => {\n return new Observable<number>((subscriber) => {\n const state: IntervalState = {\n subscriber,\n counter: 0,\n period: startPeriod,\n step,\n endPeriod,\n };\n\n subscriber.add(scheduler.schedule(dispatch, startPeriod, state));\n return subscriber;\n });\n};\n\nfunction dispatch(this: SchedulerAction<IntervalState>, state?: IntervalState) {\n if (!state) {\n return;\n }\n const { subscriber, counter, period, step, endPeriod } = state;\n subscriber.next(counter);\n const newPeriod = Math.min(period + step, endPeriod);\n this.schedule({ subscriber, counter: counter + 1, period: newPeriod, step, endPeriod }, newPeriod);\n}\n\ninterface IntervalState {\n subscriber: Subscriber<number>;\n counter: number;\n period: number;\n endPeriod: number;\n step: number;\n}\n","import { omit } from 'lodash';\n\nimport { Dimensions, VariableQuery, VariableQueryType, OldVariableQuery, MultiFilters } from '../types';\n\nconst jsonVariable = /\\${(\\w+):json}/g;\n\nfunction isVariableQuery(rawQuery: string | VariableQuery | OldVariableQuery): rawQuery is VariableQuery {\n return typeof rawQuery !== 'string' && typeof rawQuery.ec2Filters !== 'string' && typeof rawQuery.tags !== 'string';\n}\n\nfunction migrateMultiFilters(oldFilters: string): MultiFilters {\n const tempFilters = oldFilters.replace(jsonVariable, '\"$$$1\"');\n const parsedFilters: Dimensions = JSON.parse(tempFilters);\n const newFilters: MultiFilters = {};\n // if the old filter was {key:value} transform it to {key:[value]}\n Object.keys(parsedFilters).forEach((key) => {\n const value = parsedFilters[key];\n if (typeof value === 'string') {\n newFilters[key] = [value];\n } else if (value !== undefined) {\n newFilters[key] = value;\n }\n });\n return newFilters;\n}\n\nexport function migrateVariableQuery(rawQuery: string | VariableQuery | OldVariableQuery): VariableQuery {\n if (isVariableQuery(rawQuery)) {\n return rawQuery;\n }\n\n // rawQuery is OldVariableQuery\n if (typeof rawQuery !== 'string') {\n const newQuery: VariableQuery = omit(rawQuery, ['dimensionFilters', 'ec2Filters', 'tags']);\n newQuery.dimensionFilters = {};\n newQuery.ec2Filters = {};\n newQuery.tags = {};\n\n if (rawQuery.dimensionFilters !== '' && rawQuery.ec2Filters !== '[]') {\n const tempFilters = rawQuery.dimensionFilters.replace(jsonVariable, '\"$$$1\"');\n try {\n newQuery.dimensionFilters = JSON.parse(tempFilters);\n } catch {\n throw new Error(`unable to migrate poorly formed filters: ${rawQuery.dimensionFilters}`);\n }\n }\n if (rawQuery.ec2Filters !== '' && rawQuery.ec2Filters !== '[]') {\n try {\n newQuery.ec2Filters = migrateMultiFilters(rawQuery.ec2Filters);\n } catch {\n throw new Error(`unable to migrate poorly formed filters: ${rawQuery.ec2Filters}`);\n }\n }\n if (rawQuery.tags !== '' && rawQuery.tags !== '[]') {\n try {\n newQuery.tags = migrateMultiFilters(rawQuery.tags);\n } catch {\n throw new Error(`unable to migrate poorly formed filters: ${rawQuery.tags}`);\n }\n }\n return newQuery;\n }\n\n const newQuery: VariableQuery = {\n refId: 'CloudWatchVariableQueryEditor-VariableQuery',\n queryType: VariableQueryType.Regions,\n namespace: '',\n region: '',\n metricName: '',\n dimensionKey: '',\n dimensionFilters: {},\n ec2Filters: {},\n instanceID: '',\n attributeName: '',\n resourceType: '',\n tags: {},\n };\n\n if (rawQuery === '') {\n return newQuery;\n }\n\n if (rawQuery.match(/^regions\\(\\)/)) {\n return newQuery;\n }\n if (rawQuery.match(/^namespaces\\(\\)/)) {\n newQuery.queryType = VariableQueryType.Namespaces;\n return newQuery;\n }\n const metricNameQuery = rawQuery.match(/^metrics\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/);\n if (metricNameQuery) {\n newQuery.queryType = VariableQueryType.Metrics;\n newQuery.namespace = metricNameQuery[1];\n newQuery.region = metricNameQuery[3] || '';\n return newQuery;\n }\n const dimensionKeysQuery = rawQuery.match(/^dimension_keys\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/);\n if (dimensionKeysQuery) {\n newQuery.queryType = VariableQueryType.DimensionKeys;\n newQuery.namespace = dimensionKeysQuery[1];\n newQuery.region = dimensionKeysQuery[3] || '';\n return newQuery;\n }\n\n const dimensionValuesQuery = rawQuery.match(\n /^dimension_values\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?([^,]+?)(,\\s?(.+))?\\)/\n );\n if (dimensionValuesQuery) {\n newQuery.queryType = VariableQueryType.DimensionValues;\n newQuery.region = dimensionValuesQuery[1];\n newQuery.namespace = dimensionValuesQuery[2];\n newQuery.metricName = dimensionValuesQuery[3];\n newQuery.dimensionKey = dimensionValuesQuery[4];\n newQuery.dimensionFilters = {};\n if (!!dimensionValuesQuery[6] && dimensionValuesQuery[6] !== '[]') {\n const tempFilters = dimensionValuesQuery[6].replace(jsonVariable, '\"$$$1\"');\n try {\n newQuery.dimensionFilters = JSON.parse(tempFilters);\n } catch {\n throw new Error(`unable to migrate poorly formed filters: ${dimensionValuesQuery[6]}`);\n }\n }\n return newQuery;\n }\n\n const ebsVolumeIdsQuery = rawQuery.match(/^ebs_volume_ids\\(([^,]+?),\\s?([^,]+?)\\)/);\n if (ebsVolumeIdsQuery) {\n newQuery.queryType = VariableQueryType.EBSVolumeIDs;\n newQuery.region = ebsVolumeIdsQuery[1];\n newQuery.instanceID = ebsVolumeIdsQuery[2];\n return newQuery;\n }\n\n const ec2InstanceAttributeQuery = rawQuery.match(/^ec2_instance_attribute\\(([^,]+?),\\s?([^,]+?),\\s?(.+?)\\)/);\n if (ec2InstanceAttributeQuery) {\n newQuery.queryType = VariableQueryType.EC2InstanceAttributes;\n newQuery.region = ec2InstanceAttributeQuery[1];\n newQuery.attributeName = ec2InstanceAttributeQuery[2];\n if (ec2InstanceAttributeQuery[3] && ec2InstanceAttributeQuery[3] !== '[]') {\n try {\n newQuery.ec2Filters = migrateMultiFilters(ec2InstanceAttributeQuery[3]);\n } catch {\n throw new Error(`unable to migrate poorly formed filters: ${ec2InstanceAttributeQuery[3]}`);\n }\n }\n return newQuery;\n }\n\n const resourceARNsQuery = rawQuery.match(/^resource_arns\\(([^,]+?),\\s?([^,]+?),\\s?(.+?)\\)/);\n if (resourceARNsQuery) {\n newQuery.queryType = VariableQueryType.ResourceArns;\n newQuery.region = resourceARNsQuery[1];\n newQuery.resourceType = resourceARNsQuery[2];\n if (resourceARNsQuery[3] && resourceARNsQuery[3] !== '[]') {\n try {\n newQuery.tags = migrateMultiFilters(resourceARNsQuery[3]);\n } catch {\n throw new Error(`unable to migrate poorly formed filters: ${resourceARNsQuery[3]}`);\n }\n }\n return newQuery;\n }\n\n const statsQuery = rawQuery.match(/^statistics\\(\\)/);\n if (statsQuery) {\n newQuery.queryType = VariableQueryType.Statistics;\n return newQuery;\n }\n throw new Error('unable to parse old variable query');\n}\n","import { css, cx } from '@emotion/css';\nimport React, { FunctionComponent, useState } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { AccessoryButton, InputGroup } from '@grafana/experimental';\nimport { Input, stylesFactory, useTheme2 } from '@grafana/ui';\n\nimport { MultiFilterCondition } from './MultiFilter';\n\nexport interface Props {\n filter: MultiFilterCondition;\n onChange: (value: MultiFilterCondition) => void;\n onDelete: () => void;\n keyPlaceholder?: string;\n}\n\nexport const MultiFilterItem: FunctionComponent<Props> = ({ filter, onChange, onDelete, keyPlaceholder }) => {\n const [localKey, setLocalKey] = useState(filter.key || '');\n const [localValue, setLocalValue] = useState(filter.value?.join(', ') || '');\n const theme = useTheme2();\n const styles = getOperatorStyles(theme);\n\n return (\n <div data-testid=\"cloudwatch-multifilter-item\">\n <InputGroup>\n <Input\n data-testid=\"cloudwatch-multifilter-item-key\"\n aria-label=\"Filter key\"\n value={localKey}\n placeholder={keyPlaceholder ?? 'key'}\n onChange={(e) => setLocalKey(e.currentTarget.value)}\n onBlur={() => {\n if (localKey && localKey !== filter.key) {\n onChange({ ...filter, key: localKey });\n }\n }}\n />\n\n <span className={cx(styles.root)}>=</span>\n\n <Input\n data-testid=\"cloudwatch-multifilter-item-value\"\n aria-label=\"Filter value\"\n value={localValue}\n placeholder=\"value1, value2,...\"\n onChange={(e) => setLocalValue(e.currentTarget.value)}\n onBlur={() => {\n const newValues = localValue.split(',').map((v) => v.trim());\n if (localValue && newValues !== filter.value) {\n onChange({ ...filter, value: newValues });\n }\n setLocalValue(newValues.join(', '));\n }}\n />\n\n <AccessoryButton aria-label=\"remove\" icon=\"times\" variant=\"secondary\" onClick={onDelete} type=\"button\" />\n </InputGroup>\n </div>\n );\n};\n\nconst getOperatorStyles = stylesFactory((theme: GrafanaTheme2) => ({\n root: css({\n padding: theme.spacing(0, 1),\n alignSelf: 'center',\n }),\n}));\n","import { isEqual } from 'lodash';\nimport React, { useEffect, useState } from 'react';\n\nimport { EditorList } from '@grafana/experimental';\n\nimport { MultiFilters } from '../../types';\n\nimport { MultiFilterItem } from './MultiFilterItem';\n\nexport interface Props {\n filters?: MultiFilters;\n onChange: (filters: MultiFilters) => void;\n keyPlaceholder?: string;\n}\n\nexport interface MultiFilterCondition {\n key?: string;\n operator?: string;\n value?: string[];\n}\n\nconst multiFiltersToFilterConditions = (filters: MultiFilters) =>\n Object.keys(filters).map((key) => ({ key, value: filters[key], operator: '=' }));\n\nconst filterConditionsToMultiFilters = (filters: MultiFilterCondition[]) => {\n const res: MultiFilters = {};\n filters.forEach(({ key, value }) => {\n if (key && value) {\n res[key] = value;\n }\n });\n return res;\n};\n\nexport const MultiFilter: React.FC<Props> = ({ filters, onChange, keyPlaceholder }) => {\n const [items, setItems] = useState<MultiFilterCondition[]>([]);\n useEffect(() => setItems(filters ? multiFiltersToFilterConditions(filters) : []), [filters]);\n const onFiltersChange = (newItems: Array<Partial<MultiFilterCondition>>) => {\n setItems(newItems);\n\n // The onChange event should only be triggered in the case there is a complete dimension object.\n // So when a new key is added that does not yet have a value, it should not trigger an onChange event.\n const newMultifilters = filterConditionsToMultiFilters(newItems);\n if (!isEqual(newMultifilters, filters)) {\n onChange(newMultifilters);\n }\n };\n\n return <EditorList items={items} onChange={onFiltersChange} renderItem={makeRenderFilter(keyPlaceholder)} />;\n};\n\nfunction makeRenderFilter(keyPlaceholder?: string) {\n function renderFilter(\n item: MultiFilterCondition,\n onChange: (item: MultiFilterCondition) => void,\n onDelete: () => void\n ) {\n return (\n <MultiFilterItem\n filter={item}\n onChange={(item) => onChange(item)}\n onDelete={onDelete}\n keyPlaceholder={keyPlaceholder}\n />\n );\n }\n return renderFilter;\n}\n","import React from 'react';\n\nimport { SelectableValue } from '@grafana/data';\nimport { InlineField, Select } from '@grafana/ui';\n\nimport { VariableQueryType } from '../../types';\n\nconst LABEL_WIDTH = 20;\n\ninterface VariableQueryFieldProps<T> {\n onChange: (value: T) => void;\n options: SelectableValue[];\n value: T | null;\n label: string;\n inputId?: string;\n allowCustomValue?: boolean;\n isLoading?: boolean;\n}\n\nexport const VariableQueryField = <T extends string | VariableQueryType>({\n label,\n onChange,\n value,\n options,\n allowCustomValue = false,\n isLoading = false,\n inputId = label,\n}: VariableQueryFieldProps<T>) => {\n return (\n <InlineField label={label} labelWidth={LABEL_WIDTH} htmlFor={inputId}>\n <Select\n aria-label={label}\n width={25}\n allowCustomValue={allowCustomValue}\n value={value}\n onChange={({ value }) => onChange(value!)}\n options={options}\n isLoading={isLoading}\n inputId={inputId}\n />\n </InlineField>\n );\n};\n","import React, { FC, useState } from 'react';\n\nimport { InlineField, Input, PopoverContent } from '@grafana/ui';\n\nconst LABEL_WIDTH = 20;\n\ninterface VariableTextFieldProps {\n onBlur: (value: string) => void;\n placeholder: string;\n value: string;\n label: string;\n tooltip?: PopoverContent;\n interactive?: boolean;\n}\n\nexport const VariableTextField: FC<VariableTextFieldProps> = ({\n interactive,\n label,\n onBlur,\n placeholder,\n value,\n tooltip,\n}) => {\n const [localValue, setLocalValue] = useState(value);\n return (\n <InlineField interactive={interactive} label={label} labelWidth={LABEL_WIDTH} tooltip={tooltip} grow>\n <Input\n aria-label={label}\n placeholder={placeholder}\n value={localValue}\n onChange={(e) => setLocalValue(e.currentTarget.value)}\n onBlur={() => onBlur(localValue)}\n />\n </InlineField>\n );\n};\n","import React from 'react';\n\nimport { QueryEditorProps, SelectableValue } from '@grafana/data';\nimport { InlineField } from '@grafana/ui';\n\nimport { Dimensions } from '..';\nimport { CloudWatchDatasource } from '../../datasource';\nimport { useDimensionKeys, useMetrics, useNamespaces, useRegions } from '../../hooks';\nimport { migrateVariableQuery } from '../../migrations/variableQueryMigrations';\nimport { CloudWatchJsonData, CloudWatchQuery, VariableQuery, VariableQueryType } from '../../types';\n\nimport { MultiFilter } from './MultiFilter';\nimport { VariableQueryField } from './VariableQueryField';\nimport { VariableTextField } from './VariableTextField';\n\nexport type Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData, VariableQuery>;\n\nconst queryTypes: Array<{ value: string; label: string }> = [\n { value: VariableQueryType.Regions, label: 'Regions' },\n { value: VariableQueryType.Namespaces, label: 'Namespaces' },\n { value: VariableQueryType.Metrics, label: 'Metrics' },\n { value: VariableQueryType.DimensionKeys, label: 'Dimension Keys' },\n { value: VariableQueryType.DimensionValues, label: 'Dimension Values' },\n { value: VariableQueryType.EBSVolumeIDs, label: 'EBS Volume IDs' },\n { value: VariableQueryType.EC2InstanceAttributes, label: 'EC2 Instance Attributes' },\n { value: VariableQueryType.ResourceArns, label: 'Resource ARNs' },\n { value: VariableQueryType.Statistics, label: 'Statistics' },\n];\n\nexport const VariableQueryEditor = ({ query, datasource, onChange }: Props) => {\n const parsedQuery = migrateVariableQuery(query);\n\n const { region, namespace, metricName, dimensionKey, dimensionFilters } = parsedQuery;\n const [regions, regionIsLoading] = useRegions(datasource);\n const namespaces = useNamespaces(datasource);\n const metrics = useMetrics(datasource, region, namespace);\n const dimensionKeys = useDimensionKeys(datasource, region, namespace, metricName);\n const keysForDimensionFilter = useDimensionKeys(datasource, region, namespace, metricName, dimensionFilters ?? {});\n\n const onRegionChange = async (region: string) => {\n const validatedQuery = await sanitizeQuery({\n ...parsedQuery,\n region,\n });\n onQueryChange(validatedQuery);\n };\n\n const onNamespaceChange = async (namespace: string) => {\n const validatedQuery = await sanitizeQuery({\n ...parsedQuery,\n namespace,\n });\n onQueryChange(validatedQuery);\n };\n\n const onQueryChange = (newQuery: VariableQuery) => {\n onChange({\n ...newQuery,\n refId: 'CloudWatchVariableQueryEditor-VariableQuery',\n });\n };\n\n // Reset dimensionValue parameters if namespace or region change\n const sanitizeQuery = async (query: VariableQuery) => {\n let { metricName, dimensionKey, dimensionFilters, namespace, region } = query;\n if (metricName) {\n await datasource.getMetrics(namespace, region).then((result: Array<SelectableValue<string>>) => {\n if (!result.find((metric) => metric.value === metricName)) {\n metricName = '';\n }\n });\n }\n if (dimensionKey) {\n await datasource.getDimensionKeys(namespace, region).then((result: Array<SelectableValue<string>>) => {\n if (!result.find((key) => key.value === dimensionKey)) {\n dimensionKey = '';\n dimensionFilters = {};\n }\n });\n }\n return { ...query, metricName, dimensionKey, dimensionFilters };\n };\n\n const hasRegionField = [\n VariableQueryType.Metrics,\n VariableQueryType.DimensionKeys,\n VariableQueryType.DimensionValues,\n VariableQueryType.EBSVolumeIDs,\n VariableQueryType.EC2InstanceAttributes,\n VariableQueryType.ResourceArns,\n ].includes(parsedQuery.queryType);\n const hasNamespaceField = [\n VariableQueryType.Metrics,\n VariableQueryType.DimensionKeys,\n VariableQueryType.DimensionValues,\n ].includes(parsedQuery.queryType);\n return (\n <>\n <VariableQueryField\n value={parsedQuery.queryType}\n options={queryTypes}\n onChange={(value: VariableQueryType) => onQueryChange({ ...parsedQuery, queryType: value })}\n label=\"Query Type\"\n inputId={`variable-query-type-${query.refId}`}\n />\n {hasRegionField && (\n <VariableQueryField\n value={region}\n options={regions}\n onChange={(value: string) => onRegionChange(value)}\n label=\"Region\"\n isLoading={regionIsLoading}\n inputId={`variable-query-region-${query.refId}`}\n />\n )}\n {hasNamespaceField && (\n <VariableQueryField\n value={namespace}\n options={namespaces}\n onChange={(value: string) => onNamespaceChange(value)}\n label=\"Namespace\"\n inputId={`variable-query-namespace-${query.refId}`}\n />\n )}\n {parsedQuery.queryType === VariableQueryType.DimensionValues && (\n <>\n <VariableQueryField\n value={metricName || null}\n options={metrics}\n onChange={(value: string) => onQueryChange({ ...parsedQuery, metricName: value })}\n label=\"Metric\"\n inputId={`variable-query-metric-${query.refId}`}\n />\n <VariableQueryField\n value={dimensionKey || null}\n options={dimensionKeys}\n onChange={(value: string) => onQueryChange({ ...parsedQuery, dimensionKey: value })}\n label=\"Dimension Key\"\n inputId={`variable-query-dimension-key-${query.refId}`}\n />\n <InlineField label=\"Dimensions\" labelWidth={20} tooltip=\"Dimensions to filter the returned values on\">\n <Dimensions\n metricStat={{ ...parsedQuery, dimensions: parsedQuery.dimensionFilters }}\n onChange={(dimensions) => {\n onChange({ ...parsedQuery, dimensionFilters: dimensions });\n }}\n dimensionKeys={keysForDimensionFilter}\n disableExpressions={true}\n datasource={datasource}\n />\n </InlineField>\n </>\n )}\n {parsedQuery.queryType === VariableQueryType.EBSVolumeIDs && (\n <VariableTextField\n value={query.instanceID}\n placeholder=\"i-XXXXXXXXXXXXXXXXX\"\n onBlur={(value: string) => onQueryChange({ ...parsedQuery, instanceID: value })}\n label=\"Instance ID\"\n />\n )}\n {parsedQuery.queryType === VariableQueryType.EC2InstanceAttributes && (\n <>\n <VariableTextField\n value={parsedQuery.attributeName}\n placeholder=\"attribute name\"\n onBlur={(value: string) => onQueryChange({ ...parsedQuery, attributeName: value })}\n label=\"Attribute Name\"\n interactive={true}\n tooltip={\n <>\n {'Attribute or tag to query on. Tags should be formatted \"Tags.<name>\". '}\n <a\n href=\"https://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/template-queries-cloudwatch/#selecting-attributes\"\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n See the documentation for more details\n </a>\n </>\n }\n />\n <InlineField\n label=\"Filters\"\n labelWidth={20}\n tooltip={\n <>\n <a\n href=\"https://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/template-queries-cloudwatch/#selecting-attributes\"\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n Pre-defined ec2:DescribeInstances filters/tags\n </a>\n {' and the values to filter on. Tags should be formatted tag:<name>.'}\n </>\n }\n >\n <MultiFilter\n filters={parsedQuery.ec2Filters}\n onChange={(filters) => {\n onChange({ ...parsedQuery, ec2Filters: filters });\n }}\n keyPlaceholder=\"filter/tag\"\n />\n </InlineField>\n </>\n )}\n {parsedQuery.queryType === VariableQueryType.ResourceArns && (\n <>\n <VariableTextField\n value={parsedQuery.resourceType}\n placeholder=\"resource type\"\n onBlur={(value: string) => onQueryChange({ ...parsedQuery, resourceType: value })}\n label=\"Resource Type\"\n />\n <InlineField label=\"Tags\" labelWidth={20} tooltip=\"Tags to filter the returned values on.\">\n <MultiFilter\n filters={parsedQuery.tags}\n onChange={(filters) => {\n onChange({ ...parsedQuery, tags: filters });\n }}\n keyPlaceholder=\"tag\"\n />\n </InlineField>\n </>\n )}\n </>\n );\n};\n","import { from, Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { CustomVariableSupport, DataQueryRequest, DataQueryResponse } from '@grafana/data';\n\nimport { VariableQueryEditor } from './components/VariableQueryEditor/VariableQueryEditor';\nimport { CloudWatchDatasource } from './datasource';\nimport { migrateVariableQuery } from './migrations/variableQueryMigrations';\nimport { VariableQuery, VariableQueryType } from './types';\n\nexport class CloudWatchVariableSupport extends CustomVariableSupport<CloudWatchDatasource, VariableQuery> {\n private readonly datasource: CloudWatchDatasource;\n\n constructor(datasource: CloudWatchDatasource) {\n super();\n this.datasource = datasource;\n this.query = this.query.bind(this);\n }\n\n editor = VariableQueryEditor;\n\n query(request: DataQueryRequest<VariableQuery>): Observable<DataQueryResponse> {\n const queryObj = migrateVariableQuery(request.targets[0]);\n return from(this.execute(queryObj)).pipe(map((data) => ({ data })));\n }\n\n async execute(query: VariableQuery) {\n try {\n switch (query.queryType) {\n case VariableQueryType.Regions:\n return this.handleRegionsQuery();\n case VariableQueryType.Namespaces:\n return this.handleNamespacesQuery();\n case VariableQueryType.Metrics:\n return this.handleMetricsQuery(query);\n case VariableQueryType.DimensionKeys:\n return this.handleDimensionKeysQuery(query);\n case VariableQueryType.DimensionValues:\n return this.handleDimensionValuesQuery(query);\n case VariableQueryType.EBSVolumeIDs:\n return this.handleEbsVolumeIdsQuery(query);\n case VariableQueryType.EC2InstanceAttributes:\n return this.handleEc2InstanceAttributeQuery(query);\n case VariableQueryType.ResourceArns:\n return this.handleResourceARNsQuery(query);\n case VariableQueryType.Statistics:\n return this.handleStatisticsQuery();\n }\n } catch (error) {\n console.error(`Could not run CloudWatchMetricFindQuery ${query}`, error);\n return [];\n }\n }\n\n async handleRegionsQuery() {\n const regions = await this.datasource.getRegions();\n return regions.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleNamespacesQuery() {\n const namespaces = await this.datasource.getNamespaces();\n return namespaces.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleMetricsQuery({ namespace, region }: VariableQuery) {\n const metrics = await this.datasource.getMetrics(namespace, region);\n return metrics.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleDimensionKeysQuery({ namespace, region }: VariableQuery) {\n const keys = await this.datasource.getDimensionKeys(namespace, region);\n return keys.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleDimensionValuesQuery({ namespace, region, dimensionKey, metricName, dimensionFilters }: VariableQuery) {\n if (!dimensionKey || !metricName) {\n return [];\n }\n const keys = await this.datasource.getDimensionValues(\n region,\n namespace,\n metricName,\n dimensionKey,\n dimensionFilters ?? {}\n );\n return keys.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleEbsVolumeIdsQuery({ region, instanceID }: VariableQuery) {\n if (!instanceID) {\n return [];\n }\n const ids = await this.datasource.getEbsVolumeIds(region, instanceID);\n return ids.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleEc2InstanceAttributeQuery({ region, attributeName, ec2Filters }: VariableQuery) {\n if (!attributeName) {\n return [];\n }\n const values = await this.datasource.getEc2InstanceAttribute(region, attributeName, ec2Filters ?? {});\n return values.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleResourceARNsQuery({ region, resourceType, tags }: VariableQuery) {\n if (!resourceType) {\n return [];\n }\n const keys = await this.datasource.getResourceARNs(region, resourceType, tags ?? {});\n return keys.map((s: { label: string; value: string }) => ({\n text: s.label,\n value: s.value,\n expandable: true,\n }));\n }\n\n async handleStatisticsQuery() {\n return this.datasource.standardStatistics.map((s: string) => ({\n text: s,\n value: s,\n expandable: true,\n }));\n }\n}\n","import { cloneDeep, find, findLast, isEmpty, isString, set } from 'lodash';\nimport React from 'react';\nimport { from, lastValueFrom, merge, Observable, of, throwError, zip } from 'rxjs';\nimport { catchError, concatMap, finalize, map, mergeMap, repeat, scan, share, takeWhile, tap } from 'rxjs/operators';\n\nimport {\n DataFrame,\n DataQueryError,\n DataQueryErrorType,\n DataQueryRequest,\n DataQueryResponse,\n DataSourceInstanceSettings,\n DataSourceWithLogsContextSupport,\n dateMath,\n dateTimeFormat,\n FieldType,\n LoadingState,\n LogRowModel,\n rangeUtil,\n ScopedVars,\n TimeRange,\n} from '@grafana/data';\nimport { DataSourceWithBackend, FetchError, getBackendSrv, toDataQueryResponse } from '@grafana/runtime';\nimport { RowContextOptions } from '@grafana/ui/src/components/Logs/LogRowContextProvider';\nimport { notifyApp } from 'app/core/actions';\nimport { config } from 'app/core/config';\nimport { createErrorNotification } from 'app/core/copy/appNotification';\nimport { getTimeSrv, TimeSrv } from 'app/features/dashboard/services/TimeSrv';\nimport { getTemplateSrv, TemplateSrv } from 'app/features/templating/template_srv';\nimport { VariableWithMultiSupport } from 'app/features/variables/types';\nimport { store } from 'app/store/store';\nimport { AppNotificationTimeout } from 'app/types';\n\nimport { CloudWatchAnnotationSupport } from './annotationSupport';\nimport { SQLCompletionItemProvider } from './cloudwatch-sql/completion/CompletionItemProvider';\nimport { ThrottlingErrorMessage } from './components/ThrottlingErrorMessage';\nimport { isCloudWatchAnnotationQuery, isCloudWatchLogsQuery, isCloudWatchMetricsQuery } from './guards';\nimport { CloudWatchLanguageProvider } from './language_provider';\nimport memoizedDebounce from './memoizedDebounce';\nimport { MetricMathCompletionItemProvider } from './metric-math/completion/CompletionItemProvider';\nimport { migrateMetricQuery } from './migrations/metricQueryMigrations';\nimport {\n CloudWatchAnnotationQuery,\n CloudWatchJsonData,\n CloudWatchLogsQuery,\n CloudWatchLogsQueryStatus,\n CloudWatchLogsRequest,\n CloudWatchMetricsQuery,\n CloudWatchQuery,\n DescribeLogGroupsRequest,\n Dimensions,\n GetLogEventsRequest,\n GetLogGroupFieldsRequest,\n GetLogGroupFieldsResponse,\n LogAction,\n MetricEditorMode,\n MetricQuery,\n MetricQueryType,\n MetricRequest,\n MultiFilters,\n StartQueryRequest,\n TSDBResponse,\n} from './types';\nimport { addDataLinksToLogsResponse } from './utils/datalinks';\nimport { runWithRetry } from './utils/logsRetry';\nimport { increasingInterval } from './utils/rxjs/increasingInterval';\nimport { CloudWatchVariableSupport } from './variables';\n\nconst DS_QUERY_ENDPOINT = '/api/ds/query';\n\n// Constants also defined in tsdb/cloudwatch/cloudwatch.go\nexport const LOG_IDENTIFIER_INTERNAL = '__log__grafana_internal__';\nexport const LOGSTREAM_IDENTIFIER_INTERNAL = '__logstream__grafana_internal__';\n\nconst displayAlert = (datasourceName: string, region: string) =>\n store.dispatch(\n notifyApp(\n createErrorNotification(\n `CloudWatch request limit reached in ${region} for data source ${datasourceName}`,\n '',\n undefined,\n React.createElement(ThrottlingErrorMessage, { region }, null)\n )\n )\n );\n\nconst displayCustomError = (title: string, message: string) =>\n store.dispatch(notifyApp(createErrorNotification(title, message)));\n\nexport class CloudWatchDatasource\n extends DataSourceWithBackend<CloudWatchQuery, CloudWatchJsonData>\n implements DataSourceWithLogsContextSupport<CloudWatchLogsQuery>\n{\n proxyUrl: any;\n defaultRegion: any;\n datasourceName: string;\n languageProvider: CloudWatchLanguageProvider;\n sqlCompletionItemProvider: SQLCompletionItemProvider;\n\n metricMathCompletionItemProvider: MetricMathCompletionItemProvider;\n\n tracingDataSourceUid?: string;\n logsTimeout: string;\n\n type = 'cloudwatch';\n standardStatistics = ['Average', 'Maximum', 'Minimum', 'Sum', 'SampleCount'];\n\n debouncedAlert: (datasourceName: string, region: string) => void = memoizedDebounce(\n displayAlert,\n AppNotificationTimeout.Error\n );\n debouncedCustomAlert: (title: string, message: string) => void = memoizedDebounce(\n displayCustomError,\n AppNotificationTimeout.Error\n );\n logQueries: Record<string, { id: string; region: string; statsQuery: boolean }> = {};\n\n constructor(\n instanceSettings: DataSourceInstanceSettings<CloudWatchJsonData>,\n private readonly templateSrv: TemplateSrv = getTemplateSrv(),\n private readonly timeSrv: TimeSrv = getTimeSrv()\n ) {\n super(instanceSettings);\n this.proxyUrl = instanceSettings.url;\n this.defaultRegion = instanceSettings.jsonData.defaultRegion;\n this.datasourceName = instanceSettings.name;\n this.languageProvider = new CloudWatchLanguageProvider(this);\n this.tracingDataSourceUid = instanceSettings.jsonData.tracingDatasourceUid;\n this.logsTimeout = instanceSettings.jsonData.logsTimeout || '15m';\n this.sqlCompletionItemProvider = new SQLCompletionItemProvider(this, this.templateSrv);\n this.metricMathCompletionItemProvider = new MetricMathCompletionItemProvider(this, this.templateSrv);\n this.variables = new CloudWatchVariableSupport(this);\n this.annotations = CloudWatchAnnotationSupport;\n }\n\n filterQuery(query: CloudWatchQuery) {\n return query.hide !== true || (isCloudWatchMetricsQuery(query) && query.id !== '');\n }\n\n query(options: DataQueryRequest<CloudWatchQuery>): Observable<DataQueryResponse> {\n options = cloneDeep(options);\n\n let queries = options.targets.filter(this.filterQuery);\n const { logQueries, metricsQueries, annotationQueries } = this.getTargetsByQueryMode(queries);\n\n const dataQueryResponses: Array<Observable<DataQueryResponse>> = [];\n if (logQueries.length > 0) {\n dataQueryResponses.push(this.handleLogQueries(logQueries, options));\n }\n\n if (metricsQueries.length > 0) {\n dataQueryResponses.push(this.handleMetricQueries(metricsQueries, options));\n }\n\n if (annotationQueries.length > 0) {\n dataQueryResponses.push(this.handleAnnotationQuery(annotationQueries, options));\n }\n // No valid targets, return the empty result to save a round trip.\n if (isEmpty(dataQueryResponses)) {\n return of({\n data: [],\n state: LoadingState.Done,\n });\n }\n\n return merge(...dataQueryResponses);\n }\n\n /**\n * Handle log query. The log query works by starting the query on the CloudWatch and then periodically polling for\n * results.\n * @param logQueries\n * @param options\n */\n handleLogQueries = (\n logQueries: CloudWatchLogsQuery[],\n options: DataQueryRequest<CloudWatchQuery>\n ): Observable<DataQueryResponse> => {\n const validLogQueries = logQueries.filter((item) => item.logGroupNames?.length);\n if (logQueries.length > validLogQueries.length) {\n return of({ data: [], error: { message: 'Log group is required' } });\n }\n\n // No valid targets, return the empty result to save a round trip.\n if (isEmpty(validLogQueries)) {\n return of({ data: [], state: LoadingState.Done });\n }\n\n const queryParams = logQueries.map((target: CloudWatchLogsQuery) => ({\n queryString: target.expression || '',\n refId: target.refId,\n logGroupNames: target.logGroupNames,\n region: this.replace(this.getActualRegion(target.region), options.scopedVars, true, 'region'),\n }));\n\n const startTime = new Date();\n const timeoutFunc = () => {\n return Date.now() >= startTime.valueOf() + rangeUtil.intervalToMs(this.logsTimeout);\n };\n\n return runWithRetry(\n (targets: StartQueryRequest[]) => {\n return this.makeLogActionRequest('StartQuery', targets, {\n makeReplacements: true,\n scopedVars: options.scopedVars,\n skipCache: true,\n });\n },\n queryParams,\n timeoutFunc\n ).pipe(\n mergeMap(({ frames, error }: { frames: DataFrame[]; error?: DataQueryError }) =>\n // This queries for the results\n this.logsQuery(\n frames.map((dataFrame) => ({\n queryId: dataFrame.fields[0].values.get(0),\n region: dataFrame.meta?.custom?.['Region'] ?? 'default',\n refId: dataFrame.refId!,\n statsGroups: (logQueries.find((target) => target.refId === dataFrame.refId)! as CloudWatchLogsQuery)\n .statsGroups,\n })),\n timeoutFunc\n ).pipe(\n map((response: DataQueryResponse) => {\n if (!response.error && error) {\n response.error = error;\n }\n return response;\n })\n )\n ),\n mergeMap((dataQueryResponse) => {\n return from(\n (async () => {\n await addDataLinksToLogsResponse(\n dataQueryResponse,\n options,\n this.timeSrv.timeRange(),\n this.replace.bind(this),\n this.expandVariableToArray.bind(this),\n this.getActualRegion.bind(this),\n this.tracingDataSourceUid\n );\n\n return dataQueryResponse;\n })()\n );\n })\n );\n };\n\n filterMetricQuery(query: CloudWatchMetricsQuery): boolean {\n const { region, metricQueryType, metricEditorMode, expression, metricName, namespace, sqlExpression, statistic } =\n query;\n if (!region) {\n return false;\n }\n if (metricQueryType === MetricQueryType.Search && metricEditorMode === MetricEditorMode.Builder) {\n return !!namespace && !!metricName && !!statistic;\n } else if (metricQueryType === MetricQueryType.Search && metricEditorMode === MetricEditorMode.Code) {\n return !!expression;\n } else if (metricQueryType === MetricQueryType.Query) {\n // still TBD how to validate the visual query builder for SQL\n return !!sqlExpression;\n }\n\n throw new Error('invalid metric editor mode');\n }\n\n replaceMetricQueryVars(\n query: CloudWatchMetricsQuery,\n options: DataQueryRequest<CloudWatchQuery>\n ): CloudWatchMetricsQuery {\n query.region = this.templateSrv.replace(this.getActualRegion(query.region), options.scopedVars);\n query.namespace = this.replace(query.namespace, options.scopedVars, true, 'namespace');\n query.metricName = this.replace(query.metricName, options.scopedVars, true, 'metric name');\n query.dimensions = this.convertDimensionFormat(query.dimensions ?? {}, options.scopedVars);\n query.statistic = this.templateSrv.replace(query.statistic, options.scopedVars);\n query.period = String(this.getPeriod(query, options)); // use string format for period in graph query, and alerting\n query.id = this.templateSrv.replace(query.id, options.scopedVars);\n query.expression = this.templateSrv.replace(query.expression, options.scopedVars);\n query.sqlExpression = this.templateSrv.replace(query.sqlExpression, options.scopedVars, 'raw');\n\n return query;\n }\n\n handleMetricQueries = (\n metricQueries: CloudWatchMetricsQuery[],\n options: DataQueryRequest<CloudWatchQuery>\n ): Observable<DataQueryResponse> => {\n const timezoneUTCOffset = dateTimeFormat(Date.now(), {\n timeZone: options.timezone,\n format: 'Z',\n }).replace(':', '');\n\n const validMetricsQueries = metricQueries\n .filter(this.filterMetricQuery)\n .map((q: CloudWatchMetricsQuery): MetricQuery => {\n const migratedQuery = migrateMetricQuery(q);\n const migratedAndIterpolatedQuery = this.replaceMetricQueryVars(migratedQuery, options);\n\n return {\n timezoneUTCOffset,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n ...migratedAndIterpolatedQuery,\n type: 'timeSeriesQuery',\n datasource: this.getRef(),\n };\n });\n\n // No valid targets, return the empty result to save a round trip.\n if (isEmpty(validMetricsQueries)) {\n return of({ data: [] });\n }\n\n const request = {\n from: options?.range?.from.valueOf().toString(),\n to: options?.range?.to.valueOf().toString(),\n queries: validMetricsQueries,\n };\n\n return this.performTimeSeriesQuery(request, options.range);\n };\n\n handleAnnotationQuery(\n queries: CloudWatchAnnotationQuery[],\n options: DataQueryRequest<CloudWatchQuery>\n ): Observable<DataQueryResponse> {\n return this.awsRequest(DS_QUERY_ENDPOINT, {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries.map((query) => ({\n ...query,\n statistic: this.templateSrv.replace(query.statistic),\n region: this.templateSrv.replace(this.getActualRegion(query.region)),\n namespace: this.templateSrv.replace(query.namespace),\n metricName: this.templateSrv.replace(query.metricName),\n dimensions: this.convertDimensionFormat(query.dimensions ?? {}, {}),\n period: query.period ? parseInt(query.period, 10) : 300,\n actionPrefix: query.actionPrefix ?? '',\n alarmNamePrefix: query.alarmNamePrefix ?? '',\n type: 'annotationQuery',\n datasource: this.getRef(),\n })),\n }).pipe(\n map((r) => {\n const frames = toDataQueryResponse({ data: r }).data as DataFrame[];\n return { data: frames };\n })\n );\n }\n\n /**\n * Checks progress and polls data of a started logs query with some retry logic.\n * @param queryParams\n */\n logsQuery(\n queryParams: Array<{\n queryId: string;\n refId: string;\n limit?: number;\n region: string;\n statsGroups?: string[];\n }>,\n timeoutFunc: () => boolean\n ): Observable<DataQueryResponse> {\n this.logQueries = {};\n queryParams.forEach((param) => {\n this.logQueries[param.refId] = {\n id: param.queryId,\n region: param.region,\n statsQuery: (param.statsGroups?.length ?? 0) > 0 ?? false,\n };\n });\n\n const dataFrames = increasingInterval({ startPeriod: 100, endPeriod: 1000, step: 300 }).pipe(\n concatMap((_) => this.makeLogActionRequest('GetQueryResults', queryParams, { skipCache: true })),\n repeat(),\n share()\n );\n\n const consecutiveFailedAttempts = dataFrames.pipe(\n scan(\n ({ failures, prevRecordsMatched }, frames) => {\n failures++;\n for (const frame of frames) {\n const recordsMatched = frame.meta?.stats?.find((stat) => stat.displayName === 'Records scanned')?.value!;\n if (recordsMatched > (prevRecordsMatched[frame.refId!] ?? 0)) {\n failures = 0;\n }\n prevRecordsMatched[frame.refId!] = recordsMatched;\n }\n\n return { failures, prevRecordsMatched };\n },\n { failures: 0, prevRecordsMatched: {} as Record<string, number> }\n ),\n map(({ failures }) => failures),\n share()\n );\n\n const queryResponse: Observable<DataQueryResponse> = zip(dataFrames, consecutiveFailedAttempts).pipe(\n tap(([dataFrames]) => {\n for (const frame of dataFrames) {\n if (\n [\n CloudWatchLogsQueryStatus.Complete,\n CloudWatchLogsQueryStatus.Cancelled,\n CloudWatchLogsQueryStatus.Failed,\n ].includes(frame.meta?.custom?.['Status']) &&\n this.logQueries.hasOwnProperty(frame.refId!)\n ) {\n delete this.logQueries[frame.refId!];\n }\n }\n }),\n map(([dataFrames, failedAttempts]) => {\n if (timeoutFunc()) {\n for (const frame of dataFrames) {\n set(frame, 'meta.custom.Status', CloudWatchLogsQueryStatus.Cancelled);\n }\n }\n\n return {\n data: dataFrames,\n key: 'test-key',\n state: dataFrames.every((dataFrame) =>\n [\n CloudWatchLogsQueryStatus.Complete,\n CloudWatchLogsQueryStatus.Cancelled,\n CloudWatchLogsQueryStatus.Failed,\n ].includes(dataFrame.meta?.custom?.['Status'])\n )\n ? LoadingState.Done\n : LoadingState.Loading,\n error: timeoutFunc()\n ? {\n message: `error: query timed out after ${failedAttempts} attempts`,\n type: DataQueryErrorType.Timeout,\n }\n : undefined,\n };\n }),\n takeWhile(({ state }) => state !== LoadingState.Error && state !== LoadingState.Done, true)\n );\n\n return withTeardown(queryResponse, () => this.stopQueries());\n }\n\n stopQueries() {\n if (Object.keys(this.logQueries).length > 0) {\n this.makeLogActionRequest(\n 'StopQuery',\n Object.values(this.logQueries).map((logQuery) => ({ queryId: logQuery.id, region: logQuery.region })),\n {\n makeReplacements: false,\n skipCache: true,\n }\n ).pipe(\n finalize(() => {\n this.logQueries = {};\n })\n );\n }\n }\n\n async describeLogGroups(params: DescribeLogGroupsRequest): Promise<string[]> {\n const dataFrames = await lastValueFrom(this.makeLogActionRequest('DescribeLogGroups', [params]));\n\n const logGroupNames = dataFrames[0]?.fields[0]?.values.toArray() ?? [];\n return logGroupNames;\n }\n\n async getLogGroupFields(params: GetLogGroupFieldsRequest): Promise<GetLogGroupFieldsResponse> {\n const dataFrames = await lastValueFrom(this.makeLogActionRequest('GetLogGroupFields', [params]));\n\n const fieldNames = dataFrames[0].fields[0].values.toArray();\n const fieldPercentages = dataFrames[0].fields[1].values.toArray();\n const getLogGroupFieldsResponse = {\n logGroupFields: fieldNames.map((val, i) => ({ name: val, percent: fieldPercentages[i] })) ?? [],\n };\n\n return getLogGroupFieldsResponse;\n }\n\n getLogRowContext = async (\n row: LogRowModel,\n { limit = 10, direction = 'BACKWARD' }: RowContextOptions = {},\n query?: CloudWatchLogsQuery\n ): Promise<{ data: DataFrame[] }> => {\n let logStreamField = null;\n let logField = null;\n\n for (const field of row.dataFrame.fields) {\n if (field.name === LOGSTREAM_IDENTIFIER_INTERNAL) {\n logStreamField = field;\n if (logField !== null) {\n break;\n }\n } else if (field.name === LOG_IDENTIFIER_INTERNAL) {\n logField = field;\n if (logStreamField !== null) {\n break;\n }\n }\n }\n\n const requestParams: GetLogEventsRequest = {\n limit,\n startFromHead: direction !== 'BACKWARD',\n region: query?.region,\n logGroupName: parseLogGroupName(logField!.values.get(row.rowIndex)),\n logStreamName: logStreamField!.values.get(row.rowIndex),\n };\n\n if (direction === 'BACKWARD') {\n requestParams.endTime = row.timeEpochMs;\n } else {\n requestParams.startTime = row.timeEpochMs;\n }\n\n const dataFrames = await lastValueFrom(this.makeLogActionRequest('GetLogEvents', [requestParams]));\n\n return {\n data: dataFrames,\n };\n };\n\n getVariables() {\n return this.templateSrv.getVariables().map((v) => `$${v.name}`);\n }\n\n getPeriod(target: CloudWatchMetricsQuery, options: any) {\n let period = this.templateSrv.replace(target.period, options.scopedVars) as any;\n if (period && period.toLowerCase() !== 'auto') {\n if (/^\\d+$/.test(period)) {\n period = parseInt(period, 10);\n } else {\n period = rangeUtil.intervalToSeconds(period);\n }\n\n if (period < 1) {\n period = 1;\n }\n }\n\n return period || '';\n }\n\n performTimeSeriesQuery(request: MetricRequest, { from, to }: TimeRange): Observable<any> {\n return this.awsRequest(DS_QUERY_ENDPOINT, request).pipe(\n map((res) => {\n const dataframes: DataFrame[] = toDataQueryResponse({ data: res }).data;\n if (!dataframes || dataframes.length <= 0) {\n return { data: [] };\n }\n\n const lastError = findLast(res.results, (v) => !!v.error);\n\n dataframes.forEach((frame) => {\n frame.fields.forEach((field) => {\n if (field.type === FieldType.time) {\n // field.config.interval is populated in order for Grafana to fill in null values at frame intervals\n field.config.interval = frame.meta?.custom?.period * 1000;\n }\n });\n });\n\n return {\n data: dataframes,\n error: lastError ? { message: lastError.error } : null,\n };\n }),\n catchError((err) => {\n const isFrameError = err.data.results;\n\n // Error is not frame specific\n if (!isFrameError && err.data && err.data.message === 'Metric request error' && err.data.error) {\n err.message = err.data.error;\n return throwError(() => err);\n }\n\n // The error is either for a specific frame or for all the frames\n const results: Array<{ error?: string }> = Object.values(err.data.results);\n const firstErrorResult = results.find((r) => r.error);\n if (firstErrorResult) {\n err.message = firstErrorResult.error;\n }\n\n if (results.some((r) => r.error && /^Throttling:.*/.test(r.error))) {\n const failedRedIds = Object.keys(err.data.results);\n const regionsAffected = Object.values(request.queries).reduce(\n (res: string[], { refId, region }) =>\n (refId && !failedRedIds.includes(refId)) || res.includes(region) ? res : [...res, region],\n []\n ) as string[];\n regionsAffected.forEach((region) => {\n const actualRegion = this.getActualRegion(region);\n if (actualRegion) {\n this.debouncedAlert(this.datasourceName, actualRegion);\n }\n });\n }\n\n return throwError(() => err);\n })\n );\n }\n\n doMetricResourceRequest(subtype: string, parameters?: any): Promise<Array<{ text: any; label: any; value: any }>> {\n return this.getResource(subtype, parameters);\n }\n\n makeLogActionRequest(\n subtype: LogAction,\n queryParams: CloudWatchLogsRequest[],\n options: {\n scopedVars?: ScopedVars;\n makeReplacements?: boolean;\n skipCache?: boolean;\n } = {\n makeReplacements: true,\n skipCache: false,\n }\n ): Observable<DataFrame[]> {\n const range = this.timeSrv.timeRange();\n\n const requestParams = {\n from: range.from.valueOf().toString(),\n to: range.to.valueOf().toString(),\n queries: queryParams.map((param: CloudWatchLogsRequest) => ({\n refId: (param as StartQueryRequest).refId || 'A',\n intervalMs: 1, // dummy\n maxDataPoints: 1, // dummy\n datasource: this.getRef(),\n type: 'logAction',\n subtype: subtype,\n ...param,\n })),\n };\n\n if (options.makeReplacements) {\n requestParams.queries.forEach((query: CloudWatchLogsRequest) => {\n const fieldsToReplace: Array<\n keyof (GetLogEventsRequest & StartQueryRequest & DescribeLogGroupsRequest & GetLogGroupFieldsRequest)\n > = ['queryString', 'logGroupNames', 'logGroupName', 'logGroupNamePrefix'];\n\n const anyQuery: any = query;\n for (const fieldName of fieldsToReplace) {\n if (query.hasOwnProperty(fieldName)) {\n if (Array.isArray(anyQuery[fieldName])) {\n anyQuery[fieldName] = anyQuery[fieldName].flatMap((val: string) => {\n if (fieldName === 'logGroupNames') {\n return this.expandVariableToArray(val, options.scopedVars || {});\n }\n return this.replace(val, options.scopedVars, true, fieldName);\n });\n } else {\n anyQuery[fieldName] = this.replace(anyQuery[fieldName], options.scopedVars, true, fieldName);\n }\n }\n }\n // TODO: seems to be some sort of bug that we don't really send region with all queries. This means\n // if you select different than default region in editor you will get results for autocomplete from wrong\n // region.\n if (anyQuery.region) {\n anyQuery.region = this.replace(anyQuery.region, options.scopedVars, true, 'region');\n anyQuery.region = this.getActualRegion(anyQuery.region);\n }\n });\n }\n\n const resultsToDataFrames = (val: any): DataFrame[] => toDataQueryResponse(val).data || [];\n let headers = {};\n if (options.skipCache) {\n headers = {\n 'X-Cache-Skip': true,\n };\n }\n\n return this.awsRequest(DS_QUERY_ENDPOINT, requestParams, headers).pipe(\n map((response) => resultsToDataFrames({ data: response })),\n catchError((err: FetchError) => {\n if (config.featureToggles.datasourceQueryMultiStatus && err.status === 207) {\n throw err;\n }\n\n if (err.status === 400) {\n throw err;\n }\n\n if (err.data?.error) {\n throw err.data.error;\n } else if (err.data?.message) {\n // In PROD we do not supply .error\n throw err.data.message;\n }\n\n throw err;\n })\n );\n }\n\n getRegions(): Promise<Array<{ label: string; value: string; text: string }>> {\n return this.doMetricResourceRequest('regions').then((regions: any) => [\n { label: 'default', value: 'default', text: 'default' },\n ...regions,\n ]);\n }\n\n getNamespaces() {\n return this.doMetricResourceRequest('namespaces');\n }\n\n async getMetrics(namespace: string | undefined, region?: string) {\n if (!namespace) {\n return [];\n }\n\n return this.doMetricResourceRequest('metrics', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n });\n }\n\n async getAllMetrics(region: string): Promise<Array<{ metricName: string; namespace: string }>> {\n const values = await this.doMetricResourceRequest('all-metrics', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n });\n\n return values.map((v) => ({ metricName: v.value, namespace: v.text }));\n }\n\n async getDimensionKeys(\n namespace: string | undefined,\n region: string,\n dimensionFilters: Dimensions = {},\n metricName = ''\n ) {\n if (!namespace) {\n return [];\n }\n\n return this.doMetricResourceRequest('dimension-keys', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n dimensionFilters: JSON.stringify(this.convertDimensionFormat(dimensionFilters, {})),\n metricName,\n });\n }\n\n async getDimensionValues(\n region: string,\n namespace: string | undefined,\n metricName: string | undefined,\n dimensionKey: string,\n filterDimensions: {}\n ) {\n if (!namespace || !metricName) {\n return [];\n }\n\n const values = await this.doMetricResourceRequest('dimension-values', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n metricName: this.templateSrv.replace(metricName.trim()),\n dimensionKey: this.templateSrv.replace(dimensionKey),\n dimensions: JSON.stringify(this.convertDimensionFormat(filterDimensions, {})),\n });\n\n return values;\n }\n\n getEbsVolumeIds(region: string, instanceId: string) {\n return this.doMetricResourceRequest('ebs-volume-ids', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n instanceId: this.templateSrv.replace(instanceId),\n });\n }\n\n getEc2InstanceAttribute(region: string, attributeName: string, filters: any) {\n return this.doMetricResourceRequest('ec2-instance-attribute', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n attributeName: this.templateSrv.replace(attributeName),\n filters: JSON.stringify(this.convertMultiFilterFormat(filters, 'filter key')),\n });\n }\n\n getResourceARNs(region: string, resourceType: string, tags: any) {\n return this.doMetricResourceRequest('resource-arns', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n resourceType: this.templateSrv.replace(resourceType),\n tags: JSON.stringify(this.convertMultiFilterFormat(tags, 'tag name')),\n });\n }\n\n targetContainsTemplate(target: any) {\n return (\n this.templateSrv.containsTemplate(target.region) ||\n this.templateSrv.containsTemplate(target.namespace) ||\n this.templateSrv.containsTemplate(target.metricName) ||\n this.templateSrv.containsTemplate(target.expression!) ||\n target.logGroupNames?.some((logGroup: string) => this.templateSrv.containsTemplate(logGroup)) ||\n find(target.dimensions, (v, k) => this.templateSrv.containsTemplate(k) || this.templateSrv.containsTemplate(v))\n );\n }\n\n awsRequest(url: string, data: MetricRequest, headers: Record<string, any> = {}): Observable<TSDBResponse> {\n const options = {\n method: 'POST',\n url,\n data,\n headers,\n };\n\n return getBackendSrv()\n .fetch<TSDBResponse>(options)\n .pipe(map((result) => result.data));\n }\n\n getDefaultRegion() {\n return this.defaultRegion;\n }\n\n getActualRegion(region?: string) {\n if (region === 'default' || region === undefined || region === '') {\n return this.getDefaultRegion();\n }\n return region;\n }\n\n showContextToggle() {\n return true;\n }\n\n convertToCloudWatchTime(date: any, roundUp: any) {\n if (isString(date)) {\n date = dateMath.parse(date, roundUp);\n }\n return Math.round(date.valueOf() / 1000);\n }\n\n convertDimensionFormat(dimensions: Dimensions, scopedVars: ScopedVars) {\n return Object.entries(dimensions).reduce((result, [key, value]) => {\n key = this.replace(key, scopedVars, true, 'dimension keys');\n\n if (Array.isArray(value)) {\n return { ...result, [key]: value };\n }\n\n if (!value) {\n return { ...result, [key]: null };\n }\n\n const newValues = this.expandVariableToArray(value, scopedVars);\n return { ...result, [key]: newValues };\n }, {});\n }\n\n // get the value for a given template variable\n expandVariableToArray(value: string, scopedVars: ScopedVars): string[] {\n const variableName = this.templateSrv.getVariableName(value);\n const valueVar = this.templateSrv.getVariables().find(({ name }) => {\n return name === variableName;\n });\n if (variableName && valueVar) {\n if ((valueVar as unknown as VariableWithMultiSupport).multi) {\n return this.templateSrv.replace(value, scopedVars, 'pipe').split('|');\n }\n return [this.templateSrv.replace(value, scopedVars)];\n }\n return [value];\n }\n\n convertMultiFilterFormat(multiFilters: MultiFilters, fieldName?: string) {\n return Object.entries(multiFilters).reduce((result, [key, values]) => {\n key = this.replace(key, {}, true, fieldName);\n if (!values) {\n return { ...result, [key]: null };\n }\n const initialVal: string[] = [];\n const newValues = values.reduce((result, value) => {\n const vals = this.expandVariableToArray(value, {});\n return [...result, ...vals];\n }, initialVal);\n return { ...result, [key]: newValues };\n }, {});\n }\n\n replace(\n target?: string,\n scopedVars?: ScopedVars,\n displayErrorIfIsMultiTemplateVariable?: boolean,\n fieldName?: string\n ) {\n if (displayErrorIfIsMultiTemplateVariable && !!target) {\n const variable = this.templateSrv\n .getVariables()\n .find(({ name }) => name === this.templateSrv.getVariableName(target));\n if (variable && (variable as unknown as VariableWithMultiSupport).multi) {\n this.debouncedCustomAlert(\n 'CloudWatch templating error',\n `Multi template variables are not supported for ${fieldName || target}`\n );\n }\n }\n\n return this.templateSrv.replace(target, scopedVars);\n }\n\n getQueryDisplayText(query: CloudWatchQuery) {\n if (query.queryMode === 'Logs') {\n return query.expression ?? '';\n } else {\n return JSON.stringify(query);\n }\n }\n\n getTargetsByQueryMode = (targets: CloudWatchQuery[]) => {\n const logQueries: CloudWatchLogsQuery[] = [];\n const metricsQueries: CloudWatchMetricsQuery[] = [];\n const annotationQueries: CloudWatchAnnotationQuery[] = [];\n\n targets.forEach((query) => {\n if (isCloudWatchAnnotationQuery(query)) {\n annotationQueries.push(query);\n } else if (isCloudWatchLogsQuery(query)) {\n logQueries.push(query);\n } else {\n metricsQueries.push(query);\n }\n });\n\n return {\n logQueries,\n metricsQueries,\n annotationQueries,\n };\n };\n\n interpolateVariablesInQueries(queries: CloudWatchQuery[], scopedVars: ScopedVars): CloudWatchQuery[] {\n if (!queries.length) {\n return queries;\n }\n\n return queries.map((query) => ({\n ...query,\n region: this.getActualRegion(this.replace(query.region, scopedVars)),\n ...(isCloudWatchMetricsQuery(query) && this.interpolateMetricsQueryVariables(query, scopedVars)),\n }));\n }\n\n interpolateMetricsQueryVariables(\n query: CloudWatchMetricsQuery,\n scopedVars: ScopedVars\n ): Pick<CloudWatchMetricsQuery, 'alias' | 'metricName' | 'namespace' | 'period' | 'dimensions' | 'sqlExpression'> {\n return {\n alias: this.replace(query.alias, scopedVars),\n metricName: this.replace(query.metricName, scopedVars),\n namespace: this.replace(query.namespace, scopedVars),\n period: this.replace(query.period, scopedVars),\n sqlExpression: this.replace(query.sqlExpression, scopedVars),\n dimensions: this.convertDimensionFormat(query.dimensions ?? {}, scopedVars),\n };\n }\n}\n\nfunction withTeardown<T = any>(observable: Observable<T>, onUnsubscribe: () => void): Observable<T> {\n return new Observable<T>((subscriber) => {\n const innerSub = observable.subscribe({\n next: (val) => subscriber.next(val),\n error: (err) => subscriber.next(err),\n complete: () => subscriber.complete(),\n });\n\n return () => {\n innerSub.unsubscribe();\n onUnsubscribe();\n };\n });\n}\n\nfunction parseLogGroupName(logIdentifier: string): string {\n const colonIndex = logIdentifier.lastIndexOf(':');\n return logIdentifier.slice(colonIndex + 1);\n}\n","import { DataSourcePlugin } from '@grafana/data';\n\nimport { ConfigEditor } from './components/ConfigEditor';\nimport LogsCheatSheet from './components/LogsCheatSheet';\nimport { MetaInspector } from './components/MetaInspector';\nimport { PanelQueryEditor } from './components/PanelQueryEditor';\nimport { CloudWatchDatasource } from './datasource';\nimport { CloudWatchJsonData, CloudWatchQuery } from './types';\n\nexport const plugin = new DataSourcePlugin<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>(\n CloudWatchDatasource\n)\n .setQueryEditorHelp(LogsCheatSheet)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(PanelQueryEditor)\n .setMetadataInspector(MetaInspector);\n","import React, { FC, useEffect, useState } from 'react';\nimport { useDebounce } from 'react-use';\n\nimport { ConnectionConfig } from '@grafana/aws-sdk';\nimport {\n rangeUtil,\n DataSourcePluginOptionsEditorProps,\n onUpdateDatasourceJsonDataOption,\n updateDatasourcePluginJsonDataOption,\n} from '@grafana/data';\nimport { Input, InlineField } from '@grafana/ui';\nimport { notifyApp } from 'app/core/actions';\nimport { createWarningNotification } from 'app/core/copy/appNotification';\nimport { getDatasourceSrv } from 'app/features/plugins/datasource_srv';\nimport { store } from 'app/store/store';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { CloudWatchJsonData, CloudWatchSecureJsonData } from '../types';\n\nimport { XrayLinkConfig } from './XrayLinkConfig';\n\nexport type Props = DataSourcePluginOptionsEditorProps<CloudWatchJsonData, CloudWatchSecureJsonData>;\n\nexport const ConfigEditor: FC<Props> = (props: Props) => {\n const { options } = props;\n\n const datasource = useDatasource(options.name);\n useAuthenticationWarning(options.jsonData);\n const logsTimeoutError = useTimoutValidation(props.options.jsonData.logsTimeout);\n\n return (\n <>\n <ConnectionConfig\n {...props}\n loadRegions={\n datasource &&\n (() => datasource!.getRegions().then((r) => r.filter((r) => r.value !== 'default').map((v) => v.value)))\n }\n >\n <InlineField label=\"Namespaces of Custom Metrics\" labelWidth={28} tooltip=\"Namespaces of Custom Metrics.\">\n <Input\n width={60}\n placeholder=\"Namespace1,Namespace2\"\n value={options.jsonData.customMetricsNamespaces || ''}\n onChange={onUpdateDatasourceJsonDataOption(props, 'customMetricsNamespaces')}\n />\n </InlineField>\n </ConnectionConfig>\n\n <h3 className=\"page-heading\">CloudWatch Logs</h3>\n <div className=\"gf-form-group\">\n <InlineField\n label=\"Timeout\"\n labelWidth={28}\n tooltip='Custom timout for CloudWatch Logs insights queries which have max concurrency limits. Default is 15 minutes. Must be a valid duration string, such as \"15m\" \"30s\" \"2000ms\" etc.'\n invalid={Boolean(logsTimeoutError)}\n >\n <Input\n width={60}\n placeholder=\"15m\"\n value={options.jsonData.logsTimeout || ''}\n onChange={onUpdateDatasourceJsonDataOption(props, 'logsTimeout')}\n title={'The timeout must be a valid duration string, such as \"15m\" \"30s\" \"2000ms\" etc.'}\n />\n </InlineField>\n </div>\n\n <XrayLinkConfig\n onChange={(uid) => updateDatasourcePluginJsonDataOption(props, 'tracingDatasourceUid', uid)}\n datasourceUid={options.jsonData.tracingDatasourceUid}\n />\n </>\n );\n};\n\nfunction useAuthenticationWarning(jsonData: CloudWatchJsonData) {\n const addWarning = (message: string) => {\n store.dispatch(notifyApp(createWarningNotification('CloudWatch Authentication', message)));\n };\n\n useEffect(() => {\n if (jsonData.authType === 'arn') {\n addWarning('Since grafana 7.3 authentication type \"arn\" is deprecated, falling back to default SDK provider');\n } else if (jsonData.authType === 'credentials' && !jsonData.profile && !jsonData.database) {\n addWarning(\n 'As of grafana 7.3 authentication type \"credentials\" should be used only for shared file credentials. \\\n If you don\\'t have a credentials file, switch to the default SDK provider for extracting credentials \\\n from environment variables or IAM roles'\n );\n }\n }, [jsonData.authType, jsonData.database, jsonData.profile]);\n}\n\nfunction useDatasource(datasourceName: string) {\n const [datasource, setDatasource] = useState<CloudWatchDatasource>();\n\n useEffect(() => {\n getDatasourceSrv()\n .loadDatasource(datasourceName)\n .then((datasource) => {\n // It's really difficult to type .loadDatasource() because it's inherently untyped as it involves two JSON.parse()'s\n // So a \"as\" type assertion here is a necessary evil.\n setDatasource(datasource as CloudWatchDatasource);\n });\n }, [datasourceName]);\n\n return datasource;\n}\n\nfunction useTimoutValidation(value: string | undefined) {\n const [err, setErr] = useState<undefined | string>(undefined);\n useDebounce(\n () => {\n if (value) {\n try {\n rangeUtil.describeInterval(value);\n setErr(undefined);\n } catch (e) {\n setErr(e.toString());\n }\n } else {\n setErr(undefined);\n }\n },\n 350,\n [value]\n );\n return err;\n}\n","import { groupBy } from 'lodash';\nimport React, { useMemo } from 'react';\n\nimport { MetadataInspectorProps } from '@grafana/data';\n\nimport { CloudWatchDatasource } from '../datasource';\nimport { CloudWatchQuery, CloudWatchJsonData } from '../types';\n\nexport type Props = MetadataInspectorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>;\n\nexport function MetaInspector({ data = [] }: Props) {\n const rows = useMemo(() => groupBy(data, 'refId'), [data]);\n\n return (\n <>\n <table className=\"filter-table form-inline\">\n <thead>\n <tr>\n <th>RefId</th>\n <th>Metric Data Query ID</th>\n <th>Metric Data Query Expression</th>\n <th>Period</th>\n <th />\n </tr>\n </thead>\n {Object.entries(rows).map(([refId, frames], idx) => {\n if (!frames.length) {\n return null;\n }\n\n const frame = frames[0];\n const custom = frame.meta?.custom;\n if (!custom) {\n return null;\n }\n\n return (\n <tbody key={idx}>\n <tr>\n <td>{refId}</td>\n <td>{custom.id}</td>\n <td>{frame.meta?.executedQueryString}</td>\n <td>{custom.period}</td>\n </tr>\n </tbody>\n );\n })}\n </table>\n </>\n );\n}\n","Object.defineProperty(exports,\"__esModule\",{value:!0});var e,t=require(\"react\"),a=(e=t)&&\"object\"==typeof e&&\"default\"in e?e.default:e,n=require(\"@grafana/ui\"),l=require(\"@grafana/data\"),o=require(\"lodash\"),s=function(){return(s=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var l in t=arguments[a])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};function i(e,t,a,n){return new(a||(a=Promise))((function(l,o){function s(e){try{r(n.next(e))}catch(e){o(e)}}function i(e){try{r(n.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(s,i)}r((n=n.apply(e,t||[])).next())}))}function r(e,t){var a,n,l,o,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(o){return function(i){return function(o){if(a)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(a=1,n&&(l=2&o[0]?n.return:o[0]?n.throw||((l=n.return)&&l.call(n),0):n.next)&&!(l=l.call(n,o[1])).done)return l;switch(n=0,l&&(o=[2&o[0],l.value]),o[0]){case 0:case 1:l=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(l=s.trys,(l=l.length>0&&l[l.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!l||o[1]>l[0]&&o[1]<l[3])){s.label=o[1];break}if(6===o[0]&&s.label<l[1]){s.label=l[1],l=o;break}if(l&&s.label<l[2]){s.label=l[2],s.ops.push(o);break}l[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{a=l=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,i])}}}function u(e,t){var a=\"function\"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,l,o=a.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){l={error:e}}finally{try{n&&!n.done&&(a=o.return)&&a.call(o)}finally{if(l)throw l.error}}return s}var c,d=[\"af-south-1\",\"ap-east-1\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"ap-south-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ca-central-1\",\"cn-north-1\",\"cn-northwest-1\",\"eu-central-1\",\"eu-north-1\",\"eu-west-1\",\"eu-west-2\",\"eu-west-3\",\"me-south-1\",\"sa-east-1\",\"us-east-1\",\"us-east-2\",\"us-gov-east-1\",\"us-gov-west-1\",\"us-iso-east-1\",\"us-isob-east-1\",\"us-west-1\",\"us-west-2\"];(c=exports.AwsAuthType||(exports.AwsAuthType={})).Keys=\"keys\",c.Credentials=\"credentials\",c.Default=\"default\",c.EC2IAMRole=\"ec2_iam_role\",c.ARN=\"arn\";var p,h=[{label:\"Workspace IAM Role\",value:exports.AwsAuthType.EC2IAMRole},{label:\"AWS SDK Default\",value:exports.AwsAuthType.Default},{label:\"Access & secret key\",value:exports.AwsAuthType.Keys},{label:\"Credentials file\",value:exports.AwsAuthType.Credentials}],f=function(e){return{value:e,label:e}},v=function(e){var o,i,r,c,p,v,m,g,y,b=u(t.useState((e.standardRegions||d).map(f)),2),D=b[0],w=b[1],E=e.loadRegions,A=e.onOptionsChange,S=e.skipHeader,C=void 0!==S&&S,x=e.skipEndpoint,V=void 0!==x&&x,I=e.options,F=I.jsonData.profile;void 0===F&&(F=I.database);var O=window.grafanaBootData.settings,R=null!==(o=O.awsAllowedAuthProviders)&&void 0!==o?o:[exports.AwsAuthType.Default,exports.AwsAuthType.Keys,exports.AwsAuthType.Credentials],j=null===(i=O.awsAssumeRoleEnabled)||void 0===i||i,K=h.find((function(e){return e.value===I.jsonData.authType}));return t.useEffect((function(){!K&&R.length&&A(s(s({},I),{jsonData:s(s({},I.jsonData),{authType:R[0]})}))}),[K,I,A]),t.useEffect((function(){E&&E().then((function(e){return w(e.map(f))}))}),[E]),a.createElement(n.FieldSet,{label:C?\"\":\"Connection Details\",\"data-testid\":\"connection-config\"},a.createElement(n.InlineField,{label:\"Authentication Provider\",labelWidth:28,tooltip:\"Specify which AWS credentials chain to use.\"},a.createElement(n.Select,{\"aria-label\":\"Authentication Provider\",className:\"width-30\",value:K,options:h.filter((function(e){return R.includes(e.value)})),defaultValue:I.jsonData.authType,onChange:function(t){l.onUpdateDatasourceJsonDataOptionSelect(e,\"authType\")(t)},menuShouldPortal:!0})),\"credentials\"===I.jsonData.authType&&a.createElement(n.InlineField,{label:\"Credentials Profile Name\",labelWidth:28,tooltip:\"Credentials profile name, as specified in ~/.aws/credentials, leave blank for default.\"},a.createElement(n.Input,{\"aria-label\":\"Credentials Profile Name\",className:\"width-30\",placeholder:\"default\",value:F,onChange:l.onUpdateDatasourceJsonDataOption(e,\"profile\")})),\"keys\"===I.jsonData.authType&&a.createElement(a.Fragment,null,a.createElement(n.InlineField,{label:\"Access Key ID\",labelWidth:28},(null===(r=e.options.secureJsonFields)||void 0===r?void 0:r.accessKey)?a.createElement(n.ButtonGroup,{className:\"width-30\"},a.createElement(n.Input,{disabled:!0,placeholder:\"Configured\"}),a.createElement(n.ToolbarButton,{icon:\"edit\",tooltip:\"Edit Access Key ID\",type:\"button\",onClick:l.onUpdateDatasourceResetOption(e,\"accessKey\")})):a.createElement(n.Input,{\"aria-label\":\"Access Key ID\",className:\"width-30\",value:null!==(p=null===(c=I.secureJsonData)||void 0===c?void 0:c.accessKey)&&void 0!==p?p:\"\",onChange:l.onUpdateDatasourceSecureJsonDataOption(e,\"accessKey\")})),a.createElement(n.InlineField,{label:\"Secret Access Key\",labelWidth:28},(null===(v=e.options.secureJsonFields)||void 0===v?void 0:v.secretKey)?a.createElement(n.ButtonGroup,{className:\"width-30\"},a.createElement(n.Input,{disabled:!0,placeholder:\"Configured\"}),a.createElement(n.ToolbarButton,{icon:\"edit\",type:\"button\",tooltip:\"Edit Secret Access Key\",onClick:l.onUpdateDatasourceResetOption(e,\"secretKey\")})):a.createElement(n.Input,{\"aria-label\":\"Secret Access Key\",className:\"width-30\",value:null!==(g=null===(m=I.secureJsonData)||void 0===m?void 0:m.secretKey)&&void 0!==g?g:\"\",onChange:l.onUpdateDatasourceSecureJsonDataOption(e,\"secretKey\")}))),j&&a.createElement(a.Fragment,null,a.createElement(n.InlineField,{label:\"Assume Role ARN\",labelWidth:28,tooltip:\"Optionally, specify the ARN of a role to assume. Specifying a role here will ensure that the selected authentication provider is used to assume the specified role rather than using the credentials directly. Leave blank if you don't need to assume a role at all\"},a.createElement(n.Input,{\"aria-label\":\"Assume Role ARN\",className:\"width-30\",placeholder:\"arn:aws:iam:*\",value:I.jsonData.assumeRoleArn||\"\",onChange:l.onUpdateDatasourceJsonDataOption(e,\"assumeRoleArn\")})),a.createElement(n.InlineField,{label:\"External ID\",labelWidth:28,tooltip:\"If you are assuming a role in another account, that has been created with an external ID, specify the external ID here.\"},a.createElement(n.Input,{\"aria-label\":\"External ID\",className:\"width-30\",placeholder:\"External ID\",value:I.jsonData.externalId||\"\",onChange:l.onUpdateDatasourceJsonDataOption(e,\"externalId\")}))),!V&&a.createElement(n.InlineField,{label:\"Endpoint\",labelWidth:28,tooltip:\"Optionally, specify a custom endpoint for the service\"},a.createElement(n.Input,{\"aria-label\":\"Endpoint\",className:\"width-30\",placeholder:null!==(y=e.defaultEndpoint)&&void 0!==y?y:\"https://{service}.{region}.amazonaws.com\",value:I.jsonData.endpoint||\"\",onChange:l.onUpdateDatasourceJsonDataOption(e,\"endpoint\")})),a.createElement(n.InlineField,{label:\"Default Region\",labelWidth:28,tooltip:\"Specify the region, such as for US West (Oregon) use ` us-west-2 ` as the region.\"},a.createElement(n.Select,{\"aria-label\":\"Default Region\",className:\"width-30\",value:D.find((function(e){return e.value===I.jsonData.defaultRegion})),options:D,defaultValue:I.jsonData.defaultRegion,allowCustomValue:!0,onChange:l.onUpdateDatasourceJsonDataOptionSelect(e,\"defaultRegion\"),formatCreateLabel:function(e){return\"Use region: \"+e},menuShouldPortal:!0})),e.children)};function m(e){var l=this,c=u(t.useState(e.value||e.default||null),2),d=c[0],p=c[1],h=u(t.useState(d?[d]:[]),2),f=h[0],v=h[1],m=u(t.useState(e.dependencies),2),g=m[0],y=m[1],b=u(t.useState(!1),2),D=b[0],w=b[1],E=u(t.useState(!1),2),A=E[0],S=E[1],C=t.useMemo((function(){var t=[{label:\"default (\"+e.default+\")\",value:\"__default\",description:\"Default value set in the data source\"}];return e.value&&\"__default\"!==e.value&&t.push({label:e.value,value:e.value}),t}),[e.default,e.value]),x=u(t.useState(e.default?C:[]),2),V=x[0],I=x[1];t.useEffect((function(){void 0!==e.resources&&v(e.resources)}),[e.resources]),t.useEffect((function(){var t=e.default?C:[];f.length?(f.forEach((function(e){var a=\"string\"==typeof e?e:e.value;t.find((function(e){return e.value===a}))||(\"string\"==typeof e?t.push({label:e,value:e}):t.push(e))})),I(t)):I([])}),[f,C,e.default]),t.useEffect((function(){o.isEqual(e.dependencies,g)||(S(!1),p(null),e.onChange(null),y(e.dependencies))}),[e,g]);return a.createElement(n.InlineField,{label:e.label,labelWidth:e.labelWidth,tooltip:e.tooltip,hidden:e.hidden},a.createElement(\"div\",{\"data-testid\":e[\"data-testid\"],title:e.title},a.createElement(n.Select,s({},e,{\"aria-label\":e.label,options:V,onChange:function(t){e.onChange(t),t.value&&p(t.value)},isLoading:D,className:e.className||\"min-width-6\",onOpenMenu:function(){return e.fetch&&i(l,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:w(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,i(l,void 0,void 0,(function(){var t;return r(this,(function(a){switch(a.label){case 0:return A?[2]:e.saveOptions?[4,e.saveOptions()]:[3,2];case 1:a.sent(),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,e.fetch()];case 3:return t=a.sent(),v(t),[3,5];case 4:return S(!0),[7];case 5:return[2]}}))}))];case 2:return t.sent(),[3,4];case 3:return w(!1),[7];case 4:return[2]}}))}))},menuShouldPortal:!0}))))}(p=exports.FillValueOptions||(exports.FillValueOptions={}))[p.Previous=0]=\"Previous\",p[p.Null=1]=\"Null\",p[p.Value=2]=\"Value\";var g=[{label:\"Previous Value\",value:exports.FillValueOptions.Previous},{label:\"NULL\",value:exports.FillValueOptions.Null},{label:\"Value\",value:exports.FillValueOptions.Value}];function y(e){return\"string\"==typeof e?e:e.map((function(e){return function(e){return\"'\"+String(e).replace(/'/g,\"''\")+\"'\"}(e)})).join(\",\")}exports.ConfigSelect=function(e){var t=e.options.jsonData,n={title:t.defaultRegion?\"\":\"select a default region\",labelWidth:28,className:\"width-30\"},l=[e.options.jsonData.assumeRoleArn,e.options.jsonData.authType,e.options.jsonData.defaultRegion,e.options.jsonData.endpoint,e.options.jsonData.externalId,e.options.jsonData.profile].concat(e.dependencies);return a.createElement(m,s({label:e.label,\"data-testid\":e[\"data-testid\"],onChange:e.onChange,fetch:e.fetch,value:e.value,saveOptions:e.saveOptions,dependencies:l,hidden:e.hidden,disabled:e.disabled||!t.defaultRegion,allowCustomValue:e.allowCustomValue,autoFocus:e.autoFocus,backspaceRemovesValue:e.backspaceRemovesValue,className:e.className,invalid:e.invalid,isClearable:e.isClearable,isMulti:e.isMulti,inputId:e.inputId,showAllSelectedWhenOpen:e.showAllSelectedWhenOpen,maxMenuHeight:e.maxMenuHeight,minMenuHeight:e.minMenuHeight,maxVisibleValues:e.maxVisibleValues,menuPlacement:e.menuPlacement,menuPosition:e.menuPosition,noOptionsMessage:e.noOptionsMessage,onBlur:e.onBlur,onCreateOption:e.onCreateOption,onInputChange:e.onInputChange,placeholder:e.placeholder,width:e.width,isOptionDisabled:e.isOptionDisabled},n))},exports.ConnectionConfig=v,exports.FillValueSelect=function(e){var t,l,o;return a.createElement(a.Fragment,null,a.createElement(n.InlineField,{label:\"Fill value\",tooltip:\"value to fill missing points\"},a.createElement(n.Select,{\"aria-label\":\"Fill value\",options:g,value:null!==(l=null===(t=e.query.fillMode)||void 0===t?void 0:t.mode)&&void 0!==l?l:exports.FillValueOptions.Previous,onChange:function(t){var a=t.value;e.onChange(s(s({},e.query),{fillMode:s(s({},e.query.fillMode),{mode:a})})),e.onRunQuery()},className:\"width-12\",menuShouldPortal:!0})),(null===(o=e.query.fillMode)||void 0===o?void 0:o.mode)===exports.FillValueOptions.Value&&a.createElement(n.InlineField,{label:\"Value\",labelWidth:11},a.createElement(n.Input,{type:\"number\",\"aria-label\":\"Value\",value:e.query.fillMode.value,onChange:function(t){var a=t.currentTarget;return e.onChange(s(s({},e.query),{fillMode:{mode:exports.FillValueOptions.Value,value:a.valueAsNumber}}))},onBlur:function(){return e.onRunQuery()}})))},exports.FormatSelect=function(e){return a.createElement(n.InlineField,{label:\"Format as\",labelWidth:11},a.createElement(n.Select,{\"aria-label\":\"Format as\",options:e.options,value:e.query.format,onChange:function(t){e.onChange(s(s({},e.query),{format:t.value||0})),e.onRunQuery()},className:\"width-12\",menuShouldPortal:!0}))},exports.InlineInput=function(e){return a.createElement(n.InlineField,{label:e.label,labelWidth:28,tooltip:e.tooltip,hidden:e.hidden,disabled:e.disabled},a.createElement(n.Input,{\"data-testid\":e[\"data-testid\"],className:\"width-30\",value:e.value,onChange:e.onChange,placeholder:e.placeholder,disabled:e.disabled}))},exports.QueryCodeEditor=function(e){var l=e.getSuggestions,i=e.query,r=o.defaults(e.query,{rawSQL:\"\"}).rawSQL,u=t.useRef([]);return t.useEffect((function(){u.current=l(i)}),[l,i]),a.createElement(n.CodeEditor,s({language:e.language,value:r,onBlur:function(t){var a=s(s({},e.query),{rawSQL:t});e.onChange(a),e.onRunQuery()},showMiniMap:!1,showLineNumbers:!0,getSuggestions:function(){return u.current},height:\"240px\"},e.editorProps))},exports.ResourceSelector=m,exports.SIGV4ConnectionConfig=function(e){var t,n,l,o,i=e.onOptionsChange,r=e.options,u={onOptionsChange:function(e){var t,a,n,l,o=s(s({},r),{jsonData:s(s({},r.jsonData),{sigV4AuthType:e.jsonData.authType,sigV4Profile:e.jsonData.profile,sigV4AssumeRoleArn:e.jsonData.assumeRoleArn,sigV4ExternalId:e.jsonData.externalId,sigV4Region:e.jsonData.defaultRegion,sigV4Endpoint:e.jsonData.endpoint}),secureJsonFields:{sigV4AccessKey:null===(t=e.secureJsonFields)||void 0===t?void 0:t.accessKey,sigV4SecretKey:null===(a=e.secureJsonFields)||void 0===a?void 0:a.secretKey},secureJsonData:{sigV4AccessKey:null===(n=e.secureJsonData)||void 0===n?void 0:n.accessKey,sigV4SecretKey:null===(l=e.secureJsonData)||void 0===l?void 0:l.secretKey}});i(o)},options:s(s({},r),{jsonData:s(s({},r.jsonData),{authType:r.jsonData.sigV4AuthType,profile:r.jsonData.sigV4Profile,assumeRoleArn:r.jsonData.sigV4AssumeRoleArn,externalId:r.jsonData.sigV4ExternalId,defaultRegion:r.jsonData.sigV4Region,endpoint:r.jsonData.sigV4Endpoint}),secureJsonFields:{accessKey:null===(t=r.secureJsonFields)||void 0===t?void 0:t.sigV4AccessKey,secretKey:null===(n=r.secureJsonFields)||void 0===n?void 0:n.sigV4SecretKey},secureJsonData:{accessKey:null===(l=r.secureJsonData)||void 0===l?void 0:l.sigV4AccessKey,secretKey:null===(o=r.secureJsonData)||void 0===o?void 0:o.sigV4SecretKey}})};return a.createElement(a.Fragment,null,a.createElement(\"div\",{className:\"gf-form\"},a.createElement(\"h6\",null,\"SigV4 Auth Details\")),a.createElement(v,s({},u,{skipHeader:!0,skipEndpoint:!0})))},exports.appendTemplateVariablesAsSuggestions=function(e,t){var a=e(),l=[];return a.getVariables().forEach((function(e){var t=\"$\"+e.name,o=a.replace(t);o===t&&(o=\"\"),l.push({label:t,kind:n.CodeEditorSuggestionItemKind.Text,detail:\"(Template Variable) \"+o})})),t.concat(l)},exports.applySQLTemplateVariables=function(e,t,a){var n=a();return s(s({},e),{rawSQL:n.replace(e.rawSQL,t,y)})},exports.awsAuthProviderOptions=h,exports.filterSQLQuery=function(e){return!!e.rawSQL},exports.standardRegions=d;\n//# sourceMappingURL=index.production.js.map\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./dist/index.production.js');\n} else {\n module.exports = require('./dist/index.development.js');\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n continue;\n }\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","module.exports = require('./lib/jsurl');","/**\n * Copyright (c) 2011 Bruno Jouhier <bruno.jouhier@sage.com>\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n//\n(function(exports) {\n\t\"use strict\";\n\texports.stringify = function stringify(v) {\n\t\tfunction encode(s) {\n\t\t\treturn !/[^\\w-.]/.test(s) ? s : s.replace(/[^\\w-.]/g, function(ch) {\n\t\t\t\tif (ch === '$') return '!';\n\t\t\t\tch = ch.charCodeAt(0);\n\t\t\t\t// thanks to Douglas Crockford for the negative slice trick\n\t\t\t\treturn ch < 0x100 ? '*' + ('00' + ch.toString(16)).slice(-2) : '**' + ('0000' + ch.toString(16)).slice(-4);\n\t\t\t});\n\t\t}\n\n\t\tvar tmpAry;\n\n\t\tswitch (typeof v) {\n\t\t\tcase 'number':\n\t\t\t\treturn isFinite(v) ? '~' + v : '~null';\n\t\t\tcase 'boolean':\n\t\t\t\treturn '~' + v;\n\t\t\tcase 'string':\n\t\t\t\treturn \"~'\" + encode(v);\n\t\t\tcase 'object':\n\t\t\t\tif (!v) return '~null';\n\n\t\t\t\ttmpAry = [];\n\n\t\t\t\tif (Array.isArray(v)) {\n\t\t\t\t\tfor (var i = 0; i < v.length; i++) {\n\t\t\t\t\t\ttmpAry[i] = stringify(v[i]) || '~null';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn '~(' + (tmpAry.join('') || '~') + ')';\n\t\t\t\t} else {\n\t\t\t\t\tfor (var key in v) {\n\t\t\t\t\t\tif (v.hasOwnProperty(key)) {\n\t\t\t\t\t\t\tvar val = stringify(v[key]);\n\n\t\t\t\t\t\t\t// skip undefined and functions\n\t\t\t\t\t\t\tif (val) {\n\t\t\t\t\t\t\t\ttmpAry.push(encode(key) + val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn '~(' + tmpAry.join('~') + ')';\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\t// function, undefined\n\t\t\t\treturn;\n\t\t}\n\t};\n\n\tvar reserved = {\n\t\t\"true\": true,\n\t\t\"false\": false,\n\t\t\"null\": null\n\t};\n\n\texports.parse = function(s) {\n\t\tif (!s) return s;\n\t\ts = s.replace(/%(25)*27/g, \"'\");\n\t\tvar i = 0,\n\t\t\tlen = s.length;\n\n\t\tfunction eat(expected) {\n\t\t\tif (s.charAt(i) !== expected) throw new Error(\"bad JSURL syntax: expected \" + expected + \", got \" + (s && s.charAt(i)));\n\t\t\ti++;\n\t\t}\n\n\t\tfunction decode() {\n\t\t\tvar beg = i,\n\t\t\t\tch, r = \"\";\n\t\t\twhile (i < len && (ch = s.charAt(i)) !== '~' && ch !== ')') {\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\tif (beg < i) r += s.substring(beg, i);\n\t\t\t\t\t\tif (s.charAt(i + 1) === '*') r += String.fromCharCode(parseInt(s.substring(i + 2, i + 6), 16)), beg = (i += 6);\n\t\t\t\t\t\telse r += String.fromCharCode(parseInt(s.substring(i + 1, i + 3), 16)), beg = (i += 3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '!':\n\t\t\t\t\t\tif (beg < i) r += s.substring(beg, i);\n\t\t\t\t\t\tr += '$', beg = ++i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn r + s.substring(beg, i);\n\t\t}\n\n\t\treturn (function parseOne() {\n\t\t\tvar result, ch, beg;\n\t\t\teat('~');\n\t\t\tswitch (ch = s.charAt(i)) {\n\t\t\t\tcase '(':\n\t\t\t\t\ti++;\n\t\t\t\t\tif (s.charAt(i) === '~') {\n\t\t\t\t\t\tresult = [];\n\t\t\t\t\t\tif (s.charAt(i + 1) === ')') i++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tresult.push(parseOne());\n\t\t\t\t\t\t\t} while (s.charAt(i) === '~');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t\tif (s.charAt(i) !== ')') {\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tvar key = decode();\n\t\t\t\t\t\t\t\tresult[key] = parseOne();\n\t\t\t\t\t\t\t} while (s.charAt(i) === '~' && ++i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\teat(')');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"'\":\n\t\t\t\t\ti++;\n\t\t\t\t\tresult = decode();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbeg = i++;\n\t\t\t\t\twhile (i < len && /[^)~]/.test(s.charAt(i)))\n\t\t\t\t\ti++;\n\t\t\t\t\tvar sub = s.substring(beg, i);\n\t\t\t\t\tif (/[\\d\\-]/.test(ch)) {\n\t\t\t\t\t\tresult = parseFloat(sub);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = reserved[sub];\n\t\t\t\t\t\tif (typeof result === \"undefined\") throw new Error(\"bad value keyword: \" + sub);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t})();\n\t}\n\n\texports.tryParse = function(s, def) {\n\t\ttry {\n\t\t\treturn exports.parse(s);\n\t\t} catch (ex) {\n\t\t\treturn def;\n\t\t}\n\t}\n\n})(typeof exports !== 'undefined' ? exports : (window.JSURL = window.JSURL || {}));\n"],"names":["SELECT","FROM","WHERE","GROUP","ORDER","BY","DESC","ASC","LIMIT","WITH","SCHEMA","KEYWORDS","STATISTICS","AND","LOGICAL_OPERATORS","EQUALS","NOT_EQUALS","COMPARISON_OPERATORS","language","defaultToken","tokenPostfix","ignoreCase","brackets","open","close","token","keywords","operators","builtinFunctions","tokenizer","root","include","cases","whitespace","comments","comment","numbers","strings","next","string","string_double","complexIdentifiers","bracketedIdentifier","quotedIdentifier","conf","lineComment","blockComment","autoClosingPairs","surroundingPairs","DYNAMIC_LABEL_PATTERNS","id","builtInFunctions","map","replace","join","METRIC_MATH_FNS","METRIC_MATH_STATISTIC_KEYWORD_STRINGS","METRIC_MATH_KEYWORDS","METRIC_MATH_OPERATORS","METRIC_MATH_PERIODS","nonNestableStates","escapeRegExp","variables","assignment","nestedCurly","nestedParens","getStyles","theme","infoText","css","spacing","colors","text","secondary","xRayDsId","XrayLinkConfig","datasourceUid","onChange","hasXrayDatasource","Boolean","getDatasourceSrv","getList","pluginId","length","styles","useStyles2","className","Alert","title","severity","InlineField","htmlFor","label","labelWidth","tooltip","DataSourcePicker","ds","uid","current","noDefault","raw","_createClass","defineProperties","target","props","i","descriptor","enumerable","configurable","writable","Object","defineProperty","key","Constructor","protoProps","staticProps","prototype","_templateObject","freeze","value","_classCallCheck","instance","TypeError","TemplateTag","_this","this","_len","arguments","transformers","Array","_key","tag","_len2","expressions","_key2","interimTag","bind","transformEndResult","transformString","reduce","processSubstitutions","isArray","transformer","previousTag","template","_len3","substitutions","_key3","apply","undefined","concat","resultSoFar","remainingPart","substitution","transformSubstitution","shift","str","res","transform","onString","onSubstitution","endResult","onEndResult","defaults","separator","conjunction","serial","opts","arrayLength","indent","match","separatorIndex","lastIndexOf","slice","_toConsumableArray","arr","arr2","from","type","Math","min","el","regexp","RegExp","Error","side","trim","toLowerCase","splitBy","includes","split","isValidValue","x","Number","isNaN","filter","replaceWhat","replaceWith","toString","QUERY_COMMANDS","documentation","NUMERIC_OPERATORS","detail","STRING_FUNCTIONS","DATETIME_FUNCTIONS","IP_FUNCTIONS","BOOLEAN_FUNCTIONS","AGGREGATION_FUNCTIONS_STATS","STATS_FUNCS","FIELD_AND_FILTER_FUNCTIONS","FUNCTIONS","pattern","greedy","backticks","alias","quote","regex","command","function","f","keyword","lookbehind","number","punctuation","CLIQ_EXAMPLES","category","examples","expr","stripIndents","stripIndent","renderHighlightedMarkup","code","keyPrefix","grammar","spans","flattenTokens","Prism","types","aliases","content","exampleCategory","LogsCheatSheet","PureComponent","onClickExample","query","renderExpression","onClick","refId","expression","queryMode","region","logGroupNames","renderLogsCheatSheet","cat","cx","item","j","render","isCloudWatchMetricsQuery","cloudwatchQuery","hasOwnProperty","isCloudWatchAnnotationQuery","toOption","appendTemplateVariables","datasource","values","options","getVariables","wildcardOption","FilterItem","metricStat","namespace","metricName","dimensions","dimensionKeys","disableExpressions","onDelete","dimensionsExcludingCurrentKey","useMemo","currentKey","entries","acc","excludeCurrentKey","state","loadOptions","useAsyncFn","async","getDimensionValues","then","result","unshift","useTheme2","getOperatorStyles","InputGroup","Select","inputId","width","allowCustomValue","change","onOpenMenu","isLoading","loading","AccessoryButton","icon","variant","stylesFactory","padding","alignSelf","Dimensions","dimensionFilters","dimensionsToFilterConditions","operator","items","setItems","useState","EditorList","newItems","newDimensions","isEqual","renderItem","makeRenderFilter","JSURL","require","encodeUrl","obj","stringify","CloudWatchLink","Component","href","prevProps","panelData","panelDataNew","panelDataOld","request","getExternalLink","setState","range","start","toISOString","end","to","timeType","tz","editorString","isLiveTail","source","getActualRegion","rel","Icon","name","byRE","groupsRE","getStatsGroups","b","groups","g","lastIndex","index","exec","push","effect","deps","depsEqual","ref","useRef","useEffect","isDeepEqual","useRegions","regionsIsLoading","setRegionsIsLoading","regions","setRegions","variableOptionGroup","getRegions","finally","useNamespaces","namespaces","setNamespaces","getNamespaces","useMetrics","metrics","setMetrics","getMetrics","useDimensionKeys","dimensionFilter","setDimensionKeys","useDeepCompareEffect","getDimensionKeys","metricEditorModes","MetricQueryType","editorModes","MetricEditorMode","sqlCodeEditorIsDirty","onRunQuery","metricEditorMode","metricQueryType","showConfirm","setShowConfirm","onEditorModeChange","useCallback","newMetricEditorMode","InlineSelect","find","m","FlexItem","grow","RadioButtonGroup","size","Button","ConfirmModal","isOpen","body","confirmText","dismissText","onConfirm","onDismiss","apiModes","onRegionChange","regionIsLoading","EditorHeader","placeholder","onRegion","commonProps","pick","ExploreMode","containerClass","rowGap","CloudWatchLogsQueryField","React","constructor","context","super","selectedLogGroups","logGroup","availableLogGroups","invalidLogGroups","loadingLogGroups","hint","logGroupNamePrefix","describeLogGroups","err","errMessage","JSON","e","dispatch","notifyApp","createErrorNotification","searchTerm","actionMeta","action","Promise","resolve","test","fetchLogGroupOptions","matchingLogGroups","unionBy","debounce","onLogGroupSearch","logGroups","nextQuery","group","logGroupName","statsGroups","v","customLogGroup","setSelectedLogGroups","intersectionBy","languageProvider","suggestions","cloudwatchLanguageProvider","history","absoluteRange","prefix","wrapperClasses","labelKey","editor","typeahead","provideCompletionItems","_event","_editor","plugins","BracesPlugin","SlatePrism","onlyIn","node","object","getSyntax","prismLanguages","cloudwatch","syntax","ExtraFieldElement","data","showError","error","cleanText","LegacyForms","inputEl","MultiSelect","onCreateOption","setCustomLogGroups","onBlur","closeMenuOnSelect","isClearable","invalid","isOptionDisabled","maxVisibleValues","noOptionsMessage","onOpenLogGroupMenu","onInputChange","onLogGroupSearchDebounced","QueryField","additionalPlugins","onChangeQuery","onQueryFieldClick","onTypeahead","portalOrigin","disabled","message","fix","labelClass","memo","exploreId","absolute","valueOf","Date","now","InlineFormLabel","MetricStatEditor","onMetricStatChange","validateMetricName","metric","EditorRows","EditorRow","EditorFieldGroup","EditorField","validatedQuery","onNamespaceChange","statistic","standardStatistics","s","startsWith","optional","EditorSwitch","matchExact","currentTarget","checked","QueryEditorPropertyType","QueryEditorExpressionType","SQLGenerator","templateSrv","getTemplateSrv","expressionToSqlQuery","select","where","groupBy","orderBy","orderByDirection","limit","parameters","parts","appendSelect","appendFrom","appendWhere","appendGroupBy","appendOrderBy","appendLimit","appendFunction","Function","formatValue","property","isTopLevelExpression","topLevelExpressionsCount","hasChildExpressions","And","andParts","exp","andCombined","wrapInParentheses","Or","Operator","appendOperator","orParts","orCombined","groupByParts","GroupBy","params","p","interpolated","getMetricNameFromExpression","selectExpression","getNamespaceFromExpression","fromExpression","Property","sanitizeOperator","String","flattenOperatorExpressions","flatMap","getFlattenedFilters","sql","getFlattenedGroupBys","setSql","setAggregation","aggregation","AGGREGATIONS","onQueryChange","schemaLabels","curr","getSchemaLabels","withSchemaEnabled","namespaceOptions","metricOptions","existingFilters","unusedDimensionKeys","some","queryWithNoParams","removeMetricName","namespaceParam","FunctionParameter","labelKeys","setNamespace","ev","HTMLInputElement","withSchema","setWithSchema","isMulti","l","setSchemaLabels","param","setMetricName","OPERATORS","filtersFromQuery","filters","setFilters","cleaned","validExpressions","operatorExpression","validated","setOperatorExpressionValue","makeRenderItem","GroupByItem","fieldName","field","groupBysFromQuery","baseOptions","option","completeExpressions","orderByDirections","setOrderBy","SQLBuilderEditor","sqlString","fullQuery","sqlExpression","sqlPreview","setSQLPreview","Input","val","valueAsNumber","process","extensions","mimetypes","loader","TRIGGER_SUGGEST","registerLanguage","monaco","completionItemProvider","languages","getLanguages","register","monarch","setMonarchTokensProvider","setLanguageConfiguration","registerCompletionItemProvider","getCompletionProvider","MathExpressionQueryField","containerRef","onEditorMount","onDidFocusEditorText","trigger","addCommand","KeyMod","Shift","KeyCode","Enter","getValue","updateElementHeight","containerDiv","getContentHeight","pixelHeight","max","style","height","pixelWidth","clientWidth","layout","onDidContentSizeChange","CodeEditor","monacoOptions","scrollBeyondLastLine","fontSize","lineNumbers","renderLineHighlight","scrollbar","vertical","horizontal","suggestFontSize","wordWrap","top","onBeforeEditorMount","metricMathCompletionItemProvider","onEditorDidMount","SQLCodeEditor","sqlCompletionItemProvider","setRegion","showMiniMap","showLineNumbers","LinkedToken","previous","tokenTypes","isKeyword","Keyword","isWhiteSpace","Whitespace","isParenthesis","Parenthesis","isIdentifier","Identifier","isString","isDoubleQuotedString","Type","isVariable","Variable","isFunction","isNumber","is","isType","endsWith","getPreviousNonWhiteSpaceToken","getPreviousOfType","getPreviousUntil","ignoreTypes","tokens","t","getNextUntil","getPreviousKeyword","getNextNonWhiteSpaceToken","getNextOfType","linkedTokenBuilder","model","position","tokensPerLine","tokenize","lineIndex","offset","_tokenBrand","columnIndex","endColumn","getLineLength","startLineNumber","startColumn","endLineNumber","getValueInRange","newToken","Range","containsPosition","StatementPosition","SuggestionKind","CompletionItemPriority","dynamicLabelsCompletionItemProvider","Delimiter","languageDefinition","triggerCharacters","currentToken","fromPositions","toCompletionItem","rest","insertText","kind","CompletionItemKind","Field","sortText","Medium","High","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","DynamicLabelsField","getInputStyles","clientHeight","wrapper","containerStyles","disabledBackground","components","input","borderColor","overviewRulerLanes","Alias","setAlias","propagateOnChange","migrateMetricQuery","migratedQuery","config","_","aliasPatterns","migrateAliasPatterns","period","stat","DEFAULT_QUERY","preparedQuery","deepEqual","prepareQuery","MetricsQueryEditor","setSQLCodeEditorIsDirty","usePreparedMetricsQuery","newQuery","Space","event","PanelQueryEditor","LogsQueryEditor","CloudWatchAnnotationSupport","prepareAnnotation","isCloudWatchAnnotation","enable","iconColor","builtIn","hide","anno","prefixMatching","actionPrefix","alarmNamePrefix","validPrefixMatchingQuery","validMetricStatQuery","QueryEditor","topSpacing","CompletionItemProvider","templateVariables","getStatementPosition","Unknown","getSuggestionKinds","getSuggestions","suggestionKinds","statementPosition","reject","SQLTokenTypes","previousNonWhiteSpace","previousKeyword","previousIsSlash","SelectKeyword","AfterSelectKeyword","AfterSelectFuncFirstArgument","FromKeyword","AfterFromKeyword","SchemaFuncFirstArgument","SchemaFuncExtraArgument","AfterFrom","WhereKey","WhereComparisonOperator","WhereValue","AfterWhereValue","AfterGroupByKeywords","AfterGroupBy","AfterOrderByKeywords","AfterOrderByFunction","AfterOrderByDirection","FunctionsWithArguments","Metrics","Namespaces","SchemaKeyword","LabelKeys","WhereKeyword","GroupByKeywords","OrderByKeywords","LimitKeyword","ComparisonOperators","LabelValues","LogicalOperators","FunctionsWithoutArguments","SortOrderDirectionKeyword","getSelectToken","getMetricNameToken","assumedMetricNameToken","assumedStatisticToken","getSelectStatisticToken","getNamespaceToken","fromToken","selectToken","getFromKeywordToken","nextNonWhiteSpace","toUpperCase","assumedNamespaceToken","SQLCompletionItemProvider","addSuggestion","suggestion","namespaceToken","getAllMetrics","uniq","metricNameToken","n","labelKeyTokens","o","MediumHigh","MediumLow","Low","ThrottlingErrorMessage","CloudWatchLanguageProvider","LanguageProvider","initialValues","url","lastValueFrom","awsRequest","startTask","started","fetchedFieldsCache","time","sortedUniq","fields","results","all","getLogGroupFields","Set","cur","logGroupFields","suggs","getFieldCompletionItems","functionSuggestions","searchFunctionType","SearchFunctionType","commandToken","curToken","queryCommand","prevToken","prevNonWhitespaceToken","currentTokenIsFirstArg","handleSortCommand","currentTokenIsAfterCommandAndEmpty","isTokenType","currentTokenIsAfterCommand","nextNonWhitespaceToken","currentTokenIsComma","currentTokenIsCommaOrAfterComma","typeaheadOutput","getFieldAndFilterFunctionCompletionItems","getStatsAggCompletionItems","forEach","skipFilter","sugg","boolFuncs","getBoolFuncCompletionItems","fieldsSuggestions","comparisonSuggestions","getComparisonCompletionItems","fetchFields","assign","isStatsQuery","get","offsets","selection","isFirstToken","prev","getCommandCompletionItems","parenthesisToken","maybeFunctionToken","funcsWithFieldArgs","isInsideFunctionParenthesis","maybeKeyword","getPreviousTokenExcluding","isAfterKeyword","handleKeyword","handleComparison","startToken","thisToken","previousCommandToken","handleCommand","isFirstArgument","funcName","exclude","main","func","wait","mem","memoize","leading","args","MetricMathTokenTypes","WithinString","currentFunction","isAfterComma","isWithinSearch","allTokensAfterStartOfSearch","lastComma","SearchFuncThirdArg","SearchFuncSecondArg","PredefinedFuncSecondArg","AfterFunction","PredefinedFunction","KeywordArguments","Operators","Statistic","Period","MetricMathCompletionItemProvider","idx","Value","fromCharCode","createInternalXrayLink","getDataSourceSrv","console","internal","queryType","datasourceName","createAwsConsoleLink","getVariableValue","interpolatedExpression","interpolatedGroups","targetBlank","runWithRetry","queryFun","targets","timeoutFunc","startTime","timerID","subscription","retries","collected","Observable","observer","run","currentQueryParams","subscribe","frames","collectedPreviously","toDataQueryResponse","complete","errorData","keys","errorMessage","errors","queries","q","good","splitErrorData","retry","dataResponse","setTimeout","pow","random","clearTimeout","unsubscribe","subscriber","counter","step","endPeriod","newPeriod","schedule","jsonVariable","migrateMultiFilters","oldFilters","tempFilters","parsedFilters","parse","newFilters","migrateVariableQuery","rawQuery","ec2Filters","tags","isVariableQuery","omit","VariableQueryType","dimensionKey","instanceID","attributeName","resourceType","metricNameQuery","dimensionKeysQuery","dimensionValuesQuery","ebsVolumeIdsQuery","ec2InstanceAttributeQuery","resourceARNsQuery","MultiFilterItem","keyPlaceholder","localKey","setLocalKey","localValue","setLocalValue","newValues","MultiFilter","multiFiltersToFilterConditions","newMultifilters","filterConditionsToMultiFilters","VariableQueryField","VariableTextField","interactive","queryTypes","VariableQueryEditor","parsedQuery","keysForDimensionFilter","sanitizeQuery","hasRegionField","hasNamespaceField","CloudWatchVariableSupport","CustomVariableSupport","queryObj","execute","pipe","handleRegionsQuery","handleNamespacesQuery","handleMetricsQuery","handleDimensionKeysQuery","handleDimensionValuesQuery","handleEbsVolumeIdsQuery","handleEc2InstanceAttributeQuery","handleResourceARNsQuery","handleStatisticsQuery","expandable","getEbsVolumeIds","getEc2InstanceAttribute","getResourceARNs","DS_QUERY_ENDPOINT","LOG_IDENTIFIER_INTERNAL","LOGSTREAM_IDENTIFIER_INTERNAL","displayAlert","store","displayCustomError","CloudWatchDatasource","DataSourceWithBackend","instanceSettings","timeSrv","getTimeSrv","memoizedDebounce","AppNotificationTimeout","logQueries","validLogQueries","of","isEmpty","LoadingState","queryParams","queryString","scopedVars","rangeUtil","logsTimeout","makeLogActionRequest","makeReplacements","skipCache","mergeMap","logsQuery","dataFrame","queryId","meta","custom","response","dataQueryResponse","replaceFn","getVariableValueFn","getRegion","tracingDatasourceUid","curTarget","interpolatedRegion","xrayLink","links","addDataLinksToLogsResponse","timeRange","expandVariableToArray","tracingDataSourceUid","metricQueries","timezoneUTCOffset","dateTimeFormat","timeZone","timezone","format","validMetricsQueries","filterMetricQuery","migratedAndIterpolatedQuery","replaceMetricQueryVars","intervalMs","maxDataPoints","getRef","performTimeSeriesQuery","row","direction","logStreamField","logField","requestParams","startFromHead","parseLogGroupName","rowIndex","logStreamName","endTime","timeEpochMs","dataFrames","metricsQueries","annotationQueries","proxyUrl","defaultRegion","jsonData","annotations","filterQuery","cloneDeep","getTargetsByQueryMode","dataQueryResponses","handleLogQueries","handleMetricQueries","handleAnnotationQuery","merge","convertDimensionFormat","getPeriod","parseInt","r","statsQuery","startPeriod","scheduler","asyncScheduler","add","increasingInterval","concatMap","repeat","share","consecutiveFailedAttempts","scan","failures","prevRecordsMatched","frame","recordsMatched","stats","displayName","queryResponse","zip","tap","CloudWatchLogsQueryStatus","failedAttempts","set","every","DataQueryErrorType","takeWhile","observable","onUnsubscribe","stopQueries","innerSub","logQuery","finalize","toArray","fieldNames","fieldPercentages","percent","dataframes","lastError","findLast","FieldType","interval","catchError","throwError","firstErrorResult","failedRedIds","actualRegion","debouncedAlert","doMetricResourceRequest","subtype","getResource","fieldsToReplace","anyQuery","headers","resultsToDataFrames","status","filterDimensions","instanceId","convertMultiFilterFormat","targetContainsTemplate","containsTemplate","k","method","getBackendSrv","fetch","getDefaultRegion","showContextToggle","convertToCloudWatchTime","date","roundUp","dateMath","round","variableName","getVariableName","valueVar","multi","multiFilters","displayErrorIfIsMultiTemplateVariable","variable","debouncedCustomAlert","getQueryDisplayText","interpolateVariablesInQueries","interpolateMetricsQueryVariables","logIdentifier","colonIndex","plugin","DataSourcePlugin","setQueryEditorHelp","setConfigEditor","setDatasource","loadDatasource","useDatasource","addWarning","createWarningNotification","authType","profile","database","useAuthenticationWarning","logsTimeoutError","setErr","useDebounce","useTimoutValidation","ConnectionConfig","loadRegions","customMetricsNamespaces","onUpdateDatasourceJsonDataOption","updateDatasourcePluginJsonDataOption","setQueryEditor","setMetadataInspector","rows","executedQueryString","a","default","call","throw","done","sent","trys","ops","return","Symbol","iterator","pop","u","c","d","exports","Keys","Credentials","Default","EC2IAMRole","ARN","h","y","standardRegions","D","w","E","A","onOptionsChange","S","skipHeader","C","skipEndpoint","V","I","F","O","window","grafanaBootData","settings","R","awsAllowedAuthProviders","awsAssumeRoleEnabled","K","createElement","FieldSet","defaultValue","onUpdateDatasourceJsonDataOptionSelect","menuShouldPortal","Fragment","secureJsonFields","accessKey","ButtonGroup","ToolbarButton","onUpdateDatasourceResetOption","secureJsonData","onUpdateDatasourceSecureJsonDataOption","secretKey","assumeRoleArn","externalId","defaultEndpoint","endpoint","formatCreateLabel","children","dependencies","description","resources","hidden","saveOptions","Previous","Null","SIGV4ConnectionConfig","sigV4AuthType","sigV4Profile","sigV4AssumeRoleArn","sigV4ExternalId","sigV4Region","sigV4Endpoint","sigV4AccessKey","sigV4SecretKey","module","equal","flags","$$typeof","encode","ch","charCodeAt","tmpAry","isFinite","reserved","len","eat","expected","charAt","decode","beg","substring","parseOne","sub","parseFloat","tryParse","def","ex"],"sourceRoot":""}
|