id
stringlengths 1
6
| tokens
sequence | labels
sequence |
---|---|---|
661500 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiCallOut",
",",
"EuiCodeBlock",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"formatMsg",
",",
"formatStack",
"}",
"from",
"'../../../../../opensearch_dashboards_legacy/public'",
";",
"interface",
"Props",
"{",
"error",
":",
"Error",
"|",
"string",
";",
"}",
"export",
"function",
"DocViewerError",
"(",
"{",
"error",
"}",
")",
"{",
"const",
"errMsg",
"=",
"formatMsg",
"(",
"error",
")",
";",
"const",
"errStack",
"=",
"typeof",
"error",
"===",
"'object'",
"?",
"formatStack",
"(",
"error",
")",
":",
"''",
";",
"return",
"(",
"<",
"EuiCallOut",
"title",
"=",
"{",
"errMsg",
"}",
"color",
"=",
"\"danger\"",
"iconType",
"=",
"\"cross\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"docViewerError\"",
">",
"{",
"errStack",
"&&",
"<",
"EuiCodeBlock",
">",
"{",
"errStack",
"}",
"<",
"/EuiCodeBlock>}",
"<",
"/EuiCallOut>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661501 | [
"import",
"{",
"auto",
",",
"IController",
"}",
"from",
"'angular'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"render",
"}",
"from",
"'react-dom'",
";",
"import",
"angular",
",",
"{",
"ICompileService",
"}",
"from",
"'angular'",
";",
"import",
"{",
"DocViewRenderProps",
",",
"AngularScope",
",",
"AngularDirective",
"}",
"from",
"'./doc_views_types'",
";",
"import",
"{",
"DocViewerError",
"}",
"from",
"'../components/doc_viewer/doc_viewer_render_error'",
";",
"/**\n * Compiles and injects the give angular template into the given dom node\n * returns a function to cleanup the injected angular element\n */",
"export",
"async",
"function",
"injectAngularElement",
"(",
"domNode",
",",
"template",
",",
"scopeProps",
",",
"Controller",
",",
"getInjector",
")",
"{",
"const",
"$injector",
"=",
"await",
"getInjector",
"(",
")",
";",
"const",
"rootScope",
"=",
"$injector",
".",
"get",
"(",
"'$rootScope'",
")",
";",
"const",
"$compile",
"=",
"$injector",
".",
"get",
"(",
"'$compile'",
")",
";",
"const",
"newScope",
"=",
"Object",
".",
"assign",
"(",
"rootScope",
".",
"$new",
"(",
")",
",",
"scopeProps",
")",
";",
"if",
"(",
"typeof",
"Controller",
"===",
"'function'",
")",
"{",
"(",
"newScope",
"as",
"any",
")",
".",
"$ctrl",
"=",
"$injector",
".",
"instantiate",
"(",
"Controller",
",",
"{",
"$scope",
":",
"newScope",
",",
"}",
")",
";",
"}",
"const",
"$target",
"=",
"angular",
".",
"element",
"(",
"domNode",
")",
";",
"const",
"$element",
"=",
"angular",
".",
"element",
"(",
"template",
")",
";",
"newScope",
".",
"$apply",
"(",
"(",
")",
"=>",
"{",
"const",
"linkFn",
"=",
"$compile",
"(",
"$element",
")",
";",
"$target",
".",
"empty",
"(",
")",
".",
"append",
"(",
"$element",
")",
";",
"linkFn",
"(",
"newScope",
")",
";",
"}",
")",
";",
"return",
"(",
")",
"=>",
"{",
"newScope",
".",
"$destroy",
"(",
")",
";",
"}",
";",
"}",
"/**\n * Converts a given legacy angular directive to a render function\n * for usage in a react component. Note that the rendering is async\n */",
"export",
"function",
"convertDirectiveToRenderFn",
"(",
"directive",
",",
"getInjector",
")",
"{",
"return",
"(",
"domNode",
",",
"props",
")",
"=>",
"{",
"let",
"rejected",
"=",
"false",
";",
"const",
"cleanupFnPromise",
"=",
"injectAngularElement",
"(",
"domNode",
",",
"directive",
".",
"template",
",",
"props",
",",
"directive",
".",
"controller",
",",
"getInjector",
")",
";",
"cleanupFnPromise",
".",
"catch",
"(",
"(",
"e",
")",
"=>",
"{",
"rejected",
"=",
"true",
";",
"render",
"(",
"<",
"DocViewerError",
"error",
"=",
"{",
"e",
"}",
"/",
">",
",",
"domNode",
")",
";",
"}",
")",
";",
"return",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"rejected",
")",
"{",
"cleanupFnPromise",
".",
"then",
"(",
"(",
"cleanup",
")",
"=>",
"cleanup",
"(",
")",
")",
";",
"}",
"}",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
9,
null,
2,
null,
4902,
null,
5835,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13410,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13050,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
13411,
null,
7,
null,
null,
null,
null,
9,
null,
4902,
null,
null,
null,
null,
8,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661502 | [
"import",
"{",
"auto",
"}",
"from",
"'angular'",
";",
"import",
"{",
"convertDirectiveToRenderFn",
"}",
"from",
"'./doc_views_helpers'",
";",
"import",
"{",
"DocView",
",",
"DocViewInput",
",",
"OpenSearchSearchHit",
",",
"DocViewInputFn",
"}",
"from",
"'./doc_views_types'",
";",
"export",
"class",
"DocViewsRegistry",
"{",
"private",
"docViews",
":",
"DocView",
"[",
"]",
"=",
"[",
"]",
";",
"private",
"angularInjectorGetter",
":",
"(",
"(",
")",
"=>",
"Promise",
"<",
"auto",
".",
"IInjectorService",
">",
")",
"|",
"null",
"=",
"null",
";",
"setAngularInjectorGetter",
"=",
"(",
"injectorGetter",
")",
"=>",
"{",
"this",
".",
"angularInjectorGetter",
"=",
"injectorGetter",
";",
"}",
";",
"/**\n * Extends and adds the given doc view to the registry array\n */",
"addDocView",
"(",
"docViewRaw",
")",
"{",
"const",
"docView",
"=",
"typeof",
"docViewRaw",
"===",
"'function'",
"?",
"docViewRaw",
"(",
")",
":",
"docViewRaw",
";",
"if",
"(",
"docView",
".",
"directive",
")",
"{",
"docView",
".",
"render",
"=",
"convertDirectiveToRenderFn",
"(",
"docView",
".",
"directive",
",",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"angularInjectorGetter",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Angular was not initialized'",
")",
";",
"}",
"return",
"this",
".",
"angularInjectorGetter",
"(",
")",
";",
"}",
")",
";",
"}",
"if",
"(",
"typeof",
"docView",
".",
"shouldShow",
"!==",
"'function'",
")",
"{",
"docView",
".",
"shouldShow",
"=",
"(",
")",
"=>",
"true",
";",
"}",
"this",
".",
"docViews",
".",
"push",
"(",
"docView",
"as",
"DocView",
")",
";",
"}",
"/**\n * Returns a sorted array of doc_views for rendering tabs\n */",
"getDocViewsSorted",
"(",
"hit",
")",
"{",
"return",
"this",
".",
"docViews",
".",
"filter",
"(",
"(",
"docView",
")",
"=>",
"docView",
".",
"shouldShow",
"(",
"hit",
")",
")",
".",
"sort",
"(",
"(",
"a",
",",
"b",
")",
"=>",
"(",
"Number",
"(",
"a",
".",
"order",
")",
">",
"Number",
"(",
"b",
".",
"order",
")",
"?",
"1",
":",
"-",
"1",
")",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
24375,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
26159,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6542,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6542,
null,
6542,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661503 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiToolTip",
",",
"EuiButtonIcon",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"export",
"interface",
"Props",
"{",
"onClick",
":",
"(",
")",
"=>",
"void",
";",
"disabled",
"?",
":",
"boolean",
";",
"}",
"export",
"function",
"DocViewTableRowBtnFilterRemove",
"(",
"{",
"onClick",
",",
"disabled",
"=",
"false",
"}",
")",
"{",
"const",
"tooltipContent",
"=",
"disabled",
"?",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip\"",
"defaultMessage",
"=",
"\"Unindexed fields can not be searched\"",
"/",
">",
")",
":",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.docViews.table.filterOutValueButtonTooltip\"",
"defaultMessage",
"=",
"\"Filter out value\"",
"/",
">",
")",
";",
"return",
"(",
"<",
"EuiToolTip",
"content",
"=",
"{",
"tooltipContent",
"}",
">",
"<",
"EuiButtonIcon",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.docViews.table.filterOutValueButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Filter out value'",
",",
"}",
")",
"}",
"className",
"=",
"\"osdDocViewer__actionButton\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"removeInclusiveFilterButton\"",
"disabled",
"=",
"{",
"disabled",
"}",
"onClick",
"=",
"{",
"onClick",
"}",
"iconType",
"=",
"{",
"'magnifyWithMinus'",
"}",
"iconSize",
"=",
"{",
"'s'",
"}",
"/",
">",
"<",
"/EuiToolTip>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661504 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiIconTip",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"export",
"function",
"DocViewTableRowIconNoMapping",
"(",
")",
"{",
"const",
"ariaLabel",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docViews.table.noCachedMappingForThisFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Warning'",
",",
"}",
")",
";",
"const",
"tooltipContent",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docViews.table.noCachedMappingForThisFieldTooltip'",
",",
"{",
"defaultMessage",
":",
"'No cached mapping for this field. Refresh field list from the Management > Index Patterns page'",
",",
"}",
")",
";",
"return",
"(",
"<",
"EuiIconTip",
"aria",
"-",
"label",
"=",
"{",
"ariaLabel",
"}",
"color",
"=",
"\"warning\"",
"content",
"=",
"{",
"tooltipContent",
"}",
"iconProps",
"=",
"{",
"{",
"className",
":",
"'osdDocViewer__warning'",
",",
"'data-test-subj'",
":",
"'noMappingWarning'",
",",
"}",
"}",
"size",
"=",
"\"s\"",
"type",
"=",
"\"alert\"",
"/",
">",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661505 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiIconTip",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"export",
"function",
"DocViewTableRowIconUnderscore",
"(",
")",
"{",
"const",
"ariaLabel",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Warning'",
",",
"}",
")",
";",
"const",
"tooltipContent",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip'",
",",
"{",
"defaultMessage",
":",
"'Field names beginning with {underscoreSign} are not supported'",
",",
"values",
":",
"{",
"underscoreSign",
":",
"'_'",
"}",
",",
"}",
")",
";",
"return",
"(",
"<",
"EuiIconTip",
"aria",
"-",
"label",
"=",
"{",
"ariaLabel",
"}",
"content",
"=",
"{",
"tooltipContent",
"}",
"color",
"=",
"\"warning\"",
"iconProps",
"=",
"{",
"{",
"className",
":",
"'osdDocViewer__warning'",
",",
"'data-test-subj'",
":",
"'underscoreWarning'",
",",
"}",
"}",
"size",
"=",
"\"s\"",
"type",
"=",
"\"alert\"",
"/",
">",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661506 | [
"const",
"DOT_PREFIX_RE",
"=",
"/(.).+?\\./g",
";",
"/**\n * Convert a dot.notated.string into a short\n * version (d.n.string)\n */",
"export",
"const",
"shortenDottedString",
"=",
"(",
"input",
")",
"=>",
"input",
".",
"replace",
"(",
"DOT_PREFIX_RE",
",",
"'$1.'",
")",
";"
] | [
null,
27,
null,
null,
null,
null,
null,
null,
2,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661507 | [
"const",
"COMMA_SEPARATOR_RE",
"=",
"/(\\d)(?=(\\d{3})+(?!\\d))/g",
";",
"/**\n * Converts a number to a string and adds commas\n * as thousands separators\n */",
"export",
"const",
"formatNumWithCommas",
"=",
"(",
"input",
")",
"=>",
"String",
"(",
"input",
")",
".",
"replace",
"(",
"COMMA_SEPARATOR_RE",
",",
"'$1,'",
")",
";"
] | [
null,
27,
null,
null,
null,
null,
null,
null,
2,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661508 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"export",
"function",
"getFieldTypeName",
"(",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"'boolean'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.booleanAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Boolean field'",
",",
"}",
")",
";",
"case",
"'conflict'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.conflictFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Conflicting field'",
",",
"}",
")",
";",
"case",
"'date'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.dateFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Date field'",
",",
"}",
")",
";",
"case",
"'geo_point'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.geoPointFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Geo point field'",
",",
"}",
")",
";",
"case",
"'geo_shape'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.geoShapeFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Geo shape field'",
",",
"}",
")",
";",
"case",
"'ip'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.ipAddressFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'IP address field'",
",",
"}",
")",
";",
"case",
"'murmur3'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.murmur3FieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Murmur3 field'",
",",
"}",
")",
";",
"case",
"'number'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.numberFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Number field'",
",",
"}",
")",
";",
"case",
"'source'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.sourceFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Source field'",
",",
"}",
")",
";",
"case",
"'string'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.stringFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'String field'",
",",
"}",
")",
";",
"case",
"'nested'",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.nestedFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Nested field'",
",",
"}",
")",
";",
"default",
":",
"return",
"i18n",
".",
"translate",
"(",
"'discover.fieldNameIcons.unknownFieldAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Unknown field'",
",",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661509 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiToolTip",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FieldIcon",
",",
"FieldIconProps",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"shortenDottedString",
"}",
"from",
"'../../helpers'",
";",
"import",
"{",
"getFieldTypeName",
"}",
"from",
"'./field_type_name'",
";",
"interface",
"Props",
"{",
"fieldName",
":",
"string",
";",
"fieldType",
":",
"string",
";",
"useShortDots",
"?",
":",
"boolean",
";",
"fieldIconProps",
"?",
":",
"Omit",
"<",
"FieldIconProps",
",",
"'type'",
">",
";",
"scripted",
"?",
":",
"boolean",
";",
"}",
"export",
"function",
"FieldName",
"(",
"{",
"fieldName",
",",
"fieldType",
",",
"useShortDots",
",",
"fieldIconProps",
",",
"scripted",
"=",
"false",
",",
"}",
")",
"{",
"const",
"typeName",
"=",
"getFieldTypeName",
"(",
"fieldType",
")",
";",
"const",
"displayName",
"=",
"useShortDots",
"?",
"shortenDottedString",
"(",
"fieldName",
")",
":",
"fieldName",
";",
"return",
"(",
"<",
"EuiFlexGroup",
"alignItems",
"=",
"\"center\"",
"gutterSize",
"=",
"\"s\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"FieldIcon",
"type",
"=",
"{",
"fieldType",
"}",
"label",
"=",
"{",
"typeName",
"}",
"scripted",
"=",
"{",
"scripted",
"}",
"{",
"...",
"fieldIconProps",
"}",
"/>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"className",
"=",
"\"eui-textTruncate\"",
">",
"<",
"EuiToolTip",
"position",
"=",
"\"top\"",
"content",
"=",
"{",
"displayName",
"}",
"delay",
"=",
"\"long\"",
"anchorClassName",
"=",
"\"eui-textTruncate\"",
">",
"<",
"span",
">",
"{",
"displayName",
"}",
"<",
"/span>",
"<",
"/EuiToolTip>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661510 | [
"import",
"classNames",
"from",
"'classnames'",
";",
"import",
"React",
",",
"{",
"ReactNode",
"}",
"from",
"'react'",
";",
"import",
"{",
"FieldMapping",
",",
"DocViewFilterFn",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"import",
"{",
"DocViewTableRowBtnFilterAdd",
"}",
"from",
"'./table_row_btn_filter_add'",
";",
"import",
"{",
"DocViewTableRowBtnFilterRemove",
"}",
"from",
"'./table_row_btn_filter_remove'",
";",
"import",
"{",
"DocViewTableRowBtnToggleColumn",
"}",
"from",
"'./table_row_btn_toggle_column'",
";",
"import",
"{",
"DocViewTableRowBtnCollapse",
"}",
"from",
"'./table_row_btn_collapse'",
";",
"import",
"{",
"DocViewTableRowBtnFilterExists",
"}",
"from",
"'./table_row_btn_filter_exists'",
";",
"import",
"{",
"DocViewTableRowIconNoMapping",
"}",
"from",
"'./table_row_icon_no_mapping'",
";",
"import",
"{",
"DocViewTableRowIconUnderscore",
"}",
"from",
"'./table_row_icon_underscore'",
";",
"import",
"{",
"FieldName",
"}",
"from",
"'../field_name/field_name'",
";",
"export",
"interface",
"Props",
"{",
"field",
":",
"string",
";",
"fieldMapping",
"?",
":",
"FieldMapping",
";",
"fieldType",
":",
"string",
";",
"displayNoMappingWarning",
":",
"boolean",
";",
"displayUnderscoreWarning",
":",
"boolean",
";",
"isCollapsible",
":",
"boolean",
";",
"isColumnActive",
":",
"boolean",
";",
"isCollapsed",
":",
"boolean",
";",
"onToggleCollapse",
":",
"(",
")",
"=>",
"void",
";",
"onFilter",
"?",
":",
"DocViewFilterFn",
";",
"onToggleColumn",
"?",
":",
"(",
")",
"=>",
"void",
";",
"value",
":",
"string",
"|",
"ReactNode",
";",
"valueRaw",
":",
"unknown",
";",
"}",
"export",
"function",
"DocViewTableRow",
"(",
"{",
"field",
",",
"fieldMapping",
",",
"fieldType",
",",
"displayNoMappingWarning",
",",
"displayUnderscoreWarning",
",",
"isCollapsible",
",",
"isCollapsed",
",",
"isColumnActive",
",",
"onFilter",
",",
"onToggleCollapse",
",",
"onToggleColumn",
",",
"value",
",",
"valueRaw",
",",
"}",
")",
"{",
"const",
"valueClassName",
"=",
"classNames",
"(",
"{",
"osdDocViewer__value",
":",
"true",
",",
"'truncate-by-height'",
":",
"isCollapsible",
"&&",
"isCollapsed",
",",
"}",
")",
";",
"return",
"(",
"<",
"tr",
"key",
"=",
"{",
"field",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`tableDocViewRow-${",
"field",
"}`",
"}",
">",
"{",
"typeof",
"onFilter",
"===",
"'function'",
"&&",
"(",
"<",
"td",
"className",
"=",
"\"osdDocViewer__buttons\"",
">",
"<",
"DocViewTableRowBtnFilterAdd",
"disabled",
"=",
"{",
"!",
"fieldMapping",
"||",
"!",
"fieldMapping",
".",
"filterable",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onFilter",
"(",
"fieldMapping",
",",
"valueRaw",
",",
"'+'",
")",
"}",
"/>",
"<",
"DocViewTableRowBtnFilterRemove",
"disabled",
"=",
"{",
"!",
"fieldMapping",
"||",
"!",
"fieldMapping",
".",
"filterable",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onFilter",
"(",
"fieldMapping",
",",
"valueRaw",
",",
"'-'",
")",
"}",
"/>",
"{",
"typeof",
"onToggleColumn",
"===",
"'function'",
"&&",
"(",
"<",
"DocViewTableRowBtnToggleColumn",
"active",
"=",
"{",
"isColumnActive",
"}",
"onClick",
"=",
"{",
"onToggleColumn",
"}",
"/",
">",
")",
"}",
"<",
"DocViewTableRowBtnFilterExists",
"disabled",
"=",
"{",
"!",
"fieldMapping",
"||",
"!",
"fieldMapping",
".",
"filterable",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onFilter",
"(",
"'_exists_'",
",",
"field",
",",
"'+'",
")",
"}",
"scripted",
"=",
"{",
"fieldMapping",
"&&",
"fieldMapping",
".",
"scripted",
"}",
"/>",
"<",
"/td>)}",
"<",
"td",
"className",
"=",
"\"osdDocViewer__field\"",
">",
"<",
"FieldName",
"fieldName",
"=",
"{",
"field",
"}",
"fieldType",
"=",
"{",
"fieldType",
"}",
"fieldIconProps",
"=",
"{",
"{",
"fill",
":",
"'none'",
",",
"color",
":",
"'gray'",
"}",
"}",
"scripted",
"=",
"{",
"Boolean",
"(",
"fieldMapping",
"?.",
"scripted",
")",
"}",
"/",
">",
"<",
"/td>",
"<",
"td",
">",
"{",
"isCollapsible",
"&&",
"(",
"<",
"DocViewTableRowBtnCollapse",
"onClick",
"=",
"{",
"onToggleCollapse",
"}",
"isCollapsed",
"=",
"{",
"isCollapsed",
"}",
"/",
">",
")",
"}",
"{",
"displayUnderscoreWarning",
"&&",
"<",
"DocViewTableRowIconUnderscore",
"/>}",
"{",
"displayNoMappingWarning",
"&&",
"<",
"DocViewTableRowIconNoMapping",
"/>}",
"<",
"div",
"className",
"=",
"{",
"valueClassName",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`tableDocViewRow-${",
"field",
"}-value`",
"}",
"dangerouslySetInnerHTML",
"=",
"{",
"{",
"__html",
":",
"value",
"as",
"string",
"}",
"}",
"/>",
"<",
"/td>",
"<",
"/tr>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661511 | [
"/**\n * Returns true if the given array contains at least 1 object\n */",
"export",
"function",
"arrayContainsObjects",
"(",
"value",
")",
"{",
"return",
"Array",
".",
"isArray",
"(",
"value",
")",
"&&",
"value",
".",
"some",
"(",
"(",
"v",
")",
"=>",
"typeof",
"v",
"===",
"'object'",
"&&",
"v",
"!==",
"null",
")",
";",
"}",
"/**\n * Removes markup added by OpenSearch Dashboards fields html formatter\n */",
"export",
"function",
"trimAngularSpan",
"(",
"text",
")",
"{",
"return",
"text",
".",
"replace",
"(",
"/^<span ng-non-bindable>/",
",",
"''",
")",
".",
"replace",
"(",
"/<\\/span>$/",
",",
"''",
")",
";",
"}"
] | [
null,
null,
null,
8,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661512 | [
"import",
"React",
",",
"{",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"escapeRegExp",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"DocViewTableRow",
"}",
"from",
"'./table_row'",
";",
"import",
"{",
"arrayContainsObjects",
",",
"trimAngularSpan",
"}",
"from",
"'./table_helper'",
";",
"import",
"{",
"DocViewRenderProps",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"const",
"COLLAPSE_LINE_LENGTH",
"=",
"350",
";",
"export",
"function",
"DocViewTable",
"(",
"{",
"hit",
",",
"indexPattern",
",",
"filter",
",",
"columns",
",",
"onAddColumn",
",",
"onRemoveColumn",
",",
"}",
")",
"{",
"const",
"mapping",
"=",
"indexPattern",
".",
"fields",
".",
"getByName",
";",
"const",
"flattened",
"=",
"indexPattern",
".",
"flattenHit",
"(",
"hit",
")",
";",
"const",
"formatted",
"=",
"indexPattern",
".",
"formatHit",
"(",
"hit",
",",
"'html'",
")",
";",
"const",
"[",
"fieldRowOpen",
",",
"setFieldRowOpen",
"]",
"=",
"useState",
"(",
"{",
"}",
"as",
"Record",
"<",
"string",
",",
"boolean",
">",
")",
";",
"function",
"toggleValueCollapse",
"(",
"field",
")",
"{",
"fieldRowOpen",
"[",
"field",
"]",
"=",
"fieldRowOpen",
"[",
"field",
"]",
"!==",
"true",
";",
"setFieldRowOpen",
"(",
"{",
"...",
"fieldRowOpen",
"}",
")",
";",
"}",
"return",
"(",
"<",
"table",
"className",
"=",
"\"table table-condensed osdDocViewerTable\"",
">",
"<",
"tbody",
">",
"{",
"Object",
".",
"keys",
"(",
"flattened",
")",
".",
"sort",
"(",
")",
".",
"map",
"(",
"(",
"field",
")",
"=>",
"{",
"const",
"valueRaw",
"=",
"flattened",
"[",
"field",
"]",
";",
"const",
"value",
"=",
"trimAngularSpan",
"(",
"String",
"(",
"formatted",
"[",
"field",
"]",
")",
")",
";",
"const",
"isCollapsible",
"=",
"value",
".",
"length",
">",
"COLLAPSE_LINE_LENGTH",
";",
"const",
"isCollapsed",
"=",
"isCollapsible",
"&&",
"!",
"fieldRowOpen",
"[",
"field",
"]",
";",
"const",
"toggleColumn",
"=",
"onRemoveColumn",
"&&",
"onAddColumn",
"&&",
"Array",
".",
"isArray",
"(",
"columns",
")",
"?",
"(",
")",
"=>",
"{",
"if",
"(",
"columns",
".",
"includes",
"(",
"field",
")",
")",
"{",
"onRemoveColumn",
"(",
"field",
")",
";",
"}",
"else",
"{",
"onAddColumn",
"(",
"field",
")",
";",
"}",
"}",
":",
"undefined",
";",
"const",
"isArrayOfObjects",
"=",
"Array",
".",
"isArray",
"(",
"flattened",
"[",
"field",
"]",
")",
"&&",
"arrayContainsObjects",
"(",
"flattened",
"[",
"field",
"]",
")",
";",
"const",
"displayUnderscoreWarning",
"=",
"!",
"mapping",
"(",
"field",
")",
"&&",
"field",
".",
"indexOf",
"(",
"'_'",
")",
"===",
"0",
";",
"const",
"displayNoMappingWarning",
"=",
"!",
"mapping",
"(",
"field",
")",
"&&",
"!",
"displayUnderscoreWarning",
"&&",
"!",
"isArrayOfObjects",
";",
"const",
"isNestedField",
"=",
"!",
"indexPattern",
".",
"fields",
".",
"getByName",
"(",
"field",
")",
"&&",
"!",
"!",
"indexPattern",
".",
"fields",
".",
"getAll",
"(",
")",
".",
"find",
"(",
"(",
"patternField",
")",
"=>",
"{",
"const",
"nestedRootRegex",
"=",
"new",
"RegExp",
"(",
"escapeRegExp",
"(",
"field",
")",
"+",
"'(\\\\.|$)'",
")",
";",
"return",
"nestedRootRegex",
".",
"test",
"(",
"patternField",
".",
"subType",
"?.",
"nested",
"?.",
"path",
"??",
"''",
")",
";",
"}",
")",
";",
"const",
"fieldType",
"=",
"isNestedField",
"?",
"'nested'",
":",
"indexPattern",
".",
"fields",
".",
"getByName",
"(",
"field",
")",
"?.",
"type",
";",
"return",
"(",
"<",
"DocViewTableRow",
"key",
"=",
"{",
"field",
"}",
"field",
"=",
"{",
"field",
"}",
"fieldMapping",
"=",
"{",
"mapping",
"(",
"field",
")",
"}",
"fieldType",
"=",
"{",
"String",
"(",
"fieldType",
")",
"}",
"displayUnderscoreWarning",
"=",
"{",
"displayUnderscoreWarning",
"}",
"displayNoMappingWarning",
"=",
"{",
"displayNoMappingWarning",
"}",
"isCollapsed",
"=",
"{",
"isCollapsed",
"}",
"isCollapsible",
"=",
"{",
"isCollapsible",
"}",
"isColumnActive",
"=",
"{",
"Array",
".",
"isArray",
"(",
"columns",
")",
"&&",
"columns",
".",
"includes",
"(",
"field",
")",
"}",
"onFilter",
"=",
"{",
"filter",
"}",
"onToggleCollapse",
"=",
"{",
"(",
")",
"=>",
"toggleValueCollapse",
"(",
"field",
")",
"}",
"onToggleColumn",
"=",
"{",
"toggleColumn",
"}",
"value",
"=",
"{",
"value",
"}",
"valueRaw",
"=",
"{",
"valueRaw",
"}",
"/",
">",
")",
";",
"}",
")",
"}",
"<",
"/tbody>",
"<",
"/table>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661513 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiCodeBlock",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"DocViewRenderProps",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"export",
"function",
"JsonCodeBlock",
"(",
"{",
"hit",
"}",
")",
"{",
"const",
"label",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docViews.json.codeEditorAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Read only JSON view of an opensearch document'",
",",
"}",
")",
";",
"return",
"(",
"<",
"EuiCodeBlock",
"aria",
"-",
"label",
"=",
"{",
"label",
"}",
"language",
"=",
"\"json\"",
"isCopyable",
"paddingSize",
"=",
"\"s\"",
">",
"{",
"JSON",
".",
"stringify",
"(",
"hit",
",",
"null",
",",
"2",
")",
"}",
"<",
"/EuiCodeBlock>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661514 | [
"import",
"{",
"createSavedObjectClass",
",",
"SavedObject",
",",
"SavedObjectOpenSearchDashboardsServices",
",",
"}",
"from",
"'../../../saved_objects/public'",
";",
"export",
"function",
"createSavedSearchClass",
"(",
"services",
")",
"{",
"const",
"SavedObjectClass",
"=",
"createSavedObjectClass",
"(",
"services",
")",
";",
"class",
"SavedSearch",
"extends",
"SavedObjectClass",
"{",
"public",
"static",
"type",
":",
"string",
"=",
"'search'",
";",
"public",
"static",
"mapping",
"=",
"{",
"title",
":",
"'text'",
",",
"description",
":",
"'text'",
",",
"hits",
":",
"'integer'",
",",
"columns",
":",
"'keyword'",
",",
"sort",
":",
"'keyword'",
",",
"version",
":",
"'integer'",
",",
"}",
";",
"public",
"static",
"fieldOrder",
"=",
"[",
"'title'",
",",
"'description'",
"]",
";",
"public",
"static",
"searchSource",
"=",
"true",
";",
"public",
"id",
":",
"string",
";",
"public",
"showInRecentlyAccessed",
":",
"boolean",
";",
"constructor",
"(",
"id",
")",
"{",
"super",
"(",
"{",
"id",
",",
"type",
":",
"'search'",
",",
"mapping",
":",
"{",
"title",
":",
"'text'",
",",
"description",
":",
"'text'",
",",
"hits",
":",
"'integer'",
",",
"columns",
":",
"'keyword'",
",",
"sort",
":",
"'keyword'",
",",
"version",
":",
"'integer'",
",",
"}",
",",
"searchSource",
":",
"true",
",",
"defaults",
":",
"{",
"title",
":",
"''",
",",
"description",
":",
"''",
",",
"columns",
":",
"[",
"]",
",",
"hits",
":",
"0",
",",
"sort",
":",
"[",
"]",
",",
"version",
":",
"1",
",",
"}",
",",
"}",
")",
";",
"this",
".",
"showInRecentlyAccessed",
"=",
"true",
";",
"this",
".",
"id",
"=",
"id",
";",
"this",
".",
"getFullPath",
"=",
"(",
")",
"=>",
"`/app/discover#/view/${",
"String",
"(",
"id",
")",
"}`",
";",
"}",
"}",
"return",
"SavedSearch",
"as",
"new",
"(",
"id",
")",
"=>",
"SavedObject",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
620,
null,
4420,
null,
null,
null,
620,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null
] |
661515 | [
"import",
"{",
"SavedObjectLoader",
",",
"SavedObjectOpenSearchDashboardsServices",
",",
"}",
"from",
"'../../../saved_objects/public'",
";",
"import",
"{",
"createSavedSearchClass",
"}",
"from",
"'./_saved_search'",
";",
"export",
"function",
"createSavedSearchesLoader",
"(",
"services",
")",
"{",
"const",
"SavedSearchClass",
"=",
"createSavedSearchClass",
"(",
"services",
")",
";",
"const",
"savedSearchLoader",
"=",
"new",
"SavedObjectLoader",
"(",
"SavedSearchClass",
",",
"services",
".",
"savedObjectsClient",
")",
";",
"savedSearchLoader",
".",
"loaderProperties",
"=",
"{",
"name",
":",
"'searches'",
",",
"noun",
":",
"'Saved Search'",
",",
"nouns",
":",
"'saved searches'",
",",
"}",
";",
"savedSearchLoader",
".",
"urlFor",
"=",
"(",
"id",
")",
"=>",
"(",
"id",
"?",
"`#/view/${",
"encodeURIComponent",
"(",
"id",
")",
"}`",
":",
"'#/'",
")",
";",
"return",
"savedSearchLoader",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3773,
null,
4420,
null,
null,
null,
620,
null,
null,
null,
null,
null,
null,
null,
3773,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661516 | [
"import",
"{",
"History",
"}",
"from",
"'history'",
";",
"import",
"{",
"Capabilities",
",",
"ChromeStart",
",",
"CoreStart",
",",
"DocLinksStart",
",",
"ToastsStart",
",",
"IUiSettingsClient",
",",
"PluginInitializerContext",
",",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"FilterManager",
",",
"TimefilterContract",
",",
"IndexPatternsContract",
",",
"DataPublicPluginStart",
",",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"Start",
"as",
"InspectorPublicPluginStart",
"}",
"from",
"'src/plugins/inspector/public'",
";",
"import",
"{",
"SharePluginStart",
"}",
"from",
"'src/plugins/share/public'",
";",
"import",
"{",
"ChartsPluginStart",
"}",
"from",
"'src/plugins/charts/public'",
";",
"import",
"{",
"VisualizationsStart",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"SavedObjectOpenSearchDashboardsServices",
"}",
"from",
"'src/plugins/saved_objects/public'",
";",
"import",
"{",
"DiscoverStartPlugins",
"}",
"from",
"'./plugin'",
";",
"import",
"{",
"createSavedSearchesLoader",
",",
"SavedSearch",
"}",
"from",
"'./saved_searches'",
";",
"import",
"{",
"getHistory",
"}",
"from",
"'./opensearch_dashboards_services'",
";",
"import",
"{",
"OpenSearchDashboardsLegacyStart",
"}",
"from",
"'../../opensearch_dashboards_legacy/public'",
";",
"import",
"{",
"UrlForwardingStart",
"}",
"from",
"'../../url_forwarding/public'",
";",
"import",
"{",
"NavigationPublicPluginStart",
"}",
"from",
"'../../navigation/public'",
";",
"export",
"interface",
"DiscoverServices",
"{",
"addBasePath",
":",
"(",
"path",
":",
"string",
")",
"=>",
"string",
";",
"capabilities",
":",
"Capabilities",
";",
"chrome",
":",
"ChromeStart",
";",
"core",
":",
"CoreStart",
";",
"data",
":",
"DataPublicPluginStart",
";",
"docLinks",
":",
"DocLinksStart",
";",
"history",
":",
"(",
")",
"=>",
"History",
";",
"theme",
":",
"ChartsPluginStart",
"[",
"'theme'",
"]",
";",
"filterManager",
":",
"FilterManager",
";",
"indexPatterns",
":",
"IndexPatternsContract",
";",
"inspector",
":",
"InspectorPublicPluginStart",
";",
"metadata",
":",
"{",
"branch",
":",
"string",
";",
"}",
";",
"navigation",
":",
"NavigationPublicPluginStart",
";",
"share",
"?",
":",
"SharePluginStart",
";",
"opensearchDashboardsLegacy",
":",
"OpenSearchDashboardsLegacyStart",
";",
"urlForwarding",
":",
"UrlForwardingStart",
";",
"timefilter",
":",
"TimefilterContract",
";",
"toastNotifications",
":",
"ToastsStart",
";",
"getSavedSearchById",
":",
"(",
"id",
":",
"string",
")",
"=>",
"Promise",
"<",
"SavedSearch",
">",
";",
"getSavedSearchUrlById",
":",
"(",
"id",
":",
"string",
")",
"=>",
"Promise",
"<",
"string",
">",
";",
"getEmbeddableInjector",
":",
"any",
";",
"uiSettings",
":",
"IUiSettingsClient",
";",
"visualizations",
":",
"VisualizationsStart",
";",
"}",
"export",
"async",
"function",
"buildServices",
"(",
"core",
",",
"plugins",
",",
"context",
",",
"getEmbeddableInjector",
")",
"{",
"const",
"services",
"=",
"{",
"savedObjectsClient",
":",
"core",
".",
"savedObjects",
".",
"client",
",",
"indexPatterns",
":",
"plugins",
".",
"data",
".",
"indexPatterns",
",",
"search",
":",
"plugins",
".",
"data",
".",
"search",
",",
"chrome",
":",
"core",
".",
"chrome",
",",
"overlays",
":",
"core",
".",
"overlays",
",",
"}",
";",
"const",
"savedObjectService",
"=",
"createSavedSearchesLoader",
"(",
"services",
")",
";",
"return",
"{",
"addBasePath",
":",
"core",
".",
"http",
".",
"basePath",
".",
"prepend",
",",
"capabilities",
":",
"core",
".",
"application",
".",
"capabilities",
",",
"chrome",
":",
"core",
".",
"chrome",
",",
"core",
",",
"data",
":",
"plugins",
".",
"data",
",",
"docLinks",
":",
"core",
".",
"docLinks",
",",
"theme",
":",
"plugins",
".",
"charts",
".",
"theme",
",",
"filterManager",
":",
"plugins",
".",
"data",
".",
"query",
".",
"filterManager",
",",
"getEmbeddableInjector",
",",
"getSavedSearchById",
":",
"async",
"(",
"id",
")",
"=>",
"savedObjectService",
".",
"get",
"(",
"id",
")",
",",
"getSavedSearchUrlById",
":",
"async",
"(",
"id",
")",
"=>",
"savedObjectService",
".",
"urlFor",
"(",
"id",
")",
",",
"history",
":",
"getHistory",
",",
"indexPatterns",
":",
"plugins",
".",
"data",
".",
"indexPatterns",
",",
"inspector",
":",
"plugins",
".",
"inspector",
",",
"metadata",
":",
"{",
"branch",
":",
"context",
".",
"env",
".",
"packageInfo",
".",
"branch",
",",
"}",
",",
"navigation",
":",
"plugins",
".",
"navigation",
",",
"share",
":",
"plugins",
".",
"share",
",",
"opensearchDashboardsLegacy",
":",
"plugins",
".",
"opensearchDashboardsLegacy",
",",
"urlForwarding",
":",
"plugins",
".",
"urlForwarding",
",",
"timefilter",
":",
"plugins",
".",
"data",
".",
"query",
".",
"timefilter",
".",
"timefilter",
",",
"toastNotifications",
":",
"core",
".",
"notifications",
".",
"toasts",
",",
"uiSettings",
":",
"core",
".",
"uiSettings",
",",
"visualizations",
":",
"plugins",
".",
"visualizations",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
557,
null,
6417,
null,
615,
null,
null,
null,
null,
null,
4420,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3773,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661517 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"createHashHistory",
"}",
"from",
"'history'",
";",
"import",
"{",
"ScopedHistory",
",",
"AppMountParameters",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"UiActionsStart",
"}",
"from",
"'src/plugins/ui_actions/public'",
";",
"import",
"{",
"DiscoverServices",
"}",
"from",
"'./build_services'",
";",
"import",
"{",
"createGetterSetter",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"search",
"}",
"from",
"'../../data/public'",
";",
"import",
"{",
"DocViewsRegistry",
"}",
"from",
"'./application/doc_views/doc_views_registry'",
";",
"let",
"angularModule",
"=",
"null",
";",
"let",
"services",
"=",
"null",
";",
"let",
"uiActions",
";",
"/**\n * set bootstrapped inner angular module\n */",
"export",
"function",
"setAngularModule",
"(",
"module",
")",
"{",
"angularModule",
"=",
"module",
";",
"}",
"/**\n * get boostrapped inner angular module\n */",
"export",
"function",
"getAngularModule",
"(",
")",
"{",
"return",
"angularModule",
";",
"}",
"export",
"function",
"getServices",
"(",
")",
"{",
"if",
"(",
"!",
"services",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Discover services are not yet available'",
")",
";",
"}",
"return",
"services",
";",
"}",
"export",
"function",
"setServices",
"(",
"newServices",
")",
"{",
"services",
"=",
"newServices",
";",
"}",
"export",
"const",
"setUiActions",
"=",
"(",
"pluginUiActions",
")",
"=>",
"(",
"uiActions",
"=",
"pluginUiActions",
")",
";",
"export",
"const",
"getUiActions",
"=",
"(",
")",
"=>",
"uiActions",
";",
"export",
"const",
"[",
"getHeaderActionMenuMounter",
",",
"setHeaderActionMenuMounter",
"]",
"=",
"createGetterSetter",
"<",
"AppMountParameters",
"[",
"'setHeaderActionMenu'",
"]",
">",
"(",
"'headerActionMenuMounter'",
")",
";",
"export",
"const",
"[",
"getUrlTracker",
",",
"setUrlTracker",
"]",
"=",
"createGetterSetter",
"<",
"{",
"setTrackedUrl",
":",
"(",
"url",
":",
"string",
")",
"=>",
"void",
";",
"restorePreviousUrl",
":",
"(",
")",
"=>",
"void",
";",
"}",
">",
"(",
"'urlTracker'",
")",
";",
"export",
"const",
"[",
"getDocViewsRegistry",
",",
"setDocViewsRegistry",
"]",
"=",
"createGetterSetter",
"<",
"DocViewsRegistry",
">",
"(",
"'DocViewsRegistry'",
")",
";",
"/**\n * Makes sure discover and context are using one instance of history.\n */",
"export",
"const",
"getHistory",
"=",
"_",
".",
"once",
"(",
"(",
")",
"=>",
"createHashHistory",
"(",
")",
")",
";",
"/**\n * Discover currently uses two `history` instances: one from OpenSearch Dashboards Platform and\n * another from `history` package. Below function is used every time Discover\n * app is loaded to synchronize both instances.\n *\n * This helper is temporary until https://github.com/elastic/kibana/issues/65161 is resolved.\n */",
"export",
"const",
"syncHistoryLocations",
"=",
"(",
")",
"=>",
"{",
"const",
"h",
"=",
"getHistory",
"(",
")",
";",
"Object",
".",
"assign",
"(",
"h",
".",
"location",
",",
"createHashHistory",
"(",
")",
".",
"location",
")",
";",
"return",
"h",
";",
"}",
";",
"export",
"const",
"[",
"getScopedHistory",
",",
"setScopedHistory",
"]",
"=",
"createGetterSetter",
"<",
"ScopedHistory",
">",
"(",
"'scopedHistory'",
")",
";",
"export",
"const",
"{",
"getRequestInspectorStats",
",",
"getResponseInspectorStats",
",",
"tabifyAggResponse",
"}",
"=",
"search",
";",
"export",
"{",
"unhashUrl",
",",
"redirectWhenMissing",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"export",
"{",
"formatMsg",
",",
"formatStack",
",",
"subscribeWithScope",
",",
"}",
"from",
"'../../opensearch_dashboards_legacy/public'",
";",
"export",
"{",
"IndexPatternsContract",
",",
"IIndexPattern",
",",
"IndexPattern",
",",
"indexPatterns",
",",
"IFieldType",
",",
"ISearchSource",
",",
"OpenSearchQuerySortValue",
",",
"SortDirection",
",",
"}",
"from",
"'../../data/public'",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8185,
null,
null,
null,
null,
6418,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8185,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6418,
null,
null,
6418,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6418,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661518 | [
"import",
"{",
"TimeRange",
",",
"Filter",
",",
"Query",
",",
"opensearchFilters",
",",
"QueryState",
",",
"RefreshInterval",
",",
"}",
"from",
"'../../data/public'",
";",
"import",
"{",
"setStateToOsdUrl",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"UrlGeneratorsDefinition",
"}",
"from",
"'../../share/public'",
";",
"export",
"const",
"DISCOVER_APP_URL_GENERATOR",
"=",
"'DISCOVER_APP_URL_GENERATOR'",
";",
"export",
"interface",
"DiscoverUrlGeneratorState",
"{",
"/**\n * Optionally set saved search ID.\n */",
"savedSearchId",
"?",
":",
"string",
";",
"/**\n * Optionally set index pattern ID.\n */",
"indexPatternId",
"?",
":",
"string",
";",
"/**\n * Optionally set the time range in the time picker.\n */",
"timeRange",
"?",
":",
"TimeRange",
";",
"/**\n * Optionally set the refresh interval.\n */",
"refreshInterval",
"?",
":",
"RefreshInterval",
";",
"/**\n * Optionally apply filers.\n */",
"filters",
"?",
":",
"Filter",
"[",
"]",
";",
"/**\n * Optionally set a query. NOTE: if given and used in conjunction with `dashboardId`, and the\n * saved dashboard has a query saved with it, this will _replace_ that query.\n */",
"query",
"?",
":",
"Query",
";",
"/**\n * If not given, will use the uiSettings configuration for `storeInSessionStorage`. useHash determines\n * whether to hash the data in the url to avoid url length issues.\n */",
"useHash",
"?",
":",
"boolean",
";",
"}",
"interface",
"Params",
"{",
"appBasePath",
":",
"string",
";",
"useHash",
":",
"boolean",
";",
"}",
"export",
"class",
"DiscoverUrlGenerator",
"implements",
"UrlGeneratorsDefinition",
"<",
"typeof",
"DISCOVER_APP_URL_GENERATOR",
">",
"{",
"constructor",
"(",
"private",
"readonly",
"params",
")",
"{",
"}",
"public",
"readonly",
"id",
"=",
"DISCOVER_APP_URL_GENERATOR",
";",
"public",
"readonly",
"createUrl",
"=",
"async",
"(",
"{",
"filters",
",",
"indexPatternId",
",",
"query",
",",
"refreshInterval",
",",
"savedSearchId",
",",
"timeRange",
",",
"useHash",
"=",
"this",
".",
"params",
".",
"useHash",
",",
"}",
")",
":",
"Promise",
"<",
"string",
">",
"=>",
"{",
"const",
"savedSearchPath",
"=",
"savedSearchId",
"?",
"encodeURIComponent",
"(",
"savedSearchId",
")",
":",
"''",
";",
"const",
"appState",
"=",
"{",
"}",
";",
"const",
"queryState",
"=",
"{",
"}",
";",
"if",
"(",
"query",
")",
"appState",
".",
"query",
"=",
"query",
";",
"if",
"(",
"filters",
"&&",
"filters",
".",
"length",
")",
"appState",
".",
"filters",
"=",
"filters",
"?.",
"filter",
"(",
"(",
"f",
")",
"=>",
"!",
"opensearchFilters",
".",
"isFilterPinned",
"(",
"f",
")",
")",
";",
"if",
"(",
"indexPatternId",
")",
"appState",
".",
"index",
"=",
"indexPatternId",
";",
"if",
"(",
"timeRange",
")",
"queryState",
".",
"time",
"=",
"timeRange",
";",
"if",
"(",
"filters",
"&&",
"filters",
".",
"length",
")",
"queryState",
".",
"filters",
"=",
"filters",
"?.",
"filter",
"(",
"(",
"f",
")",
"=>",
"opensearchFilters",
".",
"isFilterPinned",
"(",
"f",
")",
")",
";",
"if",
"(",
"refreshInterval",
")",
"queryState",
".",
"refreshInterval",
"=",
"refreshInterval",
";",
"let",
"url",
"=",
"`${",
"this",
".",
"params",
".",
"appBasePath",
"}#/${",
"savedSearchPath",
"}`",
";",
"url",
"=",
"setStateToOsdUrl",
"<",
"QueryState",
">",
"(",
"'_g'",
",",
"queryState",
",",
"{",
"useHash",
"}",
",",
"url",
")",
";",
"url",
"=",
"setStateToOsdUrl",
"(",
"'_a'",
",",
"appState",
",",
"{",
"useHash",
"}",
",",
"url",
")",
";",
"return",
"url",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
226,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661519 | [
"export",
"const",
"SEARCH_EMBEDDABLE_TYPE",
"=",
"'search'",
";"
] | [
null,
null,
2,
null,
null,
null
] |
661520 | [
"import",
"{",
"IndexPattern",
"}",
"from",
"'../../../../../opensearch_dashboards_services'",
";",
"import",
"{",
"shortenDottedString",
"}",
"from",
"'../../../../helpers'",
";",
"export",
"type",
"SortOrder",
"=",
"[",
"string",
",",
"string",
"]",
";",
"export",
"interface",
"ColumnProps",
"{",
"name",
":",
"string",
";",
"displayName",
":",
"string",
";",
"isSortable",
":",
"boolean",
";",
"isRemoveable",
":",
"boolean",
";",
"colLeftIdx",
":",
"number",
";",
"colRightIdx",
":",
"number",
";",
"}",
"param",
"timeFieldName",
"export",
"function",
"getTimeColumn",
"(",
"timeFieldName",
")",
"{",
"return",
"{",
"name",
":",
"timeFieldName",
",",
"displayName",
":",
"'Time'",
",",
"isSortable",
":",
"true",
",",
"isRemoveable",
":",
"false",
",",
"colLeftIdx",
":",
"-",
"1",
",",
"colRightIdx",
":",
"-",
"1",
",",
"}",
";",
"}",
"param",
"columns",
"param",
"indexPattern",
"param",
"hideTimeField",
"param",
"isShortDots",
"export",
"function",
"getDisplayedColumns",
"(",
"columns",
",",
"indexPattern",
",",
"hideTimeField",
",",
"isShortDots",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"columns",
")",
"||",
"typeof",
"indexPattern",
"!==",
"'object'",
"||",
"!",
"indexPattern",
".",
"getFieldByName",
")",
"{",
"return",
"[",
"]",
";",
"}",
"const",
"columnProps",
"=",
"columns",
".",
"map",
"(",
"(",
"column",
",",
"idx",
")",
"=>",
"{",
"const",
"field",
"=",
"indexPattern",
".",
"getFieldByName",
"(",
"column",
")",
";",
"return",
"{",
"name",
":",
"column",
",",
"displayName",
":",
"isShortDots",
"?",
"shortenDottedString",
"(",
"column",
")",
":",
"column",
",",
"isSortable",
":",
"field",
"&&",
"field",
".",
"sortable",
"?",
"true",
":",
"false",
",",
"isRemoveable",
":",
"column",
"!==",
"'_source'",
"||",
"columns",
".",
"length",
">",
"1",
",",
"colLeftIdx",
":",
"idx",
"-",
"1",
"<",
"0",
"?",
"-",
"1",
":",
"idx",
"-",
"1",
",",
"colRightIdx",
":",
"idx",
"+",
"1",
">=",
"columns",
".",
"length",
"?",
"-",
"1",
":",
"idx",
"+",
"1",
",",
"}",
";",
"}",
")",
";",
"return",
"!",
"hideTimeField",
"&&",
"indexPattern",
".",
"timeFieldName",
"?",
"[",
"getTimeColumn",
"(",
"indexPattern",
".",
"timeFieldName",
")",
",",
"...",
"columnProps",
"]",
":",
"columnProps",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8186,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
584,
null,
8,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
2,
null,
3,
null,
null,
null,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661521 | [
"param",
"columns",
"function",
"buildColumns",
"(",
"columns",
")",
"{",
"if",
"(",
"columns",
".",
"length",
">",
"1",
"&&",
"columns",
".",
"indexOf",
"(",
"'_source'",
")",
"!==",
"-",
"1",
")",
"{",
"return",
"columns",
".",
"filter",
"(",
"(",
"col",
")",
"=>",
"col",
"!==",
"'_source'",
")",
";",
"}",
"else",
"if",
"(",
"columns",
".",
"length",
"!==",
"0",
")",
"{",
"return",
"columns",
";",
"}",
"return",
"[",
"'_source'",
"]",
";",
"}",
"export",
"function",
"addColumn",
"(",
"columns",
",",
"columnName",
")",
"{",
"if",
"(",
"columns",
".",
"includes",
"(",
"columnName",
")",
")",
"{",
"return",
"columns",
";",
"}",
"return",
"buildColumns",
"(",
"[",
"...",
"columns",
",",
"columnName",
"]",
")",
";",
"}",
"export",
"function",
"removeColumn",
"(",
"columns",
",",
"columnName",
")",
"{",
"if",
"(",
"!",
"columns",
".",
"includes",
"(",
"columnName",
")",
")",
"{",
"return",
"columns",
";",
"}",
"return",
"buildColumns",
"(",
"columns",
".",
"filter",
"(",
"(",
"col",
")",
"=>",
"col",
"!==",
"columnName",
")",
")",
";",
"}",
"export",
"function",
"moveColumn",
"(",
"columns",
",",
"columnName",
",",
"newIndex",
")",
"{",
"if",
"(",
"newIndex",
"<",
"0",
"||",
"newIndex",
">=",
"columns",
".",
"length",
"||",
"!",
"columns",
".",
"includes",
"(",
"columnName",
")",
")",
"{",
"return",
"columns",
";",
"}",
"const",
"modifiedColumns",
"=",
"[",
"...",
"columns",
"]",
";",
"modifiedColumns",
".",
"splice",
"(",
"modifiedColumns",
".",
"indexOf",
"(",
"columnName",
")",
",",
"1",
")",
";",
"modifiedColumns",
".",
"splice",
"(",
"newIndex",
",",
"0",
",",
"columnName",
")",
";",
"return",
"modifiedColumns",
";",
"}"
] | [
null,
null,
null,
5,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
2,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661522 | [
"export",
"const",
"DEFAULT_COLUMNS_SETTING",
"=",
"'defaultColumns'",
";",
"export",
"const",
"SAMPLE_SIZE_SETTING",
"=",
"'discover:sampleSize'",
";",
"export",
"const",
"AGGS_TERMS_SIZE_SETTING",
"=",
"'discover:aggs:terms:size'",
";",
"export",
"const",
"SORT_DEFAULT_ORDER_SETTING",
"=",
"'discover:sort:defaultOrder'",
";",
"export",
"const",
"SEARCH_ON_PAGE_LOAD_SETTING",
"=",
"'discover:searchOnPageLoad'",
";",
"export",
"const",
"DOC_HIDE_TIME_COLUMN_SETTING",
"=",
"'doc_table:hideTimeColumn'",
";",
"export",
"const",
"FIELDS_LIMIT_SETTING",
"=",
"'fields:popularLimit'",
";",
"export",
"const",
"CONTEXT_DEFAULT_SIZE_SETTING",
"=",
"'context:defaultSize'",
";",
"export",
"const",
"CONTEXT_STEP_SETTING",
"=",
"'context:step'",
";",
"export",
"const",
"CONTEXT_TIE_BREAKER_FIELDS_SETTING",
"=",
"'context:tieBreakerFields'",
";",
"export",
"const",
"MODIFY_COLUMNS_ON_SWITCH",
"=",
"'discover:modifyColumnsOnSwitch'",
";"
] | [
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
2,
null,
null,
null
] |
661523 | [
"import",
"html",
"from",
"'./doc_table.html'",
";",
"import",
"{",
"dispatchRenderComplete",
"}",
"from",
"'../../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"SAMPLE_SIZE_SETTING",
"}",
"from",
"'../../../../common'",
";",
"import",
"{",
"getLimitedSearchResultsMessage",
"}",
"from",
"'./doc_table_strings'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../../../opensearch_dashboards_services'",
";",
"import",
"'./index.scss'",
";",
"export",
"interface",
"LazyScope",
"extends",
"ng",
".",
"IScope",
"{",
"[",
"key",
"]",
":",
"any",
";",
"}",
"export",
"function",
"createDocTableDirective",
"(",
"pagerFactory",
",",
"$filter",
")",
"{",
"return",
"{",
"restrict",
":",
"'E'",
",",
"template",
":",
"html",
",",
"scope",
":",
"{",
"sorting",
":",
"'='",
",",
"columns",
":",
"'='",
",",
"hits",
":",
"'='",
",",
"totalHitCount",
":",
"'='",
",",
"indexPattern",
":",
"'='",
",",
"isLoading",
":",
"'=?'",
",",
"infiniteScroll",
":",
"'=?'",
",",
"filter",
":",
"'=?'",
",",
"minimumVisibleRows",
":",
"'=?'",
",",
"onAddColumn",
":",
"'=?'",
",",
"onChangeSortOrder",
":",
"'=?'",
",",
"onMoveColumn",
":",
"'=?'",
",",
"onRemoveColumn",
":",
"'=?'",
",",
"inspectorAdapters",
":",
"'=?'",
",",
"}",
",",
"link",
":",
"(",
"$scope",
",",
"$el",
")",
"=>",
"{",
"$scope",
".",
"persist",
"=",
"{",
"sorting",
":",
"$scope",
".",
"sorting",
",",
"columns",
":",
"$scope",
".",
"columns",
",",
"}",
";",
"const",
"limitTo",
"=",
"$filter",
"(",
"'limitTo'",
")",
";",
"const",
"calculateItemsOnPage",
"=",
"(",
")",
"=>",
"{",
"$scope",
".",
"pager",
".",
"setTotalItems",
"(",
"$scope",
".",
"hits",
".",
"length",
")",
";",
"$scope",
".",
"pageOfItems",
"=",
"limitTo",
"(",
"$scope",
".",
"hits",
",",
"$scope",
".",
"pager",
".",
"pageSize",
",",
"$scope",
".",
"pager",
".",
"startIndex",
")",
";",
"}",
";",
"$scope",
".",
"limitedResultsWarning",
"=",
"getLimitedSearchResultsMessage",
"(",
"getServices",
"(",
")",
".",
"uiSettings",
".",
"get",
"(",
"SAMPLE_SIZE_SETTING",
",",
"500",
")",
")",
";",
"$scope",
".",
"addRows",
"=",
"function",
"(",
")",
"{",
"$scope",
".",
"limit",
"+=",
"50",
";",
"}",
";",
"$scope",
".",
"$watch",
"(",
"'hits'",
",",
"(",
"hits",
")",
"=>",
"{",
"if",
"(",
"!",
"hits",
")",
"return",
";",
"$scope",
".",
"limit",
"=",
"$scope",
".",
"minimumVisibleRows",
"||",
"50",
";",
"if",
"(",
"hits",
".",
"length",
"===",
"0",
")",
"{",
"dispatchRenderComplete",
"(",
"$el",
"[",
"0",
"]",
")",
";",
"}",
"if",
"(",
"$scope",
".",
"infiniteScroll",
")",
"return",
";",
"$scope",
".",
"pager",
"=",
"pagerFactory",
".",
"create",
"(",
"hits",
".",
"length",
",",
"50",
",",
"1",
")",
";",
"calculateItemsOnPage",
"(",
")",
";",
"}",
")",
";",
"$scope",
".",
"pageOfItems",
"=",
"[",
"]",
";",
"$scope",
".",
"onPageNext",
"=",
"(",
")",
"=>",
"{",
"$scope",
".",
"pager",
".",
"nextPage",
"(",
")",
";",
"calculateItemsOnPage",
"(",
")",
";",
"}",
";",
"$scope",
".",
"onPagePrevious",
"=",
"(",
")",
"=>",
"{",
"$scope",
".",
"pager",
".",
"previousPage",
"(",
")",
";",
"calculateItemsOnPage",
"(",
")",
";",
"}",
";",
"$scope",
".",
"shouldShowLimitedResultsWarning",
"=",
"(",
")",
"=>",
"!",
"$scope",
".",
"pager",
".",
"hasNextPage",
"&&",
"$scope",
".",
"pager",
".",
"totalItems",
"<",
"$scope",
".",
"totalHitCount",
";",
"}",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5333,
null,
137,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661524 | [
"import",
"{",
"OpenSearchQuerySortValue",
",",
"IndexPattern",
"}",
"from",
"'../../../../opensearch_dashboards_services'",
";",
"import",
"{",
"SortOrder",
"}",
"from",
"'../components/table_header/helpers'",
";",
"import",
"{",
"getSort",
"}",
"from",
"'./get_sort'",
";",
"import",
"{",
"getDefaultSort",
"}",
"from",
"'./get_default_sort'",
";",
"/**\n * Prepares sort for search source, that's sending the request to OpenSearch\n * - Adds default sort if necessary\n * - Handles the special case when there's sorting by date_nanos typed fields\n * the addon of the numeric_type guarantees the right sort order\n * when there are indices with date and indices with date_nanos field\n */",
"export",
"function",
"getSortForSearchSource",
"(",
"sort",
"?",
",",
"indexPattern",
"?",
",",
"defaultDirection",
"=",
"'desc'",
")",
"{",
"if",
"(",
"!",
"sort",
"||",
"!",
"indexPattern",
")",
"{",
"return",
"[",
"]",
";",
"}",
"else",
"if",
"(",
"Array",
".",
"isArray",
"(",
"sort",
")",
"&&",
"sort",
".",
"length",
"===",
"0",
")",
"{",
"sort",
"=",
"getDefaultSort",
"(",
"indexPattern",
",",
"defaultDirection",
")",
";",
"}",
"const",
"{",
"timeFieldName",
"}",
"=",
"indexPattern",
";",
"return",
"getSort",
"(",
"sort",
",",
"indexPattern",
")",
".",
"map",
"(",
"(",
"sortPair",
")",
"=>",
"{",
"if",
"(",
"indexPattern",
".",
"isTimeNanosBased",
"(",
")",
"&&",
"timeFieldName",
"&&",
"sortPair",
"[",
"timeFieldName",
"]",
")",
"{",
"return",
"{",
"[",
"timeFieldName",
"]",
":",
"{",
"order",
":",
"sortPair",
"[",
"timeFieldName",
"]",
",",
"numeric_type",
":",
"'date_nanos'",
",",
"}",
",",
"}",
"as",
"OpenSearchQuerySortValue",
";",
"}",
"return",
"sortPair",
"as",
"OpenSearchQuerySortValue",
";",
"}",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
null,
584,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661525 | [
"import",
"'./search_embeddable.scss'",
";",
"import",
"angular",
"from",
"'angular'",
";",
"import",
"_",
"from",
"'lodash'",
";",
"import",
"*",
"as",
"Rx",
"from",
"'rxjs'",
";",
"import",
"{",
"Subscription",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"UiActionsStart",
",",
"APPLY_FILTER_TRIGGER",
"}",
"from",
"'../../../../ui_actions/public'",
";",
"import",
"{",
"RequestAdapter",
",",
"Adapters",
"}",
"from",
"'../../../../inspector/public'",
";",
"import",
"{",
"opensearchFilters",
",",
"Filter",
",",
"TimeRange",
",",
"FilterManager",
",",
"getTime",
",",
"Query",
",",
"IFieldType",
",",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"Container",
",",
"Embeddable",
"}",
"from",
"'../../../../embeddable/public'",
";",
"import",
"*",
"as",
"columnActions",
"from",
"'../angular/doc_table/actions/columns'",
";",
"import",
"searchTemplate",
"from",
"'./search_template.html'",
";",
"import",
"{",
"ISearchEmbeddable",
",",
"SearchInput",
",",
"SearchOutput",
"}",
"from",
"'./types'",
";",
"import",
"{",
"SortOrder",
"}",
"from",
"'../angular/doc_table/components/table_header/helpers'",
";",
"import",
"{",
"getSortForSearchSource",
"}",
"from",
"'../angular/doc_table'",
";",
"import",
"{",
"getRequestInspectorStats",
",",
"getResponseInspectorStats",
",",
"getServices",
",",
"IndexPattern",
",",
"ISearchSource",
",",
"}",
"from",
"'../../opensearch_dashboards_services'",
";",
"import",
"{",
"SEARCH_EMBEDDABLE_TYPE",
"}",
"from",
"'./constants'",
";",
"import",
"{",
"SavedSearch",
"}",
"from",
"'../..'",
";",
"import",
"{",
"SAMPLE_SIZE_SETTING",
",",
"SORT_DEFAULT_ORDER_SETTING",
"}",
"from",
"'../../../common'",
";",
"interface",
"SearchScope",
"extends",
"ng",
".",
"IScope",
"{",
"columns",
"?",
":",
"string",
"[",
"]",
";",
"description",
"?",
":",
"string",
";",
"sort",
"?",
":",
"SortOrder",
"[",
"]",
";",
"sharedItemTitle",
"?",
":",
"string",
";",
"inspectorAdapters",
"?",
":",
"Adapters",
";",
"setSortOrder",
"?",
":",
"(",
"sortPair",
":",
"SortOrder",
"[",
"]",
")",
"=>",
"void",
";",
"removeColumn",
"?",
":",
"(",
"column",
":",
"string",
")",
"=>",
"void",
";",
"addColumn",
"?",
":",
"(",
"column",
":",
"string",
")",
"=>",
"void",
";",
"moveColumn",
"?",
":",
"(",
"column",
":",
"string",
",",
"index",
":",
"number",
")",
"=>",
"void",
";",
"filter",
"?",
":",
"(",
"field",
":",
"IFieldType",
",",
"value",
":",
"string",
"[",
"]",
",",
"operator",
":",
"string",
")",
"=>",
"void",
";",
"hits",
"?",
":",
"any",
"[",
"]",
";",
"indexPattern",
"?",
":",
"IndexPattern",
";",
"totalHitCount",
"?",
":",
"number",
";",
"isLoading",
"?",
":",
"boolean",
";",
"}",
"interface",
"SearchEmbeddableConfig",
"{",
"$rootScope",
":",
"ng",
".",
"IRootScopeService",
";",
"$compile",
":",
"ng",
".",
"ICompileService",
";",
"savedSearch",
":",
"SavedSearch",
";",
"editUrl",
":",
"string",
";",
"editPath",
":",
"string",
";",
"indexPatterns",
"?",
":",
"IndexPattern",
"[",
"]",
";",
"editable",
":",
"boolean",
";",
"filterManager",
":",
"FilterManager",
";",
"}",
"export",
"class",
"SearchEmbeddable",
"extends",
"Embeddable",
"<",
"SearchInput",
",",
"SearchOutput",
">",
"implements",
"ISearchEmbeddable",
"{",
"private",
"readonly",
"savedSearch",
":",
"SavedSearch",
";",
"private",
"$rootScope",
":",
"ng",
".",
"IRootScopeService",
";",
"private",
"$compile",
":",
"ng",
".",
"ICompileService",
";",
"private",
"inspectorAdaptors",
":",
"Adapters",
";",
"private",
"searchScope",
"?",
":",
"SearchScope",
";",
"private",
"panelTitle",
":",
"string",
"=",
"''",
";",
"private",
"filtersSearchSource",
"?",
":",
"ISearchSource",
";",
"private",
"searchInstance",
"?",
":",
"JQLite",
";",
"private",
"autoRefreshFetchSubscription",
"?",
":",
"Subscription",
";",
"private",
"subscription",
"?",
":",
"Subscription",
";",
"public",
"readonly",
"type",
"=",
"SEARCH_EMBEDDABLE_TYPE",
";",
"private",
"filterManager",
":",
"FilterManager",
";",
"private",
"abortController",
"?",
":",
"AbortController",
";",
"private",
"prevTimeRange",
"?",
":",
"TimeRange",
";",
"private",
"prevFilters",
"?",
":",
"Filter",
"[",
"]",
";",
"private",
"prevQuery",
"?",
":",
"Query",
";",
"constructor",
"(",
"{",
"$rootScope",
",",
"$compile",
",",
"savedSearch",
",",
"editUrl",
",",
"editPath",
",",
"indexPatterns",
",",
"editable",
",",
"filterManager",
",",
"}",
",",
"initialInput",
",",
"private",
"readonly",
"executeTriggerActions",
",",
"parent",
"?",
")",
"{",
"super",
"(",
"initialInput",
",",
"{",
"defaultTitle",
":",
"savedSearch",
".",
"title",
",",
"editUrl",
",",
"editPath",
",",
"editApp",
":",
"'discover'",
",",
"indexPatterns",
",",
"editable",
",",
"}",
",",
"parent",
")",
";",
"this",
".",
"filterManager",
"=",
"filterManager",
";",
"this",
".",
"savedSearch",
"=",
"savedSearch",
";",
"this",
".",
"$rootScope",
"=",
"$rootScope",
";",
"this",
".",
"$compile",
"=",
"$compile",
";",
"this",
".",
"inspectorAdaptors",
"=",
"{",
"requests",
":",
"new",
"RequestAdapter",
"(",
")",
",",
"}",
";",
"this",
".",
"initializeSearchScope",
"(",
")",
";",
"this",
".",
"autoRefreshFetchSubscription",
"=",
"getServices",
"(",
")",
".",
"timefilter",
".",
"getAutoRefreshFetch$",
"(",
")",
".",
"subscribe",
"(",
"this",
".",
"fetch",
")",
";",
"this",
".",
"subscription",
"=",
"Rx",
".",
"merge",
"(",
"this",
".",
"getOutput$",
"(",
")",
",",
"this",
".",
"getInput$",
"(",
")",
")",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"this",
".",
"panelTitle",
"=",
"this",
".",
"output",
".",
"title",
"||",
"''",
";",
"if",
"(",
"this",
".",
"searchScope",
")",
"{",
"this",
".",
"pushContainerStateParamsToScope",
"(",
"this",
".",
"searchScope",
")",
";",
"}",
"}",
")",
";",
"}",
"public",
"getInspectorAdapters",
"(",
")",
"{",
"return",
"this",
".",
"inspectorAdaptors",
";",
"}",
"public",
"getSavedSearch",
"(",
")",
"{",
"return",
"this",
".",
"savedSearch",
";",
"}",
"param",
"{",
"Element",
"}",
"domNode",
"public",
"render",
"(",
"domNode",
")",
"{",
"if",
"(",
"!",
"this",
".",
"searchScope",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Search scope not defined'",
")",
";",
"}",
"this",
".",
"searchInstance",
"=",
"this",
".",
"$compile",
"(",
"searchTemplate",
")",
"(",
"this",
".",
"searchScope",
")",
";",
"const",
"rootNode",
"=",
"angular",
".",
"element",
"(",
"domNode",
")",
";",
"rootNode",
".",
"append",
"(",
"this",
".",
"searchInstance",
")",
";",
"this",
".",
"pushContainerStateParamsToScope",
"(",
"this",
".",
"searchScope",
")",
";",
"}",
"public",
"destroy",
"(",
")",
"{",
"super",
".",
"destroy",
"(",
")",
";",
"this",
".",
"savedSearch",
".",
"destroy",
"(",
")",
";",
"if",
"(",
"this",
".",
"searchInstance",
")",
"{",
"this",
".",
"searchInstance",
".",
"remove",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"searchScope",
")",
"{",
"this",
".",
"searchScope",
".",
"$destroy",
"(",
")",
";",
"delete",
"this",
".",
"searchScope",
";",
"}",
"if",
"(",
"this",
".",
"subscription",
")",
"{",
"this",
".",
"subscription",
".",
"unsubscribe",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"autoRefreshFetchSubscription",
")",
"{",
"this",
".",
"autoRefreshFetchSubscription",
".",
"unsubscribe",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"abortController",
")",
"this",
".",
"abortController",
".",
"abort",
"(",
")",
";",
"}",
"private",
"initializeSearchScope",
"(",
")",
"{",
"const",
"searchScope",
"=",
"(",
"this",
".",
"searchScope",
"=",
"this",
".",
"$rootScope",
".",
"$new",
"(",
")",
")",
";",
"searchScope",
".",
"description",
"=",
"this",
".",
"savedSearch",
".",
"description",
";",
"searchScope",
".",
"inspectorAdapters",
"=",
"this",
".",
"inspectorAdaptors",
";",
"const",
"{",
"searchSource",
"}",
"=",
"this",
".",
"savedSearch",
";",
"const",
"indexPattern",
"=",
"(",
"searchScope",
".",
"indexPattern",
"=",
"searchSource",
".",
"getField",
"(",
"'index'",
")",
")",
"!",
";",
"const",
"timeRangeSearchSource",
"=",
"searchSource",
".",
"create",
"(",
")",
";",
"timeRangeSearchSource",
".",
"setField",
"(",
"'filter'",
",",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"searchScope",
"||",
"!",
"this",
".",
"input",
".",
"timeRange",
")",
"return",
";",
"return",
"getTime",
"(",
"indexPattern",
",",
"this",
".",
"input",
".",
"timeRange",
")",
";",
"}",
")",
";",
"this",
".",
"filtersSearchSource",
"=",
"searchSource",
".",
"create",
"(",
")",
";",
"this",
".",
"filtersSearchSource",
".",
"setParent",
"(",
"timeRangeSearchSource",
")",
";",
"searchSource",
".",
"setParent",
"(",
"this",
".",
"filtersSearchSource",
")",
";",
"this",
".",
"pushContainerStateParamsToScope",
"(",
"searchScope",
")",
";",
"searchScope",
".",
"setSortOrder",
"=",
"(",
"sort",
")",
"=>",
"{",
"this",
".",
"updateInput",
"(",
"{",
"sort",
"}",
")",
";",
"}",
";",
"searchScope",
".",
"addColumn",
"=",
"(",
"columnName",
")",
"=>",
"{",
"if",
"(",
"!",
"searchScope",
".",
"columns",
")",
"{",
"return",
";",
"}",
"const",
"columns",
"=",
"columnActions",
".",
"addColumn",
"(",
"searchScope",
".",
"columns",
",",
"columnName",
")",
";",
"this",
".",
"updateInput",
"(",
"{",
"columns",
"}",
")",
";",
"}",
";",
"searchScope",
".",
"removeColumn",
"=",
"(",
"columnName",
")",
"=>",
"{",
"if",
"(",
"!",
"searchScope",
".",
"columns",
")",
"{",
"return",
";",
"}",
"const",
"columns",
"=",
"columnActions",
".",
"removeColumn",
"(",
"searchScope",
".",
"columns",
",",
"columnName",
")",
";",
"this",
".",
"updateInput",
"(",
"{",
"columns",
"}",
")",
";",
"}",
";",
"searchScope",
".",
"moveColumn",
"=",
"(",
"columnName",
",",
"newIndex",
")",
"=>",
"{",
"if",
"(",
"!",
"searchScope",
".",
"columns",
")",
"{",
"return",
";",
"}",
"const",
"columns",
"=",
"columnActions",
".",
"moveColumn",
"(",
"searchScope",
".",
"columns",
",",
"columnName",
",",
"newIndex",
")",
";",
"this",
".",
"updateInput",
"(",
"{",
"columns",
"}",
")",
";",
"}",
";",
"searchScope",
".",
"filter",
"=",
"async",
"(",
"field",
",",
"value",
",",
"operator",
")",
"=>",
"{",
"let",
"filters",
"=",
"opensearchFilters",
".",
"generateFilters",
"(",
"this",
".",
"filterManager",
",",
"field",
",",
"value",
",",
"operator",
",",
"indexPattern",
".",
"id",
"!",
")",
";",
"filters",
"=",
"filters",
".",
"map",
"(",
"(",
"filter",
")",
"=>",
"(",
"{",
"...",
"filter",
",",
"$state",
":",
"{",
"store",
":",
"opensearchFilters",
".",
"FilterStateStore",
".",
"APP_STATE",
"}",
",",
"}",
")",
")",
";",
"await",
"this",
".",
"executeTriggerActions",
"(",
"APPLY_FILTER_TRIGGER",
",",
"{",
"embeddable",
":",
"this",
",",
"filters",
",",
"}",
")",
";",
"}",
";",
"}",
"public",
"reload",
"(",
")",
"{",
"this",
".",
"fetch",
"(",
")",
";",
"}",
"private",
"fetch",
"=",
"async",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"searchScope",
")",
"return",
";",
"const",
"{",
"searchSource",
"}",
"=",
"this",
".",
"savedSearch",
";",
"if",
"(",
"this",
".",
"abortController",
")",
"this",
".",
"abortController",
".",
"abort",
"(",
")",
";",
"this",
".",
"abortController",
"=",
"new",
"AbortController",
"(",
")",
";",
"searchSource",
".",
"setField",
"(",
"'size'",
",",
"getServices",
"(",
")",
".",
"uiSettings",
".",
"get",
"(",
"SAMPLE_SIZE_SETTING",
")",
")",
";",
"searchSource",
".",
"setField",
"(",
"'sort'",
",",
"getSortForSearchSource",
"(",
"this",
".",
"searchScope",
".",
"sort",
",",
"this",
".",
"searchScope",
".",
"indexPattern",
",",
"getServices",
"(",
")",
".",
"uiSettings",
".",
"get",
"(",
"SORT_DEFAULT_ORDER_SETTING",
")",
")",
")",
";",
"this",
".",
"inspectorAdaptors",
".",
"requests",
".",
"reset",
"(",
")",
";",
"const",
"title",
"=",
"i18n",
".",
"translate",
"(",
"'discover.embeddable.inspectorRequestDataTitle'",
",",
"{",
"defaultMessage",
":",
"'Data'",
",",
"}",
")",
";",
"const",
"description",
"=",
"i18n",
".",
"translate",
"(",
"'discover.embeddable.inspectorRequestDescription'",
",",
"{",
"defaultMessage",
":",
"'This request queries OpenSearch to fetch the data for the search.'",
",",
"}",
")",
";",
"const",
"inspectorRequest",
"=",
"this",
".",
"inspectorAdaptors",
".",
"requests",
".",
"start",
"(",
"title",
",",
"{",
"description",
"}",
")",
";",
"inspectorRequest",
".",
"stats",
"(",
"getRequestInspectorStats",
"(",
"searchSource",
")",
")",
";",
"searchSource",
".",
"getSearchRequestBody",
"(",
")",
".",
"then",
"(",
"(",
"body",
")",
"=>",
"{",
"inspectorRequest",
".",
"json",
"(",
"body",
")",
";",
"}",
")",
";",
"this",
".",
"updateOutput",
"(",
"{",
"loading",
":",
"true",
",",
"error",
":",
"undefined",
"}",
")",
";",
"try",
"{",
"const",
"resp",
"=",
"await",
"searchSource",
".",
"fetch",
"(",
"{",
"abortSignal",
":",
"this",
".",
"abortController",
".",
"signal",
",",
"}",
")",
";",
"this",
".",
"updateOutput",
"(",
"{",
"loading",
":",
"false",
",",
"error",
":",
"undefined",
"}",
")",
";",
"inspectorRequest",
".",
"stats",
"(",
"getResponseInspectorStats",
"(",
"resp",
",",
"searchSource",
")",
")",
".",
"ok",
"(",
"{",
"json",
":",
"resp",
"}",
")",
";",
"this",
".",
"searchScope",
".",
"$apply",
"(",
"(",
")",
"=>",
"{",
"this",
".",
"searchScope",
"!",
".",
"hits",
"=",
"resp",
".",
"hits",
".",
"hits",
";",
"this",
".",
"searchScope",
"!",
".",
"totalHitCount",
"=",
"resp",
".",
"hits",
".",
"total",
";",
"}",
")",
";",
"}",
"catch",
"(",
"error",
")",
"{",
"this",
".",
"updateOutput",
"(",
"{",
"loading",
":",
"false",
",",
"error",
"}",
")",
";",
"}",
"}",
";",
"private",
"pushContainerStateParamsToScope",
"(",
"searchScope",
")",
"{",
"const",
"isFetchRequired",
"=",
"!",
"opensearchFilters",
".",
"onlyDisabledFiltersChanged",
"(",
"this",
".",
"input",
".",
"filters",
",",
"this",
".",
"prevFilters",
")",
"||",
"!",
"_",
".",
"isEqual",
"(",
"this",
".",
"prevQuery",
",",
"this",
".",
"input",
".",
"query",
")",
"||",
"!",
"_",
".",
"isEqual",
"(",
"this",
".",
"prevTimeRange",
",",
"this",
".",
"input",
".",
"timeRange",
")",
"||",
"!",
"_",
".",
"isEqual",
"(",
"searchScope",
".",
"sort",
",",
"this",
".",
"input",
".",
"sort",
"||",
"this",
".",
"savedSearch",
".",
"sort",
")",
";",
"searchScope",
".",
"columns",
"=",
"this",
".",
"input",
".",
"columns",
"||",
"this",
".",
"savedSearch",
".",
"columns",
";",
"searchScope",
".",
"sort",
"=",
"this",
".",
"input",
".",
"sort",
"||",
"this",
".",
"savedSearch",
".",
"sort",
";",
"searchScope",
".",
"sharedItemTitle",
"=",
"this",
".",
"panelTitle",
";",
"if",
"(",
"isFetchRequired",
")",
"{",
"this",
".",
"filtersSearchSource",
"!",
".",
"setField",
"(",
"'filter'",
",",
"this",
".",
"input",
".",
"filters",
")",
";",
"this",
".",
"filtersSearchSource",
"!",
".",
"setField",
"(",
"'query'",
",",
"this",
".",
"input",
".",
"query",
")",
";",
"this",
".",
"fetch",
"(",
")",
";",
"this",
".",
"prevFilters",
"=",
"this",
".",
"input",
".",
"filters",
";",
"this",
".",
"prevQuery",
"=",
"this",
".",
"input",
".",
"query",
";",
"this",
".",
"prevTimeRange",
"=",
"this",
".",
"input",
".",
"timeRange",
";",
"}",
"else",
"if",
"(",
"this",
".",
"searchScope",
")",
"{",
"this",
".",
"searchScope",
".",
"$applyAsync",
"(",
")",
";",
"}",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661526 | [
"import",
"{",
"auto",
"}",
"from",
"'angular'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"UiActionsStart",
"}",
"from",
"'src/plugins/ui_actions/public'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../../opensearch_dashboards_services'",
";",
"import",
"{",
"EmbeddableFactoryDefinition",
",",
"Container",
",",
"ErrorEmbeddable",
",",
"}",
"from",
"'../../../../embeddable/public'",
";",
"import",
"{",
"TimeRange",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"SearchInput",
",",
"SearchOutput",
",",
"SearchEmbeddable",
"}",
"from",
"'./types'",
";",
"import",
"{",
"SEARCH_EMBEDDABLE_TYPE",
"}",
"from",
"'./constants'",
";",
"interface",
"StartServices",
"{",
"executeTriggerActions",
":",
"UiActionsStart",
"[",
"'executeTriggerActions'",
"]",
";",
"isEditable",
":",
"(",
")",
"=>",
"boolean",
";",
"}",
"export",
"class",
"SearchEmbeddableFactory",
"implements",
"EmbeddableFactoryDefinition",
"<",
"SearchInput",
",",
"SearchOutput",
",",
"SearchEmbeddable",
">",
"{",
"public",
"readonly",
"type",
"=",
"SEARCH_EMBEDDABLE_TYPE",
";",
"private",
"$injector",
":",
"auto",
".",
"IInjectorService",
"|",
"null",
";",
"private",
"getInjector",
":",
"(",
")",
"=>",
"Promise",
"<",
"auto",
".",
"IInjectorService",
">",
"|",
"null",
";",
"public",
"readonly",
"savedObjectMetaData",
"=",
"{",
"name",
":",
"i18n",
".",
"translate",
"(",
"'discover.savedSearch.savedObjectName'",
",",
"{",
"defaultMessage",
":",
"'Saved search'",
",",
"}",
")",
",",
"type",
":",
"'search'",
",",
"getIconForSavedObject",
":",
"(",
")",
"=>",
"'search'",
",",
"}",
";",
"constructor",
"(",
"private",
"getStartServices",
",",
"getInjector",
")",
"{",
"this",
".",
"$injector",
"=",
"null",
";",
"this",
".",
"getInjector",
"=",
"getInjector",
";",
"}",
"public",
"canCreateNew",
"(",
")",
"{",
"return",
"false",
";",
"}",
"public",
"isEditable",
"=",
"async",
"(",
")",
"=>",
"{",
"return",
"(",
"await",
"this",
".",
"getStartServices",
"(",
")",
")",
".",
"isEditable",
"(",
")",
";",
"}",
";",
"public",
"getDisplayName",
"(",
")",
"{",
"return",
"i18n",
".",
"translate",
"(",
"'discover.embeddable.search.displayName'",
",",
"{",
"defaultMessage",
":",
"'search'",
",",
"}",
")",
";",
"}",
"public",
"createFromSavedObject",
"=",
"async",
"(",
"savedObjectId",
",",
"input",
",",
"parent",
"?",
")",
":",
"Promise",
"<",
"SearchEmbeddable",
"|",
"ErrorEmbeddable",
">",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"$injector",
")",
"{",
"this",
".",
"$injector",
"=",
"await",
"this",
".",
"getInjector",
"(",
")",
";",
"}",
"const",
"$injector",
"=",
"this",
".",
"$injector",
"as",
"auto",
".",
"IInjectorService",
";",
"const",
"$compile",
"=",
"$injector",
".",
"get",
"<",
"ng",
".",
"ICompileService",
">",
"(",
"'$compile'",
")",
";",
"const",
"$rootScope",
"=",
"$injector",
".",
"get",
"<",
"ng",
".",
"IRootScopeService",
">",
"(",
"'$rootScope'",
")",
";",
"const",
"filterManager",
"=",
"getServices",
"(",
")",
".",
"filterManager",
";",
"const",
"url",
"=",
"await",
"getServices",
"(",
")",
".",
"getSavedSearchUrlById",
"(",
"savedObjectId",
")",
";",
"const",
"editUrl",
"=",
"getServices",
"(",
")",
".",
"addBasePath",
"(",
"`/app/discover${",
"url",
"}`",
")",
";",
"try",
"{",
"const",
"savedObject",
"=",
"await",
"getServices",
"(",
")",
".",
"getSavedSearchById",
"(",
"savedObjectId",
")",
";",
"const",
"indexPattern",
"=",
"savedObject",
".",
"searchSource",
".",
"getField",
"(",
"'index'",
")",
";",
"const",
"{",
"executeTriggerActions",
"}",
"=",
"await",
"this",
".",
"getStartServices",
"(",
")",
";",
"const",
"{",
"SearchEmbeddable",
":",
"SearchEmbeddableClass",
"}",
"=",
"await",
"import",
"(",
"'./search_embeddable'",
")",
";",
"return",
"new",
"SearchEmbeddableClass",
"(",
"{",
"savedSearch",
":",
"savedObject",
",",
"$rootScope",
",",
"$compile",
",",
"editUrl",
",",
"editPath",
":",
"url",
",",
"filterManager",
",",
"editable",
":",
"getServices",
"(",
")",
".",
"capabilities",
".",
"discover",
".",
"save",
"as",
"boolean",
",",
"indexPatterns",
":",
"indexPattern",
"?",
"[",
"indexPattern",
"]",
":",
"[",
"]",
",",
"}",
",",
"input",
",",
"executeTriggerActions",
",",
"parent",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"console",
".",
"error",
"(",
"e",
")",
";",
"return",
"new",
"ErrorEmbeddable",
"(",
"e",
",",
"input",
",",
"parent",
")",
";",
"}",
"}",
";",
"public",
"async",
"create",
"(",
"input",
")",
"{",
"return",
"new",
"ErrorEmbeddable",
"(",
"'Saved searches can only be created from a saved object'",
",",
"input",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
202,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
9633,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661527 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"export",
"function",
"getRootBreadcrumbs",
"(",
")",
"{",
"return",
"[",
"{",
"text",
":",
"i18n",
".",
"translate",
"(",
"'discover.rootBreadcrumb'",
",",
"{",
"defaultMessage",
":",
"'Discover'",
",",
"}",
")",
",",
"href",
":",
"'#/'",
",",
"}",
",",
"]",
";",
"}",
"export",
"function",
"getSavedSearchBreadcrumbs",
"(",
"$route",
")",
"{",
"return",
"[",
"...",
"getRootBreadcrumbs",
"(",
")",
",",
"{",
"text",
":",
"$route",
".",
"current",
".",
"locals",
".",
"savedObjects",
".",
"savedSearch",
".",
"id",
",",
"}",
",",
"]",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661528 | [
"import",
"{",
"useEffect",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"IndexPattern",
",",
"getServices",
"}",
"from",
"'../../../opensearch_dashboards_services'",
";",
"import",
"{",
"DocProps",
"}",
"from",
"'./doc'",
";",
"import",
"{",
"OpenSearchSearchHit",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"export",
"enum",
"OpenSearchRequestState",
"{",
"Loading",
",",
"NotFound",
",",
"Found",
",",
"Error",
",",
"NotFoundIndexPattern",
"}",
"/**\n * helper function to build a query body for OpenSearch\n * https://opensearch.org/docs/latest/opensearch/query-dsl/index/\n */",
"export",
"function",
"buildSearchBody",
"(",
"id",
",",
"indexPattern",
")",
"{",
"const",
"computedFields",
"=",
"indexPattern",
".",
"getComputedFields",
"(",
")",
";",
"return",
"{",
"query",
":",
"{",
"ids",
":",
"{",
"values",
":",
"[",
"id",
"]",
",",
"}",
",",
"}",
",",
"stored_fields",
":",
"computedFields",
".",
"storedFields",
",",
"_source",
":",
"true",
",",
"script_fields",
":",
"computedFields",
".",
"scriptFields",
",",
"docvalue_fields",
":",
"computedFields",
".",
"docvalueFields",
",",
"}",
";",
"}",
"/**\n * Custom react hook for querying a single doc in OpenSearch\n */",
"export",
"function",
"useOpenSearchDocSearch",
"(",
"{",
"id",
",",
"index",
",",
"indexPatternId",
",",
"indexPatternService",
",",
"}",
")",
"{",
"const",
"[",
"indexPattern",
",",
"setIndexPattern",
"]",
"=",
"useState",
"<",
"IndexPattern",
"|",
"null",
">",
"(",
"null",
")",
";",
"const",
"[",
"status",
",",
"setStatus",
"]",
"=",
"useState",
"(",
"OpenSearchRequestState",
".",
"Loading",
")",
";",
"const",
"[",
"hit",
",",
"setHit",
"]",
"=",
"useState",
"<",
"OpenSearchSearchHit",
"|",
"null",
">",
"(",
"null",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"async",
"function",
"requestData",
"(",
")",
"{",
"try",
"{",
"const",
"indexPatternEntity",
"=",
"await",
"indexPatternService",
".",
"get",
"(",
"indexPatternId",
")",
";",
"setIndexPattern",
"(",
"indexPatternEntity",
")",
";",
"const",
"{",
"rawResponse",
"}",
"=",
"await",
"getServices",
"(",
")",
".",
"data",
".",
"search",
".",
"search",
"(",
"{",
"params",
":",
"{",
"index",
",",
"body",
":",
"buildSearchBody",
"(",
"id",
",",
"indexPatternEntity",
")",
",",
"}",
",",
"}",
")",
".",
"toPromise",
"(",
")",
";",
"const",
"hits",
"=",
"rawResponse",
".",
"hits",
";",
"if",
"(",
"hits",
"?.",
"hits",
"?.",
"[",
"0",
"]",
")",
"{",
"setStatus",
"(",
"OpenSearchRequestState",
".",
"Found",
")",
";",
"setHit",
"(",
"hits",
".",
"hits",
"[",
"0",
"]",
")",
";",
"}",
"else",
"{",
"setStatus",
"(",
"OpenSearchRequestState",
".",
"NotFound",
")",
";",
"}",
"}",
"catch",
"(",
"err",
")",
"{",
"if",
"(",
"err",
".",
"savedObjectId",
")",
"{",
"setStatus",
"(",
"OpenSearchRequestState",
".",
"NotFoundIndexPattern",
")",
";",
"}",
"else",
"if",
"(",
"err",
".",
"status",
"===",
"404",
")",
"{",
"setStatus",
"(",
"OpenSearchRequestState",
".",
"NotFound",
")",
";",
"}",
"else",
"{",
"setStatus",
"(",
"OpenSearchRequestState",
".",
"Error",
")",
";",
"}",
"}",
"}",
"requestData",
"(",
")",
";",
"}",
",",
"[",
"id",
",",
"index",
",",
"indexPatternId",
",",
"indexPatternService",
"]",
")",
";",
"return",
"[",
"status",
",",
"hit",
",",
"indexPattern",
"]",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
2,
null,
584,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661529 | [
"import",
"React",
",",
"{",
"useRef",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"DocViewRenderFn",
",",
"DocViewRenderProps",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"interface",
"Props",
"{",
"render",
":",
"DocViewRenderFn",
";",
"renderProps",
":",
"DocViewRenderProps",
";",
"}",
"/**\n * Responsible for rendering a tab provided by a render function.\n * So any other framework can be used (E.g. legacy Angular 3rd party plugin code)\n * The provided `render` function is called with a reference to the\n * component's `HTMLDivElement` as 1st arg and `renderProps` as 2nd arg\n */",
"export",
"function",
"DocViewRenderTab",
"(",
"{",
"render",
",",
"renderProps",
"}",
")",
"{",
"const",
"ref",
"=",
"useRef",
"<",
"HTMLDivElement",
">",
"(",
"null",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"ref",
"&&",
"ref",
".",
"current",
")",
"{",
"return",
"render",
"(",
"ref",
".",
"current",
",",
"renderProps",
")",
";",
"}",
"}",
",",
"[",
"render",
",",
"renderProps",
"]",
")",
";",
"return",
"<",
"div",
"ref",
"=",
"{",
"ref",
"}",
"/>;",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661530 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"DocViewRenderTab",
"}",
"from",
"'./doc_viewer_render_tab'",
";",
"import",
"{",
"DocViewerError",
"}",
"from",
"'./doc_viewer_render_error'",
";",
"import",
"{",
"DocViewRenderFn",
",",
"DocViewRenderProps",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"interface",
"Props",
"{",
"component",
"?",
":",
"React",
".",
"ComponentType",
"<",
"DocViewRenderProps",
">",
";",
"id",
":",
"number",
";",
"render",
"?",
":",
"DocViewRenderFn",
";",
"renderProps",
":",
"DocViewRenderProps",
";",
"title",
":",
"string",
";",
"}",
"interface",
"State",
"{",
"error",
":",
"Error",
"|",
"string",
";",
"hasError",
":",
"boolean",
";",
"}",
"/**\n * Renders the tab content of a doc view.\n * Displays an error message when it encounters exceptions, thanks to\n * Error Boundaries.\n */",
"export",
"class",
"DocViewerTab",
"extends",
"React",
".",
"Component",
"<",
"Props",
",",
"State",
">",
"{",
"state",
"=",
"{",
"hasError",
":",
"false",
",",
"error",
":",
"''",
",",
"}",
";",
"static",
"getDerivedStateFromError",
"(",
"error",
")",
"{",
"return",
"{",
"hasError",
":",
"true",
",",
"error",
"}",
";",
"}",
"shouldComponentUpdate",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"return",
"(",
"nextProps",
".",
"renderProps",
".",
"hit",
".",
"_id",
"!==",
"this",
".",
"props",
".",
"renderProps",
".",
"hit",
".",
"_id",
"||",
"nextProps",
".",
"id",
"!==",
"this",
".",
"props",
".",
"id",
"||",
"nextState",
".",
"hasError",
")",
";",
"}",
"render",
"(",
")",
"{",
"const",
"{",
"component",
",",
"render",
",",
"renderProps",
",",
"title",
"}",
"=",
"this",
".",
"props",
";",
"const",
"{",
"hasError",
",",
"error",
"}",
"=",
"this",
".",
"state",
";",
"if",
"(",
"hasError",
"&&",
"error",
")",
"{",
"return",
"<",
"DocViewerError",
"error",
"=",
"{",
"error",
"}",
"/>;",
"}",
"else",
"if",
"(",
"!",
"render",
"&&",
"!",
"component",
")",
"{",
"return",
"(",
"<",
"DocViewerError",
"error",
"=",
"{",
"`Invalid plugin ${",
"title",
"}, there is neither a (react) component nor a render function provided`",
"}",
"/>);",
"}",
"if",
"(",
"render",
")",
"{",
"return",
"<",
"DocViewRenderTab",
"render",
"=",
"{",
"render",
"}",
"renderProps",
"=",
"{",
"renderProps",
"}",
"/",
">",
";",
"}",
"const",
"Component",
"=",
"component",
"as",
"any",
";",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"Component",
"{",
"...",
"renderProps",
"}",
"/",
">",
"<",
"/I18nProvider>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
32,
null,
38,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661531 | [
"import",
"'./doc_viewer.scss'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiTabbedContent",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"getDocViewsRegistry",
"}",
"from",
"'../../../opensearch_dashboards_services'",
";",
"import",
"{",
"DocViewerTab",
"}",
"from",
"'./doc_viewer_tab'",
";",
"import",
"{",
"DocView",
",",
"DocViewRenderProps",
"}",
"from",
"'../../doc_views/doc_views_types'",
";",
"/**\n * Rendering tabs with different views of 1 OpenSearch hit in Discover.\n * The tabs are provided by the `docs_views` registry.\n * A view can contain a React `component`, or any JS framework by using\n * a `render` function.\n */",
"export",
"function",
"DocViewer",
"(",
"renderProps",
")",
"{",
"const",
"docViewsRegistry",
"=",
"getDocViewsRegistry",
"(",
")",
";",
"const",
"tabs",
"=",
"docViewsRegistry",
".",
"getDocViewsSorted",
"(",
"renderProps",
".",
"hit",
")",
".",
"map",
"(",
"(",
"{",
"title",
",",
"render",
",",
"component",
"}",
",",
"idx",
")",
"=>",
"{",
"return",
"{",
"id",
":",
"`osd_doc_viewer_tab_${",
"idx",
"}`",
",",
"name",
":",
"title",
",",
"content",
":",
"(",
"<",
"DocViewerTab",
"id",
"=",
"{",
"idx",
"}",
"title",
"=",
"{",
"title",
"}",
"component",
"=",
"{",
"component",
"}",
"renderProps",
"=",
"{",
"renderProps",
"}",
"render",
"=",
"{",
"render",
"}",
"/",
">",
")",
",",
"}",
";",
"}",
")",
";",
"if",
"(",
"!",
"tabs",
".",
"length",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"div",
"className",
"=",
"\"osdDocViewer\"",
">",
"<",
"EuiTabbedContent",
"tabs",
"=",
"{",
"tabs",
"}",
"/>",
"<",
"/div>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4902,
null,
null,
null,
35183,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661532 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiCallOut",
",",
"EuiLink",
",",
"EuiLoadingSpinner",
",",
"EuiPageContent",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"IndexPatternsContract",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"OpenSearchRequestState",
",",
"useOpenSearchDocSearch",
"}",
"from",
"'./use_opensearch_doc_search'",
";",
"import",
"{",
"DocViewer",
"}",
"from",
"'../doc_viewer/doc_viewer'",
";",
"export",
"interface",
"DocProps",
"{",
"/**\n * Id of the doc in OpenSearch\n */",
"id",
":",
"string",
";",
"/**\n * Index in OpenSearch to query\n */",
"index",
":",
"string",
";",
"/**\n * IndexPattern ID used to get IndexPattern entity\n * that's used for adding additional fields (stored_fields, script_fields, docvalue_fields)\n */",
"indexPatternId",
":",
"string",
";",
"/**\n * IndexPatternService to get a given index pattern by ID\n */",
"indexPatternService",
":",
"IndexPatternsContract",
";",
"}",
"export",
"function",
"Doc",
"(",
"props",
")",
"{",
"const",
"[",
"reqState",
",",
"hit",
",",
"indexPattern",
"]",
"=",
"useOpenSearchDocSearch",
"(",
"props",
")",
";",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"EuiPageContent",
">",
"{",
"reqState",
"===",
"OpenSearchRequestState",
".",
"NotFoundIndexPattern",
"&&",
"(",
"<",
"EuiCallOut",
"color",
"=",
"\"danger\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`doc-msg-notFoundIndexPattern`",
"}",
"iconType",
"=",
"\"alert\"",
"title",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.failedToLocateIndexPattern\"",
"defaultMessage",
"=",
"\"No index pattern matches ID {indexPatternId}\"",
"values",
"=",
"{",
"{",
"indexPatternId",
":",
"props",
".",
"indexPatternId",
"}",
"}",
"/>}/",
">",
")",
"}",
"{",
"reqState",
"===",
"OpenSearchRequestState",
".",
"NotFound",
"&&",
"(",
"<",
"EuiCallOut",
"color",
"=",
"\"danger\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`doc-msg-notFound`",
"}",
"iconType",
"=",
"\"alert\"",
"title",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.failedToLocateDocumentDescription\"",
"defaultMessage",
"=",
"\"Cannot find document\"",
"/",
">",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.couldNotFindDocumentsDescription\"",
"defaultMessage",
"=",
"\"No documents match that ID.\"",
"/",
">",
"<",
"/EuiCallOut>)}",
"{",
"reqState",
"===",
"OpenSearchRequestState",
".",
"Error",
"&&",
"(",
"<",
"EuiCallOut",
"color",
"=",
"\"danger\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`doc-msg-error`",
"}",
"iconType",
"=",
"\"alert\"",
"title",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.failedToExecuteQueryDescription\"",
"defaultMessage",
"=",
"\"Cannot run search\"",
"/",
">",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.somethingWentWrongDescription\"",
"defaultMessage",
"=",
"\"{indexName} is missing.\"",
"values",
"=",
"{",
"{",
"indexName",
":",
"props",
".",
"index",
"}",
"}",
"/>{' '}",
"<",
"EuiLink",
"href",
"=",
"{",
"`https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/`",
"}",
"target",
"=",
"\"_blank\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.somethingWentWrongDescriptionAddon\"",
"defaultMessage",
"=",
"\"Please ensure the index exists.\"",
"/",
">",
"<",
"/EuiLink>",
"<",
"/EuiCallOut>)}",
"{",
"reqState",
"===",
"OpenSearchRequestState",
".",
"Loading",
"&&",
"(",
"<",
"EuiCallOut",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`doc-msg-loading`",
"}",
">",
"<",
"EuiLoadingSpinner",
"size",
"=",
"\"m\"",
"/",
">",
"{",
"' '",
"}",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.doc.loadingDescription\"",
"defaultMessage",
"=",
"\"Loading…\"",
"/",
">",
"<",
"/EuiCallOut>)}",
"{",
"reqState",
"===",
"OpenSearchRequestState",
".",
"Found",
"&&",
"hit",
"!==",
"null",
"&&",
"indexPattern",
"&&",
"(",
"<",
"div",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"doc-hit\"",
">",
"<",
"DocViewer",
"hit",
"=",
"{",
"hit",
"}",
"indexPattern",
"=",
"{",
"indexPattern",
"}",
"/",
">",
"<",
"/div>)}",
"<",
"/EuiPageContent>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
10994,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661533 | [
"import",
"{",
"getAngularModule",
",",
"getServices",
"}",
"from",
"'../../opensearch_dashboards_services'",
";",
"import",
"{",
"getRootBreadcrumbs",
"}",
"from",
"'../helpers/breadcrumbs'",
";",
"import",
"html",
"from",
"'./doc.html'",
";",
"import",
"{",
"Doc",
"}",
"from",
"'../components/doc/doc'",
";",
"interface",
"LazyScope",
"extends",
"ng",
".",
"IScope",
"{",
"[",
"key",
"]",
":",
"any",
";",
"}",
"const",
"{",
"timefilter",
"}",
"=",
"getServices",
"(",
")",
";",
"const",
"app",
"=",
"getAngularModule",
"(",
")",
";",
"app",
".",
"directive",
"(",
"'discoverDoc'",
",",
"function",
"(",
"reactDirective",
")",
"{",
"return",
"reactDirective",
"(",
"Doc",
",",
"[",
"[",
"'id'",
",",
"{",
"watchDepth",
":",
"'value'",
"}",
"]",
",",
"[",
"'index'",
",",
"{",
"watchDepth",
":",
"'value'",
"}",
"]",
",",
"[",
"'indexPatternId'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'indexPatternService'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"]",
",",
"{",
"restrict",
":",
"'E'",
"}",
")",
";",
"}",
")",
";",
"app",
".",
"config",
"(",
"(",
"$routeProvider",
")",
"=>",
"{",
"$routeProvider",
".",
"when",
"(",
"'/doc/:indexPattern/:index/:type'",
",",
"{",
"redirectTo",
":",
"'/doc/:indexPattern/:index'",
",",
"}",
")",
".",
"when",
"(",
"'/doc/:indexPattern/:index'",
",",
"{",
"controller",
":",
"function",
"(",
"$scope",
",",
"$route",
")",
"{",
"timefilter",
".",
"disableAutoRefreshSelector",
"(",
")",
";",
"timefilter",
".",
"disableTimeRangeSelector",
"(",
")",
";",
"$scope",
".",
"id",
"=",
"$route",
".",
"current",
".",
"params",
".",
"id",
";",
"$scope",
".",
"index",
"=",
"$route",
".",
"current",
".",
"params",
".",
"index",
";",
"$scope",
".",
"indexPatternId",
"=",
"$route",
".",
"current",
".",
"params",
".",
"indexPattern",
";",
"$scope",
".",
"indexPatternService",
"=",
"getServices",
"(",
")",
".",
"indexPatterns",
";",
"}",
",",
"template",
":",
"html",
",",
"k7Breadcrumbs",
":",
"(",
"$route",
")",
"=>",
"[",
"...",
"getRootBreadcrumbs",
"(",
")",
",",
"{",
"text",
":",
"`${",
"$route",
".",
"current",
".",
"params",
".",
"index",
"}#${",
"$route",
".",
"current",
".",
"params",
".",
"id",
"}`",
",",
"}",
",",
"]",
",",
"}",
")",
";",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5333,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661534 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"DocViewer",
"}",
"from",
"'../components/doc_viewer/doc_viewer'",
";",
"export",
"function",
"createDocViewerDirective",
"(",
"reactDirective",
")",
"{",
"return",
"reactDirective",
"(",
"(",
"props",
")",
"=>",
"{",
"return",
"<",
"DocViewer",
"{",
"...",
"props",
"}",
"/",
">",
";",
"}",
",",
"[",
"'hit'",
",",
"[",
"'indexPattern'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'filter'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'columns'",
",",
"{",
"watchDepth",
":",
"'collection'",
"}",
"]",
",",
"[",
"'onAddColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onRemoveColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"]",
",",
"{",
"restrict",
":",
"'E'",
",",
"scope",
":",
"{",
"hit",
":",
"'='",
",",
"indexPattern",
":",
"'='",
",",
"filter",
":",
"'=?'",
",",
"columns",
":",
"'=?'",
",",
"onAddColumn",
":",
"'=?'",
",",
"onRemoveColumn",
":",
"'=?'",
",",
"}",
",",
"}",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661535 | [
"import",
"{",
"getAngularModule",
",",
"getServices",
",",
"getUrlTracker",
"}",
"from",
"'../../opensearch_dashboards_services'",
";",
"getAngularModule",
"(",
")",
".",
"config",
"(",
"(",
"$routeProvider",
")",
"=>",
"{",
"$routeProvider",
".",
"otherwise",
"(",
"{",
"resolveRedirectTo",
":",
"(",
"$rootScope",
")",
"=>",
"{",
"const",
"path",
"=",
"window",
".",
"location",
".",
"hash",
".",
"substr",
"(",
"1",
")",
";",
"getUrlTracker",
"(",
")",
".",
"restorePreviousUrl",
"(",
")",
";",
"$rootScope",
".",
"$applyAsync",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"urlForwarding",
"}",
"=",
"getServices",
"(",
")",
";",
"const",
"{",
"navigated",
"}",
"=",
"urlForwarding",
".",
"navigateToLegacyOpenSearchDashboardsUrl",
"(",
"path",
")",
";",
"if",
"(",
"!",
"navigated",
")",
"{",
"urlForwarding",
".",
"navigateToDefaultApp",
"(",
")",
";",
"}",
"}",
")",
";",
"return",
"new",
"Promise",
"(",
"(",
")",
"=>",
"{",
"}",
")",
";",
"}",
",",
"}",
")",
";",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661536 | [
"import",
"'./index.scss'",
";",
"import",
"angular",
"from",
"'angular'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../opensearch_dashboards_services'",
";",
"/**\n * Here's where Discover's inner angular is mounted and rendered\n */",
"export",
"async",
"function",
"renderApp",
"(",
"moduleName",
",",
"element",
")",
"{",
"getServices",
"(",
")",
".",
"opensearchDashboardsLegacy",
".",
"loadFontAwesome",
"(",
")",
";",
"await",
"import",
"(",
"'./angular'",
")",
";",
"const",
"$injector",
"=",
"mountDiscoverApp",
"(",
"moduleName",
",",
"element",
")",
";",
"return",
"(",
")",
"=>",
"$injector",
".",
"get",
"(",
"'$rootScope'",
")",
".",
"$destroy",
"(",
")",
";",
"}",
"function",
"mountDiscoverApp",
"(",
"moduleName",
",",
"element",
")",
"{",
"const",
"mountpoint",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"const",
"appWrapper",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"appWrapper",
".",
"setAttribute",
"(",
"'ng-view'",
",",
"''",
")",
";",
"mountpoint",
".",
"appendChild",
"(",
"appWrapper",
")",
";",
"const",
"$injector",
"=",
"angular",
".",
"bootstrap",
"(",
"mountpoint",
",",
"[",
"moduleName",
"]",
")",
";",
"element",
".",
"appendChild",
"(",
"mountpoint",
")",
";",
"return",
"$injector",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
2,
null,
15,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
15,
null,
null,
null,
39,
null,
null,
null,
null,
null,
null,
null,
null,
null,
39,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661537 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"EuiToolTip",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"SortOrder",
"}",
"from",
"'./helpers'",
";",
"interface",
"Props",
"{",
"colLeftIdx",
":",
"number",
";",
"colRightIdx",
":",
"number",
";",
"displayName",
":",
"string",
";",
"isRemoveable",
":",
"boolean",
";",
"isSortable",
":",
"boolean",
";",
"name",
":",
"string",
";",
"onChangeSortOrder",
"?",
":",
"(",
"sortOrder",
":",
"SortOrder",
"[",
"]",
")",
"=>",
"void",
";",
"onMoveColumn",
"?",
":",
"(",
"name",
":",
"string",
",",
"idx",
":",
"number",
")",
"=>",
"void",
";",
"onRemoveColumn",
"?",
":",
"(",
"name",
":",
"string",
")",
"=>",
"void",
";",
"sortOrder",
":",
"SortOrder",
"[",
"]",
";",
"}",
"const",
"sortDirectionToIcon",
"=",
"{",
"desc",
":",
"'fa fa-sort-down'",
",",
"asc",
":",
"'fa fa-sort-up'",
",",
"''",
":",
"'fa fa-sort'",
",",
"}",
";",
"export",
"function",
"TableHeaderColumn",
"(",
"{",
"colLeftIdx",
",",
"colRightIdx",
",",
"displayName",
",",
"isRemoveable",
",",
"isSortable",
",",
"name",
",",
"onChangeSortOrder",
",",
"onMoveColumn",
",",
"onRemoveColumn",
",",
"sortOrder",
",",
"}",
")",
"{",
"const",
"[",
",",
"sortDirection",
"=",
"''",
"]",
"=",
"sortOrder",
".",
"find",
"(",
"(",
"sortPair",
")",
"=>",
"name",
"===",
"sortPair",
"[",
"0",
"]",
")",
"||",
"[",
"]",
";",
"const",
"currentSortWithoutColumn",
"=",
"sortOrder",
".",
"filter",
"(",
"(",
"pair",
")",
"=>",
"pair",
"[",
"0",
"]",
"!==",
"name",
")",
";",
"const",
"currentColumnSort",
"=",
"sortOrder",
".",
"find",
"(",
"(",
"pair",
")",
"=>",
"pair",
"[",
"0",
"]",
"===",
"name",
")",
";",
"const",
"currentColumnSortDirection",
"=",
"(",
"currentColumnSort",
"&&",
"currentColumnSort",
"[",
"1",
"]",
")",
"||",
"''",
";",
"const",
"btnSortIcon",
"=",
"sortDirectionToIcon",
"[",
"sortDirection",
"]",
";",
"const",
"btnSortClassName",
"=",
"sortDirection",
"!==",
"''",
"?",
"btnSortIcon",
":",
"`osdDocTableHeader__sortChange ${",
"btnSortIcon",
"}`",
";",
"const",
"handleChangeSortOrder",
"=",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"onChangeSortOrder",
")",
"return",
";",
"if",
"(",
"currentColumnSort",
"===",
"undefined",
")",
"{",
"onChangeSortOrder",
"(",
"[",
"...",
"currentSortWithoutColumn",
",",
"[",
"name",
",",
"'asc'",
"]",
"]",
")",
";",
"}",
"else",
"if",
"(",
"currentColumnSortDirection",
"===",
"'asc'",
")",
"{",
"onChangeSortOrder",
"(",
"[",
"...",
"currentSortWithoutColumn",
",",
"[",
"name",
",",
"'desc'",
"]",
"]",
")",
";",
"}",
"else",
"if",
"(",
"currentColumnSortDirection",
"===",
"'desc'",
"&&",
"currentSortWithoutColumn",
".",
"length",
"===",
"0",
")",
"{",
"onChangeSortOrder",
"(",
"[",
"[",
"name",
",",
"'asc'",
"]",
"]",
")",
";",
"}",
"else",
"{",
"onChangeSortOrder",
"(",
"currentSortWithoutColumn",
")",
";",
"}",
"}",
";",
"const",
"getSortButtonAriaLabel",
"=",
"(",
")",
"=>",
"{",
"const",
"sortAscendingMessage",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.sortByColumnAscendingAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Sort {columnName} ascending'",
",",
"values",
":",
"{",
"columnName",
":",
"name",
"}",
",",
"}",
")",
";",
"const",
"sortDescendingMessage",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.sortByColumnDescendingAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Sort {columnName} descending'",
",",
"values",
":",
"{",
"columnName",
":",
"name",
"}",
",",
"}",
")",
";",
"const",
"stopSortingMessage",
"=",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.sortByColumnUnsortedAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Stop sorting on {columnName}'",
",",
"values",
":",
"{",
"columnName",
":",
"name",
"}",
",",
"}",
")",
";",
"if",
"(",
"currentColumnSort",
"===",
"undefined",
")",
"{",
"return",
"sortAscendingMessage",
";",
"}",
"else",
"if",
"(",
"sortDirection",
"===",
"'asc'",
")",
"{",
"return",
"sortDescendingMessage",
";",
"}",
"else",
"if",
"(",
"sortDirection",
"===",
"'desc'",
"&&",
"currentSortWithoutColumn",
".",
"length",
"===",
"0",
")",
"{",
"return",
"sortAscendingMessage",
";",
"}",
"else",
"{",
"return",
"stopSortingMessage",
";",
"}",
"}",
";",
"const",
"buttons",
"=",
"[",
"{",
"active",
":",
"isSortable",
"&&",
"typeof",
"onChangeSortOrder",
"===",
"'function'",
",",
"ariaLabel",
":",
"getSortButtonAriaLabel",
"(",
")",
",",
"className",
":",
"btnSortClassName",
",",
"onClick",
":",
"handleChangeSortOrder",
",",
"testSubject",
":",
"`docTableHeaderFieldSort_${",
"name",
"}`",
",",
"tooltip",
":",
"getSortButtonAriaLabel",
"(",
")",
",",
"}",
",",
"{",
"active",
":",
"isRemoveable",
"&&",
"typeof",
"onRemoveColumn",
"===",
"'function'",
",",
"ariaLabel",
":",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.removeColumnButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Remove {columnName} column'",
",",
"values",
":",
"{",
"columnName",
":",
"name",
"}",
",",
"}",
")",
",",
"className",
":",
"'fa fa-remove osdDocTableHeader__move'",
",",
"onClick",
":",
"(",
")",
"=>",
"onRemoveColumn",
"&&",
"onRemoveColumn",
"(",
"name",
")",
",",
"testSubject",
":",
"`docTableRemoveHeader-${",
"name",
"}`",
",",
"tooltip",
":",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.removeColumnButtonTooltip'",
",",
"{",
"defaultMessage",
":",
"'Remove Column'",
",",
"}",
")",
",",
"}",
",",
"{",
"active",
":",
"colLeftIdx",
">=",
"0",
"&&",
"typeof",
"onMoveColumn",
"===",
"'function'",
",",
"ariaLabel",
":",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.moveColumnLeftButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Move {columnName} column to the left'",
",",
"values",
":",
"{",
"columnName",
":",
"name",
"}",
",",
"}",
")",
",",
"className",
":",
"'fa fa-angle-double-left osdDocTableHeader__move'",
",",
"onClick",
":",
"(",
")",
"=>",
"onMoveColumn",
"&&",
"onMoveColumn",
"(",
"name",
",",
"colLeftIdx",
")",
",",
"testSubject",
":",
"`docTableMoveLeftHeader-${",
"name",
"}`",
",",
"tooltip",
":",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.moveColumnLeftButtonTooltip'",
",",
"{",
"defaultMessage",
":",
"'Move column to the left'",
",",
"}",
")",
",",
"}",
",",
"{",
"active",
":",
"colRightIdx",
">=",
"0",
"&&",
"typeof",
"onMoveColumn",
"===",
"'function'",
",",
"ariaLabel",
":",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.moveColumnRightButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Move {columnName} column to the right'",
",",
"values",
":",
"{",
"columnName",
":",
"name",
"}",
",",
"}",
")",
",",
"className",
":",
"'fa fa-angle-double-right osdDocTableHeader__move'",
",",
"onClick",
":",
"(",
")",
"=>",
"onMoveColumn",
"&&",
"onMoveColumn",
"(",
"name",
",",
"colRightIdx",
")",
",",
"testSubject",
":",
"`docTableMoveRightHeader-${",
"name",
"}`",
",",
"tooltip",
":",
"i18n",
".",
"translate",
"(",
"'discover.docTable.tableHeader.moveColumnRightButtonTooltip'",
",",
"{",
"defaultMessage",
":",
"'Move column to the right'",
",",
"}",
")",
",",
"}",
",",
"]",
";",
"return",
"(",
"<",
"th",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"docTableHeaderField\"",
">",
"<",
"span",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`docTableHeader-${",
"name",
"}`",
"}",
">",
"{",
"displayName",
"}",
"{",
"buttons",
".",
"filter",
"(",
"(",
"button",
")",
"=>",
"button",
".",
"active",
")",
".",
"map",
"(",
"(",
"button",
",",
"idx",
")",
"=>",
"(",
"<",
"EuiToolTip",
"id",
"=",
"{",
"`docTableHeader-${",
"name",
"}-tt`",
"}",
"content",
"=",
"{",
"button",
".",
"tooltip",
"}",
"key",
"=",
"{",
"`button-${",
"idx",
"}`",
"}",
">",
"<",
"button",
"aria",
"-",
"label",
"=",
"{",
"button",
".",
"ariaLabel",
"}",
"className",
"=",
"{",
"button",
".",
"className",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"button",
".",
"testSubject",
"}",
"onClick",
"=",
"{",
"button",
".",
"onClick",
"}",
"/",
">",
"<",
"/EuiToolTip>))}",
"<",
"/span>",
"<",
"/th>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661538 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"IndexPattern",
"}",
"from",
"'../../../../../opensearch_dashboards_services'",
";",
"import",
"{",
"TableHeaderColumn",
"}",
"from",
"'./table_header_column'",
";",
"import",
"{",
"SortOrder",
",",
"getDisplayedColumns",
"}",
"from",
"'./helpers'",
";",
"import",
"{",
"getDefaultSort",
"}",
"from",
"'../../lib/get_default_sort'",
";",
"interface",
"Props",
"{",
"columns",
":",
"string",
"[",
"]",
";",
"defaultSortOrder",
":",
"string",
";",
"hideTimeColumn",
":",
"boolean",
";",
"indexPattern",
":",
"IndexPattern",
";",
"isShortDots",
":",
"boolean",
";",
"onChangeSortOrder",
"?",
":",
"(",
"sortOrder",
":",
"SortOrder",
"[",
"]",
")",
"=>",
"void",
";",
"onMoveColumn",
"?",
":",
"(",
"name",
":",
"string",
",",
"index",
":",
"number",
")",
"=>",
"void",
";",
"onRemoveColumn",
"?",
":",
"(",
"name",
":",
"string",
")",
"=>",
"void",
";",
"sortOrder",
":",
"SortOrder",
"[",
"]",
";",
"}",
"export",
"function",
"TableHeader",
"(",
"{",
"columns",
",",
"defaultSortOrder",
",",
"hideTimeColumn",
",",
"indexPattern",
",",
"isShortDots",
",",
"onChangeSortOrder",
",",
"onMoveColumn",
",",
"onRemoveColumn",
",",
"sortOrder",
",",
"}",
")",
"{",
"const",
"displayedColumns",
"=",
"getDisplayedColumns",
"(",
"columns",
",",
"indexPattern",
",",
"hideTimeColumn",
",",
"isShortDots",
")",
";",
"return",
"(",
"<",
"tr",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"docTableHeader\"",
"className",
"=",
"\"osdDocTableHeader\"",
">",
"<",
"th",
"style",
"=",
"{",
"{",
"width",
":",
"'24px'",
"}",
"}",
"/>",
"{",
"displayedColumns",
".",
"map",
"(",
"(",
"col",
")",
"=>",
"{",
"return",
"(",
"<",
"TableHeaderColumn",
"key",
"=",
"{",
"col",
".",
"name",
"}",
"{",
"...",
"col",
"}",
"sortOrder",
"=",
"{",
"sortOrder",
".",
"length",
"?",
"sortOrder",
":",
"getDefaultSort",
"(",
"indexPattern",
",",
"defaultSortOrder",
")",
"}",
"onMoveColumn",
"=",
"{",
"onMoveColumn",
"}",
"onRemoveColumn",
"=",
"{",
"onRemoveColumn",
"}",
"onChangeSortOrder",
"=",
"{",
"onChangeSortOrder",
"}",
"/",
">",
")",
";",
"}",
")",
"}",
"<",
"/tr>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661539 | [
"import",
"{",
"TableHeader",
"}",
"from",
"'./table_header/table_header'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../../../../opensearch_dashboards_services'",
";",
"import",
"{",
"SORT_DEFAULT_ORDER_SETTING",
",",
"DOC_HIDE_TIME_COLUMN_SETTING",
"}",
"from",
"'../../../../../common'",
";",
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../../../../data/public'",
";",
"export",
"function",
"createTableHeaderDirective",
"(",
"reactDirective",
")",
"{",
"const",
"{",
"uiSettings",
":",
"config",
"}",
"=",
"getServices",
"(",
")",
";",
"return",
"reactDirective",
"(",
"TableHeader",
",",
"[",
"[",
"'columns'",
",",
"{",
"watchDepth",
":",
"'collection'",
"}",
"]",
",",
"[",
"'hideTimeColumn'",
",",
"{",
"watchDepth",
":",
"'value'",
"}",
"]",
",",
"[",
"'indexPattern'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'isShortDots'",
",",
"{",
"watchDepth",
":",
"'value'",
"}",
"]",
",",
"[",
"'onChangeSortOrder'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onMoveColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onRemoveColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'sortOrder'",
",",
"{",
"watchDepth",
":",
"'collection'",
"}",
"]",
",",
"]",
",",
"{",
"restrict",
":",
"'A'",
"}",
",",
"{",
"hideTimeColumn",
":",
"config",
".",
"get",
"(",
"DOC_HIDE_TIME_COLUMN_SETTING",
",",
"false",
")",
",",
"isShortDots",
":",
"config",
".",
"get",
"(",
"UI_SETTINGS",
".",
"SHORT_DOTS_ENABLE",
")",
",",
"defaultSortOrder",
":",
"config",
".",
"get",
"(",
"SORT_DEFAULT_ORDER_SETTING",
",",
"'desc'",
")",
",",
"}",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661540 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"interface",
"Props",
"{",
"startItem",
":",
"number",
";",
"endItem",
":",
"number",
";",
"totalItems",
":",
"number",
";",
"}",
"export",
"function",
"ToolBarPagerText",
"(",
"{",
"startItem",
",",
"endItem",
",",
"totalItems",
"}",
")",
"{",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"div",
"className",
"=",
"\"kuiToolBarText\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"toolBarPagerText\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.docTable.pagerControl.pagesCountLabel\"",
"defaultMessage",
"=",
"\"{startItem}–{endItem} of {totalItems}\"",
"values",
"=",
"{",
"{",
"startItem",
",",
"endItem",
",",
"totalItems",
"}",
"}",
"/>",
"<",
"/div>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661541 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"interface",
"Props",
"{",
"hasPreviousPage",
":",
"boolean",
";",
"hasNextPage",
":",
"boolean",
";",
"onPageNext",
":",
"(",
")",
"=>",
"void",
";",
"onPagePrevious",
":",
"(",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"ToolBarPagerButtons",
"(",
"props",
")",
"{",
"return",
"(",
"<",
"div",
"className",
"=",
"\"kuiButtonGroup\"",
">",
"<",
"button",
"className",
"=",
"\"kuiButton kuiButton--basic kuiButton--icon\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"props",
".",
"onPagePrevious",
"(",
")",
"}",
"disabled",
"=",
"{",
"!",
"props",
".",
"hasPreviousPage",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"btnPrevPage\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.docTable.pager.toolbarPagerButtons.previousButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Previous page in table'",
",",
"}",
")",
"}",
">",
"<",
"span",
"className",
"=",
"\"kuiButton__icon kuiIcon fa-chevron-left\"",
"/",
">",
"<",
"/button>",
"<",
"button",
"className",
"=",
"\"kuiButton kuiButton--basic kuiButton--icon\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"props",
".",
"onPageNext",
"(",
")",
"}",
"disabled",
"=",
"{",
"!",
"props",
".",
"hasNextPage",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"btnNextPage\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.docTable.pager.toolbarPagerButtons.nextButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Next page in table'",
",",
"}",
")",
"}",
">",
"<",
"span",
"className",
"=",
"\"kuiButton__icon kuiIcon fa-chevron-right\"",
"/",
">",
"<",
"/button>",
"<",
"/div>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
32,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661542 | [
"import",
"{",
"ToolBarPagerText",
"}",
"from",
"'./tool_bar_pager_text'",
";",
"import",
"{",
"ToolBarPagerButtons",
"}",
"from",
"'./tool_bar_pager_buttons'",
";",
"export",
"function",
"createToolBarPagerTextDirective",
"(",
"reactDirective",
")",
"{",
"return",
"reactDirective",
"(",
"ToolBarPagerText",
")",
";",
"}",
"export",
"function",
"createToolBarPagerButtonsDirective",
"(",
"reactDirective",
")",
"{",
"return",
"reactDirective",
"(",
"ToolBarPagerButtons",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661543 | [
"import",
"{",
"find",
",",
"template",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"stringify",
"}",
"from",
"'query-string'",
";",
"import",
"$",
"from",
"'jquery'",
";",
"import",
"rison",
"from",
"'rison-node'",
";",
"import",
"'../../doc_viewer'",
";",
"import",
"openRowHtml",
"from",
"'./table_row/open.html'",
";",
"import",
"detailsHtml",
"from",
"'./table_row/details.html'",
";",
"import",
"{",
"dispatchRenderComplete",
",",
"url",
"}",
"from",
"'../../../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"DOC_HIDE_TIME_COLUMN_SETTING",
"}",
"from",
"'../../../../../common'",
";",
"import",
"cellTemplateHtml",
"from",
"'../components/table_row/cell.html'",
";",
"import",
"truncateByHeightTemplateHtml",
"from",
"'../components/table_row/truncate_by_height.html'",
";",
"import",
"{",
"opensearchFilters",
"}",
"from",
"'../../../../../../data/public'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../../../../opensearch_dashboards_services'",
";",
"const",
"TAGS_WITH_WS",
"=",
"/>\\s+</g",
";",
"/**\n * Remove all of the whitespace between html tags\n * so that inline elements don't have extra spaces.\n */",
"export",
"function",
"noWhiteSpace",
"(",
"html",
")",
"{",
"return",
"html",
".",
"replace",
"(",
"TAGS_WITH_WS",
",",
"'><'",
")",
";",
"}",
"const",
"MIN_LINE_LENGTH",
"=",
"20",
";",
"interface",
"LazyScope",
"extends",
"ng",
".",
"IScope",
"{",
"[",
"key",
"]",
":",
"any",
";",
"}",
"export",
"function",
"createTableRowDirective",
"(",
"$compile",
")",
"{",
"const",
"cellTemplate",
"=",
"template",
"(",
"noWhiteSpace",
"(",
"cellTemplateHtml",
")",
")",
";",
"const",
"truncateByHeightTemplate",
"=",
"template",
"(",
"noWhiteSpace",
"(",
"truncateByHeightTemplateHtml",
")",
")",
";",
"return",
"{",
"restrict",
":",
"'A'",
",",
"scope",
":",
"{",
"columns",
":",
"'='",
",",
"filter",
":",
"'='",
",",
"indexPattern",
":",
"'='",
",",
"row",
":",
"'=osdTableRow'",
",",
"onAddColumn",
":",
"'=?'",
",",
"onRemoveColumn",
":",
"'=?'",
",",
"}",
",",
"link",
":",
"(",
"$scope",
",",
"$el",
")",
"=>",
"{",
"$el",
".",
"after",
"(",
"'<tr data-test-subj=\"docTableDetailsRow\" class=\"osdDocTableDetails__row\">'",
")",
";",
"$el",
".",
"empty",
"(",
")",
";",
"let",
"$detailsScope",
";",
"let",
"$toggleScope",
";",
"$scope",
".",
"toggleRow",
"=",
"(",
")",
"=>",
"{",
"const",
"$detailsTr",
"=",
"$el",
".",
"next",
"(",
")",
";",
"$scope",
".",
"open",
"=",
"!",
"$scope",
".",
"open",
";",
"$detailsTr",
".",
"toggle",
"(",
"$scope",
".",
"open",
")",
";",
"if",
"(",
"!",
"$scope",
".",
"open",
")",
"{",
"$detailsScope",
".",
"$destroy",
"(",
")",
";",
"return",
";",
"}",
"else",
"{",
"$detailsScope",
"=",
"$scope",
".",
"$new",
"(",
")",
";",
"}",
"$detailsTr",
".",
"html",
"(",
"detailsHtml",
")",
";",
"$detailsScope",
".",
"row",
"=",
"$scope",
".",
"row",
";",
"$detailsScope",
".",
"hit",
"=",
"$scope",
".",
"row",
";",
"$detailsScope",
".",
"uriEncodedId",
"=",
"encodeURIComponent",
"(",
"$detailsScope",
".",
"hit",
".",
"_id",
")",
";",
"$compile",
"(",
"$detailsTr",
")",
"(",
"$detailsScope",
")",
";",
"}",
";",
"$scope",
".",
"$watchMulti",
"(",
"[",
"'indexPattern.timeFieldName'",
",",
"'row.highlight'",
",",
"'[]columns'",
"]",
",",
"(",
")",
"=>",
"{",
"createSummaryRow",
"(",
"$scope",
".",
"row",
")",
";",
"}",
")",
";",
"$scope",
".",
"inlineFilter",
"=",
"function",
"inlineFilter",
"(",
"$event",
",",
"type",
")",
"{",
"const",
"column",
"=",
"$",
"(",
"$event",
".",
"currentTarget",
")",
".",
"data",
"(",
")",
".",
"column",
";",
"const",
"field",
"=",
"$scope",
".",
"indexPattern",
".",
"fields",
".",
"getByName",
"(",
"column",
")",
";",
"$scope",
".",
"filter",
"(",
"field",
",",
"$scope",
".",
"flattenedRow",
"[",
"column",
"]",
",",
"type",
")",
";",
"}",
";",
"$scope",
".",
"getContextAppHref",
"=",
"(",
")",
"=>",
"{",
"const",
"globalFilters",
"=",
"getServices",
"(",
")",
".",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
";",
"const",
"appFilters",
"=",
"getServices",
"(",
")",
".",
"filterManager",
".",
"getAppFilters",
"(",
")",
";",
"const",
"hash",
"=",
"stringify",
"(",
"url",
".",
"encodeQuery",
"(",
"{",
"_g",
":",
"rison",
".",
"encode",
"(",
"{",
"filters",
":",
"globalFilters",
"||",
"[",
"]",
",",
"}",
")",
",",
"_a",
":",
"rison",
".",
"encode",
"(",
"{",
"columns",
":",
"$scope",
".",
"columns",
",",
"filters",
":",
"(",
"appFilters",
"||",
"[",
"]",
")",
".",
"map",
"(",
"opensearchFilters",
".",
"disableFilter",
")",
",",
"}",
")",
",",
"}",
")",
",",
"{",
"encode",
":",
"false",
",",
"sort",
":",
"false",
"}",
")",
";",
"return",
"`#/context/${",
"encodeURIComponent",
"(",
"$scope",
".",
"indexPattern",
".",
"id",
")",
"}/${",
"encodeURIComponent",
"(",
"$scope",
".",
"row",
".",
"_id",
")",
"}?${",
"hash",
"}`",
";",
"}",
";",
"function",
"createSummaryRow",
"(",
"row",
")",
"{",
"const",
"indexPattern",
"=",
"$scope",
".",
"indexPattern",
";",
"$scope",
".",
"flattenedRow",
"=",
"indexPattern",
".",
"flattenHit",
"(",
"row",
")",
";",
"const",
"newHtmls",
"=",
"[",
"openRowHtml",
"]",
";",
"const",
"mapping",
"=",
"indexPattern",
".",
"fields",
".",
"getByName",
";",
"const",
"hideTimeColumn",
"=",
"getServices",
"(",
")",
".",
"uiSettings",
".",
"get",
"(",
"DOC_HIDE_TIME_COLUMN_SETTING",
",",
"false",
")",
";",
"if",
"(",
"indexPattern",
".",
"timeFieldName",
"&&",
"!",
"hideTimeColumn",
")",
"{",
"newHtmls",
".",
"push",
"(",
"cellTemplate",
"(",
"{",
"timefield",
":",
"true",
",",
"formatted",
":",
"_displayField",
"(",
"row",
",",
"indexPattern",
".",
"timeFieldName",
")",
",",
"filterable",
":",
"mapping",
"(",
"indexPattern",
".",
"timeFieldName",
")",
".",
"filterable",
"&&",
"$scope",
".",
"filter",
",",
"column",
":",
"indexPattern",
".",
"timeFieldName",
",",
"}",
")",
")",
";",
"}",
"$scope",
".",
"columns",
".",
"forEach",
"(",
"function",
"(",
"column",
")",
"{",
"const",
"isFilterable",
"=",
"mapping",
"(",
"column",
")",
"&&",
"mapping",
"(",
"column",
")",
".",
"filterable",
"&&",
"$scope",
".",
"filter",
";",
"newHtmls",
".",
"push",
"(",
"cellTemplate",
"(",
"{",
"timefield",
":",
"false",
",",
"sourcefield",
":",
"column",
"===",
"'_source'",
",",
"formatted",
":",
"_displayField",
"(",
"row",
",",
"column",
",",
"true",
")",
",",
"filterable",
":",
"isFilterable",
",",
"column",
",",
"}",
")",
")",
";",
"}",
")",
";",
"let",
"$cells",
"=",
"$el",
".",
"children",
"(",
")",
";",
"newHtmls",
".",
"forEach",
"(",
"function",
"(",
"html",
",",
"i",
")",
"{",
"const",
"$cell",
"=",
"$cells",
".",
"eq",
"(",
"i",
")",
";",
"if",
"(",
"$cell",
".",
"data",
"(",
"'discover:html'",
")",
"===",
"html",
")",
"return",
";",
"const",
"reuse",
"=",
"find",
"(",
"$cells",
".",
"slice",
"(",
"i",
"+",
"1",
")",
",",
"function",
"(",
"cell",
")",
"{",
"return",
"$",
".",
"data",
"(",
"cell",
",",
"'discover:html'",
")",
"===",
"html",
";",
"}",
")",
";",
"const",
"$target",
"=",
"reuse",
"?",
"$",
"(",
"reuse",
")",
".",
"detach",
"(",
")",
":",
"$",
"(",
"html",
")",
";",
"$target",
".",
"data",
"(",
"'discover:html'",
",",
"html",
")",
";",
"const",
"$before",
"=",
"$cells",
".",
"eq",
"(",
"i",
"-",
"1",
")",
";",
"if",
"(",
"$before",
".",
"length",
")",
"{",
"$before",
".",
"after",
"(",
"$target",
")",
";",
"}",
"else",
"{",
"$el",
".",
"append",
"(",
"$target",
")",
";",
"}",
"$cells",
"=",
"$el",
".",
"children",
"(",
")",
";",
"if",
"(",
"!",
"reuse",
")",
"{",
"$toggleScope",
"=",
"$scope",
".",
"$new",
"(",
")",
";",
"$compile",
"(",
"$target",
")",
"(",
"$toggleScope",
")",
";",
"}",
"}",
")",
";",
"if",
"(",
"$scope",
".",
"open",
")",
"{",
"$detailsScope",
".",
"row",
"=",
"row",
";",
"}",
"$cells",
".",
"filter",
"(",
"':gt('",
"+",
"(",
"newHtmls",
".",
"length",
"-",
"1",
")",
"+",
"')'",
")",
".",
"remove",
"(",
")",
";",
"dispatchRenderComplete",
"(",
"$el",
"[",
"0",
"]",
")",
";",
"}",
"/**\n * Fill an element with the value of a field\n */",
"function",
"_displayField",
"(",
"row",
",",
"fieldName",
",",
"truncate",
"=",
"false",
")",
"{",
"const",
"indexPattern",
"=",
"$scope",
".",
"indexPattern",
";",
"const",
"text",
"=",
"indexPattern",
".",
"formatField",
"(",
"row",
",",
"fieldName",
")",
";",
"if",
"(",
"truncate",
"&&",
"text",
".",
"length",
">",
"MIN_LINE_LENGTH",
")",
"{",
"return",
"truncateByHeightTemplate",
"(",
"{",
"body",
":",
"text",
",",
"}",
")",
";",
"}",
"return",
"text",
";",
"}",
"}",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
27,
null,
null,
null,
null,
null,
null,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
24377,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5333,
null,
137,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5333,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661544 | [
"import",
"{",
"Pager",
"}",
"from",
"'./pager'",
";",
"export",
"function",
"createPagerFactory",
"(",
")",
"{",
"return",
"{",
"create",
"(",
"...",
"args",
")",
"{",
"return",
"new",
"Pager",
"(",
"...",
"args",
")",
";",
"}",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661545 | [
"import",
"$",
"from",
"'jquery'",
";",
"interface",
"LazyScope",
"extends",
"ng",
".",
"IScope",
"{",
"[",
"key",
"]",
":",
"any",
";",
"}",
"export",
"function",
"createInfiniteScrollDirective",
"(",
")",
"{",
"return",
"{",
"restrict",
":",
"'E'",
",",
"scope",
":",
"{",
"more",
":",
"'='",
",",
"}",
",",
"link",
":",
"(",
"$scope",
",",
"$element",
")",
"=>",
"{",
"const",
"$window",
"=",
"$",
"(",
"window",
")",
";",
"let",
"checkTimer",
";",
"function",
"onScroll",
"(",
")",
"{",
"if",
"(",
"!",
"$scope",
".",
"more",
")",
"return",
";",
"const",
"winHeight",
"=",
"Number",
"(",
"$window",
".",
"height",
"(",
")",
")",
";",
"const",
"winBottom",
"=",
"Number",
"(",
"winHeight",
")",
"+",
"Number",
"(",
"$window",
".",
"scrollTop",
"(",
")",
")",
";",
"const",
"offset",
"=",
"$element",
".",
"offset",
"(",
")",
";",
"const",
"elTop",
"=",
"offset",
"?",
"offset",
".",
"top",
":",
"0",
";",
"const",
"remaining",
"=",
"elTop",
"-",
"winBottom",
";",
"if",
"(",
"remaining",
"<=",
"winHeight",
"*",
"0.5",
")",
"{",
"$scope",
"[",
"$scope",
".",
"$$phase",
"?",
"'$eval'",
":",
"'$apply'",
"]",
"(",
"function",
"(",
")",
"{",
"$scope",
".",
"more",
"(",
")",
";",
"}",
")",
";",
"}",
"}",
"function",
"scheduleCheck",
"(",
")",
"{",
"if",
"(",
"checkTimer",
")",
"return",
";",
"checkTimer",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"checkTimer",
"=",
"null",
";",
"onScroll",
"(",
")",
";",
"}",
",",
"50",
")",
";",
"}",
"$window",
".",
"on",
"(",
"'scroll'",
",",
"scheduleCheck",
")",
";",
"$scope",
".",
"$on",
"(",
"'$destroy'",
",",
"function",
"(",
")",
"{",
"clearTimeout",
"(",
"checkTimer",
")",
";",
"$window",
".",
"off",
"(",
"'scroll'",
",",
"scheduleCheck",
")",
";",
"}",
")",
";",
"scheduleCheck",
"(",
")",
";",
"}",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5333,
null,
137,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661546 | [
"import",
"{",
"IScope",
"}",
"from",
"'angular'",
";",
"import",
"{",
"RenderCompleteListener",
"}",
"from",
"'../../../../../opensearch_dashboards_utils/public'",
";",
"export",
"function",
"createRenderCompleteDirective",
"(",
")",
"{",
"return",
"{",
"controller",
"(",
"$scope",
",",
"$element",
")",
"{",
"const",
"el",
"=",
"$element",
"[",
"0",
"]",
";",
"const",
"renderCompleteListener",
"=",
"new",
"RenderCompleteListener",
"(",
"el",
")",
";",
"$scope",
".",
"$on",
"(",
"'$destroy'",
",",
"renderCompleteListener",
".",
"destroy",
")",
";",
"}",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
4,
null,
3958,
null,
11976,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
35184,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661547 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiCallOut",
",",
"EuiText",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"FAILURE_REASONS",
",",
"LOADING_STATUS",
"}",
"from",
"'../../angular/context/query'",
";",
"export",
"interface",
"ContextErrorMessageProps",
"{",
"/**\n * the status of the loading action\n */",
"status",
":",
"string",
";",
"/**\n * the reason of the error\n */",
"reason",
"?",
":",
"string",
";",
"}",
"export",
"function",
"ContextErrorMessage",
"(",
"{",
"status",
",",
"reason",
"}",
")",
"{",
"if",
"(",
"status",
"!==",
"LOADING_STATUS",
".",
"FAILED",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"EuiCallOut",
"title",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.context.failedToLoadAnchorDocumentDescription\"",
"defaultMessage",
"=",
"\"Failed to load the anchor document\"",
"/",
">",
"}",
"color",
"=",
"\"danger\"",
"iconType",
"=",
"\"alert\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"contextErrorMessageTitle\"",
">",
"<",
"EuiText",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"contextErrorMessageBody\"",
">",
"{",
"reason",
"===",
"FAILURE_REASONS",
".",
"UNKNOWN",
"&&",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.context.reloadPageDescription.reloadOrVisitTextMessage\"",
"defaultMessage",
"=",
"\"Please reload or go back to the document list to select a valid anchor document.\"",
"/",
">",
")",
"}",
"<",
"/EuiText>",
"<",
"/EuiCallOut>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661548 | [
"import",
"{",
"ContextErrorMessage",
"}",
"from",
"'./context_error_message'",
";",
"export",
"function",
"createContextErrorMessageDirective",
"(",
"reactDirective",
")",
"{",
"return",
"reactDirective",
"(",
"ContextErrorMessage",
",",
"[",
"[",
"'status'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'reason'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"]",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661549 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiButtonEmpty",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiText",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"formatNumWithCommas",
"}",
"from",
"'../../helpers'",
";",
"export",
"interface",
"HitsCounterProps",
"{",
"/**\n * the number of query hits\n */",
"hits",
":",
"number",
";",
"/**\n * displays the reset button\n */",
"showResetButton",
":",
"boolean",
";",
"/**\n * resets the query\n */",
"onResetQuery",
":",
"(",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"HitsCounter",
"(",
"{",
"hits",
",",
"showResetButton",
",",
"onResetQuery",
"}",
")",
"{",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"EuiFlexGroup",
"gutterSize",
"=",
"\"s\"",
"className",
"=",
"\"dscResultCount\"",
"responsive",
"=",
"{",
"false",
"}",
"justifyContent",
"=",
"\"center\"",
"alignItems",
"=",
"\"center\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiText",
">",
"<",
"strong",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discoverQueryHits\"",
">",
"{",
"formatNumWithCommas",
"(",
"hits",
")",
"}",
"<",
"/strong>{' '}",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.hitsPluralTitle\"",
"defaultMessage",
"=",
"\"{hits, plural, one {hit} other {hits}}\"",
"values",
"=",
"{",
"{",
"hits",
",",
"}",
"}",
"/>",
"<",
"/EuiText>",
"<",
"/EuiFlexItem>",
"{",
"showResetButton",
"&&",
"(",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButtonEmpty",
"iconType",
"=",
"\"refresh\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"resetSavedSearch\"",
"onClick",
"=",
"{",
"onResetQuery",
"}",
"size",
"=",
"\"s\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.reloadSavedSearchButton'",
",",
"{",
"defaultMessage",
":",
"'Reset search'",
",",
"}",
")",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.reloadSavedSearchButton\"",
"defaultMessage",
"=",
"\"Reset search\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>)}",
"<",
"/EuiFlexGroup>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661550 | [
"import",
"React",
",",
"{",
"useState",
",",
"useEffect",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiToolTip",
",",
"EuiText",
",",
"EuiSelect",
",",
"EuiIconTip",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"moment",
"from",
"'moment'",
";",
"export",
"interface",
"TimechartHeaderProps",
"{",
"/**\n * Format of date to be displayed\n */",
"dateFormat",
"?",
":",
"string",
";",
"/**\n * Interval for the buckets of the recent request\n */",
"bucketInterval",
"?",
":",
"{",
"scaled",
"?",
":",
"boolean",
";",
"description",
"?",
":",
"string",
";",
"scale",
"?",
":",
"number",
";",
"}",
";",
"/**\n * Range of dates to be displayed\n */",
"timeRange",
"?",
":",
"{",
"from",
":",
"string",
";",
"to",
":",
"string",
";",
"}",
";",
"/**\n * Interval Options\n */",
"options",
":",
"Array",
"<",
"{",
"display",
":",
"string",
";",
"val",
":",
"string",
";",
"}",
">",
";",
"/**\n * changes the interval\n */",
"onChangeInterval",
":",
"(",
"interval",
":",
"string",
")",
"=>",
"void",
";",
"/**\n * selected interval\n */",
"stateInterval",
":",
"string",
";",
"}",
"export",
"function",
"TimechartHeader",
"(",
"{",
"bucketInterval",
",",
"dateFormat",
",",
"timeRange",
",",
"options",
",",
"onChangeInterval",
",",
"stateInterval",
",",
"}",
")",
"{",
"const",
"[",
"interval",
",",
"setInterval",
"]",
"=",
"useState",
"(",
"stateInterval",
")",
";",
"const",
"toMoment",
"=",
"useCallback",
"(",
"(",
"datetime",
")",
"=>",
"{",
"if",
"(",
"!",
"datetime",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"!",
"dateFormat",
")",
"{",
"return",
"datetime",
";",
"}",
"return",
"moment",
"(",
"datetime",
")",
".",
"format",
"(",
"dateFormat",
")",
";",
"}",
",",
"[",
"dateFormat",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setInterval",
"(",
"stateInterval",
")",
";",
"}",
",",
"[",
"stateInterval",
"]",
")",
";",
"const",
"handleIntervalChange",
"=",
"(",
"e",
")",
"=>",
"{",
"setInterval",
"(",
"e",
".",
"target",
".",
"value",
")",
";",
"onChangeInterval",
"(",
"e",
".",
"target",
".",
"value",
")",
";",
"}",
";",
"if",
"(",
"!",
"timeRange",
"||",
"!",
"bucketInterval",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"EuiFlexGroup",
"gutterSize",
"=",
"\"s\"",
"responsive",
"justifyContent",
"=",
"\"center\"",
"alignItems",
"=",
"\"center\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiToolTip",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.howToChangeTheTimeTooltip'",
",",
"{",
"defaultMessage",
":",
"'To change the time, use the global time filter above'",
",",
"}",
")",
"}",
"delay",
"=",
"\"long\"",
">",
"<",
"EuiText",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discoverIntervalDateRange\"",
"size",
"=",
"\"s\"",
">",
"{",
"`${",
"toMoment",
"(",
"timeRange",
".",
"from",
")",
"} - ${",
"toMoment",
"(",
"timeRange",
".",
"to",
")",
"} ${",
"interval",
"!==",
"'auto'",
"?",
"i18n",
".",
"translate",
"(",
"'discover.timechartHeader.timeIntervalSelect.per'",
",",
"{",
"defaultMessage",
":",
"'per'",
",",
"}",
")",
":",
"''",
"}`",
"}",
"<",
"/EuiText>",
"<",
"/EuiToolTip>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiSelect",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.timechartHeader.timeIntervalSelect.ariaLabel'",
",",
"{",
"defaultMessage",
":",
"'Time interval'",
",",
"}",
")",
"}",
"compressed",
"id",
"=",
"\"dscResultsIntervalSelector\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discoverIntervalSelect\"",
"options",
"=",
"{",
"options",
".",
"filter",
"(",
"(",
"{",
"val",
"}",
")",
"=>",
"val",
"!==",
"'custom'",
")",
".",
"map",
"(",
"(",
"{",
"display",
",",
"val",
"}",
")",
"=>",
"{",
"return",
"{",
"text",
":",
"display",
",",
"value",
":",
"val",
",",
"label",
":",
"display",
",",
"}",
";",
"}",
")",
"}",
"value",
"=",
"{",
"interval",
"}",
"onChange",
"=",
"{",
"handleIntervalChange",
"}",
"append",
"=",
"{",
"bucketInterval",
".",
"scaled",
"?",
"(",
"<",
"EuiIconTip",
"id",
"=",
"\"discoverIntervalIconTip\"",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.bucketIntervalTooltip'",
",",
"{",
"defaultMessage",
":",
"'This interval creates {bucketsDescription} to show in the selected time range, so it has been scaled to {bucketIntervalDescription}.'",
",",
"values",
":",
"{",
"bucketsDescription",
":",
"bucketInterval",
"!",
".",
"scale",
"&&",
"bucketInterval",
"!",
".",
"scale",
">",
"1",
"?",
"i18n",
".",
"translate",
"(",
"'discover.bucketIntervalTooltip.tooLargeBucketsText'",
",",
"{",
"defaultMessage",
":",
"'buckets that are too large'",
",",
"}",
")",
":",
"i18n",
".",
"translate",
"(",
"'discover.bucketIntervalTooltip.tooManyBucketsText'",
",",
"{",
"defaultMessage",
":",
"'too many buckets'",
",",
"}",
")",
",",
"bucketIntervalDescription",
":",
"bucketInterval",
".",
"description",
",",
"}",
",",
"}",
")",
"}",
"color",
"=",
"\"warning\"",
"size",
"=",
"\"s\"",
"type",
"=",
"\"alert\"",
"/",
">",
")",
":",
"undefined",
"}",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661551 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiProgress",
"}",
"from",
"'@elastic/eui'",
";",
"interface",
"Props",
"{",
"percent",
":",
"number",
";",
"count",
":",
"number",
";",
"value",
":",
"string",
";",
"}",
"export",
"function",
"StringFieldProgressBar",
"(",
"{",
"value",
",",
"percent",
",",
"count",
"}",
")",
"{",
"const",
"ariaLabel",
"=",
"`${",
"value",
"}: ${",
"count",
"} (${",
"percent",
"}%)`",
";",
"return",
"(",
"<",
"EuiProgress",
"value",
"=",
"{",
"percent",
"}",
"max",
"=",
"{",
"100",
"}",
"color",
"=",
"\"secondary\"",
"aria",
"-",
"label",
"=",
"{",
"ariaLabel",
"}",
"size",
"=",
"\"s\"",
"/",
">",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661552 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IndexPatternField",
"}",
"from",
"'../../../../../../data/public'",
";",
"export",
"function",
"getWarnings",
"(",
"field",
")",
"{",
"let",
"warnings",
"=",
"[",
"]",
";",
"if",
"(",
"field",
".",
"scripted",
")",
"{",
"warnings",
".",
"push",
"(",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.discoverField.scriptedFieldsTakeLongExecuteDescription'",
",",
"{",
"defaultMessage",
":",
"'Scripted fields can take a long time to execute.'",
",",
"}",
")",
")",
";",
"}",
"if",
"(",
"warnings",
".",
"length",
">",
"1",
")",
"{",
"warnings",
"=",
"warnings",
".",
"map",
"(",
"function",
"(",
"warning",
",",
"i",
")",
"{",
"return",
"(",
"i",
">",
"0",
"?",
"'\\n'",
":",
"''",
")",
"+",
"(",
"i",
"+",
"1",
")",
"+",
"' - '",
"+",
"warning",
";",
"}",
")",
";",
"}",
"return",
"warnings",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
668,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661553 | [
"import",
"{",
"VISUALIZE_FIELD_TRIGGER",
",",
"VISUALIZE_GEO_FIELD_TRIGGER",
",",
"visualizeFieldTrigger",
",",
"visualizeGeoFieldTrigger",
",",
"}",
"from",
"'../../../../../../ui_actions/public'",
";",
"import",
"{",
"getUiActions",
"}",
"from",
"'../../../../opensearch_dashboards_services'",
";",
"import",
"{",
"IndexPatternField",
",",
"OSD_FIELD_TYPES",
"}",
"from",
"'../../../../../../data/public'",
";",
"function",
"getTriggerConstant",
"(",
"type",
")",
"{",
"return",
"type",
"===",
"OSD_FIELD_TYPES",
".",
"GEO_POINT",
"||",
"type",
"===",
"OSD_FIELD_TYPES",
".",
"GEO_SHAPE",
"?",
"VISUALIZE_GEO_FIELD_TRIGGER",
":",
"VISUALIZE_FIELD_TRIGGER",
";",
"}",
"function",
"getTrigger",
"(",
"type",
")",
"{",
"return",
"type",
"===",
"OSD_FIELD_TYPES",
".",
"GEO_POINT",
"||",
"type",
"===",
"OSD_FIELD_TYPES",
".",
"GEO_SHAPE",
"?",
"visualizeGeoFieldTrigger",
":",
"visualizeFieldTrigger",
";",
"}",
"async",
"function",
"getCompatibleActions",
"(",
"fieldName",
",",
"indexPatternId",
",",
"contextualFields",
",",
"trigger",
")",
"{",
"const",
"compatibleActions",
"=",
"await",
"getUiActions",
"(",
")",
".",
"getTriggerCompatibleActions",
"(",
"trigger",
",",
"{",
"indexPatternId",
",",
"fieldName",
",",
"contextualFields",
",",
"}",
")",
";",
"return",
"compatibleActions",
";",
"}",
"export",
"async",
"function",
"getVisualizeHref",
"(",
"field",
",",
"indexPatternId",
",",
"contextualFields",
")",
"{",
"if",
"(",
"!",
"indexPatternId",
")",
"return",
"undefined",
";",
"const",
"triggerOptions",
"=",
"{",
"indexPatternId",
",",
"fieldName",
":",
"field",
".",
"name",
",",
"contextualFields",
",",
"trigger",
":",
"getTrigger",
"(",
"field",
".",
"type",
")",
",",
"}",
";",
"const",
"compatibleActions",
"=",
"await",
"getCompatibleActions",
"(",
"field",
".",
"name",
",",
"indexPatternId",
",",
"contextualFields",
",",
"getTriggerConstant",
"(",
"field",
".",
"type",
")",
")",
";",
"return",
"compatibleActions",
".",
"length",
"===",
"1",
"?",
"compatibleActions",
"[",
"0",
"]",
".",
"getHref",
"?.",
"(",
"triggerOptions",
")",
":",
"undefined",
";",
"}",
"export",
"function",
"triggerVisualizeActions",
"(",
"field",
",",
"indexPatternId",
",",
"contextualFields",
")",
"{",
"if",
"(",
"!",
"indexPatternId",
")",
"return",
";",
"const",
"trigger",
"=",
"getTriggerConstant",
"(",
"field",
".",
"type",
")",
";",
"const",
"triggerOptions",
"=",
"{",
"indexPatternId",
",",
"fieldName",
":",
"field",
".",
"name",
",",
"contextualFields",
",",
"}",
";",
"getUiActions",
"(",
")",
".",
"getTrigger",
"(",
"trigger",
")",
".",
"exec",
"(",
"triggerOptions",
")",
";",
"}",
"export",
"async",
"function",
"isFieldVisualizable",
"(",
"field",
",",
"indexPatternId",
",",
"contextualFields",
")",
"{",
"if",
"(",
"field",
".",
"name",
"===",
"'_id'",
"||",
"!",
"indexPatternId",
")",
"{",
"return",
"false",
";",
"}",
"const",
"trigger",
"=",
"getTriggerConstant",
"(",
"field",
".",
"type",
")",
";",
"const",
"compatibleActions",
"=",
"await",
"getCompatibleActions",
"(",
"field",
".",
"name",
",",
"indexPatternId",
",",
"contextualFields",
",",
"trigger",
")",
";",
"return",
"compatibleActions",
".",
"length",
">",
"0",
"&&",
"field",
".",
"visualizable",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
2,
null,
2,
null,
5,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
668,
null,
2,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
668,
null,
2,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
668,
null,
2,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661554 | [
"import",
"React",
",",
"{",
"useState",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiLink",
",",
"EuiIconTip",
",",
"EuiText",
",",
"EuiPopoverFooter",
",",
"EuiButton",
",",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"DiscoverFieldBucket",
"}",
"from",
"'./discover_field_bucket'",
";",
"import",
"{",
"getWarnings",
"}",
"from",
"'./lib/get_warnings'",
";",
"import",
"{",
"triggerVisualizeActions",
",",
"isFieldVisualizable",
",",
"getVisualizeHref",
",",
"}",
"from",
"'./lib/visualize_trigger_utils'",
";",
"import",
"{",
"Bucket",
",",
"FieldDetails",
"}",
"from",
"'./types'",
";",
"import",
"{",
"IndexPatternField",
",",
"IndexPattern",
"}",
"from",
"'../../../../../data/public'",
";",
"import",
"'./discover_field_details.scss'",
";",
"interface",
"DiscoverFieldDetailsProps",
"{",
"field",
":",
"IndexPatternField",
";",
"indexPattern",
":",
"IndexPattern",
";",
"details",
":",
"FieldDetails",
";",
"onAddFilter",
":",
"(",
"field",
":",
"IndexPatternField",
"|",
"string",
",",
"value",
":",
"string",
",",
"type",
":",
"'+'",
"|",
"'-'",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"DiscoverFieldDetails",
"(",
"{",
"field",
",",
"indexPattern",
",",
"details",
",",
"onAddFilter",
",",
"}",
")",
"{",
"const",
"warnings",
"=",
"getWarnings",
"(",
"field",
")",
";",
"const",
"[",
"showVisualizeLink",
",",
"setShowVisualizeLink",
"]",
"=",
"useState",
"<",
"boolean",
">",
"(",
"false",
")",
";",
"const",
"[",
"visualizeLink",
",",
"setVisualizeLink",
"]",
"=",
"useState",
"<",
"string",
">",
"(",
"''",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"isFieldVisualizable",
"(",
"field",
",",
"indexPattern",
".",
"id",
",",
"details",
".",
"columns",
")",
".",
"then",
"(",
"(",
"flag",
")",
"=>",
"{",
"setShowVisualizeLink",
"(",
"flag",
")",
";",
"getVisualizeHref",
"(",
"field",
",",
"indexPattern",
".",
"id",
",",
"details",
".",
"columns",
")",
".",
"then",
"(",
"(",
"uri",
")",
"=>",
"{",
"if",
"(",
"uri",
")",
"setVisualizeLink",
"(",
"uri",
")",
";",
"}",
",",
"(",
")",
"=>",
"{",
"setVisualizeLink",
"(",
"''",
")",
";",
"}",
")",
";",
"}",
",",
"(",
")",
"=>",
"{",
"setShowVisualizeLink",
"(",
"false",
")",
";",
"}",
")",
";",
"}",
",",
"[",
"field",
",",
"indexPattern",
".",
"id",
",",
"details",
".",
"columns",
"]",
")",
";",
"const",
"handleVisualizeLinkClick",
"=",
"(",
"event",
")",
"=>",
"{",
"event",
".",
"preventDefault",
"(",
")",
";",
"triggerVisualizeActions",
"(",
"field",
",",
"indexPattern",
".",
"id",
",",
"details",
".",
"columns",
")",
";",
"}",
";",
"return",
"(",
"<",
">",
"<",
"div",
"className",
"=",
"\"dscFieldDetails\"",
">",
"{",
"details",
".",
"error",
"&&",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
">",
"{",
"details",
".",
"error",
"}",
"<",
"/EuiText>}",
"{",
"!",
"details",
".",
"error",
"&&",
"(",
"<",
"div",
"style",
"=",
"{",
"{",
"marginTop",
":",
"'4px'",
"}",
"}",
">",
"{",
"details",
".",
"buckets",
".",
"map",
"(",
"(",
"bucket",
",",
"idx",
")",
"=>",
"(",
"<",
"DiscoverFieldBucket",
"key",
"=",
"{",
"`bucket${",
"idx",
"}`",
"}",
"bucket",
"=",
"{",
"bucket",
"}",
"field",
"=",
"{",
"field",
"}",
"onAddFilter",
"=",
"{",
"onAddFilter",
"}",
"/",
">",
")",
")",
"}",
"<",
"/div>)}",
"{",
"showVisualizeLink",
"&&",
"(",
"<",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"{",
"}",
"<",
"EuiButton",
"onClick",
"=",
"{",
"(",
"e",
")",
"=>",
"handleVisualizeLinkClick",
"(",
"e",
")",
"}",
"href",
"=",
"{",
"visualizeLink",
"}",
"size",
"=",
"\"s\"",
"className",
"=",
"\"dscFieldDetails__visualizeBtn\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`fieldVisualize-${",
"field",
".",
"name",
"}`",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.fieldChooser.detailViews.visualizeLinkText\"",
"defaultMessage",
"=",
"\"Visualize\"",
"/",
">",
"<",
"/EuiButton>",
"{",
"warnings",
".",
"length",
">",
"0",
"&&",
"(",
"<",
"EuiIconTip",
"type",
"=",
"\"alert\"",
"color",
"=",
"\"warning\"",
"content",
"=",
"{",
"warnings",
".",
"join",
"(",
"' '",
")",
"}",
"/",
">",
")",
"}",
"<",
"/>)}",
"<",
"/div>",
"{",
"!",
"details",
".",
"error",
"&&",
"(",
"<",
"EuiPopoverFooter",
">",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
"textAlign",
"=",
"\"center\"",
">",
"{",
"!",
"indexPattern",
".",
"metaFields",
".",
"includes",
"(",
"field",
".",
"name",
")",
"&&",
"!",
"field",
".",
"scripted",
"?",
"(",
"<",
"EuiLink",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onAddFilter",
"(",
"'_exists_'",
",",
"field",
".",
"name",
",",
"'+'",
")",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.fieldChooser.detailViews.existsText\"",
"defaultMessage",
"=",
"\"Exists in\"",
"/",
">",
"{",
"' '",
"}",
"{",
"details",
".",
"exists",
"}",
"<",
"/EuiLink>) : (<span>{details.exists}</span",
">",
")",
"}",
"{",
"' '",
"}",
"/ {details.total}{' '}",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.fieldChooser.detailViews.recordsText\"",
"defaultMessage",
"=",
"\"records\"",
"/",
">",
"<",
"/EuiText>",
"<",
"/EuiPopoverFooter>)}",
"<",
"/>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661555 | [
"import",
"React",
",",
"{",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiPopover",
",",
"EuiPopoverTitle",
",",
"EuiButtonIcon",
",",
"EuiToolTip",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"DiscoverFieldDetails",
"}",
"from",
"'./discover_field_details'",
";",
"import",
"{",
"FieldIcon",
",",
"FieldButton",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"FieldDetails",
"}",
"from",
"'./types'",
";",
"import",
"{",
"IndexPatternField",
",",
"IndexPattern",
"}",
"from",
"'../../../../../data/public'",
";",
"import",
"{",
"shortenDottedString",
"}",
"from",
"'../../helpers'",
";",
"import",
"{",
"getFieldTypeName",
"}",
"from",
"'./lib/get_field_type_name'",
";",
"import",
"'./discover_field.scss'",
";",
"export",
"interface",
"DiscoverFieldProps",
"{",
"/**\n * The displayed field\n */",
"field",
":",
"IndexPatternField",
";",
"/**\n * The currently selected index pattern\n */",
"indexPattern",
":",
"IndexPattern",
";",
"/**\n * Callback to add/select the field\n */",
"onAddField",
":",
"(",
"fieldName",
":",
"string",
")",
"=>",
"void",
";",
"/**\n * Callback to add a filter to filter bar\n */",
"onAddFilter",
":",
"(",
"field",
":",
"IndexPatternField",
"|",
"string",
",",
"value",
":",
"string",
",",
"type",
":",
"'+'",
"|",
"'-'",
")",
"=>",
"void",
";",
"param",
"fieldName",
"onRemoveField",
":",
"(",
"fieldName",
":",
"string",
")",
"=>",
"void",
";",
"/**\n * Retrieve details data for the field\n */",
"getDetails",
":",
"(",
"field",
":",
"IndexPatternField",
")",
"=>",
"FieldDetails",
";",
"/**\n * Determines whether the field is selected\n */",
"selected",
"?",
":",
"boolean",
";",
"/**\n * Determines whether the field name is shortened test.sub1.sub2 = t.s.sub2\n */",
"useShortDots",
"?",
":",
"boolean",
";",
"}",
"export",
"function",
"DiscoverField",
"(",
"{",
"field",
",",
"indexPattern",
",",
"onAddField",
",",
"onRemoveField",
",",
"onAddFilter",
",",
"getDetails",
",",
"selected",
",",
"useShortDots",
",",
"}",
")",
"{",
"const",
"addLabelAria",
"=",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.discoverField.addButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Add {field} to table'",
",",
"values",
":",
"{",
"field",
":",
"field",
".",
"name",
"}",
",",
"}",
")",
";",
"const",
"removeLabelAria",
"=",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.discoverField.removeButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Remove {field} from table'",
",",
"values",
":",
"{",
"field",
":",
"field",
".",
"name",
"}",
",",
"}",
")",
";",
"const",
"[",
"infoIsOpen",
",",
"setOpen",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"toggleDisplay",
"=",
"(",
"f",
")",
"=>",
"{",
"if",
"(",
"selected",
")",
"{",
"onRemoveField",
"(",
"f",
".",
"name",
")",
";",
"}",
"else",
"{",
"onAddField",
"(",
"f",
".",
"name",
")",
";",
"}",
"}",
";",
"function",
"togglePopover",
"(",
")",
"{",
"setOpen",
"(",
"!",
"infoIsOpen",
")",
";",
"}",
"function",
"wrapOnDot",
"(",
"str",
"?",
")",
"{",
"return",
"str",
"?",
"str",
".",
"replace",
"(",
"/\\./g",
",",
"'.\\u200B'",
")",
":",
"''",
";",
"}",
"const",
"dscFieldIcon",
"=",
"(",
"<",
"FieldIcon",
"type",
"=",
"{",
"field",
".",
"type",
"}",
"label",
"=",
"{",
"getFieldTypeName",
"(",
"field",
".",
"type",
")",
"}",
"scripted",
"=",
"{",
"field",
".",
"scripted",
"}",
"/",
">",
")",
";",
"const",
"fieldName",
"=",
"(",
"<",
"span",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`field-${",
"field",
".",
"name",
"}`",
"}",
"title",
"=",
"{",
"field",
".",
"name",
"}",
"className",
"=",
"\"dscSidebarField__name\"",
">",
"{",
"useShortDots",
"?",
"wrapOnDot",
"(",
"shortenDottedString",
"(",
"field",
".",
"name",
")",
")",
":",
"wrapOnDot",
"(",
"field",
".",
"displayName",
")",
"}",
"<",
"/span>);",
"let",
"actionButton",
";",
"if",
"(",
"field",
".",
"name",
"!==",
"'_source'",
"&&",
"!",
"selected",
")",
"{",
"actionButton",
"=",
"(",
"<",
"EuiToolTip",
"delay",
"=",
"\"long\"",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.discoverField.addFieldTooltip'",
",",
"{",
"defaultMessage",
":",
"'Add field as column'",
",",
"}",
")",
"}",
">",
"<",
"EuiButtonIcon",
"iconType",
"=",
"\"plusInCircleFilled\"",
"className",
"=",
"\"dscSidebarItem__action\"",
"onClick",
"=",
"{",
"(",
"ev",
")",
"=>",
"{",
"if",
"(",
"ev",
".",
"type",
"===",
"'click'",
")",
"{",
"ev",
".",
"currentTarget",
".",
"focus",
"(",
")",
";",
"}",
"ev",
".",
"preventDefault",
"(",
")",
";",
"ev",
".",
"stopPropagation",
"(",
")",
";",
"toggleDisplay",
"(",
"field",
")",
";",
"}",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`fieldToggle-${",
"field",
".",
"name",
"}`",
"}",
"aria",
"-",
"label",
"=",
"{",
"addLabelAria",
"}",
"/>",
"<",
"/EuiToolTip>);",
"}",
"else",
"if",
"(",
"field",
".",
"name",
"!==",
"'_source'",
"&&",
"selected",
")",
"{",
"actionButton",
"=",
"(",
"<",
"EuiToolTip",
"delay",
"=",
"\"long\"",
"content",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.discoverField.removeFieldTooltip'",
",",
"{",
"defaultMessage",
":",
"'Remove field from table'",
",",
"}",
")",
"}",
">",
"<",
"EuiButtonIcon",
"color",
"=",
"\"danger\"",
"iconType",
"=",
"\"cross\"",
"className",
"=",
"\"dscSidebarItem__action\"",
"onClick",
"=",
"{",
"(",
"ev",
")",
"=>",
"{",
"if",
"(",
"ev",
".",
"type",
"===",
"'click'",
")",
"{",
"ev",
".",
"currentTarget",
".",
"focus",
"(",
")",
";",
"}",
"ev",
".",
"preventDefault",
"(",
")",
";",
"ev",
".",
"stopPropagation",
"(",
")",
";",
"toggleDisplay",
"(",
"field",
")",
";",
"}",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`fieldToggle-${",
"field",
".",
"name",
"}`",
"}",
"aria",
"-",
"label",
"=",
"{",
"removeLabelAria",
"}",
"/>",
"<",
"/EuiToolTip>);",
"}",
"if",
"(",
"field",
".",
"type",
"===",
"'_source'",
")",
"{",
"return",
"(",
"<",
"FieldButton",
"size",
"=",
"\"s\"",
"className",
"=",
"\"dscSidebarItem\"",
"dataTestSubj",
"=",
"{",
"`field-${",
"field",
".",
"name",
"}-showDetails`",
"}",
"fieldIcon",
"=",
"{",
"dscFieldIcon",
"}",
"fieldAction",
"=",
"{",
"actionButton",
"}",
"fieldName",
"=",
"{",
"fieldName",
"}",
"/",
">",
")",
";",
"}",
"return",
"(",
"<",
"EuiPopover",
"ownFocus",
"display",
"=",
"\"block\"",
"button",
"=",
"{",
"<",
"FieldButton",
"size",
"=",
"\"s\"",
"className",
"=",
"\"dscSidebarItem\"",
"isActive",
"=",
"{",
"infoIsOpen",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"{",
"togglePopover",
"(",
")",
";",
"}",
"}",
"dataTestSubj",
"=",
"{",
"`field-${",
"field",
".",
"name",
"}-showDetails`",
"}",
"fieldIcon",
"=",
"{",
"dscFieldIcon",
"}",
"fieldAction",
"=",
"{",
"actionButton",
"}",
"fieldName",
"=",
"{",
"fieldName",
"}",
"/",
">",
"}",
"isOpen",
"=",
"{",
"infoIsOpen",
"}",
"closePopover",
"=",
"{",
"(",
")",
"=>",
"setOpen",
"(",
"false",
")",
"}",
"anchorPosition",
"=",
"\"rightUp\"",
"panelClassName",
"=",
"\"dscSidebarItem__fieldPopoverPanel\"",
">",
"<",
"EuiPopoverTitle",
">",
"{",
"' '",
"}",
"{",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.discoverField.fieldTopValuesLabel'",
",",
"{",
"defaultMessage",
":",
"'Top 5 values'",
",",
"}",
")",
"}",
"<",
"/EuiPopoverTitle>",
"{",
"infoIsOpen",
"&&",
"(",
"<",
"DiscoverFieldDetails",
"indexPattern",
"=",
"{",
"indexPattern",
"}",
"field",
"=",
"{",
"field",
"}",
"details",
"=",
"{",
"getDetails",
"(",
"field",
")",
"}",
"onAddFilter",
"=",
"{",
"onAddFilter",
"}",
"/",
">",
")",
"}",
"<",
"/EuiPopover>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661556 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"React",
",",
"{",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiButtonEmpty",
",",
"EuiPopover",
",",
"EuiPopoverTitle",
",",
"EuiSelectable",
",",
"EuiButtonEmptyProps",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"EuiSelectableProps",
"}",
"from",
"'@elastic/eui/src/components/selectable/selectable'",
";",
"import",
"{",
"IndexPatternRef",
"}",
"from",
"'./types'",
";",
"export",
"type",
"ChangeIndexPatternTriggerProps",
"=",
"EuiButtonEmptyProps",
"&",
"{",
"label",
":",
"string",
";",
"title",
"?",
":",
"string",
";",
"}",
";",
"export",
"function",
"ChangeIndexPattern",
"(",
"{",
"indexPatternRefs",
",",
"indexPatternId",
",",
"onChangeIndexPattern",
",",
"trigger",
",",
"selectableProps",
",",
"}",
")",
"{",
"const",
"[",
"isPopoverOpen",
",",
"setPopoverIsOpen",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"createTrigger",
"=",
"function",
"(",
")",
"{",
"const",
"{",
"label",
",",
"title",
",",
"...",
"rest",
"}",
"=",
"trigger",
";",
"return",
"(",
"<",
"EuiButtonEmpty",
"className",
"=",
"\"eui-textTruncate\"",
"flush",
"=",
"\"left\"",
"color",
"=",
"\"text\"",
"iconSide",
"=",
"\"right\"",
"iconType",
"=",
"\"arrowDown\"",
"title",
"=",
"{",
"title",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"setPopoverIsOpen",
"(",
"!",
"isPopoverOpen",
")",
"}",
"{",
"...",
"rest",
"}",
">",
"{",
"label",
"}",
"<",
"/EuiButtonEmpty>);",
"}",
";",
"return",
"(",
"<",
"EuiPopover",
"button",
"=",
"{",
"createTrigger",
"(",
")",
"}",
"isOpen",
"=",
"{",
"isPopoverOpen",
"}",
"closePopover",
"=",
"{",
"(",
")",
"=>",
"setPopoverIsOpen",
"(",
"false",
")",
"}",
"className",
"=",
"\"eui-textTruncate\"",
"anchorClassName",
"=",
"\"eui-textTruncate\"",
"display",
"=",
"\"block\"",
"panelPaddingSize",
"=",
"\"s\"",
"ownFocus",
">",
"<",
"div",
"style",
"=",
"{",
"{",
"width",
":",
"320",
"}",
"}",
">",
"<",
"EuiPopoverTitle",
">",
"{",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.indexPattern.changeIndexPatternTitle'",
",",
"{",
"defaultMessage",
":",
"'Change index pattern'",
",",
"}",
")",
"}",
"<",
"/EuiPopoverTitle>",
"<",
"EuiSelectable",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"indexPattern-switcher\"",
"{",
"...",
"selectableProps",
"}",
"searchable",
"singleSelection",
"=",
"\"always\"",
"options",
"=",
"{",
"indexPatternRefs",
".",
"map",
"(",
"(",
"{",
"title",
",",
"id",
"}",
")",
"=>",
"(",
"{",
"label",
":",
"title",
",",
"key",
":",
"id",
",",
"value",
":",
"id",
",",
"checked",
":",
"id",
"===",
"indexPatternId",
"?",
"'on'",
":",
"undefined",
",",
"}",
")",
")",
"}",
"onChange",
"=",
"{",
"(",
"choices",
")",
"=>",
"{",
"const",
"choice",
"=",
"(",
"choices",
".",
"find",
"(",
"(",
"{",
"checked",
"}",
")",
"=>",
"checked",
")",
"as",
"unknown",
")",
"as",
"{",
"value",
":",
"string",
";",
"}",
";",
"onChangeIndexPattern",
"(",
"choice",
".",
"value",
")",
";",
"setPopoverIsOpen",
"(",
"false",
")",
";",
"}",
"}",
"searchProps",
"=",
"{",
"{",
"compressed",
":",
"true",
",",
"...",
"(",
"selectableProps",
"?",
"selectableProps",
".",
"searchProps",
":",
"undefined",
")",
",",
"}",
"}",
">",
"{",
"(",
"list",
",",
"search",
")",
"=>",
"(",
"<",
">",
"{",
"search",
"}",
"{",
"list",
"}",
"<",
"/>)}",
"<",
"/EuiSelectable>",
"<",
"/div>",
"<",
"/EuiPopover>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661557 | [
"import",
"React",
",",
"{",
"useState",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"IIndexPattern",
",",
"IndexPatternAttributes",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"IndexPatternRef",
"}",
"from",
"'./types'",
";",
"import",
"{",
"ChangeIndexPattern",
"}",
"from",
"'./change_indexpattern'",
";",
"export",
"interface",
"DiscoverIndexPatternProps",
"{",
"/**\n * list of available index patterns, if length > 1, component offers a \"change\" link\n */",
"indexPatternList",
":",
"Array",
"<",
"SavedObject",
"<",
"IndexPatternAttributes",
">",
">",
";",
"/**\n * currently selected index pattern, due to angular issues it's undefined at first rendering\n */",
"selectedIndexPattern",
":",
"IIndexPattern",
";",
"/**\n * triggered when user selects a new index pattern\n */",
"setIndexPattern",
":",
"(",
"id",
":",
"string",
")",
"=>",
"void",
";",
"}",
"/**\n * Component allows you to select an index pattern in discovers side bar\n */",
"export",
"function",
"DiscoverIndexPattern",
"(",
"{",
"indexPatternList",
",",
"selectedIndexPattern",
",",
"setIndexPattern",
",",
"}",
")",
"{",
"const",
"options",
"=",
"(",
"indexPatternList",
"||",
"[",
"]",
")",
".",
"map",
"(",
"(",
"entity",
")",
"=>",
"(",
"{",
"id",
":",
"entity",
".",
"id",
",",
"title",
":",
"entity",
".",
"attributes",
"!",
".",
"title",
",",
"}",
")",
")",
";",
"const",
"{",
"id",
":",
"selectedId",
",",
"title",
":",
"selectedTitle",
"}",
"=",
"selectedIndexPattern",
"||",
"{",
"}",
";",
"const",
"[",
"selected",
",",
"setSelected",
"]",
"=",
"useState",
"(",
"{",
"id",
":",
"selectedId",
",",
"title",
":",
"selectedTitle",
"||",
"''",
",",
"}",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"id",
",",
"title",
"}",
"=",
"selectedIndexPattern",
";",
"setSelected",
"(",
"{",
"id",
",",
"title",
"}",
")",
";",
"}",
",",
"[",
"selectedIndexPattern",
"]",
")",
";",
"if",
"(",
"!",
"selectedId",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"div",
"className",
"=",
"\"dscIndexPattern__container\"",
">",
"<",
"I18nProvider",
">",
"<",
"ChangeIndexPattern",
"trigger",
"=",
"{",
"{",
"label",
":",
"selected",
".",
"title",
",",
"title",
":",
"selected",
".",
"title",
",",
"'data-test-subj'",
":",
"'indexPattern-switch-link'",
",",
"className",
":",
"'dscIndexPattern__triggerButton'",
",",
"}",
"}",
"indexPatternId",
"=",
"{",
"selected",
".",
"id",
"}",
"indexPatternRefs",
"=",
"{",
"options",
"}",
"onChangeIndexPattern",
"=",
"{",
"(",
"id",
")",
"=>",
"{",
"const",
"indexPattern",
"=",
"options",
".",
"find",
"(",
"(",
"pattern",
")",
"=>",
"pattern",
".",
"id",
"===",
"id",
")",
";",
"if",
"(",
"indexPattern",
")",
"{",
"setIndexPattern",
"(",
"id",
")",
";",
"setSelected",
"(",
"indexPattern",
")",
";",
"}",
"}",
"}",
"/>",
"<",
"/I18nProvider>",
"<",
"/div>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661558 | [
"import",
"{",
"IndexPatternField",
"}",
"from",
"'../../../../../../data/public'",
";",
"export",
"interface",
"FieldFilterState",
"{",
"missing",
":",
"boolean",
";",
"type",
":",
"string",
";",
"name",
":",
"string",
";",
"aggregatable",
":",
"null",
"|",
"boolean",
";",
"searchable",
":",
"null",
"|",
"boolean",
";",
"}",
"export",
"function",
"getDefaultFieldFilter",
"(",
")",
"{",
"return",
"{",
"missing",
":",
"true",
",",
"type",
":",
"'any'",
",",
"name",
":",
"''",
",",
"aggregatable",
":",
"null",
",",
"searchable",
":",
"null",
",",
"}",
";",
"}",
"export",
"function",
"setFieldFilterProp",
"(",
"state",
",",
"name",
",",
"value",
")",
"{",
"const",
"newState",
"=",
"{",
"...",
"state",
"}",
";",
"if",
"(",
"name",
"===",
"'missing'",
")",
"{",
"newState",
".",
"missing",
"=",
"Boolean",
"(",
"value",
")",
";",
"}",
"else",
"if",
"(",
"name",
"===",
"'aggregatable'",
")",
"{",
"newState",
".",
"aggregatable",
"=",
"typeof",
"value",
"!==",
"'boolean'",
"?",
"null",
":",
"value",
";",
"}",
"else",
"if",
"(",
"name",
"===",
"'searchable'",
")",
"{",
"newState",
".",
"searchable",
"=",
"typeof",
"value",
"!==",
"'boolean'",
"?",
"null",
":",
"value",
";",
"}",
"else",
"if",
"(",
"name",
"===",
"'name'",
")",
"{",
"newState",
".",
"name",
"=",
"String",
"(",
"value",
")",
";",
"}",
"else",
"if",
"(",
"name",
"===",
"'type'",
")",
"{",
"newState",
".",
"type",
"=",
"String",
"(",
"value",
")",
";",
"}",
"return",
"newState",
";",
"}",
"export",
"function",
"isFieldFiltered",
"(",
"field",
",",
"filterState",
",",
"fieldCounts",
")",
"{",
"const",
"matchFilter",
"=",
"filterState",
".",
"type",
"===",
"'any'",
"||",
"field",
".",
"type",
"===",
"filterState",
".",
"type",
";",
"const",
"isAggregatable",
"=",
"filterState",
".",
"aggregatable",
"===",
"null",
"||",
"field",
".",
"aggregatable",
"===",
"filterState",
".",
"aggregatable",
";",
"const",
"isSearchable",
"=",
"filterState",
".",
"searchable",
"===",
"null",
"||",
"field",
".",
"searchable",
"===",
"filterState",
".",
"searchable",
";",
"const",
"scriptedOrMissing",
"=",
"!",
"filterState",
".",
"missing",
"||",
"field",
".",
"type",
"===",
"'_source'",
"||",
"field",
".",
"scripted",
"||",
"fieldCounts",
"[",
"field",
".",
"name",
"]",
">",
"0",
";",
"const",
"matchName",
"=",
"!",
"filterState",
".",
"name",
"||",
"field",
".",
"name",
".",
"indexOf",
"(",
"filterState",
".",
"name",
")",
"!==",
"-",
"1",
";",
"return",
"matchFilter",
"&&",
"isAggregatable",
"&&",
"isSearchable",
"&&",
"scriptedOrMissing",
"&&",
"matchName",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5259,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5259,
null,
5259,
null,
2,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
668,
null,
5259,
null,
17,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661559 | [
"import",
"{",
"IndexPatternField",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"FieldFilterState",
",",
"isFieldFiltered",
"}",
"from",
"'./field_filter'",
";",
"interface",
"GroupedFields",
"{",
"selected",
":",
"IndexPatternField",
"[",
"]",
";",
"popular",
":",
"IndexPatternField",
"[",
"]",
";",
"unpopular",
":",
"IndexPatternField",
"[",
"]",
";",
"}",
"/**\n * group the fields into selected, popular and unpopular, filter by fieldFilterState\n */",
"export",
"function",
"groupFields",
"(",
"fields",
",",
"columns",
",",
"popularLimit",
",",
"fieldCounts",
",",
"fieldFilterState",
")",
"{",
"const",
"result",
"=",
"{",
"selected",
":",
"[",
"]",
",",
"popular",
":",
"[",
"]",
",",
"unpopular",
":",
"[",
"]",
",",
"}",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"fields",
")",
"||",
"!",
"Array",
".",
"isArray",
"(",
"columns",
")",
"||",
"typeof",
"fieldCounts",
"!==",
"'object'",
")",
"{",
"return",
"result",
";",
"}",
"const",
"popular",
"=",
"fields",
".",
"filter",
"(",
"(",
"field",
")",
"=>",
"!",
"columns",
".",
"includes",
"(",
"field",
".",
"name",
")",
"&&",
"field",
".",
"count",
")",
".",
"sort",
"(",
"(",
"a",
",",
"b",
")",
"=>",
"(",
"b",
".",
"count",
"||",
"0",
")",
"-",
"(",
"a",
".",
"count",
"||",
"0",
")",
")",
".",
"map",
"(",
"(",
"field",
")",
"=>",
"field",
".",
"name",
")",
".",
"slice",
"(",
"0",
",",
"popularLimit",
")",
";",
"const",
"compareFn",
"=",
"(",
"a",
",",
"b",
")",
"=>",
"{",
"if",
"(",
"!",
"a",
".",
"displayName",
")",
"{",
"return",
"0",
";",
"}",
"return",
"a",
".",
"displayName",
".",
"localeCompare",
"(",
"b",
".",
"displayName",
"||",
"''",
")",
";",
"}",
";",
"const",
"fieldsSorted",
"=",
"fields",
".",
"sort",
"(",
"compareFn",
")",
";",
"for",
"(",
"const",
"field",
"of",
"fieldsSorted",
")",
"{",
"if",
"(",
"!",
"isFieldFiltered",
"(",
"field",
",",
"fieldFilterState",
",",
"fieldCounts",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"columns",
".",
"includes",
"(",
"field",
".",
"name",
")",
")",
"{",
"result",
".",
"selected",
".",
"push",
"(",
"field",
")",
";",
"}",
"else",
"if",
"(",
"popular",
".",
"includes",
"(",
"field",
".",
"name",
")",
"&&",
"field",
".",
"type",
"!==",
"'_source'",
")",
"{",
"result",
".",
"popular",
".",
"push",
"(",
"field",
")",
";",
"}",
"else",
"if",
"(",
"field",
".",
"type",
"!==",
"'_source'",
")",
"{",
"result",
".",
"unpopular",
".",
"push",
"(",
"field",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9634,
null,
5,
null,
5,
null,
3,
null,
17,
null,
5259,
null,
null,
null,
9634,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
668,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
668,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661560 | [
"import",
"{",
"difference",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"IndexPattern",
",",
"IndexPatternField",
"}",
"from",
"'src/plugins/data/public'",
";",
"export",
"function",
"getIndexPatternFieldList",
"(",
"indexPattern",
"?",
",",
"fieldCounts",
"?",
")",
"{",
"if",
"(",
"!",
"indexPattern",
"||",
"!",
"fieldCounts",
")",
"return",
"[",
"]",
";",
"const",
"fieldNamesInDocs",
"=",
"Object",
".",
"keys",
"(",
"fieldCounts",
")",
";",
"const",
"fieldNamesInIndexPattern",
"=",
"indexPattern",
".",
"fields",
".",
"getAll",
"(",
")",
".",
"map",
"(",
"(",
"fld",
")",
"=>",
"fld",
".",
"name",
")",
";",
"const",
"unknownTypes",
"=",
"[",
"]",
";",
"difference",
"(",
"fieldNamesInDocs",
",",
"fieldNamesInIndexPattern",
")",
".",
"forEach",
"(",
"(",
"unknownFieldName",
")",
"=>",
"{",
"unknownTypes",
".",
"push",
"(",
"{",
"displayName",
":",
"String",
"(",
"unknownFieldName",
")",
",",
"name",
":",
"String",
"(",
"unknownFieldName",
")",
",",
"type",
":",
"'unknown'",
",",
"}",
"as",
"IndexPatternField",
")",
";",
"}",
")",
";",
"return",
"[",
"...",
"indexPattern",
".",
"fields",
".",
"getAll",
"(",
")",
",",
"...",
"unknownTypes",
"]",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
584,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
668,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661561 | [
"import",
"'./discover_sidebar.scss'",
";",
"import",
"React",
",",
"{",
"useCallback",
",",
"useEffect",
",",
"useState",
",",
"useMemo",
"}",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"EuiButtonIcon",
",",
"EuiTitle",
",",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"sortBy",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"DiscoverField",
"}",
"from",
"'./discover_field'",
";",
"import",
"{",
"DiscoverIndexPattern",
"}",
"from",
"'./discover_index_pattern'",
";",
"import",
"{",
"DiscoverFieldSearch",
"}",
"from",
"'./discover_field_search'",
";",
"import",
"{",
"IndexPatternAttributes",
"}",
"from",
"'../../../../../data/common'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'../../../../../../core/types'",
";",
"import",
"{",
"FIELDS_LIMIT_SETTING",
"}",
"from",
"'../../../../common'",
";",
"import",
"{",
"groupFields",
"}",
"from",
"'./lib/group_fields'",
";",
"import",
"{",
"IndexPatternField",
",",
"IndexPattern",
",",
"UI_SETTINGS",
"}",
"from",
"'../../../../../data/public'",
";",
"import",
"{",
"getDetails",
"}",
"from",
"'./lib/get_details'",
";",
"import",
"{",
"getDefaultFieldFilter",
",",
"setFieldFilterProp",
"}",
"from",
"'./lib/field_filter'",
";",
"import",
"{",
"getIndexPatternFieldList",
"}",
"from",
"'./lib/get_index_pattern_field_list'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../../../opensearch_dashboards_services'",
";",
"export",
"interface",
"DiscoverSidebarProps",
"{",
"/**\n * the selected columns displayed in the doc table in discover\n */",
"columns",
":",
"string",
"[",
"]",
";",
"/**\n * a statistics of the distribution of fields in the given hits\n */",
"fieldCounts",
":",
"Record",
"<",
"string",
",",
"number",
">",
";",
"/**\n * hits fetched from OpenSearch, displayed in the doc table\n */",
"hits",
":",
"Array",
"<",
"Record",
"<",
"string",
",",
"unknown",
">",
">",
";",
"/**\n * List of available index patterns\n */",
"indexPatternList",
":",
"Array",
"<",
"SavedObject",
"<",
"IndexPatternAttributes",
">",
">",
";",
"/**\n * Callback function when selecting a field\n */",
"onAddField",
":",
"(",
"fieldName",
":",
"string",
")",
"=>",
"void",
";",
"/**\n * Callback function when adding a filter from sidebar\n */",
"onAddFilter",
":",
"(",
"field",
":",
"IndexPatternField",
"|",
"string",
",",
"value",
":",
"string",
",",
"type",
":",
"'+'",
"|",
"'-'",
")",
"=>",
"void",
";",
"param",
"fieldName",
"onRemoveField",
":",
"(",
"fieldName",
":",
"string",
")",
"=>",
"void",
";",
"/**\n * Currently selected index pattern\n */",
"selectedIndexPattern",
"?",
":",
"IndexPattern",
";",
"/**\n * Callback function to select another index pattern\n */",
"setIndexPattern",
":",
"(",
"id",
":",
"string",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"DiscoverSidebar",
"(",
"{",
"columns",
",",
"fieldCounts",
",",
"hits",
",",
"indexPatternList",
",",
"onAddField",
",",
"onAddFilter",
",",
"onRemoveField",
",",
"selectedIndexPattern",
",",
"setIndexPattern",
",",
"}",
")",
"{",
"const",
"[",
"showFields",
",",
"setShowFields",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"[",
"fields",
",",
"setFields",
"]",
"=",
"useState",
"<",
"IndexPatternField",
"[",
"]",
"|",
"null",
">",
"(",
"null",
")",
";",
"const",
"[",
"fieldFilterState",
",",
"setFieldFilterState",
"]",
"=",
"useState",
"(",
"getDefaultFieldFilter",
"(",
")",
")",
";",
"const",
"services",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"getServices",
"(",
")",
",",
"[",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"newFields",
"=",
"getIndexPatternFieldList",
"(",
"selectedIndexPattern",
",",
"fieldCounts",
")",
";",
"setFields",
"(",
"newFields",
")",
";",
"}",
",",
"[",
"selectedIndexPattern",
",",
"fieldCounts",
",",
"hits",
",",
"services",
"]",
")",
";",
"const",
"onChangeFieldSearch",
"=",
"useCallback",
"(",
"(",
"field",
",",
"value",
")",
"=>",
"{",
"const",
"newState",
"=",
"setFieldFilterProp",
"(",
"fieldFilterState",
",",
"field",
",",
"value",
")",
";",
"setFieldFilterState",
"(",
"newState",
")",
";",
"}",
",",
"[",
"fieldFilterState",
"]",
")",
";",
"const",
"getDetailsByField",
"=",
"useCallback",
"(",
"(",
"ipField",
")",
"=>",
"getDetails",
"(",
"ipField",
",",
"hits",
",",
"columns",
",",
"selectedIndexPattern",
")",
",",
"[",
"hits",
",",
"columns",
",",
"selectedIndexPattern",
"]",
")",
";",
"const",
"popularLimit",
"=",
"services",
".",
"uiSettings",
".",
"get",
"(",
"FIELDS_LIMIT_SETTING",
")",
";",
"const",
"useShortDots",
"=",
"services",
".",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"SHORT_DOTS_ENABLE",
")",
";",
"const",
"{",
"selected",
":",
"selectedFields",
",",
"popular",
":",
"popularFields",
",",
"unpopular",
":",
"unpopularFields",
",",
"}",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"groupFields",
"(",
"fields",
",",
"columns",
",",
"popularLimit",
",",
"fieldCounts",
",",
"fieldFilterState",
")",
",",
"[",
"fields",
",",
"columns",
",",
"popularLimit",
",",
"fieldCounts",
",",
"fieldFilterState",
",",
"]",
")",
";",
"const",
"fieldTypes",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"{",
"const",
"result",
"=",
"[",
"'any'",
"]",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"fields",
")",
")",
"{",
"for",
"(",
"const",
"field",
"of",
"fields",
")",
"{",
"if",
"(",
"result",
".",
"indexOf",
"(",
"field",
".",
"type",
")",
"===",
"-",
"1",
")",
"{",
"result",
".",
"push",
"(",
"field",
".",
"type",
")",
";",
"}",
"}",
"}",
"return",
"result",
";",
"}",
",",
"[",
"fields",
"]",
")",
";",
"if",
"(",
"!",
"selectedIndexPattern",
"||",
"!",
"fields",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"section",
"className",
"=",
"\"sidebar-list\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.filter.indexAndFieldsSectionAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Index and fields'",
",",
"}",
")",
"}",
">",
"<",
"DiscoverIndexPattern",
"selectedIndexPattern",
"=",
"{",
"selectedIndexPattern",
"}",
"setIndexPattern",
"=",
"{",
"setIndexPattern",
"}",
"indexPatternList",
"=",
"{",
"sortBy",
"(",
"indexPatternList",
",",
"(",
"o",
")",
"=>",
"o",
".",
"attributes",
".",
"title",
")",
"}",
"/>",
"<",
"div",
"className",
"=",
"\"dscSidebar__item\"",
">",
"<",
"form",
">",
"<",
"DiscoverFieldSearch",
"onChange",
"=",
"{",
"onChangeFieldSearch",
"}",
"value",
"=",
"{",
"fieldFilterState",
".",
"name",
"}",
"types",
"=",
"{",
"fieldTypes",
"}",
"/",
">",
"<",
"/form>",
"<",
"/div>",
"<",
"div",
"className",
"=",
"\"sidebar-list\"",
">",
"{",
"fields",
".",
"length",
">",
"0",
"&&",
"(",
"<",
">",
"<",
"EuiTitle",
"size",
"=",
"\"xxxs\"",
"id",
"=",
"\"selected_fields\"",
">",
"<",
"h3",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.fieldChooser.filter.selectedFieldsTitle\"",
"defaultMessage",
"=",
"\"Selected fields\"",
"/",
">",
"<",
"/h3>",
"<",
"/EuiTitle>",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"<",
"ul",
"className",
"=",
"\"dscSidebarList dscFieldList--selected\"",
"aria",
"-",
"labelledby",
"=",
"\"selected_fields\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`fieldList-selected`",
"}",
">",
"{",
"selectedFields",
".",
"map",
"(",
"(",
"field",
")",
"=>",
"{",
"return",
"(",
"<",
"li",
"key",
"=",
"{",
"`field${",
"field",
".",
"name",
"}`",
"}",
"data",
"-",
"attr",
"-",
"field",
"=",
"{",
"field",
".",
"name",
"}",
"className",
"=",
"\"dscSidebar__item\"",
">",
"<",
"DiscoverField",
"field",
"=",
"{",
"field",
"}",
"indexPattern",
"=",
"{",
"selectedIndexPattern",
"}",
"onAddField",
"=",
"{",
"onAddField",
"}",
"onRemoveField",
"=",
"{",
"onRemoveField",
"}",
"onAddFilter",
"=",
"{",
"onAddFilter",
"}",
"getDetails",
"=",
"{",
"getDetailsByField",
"}",
"selected",
"=",
"{",
"true",
"}",
"useShortDots",
"=",
"{",
"useShortDots",
"}",
"/",
">",
"<",
"/li>);",
"}",
")",
"}",
"<",
"/ul>",
"<",
"div",
"className",
"=",
"\"euiFlexGroup euiFlexGroup--gutterMedium\"",
">",
"<",
"EuiTitle",
"size",
"=",
"\"xxxs\"",
"id",
"=",
"\"available_fields\"",
"className",
"=",
"\"euiFlexItem\"",
">",
"<",
"h3",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.fieldChooser.filter.availableFieldsTitle\"",
"defaultMessage",
"=",
"\"Available fields\"",
"/",
">",
"<",
"/h3>",
"<",
"/EuiTitle>",
"<",
"div",
"className",
"=",
"\"euiFlexItem euiFlexItem--flexGrowZero\"",
">",
"<",
"EuiButtonIcon",
"className",
"=",
"{",
"'visible-xs visible-sm dscFieldChooser__toggle'",
"}",
"iconType",
"=",
"{",
"showFields",
"?",
"'arrowDown'",
":",
"'arrowRight'",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"setShowFields",
"(",
"!",
"showFields",
")",
"}",
"aria",
"-",
"label",
"=",
"{",
"showFields",
"?",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.filter.indexAndFieldsSectionHideAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Hide fields'",
",",
"}",
")",
":",
"i18n",
".",
"translate",
"(",
"'discover.fieldChooser.filter.indexAndFieldsSectionShowAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Show fields'",
",",
"}",
")",
"}",
"/>",
"<",
"/div>",
"<",
"/div>",
"<",
"/>)}",
"{",
"popularFields",
".",
"length",
">",
"0",
"&&",
"(",
"<",
"div",
">",
"<",
"EuiTitle",
"size",
"=",
"\"xxxs\"",
"className",
"=",
"{",
"`dscFieldListHeader ${",
"!",
"showFields",
"?",
"'hidden-sm hidden-xs'",
":",
"''",
"}`",
"}",
">",
"<",
"h4",
"style",
"=",
"{",
"{",
"fontWeight",
":",
"'normal'",
"}",
"}",
"id",
"=",
"\"available_fields_popular\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.fieldChooser.filter.popularTitle\"",
"defaultMessage",
"=",
"\"Popular\"",
"/",
">",
"<",
"/h4>",
"<",
"/EuiTitle>",
"<",
"ul",
"className",
"=",
"{",
"`dscFieldList dscFieldList--popular ${",
"!",
"showFields",
"?",
"'hidden-sm hidden-xs'",
":",
"''",
"}`",
"}",
"aria",
"-",
"labelledby",
"=",
"\"available_fields available_fields_popular\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`fieldList-popular`",
"}",
">",
"{",
"popularFields",
".",
"map",
"(",
"(",
"field",
")",
"=>",
"{",
"return",
"(",
"<",
"li",
"key",
"=",
"{",
"`field${",
"field",
".",
"name",
"}`",
"}",
"data",
"-",
"attr",
"-",
"field",
"=",
"{",
"field",
".",
"name",
"}",
"className",
"=",
"\"dscSidebar__item\"",
">",
"<",
"DiscoverField",
"field",
"=",
"{",
"field",
"}",
"indexPattern",
"=",
"{",
"selectedIndexPattern",
"}",
"onAddField",
"=",
"{",
"onAddField",
"}",
"onRemoveField",
"=",
"{",
"onRemoveField",
"}",
"onAddFilter",
"=",
"{",
"onAddFilter",
"}",
"getDetails",
"=",
"{",
"getDetailsByField",
"}",
"useShortDots",
"=",
"{",
"useShortDots",
"}",
"/",
">",
"<",
"/li>);",
"}",
")",
"}",
"<",
"/ul>",
"<",
"/div>)}",
"<",
"ul",
"className",
"=",
"{",
"`dscFieldList dscFieldList--unpopular ${",
"!",
"showFields",
"?",
"'hidden-sm hidden-xs'",
":",
"''",
"}`",
"}",
"aria",
"-",
"labelledby",
"=",
"\"available_fields\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`fieldList-unpopular`",
"}",
">",
"{",
"unpopularFields",
".",
"map",
"(",
"(",
"field",
")",
"=>",
"{",
"return",
"(",
"<",
"li",
"key",
"=",
"{",
"`field${",
"field",
".",
"name",
"}`",
"}",
"data",
"-",
"attr",
"-",
"field",
"=",
"{",
"field",
".",
"name",
"}",
"className",
"=",
"\"dscSidebar__item\"",
">",
"<",
"DiscoverField",
"field",
"=",
"{",
"field",
"}",
"indexPattern",
"=",
"{",
"selectedIndexPattern",
"}",
"onAddField",
"=",
"{",
"onAddField",
"}",
"onRemoveField",
"=",
"{",
"onRemoveField",
"}",
"onAddFilter",
"=",
"{",
"onAddFilter",
"}",
"getDetails",
"=",
"{",
"getDetailsByField",
"}",
"useShortDots",
"=",
"{",
"useShortDots",
"}",
"/",
">",
"<",
"/li>);",
"}",
")",
"}",
"<",
"/ul>",
"<",
"/div>",
"<",
"/section>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661562 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiButton",
",",
"EuiEmptyPrompt",
",",
"EuiPage",
",",
"EuiPageBody",
",",
"EuiPageContent",
"}",
"from",
"'@elastic/eui'",
";",
"interface",
"Props",
"{",
"onRefresh",
":",
"(",
")",
"=>",
"void",
";",
"}",
"export",
"const",
"DiscoverUninitialized",
"=",
"(",
"{",
"onRefresh",
"}",
")",
"=>",
"{",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"EuiPage",
">",
"<",
"EuiPageBody",
">",
"<",
"EuiPageContent",
"horizontalPosition",
"=",
"\"center\"",
">",
"<",
"EuiEmptyPrompt",
"iconType",
"=",
"\"discoverApp\"",
"title",
"=",
"{",
"<",
"h2",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.uninitializedTitle\"",
"defaultMessage",
"=",
"\"Start searching\"",
"/",
">",
"<",
"/h2>} body={<p>",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.uninitializedText\"",
"defaultMessage",
"=",
"\"Write a query, add some filters, or simply hit Refresh to retrieve results for the current query.\"",
"/",
">",
"<",
"/p>} actions={<EuiButton color=\"primary\" fill onClick={onRefresh}>",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.uninitializedRefreshButtonText\"",
"defaultMessage",
"=",
"\"Refresh data\"",
"/",
">",
"<",
"/EuiButton>}/",
">",
"<",
"/EuiPageContent>",
"<",
"/EuiPageBody>",
"<",
"/EuiPage>",
"<",
"/I18nProvider>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661563 | [
"import",
"{",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiIcon",
",",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"moment",
"from",
"'moment-timezone'",
";",
"import",
"{",
"unitOfTime",
"}",
"from",
"'moment'",
";",
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"lightEuiTheme",
"from",
"'@elastic/eui/dist/eui_theme_light.json'",
";",
"import",
"darkEuiTheme",
"from",
"'@elastic/eui/dist/eui_theme_dark.json'",
";",
"import",
"{",
"AnnotationDomainTypes",
",",
"Axis",
",",
"Chart",
",",
"HistogramBarSeries",
",",
"LineAnnotation",
",",
"Position",
",",
"ScaleType",
",",
"Settings",
",",
"RectAnnotation",
",",
"TooltipValue",
",",
"TooltipType",
",",
"ElementClickListener",
",",
"XYChartElementEvent",
",",
"BrushEndListener",
",",
"Theme",
",",
"}",
"from",
"'@elastic/charts'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"EuiChartThemeType",
"}",
"from",
"'@elastic/eui/dist/eui_charts_theme'",
";",
"import",
"{",
"Subscription",
",",
"combineLatest",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"getServices",
"}",
"from",
"'../../../opensearch_dashboards_services'",
";",
"import",
"{",
"Chart",
"as",
"IChart",
"}",
"from",
"'../helpers/point_series'",
";",
"export",
"interface",
"DiscoverHistogramProps",
"{",
"chartData",
":",
"IChart",
";",
"timefilterUpdateHandler",
":",
"(",
"ranges",
":",
"{",
"from",
":",
"number",
";",
"to",
":",
"number",
";",
"}",
")",
"=>",
"void",
";",
"}",
"interface",
"DiscoverHistogramState",
"{",
"chartsTheme",
":",
"EuiChartThemeType",
"[",
"'theme'",
"]",
";",
"chartsBaseTheme",
":",
"Theme",
";",
"}",
"function",
"findIntervalFromDuration",
"(",
"dateValue",
",",
"opensearchValue",
",",
"opensearchUnit",
",",
"timeZone",
")",
"{",
"const",
"date",
"=",
"moment",
".",
"tz",
"(",
"dateValue",
",",
"timeZone",
")",
";",
"const",
"startOfDate",
"=",
"moment",
".",
"tz",
"(",
"date",
",",
"timeZone",
")",
".",
"startOf",
"(",
"opensearchUnit",
")",
";",
"const",
"endOfDate",
"=",
"moment",
".",
"tz",
"(",
"date",
",",
"timeZone",
")",
".",
"startOf",
"(",
"opensearchUnit",
")",
".",
"add",
"(",
"opensearchValue",
",",
"opensearchUnit",
")",
";",
"return",
"endOfDate",
".",
"valueOf",
"(",
")",
"-",
"startOfDate",
".",
"valueOf",
"(",
")",
";",
"}",
"function",
"getIntervalInMs",
"(",
"value",
",",
"opensearchValue",
",",
"opensearchUnit",
",",
"timeZone",
")",
"{",
"switch",
"(",
"opensearchUnit",
")",
"{",
"case",
"'s'",
":",
"return",
"1000",
"*",
"opensearchValue",
";",
"case",
"'ms'",
":",
"return",
"1",
"*",
"opensearchValue",
";",
"default",
":",
"return",
"findIntervalFromDuration",
"(",
"value",
",",
"opensearchValue",
",",
"opensearchUnit",
",",
"timeZone",
")",
";",
"}",
"}",
"function",
"getTimezone",
"(",
"uiSettings",
")",
"{",
"if",
"(",
"uiSettings",
".",
"isDefault",
"(",
"'dateFormat:tz'",
")",
")",
"{",
"const",
"detectedTimezone",
"=",
"moment",
".",
"tz",
".",
"guess",
"(",
")",
";",
"if",
"(",
"detectedTimezone",
")",
"return",
"detectedTimezone",
";",
"else",
"return",
"moment",
"(",
")",
".",
"format",
"(",
"'Z'",
")",
";",
"}",
"else",
"{",
"return",
"uiSettings",
".",
"get",
"(",
"'dateFormat:tz'",
",",
"'Browser'",
")",
";",
"}",
"}",
"export",
"function",
"findMinInterval",
"(",
"xValues",
",",
"opensearchValue",
",",
"opensearchUnit",
",",
"timeZone",
")",
"{",
"return",
"xValues",
".",
"reduce",
"(",
"(",
"minInterval",
",",
"currentXvalue",
",",
"index",
")",
"=>",
"{",
"let",
"currentDiff",
"=",
"minInterval",
";",
"if",
"(",
"index",
">",
"0",
")",
"{",
"currentDiff",
"=",
"Math",
".",
"abs",
"(",
"xValues",
"[",
"index",
"-",
"1",
"]",
"-",
"currentXvalue",
")",
";",
"}",
"const",
"singleUnitInterval",
"=",
"getIntervalInMs",
"(",
"currentXvalue",
",",
"opensearchValue",
",",
"opensearchUnit",
"as",
"unitOfTime",
".",
"Base",
",",
"timeZone",
")",
";",
"return",
"Math",
".",
"min",
"(",
"minInterval",
",",
"singleUnitInterval",
",",
"currentDiff",
")",
";",
"}",
",",
"Number",
".",
"MAX_SAFE_INTEGER",
")",
";",
"}",
"export",
"class",
"DiscoverHistogram",
"extends",
"Component",
"<",
"DiscoverHistogramProps",
",",
"DiscoverHistogramState",
">",
"{",
"public",
"static",
"propTypes",
"=",
"{",
"chartData",
":",
"PropTypes",
".",
"object",
",",
"timefilterUpdateHandler",
":",
"PropTypes",
".",
"func",
",",
"}",
";",
"private",
"subscription",
"?",
":",
"Subscription",
";",
"public",
"state",
"=",
"{",
"chartsTheme",
":",
"getServices",
"(",
")",
".",
"theme",
".",
"chartsDefaultTheme",
",",
"chartsBaseTheme",
":",
"getServices",
"(",
")",
".",
"theme",
".",
"chartsDefaultBaseTheme",
",",
"}",
";",
"componentDidMount",
"(",
")",
"{",
"this",
".",
"subscription",
"=",
"combineLatest",
"(",
"getServices",
"(",
")",
".",
"theme",
".",
"chartsTheme$",
",",
"getServices",
"(",
")",
".",
"theme",
".",
"chartsBaseTheme$",
")",
".",
"subscribe",
"(",
"(",
"[",
"chartsTheme",
",",
"chartsBaseTheme",
"]",
")",
"=>",
"this",
".",
"setState",
"(",
"{",
"chartsTheme",
",",
"chartsBaseTheme",
"}",
")",
")",
";",
"}",
"componentWillUnmount",
"(",
")",
"{",
"if",
"(",
"this",
".",
"subscription",
")",
"{",
"this",
".",
"subscription",
".",
"unsubscribe",
"(",
")",
";",
"}",
"}",
"public",
"onBrushEnd",
":",
"BrushEndListener",
"=",
"(",
"{",
"x",
"}",
")",
"=>",
"{",
"if",
"(",
"!",
"x",
")",
"{",
"return",
";",
"}",
"const",
"[",
"from",
",",
"to",
"]",
"=",
"x",
";",
"this",
".",
"props",
".",
"timefilterUpdateHandler",
"(",
"{",
"from",
",",
"to",
"}",
")",
";",
"}",
";",
"public",
"onElementClick",
"=",
"(",
"xInterval",
")",
":",
"ElementClickListener",
"=>",
"(",
"[",
"elementData",
"]",
")",
"=>",
"{",
"const",
"startRange",
"=",
"(",
"elementData",
"as",
"XYChartElementEvent",
")",
"[",
"0",
"]",
".",
"x",
";",
"const",
"range",
"=",
"{",
"from",
":",
"startRange",
",",
"to",
":",
"startRange",
"+",
"xInterval",
",",
"}",
";",
"this",
".",
"props",
".",
"timefilterUpdateHandler",
"(",
"range",
")",
";",
"}",
";",
"public",
"formatXValue",
"=",
"(",
"val",
")",
"=>",
"{",
"const",
"xAxisFormat",
"=",
"this",
".",
"props",
".",
"chartData",
".",
"xAxisFormat",
".",
"params",
"!",
".",
"pattern",
";",
"return",
"moment",
"(",
"val",
")",
".",
"format",
"(",
"xAxisFormat",
")",
";",
"}",
";",
"public",
"renderBarTooltip",
"=",
"(",
"xInterval",
",",
"domainStart",
",",
"domainEnd",
")",
"=>",
"(",
"headerData",
")",
":",
"JSX",
".",
"Element",
"|",
"string",
"=>",
"{",
"const",
"headerDataValue",
"=",
"headerData",
".",
"value",
";",
"const",
"formattedValue",
"=",
"this",
".",
"formatXValue",
"(",
"headerDataValue",
")",
";",
"const",
"partialDataText",
"=",
"i18n",
".",
"translate",
"(",
"'discover.histogram.partialData.bucketTooltipText'",
",",
"{",
"defaultMessage",
":",
"'The selected time range does not include this entire bucket, it may contain partial data.'",
",",
"}",
")",
";",
"if",
"(",
"headerDataValue",
"<",
"domainStart",
"||",
"headerDataValue",
"+",
"xInterval",
">",
"domainEnd",
")",
"{",
"return",
"(",
"<",
"React",
".",
"Fragment",
">",
"<",
"EuiFlexGroup",
"alignItems",
"=",
"\"center\"",
"className",
"=",
"\"dscHistogram__header--partial\"",
"responsive",
"=",
"{",
"false",
"}",
"gutterSize",
"=",
"\"xs\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiIcon",
"type",
"=",
"\"iInCircle\"",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
">",
"{",
"partialDataText",
"}",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"<",
"p",
">",
"{",
"formattedValue",
"}",
"<",
"/p>",
"<",
"/React.Fragment>);",
"}",
"return",
"formattedValue",
";",
"}",
";",
"public",
"render",
"(",
")",
"{",
"const",
"uiSettings",
"=",
"getServices",
"(",
")",
".",
"uiSettings",
";",
"const",
"timeZone",
"=",
"getTimezone",
"(",
"uiSettings",
")",
";",
"const",
"{",
"chartData",
"}",
"=",
"this",
".",
"props",
";",
"const",
"{",
"chartsTheme",
",",
"chartsBaseTheme",
"}",
"=",
"this",
".",
"state",
";",
"if",
"(",
"!",
"chartData",
")",
"{",
"return",
"null",
";",
"}",
"const",
"data",
"=",
"chartData",
".",
"values",
";",
"/**\n * Deprecation: [interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval].\n * see https://github.com/elastic/kibana/issues/27410\n * TODO: Once the Discover query has been update, we should change the below to use the new field\n */",
"const",
"{",
"intervalOpenSearchValue",
",",
"intervalOpenSearchUnit",
",",
"interval",
"}",
"=",
"chartData",
".",
"ordered",
";",
"const",
"xInterval",
"=",
"interval",
".",
"asMilliseconds",
"(",
")",
";",
"const",
"xValues",
"=",
"chartData",
".",
"xAxisOrderedValues",
";",
"const",
"lastXValue",
"=",
"xValues",
"[",
"xValues",
".",
"length",
"-",
"1",
"]",
";",
"const",
"domain",
"=",
"chartData",
".",
"ordered",
";",
"const",
"domainStart",
"=",
"domain",
".",
"min",
".",
"valueOf",
"(",
")",
";",
"const",
"domainEnd",
"=",
"domain",
".",
"max",
".",
"valueOf",
"(",
")",
";",
"const",
"domainMin",
"=",
"data",
"[",
"0",
"]",
"?.",
"x",
">",
"domainStart",
"?",
"domainStart",
":",
"data",
"[",
"0",
"]",
"?.",
"x",
";",
"const",
"domainMax",
"=",
"domainEnd",
"-",
"xInterval",
">",
"lastXValue",
"?",
"domainEnd",
"-",
"xInterval",
":",
"lastXValue",
";",
"const",
"xDomain",
"=",
"{",
"min",
":",
"domainMin",
",",
"max",
":",
"domainMax",
",",
"minInterval",
":",
"findMinInterval",
"(",
"xValues",
",",
"intervalOpenSearchValue",
",",
"intervalOpenSearchUnit",
",",
"timeZone",
")",
",",
"}",
";",
"const",
"now",
"=",
"moment",
"(",
")",
";",
"const",
"isAnnotationAtEdge",
"=",
"moment",
"(",
"domainEnd",
")",
".",
"add",
"(",
"60000",
")",
".",
"isAfter",
"(",
"now",
")",
"&&",
"now",
".",
"isAfter",
"(",
"domainEnd",
")",
";",
"const",
"lineAnnotationValue",
"=",
"isAnnotationAtEdge",
"?",
"domainEnd",
":",
"now",
";",
"const",
"lineAnnotationData",
"=",
"[",
"{",
"dataValue",
":",
"lineAnnotationValue",
",",
"}",
",",
"]",
";",
"const",
"isDarkMode",
"=",
"uiSettings",
".",
"get",
"(",
"'theme:darkMode'",
")",
";",
"const",
"lineAnnotationStyle",
"=",
"{",
"line",
":",
"{",
"strokeWidth",
":",
"2",
",",
"stroke",
":",
"isDarkMode",
"?",
"darkEuiTheme",
".",
"euiColorDanger",
":",
"lightEuiTheme",
".",
"euiColorDanger",
",",
"opacity",
":",
"0.7",
",",
"}",
",",
"}",
";",
"const",
"rectAnnotations",
"=",
"[",
"]",
";",
"if",
"(",
"domainStart",
"!==",
"domainMin",
")",
"{",
"rectAnnotations",
".",
"push",
"(",
"{",
"coordinates",
":",
"{",
"x1",
":",
"domainStart",
",",
"}",
",",
"}",
")",
";",
"}",
"if",
"(",
"domainEnd",
"!==",
"domainMax",
")",
"{",
"rectAnnotations",
".",
"push",
"(",
"{",
"coordinates",
":",
"{",
"x0",
":",
"domainEnd",
",",
"}",
",",
"}",
")",
";",
"}",
"const",
"rectAnnotationStyle",
"=",
"{",
"stroke",
":",
"isDarkMode",
"?",
"darkEuiTheme",
".",
"euiColorLightShade",
":",
"lightEuiTheme",
".",
"euiColorDarkShade",
",",
"strokeWidth",
":",
"0",
",",
"opacity",
":",
"isDarkMode",
"?",
"0.6",
":",
"0.2",
",",
"fill",
":",
"isDarkMode",
"?",
"darkEuiTheme",
".",
"euiColorLightShade",
":",
"lightEuiTheme",
".",
"euiColorDarkShade",
",",
"}",
";",
"const",
"tooltipProps",
"=",
"{",
"headerFormatter",
":",
"this",
".",
"renderBarTooltip",
"(",
"xInterval",
",",
"domainStart",
",",
"domainEnd",
")",
",",
"type",
":",
"TooltipType",
".",
"VerticalCursor",
",",
"}",
";",
"return",
"(",
"<",
"Chart",
"size",
"=",
"\"100%\"",
">",
"<",
"Settings",
"xDomain",
"=",
"{",
"xDomain",
"}",
"onBrushEnd",
"=",
"{",
"this",
".",
"onBrushEnd",
"}",
"onElementClick",
"=",
"{",
"this",
".",
"onElementClick",
"(",
"xInterval",
")",
"}",
"tooltip",
"=",
"{",
"tooltipProps",
"}",
"theme",
"=",
"{",
"chartsTheme",
"}",
"baseTheme",
"=",
"{",
"chartsBaseTheme",
"}",
"/",
">",
"<",
"Axis",
"id",
"=",
"\"discover-histogram-left-axis\"",
"position",
"=",
"{",
"Position",
".",
"Left",
"}",
"ticks",
"=",
"{",
"5",
"}",
"title",
"=",
"{",
"chartData",
".",
"yAxisLabel",
"}",
"/",
">",
"<",
"Axis",
"id",
"=",
"\"discover-histogram-bottom-axis\"",
"position",
"=",
"{",
"Position",
".",
"Bottom",
"}",
"title",
"=",
"{",
"chartData",
".",
"xAxisLabel",
"}",
"tickFormat",
"=",
"{",
"this",
".",
"formatXValue",
"}",
"ticks",
"=",
"{",
"10",
"}",
"/",
">",
"<",
"LineAnnotation",
"id",
"=",
"\"line-annotation\"",
"domainType",
"=",
"{",
"AnnotationDomainTypes",
".",
"XDomain",
"}",
"dataValues",
"=",
"{",
"lineAnnotationData",
"}",
"hideTooltips",
"=",
"{",
"true",
"}",
"style",
"=",
"{",
"lineAnnotationStyle",
"}",
"/",
">",
"<",
"RectAnnotation",
"dataValues",
"=",
"{",
"rectAnnotations",
"}",
"id",
"=",
"\"rect-annotation\"",
"zIndex",
"=",
"{",
"2",
"}",
"style",
"=",
"{",
"rectAnnotationStyle",
"}",
"hideTooltips",
"=",
"{",
"true",
"}",
"/",
">",
"<",
"HistogramBarSeries",
"id",
"=",
"\"discover-histogram\"",
"minBarHeight",
"=",
"{",
"2",
"}",
"xScaleType",
"=",
"{",
"ScaleType",
".",
"Time",
"}",
"yScaleType",
"=",
"{",
"ScaleType",
".",
"Linear",
"}",
"xAccessor",
"=",
"\"x\"",
"yAccessors",
"=",
"{",
"[",
"'y'",
"]",
"}",
"data",
"=",
"{",
"data",
"}",
"timeZone",
"=",
"{",
"timeZone",
"}",
"name",
"=",
"{",
"chartData",
".",
"yAxisLabel",
"}",
"/",
">",
"<",
"/Chart>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
3,
null,
3,
null,
11977,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
3,
null,
3,
null,
11977,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1828,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
5,
null,
3,
null,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
3,
null,
3,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
3,
null,
3,
null,
null,
null,
9958,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661564 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiLoadingSpinner",
",",
"EuiTitle",
",",
"EuiSpacer",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"export",
"function",
"LoadingSpinner",
"(",
")",
"{",
"return",
"(",
"<",
">",
"<",
"EuiTitle",
"size",
"=",
"\"s\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"loadingSpinnerText\"",
">",
"<",
"h2",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.searchingTitle\"",
"defaultMessage",
"=",
"\"Searching\"",
"/",
">",
"<",
"/h2>",
"<",
"/EuiTitle>",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"EuiLoadingSpinner",
"size",
"=",
"\"l\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"loadingSpinner\"",
"/",
">",
"<",
"/>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661565 | [
"import",
"angular",
",",
"{",
"auto",
",",
"ICompileService",
",",
"IScope",
"}",
"from",
"'angular'",
";",
"import",
"{",
"render",
"}",
"from",
"'react-dom'",
";",
"import",
"React",
",",
"{",
"useRef",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"getServices",
",",
"IIndexPattern",
"}",
"from",
"'../../../opensearch_dashboards_services'",
";",
"import",
"{",
"IndexPatternField",
"}",
"from",
"'../../../../../data/common/index_patterns'",
";",
"export",
"type",
"AngularScope",
"=",
"IScope",
";",
"export",
"interface",
"AngularDirective",
"{",
"template",
":",
"string",
";",
"}",
"/**\n * Compiles and injects the give angular template into the given dom node\n * returns a function to cleanup the injected angular element\n */",
"export",
"async",
"function",
"injectAngularElement",
"(",
"domNode",
",",
"template",
",",
"scopeProps",
",",
"getInjector",
")",
"{",
"const",
"$injector",
"=",
"await",
"getInjector",
"(",
")",
";",
"const",
"rootScope",
"=",
"$injector",
".",
"get",
"(",
"'$rootScope'",
")",
";",
"const",
"$compile",
"=",
"$injector",
".",
"get",
"(",
"'$compile'",
")",
";",
"const",
"newScope",
"=",
"Object",
".",
"assign",
"(",
"rootScope",
".",
"$new",
"(",
")",
",",
"scopeProps",
")",
";",
"const",
"$target",
"=",
"angular",
".",
"element",
"(",
"domNode",
")",
";",
"const",
"$element",
"=",
"angular",
".",
"element",
"(",
"template",
")",
";",
"newScope",
".",
"$apply",
"(",
"(",
")",
"=>",
"{",
"const",
"linkFn",
"=",
"$compile",
"(",
"$element",
")",
";",
"$target",
".",
"empty",
"(",
")",
".",
"append",
"(",
"$element",
")",
";",
"linkFn",
"(",
"newScope",
")",
";",
"}",
")",
";",
"return",
"(",
")",
"=>",
"{",
"newScope",
".",
"$destroy",
"(",
")",
";",
"}",
";",
"}",
"/**\n * Converts a given legacy angular directive to a render function\n * for usage in a react component. Note that the rendering is async\n */",
"export",
"function",
"convertDirectiveToRenderFn",
"(",
"directive",
",",
"getInjector",
")",
"{",
"return",
"(",
"domNode",
",",
"props",
")",
"=>",
"{",
"let",
"rejected",
"=",
"false",
";",
"const",
"cleanupFnPromise",
"=",
"injectAngularElement",
"(",
"domNode",
",",
"directive",
".",
"template",
",",
"props",
",",
"getInjector",
")",
";",
"cleanupFnPromise",
".",
"catch",
"(",
"(",
")",
"=>",
"{",
"rejected",
"=",
"true",
";",
"render",
"(",
"<",
"div",
">",
"error",
"<",
"/div>, domNode);",
"}",
")",
";",
"return",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"rejected",
")",
"{",
"cleanupFnPromise",
".",
"then",
"(",
"(",
"cleanup",
")",
"=>",
"cleanup",
"(",
")",
")",
";",
"}",
"}",
";",
"}",
";",
"}",
"export",
"interface",
"DocTableLegacyProps",
"{",
"columns",
":",
"string",
"[",
"]",
";",
"searchDescription",
"?",
":",
"string",
";",
"searchTitle",
"?",
":",
"string",
";",
"onFilter",
":",
"(",
"field",
":",
"IndexPatternField",
"|",
"string",
",",
"value",
":",
"string",
",",
"type",
":",
"'+'",
"|",
"'-'",
")",
"=>",
"void",
";",
"rows",
":",
"Array",
"<",
"Record",
"<",
"string",
",",
"unknown",
">",
">",
";",
"indexPattern",
":",
"IIndexPattern",
";",
"minimumVisibleRows",
":",
"number",
";",
"onAddColumn",
":",
"(",
"column",
":",
"string",
")",
"=>",
"void",
";",
"onSort",
":",
"(",
"sort",
":",
"string",
"[",
"]",
"[",
"]",
")",
"=>",
"void",
";",
"onMoveColumn",
":",
"(",
"columns",
":",
"string",
",",
"newIdx",
":",
"number",
")",
"=>",
"void",
";",
"onRemoveColumn",
":",
"(",
"column",
":",
"string",
")",
"=>",
"void",
";",
"sort",
"?",
":",
"string",
"[",
"]",
"[",
"]",
";",
"}",
"export",
"function",
"DocTableLegacy",
"(",
"renderProps",
")",
"{",
"const",
"renderFn",
"=",
"convertDirectiveToRenderFn",
"(",
"{",
"template",
":",
"`<doc-table\n columns=\"columns\"\n data-description=\"{{searchDescription}}\"\n data-shared-item\n data-test-subj=\"discoverDocTable\"\n data-title=\"{{searchTitle}}\"\n filter=\"onFilter\"\n hits=\"rows\"\n index-pattern=\"indexPattern\"\n infinite-scroll=\"true\"\n minimum-visible-rows=\"minimumVisibleRows\"\n on-add-column=\"onAddColumn\"\n on-change-sort-order=\"onSort\"\n on-move-column=\"onMoveColumn\"\n on-remove-column=\"onRemoveColumn\"\n render-complete\n sorting=\"sort\"></doc_table>`",
",",
"}",
",",
"(",
")",
"=>",
"getServices",
"(",
")",
".",
"getEmbeddableInjector",
"(",
")",
")",
";",
"const",
"ref",
"=",
"useRef",
"<",
"HTMLDivElement",
">",
"(",
"null",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"ref",
"&&",
"ref",
".",
"current",
")",
"{",
"return",
"renderFn",
"(",
"ref",
".",
"current",
",",
"renderProps",
")",
";",
"}",
"}",
",",
"[",
"renderFn",
",",
"renderProps",
"]",
")",
";",
"return",
"<",
"div",
"ref",
"=",
"{",
"ref",
"}",
"/>;",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
9,
null,
2,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13410,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13050,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
13411,
null,
7,
null,
null,
null,
null,
9,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26161,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661566 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"EuiSkipLink",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"export",
"interface",
"SkipBottomButtonProps",
"{",
"/**\n * Action to perform on click\n */",
"onClick",
":",
"(",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"SkipBottomButton",
"(",
"{",
"onClick",
"}",
")",
"{",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"EuiSkipLink",
"size",
"=",
"\"s\"",
"onClick",
"=",
"{",
"(",
"event",
")",
"=>",
"{",
"event",
".",
"preventDefault",
"(",
")",
";",
"onClick",
"(",
")",
";",
"}",
"}",
"className",
"=",
"\"dscSkipButton\"",
"destinationId",
"=",
"\"\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discoverSkipTableButton\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.skipToBottomButtonLabel\"",
"defaultMessage",
"=",
"\"Skip to end of table\"",
"/",
">",
"<",
"/EuiSkipLink>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661567 | [
"import",
"{",
"isEqual",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"History",
"}",
"from",
"'history'",
";",
"import",
"{",
"NotificationsStart",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"createStateContainer",
",",
"createOsdUrlStateStorage",
",",
"syncState",
",",
"ReduxLikeStateContainer",
",",
"IOsdUrlStateStorage",
",",
"withNotifyOnErrors",
",",
"}",
"from",
"'../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"opensearchFilters",
",",
"Filter",
",",
"Query",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"migrateLegacyQuery",
"}",
"from",
"'../helpers/migrate_legacy_query'",
";",
"export",
"interface",
"AppState",
"{",
"/**\n * Columns displayed in the table\n */",
"columns",
"?",
":",
"string",
"[",
"]",
";",
"/**\n * Array of applied filters\n */",
"filters",
"?",
":",
"Filter",
"[",
"]",
";",
"/**\n * id of the used index pattern\n */",
"index",
"?",
":",
"string",
";",
"/**\n * Used interval of the histogram\n */",
"interval",
"?",
":",
"string",
";",
"/**\n * Lucence or DQL query\n */",
"query",
"?",
":",
"Query",
";",
"/**\n * Array of the used sorting [[field,direction],...]\n */",
"sort",
"?",
":",
"string",
"[",
"]",
"[",
"]",
";",
"/**\n * id of the used saved query\n */",
"savedQuery",
"?",
":",
"string",
";",
"}",
"interface",
"GetStateParams",
"{",
"/**\n * Default state used for merging with with URL state to get the initial state\n */",
"defaultAppState",
"?",
":",
"AppState",
";",
"/**\n * Determins the use of long vs. short/hashed urls\n */",
"storeInSessionStorage",
"?",
":",
"boolean",
";",
"/**\n * Browser history\n */",
"history",
":",
"History",
";",
"/**\n * Core's notifications.toasts service\n * In case it is passed in,\n * osdUrlStateStorage will use it notifying about inner errors\n */",
"toasts",
"?",
":",
"NotificationsStart",
"[",
"'toasts'",
"]",
";",
"}",
"export",
"interface",
"GetStateReturn",
"{",
"/**\n * osdUrlStateStorage\n */",
"osdUrlStateStorage",
":",
"IOsdUrlStateStorage",
";",
"/**\n * App state, the _a part of the URL\n */",
"appStateContainer",
":",
"ReduxLikeStateContainer",
"<",
"AppState",
">",
";",
"/**\n * Start sync between state and URL\n */",
"startSync",
":",
"(",
")",
"=>",
"void",
";",
"/**\n * Stop sync between state and URL\n */",
"stopSync",
":",
"(",
")",
"=>",
"void",
";",
"/**\n * Set app state to with a partial new app state\n */",
"setAppState",
":",
"(",
"newState",
":",
"Partial",
"<",
"AppState",
">",
")",
"=>",
"void",
";",
"/**\n * Set state in Url using history.replace\n */",
"replaceUrlAppState",
":",
"(",
"newState",
":",
"Partial",
"<",
"AppState",
">",
")",
"=>",
"Promise",
"<",
"void",
">",
";",
"/**\n * Sync state to URL, used for testing\n */",
"flushToUrl",
":",
"(",
")",
"=>",
"void",
";",
"/**\n * Reset initial state to the current app state\n */",
"resetInitialAppState",
":",
"(",
")",
"=>",
"void",
";",
"/**\n * Return the Appstate before the current app state, useful for diffing changes\n */",
"getPreviousAppState",
":",
"(",
")",
"=>",
"AppState",
";",
"/**\n * Returns whether the current app state is different to the initial state\n */",
"isAppStateDirty",
":",
"(",
")",
"=>",
"void",
";",
"}",
"const",
"APP_STATE_URL_KEY",
"=",
"'_a'",
";",
"/**\n * Builds and returns appState and globalState containers and helper functions\n * Used to sync URL with UI state\n */",
"export",
"function",
"getState",
"(",
"{",
"defaultAppState",
"=",
"{",
"}",
",",
"storeInSessionStorage",
"=",
"false",
",",
"history",
",",
"toasts",
",",
"}",
")",
"{",
"const",
"stateStorage",
"=",
"createOsdUrlStateStorage",
"(",
"{",
"useHash",
":",
"storeInSessionStorage",
",",
"history",
",",
"...",
"(",
"toasts",
"&&",
"withNotifyOnErrors",
"(",
"toasts",
")",
")",
",",
"}",
")",
";",
"const",
"appStateFromUrl",
"=",
"stateStorage",
".",
"get",
"(",
"APP_STATE_URL_KEY",
")",
"as",
"AppState",
";",
"if",
"(",
"appStateFromUrl",
"&&",
"appStateFromUrl",
".",
"query",
"&&",
"!",
"appStateFromUrl",
".",
"query",
".",
"language",
")",
"{",
"appStateFromUrl",
".",
"query",
"=",
"migrateLegacyQuery",
"(",
"appStateFromUrl",
".",
"query",
")",
";",
"}",
"let",
"initialAppState",
"=",
"{",
"...",
"defaultAppState",
",",
"...",
"appStateFromUrl",
",",
"}",
";",
"let",
"previousAppState",
";",
"const",
"appStateContainer",
"=",
"createStateContainer",
"<",
"AppState",
">",
"(",
"initialAppState",
")",
";",
"const",
"appStateContainerModified",
"=",
"{",
"...",
"appStateContainer",
",",
"set",
":",
"(",
"value",
")",
"=>",
"{",
"if",
"(",
"value",
")",
"{",
"previousAppState",
"=",
"appStateContainer",
".",
"getState",
"(",
")",
";",
"appStateContainer",
".",
"set",
"(",
"value",
")",
";",
"}",
"}",
",",
"}",
";",
"const",
"{",
"start",
",",
"stop",
"}",
"=",
"syncState",
"(",
"{",
"storageKey",
":",
"APP_STATE_URL_KEY",
",",
"stateContainer",
":",
"appStateContainerModified",
",",
"stateStorage",
",",
"}",
")",
";",
"return",
"{",
"osdUrlStateStorage",
":",
"stateStorage",
",",
"appStateContainer",
":",
"appStateContainerModified",
",",
"startSync",
":",
"start",
",",
"stopSync",
":",
"stop",
",",
"setAppState",
":",
"(",
"newPartial",
")",
"=>",
"setState",
"(",
"appStateContainerModified",
",",
"newPartial",
")",
",",
"replaceUrlAppState",
":",
"async",
"(",
"newPartial",
"=",
"{",
"}",
")",
"=>",
"{",
"const",
"state",
"=",
"{",
"...",
"appStateContainer",
".",
"getState",
"(",
")",
",",
"...",
"newPartial",
"}",
";",
"await",
"stateStorage",
".",
"set",
"(",
"APP_STATE_URL_KEY",
",",
"state",
",",
"{",
"replace",
":",
"true",
"}",
")",
";",
"}",
",",
"resetInitialAppState",
":",
"(",
")",
"=>",
"{",
"initialAppState",
"=",
"appStateContainer",
".",
"getState",
"(",
")",
";",
"}",
",",
"getPreviousAppState",
":",
"(",
")",
"=>",
"previousAppState",
",",
"flushToUrl",
":",
"(",
")",
"=>",
"stateStorage",
".",
"flush",
"(",
")",
",",
"isAppStateDirty",
":",
"(",
")",
"=>",
"!",
"isEqualState",
"(",
"initialAppState",
",",
"appStateContainer",
".",
"getState",
"(",
")",
")",
",",
"}",
";",
"}",
"/**\n * Helper function to merge a given new state with the existing state and to set the given state\n * container\n */",
"export",
"function",
"setState",
"(",
"stateContainer",
",",
"newState",
")",
"{",
"const",
"oldState",
"=",
"stateContainer",
".",
"getState",
"(",
")",
";",
"const",
"mergedState",
"=",
"{",
"...",
"oldState",
",",
"...",
"newState",
"}",
";",
"if",
"(",
"!",
"isEqualState",
"(",
"oldState",
",",
"mergedState",
")",
")",
"{",
"stateContainer",
".",
"set",
"(",
"mergedState",
")",
";",
"}",
"}",
"/**\n * Helper function to compare 2 different filter states\n */",
"export",
"function",
"isEqualFilters",
"(",
"filtersA",
",",
"filtersB",
")",
"{",
"if",
"(",
"!",
"filtersA",
"&&",
"!",
"filtersB",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"!",
"filtersA",
"||",
"!",
"filtersB",
")",
"{",
"return",
"false",
";",
"}",
"return",
"opensearchFilters",
".",
"compareFilters",
"(",
"filtersA",
",",
"filtersB",
",",
"opensearchFilters",
".",
"COMPARE_ALL_OPTIONS",
")",
";",
"}",
"/**\n * helper function to extract filters of the given state\n * returns a state object without filters and an array of filters\n */",
"export",
"function",
"splitState",
"(",
"state",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"filters",
"=",
"[",
"]",
",",
"...",
"statePartial",
"}",
"=",
"state",
";",
"return",
"{",
"filters",
",",
"state",
":",
"statePartial",
"}",
";",
"}",
"/**\n * Helper function to compare 2 different state, is needed since comparing filters\n * works differently\n */",
"export",
"function",
"isEqualState",
"(",
"stateA",
",",
"stateB",
")",
"{",
"if",
"(",
"!",
"stateA",
"&&",
"!",
"stateB",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"!",
"stateA",
"||",
"!",
"stateB",
")",
"{",
"return",
"false",
";",
"}",
"const",
"{",
"filters",
":",
"stateAFilters",
"=",
"[",
"]",
",",
"...",
"stateAPartial",
"}",
"=",
"stateA",
";",
"const",
"{",
"filters",
":",
"stateBFilters",
"=",
"[",
"]",
",",
"...",
"stateBPartial",
"}",
"=",
"stateB",
";",
"return",
"isEqual",
"(",
"stateAPartial",
",",
"stateBPartial",
")",
"&&",
"isEqualFilters",
"(",
"stateAFilters",
",",
"stateBFilters",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
19717,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661568 | [
"import",
"React",
",",
"{",
"useState",
",",
"useCallback",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"classNames",
"from",
"'classnames'",
";",
"import",
"{",
"EuiButtonEmpty",
",",
"EuiButtonIcon",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"IUiSettingsClient",
",",
"MountPoint",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"HitsCounter",
"}",
"from",
"'./hits_counter'",
";",
"import",
"{",
"TimechartHeader",
"}",
"from",
"'./timechart_header'",
";",
"import",
"{",
"DiscoverSidebar",
"}",
"from",
"'./sidebar'",
";",
"import",
"{",
"getServices",
",",
"IndexPattern",
"}",
"from",
"'../../opensearch_dashboards_services'",
";",
"import",
"{",
"DiscoverNoResults",
"}",
"from",
"'../angular/directives/no_results'",
";",
"import",
"{",
"DiscoverUninitialized",
"}",
"from",
"'../angular/directives/uninitialized'",
";",
"import",
"{",
"DiscoverHistogram",
"}",
"from",
"'../angular/directives/histogram'",
";",
"import",
"{",
"LoadingSpinner",
"}",
"from",
"'./loading_spinner/loading_spinner'",
";",
"import",
"{",
"DocTableLegacy",
"}",
"from",
"'../angular/doc_table/create_doc_table_react'",
";",
"import",
"{",
"SkipBottomButton",
"}",
"from",
"'./skip_bottom_button'",
";",
"import",
"{",
"IndexPatternField",
",",
"search",
",",
"ISearchSource",
",",
"TimeRange",
",",
"Query",
",",
"IndexPatternAttributes",
",",
"}",
"from",
"'../../../../data/public'",
";",
"import",
"{",
"Chart",
"}",
"from",
"'../angular/helpers/point_series'",
";",
"import",
"{",
"AppState",
"}",
"from",
"'../angular/discover_state'",
";",
"import",
"{",
"SavedSearch",
"}",
"from",
"'../../saved_searches'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'../../../../../core/types'",
";",
"import",
"{",
"Vis",
"}",
"from",
"'../../../../visualizations/public'",
";",
"import",
"{",
"TopNavMenuData",
"}",
"from",
"'../../../../navigation/public'",
";",
"export",
"interface",
"DiscoverLegacyProps",
"{",
"addColumn",
":",
"(",
"column",
":",
"string",
")",
"=>",
"void",
";",
"fetch",
":",
"(",
")",
"=>",
"void",
";",
"fetchCounter",
":",
"number",
";",
"fieldCounts",
":",
"Record",
"<",
"string",
",",
"number",
">",
";",
"histogramData",
":",
"Chart",
";",
"hits",
":",
"number",
";",
"indexPattern",
":",
"IndexPattern",
";",
"minimumVisibleRows",
":",
"number",
";",
"onAddFilter",
":",
"(",
"field",
":",
"IndexPatternField",
"|",
"string",
",",
"value",
":",
"string",
",",
"type",
":",
"'+'",
"|",
"'-'",
")",
"=>",
"void",
";",
"onChangeInterval",
":",
"(",
"interval",
":",
"string",
")",
"=>",
"void",
";",
"onMoveColumn",
":",
"(",
"columns",
":",
"string",
",",
"newIdx",
":",
"number",
")",
"=>",
"void",
";",
"onRemoveColumn",
":",
"(",
"column",
":",
"string",
")",
"=>",
"void",
";",
"onSetColumns",
":",
"(",
"columns",
":",
"string",
"[",
"]",
")",
"=>",
"void",
";",
"onSkipBottomButtonClick",
":",
"(",
")",
"=>",
"void",
";",
"onSort",
":",
"(",
"sort",
":",
"string",
"[",
"]",
"[",
"]",
")",
"=>",
"void",
";",
"opts",
":",
"{",
"savedSearch",
":",
"SavedSearch",
";",
"config",
":",
"IUiSettingsClient",
";",
"indexPatternList",
":",
"Array",
"<",
"SavedObject",
"<",
"IndexPatternAttributes",
">",
">",
";",
"timefield",
":",
"string",
";",
"sampleSize",
":",
"number",
";",
"fixedScroll",
":",
"(",
"el",
":",
"HTMLElement",
")",
"=>",
"void",
";",
"setHeaderActionMenu",
":",
"(",
"menuMount",
":",
"MountPoint",
"|",
"undefined",
")",
"=>",
"void",
";",
"}",
";",
"resetQuery",
":",
"(",
")",
"=>",
"void",
";",
"resultState",
":",
"string",
";",
"rows",
":",
"Array",
"<",
"Record",
"<",
"string",
",",
"unknown",
">",
">",
";",
"searchSource",
":",
"ISearchSource",
";",
"setIndexPattern",
":",
"(",
"id",
":",
"string",
")",
"=>",
"void",
";",
"showSaveQuery",
":",
"boolean",
";",
"state",
":",
"AppState",
";",
"timefilterUpdateHandler",
":",
"(",
"ranges",
":",
"{",
"from",
":",
"number",
";",
"to",
":",
"number",
";",
"}",
")",
"=>",
"void",
";",
"timeRange",
"?",
":",
"{",
"from",
":",
"string",
";",
"to",
":",
"string",
";",
"}",
";",
"topNavMenu",
":",
"TopNavMenuData",
"[",
"]",
";",
"updateQuery",
":",
"(",
"payload",
":",
"{",
"dateRange",
":",
"TimeRange",
";",
"query",
"?",
":",
"Query",
";",
"}",
",",
"isUpdate",
"?",
":",
"boolean",
")",
"=>",
"void",
";",
"updateSavedQueryId",
":",
"(",
"savedQueryId",
"?",
":",
"string",
")",
"=>",
"void",
";",
"vis",
"?",
":",
"Vis",
";",
"}",
"export",
"function",
"DiscoverLegacy",
"(",
"{",
"addColumn",
",",
"fetch",
",",
"fetchCounter",
",",
"fieldCounts",
",",
"histogramData",
",",
"hits",
",",
"indexPattern",
",",
"minimumVisibleRows",
",",
"onAddFilter",
",",
"onChangeInterval",
",",
"onMoveColumn",
",",
"onRemoveColumn",
",",
"onSkipBottomButtonClick",
",",
"onSort",
",",
"opts",
",",
"resetQuery",
",",
"resultState",
",",
"rows",
",",
"searchSource",
",",
"setIndexPattern",
",",
"showSaveQuery",
",",
"state",
",",
"timefilterUpdateHandler",
",",
"timeRange",
",",
"topNavMenu",
",",
"updateQuery",
",",
"updateSavedQueryId",
",",
"vis",
",",
"}",
")",
"{",
"const",
"[",
"isSidebarClosed",
",",
"setIsSidebarClosed",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"{",
"TopNavMenu",
"}",
"=",
"getServices",
"(",
")",
".",
"navigation",
".",
"ui",
";",
"const",
"{",
"savedSearch",
",",
"indexPatternList",
"}",
"=",
"opts",
";",
"const",
"bucketAggConfig",
"=",
"vis",
"?.",
"data",
"?.",
"aggs",
"?.",
"aggs",
"[",
"1",
"]",
";",
"const",
"bucketInterval",
"=",
"bucketAggConfig",
"&&",
"search",
".",
"aggs",
".",
"isDateHistogramBucketAggConfig",
"(",
"bucketAggConfig",
")",
"?",
"bucketAggConfig",
".",
"buckets",
"?.",
"getInterval",
"(",
")",
":",
"undefined",
";",
"const",
"[",
"fixedScrollEl",
",",
"setFixedScrollEl",
"]",
"=",
"useState",
"<",
"HTMLElement",
"|",
"undefined",
">",
"(",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"(",
"fixedScrollEl",
"?",
"opts",
".",
"fixedScroll",
"(",
"fixedScrollEl",
")",
":",
"undefined",
")",
",",
"[",
"fixedScrollEl",
",",
"opts",
",",
"]",
")",
";",
"const",
"fixedScrollRef",
"=",
"useCallback",
"(",
"(",
"node",
")",
"=>",
"{",
"if",
"(",
"node",
"!==",
"null",
")",
"{",
"setFixedScrollEl",
"(",
"node",
")",
";",
"}",
"}",
",",
"[",
"setFixedScrollEl",
"]",
")",
";",
"const",
"sidebarClassName",
"=",
"classNames",
"(",
"{",
"closed",
":",
"isSidebarClosed",
",",
"}",
")",
";",
"const",
"mainSectionClassName",
"=",
"classNames",
"(",
"{",
"'col-md-10'",
":",
"!",
"isSidebarClosed",
",",
"'col-md-12'",
":",
"isSidebarClosed",
",",
"}",
")",
";",
"return",
"(",
"<",
"I18nProvider",
">",
"<",
"div",
"className",
"=",
"\"dscAppContainer\"",
"data",
"-",
"fetch",
"-",
"counter",
"=",
"{",
"fetchCounter",
"}",
">",
"<",
"h1",
"className",
"=",
"\"euiScreenReaderOnly\"",
">",
"{",
"savedSearch",
".",
"title",
"}",
"<",
"/h1>",
"<",
"TopNavMenu",
"appName",
"=",
"\"discover\"",
"config",
"=",
"{",
"topNavMenu",
"}",
"indexPatterns",
"=",
"{",
"[",
"indexPattern",
"]",
"}",
"onQuerySubmit",
"=",
"{",
"updateQuery",
"}",
"onSavedQueryIdChange",
"=",
"{",
"updateSavedQueryId",
"}",
"query",
"=",
"{",
"state",
".",
"query",
"}",
"setMenuMountPoint",
"=",
"{",
"opts",
".",
"setHeaderActionMenu",
"}",
"savedQueryId",
"=",
"{",
"state",
".",
"savedQuery",
"}",
"screenTitle",
"=",
"{",
"savedSearch",
".",
"title",
"}",
"showDatePicker",
"=",
"{",
"indexPattern",
".",
"isTimeBased",
"(",
")",
"}",
"showSaveQuery",
"=",
"{",
"showSaveQuery",
"}",
"showSearchBar",
"=",
"{",
"true",
"}",
"useDefaultBehaviors",
"=",
"{",
"true",
"}",
"/",
">",
"<",
"main",
"className",
"=",
"\"container-fluid\"",
">",
"<",
"div",
"className",
"=",
"\"row\"",
">",
"<",
"div",
"className",
"=",
"{",
"`col-md-2 dscSidebar__container dscCollapsibleSidebar ${",
"sidebarClassName",
"}`",
"}",
"id",
"=",
"\"discover-sidebar\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discover-sidebar\"",
">",
"{",
"!",
"isSidebarClosed",
"&&",
"(",
"<",
"div",
"className",
"=",
"\"dscFieldChooser\"",
">",
"<",
"DiscoverSidebar",
"columns",
"=",
"{",
"state",
".",
"columns",
"||",
"[",
"]",
"}",
"fieldCounts",
"=",
"{",
"fieldCounts",
"}",
"hits",
"=",
"{",
"rows",
"}",
"indexPatternList",
"=",
"{",
"indexPatternList",
"}",
"onAddField",
"=",
"{",
"addColumn",
"}",
"onAddFilter",
"=",
"{",
"onAddFilter",
"}",
"onRemoveField",
"=",
"{",
"onRemoveColumn",
"}",
"selectedIndexPattern",
"=",
"{",
"searchSource",
"&&",
"searchSource",
".",
"getField",
"(",
"'index'",
")",
"}",
"setIndexPattern",
"=",
"{",
"setIndexPattern",
"}",
"/",
">",
"<",
"/div>)}",
"<",
"EuiButtonIcon",
"iconType",
"=",
"{",
"isSidebarClosed",
"?",
"'menuRight'",
":",
"'menuLeft'",
"}",
"iconSize",
"=",
"\"m\"",
"size",
"=",
"\"s\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"setIsSidebarClosed",
"(",
"!",
"isSidebarClosed",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"collapseSideBarButton\"",
"aria",
"-",
"controls",
"=",
"\"discover-sidebar\"",
"aria",
"-",
"expanded",
"=",
"{",
"isSidebarClosed",
"?",
"'false'",
":",
"'true'",
"}",
"aria",
"-",
"label",
"=",
"\"Toggle sidebar\"",
"className",
"=",
"\"dscCollapsibleSidebar__collapseButton\"",
"/",
">",
"<",
"/div>",
"<",
"div",
"className",
"=",
"{",
"`dscWrapper ${",
"mainSectionClassName",
"}`",
"}",
">",
"{",
"resultState",
"===",
"'none'",
"&&",
"(",
"<",
"DiscoverNoResults",
"timeFieldName",
"=",
"{",
"opts",
".",
"timefield",
"}",
"queryLanguage",
"=",
"{",
"state",
".",
"query",
"?",
"state",
".",
"query",
".",
"language",
":",
"''",
"}",
"/",
">",
")",
"}",
"{",
"resultState",
"===",
"'uninitialized'",
"&&",
"<",
"DiscoverUninitialized",
"onRefresh",
"=",
"{",
"fetch",
"}",
"/>}",
"{",
"}",
"<",
"span",
"style",
"=",
"{",
"{",
"display",
":",
"resultState",
"!==",
"'loading'",
"?",
"'none'",
":",
"''",
"}",
"}",
">",
"<",
"div",
"className",
"=",
"\"dscOverlay\"",
">",
"<",
"LoadingSpinner",
"/>",
"<",
"/div>",
"<",
"/span>",
"{",
"resultState",
"===",
"'ready'",
"&&",
"(",
"<",
"div",
"className",
"=",
"\"dscWrapper__content\"",
">",
"<",
"SkipBottomButton",
"onClick",
"=",
"{",
"onSkipBottomButtonClick",
"}",
"/>",
"<",
"HitsCounter",
"hits",
"=",
"{",
"hits",
">",
"0",
"?",
"hits",
":",
"0",
"}",
"showResetButton",
"=",
"{",
"!",
"!",
"(",
"savedSearch",
"&&",
"savedSearch",
".",
"id",
")",
"}",
"onResetQuery",
"=",
"{",
"resetQuery",
"}",
"/",
">",
"{",
"opts",
".",
"timefield",
"&&",
"(",
"<",
"TimechartHeader",
"dateFormat",
"=",
"{",
"opts",
".",
"config",
".",
"get",
"(",
"'dateFormat'",
")",
"}",
"timeRange",
"=",
"{",
"timeRange",
"}",
"options",
"=",
"{",
"search",
".",
"aggs",
".",
"intervalOptions",
"}",
"onChangeInterval",
"=",
"{",
"onChangeInterval",
"}",
"stateInterval",
"=",
"{",
"state",
".",
"interval",
"||",
"''",
"}",
"bucketInterval",
"=",
"{",
"bucketInterval",
"}",
"/",
">",
")",
"}",
"{",
"opts",
".",
"timefield",
"&&",
"(",
"<",
"section",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'discover.histogramOfFoundDocumentsAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Histogram of found documents'",
",",
"}",
")",
"}",
"className",
"=",
"\"dscTimechart\"",
">",
"{",
"vis",
"&&",
"rows",
".",
"length",
"!==",
"0",
"&&",
"(",
"<",
"div",
"className",
"=",
"\"dscHistogram\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discoverChart\"",
">",
"<",
"DiscoverHistogram",
"chartData",
"=",
"{",
"histogramData",
"}",
"timefilterUpdateHandler",
"=",
"{",
"timefilterUpdateHandler",
"}",
"/",
">",
"<",
"/div>)}",
"<",
"/section>)}",
"<",
"div",
"className",
"=",
"\"dscResults\"",
">",
"<",
"section",
"className",
"=",
"\"dscTable dscTableFixedScroll\"",
"aria",
"-",
"labelledby",
"=",
"\"documentsAriaLabel\"",
"ref",
"=",
"{",
"fixedScrollRef",
"}",
">",
"<",
"h2",
"className",
"=",
"\"euiScreenReaderOnly\"",
"id",
"=",
"\"documentsAriaLabel\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.documentsAriaLabel\"",
"defaultMessage",
"=",
"\"Documents\"",
"/",
">",
"<",
"/h2>",
"{",
"rows",
"&&",
"rows",
".",
"length",
"&&",
"(",
"<",
"div",
"className",
"=",
"\"dscDiscover\"",
">",
"<",
"DocTableLegacy",
"columns",
"=",
"{",
"state",
".",
"columns",
"||",
"[",
"]",
"}",
"indexPattern",
"=",
"{",
"indexPattern",
"}",
"minimumVisibleRows",
"=",
"{",
"minimumVisibleRows",
"}",
"rows",
"=",
"{",
"rows",
"}",
"sort",
"=",
"{",
"state",
".",
"sort",
"||",
"[",
"]",
"}",
"searchDescription",
"=",
"{",
"opts",
".",
"savedSearch",
".",
"description",
"}",
"searchTitle",
"=",
"{",
"opts",
".",
"savedSearch",
".",
"lastSavedTitle",
"}",
"onAddColumn",
"=",
"{",
"addColumn",
"}",
"onFilter",
"=",
"{",
"onAddFilter",
"}",
"onMoveColumn",
"=",
"{",
"onMoveColumn",
"}",
"onRemoveColumn",
"=",
"{",
"onRemoveColumn",
"}",
"onSort",
"=",
"{",
"onSort",
"}",
"/",
">",
"<",
"a",
"tabIndex",
"=",
"{",
"0",
"}",
"id",
"=",
"\"discoverBottomMarker\"",
">",
"&",
"#",
"8203",
";",
"<",
"/a>",
"{",
"rows",
".",
"length",
"===",
"opts",
".",
"sampleSize",
"&&",
"(",
"<",
"div",
"className",
"=",
"\"dscTable__footer\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"discoverDocTableFooter\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.howToSeeOtherMatchingDocumentsDescription\"",
"defaultMessage",
"=",
"\"These are the first {sampleSize} documents matching",
"your",
"search",
",",
"refine",
"your",
"search",
"to",
"see",
"others",
".",
"\" values={{ sampleSize: opts.sampleSize }}/>",
"<",
"EuiButtonEmpty",
"onClick",
"=",
"{",
"(",
")",
"=>",
"window",
".",
"scrollTo",
"(",
"0",
",",
"0",
")",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"discover.backToTopLinkText\"",
"defaultMessage",
"=",
"\"Back to top.\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/div>)}",
"<",
"/div>)}",
"<",
"/section>",
"<",
"/div>",
"<",
"/div>)}",
"<",
"/div>",
"<",
"/div>",
"<",
"/main>",
"<",
"/div>",
"<",
"/I18nProvider>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661569 | [
"import",
"{",
"DiscoverLegacy",
"}",
"from",
"'./discover_legacy'",
";",
"export",
"function",
"createDiscoverLegacyDirective",
"(",
"reactDirective",
")",
"{",
"return",
"reactDirective",
"(",
"DiscoverLegacy",
",",
"[",
"[",
"'addColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'fetch'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'fetchCounter'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'fetchError'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'fieldCounts'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'histogramData'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'hits'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'indexPattern'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'minimumVisibleRows'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onAddFilter'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onChangeInterval'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onMoveColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onRemoveColumn'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onSetColumns'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onSkipBottomButtonClick'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'onSort'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'opts'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'resetQuery'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'resultState'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'rows'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'savedSearch'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'searchSource'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'setIndexPattern'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'showSaveQuery'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'state'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'timefilterUpdateHandler'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'timeRange'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'topNavMenu'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'updateQuery'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'updateSavedQueryId'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"[",
"'vis'",
",",
"{",
"watchDepth",
":",
"'reference'",
"}",
"]",
",",
"]",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661570 | [
"import",
"'./application/index.scss'",
";",
"import",
"angular",
"from",
"'angular'",
";",
"import",
"'angular-sanitize'",
";",
"import",
"{",
"EuiIcon",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18nDirective",
",",
"i18nFilter",
",",
"I18nProvider",
"}",
"from",
"'@osd/i18n/angular'",
";",
"import",
"{",
"CoreStart",
",",
"PluginInitializerContext",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"DataPublicPluginStart",
"}",
"from",
"'../../data/public'",
";",
"import",
"{",
"Storage",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"NavigationPublicPluginStart",
"as",
"NavigationStart",
"}",
"from",
"'../../navigation/public'",
";",
"import",
"{",
"createDocTableDirective",
"}",
"from",
"'./application/angular/doc_table'",
";",
"import",
"{",
"createTableHeaderDirective",
"}",
"from",
"'./application/angular/doc_table/components/table_header'",
";",
"import",
"{",
"createToolBarPagerButtonsDirective",
",",
"createToolBarPagerTextDirective",
",",
"}",
"from",
"'./application/angular/doc_table/components/pager'",
";",
"import",
"{",
"createTableRowDirective",
"}",
"from",
"'./application/angular/doc_table/components/table_row'",
";",
"import",
"{",
"createPagerFactory",
"}",
"from",
"'./application/angular/doc_table/lib/pager/pager_factory'",
";",
"import",
"{",
"createInfiniteScrollDirective",
"}",
"from",
"'./application/angular/doc_table/infinite_scroll'",
";",
"import",
"{",
"createDocViewerDirective",
"}",
"from",
"'./application/angular/doc_viewer'",
";",
"import",
"{",
"createRenderCompleteDirective",
"}",
"from",
"'./application/angular/directives/render_complete'",
";",
"import",
"{",
"initAngularBootstrap",
",",
"configureAppAngularModule",
",",
"PrivateProvider",
",",
"PromiseServiceCreator",
",",
"registerListenEventListener",
",",
"watchMultiDecorator",
",",
"createTopNavDirective",
",",
"createTopNavHelper",
",",
"}",
"from",
"'../../opensearch_dashboards_legacy/public'",
";",
"import",
"{",
"createContextErrorMessageDirective",
"}",
"from",
"'./application/components/context_error_message'",
";",
"import",
"{",
"DiscoverStartPlugins",
"}",
"from",
"'./plugin'",
";",
"import",
"{",
"getScopedHistory",
"}",
"from",
"'./opensearch_dashboards_services'",
";",
"import",
"{",
"createDiscoverLegacyDirective",
"}",
"from",
"'./application/components/create_discover_legacy_directive'",
";",
"/**\n * returns the main inner angular module, it contains all the parts of Angular Discover\n * needs to render, so in the end the current 'opensearchDashboards' angular module is no longer necessary\n */",
"export",
"function",
"getInnerAngularModule",
"(",
"name",
",",
"core",
",",
"deps",
",",
"context",
")",
"{",
"initAngularBootstrap",
"(",
")",
";",
"const",
"module",
"=",
"initializeInnerAngularModule",
"(",
"name",
",",
"core",
",",
"deps",
".",
"navigation",
",",
"deps",
".",
"data",
")",
";",
"configureAppAngularModule",
"(",
"module",
",",
"{",
"core",
",",
"env",
":",
"context",
".",
"env",
"}",
",",
"true",
",",
"getScopedHistory",
")",
";",
"return",
"module",
";",
"}",
"/**\n * returns a slimmer inner angular module for embeddable rendering\n */",
"export",
"function",
"getInnerAngularModuleEmbeddable",
"(",
"name",
",",
"core",
",",
"deps",
")",
"{",
"return",
"initializeInnerAngularModule",
"(",
"name",
",",
"core",
",",
"deps",
".",
"navigation",
",",
"deps",
".",
"data",
",",
"true",
")",
";",
"}",
"let",
"initialized",
"=",
"false",
";",
"export",
"function",
"initializeInnerAngularModule",
"(",
"name",
"=",
"'app/discover'",
",",
"core",
",",
"navigation",
",",
"data",
",",
"embeddable",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"initialized",
")",
"{",
"createLocalI18nModule",
"(",
")",
";",
"createLocalPrivateModule",
"(",
")",
";",
"createLocalPromiseModule",
"(",
")",
";",
"createLocalTopNavModule",
"(",
"navigation",
")",
";",
"createLocalStorageModule",
"(",
")",
";",
"createPagerFactoryModule",
"(",
")",
";",
"createDocTableModule",
"(",
")",
";",
"initialized",
"=",
"true",
";",
"}",
"if",
"(",
"embeddable",
")",
"{",
"return",
"angular",
".",
"module",
"(",
"name",
",",
"[",
"'ngSanitize'",
",",
"'react'",
",",
"'ui.bootstrap'",
",",
"'discoverI18n'",
",",
"'discoverPrivate'",
",",
"'discoverDocTable'",
",",
"'discoverPagerFactory'",
",",
"'discoverPromise'",
",",
"]",
")",
".",
"config",
"(",
"watchMultiDecorator",
")",
".",
"directive",
"(",
"'icon'",
",",
"(",
"reactDirective",
")",
"=>",
"reactDirective",
"(",
"EuiIcon",
")",
")",
".",
"directive",
"(",
"'renderComplete'",
",",
"createRenderCompleteDirective",
")",
";",
"}",
"return",
"angular",
".",
"module",
"(",
"name",
",",
"[",
"'ngSanitize'",
",",
"'ngRoute'",
",",
"'react'",
",",
"'ui.bootstrap'",
",",
"'discoverI18n'",
",",
"'discoverPrivate'",
",",
"'discoverPromise'",
",",
"'discoverTopNav'",
",",
"'discoverLocalStorageProvider'",
",",
"'discoverDocTable'",
",",
"'discoverPagerFactory'",
",",
"]",
")",
".",
"config",
"(",
"watchMultiDecorator",
")",
".",
"run",
"(",
"registerListenEventListener",
")",
".",
"directive",
"(",
"'renderComplete'",
",",
"createRenderCompleteDirective",
")",
".",
"directive",
"(",
"'discoverLegacy'",
",",
"createDiscoverLegacyDirective",
")",
".",
"directive",
"(",
"'contextErrorMessage'",
",",
"createContextErrorMessageDirective",
")",
";",
"}",
"function",
"createLocalPromiseModule",
"(",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverPromise'",
",",
"[",
"]",
")",
".",
"service",
"(",
"'Promise'",
",",
"PromiseServiceCreator",
")",
";",
"}",
"function",
"createLocalPrivateModule",
"(",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverPrivate'",
",",
"[",
"]",
")",
".",
"provider",
"(",
"'Private'",
",",
"PrivateProvider",
")",
";",
"}",
"function",
"createLocalTopNavModule",
"(",
"navigation",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverTopNav'",
",",
"[",
"'react'",
"]",
")",
".",
"directive",
"(",
"'osdTopNav'",
",",
"createTopNavDirective",
")",
".",
"directive",
"(",
"'osdTopNavHelper'",
",",
"createTopNavHelper",
"(",
"navigation",
".",
"ui",
")",
")",
";",
"}",
"function",
"createLocalI18nModule",
"(",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverI18n'",
",",
"[",
"]",
")",
".",
"provider",
"(",
"'i18n'",
",",
"I18nProvider",
")",
".",
"filter",
"(",
"'i18n'",
",",
"i18nFilter",
")",
".",
"directive",
"(",
"'i18nId'",
",",
"i18nDirective",
")",
";",
"}",
"function",
"createLocalStorageModule",
"(",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverLocalStorageProvider'",
",",
"[",
"'discoverPrivate'",
"]",
")",
".",
"service",
"(",
"'localStorage'",
",",
"createLocalStorageService",
"(",
"'localStorage'",
")",
")",
".",
"service",
"(",
"'sessionStorage'",
",",
"createLocalStorageService",
"(",
"'sessionStorage'",
")",
")",
";",
"}",
"const",
"createLocalStorageService",
"=",
"function",
"(",
"type",
")",
"{",
"return",
"function",
"(",
"$window",
")",
"{",
"return",
"new",
"Storage",
"(",
"$window",
"[",
"type",
"]",
")",
";",
"}",
";",
"}",
";",
"function",
"createPagerFactoryModule",
"(",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverPagerFactory'",
",",
"[",
"]",
")",
".",
"factory",
"(",
"'pagerFactory'",
",",
"createPagerFactory",
")",
";",
"}",
"function",
"createDocTableModule",
"(",
")",
"{",
"angular",
".",
"module",
"(",
"'discoverDocTable'",
",",
"[",
"'discoverPagerFactory'",
",",
"'react'",
"]",
")",
".",
"directive",
"(",
"'docTable'",
",",
"createDocTableDirective",
")",
".",
"directive",
"(",
"'osdTableHeader'",
",",
"createTableHeaderDirective",
")",
".",
"directive",
"(",
"'toolBarPagerText'",
",",
"createToolBarPagerTextDirective",
")",
".",
"directive",
"(",
"'osdTableRow'",
",",
"createTableRowDirective",
")",
".",
"directive",
"(",
"'toolBarPagerButtons'",
",",
"createToolBarPagerButtonsDirective",
")",
".",
"directive",
"(",
"'osdInfiniteScroll'",
",",
"createInfiniteScrollDirective",
")",
".",
"directive",
"(",
"'docViewer'",
",",
"createDocViewerDirective",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
557,
null,
6417,
null,
615,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
557,
null,
6417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
557,
null,
9411,
null,
6801,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
9411,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
470,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661571 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"angular",
",",
"{",
"auto",
"}",
"from",
"'angular'",
";",
"import",
"{",
"BehaviorSubject",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"filter",
",",
"map",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"AppMountParameters",
",",
"AppUpdater",
",",
"CoreSetup",
",",
"CoreStart",
",",
"Plugin",
",",
"PluginInitializerContext",
",",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"UiActionsStart",
",",
"UiActionsSetup",
"}",
"from",
"'src/plugins/ui_actions/public'",
";",
"import",
"{",
"EmbeddableStart",
",",
"EmbeddableSetup",
"}",
"from",
"'src/plugins/embeddable/public'",
";",
"import",
"{",
"ChartsPluginStart",
"}",
"from",
"'src/plugins/charts/public'",
";",
"import",
"{",
"NavigationPublicPluginStart",
"as",
"NavigationStart",
"}",
"from",
"'src/plugins/navigation/public'",
";",
"import",
"{",
"SharePluginStart",
",",
"SharePluginSetup",
",",
"UrlGeneratorContract",
"}",
"from",
"'src/plugins/share/public'",
";",
"import",
"{",
"VisualizationsStart",
",",
"VisualizationsSetup",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"OpenSearchDashboardsLegacySetup",
",",
"OpenSearchDashboardsLegacyStart",
",",
"}",
"from",
"'src/plugins/opensearch_dashboards_legacy/public'",
";",
"import",
"{",
"UrlForwardingSetup",
",",
"UrlForwardingStart",
"}",
"from",
"'src/plugins/url_forwarding/public'",
";",
"import",
"{",
"HomePublicPluginSetup",
"}",
"from",
"'src/plugins/home/public'",
";",
"import",
"{",
"Start",
"as",
"InspectorPublicPluginStart",
"}",
"from",
"'src/plugins/inspector/public'",
";",
"import",
"{",
"DataPublicPluginStart",
",",
"DataPublicPluginSetup",
",",
"opensearchFilters",
"}",
"from",
"'../../data/public'",
";",
"import",
"{",
"SavedObjectLoader",
"}",
"from",
"'../../saved_objects/public'",
";",
"import",
"{",
"createOsdUrlTracker",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"DEFAULT_APP_CATEGORIES",
"}",
"from",
"'../../../core/public'",
";",
"import",
"{",
"UrlGeneratorState",
"}",
"from",
"'../../share/public'",
";",
"import",
"{",
"DocViewInput",
",",
"DocViewInputFn",
"}",
"from",
"'./application/doc_views/doc_views_types'",
";",
"import",
"{",
"DocViewsRegistry",
"}",
"from",
"'./application/doc_views/doc_views_registry'",
";",
"import",
"{",
"DocViewTable",
"}",
"from",
"'./application/components/table/table'",
";",
"import",
"{",
"JsonCodeBlock",
"}",
"from",
"'./application/components/json_code_block/json_code_block'",
";",
"import",
"{",
"setDocViewsRegistry",
",",
"setUrlTracker",
",",
"setAngularModule",
",",
"setServices",
",",
"setHeaderActionMenuMounter",
",",
"setUiActions",
",",
"setScopedHistory",
",",
"getScopedHistory",
",",
"syncHistoryLocations",
",",
"getServices",
",",
"}",
"from",
"'./opensearch_dashboards_services'",
";",
"import",
"{",
"createSavedSearchesLoader",
"}",
"from",
"'./saved_searches'",
";",
"import",
"{",
"registerFeature",
"}",
"from",
"'./register_feature'",
";",
"import",
"{",
"buildServices",
"}",
"from",
"'./build_services'",
";",
"import",
"{",
"DiscoverUrlGeneratorState",
",",
"DISCOVER_APP_URL_GENERATOR",
",",
"DiscoverUrlGenerator",
",",
"}",
"from",
"'./url_generator'",
";",
"import",
"{",
"SearchEmbeddableFactory",
"}",
"from",
"'./application/embeddable'",
";",
"declare",
"module",
"'../../share/public'",
"{",
"export",
"interface",
"UrlGeneratorStateMapping",
"{",
"[",
"DISCOVER_APP_URL_GENERATOR",
"]",
":",
"UrlGeneratorState",
"<",
"DiscoverUrlGeneratorState",
">",
";",
"}",
"}",
"public",
"export",
"interface",
"DiscoverSetup",
"{",
"docViews",
":",
"{",
"param",
"docViewRaw",
"addDocView",
"(",
"docViewRaw",
")",
":",
"void",
";",
"}",
";",
"}",
"export",
"interface",
"DiscoverStart",
"{",
"savedSearchLoader",
":",
"SavedObjectLoader",
";",
"/**\n * `share` plugin URL generator for Discover app. Use it to generate links into\n * Discover application, example:\n *\n * ```ts\n * const url = await plugins.discover.urlGenerator.createUrl({\n * savedSearchId: '571aaf70-4c88-11e8-b3d7-01146121b73d',\n * indexPatternId: 'c367b774-a4c2-11ea-bb37-0242ac130002',\n * timeRange: {\n * to: 'now',\n * from: 'now-15m',\n * mode: 'relative',\n * },\n * });\n * ```\n */",
"readonly",
"urlGenerator",
":",
"undefined",
"|",
"UrlGeneratorContract",
"<",
"'DISCOVER_APP_URL_GENERATOR'",
">",
";",
"}",
"internal",
"export",
"interface",
"DiscoverSetupPlugins",
"{",
"share",
"?",
":",
"SharePluginSetup",
";",
"uiActions",
":",
"UiActionsSetup",
";",
"embeddable",
":",
"EmbeddableSetup",
";",
"opensearchDashboardsLegacy",
":",
"OpenSearchDashboardsLegacySetup",
";",
"urlForwarding",
":",
"UrlForwardingSetup",
";",
"home",
"?",
":",
"HomePublicPluginSetup",
";",
"visualizations",
":",
"VisualizationsSetup",
";",
"data",
":",
"DataPublicPluginSetup",
";",
"}",
"internal",
"export",
"interface",
"DiscoverStartPlugins",
"{",
"uiActions",
":",
"UiActionsStart",
";",
"embeddable",
":",
"EmbeddableStart",
";",
"navigation",
":",
"NavigationStart",
";",
"charts",
":",
"ChartsPluginStart",
";",
"data",
":",
"DataPublicPluginStart",
";",
"share",
"?",
":",
"SharePluginStart",
";",
"opensearchDashboardsLegacy",
":",
"OpenSearchDashboardsLegacyStart",
";",
"urlForwarding",
":",
"UrlForwardingStart",
";",
"inspector",
":",
"InspectorPublicPluginStart",
";",
"visualizations",
":",
"VisualizationsStart",
";",
"}",
"const",
"innerAngularName",
"=",
"'app/discover'",
";",
"const",
"embeddableAngularName",
"=",
"'app/discoverEmbeddable'",
";",
"/**\n * Contains Discover, one of the oldest parts of OpenSearch Dashboards\n * There are 2 kinds of Angular bootstrapped for rendering, additionally to the main Angular\n * Discover provides embeddables, those contain a slimmer Angular\n */",
"export",
"class",
"DiscoverPlugin",
"implements",
"Plugin",
"<",
"DiscoverSetup",
",",
"DiscoverStart",
",",
"DiscoverSetupPlugins",
",",
"DiscoverStartPlugins",
">",
"{",
"constructor",
"(",
"private",
"readonly",
"initializerContext",
")",
"{",
"}",
"private",
"appStateUpdater",
"=",
"new",
"BehaviorSubject",
"<",
"AppUpdater",
">",
"(",
"(",
")",
"=>",
"(",
"{",
"}",
")",
")",
";",
"private",
"docViewsRegistry",
":",
"DocViewsRegistry",
"|",
"null",
"=",
"null",
";",
"private",
"embeddableInjector",
":",
"auto",
".",
"IInjectorService",
"|",
"null",
"=",
"null",
";",
"private",
"stopUrlTracking",
":",
"(",
"(",
")",
"=>",
"void",
")",
"|",
"undefined",
"=",
"undefined",
";",
"private",
"servicesInitialized",
":",
"boolean",
"=",
"false",
";",
"private",
"innerAngularInitialized",
":",
"boolean",
"=",
"false",
";",
"private",
"urlGenerator",
"?",
":",
"DiscoverStart",
"[",
"'urlGenerator'",
"]",
";",
"/**\n * why are those functions public? they are needed for some mocha tests\n * can be removed once all is Jest\n */",
"public",
"initializeInnerAngular",
"?",
":",
"(",
")",
"=>",
"void",
";",
"public",
"initializeServices",
"?",
":",
"(",
")",
"=>",
"Promise",
"<",
"{",
"core",
":",
"CoreStart",
";",
"plugins",
":",
"DiscoverStartPlugins",
";",
"}",
">",
";",
"setup",
"(",
"core",
",",
"plugins",
")",
"{",
"const",
"baseUrl",
"=",
"core",
".",
"http",
".",
"basePath",
".",
"prepend",
"(",
"'/app/discover'",
")",
";",
"if",
"(",
"plugins",
".",
"share",
")",
"{",
"this",
".",
"urlGenerator",
"=",
"plugins",
".",
"share",
".",
"urlGenerators",
".",
"registerUrlGenerator",
"(",
"new",
"DiscoverUrlGenerator",
"(",
"{",
"appBasePath",
":",
"baseUrl",
",",
"useHash",
":",
"core",
".",
"uiSettings",
".",
"get",
"(",
"'state:storeInSessionStorage'",
")",
",",
"}",
")",
")",
";",
"}",
"this",
".",
"docViewsRegistry",
"=",
"new",
"DocViewsRegistry",
"(",
")",
";",
"setDocViewsRegistry",
"(",
"this",
".",
"docViewsRegistry",
")",
";",
"this",
".",
"docViewsRegistry",
".",
"addDocView",
"(",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'discover.docViews.table.tableTitle'",
",",
"{",
"defaultMessage",
":",
"'Table'",
",",
"}",
")",
",",
"order",
":",
"10",
",",
"component",
":",
"DocViewTable",
",",
"}",
")",
";",
"this",
".",
"docViewsRegistry",
".",
"addDocView",
"(",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'discover.docViews.json.jsonTitle'",
",",
"{",
"defaultMessage",
":",
"'JSON'",
",",
"}",
")",
",",
"order",
":",
"20",
",",
"component",
":",
"JsonCodeBlock",
",",
"}",
")",
";",
"const",
"{",
"appMounted",
",",
"appUnMounted",
",",
"stop",
":",
"stopUrlTracker",
",",
"setActiveUrl",
":",
"setTrackedUrl",
",",
"restorePreviousUrl",
",",
"}",
"=",
"createOsdUrlTracker",
"(",
"{",
"getHistory",
":",
"getScopedHistory",
",",
"baseUrl",
",",
"defaultSubUrl",
":",
"'#/'",
",",
"storageKey",
":",
"`lastUrl:${",
"core",
".",
"http",
".",
"basePath",
".",
"get",
"(",
")",
"}:discover`",
",",
"navLinkUpdater$",
":",
"this",
".",
"appStateUpdater",
",",
"toastNotifications",
":",
"core",
".",
"notifications",
".",
"toasts",
",",
"stateParams",
":",
"[",
"{",
"osdUrlKey",
":",
"'_g'",
",",
"stateUpdate$",
":",
"plugins",
".",
"data",
".",
"query",
".",
"state$",
".",
"pipe",
"(",
"filter",
"(",
"(",
"{",
"changes",
"}",
")",
"=>",
"!",
"!",
"(",
"changes",
".",
"globalFilters",
"||",
"changes",
".",
"time",
"||",
"changes",
".",
"refreshInterval",
")",
")",
",",
"map",
"(",
"(",
"{",
"state",
"}",
")",
"=>",
"(",
"{",
"...",
"state",
",",
"filters",
":",
"state",
".",
"filters",
"?.",
"filter",
"(",
"opensearchFilters",
".",
"isFilterPinned",
")",
",",
"}",
")",
")",
")",
",",
"}",
",",
"]",
",",
"}",
")",
";",
"setUrlTracker",
"(",
"{",
"setTrackedUrl",
",",
"restorePreviousUrl",
"}",
")",
";",
"this",
".",
"stopUrlTracking",
"=",
"(",
")",
"=>",
"{",
"stopUrlTracker",
"(",
")",
";",
"}",
";",
"this",
".",
"docViewsRegistry",
".",
"setAngularInjectorGetter",
"(",
"this",
".",
"getEmbeddableInjector",
")",
";",
"core",
".",
"application",
".",
"register",
"(",
"{",
"id",
":",
"'discover'",
",",
"title",
":",
"'Discover'",
",",
"updater$",
":",
"this",
".",
"appStateUpdater",
".",
"asObservable",
"(",
")",
",",
"order",
":",
"1000",
",",
"euiIconType",
":",
"'inputOutput'",
",",
"defaultPath",
":",
"'#/'",
",",
"category",
":",
"DEFAULT_APP_CATEGORIES",
".",
"opensearchDashboards",
",",
"mount",
":",
"async",
"(",
"params",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"initializeServices",
")",
"{",
"throw",
"Error",
"(",
"'Discover plugin method initializeServices is undefined'",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"initializeInnerAngular",
")",
"{",
"throw",
"Error",
"(",
"'Discover plugin method initializeInnerAngular is undefined'",
")",
";",
"}",
"setScopedHistory",
"(",
"params",
".",
"history",
")",
";",
"setHeaderActionMenuMounter",
"(",
"params",
".",
"setHeaderActionMenu",
")",
";",
"syncHistoryLocations",
"(",
")",
";",
"appMounted",
"(",
")",
";",
"const",
"{",
"plugins",
":",
"{",
"data",
":",
"dataStart",
"}",
",",
"}",
"=",
"await",
"this",
".",
"initializeServices",
"(",
")",
";",
"await",
"this",
".",
"initializeInnerAngular",
"(",
")",
";",
"await",
"dataStart",
".",
"indexPatterns",
".",
"clearCache",
"(",
")",
";",
"const",
"{",
"renderApp",
"}",
"=",
"await",
"import",
"(",
"'./application/application'",
")",
";",
"params",
".",
"element",
".",
"classList",
".",
"add",
"(",
"'dscAppWrapper'",
")",
";",
"const",
"unmount",
"=",
"await",
"renderApp",
"(",
"innerAngularName",
",",
"params",
".",
"element",
")",
";",
"return",
"(",
")",
"=>",
"{",
"params",
".",
"element",
".",
"classList",
".",
"remove",
"(",
"'dscAppWrapper'",
")",
";",
"unmount",
"(",
")",
";",
"appUnMounted",
"(",
")",
";",
"}",
";",
"}",
",",
"}",
")",
";",
"plugins",
".",
"urlForwarding",
".",
"forwardApp",
"(",
"'doc'",
",",
"'discover'",
",",
"(",
"path",
")",
"=>",
"{",
"return",
"`#${",
"path",
"}`",
";",
"}",
")",
";",
"plugins",
".",
"urlForwarding",
".",
"forwardApp",
"(",
"'context'",
",",
"'discover'",
",",
"(",
"path",
")",
"=>",
"{",
"const",
"urlParts",
"=",
"path",
".",
"split",
"(",
"'/'",
")",
";",
"if",
"(",
"urlParts",
"[",
"4",
"]",
")",
"{",
"const",
"newPath",
"=",
"[",
"...",
"urlParts",
".",
"slice",
"(",
"0",
",",
"3",
")",
",",
"...",
"urlParts",
".",
"slice",
"(",
"4",
")",
"]",
".",
"join",
"(",
"'/'",
")",
";",
"return",
"`#${",
"newPath",
"}`",
";",
"}",
"return",
"`#${",
"path",
"}`",
";",
"}",
")",
";",
"plugins",
".",
"urlForwarding",
".",
"forwardApp",
"(",
"'discover'",
",",
"'discover'",
",",
"(",
"path",
")",
"=>",
"{",
"const",
"[",
",",
"id",
",",
"tail",
"]",
"=",
"/discover\\/([^\\?]+)(.*)/",
".",
"exec",
"(",
"path",
")",
"||",
"[",
"]",
";",
"if",
"(",
"!",
"id",
")",
"{",
"return",
"`#${",
"path",
".",
"replace",
"(",
"'/discover'",
",",
"''",
")",
"||",
"'/'",
"}`",
";",
"}",
"return",
"`#/view/${",
"id",
"}${",
"tail",
"||",
"''",
"}`",
";",
"}",
")",
";",
"if",
"(",
"plugins",
".",
"home",
")",
"{",
"registerFeature",
"(",
"plugins",
".",
"home",
")",
";",
"}",
"this",
".",
"registerEmbeddable",
"(",
"core",
",",
"plugins",
")",
";",
"return",
"{",
"docViews",
":",
"{",
"addDocView",
":",
"this",
".",
"docViewsRegistry",
".",
"addDocView",
".",
"bind",
"(",
"this",
".",
"docViewsRegistry",
")",
",",
"}",
",",
"}",
";",
"}",
"start",
"(",
"core",
",",
"plugins",
")",
"{",
"this",
".",
"initializeInnerAngular",
"=",
"async",
"(",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"innerAngularInitialized",
")",
"{",
"return",
";",
"}",
"const",
"{",
"getInnerAngularModule",
"}",
"=",
"await",
"import",
"(",
"'./get_inner_angular'",
")",
";",
"const",
"module",
"=",
"getInnerAngularModule",
"(",
"innerAngularName",
",",
"core",
",",
"plugins",
",",
"this",
".",
"initializerContext",
")",
";",
"setAngularModule",
"(",
"module",
")",
";",
"this",
".",
"innerAngularInitialized",
"=",
"true",
";",
"}",
";",
"setUiActions",
"(",
"plugins",
".",
"uiActions",
")",
";",
"this",
".",
"initializeServices",
"=",
"async",
"(",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"servicesInitialized",
")",
"{",
"return",
"{",
"core",
",",
"plugins",
"}",
";",
"}",
"const",
"services",
"=",
"await",
"buildServices",
"(",
"core",
",",
"plugins",
",",
"this",
".",
"initializerContext",
",",
"this",
".",
"getEmbeddableInjector",
")",
";",
"setServices",
"(",
"services",
")",
";",
"this",
".",
"servicesInitialized",
"=",
"true",
";",
"return",
"{",
"core",
",",
"plugins",
"}",
";",
"}",
";",
"return",
"{",
"urlGenerator",
":",
"this",
".",
"urlGenerator",
",",
"savedSearchLoader",
":",
"createSavedSearchesLoader",
"(",
"{",
"savedObjectsClient",
":",
"core",
".",
"savedObjects",
".",
"client",
",",
"indexPatterns",
":",
"plugins",
".",
"data",
".",
"indexPatterns",
",",
"search",
":",
"plugins",
".",
"data",
".",
"search",
",",
"chrome",
":",
"core",
".",
"chrome",
",",
"overlays",
":",
"core",
".",
"overlays",
",",
"}",
")",
",",
"}",
";",
"}",
"stop",
"(",
")",
"{",
"if",
"(",
"this",
".",
"stopUrlTracking",
")",
"{",
"this",
".",
"stopUrlTracking",
"(",
")",
";",
"}",
"}",
"/**\n * register embeddable with a slimmer embeddable version of inner angular\n */",
"private",
"registerEmbeddable",
"(",
"core",
",",
"plugins",
")",
"{",
"if",
"(",
"!",
"this",
".",
"getEmbeddableInjector",
")",
"{",
"throw",
"Error",
"(",
"'Discover plugin method getEmbeddableInjector is undefined'",
")",
";",
"}",
"const",
"getStartServices",
"=",
"async",
"(",
")",
"=>",
"{",
"const",
"[",
"coreStart",
",",
"deps",
"]",
"=",
"await",
"core",
".",
"getStartServices",
"(",
")",
";",
"return",
"{",
"executeTriggerActions",
":",
"deps",
".",
"uiActions",
".",
"executeTriggerActions",
",",
"isEditable",
":",
"(",
")",
"=>",
"coreStart",
".",
"application",
".",
"capabilities",
".",
"discover",
".",
"save",
"as",
"boolean",
",",
"}",
";",
"}",
";",
"const",
"factory",
"=",
"new",
"SearchEmbeddableFactory",
"(",
"getStartServices",
",",
"this",
".",
"getEmbeddableInjector",
")",
";",
"plugins",
".",
"embeddable",
".",
"registerEmbeddableFactory",
"(",
"factory",
".",
"type",
",",
"factory",
")",
";",
"}",
"private",
"getEmbeddableInjector",
"=",
"async",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"this",
".",
"embeddableInjector",
")",
"{",
"if",
"(",
"!",
"this",
".",
"initializeServices",
")",
"{",
"throw",
"Error",
"(",
"'Discover plugin getEmbeddableInjector: initializeServices is undefined'",
")",
";",
"}",
"const",
"{",
"core",
",",
"plugins",
"}",
"=",
"await",
"this",
".",
"initializeServices",
"(",
")",
";",
"getServices",
"(",
")",
".",
"opensearchDashboardsLegacy",
".",
"loadFontAwesome",
"(",
")",
";",
"const",
"{",
"getInnerAngularModuleEmbeddable",
"}",
"=",
"await",
"import",
"(",
"'./get_inner_angular'",
")",
";",
"getInnerAngularModuleEmbeddable",
"(",
"embeddableAngularName",
",",
"core",
",",
"plugins",
")",
";",
"const",
"mountpoint",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"this",
".",
"embeddableInjector",
"=",
"angular",
".",
"bootstrap",
"(",
"mountpoint",
",",
"[",
"embeddableAngularName",
"]",
")",
";",
"}",
"return",
"this",
".",
"embeddableInjector",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
615,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
501,
null,
12654,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1602,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
557,
null,
6417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
501,
null,
12654,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
24381,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
39,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661572 | [
"import",
"{",
"PluginInitializerContext",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"DiscoverPlugin",
"}",
"from",
"'./plugin'",
";",
"export",
"{",
"DiscoverSetup",
",",
"DiscoverStart",
"}",
"from",
"'./plugin'",
";",
"export",
"function",
"plugin",
"(",
"initializerContext",
")",
"{",
"return",
"new",
"DiscoverPlugin",
"(",
"initializerContext",
")",
";",
"}",
"export",
"{",
"SavedSearch",
",",
"SavedSearchLoader",
",",
"createSavedSearchesLoader",
"}",
"from",
"'./saved_searches'",
";",
"export",
"{",
"ISearchEmbeddable",
",",
"SEARCH_EMBEDDABLE_TYPE",
",",
"SearchInput",
"}",
"from",
"'./application/embeddable'",
";",
"export",
"{",
"DISCOVER_APP_URL_GENERATOR",
",",
"DiscoverUrlGeneratorState",
"}",
"from",
"'./url_generator'",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
24382,
null,
615,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661573 | [
"import",
"{",
"SerializedVis",
",",
"Vis",
",",
"VisSavedObject",
",",
"VisualizeEmbeddableContract",
",",
"VisualizeInput",
",",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"SearchSourceFields",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"SavedObject",
"}",
"from",
"'src/plugins/saved_objects/public'",
";",
"import",
"{",
"cloneDeep",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"ExpressionValueError",
"}",
"from",
"'src/plugins/expressions/public'",
";",
"import",
"{",
"createSavedSearchesLoader",
"}",
"from",
"'../../../../discover/public'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'../types'",
";",
"const",
"createVisualizeEmbeddableAndLinkSavedSearch",
"=",
"async",
"(",
"vis",
",",
"visualizeServices",
")",
"=>",
"{",
"const",
"{",
"chrome",
",",
"data",
",",
"overlays",
",",
"createVisEmbeddableFromObject",
",",
"savedObjects",
"}",
"=",
"visualizeServices",
";",
"const",
"embeddableHandler",
"=",
"(",
"await",
"createVisEmbeddableFromObject",
"(",
"vis",
",",
"{",
"timeRange",
":",
"data",
".",
"query",
".",
"timefilter",
".",
"timefilter",
".",
"getTime",
"(",
")",
",",
"filters",
":",
"data",
".",
"query",
".",
"filterManager",
".",
"getFilters",
"(",
")",
",",
"id",
":",
"''",
",",
"}",
")",
")",
"as",
"VisualizeEmbeddableContract",
";",
"embeddableHandler",
".",
"getOutput$",
"(",
")",
".",
"subscribe",
"(",
"(",
"output",
")",
"=>",
"{",
"if",
"(",
"output",
".",
"error",
")",
"{",
"data",
".",
"search",
".",
"showError",
"(",
"(",
"(",
"output",
".",
"error",
"as",
"unknown",
")",
"as",
"ExpressionValueError",
"[",
"'error'",
"]",
")",
".",
"original",
"||",
"output",
".",
"error",
")",
";",
"}",
"}",
")",
";",
"let",
"savedSearch",
";",
"if",
"(",
"vis",
".",
"data",
".",
"savedSearchId",
")",
"{",
"savedSearch",
"=",
"await",
"createSavedSearchesLoader",
"(",
"{",
"savedObjectsClient",
":",
"savedObjects",
".",
"client",
",",
"indexPatterns",
":",
"data",
".",
"indexPatterns",
",",
"search",
":",
"data",
".",
"search",
",",
"chrome",
",",
"overlays",
",",
"}",
")",
".",
"get",
"(",
"vis",
".",
"data",
".",
"savedSearchId",
")",
";",
"}",
"return",
"{",
"savedSearch",
",",
"embeddableHandler",
"}",
";",
"}",
";",
"export",
"const",
"getVisualizationInstanceFromInput",
"=",
"async",
"(",
"visualizeServices",
",",
"input",
")",
"=>",
"{",
"const",
"{",
"visualizations",
"}",
"=",
"visualizeServices",
";",
"const",
"visState",
"=",
"input",
".",
"savedVis",
"as",
"SerializedVis",
";",
"let",
"vis",
"=",
"await",
"visualizations",
".",
"createVis",
"(",
"visState",
".",
"type",
",",
"cloneDeep",
"(",
"visState",
")",
")",
";",
"if",
"(",
"vis",
".",
"type",
".",
"setup",
")",
"{",
"try",
"{",
"vis",
"=",
"await",
"vis",
".",
"type",
".",
"setup",
"(",
"vis",
")",
";",
"}",
"catch",
"{",
"}",
"}",
"const",
"{",
"embeddableHandler",
",",
"savedSearch",
"}",
"=",
"await",
"createVisualizeEmbeddableAndLinkSavedSearch",
"(",
"vis",
",",
"visualizeServices",
")",
";",
"return",
"{",
"vis",
",",
"embeddableHandler",
",",
"savedSearch",
",",
"}",
";",
"}",
";",
"export",
"const",
"getVisualizationInstance",
"=",
"async",
"(",
"visualizeServices",
",",
"/**\n * opts can be either a saved visualization id passed as string,\n * or an object of new visualization params.\n * Both come from url search query\n */",
"opts",
"?",
")",
"=>",
"{",
"const",
"{",
"visualizations",
",",
"savedVisualizations",
"}",
"=",
"visualizeServices",
";",
"const",
"savedVis",
"=",
"await",
"savedVisualizations",
".",
"get",
"(",
"opts",
")",
";",
"if",
"(",
"typeof",
"opts",
"!==",
"'string'",
")",
"{",
"savedVis",
".",
"searchSourceFields",
"=",
"{",
"index",
":",
"opts",
"?.",
"indexPattern",
"}",
"as",
"SearchSourceFields",
";",
"}",
"const",
"serializedVis",
"=",
"visualizations",
".",
"convertToSerializedVis",
"(",
"savedVis",
")",
";",
"let",
"vis",
"=",
"await",
"visualizations",
".",
"createVis",
"(",
"serializedVis",
".",
"type",
",",
"serializedVis",
")",
";",
"if",
"(",
"vis",
".",
"type",
".",
"setup",
")",
"{",
"try",
"{",
"vis",
"=",
"await",
"vis",
".",
"type",
".",
"setup",
"(",
"vis",
")",
";",
"}",
"catch",
"{",
"}",
"}",
"const",
"{",
"embeddableHandler",
",",
"savedSearch",
"}",
"=",
"await",
"createVisualizeEmbeddableAndLinkSavedSearch",
"(",
"vis",
",",
"visualizeServices",
")",
";",
"return",
"{",
"vis",
",",
"embeddableHandler",
",",
"savedSearch",
",",
"savedVis",
",",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
1742,
null,
2089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
620,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
2089,
null,
5836,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
null,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
2089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4326,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2528,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1742,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661574 | [
"import",
"{",
"useEffect",
",",
"useRef",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"parse",
"}",
"from",
"'query-string'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"redirectWhenMissing",
"}",
"from",
"'../../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"DefaultEditorController",
"}",
"from",
"'../../../../../vis_default_editor/public'",
";",
"import",
"{",
"getVisualizationInstance",
"}",
"from",
"'../get_visualization_instance'",
";",
"import",
"{",
"getEditBreadcrumbs",
",",
"getCreateBreadcrumbs",
"}",
"from",
"'../breadcrumbs'",
";",
"import",
"{",
"SavedVisInstance",
",",
"IEditorController",
",",
"VisualizeServices",
"}",
"from",
"'../../types'",
";",
"import",
"{",
"VisualizeConstants",
"}",
"from",
"'../../visualize_constants'",
";",
"/**\n * This effect is responsible for instantiating a saved vis or creating a new one\n * using url parameters, embedding and destroying it in DOM\n */",
"export",
"const",
"useSavedVisInstance",
"=",
"(",
"services",
",",
"eventEmitter",
",",
"isChromeVisible",
",",
"visualizationIdFromUrl",
")",
"=>",
"{",
"const",
"[",
"state",
",",
"setState",
"]",
"=",
"useState",
"<",
"{",
"savedVisInstance",
"?",
":",
"SavedVisInstance",
";",
"visEditorController",
"?",
":",
"IEditorController",
";",
"}",
">",
"(",
"{",
"}",
")",
";",
"const",
"visEditorRef",
"=",
"useRef",
"<",
"HTMLDivElement",
">",
"(",
"null",
")",
";",
"const",
"visId",
"=",
"useRef",
"(",
"''",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"application",
":",
"{",
"navigateToApp",
"}",
",",
"chrome",
",",
"history",
",",
"http",
":",
"{",
"basePath",
"}",
",",
"setActiveUrl",
",",
"toastNotifications",
",",
"}",
"=",
"services",
";",
"const",
"getSavedVisInstance",
"=",
"async",
"(",
")",
"=>",
"{",
"try",
"{",
"let",
"savedVisInstance",
";",
"if",
"(",
"history",
".",
"location",
".",
"pathname",
"===",
"'/create'",
")",
"{",
"const",
"searchParams",
"=",
"parse",
"(",
"history",
".",
"location",
".",
"search",
")",
";",
"const",
"visTypes",
"=",
"services",
".",
"visualizations",
".",
"all",
"(",
")",
";",
"const",
"visType",
"=",
"visTypes",
".",
"find",
"(",
"(",
"{",
"name",
"}",
")",
"=>",
"name",
"===",
"searchParams",
".",
"type",
")",
";",
"if",
"(",
"!",
"visType",
")",
"{",
"throw",
"new",
"Error",
"(",
"i18n",
".",
"translate",
"(",
"'visualize.createVisualization.noVisTypeErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'You must provide a valid visualization type'",
",",
"}",
")",
")",
";",
"}",
"const",
"shouldHaveIndex",
"=",
"visType",
".",
"requiresSearch",
"&&",
"visType",
".",
"options",
".",
"showIndexSelection",
";",
"const",
"hasIndex",
"=",
"searchParams",
".",
"indexPattern",
"||",
"searchParams",
".",
"savedSearchId",
";",
"if",
"(",
"shouldHaveIndex",
"&&",
"!",
"hasIndex",
")",
"{",
"throw",
"new",
"Error",
"(",
"i18n",
".",
"translate",
"(",
"'visualize.createVisualization.noIndexPatternOrSavedSearchIdErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'You must provide either an indexPattern or a savedSearchId'",
",",
"}",
")",
")",
";",
"}",
"savedVisInstance",
"=",
"await",
"getVisualizationInstance",
"(",
"services",
",",
"searchParams",
")",
";",
"}",
"else",
"{",
"savedVisInstance",
"=",
"await",
"getVisualizationInstance",
"(",
"services",
",",
"visualizationIdFromUrl",
")",
";",
"}",
"const",
"{",
"embeddableHandler",
",",
"savedVis",
",",
"vis",
"}",
"=",
"savedVisInstance",
";",
"if",
"(",
"savedVis",
".",
"id",
")",
"{",
"chrome",
".",
"setBreadcrumbs",
"(",
"getEditBreadcrumbs",
"(",
"savedVis",
".",
"title",
")",
")",
";",
"chrome",
".",
"docTitle",
".",
"change",
"(",
"savedVis",
".",
"title",
")",
";",
"}",
"else",
"{",
"chrome",
".",
"setBreadcrumbs",
"(",
"getCreateBreadcrumbs",
"(",
")",
")",
";",
"}",
"let",
"visEditorController",
";",
"if",
"(",
"isChromeVisible",
")",
"{",
"const",
"Editor",
"=",
"vis",
".",
"type",
".",
"editor",
"||",
"DefaultEditorController",
";",
"visEditorController",
"=",
"new",
"Editor",
"(",
"visEditorRef",
".",
"current",
",",
"vis",
",",
"eventEmitter",
",",
"embeddableHandler",
")",
";",
"}",
"else",
"if",
"(",
"visEditorRef",
".",
"current",
")",
"{",
"embeddableHandler",
".",
"render",
"(",
"visEditorRef",
".",
"current",
")",
";",
"}",
"setState",
"(",
"{",
"savedVisInstance",
",",
"visEditorController",
",",
"}",
")",
";",
"}",
"catch",
"(",
"error",
")",
"{",
"const",
"managementRedirectTarget",
"=",
"{",
"app",
":",
"'management'",
",",
"path",
":",
"`opensearch-dashboards/objects/savedVisualizations/${",
"visualizationIdFromUrl",
"}`",
",",
"}",
";",
"try",
"{",
"redirectWhenMissing",
"(",
"{",
"history",
",",
"navigateToApp",
",",
"toastNotifications",
",",
"basePath",
",",
"mapping",
":",
"{",
"visualization",
":",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
",",
"search",
":",
"managementRedirectTarget",
",",
"'index-pattern'",
":",
"managementRedirectTarget",
",",
"'index-pattern-field'",
":",
"managementRedirectTarget",
",",
"}",
",",
"onBeforeRedirect",
"(",
")",
"{",
"setActiveUrl",
"(",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
")",
";",
"}",
",",
"}",
")",
"(",
"error",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"toastNotifications",
".",
"addWarning",
"(",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'visualize.createVisualization.failedToLoadErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'Failed to load the visualization'",
",",
"}",
")",
",",
"text",
":",
"e",
".",
"message",
",",
"}",
")",
";",
"history",
".",
"replace",
"(",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
")",
";",
"}",
"}",
"}",
";",
"if",
"(",
"isChromeVisible",
"===",
"undefined",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"visId",
".",
"current",
")",
"{",
"visId",
".",
"current",
"=",
"visualizationIdFromUrl",
"||",
"'new'",
";",
"getSavedVisInstance",
"(",
")",
";",
"}",
"else",
"if",
"(",
"visualizationIdFromUrl",
"&&",
"visId",
".",
"current",
"!==",
"visualizationIdFromUrl",
"&&",
"state",
".",
"savedVisInstance",
"?.",
"savedVis",
".",
"id",
"!==",
"visualizationIdFromUrl",
")",
"{",
"visId",
".",
"current",
"=",
"visualizationIdFromUrl",
";",
"setState",
"(",
"{",
"}",
")",
";",
"getSavedVisInstance",
"(",
")",
";",
"}",
"}",
",",
"[",
"eventEmitter",
",",
"isChromeVisible",
",",
"services",
",",
"state",
".",
"savedVisInstance",
",",
"state",
".",
"visEditorController",
",",
"visualizationIdFromUrl",
",",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"return",
"(",
")",
"=>",
"{",
"if",
"(",
"state",
".",
"visEditorController",
")",
"{",
"state",
".",
"visEditorController",
".",
"destroy",
"(",
")",
";",
"}",
"else",
"if",
"(",
"state",
".",
"savedVisInstance",
"?.",
"embeddableHandler",
")",
"{",
"state",
".",
"savedVisInstance",
".",
"embeddableHandler",
".",
"destroy",
"(",
")",
";",
"}",
"if",
"(",
"state",
".",
"savedVisInstance",
"?.",
"savedVis",
")",
"{",
"state",
".",
"savedVisInstance",
".",
"savedVis",
".",
"destroy",
"(",
")",
";",
"}",
"}",
";",
"}",
",",
"[",
"state",
"]",
")",
";",
"return",
"{",
"...",
"state",
",",
"visEditorRef",
",",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2089,
null,
400,
null,
8,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
23199,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5837,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661575 | [
"import",
"{",
"isFunction",
",",
"omitBy",
",",
"union",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"migrateAppState",
"}",
"from",
"'./migrate_app_state'",
";",
"import",
"{",
"createStateContainer",
",",
"syncState",
",",
"IOsdUrlStateStorage",
",",
"}",
"from",
"'../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"PureVisState",
",",
"VisualizeAppState",
",",
"VisualizeAppStateTransitions",
"}",
"from",
"'../types'",
";",
"const",
"STATE_STORAGE_KEY",
"=",
"'_a'",
";",
"interface",
"Arguments",
"{",
"osdUrlStateStorage",
":",
"IOsdUrlStateStorage",
";",
"stateDefaults",
":",
"VisualizeAppState",
";",
"byValue",
"?",
":",
"boolean",
";",
"}",
"function",
"toObject",
"(",
"state",
")",
"{",
"return",
"omitBy",
"(",
"state",
",",
"(",
"value",
",",
"key",
")",
"=>",
"{",
"return",
"key",
".",
"charAt",
"(",
"0",
")",
"===",
"'$'",
"||",
"key",
".",
"charAt",
"(",
"0",
")",
"===",
"'_'",
"||",
"isFunction",
"(",
"value",
")",
";",
"}",
")",
"as",
"PureVisState",
";",
"}",
"const",
"pureTransitions",
"=",
"{",
"set",
":",
"(",
"state",
")",
"=>",
"(",
"prop",
",",
"value",
")",
"=>",
"(",
"{",
"...",
"state",
",",
"[",
"prop",
"]",
":",
"value",
"}",
")",
",",
"setVis",
":",
"(",
"state",
")",
"=>",
"(",
"vis",
")",
"=>",
"(",
"{",
"...",
"state",
",",
"vis",
":",
"{",
"...",
"state",
".",
"vis",
",",
"...",
"vis",
",",
"}",
",",
"}",
")",
",",
"unlinkSavedSearch",
":",
"(",
"state",
")",
"=>",
"(",
"{",
"query",
",",
"parentFilters",
"=",
"[",
"]",
"}",
")",
"=>",
"(",
"{",
"...",
"state",
",",
"query",
":",
"query",
"||",
"state",
".",
"query",
",",
"filters",
":",
"union",
"(",
"state",
".",
"filters",
",",
"parentFilters",
")",
",",
"linked",
":",
"false",
",",
"}",
")",
",",
"updateVisState",
":",
"(",
"state",
")",
"=>",
"(",
"newVisState",
")",
"=>",
"(",
"{",
"...",
"state",
",",
"vis",
":",
"toObject",
"(",
"newVisState",
")",
"}",
")",
",",
"updateSavedQuery",
":",
"(",
"state",
")",
"=>",
"(",
"savedQueryId",
")",
"=>",
"{",
"const",
"updatedState",
"=",
"{",
"...",
"state",
",",
"savedQuery",
":",
"savedQueryId",
",",
"}",
";",
"if",
"(",
"!",
"savedQueryId",
")",
"{",
"delete",
"updatedState",
".",
"savedQuery",
";",
"}",
"return",
"updatedState",
";",
"}",
",",
"}",
"as",
"VisualizeAppStateTransitions",
";",
"function",
"createVisualizeByValueAppState",
"(",
"stateDefaults",
")",
"{",
"const",
"initialState",
"=",
"migrateAppState",
"(",
"{",
"...",
"stateDefaults",
",",
"...",
"stateDefaults",
",",
"}",
")",
";",
"const",
"stateContainer",
"=",
"createStateContainer",
"<",
"VisualizeAppState",
",",
"VisualizeAppStateTransitions",
">",
"(",
"initialState",
",",
"pureTransitions",
")",
";",
"const",
"stopStateSync",
"=",
"(",
")",
"=>",
"{",
"}",
";",
"return",
"{",
"stateContainer",
",",
"stopStateSync",
"}",
";",
"}",
"function",
"createDefaultVisualizeAppState",
"(",
"{",
"stateDefaults",
",",
"osdUrlStateStorage",
"}",
")",
"{",
"const",
"urlState",
"=",
"osdUrlStateStorage",
".",
"get",
"<",
"VisualizeAppState",
">",
"(",
"STATE_STORAGE_KEY",
")",
";",
"const",
"initialState",
"=",
"migrateAppState",
"(",
"{",
"...",
"stateDefaults",
",",
"...",
"urlState",
",",
"}",
")",
";",
"osdUrlStateStorage",
".",
"set",
"(",
"STATE_STORAGE_KEY",
",",
"initialState",
",",
"{",
"replace",
":",
"true",
"}",
")",
";",
"const",
"stateContainer",
"=",
"createStateContainer",
"<",
"VisualizeAppState",
",",
"VisualizeAppStateTransitions",
">",
"(",
"initialState",
",",
"pureTransitions",
")",
";",
"const",
"{",
"start",
":",
"startStateSync",
",",
"stop",
":",
"stopStateSync",
"}",
"=",
"syncState",
"(",
"{",
"storageKey",
":",
"STATE_STORAGE_KEY",
",",
"stateContainer",
":",
"{",
"...",
"stateContainer",
",",
"set",
":",
"(",
"state",
")",
"=>",
"{",
"if",
"(",
"state",
")",
"{",
"stateContainer",
".",
"set",
"(",
"state",
")",
";",
"}",
"}",
",",
"}",
",",
"stateStorage",
":",
"osdUrlStateStorage",
",",
"}",
")",
";",
"startStateSync",
"(",
")",
";",
"return",
"{",
"stateContainer",
",",
"stopStateSync",
"}",
";",
"}",
"export",
"function",
"createVisualizeAppState",
"(",
"{",
"stateDefaults",
",",
"osdUrlStateStorage",
",",
"byValue",
"}",
")",
"{",
"if",
"(",
"byValue",
")",
"{",
"return",
"createVisualizeByValueAppState",
"(",
"stateDefaults",
")",
";",
"}",
"return",
"createDefaultVisualizeAppState",
"(",
"{",
"stateDefaults",
",",
"osdUrlStateStorage",
"}",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13413,
null,
13413,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26163,
null,
null,
null,
null,
null,
2584,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2584,
null,
null,
null,
20,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2584,
null,
null,
null,
16564,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2584,
null,
null,
null,
2,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
2584,
null,
null,
null,
2584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661576 | [
"import",
"React",
",",
"{",
"useEffect",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"cloneDeep",
",",
"isEqual",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"map",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"MarkdownSimple",
",",
"toMountPoint",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"migrateLegacyQuery",
"}",
"from",
"'../migrate_legacy_query'",
";",
"import",
"{",
"opensearchFilters",
",",
"connectToQueryState",
"}",
"from",
"'../../../../../data/public'",
";",
"import",
"{",
"VisualizeServices",
",",
"VisualizeAppStateContainer",
",",
"VisualizeEditorVisInstance",
",",
"}",
"from",
"'../../types'",
";",
"import",
"{",
"visStateToEditorState",
"}",
"from",
"'../utils'",
";",
"import",
"{",
"createVisualizeAppState",
"}",
"from",
"'../create_visualize_app_state'",
";",
"import",
"{",
"VisualizeConstants",
"}",
"from",
"'../../visualize_constants'",
";",
"/**\n * This effect is responsible for instantiating the visualize app state container,\n * which is in sync with \"_a\" url param\n */",
"export",
"const",
"useVisualizeAppState",
"=",
"(",
"services",
",",
"eventEmitter",
",",
"instance",
"?",
")",
"=>",
"{",
"const",
"[",
"hasUnappliedChanges",
",",
"setHasUnappliedChanges",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"[",
"appState",
",",
"setAppState",
"]",
"=",
"useState",
"<",
"VisualizeAppStateContainer",
"|",
"null",
">",
"(",
"null",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"instance",
")",
"{",
"const",
"stateDefaults",
"=",
"visStateToEditorState",
"(",
"instance",
",",
"services",
")",
";",
"const",
"byValue",
"=",
"!",
"(",
"'savedVis'",
"in",
"instance",
")",
";",
"const",
"{",
"stateContainer",
",",
"stopStateSync",
"}",
"=",
"createVisualizeAppState",
"(",
"{",
"stateDefaults",
",",
"osdUrlStateStorage",
":",
"services",
".",
"osdUrlStateStorage",
",",
"byValue",
",",
"}",
")",
";",
"const",
"onDirtyStateChange",
"=",
"(",
"{",
"isDirty",
"}",
")",
"=>",
"{",
"if",
"(",
"!",
"isDirty",
")",
"{",
"stateContainer",
".",
"transitions",
".",
"updateVisState",
"(",
"visStateToEditorState",
"(",
"instance",
",",
"services",
")",
".",
"vis",
")",
";",
"}",
"setHasUnappliedChanges",
"(",
"isDirty",
")",
";",
"}",
";",
"eventEmitter",
".",
"on",
"(",
"'dirtyStateChange'",
",",
"onDirtyStateChange",
")",
";",
"const",
"{",
"filterManager",
",",
"queryString",
"}",
"=",
"services",
".",
"data",
".",
"query",
";",
"filterManager",
".",
"setAppFilters",
"(",
"cloneDeep",
"(",
"stateContainer",
".",
"getState",
"(",
")",
".",
"filters",
")",
")",
";",
"queryString",
".",
"setQuery",
"(",
"migrateLegacyQuery",
"(",
"stateContainer",
".",
"getState",
"(",
")",
".",
"query",
")",
")",
";",
"const",
"stopSyncingAppFilters",
"=",
"connectToQueryState",
"(",
"services",
".",
"data",
".",
"query",
",",
"{",
"set",
":",
"(",
"{",
"filters",
",",
"query",
"}",
")",
"=>",
"{",
"stateContainer",
".",
"transitions",
".",
"set",
"(",
"'filters'",
",",
"filters",
")",
";",
"stateContainer",
".",
"transitions",
".",
"set",
"(",
"'query'",
",",
"query",
")",
";",
"}",
",",
"get",
":",
"(",
")",
"=>",
"{",
"return",
"{",
"filters",
":",
"stateContainer",
".",
"getState",
"(",
")",
".",
"filters",
",",
"query",
":",
"stateContainer",
".",
"getState",
"(",
")",
".",
"query",
",",
"}",
";",
"}",
",",
"state$",
":",
"stateContainer",
".",
"state$",
".",
"pipe",
"(",
"map",
"(",
"(",
"state",
")",
"=>",
"(",
"{",
"filters",
":",
"state",
".",
"filters",
",",
"query",
":",
"state",
".",
"query",
",",
"}",
")",
")",
")",
",",
"}",
",",
"{",
"filters",
":",
"opensearchFilters",
".",
"FilterStateStore",
".",
"APP_STATE",
",",
"query",
":",
"true",
",",
"}",
")",
";",
"if",
"(",
"!",
"isEqual",
"(",
"stateContainer",
".",
"getState",
"(",
")",
".",
"vis",
",",
"stateDefaults",
".",
"vis",
")",
")",
"{",
"const",
"{",
"aggs",
",",
"...",
"visState",
"}",
"=",
"stateContainer",
".",
"getState",
"(",
")",
".",
"vis",
";",
"instance",
".",
"vis",
".",
"setState",
"(",
"{",
"...",
"visState",
",",
"data",
":",
"{",
"aggs",
"}",
"}",
")",
".",
"then",
"(",
"(",
")",
"=>",
"{",
"setAppState",
"(",
"stateContainer",
")",
";",
"}",
")",
".",
"catch",
"(",
"(",
"error",
")",
"=>",
"{",
"services",
".",
"toastNotifications",
".",
"addWarning",
"(",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'visualize.visualizationLoadingFailedErrorMessage'",
",",
"{",
"defaultMessage",
":",
"'Failed to load the visualization'",
",",
"}",
")",
",",
"text",
":",
"toMountPoint",
"(",
"<",
"MarkdownSimple",
">",
"{",
"error",
".",
"message",
"}",
"<",
"/MarkdownSimple>),",
"}",
")",
";",
"services",
".",
"history",
".",
"replace",
"(",
"`${",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
"}?notFound=visualization`",
")",
";",
"}",
")",
";",
"}",
"else",
"{",
"setAppState",
"(",
"stateContainer",
")",
";",
"}",
"return",
"(",
")",
"=>",
"{",
"eventEmitter",
".",
"off",
"(",
"'dirtyStateChange'",
",",
"onDirtyStateChange",
")",
";",
"stopStateSync",
"(",
")",
";",
"stopSyncingAppFilters",
"(",
")",
";",
"}",
";",
"}",
"}",
",",
"[",
"eventEmitter",
",",
"instance",
",",
"services",
"]",
")",
";",
"return",
"{",
"appState",
",",
"hasUnappliedChanges",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
2089,
null,
400,
null,
8584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661577 | [
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"useEffect",
",",
"useRef",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"VisualizeInput",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"ByValueVisInstance",
",",
"IEditorController",
",",
"VisualizeServices",
"}",
"from",
"'../../types'",
";",
"import",
"{",
"getVisualizationInstanceFromInput",
"}",
"from",
"'../get_visualization_instance'",
";",
"import",
"{",
"getBreadcrumbsPrefixedWithApp",
",",
"getEditBreadcrumbs",
"}",
"from",
"'../breadcrumbs'",
";",
"import",
"{",
"DefaultEditorController",
"}",
"from",
"'../../../../../vis_default_editor/public'",
";",
"export",
"const",
"useVisByValue",
"=",
"(",
"services",
",",
"eventEmitter",
",",
"isChromeVisible",
",",
"valueInput",
"?",
",",
"originatingApp",
"?",
")",
"=>",
"{",
"const",
"[",
"state",
",",
"setState",
"]",
"=",
"useState",
"<",
"{",
"byValueVisInstance",
"?",
":",
"ByValueVisInstance",
";",
"visEditorController",
"?",
":",
"IEditorController",
";",
"}",
">",
"(",
"{",
"}",
")",
";",
"const",
"visEditorRef",
"=",
"useRef",
"<",
"HTMLDivElement",
">",
"(",
"null",
")",
";",
"const",
"loaded",
"=",
"useRef",
"(",
"false",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"chrome",
"}",
"=",
"services",
";",
"const",
"getVisInstance",
"=",
"async",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"valueInput",
"||",
"loaded",
".",
"current",
")",
"{",
"return",
";",
"}",
"const",
"byValueVisInstance",
"=",
"await",
"getVisualizationInstanceFromInput",
"(",
"services",
",",
"valueInput",
")",
";",
"const",
"{",
"embeddableHandler",
",",
"vis",
"}",
"=",
"byValueVisInstance",
";",
"const",
"Editor",
"=",
"vis",
".",
"type",
".",
"editor",
"||",
"DefaultEditorController",
";",
"const",
"visEditorController",
"=",
"new",
"Editor",
"(",
"visEditorRef",
".",
"current",
",",
"vis",
",",
"eventEmitter",
",",
"embeddableHandler",
")",
";",
"if",
"(",
"chrome",
"&&",
"originatingApp",
")",
"{",
"chrome",
".",
"setBreadcrumbs",
"(",
"getBreadcrumbsPrefixedWithApp",
"(",
"originatingApp",
")",
")",
";",
"}",
"else",
"if",
"(",
"chrome",
")",
"{",
"chrome",
".",
"setBreadcrumbs",
"(",
"getEditBreadcrumbs",
"(",
")",
")",
";",
"}",
"loaded",
".",
"current",
"=",
"true",
";",
"setState",
"(",
"{",
"byValueVisInstance",
",",
"visEditorController",
",",
"}",
")",
";",
"}",
";",
"getVisInstance",
"(",
")",
";",
"}",
",",
"[",
"eventEmitter",
",",
"isChromeVisible",
",",
"services",
",",
"state",
".",
"byValueVisInstance",
",",
"state",
".",
"visEditorController",
",",
"valueInput",
",",
"originatingApp",
",",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"return",
"(",
")",
"=>",
"{",
"if",
"(",
"state",
".",
"visEditorController",
")",
"{",
"state",
".",
"visEditorController",
".",
"destroy",
"(",
")",
";",
"}",
"else",
"if",
"(",
"state",
".",
"byValueVisInstance",
"?.",
"embeddableHandler",
")",
"{",
"state",
".",
"byValueVisInstance",
".",
"embeddableHandler",
".",
"destroy",
"(",
")",
";",
"}",
"}",
";",
"}",
",",
"[",
"state",
"]",
")",
";",
"return",
"{",
"...",
"state",
",",
"visEditorRef",
",",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2089,
null,
400,
null,
8,
null,
5836,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661578 | [
"import",
"'./visualize_listing.scss'",
";",
"import",
"React",
",",
"{",
"useCallback",
",",
"useRef",
",",
"useMemo",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"useUnmount",
",",
"useMount",
"}",
"from",
"'react-use'",
";",
"import",
"{",
"useLocation",
"}",
"from",
"'react-router-dom'",
";",
"import",
"{",
"useOpenSearchDashboards",
",",
"TableListView",
",",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"VISUALIZE_ENABLE_LABS_SETTING",
"}",
"from",
"'../../../../visualizations/public'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'../types'",
";",
"import",
"{",
"VisualizeConstants",
"}",
"from",
"'../visualize_constants'",
";",
"import",
"{",
"getTableColumns",
",",
"getNoItemsMessage",
"}",
"from",
"'../utils'",
";",
"export",
"const",
"VisualizeListing",
"=",
"(",
")",
"=>",
"{",
"const",
"{",
"services",
":",
"{",
"application",
",",
"chrome",
",",
"history",
",",
"savedVisualizations",
",",
"toastNotifications",
",",
"visualizations",
",",
"savedObjects",
",",
"savedObjectsPublic",
",",
"uiSettings",
",",
"visualizeCapabilities",
",",
"}",
",",
"}",
"=",
"useOpenSearchDashboards",
"<",
"VisualizeServices",
">",
"(",
")",
";",
"const",
"{",
"pathname",
"}",
"=",
"useLocation",
"(",
")",
";",
"const",
"closeNewVisModal",
"=",
"useRef",
"(",
"(",
")",
"=>",
"{",
"}",
")",
";",
"const",
"listingLimit",
"=",
"savedObjectsPublic",
".",
"settings",
".",
"getListingLimit",
"(",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"pathname",
"===",
"'/new'",
")",
"{",
"closeNewVisModal",
".",
"current",
"=",
"visualizations",
".",
"showNewVisModal",
"(",
"{",
"onClose",
":",
"(",
")",
"=>",
"{",
"history",
".",
"push",
"(",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
")",
";",
"}",
",",
"}",
")",
";",
"}",
"else",
"{",
"closeNewVisModal",
".",
"current",
"(",
")",
";",
"}",
"}",
",",
"[",
"history",
",",
"pathname",
",",
"visualizations",
"]",
")",
";",
"useMount",
"(",
"(",
")",
"=>",
"{",
"chrome",
".",
"setBreadcrumbs",
"(",
"[",
"{",
"text",
":",
"i18n",
".",
"translate",
"(",
"'visualize.visualizeListingBreadcrumbsTitle'",
",",
"{",
"defaultMessage",
":",
"'Visualize'",
",",
"}",
")",
",",
"}",
",",
"]",
")",
";",
"chrome",
".",
"docTitle",
".",
"change",
"(",
"i18n",
".",
"translate",
"(",
"'visualize.listingPageTitle'",
",",
"{",
"defaultMessage",
":",
"'Visualize'",
"}",
")",
")",
";",
"}",
")",
";",
"useUnmount",
"(",
"(",
")",
"=>",
"closeNewVisModal",
".",
"current",
"(",
")",
")",
";",
"const",
"createNewVis",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"closeNewVisModal",
".",
"current",
"=",
"visualizations",
".",
"showNewVisModal",
"(",
")",
";",
"}",
",",
"[",
"visualizations",
"]",
")",
";",
"const",
"editItem",
"=",
"useCallback",
"(",
"(",
"{",
"editUrl",
",",
"editApp",
"}",
")",
"=>",
"{",
"if",
"(",
"editApp",
")",
"{",
"application",
".",
"navigateToApp",
"(",
"editApp",
",",
"{",
"path",
":",
"editUrl",
"}",
")",
";",
"return",
";",
"}",
"history",
".",
"push",
"(",
"editUrl",
")",
";",
"}",
",",
"[",
"application",
",",
"history",
"]",
")",
";",
"const",
"noItemsFragment",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"getNoItemsMessage",
"(",
"createNewVis",
")",
",",
"[",
"createNewVis",
"]",
")",
";",
"const",
"tableColumns",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"getTableColumns",
"(",
"application",
",",
"history",
")",
",",
"[",
"application",
",",
"history",
"]",
")",
";",
"const",
"fetchItems",
"=",
"useCallback",
"(",
"(",
"filter",
")",
"=>",
"{",
"const",
"isLabsEnabled",
"=",
"uiSettings",
".",
"get",
"(",
"VISUALIZE_ENABLE_LABS_SETTING",
")",
";",
"return",
"savedVisualizations",
".",
"findListItems",
"(",
"filter",
",",
"listingLimit",
")",
".",
"then",
"(",
"(",
"{",
"total",
",",
"hits",
"}",
")",
"=>",
"(",
"{",
"total",
",",
"hits",
":",
"hits",
".",
"filter",
"(",
"(",
"result",
")",
"=>",
"isLabsEnabled",
"||",
"result",
".",
"type",
"?.",
"stage",
"!==",
"'experimental'",
")",
",",
"}",
")",
")",
";",
"}",
",",
"[",
"listingLimit",
",",
"savedVisualizations",
",",
"uiSettings",
"]",
")",
";",
"const",
"deleteItems",
"=",
"useCallback",
"(",
"async",
"(",
"selectedItems",
")",
"=>",
"{",
"await",
"Promise",
".",
"all",
"(",
"selectedItems",
".",
"map",
"(",
"(",
"item",
")",
"=>",
"savedObjects",
".",
"client",
".",
"delete",
"(",
"item",
".",
"savedObjectType",
",",
"item",
".",
"id",
")",
")",
")",
".",
"catch",
"(",
"(",
"error",
")",
"=>",
"{",
"toastNotifications",
".",
"addError",
"(",
"error",
",",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'visualize.visualizeListingDeleteErrorTitle'",
",",
"{",
"defaultMessage",
":",
"'Error deleting visualization'",
",",
"}",
")",
",",
"}",
")",
";",
"}",
")",
";",
"}",
",",
"[",
"savedObjects",
".",
"client",
",",
"toastNotifications",
"]",
")",
";",
"return",
"(",
"<",
"TableListView",
"headingId",
"=",
"\"visualizeListingHeading\"",
"createItem",
"=",
"{",
"createNewVis",
"}",
"findItems",
"=",
"{",
"fetchItems",
"}",
"deleteItems",
"=",
"{",
"visualizeCapabilities",
".",
"delete",
"?",
"deleteItems",
":",
"undefined",
"}",
"editItem",
"=",
"{",
"visualizeCapabilities",
".",
"save",
"?",
"editItem",
":",
"undefined",
"}",
"tableColumns",
"=",
"{",
"tableColumns",
"}",
"listingLimit",
"=",
"{",
"listingLimit",
"}",
"initialPageSize",
"=",
"{",
"savedObjectsPublic",
".",
"settings",
".",
"getPerPage",
"(",
")",
"}",
"initialFilter",
"=",
"{",
"''",
"}",
"noItemsFragment",
"=",
"{",
"noItemsFragment",
"}",
"entityName",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visualize.listing.table.entityName'",
",",
"{",
"defaultMessage",
":",
"'visualization'",
",",
"}",
")",
"}",
"entityNamePlural",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visualize.listing.table.entityNamePlural'",
",",
"{",
"defaultMessage",
":",
"'visualizations'",
",",
"}",
")",
"}",
"tableListTitle",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visualize.listing.table.listTitle'",
",",
"{",
"defaultMessage",
":",
"'Visualizations'",
",",
"}",
")",
"}",
"toastNotifications",
"=",
"{",
"toastNotifications",
"}",
"/",
">",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661579 | [
"import",
"React",
",",
"{",
"memo",
",",
"useCallback",
",",
"useMemo",
",",
"useState",
",",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"AppMountParameters",
",",
"OverlayRef",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"VisualizeServices",
",",
"VisualizeAppState",
",",
"VisualizeAppStateContainer",
",",
"VisualizeEditorVisInstance",
",",
"}",
"from",
"'../types'",
";",
"import",
"{",
"APP_NAME",
"}",
"from",
"'../visualize_constants'",
";",
"import",
"{",
"getTopNavConfig",
"}",
"from",
"'../utils'",
";",
"import",
"type",
"{",
"IndexPattern",
"}",
"from",
"'../../../../data/public'",
";",
"interface",
"VisualizeTopNavProps",
"{",
"currentAppState",
":",
"VisualizeAppState",
";",
"isChromeVisible",
"?",
":",
"boolean",
";",
"isEmbeddableRendered",
":",
"boolean",
";",
"hasUnsavedChanges",
":",
"boolean",
";",
"setHasUnsavedChanges",
":",
"(",
"value",
":",
"boolean",
")",
"=>",
"void",
";",
"hasUnappliedChanges",
":",
"boolean",
";",
"originatingApp",
"?",
":",
"string",
";",
"visInstance",
":",
"VisualizeEditorVisInstance",
";",
"setOriginatingApp",
"?",
":",
"(",
"originatingApp",
":",
"string",
"|",
"undefined",
")",
"=>",
"void",
";",
"stateContainer",
":",
"VisualizeAppStateContainer",
";",
"visualizationIdFromUrl",
"?",
":",
"string",
";",
"embeddableId",
"?",
":",
"string",
";",
"onAppLeave",
":",
"AppMountParameters",
"[",
"'onAppLeave'",
"]",
";",
"}",
"const",
"TopNav",
"=",
"(",
"{",
"currentAppState",
",",
"isChromeVisible",
",",
"isEmbeddableRendered",
",",
"hasUnsavedChanges",
",",
"setHasUnsavedChanges",
",",
"hasUnappliedChanges",
",",
"originatingApp",
",",
"setOriginatingApp",
",",
"visInstance",
",",
"stateContainer",
",",
"visualizationIdFromUrl",
",",
"embeddableId",
",",
"onAppLeave",
",",
"}",
")",
"=>",
"{",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"VisualizeServices",
">",
"(",
")",
";",
"const",
"{",
"TopNavMenu",
"}",
"=",
"services",
".",
"navigation",
".",
"ui",
";",
"const",
"{",
"setHeaderActionMenu",
",",
"visualizeCapabilities",
"}",
"=",
"services",
";",
"const",
"{",
"embeddableHandler",
",",
"vis",
"}",
"=",
"visInstance",
";",
"const",
"[",
"inspectorSession",
",",
"setInspectorSession",
"]",
"=",
"useState",
"<",
"OverlayRef",
">",
"(",
")",
";",
"const",
"openInspector",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"{",
"const",
"session",
"=",
"embeddableHandler",
".",
"openInspector",
"(",
")",
";",
"setInspectorSession",
"(",
"session",
")",
";",
"}",
",",
"[",
"embeddableHandler",
"]",
")",
";",
"const",
"handleRefresh",
"=",
"useCallback",
"(",
"(",
"_payload",
",",
"isUpdate",
"?",
")",
"=>",
"{",
"if",
"(",
"isUpdate",
"===",
"false",
")",
"{",
"visInstance",
".",
"embeddableHandler",
".",
"reload",
"(",
")",
";",
"}",
"}",
",",
"[",
"visInstance",
".",
"embeddableHandler",
"]",
")",
";",
"const",
"stateTransfer",
"=",
"services",
".",
"embeddable",
".",
"getStateTransfer",
"(",
")",
";",
"const",
"config",
"=",
"useMemo",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"isEmbeddableRendered",
")",
"{",
"return",
"getTopNavConfig",
"(",
"{",
"hasUnsavedChanges",
",",
"setHasUnsavedChanges",
",",
"hasUnappliedChanges",
",",
"openInspector",
",",
"originatingApp",
",",
"setOriginatingApp",
",",
"visInstance",
",",
"stateContainer",
",",
"visualizationIdFromUrl",
",",
"stateTransfer",
",",
"embeddableId",
",",
"onAppLeave",
",",
"}",
",",
"services",
")",
";",
"}",
"}",
",",
"[",
"isEmbeddableRendered",
",",
"hasUnsavedChanges",
",",
"setHasUnsavedChanges",
",",
"hasUnappliedChanges",
",",
"openInspector",
",",
"originatingApp",
",",
"visInstance",
",",
"setOriginatingApp",
",",
"stateContainer",
",",
"visualizationIdFromUrl",
",",
"services",
",",
"embeddableId",
",",
"stateTransfer",
",",
"onAppLeave",
",",
"]",
")",
";",
"const",
"[",
"indexPatterns",
",",
"setIndexPatterns",
"]",
"=",
"useState",
"<",
"IndexPattern",
"[",
"]",
">",
"(",
"vis",
".",
"data",
".",
"indexPattern",
"?",
"[",
"vis",
".",
"data",
".",
"indexPattern",
"]",
":",
"[",
"]",
")",
";",
"const",
"showDatePicker",
"=",
"(",
")",
"=>",
"{",
"const",
"hasTimeField",
"=",
"vis",
".",
"data",
".",
"indexPattern",
"?",
"!",
"!",
"vis",
".",
"data",
".",
"indexPattern",
".",
"timeFieldName",
":",
"true",
";",
"return",
"vis",
".",
"type",
".",
"options",
".",
"showTimePicker",
"&&",
"hasTimeField",
";",
"}",
";",
"const",
"showFilterBar",
"=",
"vis",
".",
"type",
".",
"options",
".",
"showFilterBar",
";",
"const",
"showQueryInput",
"=",
"vis",
".",
"type",
".",
"requiresSearch",
"&&",
"vis",
".",
"type",
".",
"options",
".",
"showQueryBar",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"return",
"(",
")",
"=>",
"{",
"if",
"(",
"inspectorSession",
")",
"{",
"inspectorSession",
".",
"close",
"(",
")",
";",
"}",
"}",
";",
"}",
",",
"[",
"inspectorSession",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"onAppLeave",
"(",
"(",
"actions",
")",
"=>",
"{",
"if",
"(",
"(",
"(",
"originatingApp",
"&&",
"originatingApp",
"===",
"'dashboards'",
")",
"||",
"originatingApp",
"===",
"'canvas'",
")",
"&&",
"(",
"hasUnappliedChanges",
"||",
"hasUnsavedChanges",
")",
")",
"{",
"return",
"actions",
".",
"confirm",
"(",
"i18n",
".",
"translate",
"(",
"'visualize.confirmModal.confirmTextDescription'",
",",
"{",
"defaultMessage",
":",
"'Leave Visualize editor with unsaved changes?'",
",",
"}",
")",
",",
"i18n",
".",
"translate",
"(",
"'visualize.confirmModal.title'",
",",
"{",
"defaultMessage",
":",
"'Unsaved changes'",
",",
"}",
")",
")",
";",
"}",
"return",
"actions",
".",
"default",
"(",
")",
";",
"}",
")",
";",
"}",
",",
"[",
"onAppLeave",
",",
"hasUnappliedChanges",
",",
"hasUnsavedChanges",
",",
"visualizeCapabilities",
".",
"save",
",",
"originatingApp",
",",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"asyncSetIndexPattern",
"=",
"async",
"(",
")",
"=>",
"{",
"let",
"indexes",
";",
"if",
"(",
"vis",
".",
"type",
".",
"getUsedIndexPattern",
")",
"{",
"indexes",
"=",
"await",
"vis",
".",
"type",
".",
"getUsedIndexPattern",
"(",
"vis",
".",
"params",
")",
";",
"}",
"if",
"(",
"!",
"indexes",
"||",
"!",
"indexes",
".",
"length",
")",
"{",
"const",
"defaultIndex",
"=",
"await",
"services",
".",
"data",
".",
"indexPatterns",
".",
"getDefault",
"(",
")",
";",
"if",
"(",
"defaultIndex",
")",
"{",
"indexes",
"=",
"[",
"defaultIndex",
"]",
";",
"}",
"}",
"if",
"(",
"indexes",
")",
"{",
"setIndexPatterns",
"(",
"indexes",
")",
";",
"}",
"}",
";",
"if",
"(",
"!",
"vis",
".",
"data",
".",
"indexPattern",
")",
"{",
"asyncSetIndexPattern",
"(",
")",
";",
"}",
"}",
",",
"[",
"vis",
".",
"params",
",",
"vis",
".",
"type",
",",
"services",
".",
"data",
".",
"indexPatterns",
",",
"vis",
".",
"data",
".",
"indexPattern",
"]",
")",
";",
"return",
"isChromeVisible",
"?",
"(",
"<",
"TopNavMenu",
"appName",
"=",
"{",
"APP_NAME",
"}",
"config",
"=",
"{",
"config",
"}",
"setMenuMountPoint",
"=",
"{",
"setHeaderActionMenu",
"}",
"onQuerySubmit",
"=",
"{",
"handleRefresh",
"}",
"savedQueryId",
"=",
"{",
"currentAppState",
".",
"savedQuery",
"}",
"onSavedQueryIdChange",
"=",
"{",
"stateContainer",
".",
"transitions",
".",
"updateSavedQuery",
"}",
"indexPatterns",
"=",
"{",
"indexPatterns",
"}",
"screenTitle",
"=",
"{",
"vis",
".",
"title",
"}",
"showAutoRefreshOnly",
"=",
"{",
"!",
"showDatePicker",
"(",
")",
"}",
"showDatePicker",
"=",
"{",
"showDatePicker",
"(",
")",
"}",
"showFilterBar",
"=",
"{",
"showFilterBar",
"}",
"showQueryInput",
"=",
"{",
"showQueryInput",
"}",
"showSaveQuery",
"=",
"{",
"services",
".",
"visualizeCapabilities",
".",
"saveQuery",
"}",
"showSearchBar",
"useDefaultBehaviors",
"/>) : showFilterBar ? (",
"<",
"TopNavMenu",
"appName",
"=",
"{",
"APP_NAME",
"}",
"setMenuMountPoint",
"=",
"{",
"setHeaderActionMenu",
"}",
"indexPatterns",
"=",
"{",
"indexPatterns",
"}",
"showSearchBar",
"showSaveQuery",
"=",
"{",
"false",
"}",
"showDatePicker",
"=",
"{",
"false",
"}",
"showQueryInput",
"=",
"{",
"false",
"}",
"/",
">",
")",
":",
"null",
";",
"}",
";",
"export",
"const",
"VisualizeTopNav",
"=",
"memo",
"(",
"TopNav",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661580 | [
"import",
"React",
",",
"{",
"memo",
"}",
"from",
"'react'",
";",
"import",
"{",
"EuiCallOut",
",",
"EuiLink",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"export",
"const",
"InfoComponent",
"=",
"(",
")",
"=>",
"{",
"const",
"title",
"=",
"(",
"<",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualize.experimentalVisInfoText\"",
"defaultMessage",
"=",
"\"This visualization is experimental and is not subject to the support SLA of official GA features.",
"For",
"feedback",
",",
"please",
"create",
"an",
"issue",
"in",
"{",
"githubLink",
"}",
".",
"\" values={{",
"githubLink",
":",
"(",
"<",
"EuiLink",
"external",
"href",
"=",
"\"https://github.com/opensearch-project/OpenSearch-Dashboards/issues/new/choose\"",
"target",
"=",
"\"_blank\"",
">",
"GitHub",
"<",
"/EuiLink>),",
"}",
"}",
"/>",
"<",
"/>);",
"return",
"(",
"<",
"EuiCallOut",
"className",
"=",
"\"hide-for-sharing\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"experimentalVisInfo\"",
"size",
"=",
"\"s\"",
"title",
"=",
"{",
"title",
"}",
"iconType",
"=",
"\"beaker\"",
"/",
">",
")",
";",
"}",
";",
"export",
"const",
"ExperimentalVisInfo",
"=",
"memo",
"(",
"InfoComponent",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661581 | [
"import",
"'./visualize_editor.scss'",
";",
"import",
"React",
",",
"{",
"RefObject",
"}",
"from",
"'react'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiScreenReaderOnly",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"AppMountParameters",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"VisualizeTopNav",
"}",
"from",
"'./visualize_top_nav'",
";",
"import",
"{",
"ExperimentalVisInfo",
"}",
"from",
"'./experimental_vis_info'",
";",
"import",
"{",
"SavedVisInstance",
",",
"VisualizeAppState",
",",
"VisualizeAppStateContainer",
",",
"VisualizeEditorVisInstance",
",",
"}",
"from",
"'../types'",
";",
"interface",
"VisualizeEditorCommonProps",
"{",
"visInstance",
"?",
":",
"VisualizeEditorVisInstance",
";",
"appState",
":",
"VisualizeAppStateContainer",
"|",
"null",
";",
"currentAppState",
"?",
":",
"VisualizeAppState",
";",
"isChromeVisible",
"?",
":",
"boolean",
";",
"hasUnsavedChanges",
":",
"boolean",
";",
"setHasUnsavedChanges",
":",
"(",
"value",
":",
"boolean",
")",
"=>",
"void",
";",
"hasUnappliedChanges",
":",
"boolean",
";",
"isEmbeddableRendered",
":",
"boolean",
";",
"onAppLeave",
":",
"AppMountParameters",
"[",
"'onAppLeave'",
"]",
";",
"visEditorRef",
":",
"RefObject",
"<",
"HTMLDivElement",
">",
";",
"originatingApp",
"?",
":",
"string",
";",
"setOriginatingApp",
"?",
":",
"(",
"originatingApp",
":",
"string",
"|",
"undefined",
")",
"=>",
"void",
";",
"visualizationIdFromUrl",
"?",
":",
"string",
";",
"embeddableId",
"?",
":",
"string",
";",
"}",
"export",
"const",
"VisualizeEditorCommon",
"=",
"(",
"{",
"visInstance",
",",
"appState",
",",
"currentAppState",
",",
"isChromeVisible",
",",
"hasUnsavedChanges",
",",
"setHasUnsavedChanges",
",",
"hasUnappliedChanges",
",",
"isEmbeddableRendered",
",",
"onAppLeave",
",",
"originatingApp",
",",
"setOriginatingApp",
",",
"visualizationIdFromUrl",
",",
"embeddableId",
",",
"visEditorRef",
",",
"}",
")",
"=>",
"{",
"return",
"(",
"<",
"div",
"className",
"=",
"{",
"`app-container visEditor visEditor--${",
"visInstance",
"?.",
"vis",
".",
"type",
".",
"name",
"}`",
"}",
">",
"{",
"visInstance",
"&&",
"appState",
"&&",
"currentAppState",
"&&",
"(",
"<",
"VisualizeTopNav",
"currentAppState",
"=",
"{",
"currentAppState",
"}",
"hasUnsavedChanges",
"=",
"{",
"hasUnsavedChanges",
"}",
"setHasUnsavedChanges",
"=",
"{",
"setHasUnsavedChanges",
"}",
"isChromeVisible",
"=",
"{",
"isChromeVisible",
"}",
"isEmbeddableRendered",
"=",
"{",
"isEmbeddableRendered",
"}",
"hasUnappliedChanges",
"=",
"{",
"hasUnappliedChanges",
"}",
"originatingApp",
"=",
"{",
"originatingApp",
"}",
"setOriginatingApp",
"=",
"{",
"setOriginatingApp",
"}",
"visInstance",
"=",
"{",
"visInstance",
"}",
"stateContainer",
"=",
"{",
"appState",
"}",
"visualizationIdFromUrl",
"=",
"{",
"visualizationIdFromUrl",
"}",
"embeddableId",
"=",
"{",
"embeddableId",
"}",
"onAppLeave",
"=",
"{",
"onAppLeave",
"}",
"/",
">",
")",
"}",
"{",
"visInstance",
"?.",
"vis",
"?.",
"type",
"?.",
"stage",
"===",
"'experimental'",
"&&",
"<",
"ExperimentalVisInfo",
"/>}",
"{",
"visInstance",
"?.",
"vis",
"?.",
"type",
"?.",
"getInfoMessage",
"?.",
"(",
"visInstance",
".",
"vis",
")",
"}",
"{",
"visInstance",
"&&",
"(",
"<",
"EuiScreenReaderOnly",
">",
"<",
"h1",
">",
"{",
"'savedVis'",
"in",
"visInstance",
"&&",
"visInstance",
".",
"savedVis",
".",
"id",
"?",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"visualize.pageHeading\"",
"defaultMessage",
"=",
"\"{chartName} {chartType} visualization\"",
"values",
"=",
"{",
"{",
"chartName",
":",
"(",
"visInstance",
"as",
"SavedVisInstance",
")",
".",
"savedVis",
".",
"title",
",",
"chartType",
":",
"(",
"visInstance",
"as",
"SavedVisInstance",
")",
".",
"vis",
".",
"type",
".",
"title",
",",
"}",
"}",
"/>) : (<FormattedMessage id=\"visualize.byValue_pageHeading\" defaultMessage=\"Visualization of type {chartType} embedded into {originatingApp} app\" values={{",
"chartType",
":",
"visInstance",
".",
"vis",
".",
"type",
".",
"title",
",",
"originatingApp",
":",
"originatingApp",
"||",
"'dashboards'",
",",
"}",
"}",
"/>)}",
"<",
"/h1>",
"<",
"/EuiScreenReaderOnly>)}",
"<",
"div",
"className",
"=",
"{",
"isChromeVisible",
"?",
"'visEditor__content'",
":",
"'visualize'",
"}",
"ref",
"=",
"{",
"visEditorRef",
"}",
"/",
">",
"<",
"/div>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661582 | [
"import",
"'./visualize_editor.scss'",
";",
"import",
"React",
",",
"{",
"useEffect",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"useParams",
"}",
"from",
"'react-router-dom'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"useChromeVisibility",
",",
"useSavedVisInstance",
",",
"useVisualizeAppState",
",",
"useEditorUpdates",
",",
"useLinkedSearchUpdates",
",",
"}",
"from",
"'../utils'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'../types'",
";",
"import",
"{",
"VisualizeEditorCommon",
"}",
"from",
"'./visualize_editor_common'",
";",
"import",
"{",
"VisualizeAppProps",
"}",
"from",
"'../app'",
";",
"export",
"const",
"VisualizeEditor",
"=",
"(",
"{",
"onAppLeave",
"}",
")",
"=>",
"{",
"const",
"{",
"id",
":",
"visualizationIdFromUrl",
"}",
"=",
"useParams",
"<",
"{",
"id",
":",
"string",
";",
"}",
">",
"(",
")",
";",
"const",
"[",
"originatingApp",
",",
"setOriginatingApp",
"]",
"=",
"useState",
"<",
"string",
">",
"(",
")",
";",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"VisualizeServices",
">",
"(",
")",
";",
"const",
"[",
"eventEmitter",
"]",
"=",
"useState",
"(",
"new",
"EventEmitter",
"(",
")",
")",
";",
"const",
"[",
"hasUnsavedChanges",
",",
"setHasUnsavedChanges",
"]",
"=",
"useState",
"(",
"!",
"visualizationIdFromUrl",
")",
";",
"const",
"isChromeVisible",
"=",
"useChromeVisibility",
"(",
"services",
".",
"chrome",
")",
";",
"const",
"{",
"savedVisInstance",
",",
"visEditorRef",
",",
"visEditorController",
"}",
"=",
"useSavedVisInstance",
"(",
"services",
",",
"eventEmitter",
",",
"isChromeVisible",
",",
"visualizationIdFromUrl",
")",
";",
"const",
"{",
"appState",
",",
"hasUnappliedChanges",
"}",
"=",
"useVisualizeAppState",
"(",
"services",
",",
"eventEmitter",
",",
"savedVisInstance",
")",
";",
"const",
"{",
"isEmbeddableRendered",
",",
"currentAppState",
"}",
"=",
"useEditorUpdates",
"(",
"services",
",",
"eventEmitter",
",",
"setHasUnsavedChanges",
",",
"appState",
",",
"savedVisInstance",
",",
"visEditorController",
")",
";",
"useLinkedSearchUpdates",
"(",
"services",
",",
"eventEmitter",
",",
"appState",
",",
"savedVisInstance",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"originatingApp",
":",
"value",
"}",
"=",
"services",
".",
"embeddable",
".",
"getStateTransfer",
"(",
"services",
".",
"scopedHistory",
")",
".",
"getIncomingEditorState",
"(",
"{",
"keysToRemoveAfterFetch",
":",
"[",
"'id'",
",",
"'input'",
"]",
"}",
")",
"||",
"{",
"}",
";",
"setOriginatingApp",
"(",
"value",
")",
";",
"}",
",",
"[",
"services",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"return",
"(",
")",
"=>",
"{",
"eventEmitter",
".",
"removeAllListeners",
"(",
")",
";",
"}",
";",
"}",
",",
"[",
"eventEmitter",
"]",
")",
";",
"return",
"(",
"<",
"VisualizeEditorCommon",
"visInstance",
"=",
"{",
"savedVisInstance",
"}",
"appState",
"=",
"{",
"appState",
"}",
"currentAppState",
"=",
"{",
"currentAppState",
"}",
"isChromeVisible",
"=",
"{",
"isChromeVisible",
"}",
"hasUnsavedChanges",
"=",
"{",
"hasUnsavedChanges",
"}",
"hasUnappliedChanges",
"=",
"{",
"hasUnappliedChanges",
"}",
"isEmbeddableRendered",
"=",
"{",
"isEmbeddableRendered",
"}",
"originatingApp",
"=",
"{",
"originatingApp",
"}",
"setOriginatingApp",
"=",
"{",
"setOriginatingApp",
"}",
"visualizationIdFromUrl",
"=",
"{",
"visualizationIdFromUrl",
"}",
"setHasUnsavedChanges",
"=",
"{",
"setHasUnsavedChanges",
"}",
"visEditorRef",
"=",
"{",
"visEditorRef",
"}",
"onAppLeave",
"=",
"{",
"onAppLeave",
"}",
"/",
">",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661583 | [
"import",
"React",
",",
"{",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiCallOut",
",",
"EuiLink",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"useOpenSearchDashboards",
",",
"toMountPoint",
",",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'../types'",
";",
"import",
"{",
"VisualizeConstants",
"}",
"from",
"'../visualize_constants'",
";",
"let",
"bannerId",
";",
"export",
"const",
"VisualizeNoMatch",
"=",
"(",
")",
"=>",
"{",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"VisualizeServices",
">",
"(",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"services",
".",
"restorePreviousUrl",
"(",
")",
";",
"const",
"{",
"navigated",
"}",
"=",
"services",
".",
"urlForwarding",
".",
"navigateToLegacyOpenSearchDashboardsUrl",
"(",
"services",
".",
"history",
".",
"location",
".",
"pathname",
")",
";",
"if",
"(",
"!",
"navigated",
")",
"{",
"const",
"bannerMessage",
"=",
"i18n",
".",
"translate",
"(",
"'visualize.noMatchRoute.bannerTitleText'",
",",
"{",
"defaultMessage",
":",
"'Page not found'",
",",
"}",
")",
";",
"bannerId",
"=",
"services",
".",
"overlays",
".",
"banners",
".",
"replace",
"(",
"bannerId",
",",
"toMountPoint",
"(",
"<",
"EuiCallOut",
"color",
"=",
"\"warning\"",
"iconType",
"=",
"\"iInCircle\"",
"title",
"=",
"{",
"bannerMessage",
"}",
">",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visualize.noMatchRoute.bannerText\"",
"defaultMessage",
"=",
"\"Visualize application doesn't recognize this route: {route}.\"",
"values",
"=",
"{",
"{",
"route",
":",
"(",
"<",
"EuiLink",
"href",
"=",
"{",
"window",
".",
"location",
".",
"href",
"}",
">",
"{",
"services",
".",
"history",
".",
"location",
".",
"pathname",
"}",
"<",
"/EuiLink>),",
"}",
"}",
"/>",
"<",
"/p>",
"<",
"/EuiCallOut>));",
"setTimeout",
"(",
"(",
")",
"=>",
"{",
"services",
".",
"overlays",
".",
"banners",
".",
"remove",
"(",
"bannerId",
")",
";",
"}",
",",
"15000",
")",
";",
"services",
".",
"history",
".",
"replace",
"(",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
")",
";",
"}",
"}",
",",
"[",
"services",
"]",
")",
";",
"return",
"null",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661584 | [
"import",
"'./visualize_editor.scss'",
";",
"import",
"React",
",",
"{",
"useEffect",
",",
"useState",
"}",
"from",
"'react'",
";",
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"VisualizeInput",
"}",
"from",
"'src/plugins/visualizations/public'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"useChromeVisibility",
",",
"useVisByValue",
",",
"useVisualizeAppState",
",",
"useEditorUpdates",
",",
"useLinkedSearchUpdates",
",",
"}",
"from",
"'../utils'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'../types'",
";",
"import",
"{",
"VisualizeEditorCommon",
"}",
"from",
"'./visualize_editor_common'",
";",
"import",
"{",
"VisualizeAppProps",
"}",
"from",
"'../app'",
";",
"export",
"const",
"VisualizeByValueEditor",
"=",
"(",
"{",
"onAppLeave",
"}",
")",
"=>",
"{",
"const",
"[",
"originatingApp",
",",
"setOriginatingApp",
"]",
"=",
"useState",
"<",
"string",
">",
"(",
")",
";",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"VisualizeServices",
">",
"(",
")",
";",
"const",
"[",
"eventEmitter",
"]",
"=",
"useState",
"(",
"new",
"EventEmitter",
"(",
")",
")",
";",
"const",
"[",
"hasUnsavedChanges",
",",
"setHasUnsavedChanges",
"]",
"=",
"useState",
"(",
"false",
")",
";",
"const",
"[",
"embeddableId",
",",
"setEmbeddableId",
"]",
"=",
"useState",
"<",
"string",
">",
"(",
")",
";",
"const",
"[",
"valueInput",
",",
"setValueInput",
"]",
"=",
"useState",
"<",
"VisualizeInput",
">",
"(",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"originatingApp",
":",
"value",
",",
"embeddableId",
":",
"embeddableIdValue",
",",
"valueInput",
":",
"valueInputValue",
"}",
"=",
"services",
".",
"embeddable",
".",
"getStateTransfer",
"(",
"services",
".",
"scopedHistory",
")",
".",
"getIncomingEditorState",
"(",
"{",
"keysToRemoveAfterFetch",
":",
"[",
"'id'",
",",
"'embeddableId'",
",",
"'valueInput'",
"]",
"}",
")",
"||",
"{",
"}",
";",
"setOriginatingApp",
"(",
"value",
")",
";",
"setValueInput",
"(",
"valueInputValue",
")",
";",
"setEmbeddableId",
"(",
"embeddableIdValue",
")",
";",
"if",
"(",
"!",
"valueInputValue",
")",
"{",
"history",
".",
"back",
"(",
")",
";",
"}",
"}",
",",
"[",
"services",
"]",
")",
";",
"const",
"isChromeVisible",
"=",
"useChromeVisibility",
"(",
"services",
".",
"chrome",
")",
";",
"const",
"{",
"byValueVisInstance",
",",
"visEditorRef",
",",
"visEditorController",
"}",
"=",
"useVisByValue",
"(",
"services",
",",
"eventEmitter",
",",
"isChromeVisible",
",",
"valueInput",
",",
"originatingApp",
")",
";",
"const",
"{",
"appState",
",",
"hasUnappliedChanges",
"}",
"=",
"useVisualizeAppState",
"(",
"services",
",",
"eventEmitter",
",",
"byValueVisInstance",
")",
";",
"const",
"{",
"isEmbeddableRendered",
",",
"currentAppState",
"}",
"=",
"useEditorUpdates",
"(",
"services",
",",
"eventEmitter",
",",
"setHasUnsavedChanges",
",",
"appState",
",",
"byValueVisInstance",
",",
"visEditorController",
")",
";",
"useLinkedSearchUpdates",
"(",
"services",
",",
"eventEmitter",
",",
"appState",
",",
"byValueVisInstance",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"return",
"(",
")",
"=>",
"{",
"eventEmitter",
".",
"removeAllListeners",
"(",
")",
";",
"}",
";",
"}",
",",
"[",
"eventEmitter",
"]",
")",
";",
"return",
"(",
"<",
"VisualizeEditorCommon",
"visInstance",
"=",
"{",
"byValueVisInstance",
"}",
"appState",
"=",
"{",
"appState",
"}",
"currentAppState",
"=",
"{",
"currentAppState",
"}",
"isChromeVisible",
"=",
"{",
"isChromeVisible",
"}",
"hasUnsavedChanges",
"=",
"{",
"hasUnsavedChanges",
"}",
"hasUnappliedChanges",
"=",
"{",
"hasUnappliedChanges",
"}",
"isEmbeddableRendered",
"=",
"{",
"isEmbeddableRendered",
"}",
"originatingApp",
"=",
"{",
"originatingApp",
"}",
"setOriginatingApp",
"=",
"{",
"setOriginatingApp",
"}",
"setHasUnsavedChanges",
"=",
"{",
"setHasUnsavedChanges",
"}",
"visEditorRef",
"=",
"{",
"visEditorRef",
"}",
"embeddableId",
"=",
"{",
"embeddableId",
"}",
"onAppLeave",
"=",
"{",
"onAppLeave",
"}",
"/",
">",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661585 | [
"import",
"'./app.scss'",
";",
"import",
"React",
",",
"{",
"useEffect",
"}",
"from",
"'react'",
";",
"import",
"{",
"Route",
",",
"Switch",
",",
"useLocation",
"}",
"from",
"'react-router-dom'",
";",
"import",
"{",
"AppMountParameters",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"syncQueryStateWithUrl",
"}",
"from",
"'../../../data/public'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'./types'",
";",
"import",
"{",
"VisualizeEditor",
",",
"VisualizeListing",
",",
"VisualizeNoMatch",
",",
"VisualizeByValueEditor",
",",
"}",
"from",
"'./components'",
";",
"import",
"{",
"VisualizeConstants",
"}",
"from",
"'./visualize_constants'",
";",
"export",
"interface",
"VisualizeAppProps",
"{",
"onAppLeave",
":",
"AppMountParameters",
"[",
"'onAppLeave'",
"]",
";",
"}",
"export",
"const",
"VisualizeApp",
"=",
"(",
"{",
"onAppLeave",
"}",
")",
"=>",
"{",
"const",
"{",
"services",
":",
"{",
"data",
":",
"{",
"query",
"}",
",",
"osdUrlStateStorage",
",",
"}",
",",
"}",
"=",
"useOpenSearchDashboards",
"<",
"VisualizeServices",
">",
"(",
")",
";",
"const",
"{",
"pathname",
"}",
"=",
"useLocation",
"(",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"{",
"stop",
"}",
"=",
"syncQueryStateWithUrl",
"(",
"query",
",",
"osdUrlStateStorage",
")",
";",
"return",
"(",
")",
"=>",
"stop",
"(",
")",
";",
"}",
",",
"[",
"query",
",",
"osdUrlStateStorage",
",",
"pathname",
"]",
")",
";",
"return",
"(",
"<",
"Switch",
">",
"<",
"Route",
"exact",
"path",
"=",
"{",
"`${",
"VisualizeConstants",
".",
"EDIT_BY_VALUE_PATH",
"}`",
"}",
">",
"<",
"VisualizeByValueEditor",
"onAppLeave",
"=",
"{",
"onAppLeave",
"}",
"/>",
"<",
"/Route>",
"<",
"Route",
"path",
"=",
"{",
"[",
"VisualizeConstants",
".",
"CREATE_PATH",
",",
"`${",
"VisualizeConstants",
".",
"EDIT_PATH",
"}/:id`",
"]",
"}",
">",
"<",
"VisualizeEditor",
"onAppLeave",
"=",
"{",
"onAppLeave",
"}",
"/>",
"<",
"/Route>",
"<",
"Route",
"exact",
"path",
"=",
"{",
"[",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
",",
"VisualizeConstants",
".",
"WIZARD_STEP_1_PAGE_PATH",
"]",
"}",
">",
"<",
"VisualizeListing",
"/>",
"<",
"/Route>",
"<",
"VisualizeNoMatch",
"/",
">",
"<",
"/Switch>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661586 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"ReactDOM",
"from",
"'react-dom'",
";",
"import",
"{",
"Router",
"}",
"from",
"'react-router-dom'",
";",
"import",
"{",
"AppMountParameters",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"OpenSearchDashboardsContextProvider",
"}",
"from",
"'../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"VisualizeApp",
"}",
"from",
"'./app'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'./types'",
";",
"import",
"{",
"addHelpMenuToAppChrome",
",",
"addBadgeToAppChrome",
"}",
"from",
"'./utils'",
";",
"export",
"const",
"renderApp",
"=",
"(",
"{",
"element",
",",
"onAppLeave",
"}",
",",
"services",
")",
"=>",
"{",
"addHelpMenuToAppChrome",
"(",
"services",
".",
"chrome",
",",
"services",
".",
"docLinks",
")",
";",
"if",
"(",
"!",
"services",
".",
"visualizeCapabilities",
".",
"save",
")",
"{",
"addBadgeToAppChrome",
"(",
"services",
".",
"chrome",
")",
";",
"}",
"const",
"app",
"=",
"(",
"<",
"Router",
"history",
"=",
"{",
"services",
".",
"history",
"}",
">",
"<",
"OpenSearchDashboardsContextProvider",
"services",
"=",
"{",
"services",
"}",
">",
"<",
"services",
".",
"i18n",
".",
"Context",
">",
"<",
"VisualizeApp",
"onAppLeave",
"=",
"{",
"onAppLeave",
"}",
"/>",
"<",
"/services.i18n.Context>",
"<",
"/OpenSearchDashboardsContextProvider>",
"<",
"/Router>);",
"ReactDOM",
".",
"render",
"(",
"app",
",",
"element",
")",
";",
"return",
"(",
")",
"=>",
"ReactDOM",
".",
"unmountComponentAtNode",
"(",
"element",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661587 | [
"import",
"{",
"BehaviorSubject",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"filter",
",",
"map",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"createHashHistory",
"}",
"from",
"'history'",
";",
"import",
"{",
"AppMountParameters",
",",
"AppUpdater",
",",
"CoreSetup",
",",
"CoreStart",
",",
"Plugin",
",",
"PluginInitializerContext",
",",
"ScopedHistory",
",",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"Storage",
",",
"createOsdUrlTracker",
",",
"createOsdUrlStateStorage",
",",
"withNotifyOnErrors",
",",
"}",
"from",
"'../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"DataPublicPluginStart",
",",
"DataPublicPluginSetup",
",",
"opensearchFilters",
"}",
"from",
"'../../data/public'",
";",
"import",
"{",
"NavigationPublicPluginStart",
"as",
"NavigationStart",
"}",
"from",
"'../../navigation/public'",
";",
"import",
"{",
"SharePluginStart",
",",
"SharePluginSetup",
"}",
"from",
"'../../share/public'",
";",
"import",
"{",
"UrlForwardingSetup",
",",
"UrlForwardingStart",
"}",
"from",
"'../../url_forwarding/public'",
";",
"import",
"{",
"VisualizationsStart",
"}",
"from",
"'../../visualizations/public'",
";",
"import",
"{",
"VisualizeConstants",
"}",
"from",
"'./application/visualize_constants'",
";",
"import",
"{",
"FeatureCatalogueCategory",
",",
"HomePublicPluginSetup",
"}",
"from",
"'../../home/public'",
";",
"import",
"{",
"VisualizeServices",
"}",
"from",
"'./application/types'",
";",
"import",
"{",
"DEFAULT_APP_CATEGORIES",
"}",
"from",
"'../../../core/public'",
";",
"import",
"{",
"SavedObjectsStart",
"}",
"from",
"'../../saved_objects/public'",
";",
"import",
"{",
"EmbeddableStart",
"}",
"from",
"'../../embeddable/public'",
";",
"import",
"{",
"DashboardStart",
"}",
"from",
"'../../dashboard/public'",
";",
"import",
"{",
"UiActionsSetup",
",",
"VISUALIZE_FIELD_TRIGGER",
"}",
"from",
"'../../ui_actions/public'",
";",
"import",
"{",
"setUISettings",
",",
"setApplication",
",",
"setIndexPatterns",
",",
"setQueryService",
",",
"setShareService",
",",
"}",
"from",
"'./services'",
";",
"import",
"{",
"visualizeFieldAction",
"}",
"from",
"'./actions/visualize_field_action'",
";",
"import",
"{",
"createVisualizeUrlGenerator",
"}",
"from",
"'./url_generator'",
";",
"export",
"interface",
"VisualizePluginStartDependencies",
"{",
"data",
":",
"DataPublicPluginStart",
";",
"navigation",
":",
"NavigationStart",
";",
"share",
"?",
":",
"SharePluginStart",
";",
"visualizations",
":",
"VisualizationsStart",
";",
"embeddable",
":",
"EmbeddableStart",
";",
"urlForwarding",
":",
"UrlForwardingStart",
";",
"savedObjects",
":",
"SavedObjectsStart",
";",
"dashboard",
":",
"DashboardStart",
";",
"}",
"export",
"interface",
"VisualizePluginSetupDependencies",
"{",
"home",
"?",
":",
"HomePublicPluginSetup",
";",
"urlForwarding",
":",
"UrlForwardingSetup",
";",
"data",
":",
"DataPublicPluginSetup",
";",
"share",
"?",
":",
"SharePluginSetup",
";",
"uiActions",
":",
"UiActionsSetup",
";",
"}",
"export",
"class",
"VisualizePlugin",
"implements",
"Plugin",
"<",
"void",
",",
"void",
",",
"VisualizePluginSetupDependencies",
",",
"VisualizePluginStartDependencies",
">",
"{",
"private",
"appStateUpdater",
"=",
"new",
"BehaviorSubject",
"<",
"AppUpdater",
">",
"(",
"(",
")",
"=>",
"(",
"{",
"}",
")",
")",
";",
"private",
"stopUrlTracking",
":",
"(",
"(",
")",
"=>",
"void",
")",
"|",
"undefined",
"=",
"undefined",
";",
"private",
"currentHistory",
":",
"ScopedHistory",
"|",
"undefined",
"=",
"undefined",
";",
"constructor",
"(",
"private",
"initializerContext",
")",
"{",
"}",
"public",
"async",
"setup",
"(",
"core",
",",
"{",
"home",
",",
"urlForwarding",
",",
"data",
",",
"share",
",",
"uiActions",
"}",
")",
"{",
"const",
"{",
"appMounted",
",",
"appUnMounted",
",",
"stop",
":",
"stopUrlTracker",
",",
"setActiveUrl",
",",
"restorePreviousUrl",
",",
"}",
"=",
"createOsdUrlTracker",
"(",
"{",
"baseUrl",
":",
"core",
".",
"http",
".",
"basePath",
".",
"prepend",
"(",
"'/app/visualize'",
")",
",",
"defaultSubUrl",
":",
"'#/'",
",",
"storageKey",
":",
"`lastUrl:${",
"core",
".",
"http",
".",
"basePath",
".",
"get",
"(",
")",
"}:visualize`",
",",
"navLinkUpdater$",
":",
"this",
".",
"appStateUpdater",
",",
"toastNotifications",
":",
"core",
".",
"notifications",
".",
"toasts",
",",
"stateParams",
":",
"[",
"{",
"osdUrlKey",
":",
"'_g'",
",",
"stateUpdate$",
":",
"data",
".",
"query",
".",
"state$",
".",
"pipe",
"(",
"filter",
"(",
"(",
"{",
"changes",
"}",
")",
"=>",
"!",
"!",
"(",
"changes",
".",
"globalFilters",
"||",
"changes",
".",
"time",
"||",
"changes",
".",
"refreshInterval",
")",
")",
",",
"map",
"(",
"(",
"{",
"state",
"}",
")",
"=>",
"(",
"{",
"...",
"state",
",",
"filters",
":",
"state",
".",
"filters",
"?.",
"filter",
"(",
"opensearchFilters",
".",
"isFilterPinned",
")",
",",
"}",
")",
")",
")",
",",
"}",
",",
"]",
",",
"getHistory",
":",
"(",
")",
"=>",
"this",
".",
"currentHistory",
"!",
",",
"}",
")",
";",
"this",
".",
"stopUrlTracking",
"=",
"(",
")",
"=>",
"{",
"stopUrlTracker",
"(",
")",
";",
"}",
";",
"if",
"(",
"share",
")",
"{",
"share",
".",
"urlGenerators",
".",
"registerUrlGenerator",
"(",
"createVisualizeUrlGenerator",
"(",
"async",
"(",
")",
"=>",
"{",
"const",
"[",
"coreStart",
"]",
"=",
"await",
"core",
".",
"getStartServices",
"(",
")",
";",
"return",
"{",
"appBasePath",
":",
"coreStart",
".",
"application",
".",
"getUrlForApp",
"(",
"'visualize'",
")",
",",
"useHashedUrl",
":",
"coreStart",
".",
"uiSettings",
".",
"get",
"(",
"'state:storeInSessionStorage'",
")",
",",
"}",
";",
"}",
")",
")",
";",
"}",
"setUISettings",
"(",
"core",
".",
"uiSettings",
")",
";",
"uiActions",
".",
"addTriggerAction",
"(",
"VISUALIZE_FIELD_TRIGGER",
",",
"visualizeFieldAction",
")",
";",
"core",
".",
"application",
".",
"register",
"(",
"{",
"id",
":",
"'visualize'",
",",
"title",
":",
"'Visualize'",
",",
"order",
":",
"8000",
",",
"euiIconType",
":",
"'inputOutput'",
",",
"defaultPath",
":",
"'#/'",
",",
"category",
":",
"DEFAULT_APP_CATEGORIES",
".",
"opensearchDashboards",
",",
"updater$",
":",
"this",
".",
"appStateUpdater",
".",
"asObservable",
"(",
")",
",",
"mount",
":",
"async",
"(",
"params",
")",
"=>",
"{",
"const",
"[",
"coreStart",
",",
"pluginsStart",
"]",
"=",
"await",
"core",
".",
"getStartServices",
"(",
")",
";",
"this",
".",
"currentHistory",
"=",
"params",
".",
"history",
";",
"pluginsStart",
".",
"data",
".",
"indexPatterns",
".",
"clearCache",
"(",
")",
";",
"await",
"pluginsStart",
".",
"data",
".",
"indexPatterns",
".",
"ensureDefaultIndexPattern",
"(",
")",
";",
"appMounted",
"(",
")",
";",
"const",
"unlistenParentHistory",
"=",
"params",
".",
"history",
".",
"listen",
"(",
"(",
")",
"=>",
"{",
"window",
".",
"dispatchEvent",
"(",
"new",
"HashChangeEvent",
"(",
"'hashchange'",
")",
")",
";",
"}",
")",
";",
"/**\n * current implementation uses 2 history objects:\n * 1. the hash history (used for the react hash router)\n * 2. and the scoped history (used for url tracking)\n * this should be replaced to use only scoped history after moving legacy apps to browser routing\n */",
"const",
"history",
"=",
"createHashHistory",
"(",
")",
";",
"const",
"services",
"=",
"{",
"...",
"coreStart",
",",
"history",
",",
"osdUrlStateStorage",
":",
"createOsdUrlStateStorage",
"(",
"{",
"history",
",",
"useHash",
":",
"coreStart",
".",
"uiSettings",
".",
"get",
"(",
"'state:storeInSessionStorage'",
")",
",",
"...",
"withNotifyOnErrors",
"(",
"coreStart",
".",
"notifications",
".",
"toasts",
")",
",",
"}",
")",
",",
"urlForwarding",
":",
"pluginsStart",
".",
"urlForwarding",
",",
"pluginInitializerContext",
":",
"this",
".",
"initializerContext",
",",
"chrome",
":",
"coreStart",
".",
"chrome",
",",
"data",
":",
"pluginsStart",
".",
"data",
",",
"localStorage",
":",
"new",
"Storage",
"(",
"localStorage",
")",
",",
"navigation",
":",
"pluginsStart",
".",
"navigation",
",",
"savedVisualizations",
":",
"pluginsStart",
".",
"visualizations",
".",
"savedVisualizationsLoader",
",",
"share",
":",
"pluginsStart",
".",
"share",
",",
"toastNotifications",
":",
"coreStart",
".",
"notifications",
".",
"toasts",
",",
"visualizeCapabilities",
":",
"coreStart",
".",
"application",
".",
"capabilities",
".",
"visualize",
",",
"visualizations",
":",
"pluginsStart",
".",
"visualizations",
",",
"embeddable",
":",
"pluginsStart",
".",
"embeddable",
",",
"setActiveUrl",
",",
"createVisEmbeddableFromObject",
":",
"pluginsStart",
".",
"visualizations",
".",
"__LEGACY",
".",
"createVisEmbeddableFromObject",
",",
"savedObjectsPublic",
":",
"pluginsStart",
".",
"savedObjects",
",",
"scopedHistory",
":",
"params",
".",
"history",
",",
"restorePreviousUrl",
",",
"dashboard",
":",
"pluginsStart",
".",
"dashboard",
",",
"setHeaderActionMenu",
":",
"params",
".",
"setHeaderActionMenu",
",",
"}",
";",
"params",
".",
"element",
".",
"classList",
".",
"add",
"(",
"'visAppWrapper'",
")",
";",
"const",
"{",
"renderApp",
"}",
"=",
"await",
"import",
"(",
"'./application'",
")",
";",
"const",
"unmount",
"=",
"renderApp",
"(",
"params",
",",
"services",
")",
";",
"return",
"(",
")",
"=>",
"{",
"params",
".",
"element",
".",
"classList",
".",
"remove",
"(",
"'visAppWrapper'",
")",
";",
"unlistenParentHistory",
"(",
")",
";",
"unmount",
"(",
")",
";",
"appUnMounted",
"(",
")",
";",
"}",
";",
"}",
",",
"}",
")",
";",
"urlForwarding",
".",
"forwardApp",
"(",
"'visualize'",
",",
"'visualize'",
")",
";",
"if",
"(",
"home",
")",
"{",
"home",
".",
"featureCatalogue",
".",
"register",
"(",
"{",
"id",
":",
"'visualize'",
",",
"title",
":",
"'Visualize'",
",",
"description",
":",
"i18n",
".",
"translate",
"(",
"'visualize.visualizeDescription'",
",",
"{",
"defaultMessage",
":",
"'Create visualizations and aggregate data stores in your OpenSearch indices.'",
",",
"}",
")",
",",
"icon",
":",
"'visualizeApp'",
",",
"path",
":",
"`/app/visualize#${",
"VisualizeConstants",
".",
"LANDING_PAGE_PATH",
"}`",
",",
"showOnHomePage",
":",
"false",
",",
"category",
":",
"FeatureCatalogueCategory",
".",
"DATA",
",",
"}",
")",
";",
"}",
"}",
"public",
"start",
"(",
"core",
",",
"plugins",
")",
"{",
"setApplication",
"(",
"core",
".",
"application",
")",
";",
"setIndexPatterns",
"(",
"plugins",
".",
"data",
".",
"indexPatterns",
")",
";",
"setQueryService",
"(",
"plugins",
".",
"data",
".",
"query",
")",
";",
"if",
"(",
"plugins",
".",
"share",
")",
"{",
"setShareService",
"(",
"plugins",
".",
"share",
")",
";",
"}",
"}",
"stop",
"(",
")",
"{",
"if",
"(",
"this",
".",
"stopUrlTracking",
")",
"{",
"this",
".",
"stopUrlTracking",
"(",
")",
";",
"}",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
615,
null,
null,
null,
null,
null,
7,
null,
501,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661588 | [
"import",
"{",
"PluginInitializerContext",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"VisualizePlugin",
"}",
"from",
"'./plugin'",
";",
"export",
"{",
"EditorRenderProps",
"}",
"from",
"'./application/types'",
";",
"export",
"{",
"VisualizeConstants",
"}",
"from",
"'./application/visualize_constants'",
";",
"export",
"const",
"plugin",
"=",
"(",
"context",
")",
"=>",
"{",
"return",
"new",
"VisualizePlugin",
"(",
"context",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26166,
null,
null,
615,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661589 | [
"interface",
"ComboBoxOption",
"<",
"T",
">",
"{",
"label",
":",
"string",
";",
"target",
":",
"T",
";",
"}",
"interface",
"ComboBoxGroupedOption",
"<",
"T",
">",
"{",
"label",
":",
"string",
";",
"options",
":",
"Array",
"<",
"ComboBoxOption",
"<",
"T",
">",
">",
";",
"}",
"type",
"GroupOrOption",
"<",
"T",
">",
"=",
"ComboBoxGroupedOption",
"<",
"T",
">",
"|",
"ComboBoxOption",
"<",
"T",
">",
";",
"export",
"type",
"ComboBoxGroupedOptions",
"<",
"T",
">",
"=",
"Array",
"<",
"GroupOrOption",
"<",
"T",
">",
">",
";",
"param",
"objects",
"param",
"groupBy",
"param",
"labelName",
"returns",
"export",
"function",
"groupAndSortBy",
"<",
"T",
"extends",
"Record",
"<",
"TGroupBy",
"|",
"TLabelName",
",",
"string",
">",
",",
"TGroupBy",
"extends",
"string",
"=",
"'type'",
",",
"TLabelName",
"extends",
"string",
"=",
"'title'",
">",
"(",
"objects",
",",
"groupBy",
",",
"labelName",
")",
"{",
"const",
"groupedOptions",
"=",
"objects",
".",
"reduce",
"(",
"(",
"array",
",",
"obj",
")",
"=>",
"{",
"const",
"group",
"=",
"array",
".",
"find",
"(",
"(",
"element",
")",
"=>",
"element",
".",
"label",
"===",
"obj",
"[",
"groupBy",
"]",
")",
";",
"const",
"option",
"=",
"{",
"label",
":",
"obj",
"[",
"labelName",
"]",
",",
"target",
":",
"obj",
",",
"}",
";",
"if",
"(",
"group",
"&&",
"group",
".",
"options",
")",
"{",
"group",
".",
"options",
".",
"push",
"(",
"option",
")",
";",
"}",
"else",
"{",
"array",
".",
"push",
"(",
"{",
"label",
":",
"obj",
"[",
"groupBy",
"]",
",",
"options",
":",
"[",
"option",
"]",
"}",
")",
";",
"}",
"return",
"array",
";",
"}",
",",
"[",
"]",
"as",
"Array",
"<",
"ComboBoxGroupedOption",
"<",
"T",
">",
">",
")",
";",
"groupedOptions",
".",
"sort",
"(",
"sortByLabel",
")",
";",
"groupedOptions",
".",
"forEach",
"(",
"(",
"group",
")",
"=>",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"group",
".",
"options",
")",
")",
"{",
"group",
".",
"options",
".",
"sort",
"(",
"sortByLabel",
")",
";",
"}",
"}",
")",
";",
"if",
"(",
"groupedOptions",
".",
"length",
"===",
"1",
"&&",
"!",
"groupedOptions",
"[",
"0",
"]",
".",
"label",
")",
"{",
"return",
"groupedOptions",
"[",
"0",
"]",
".",
"options",
"||",
"[",
"]",
";",
"}",
"return",
"groupedOptions",
";",
"}",
"function",
"sortByLabel",
"<",
"T",
">",
"(",
"a",
",",
"b",
")",
"{",
"return",
"(",
"a",
".",
"label",
"||",
"''",
")",
".",
"toLowerCase",
"(",
")",
".",
"localeCompare",
"(",
"(",
"b",
".",
"label",
"||",
"''",
")",
".",
"toLowerCase",
"(",
")",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8338,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
26167,
null,
26168,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
5,
null,
11,
null,
null,
null,
null,
9635,
null,
null,
null,
null,
null,
null,
9635,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9635,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
9192,
null,
9192,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661590 | [
"import",
"{",
"IAggType",
",",
"IAggConfig",
",",
"IndexPattern",
",",
"search",
"}",
"from",
"'../../../data/public'",
";",
"const",
"{",
"propFilter",
"}",
"=",
"search",
".",
"aggs",
";",
"const",
"filterByName",
"=",
"propFilter",
"(",
"'name'",
")",
";",
"type",
"AggTypeFilter",
"=",
"(",
"aggType",
":",
"IAggType",
",",
"indexPattern",
":",
"IndexPattern",
",",
"aggConfig",
":",
"IAggConfig",
",",
"aggFilter",
":",
"string",
"[",
"]",
")",
"=>",
"boolean",
";",
"const",
"filters",
"=",
"[",
"/**\n * This filter checks the defined aggFilter in the schemas of that visualization\n * and limits available aggregations based on that.\n */",
"(",
"aggType",
",",
"indexPattern",
",",
"aggConfig",
",",
"aggFilter",
")",
"=>",
"{",
"const",
"doesSchemaAllowAggType",
"=",
"filterByName",
"(",
"[",
"aggType",
"]",
",",
"aggFilter",
")",
".",
"length",
"!==",
"0",
";",
"return",
"doesSchemaAllowAggType",
";",
"}",
",",
"/**\n * Check index pattern aggregation restrictions and limit available aggTypes.\n */",
"(",
"aggType",
",",
"indexPattern",
",",
"aggConfig",
",",
"aggFilter",
")",
"=>",
"{",
"const",
"aggRestrictions",
"=",
"indexPattern",
".",
"getAggregationRestrictions",
"(",
")",
";",
"if",
"(",
"!",
"aggRestrictions",
")",
"{",
"return",
"true",
";",
"}",
"const",
"aggName",
"=",
"aggType",
".",
"name",
";",
"return",
"(",
"aggName",
"===",
"'count'",
"||",
"(",
"!",
"!",
"aggRestrictions",
"&&",
"Object",
".",
"keys",
"(",
"aggRestrictions",
")",
".",
"includes",
"(",
"aggName",
")",
")",
"||",
"false",
")",
";",
"}",
",",
"]",
";",
"export",
"function",
"filterAggTypes",
"(",
"aggTypes",
",",
"indexPattern",
",",
"aggConfig",
",",
"aggFilter",
")",
"{",
"const",
"allowedAggTypes",
"=",
"aggTypes",
".",
"filter",
"(",
"(",
"aggType",
")",
"=>",
"{",
"const",
"isAggTypeAllowed",
"=",
"filters",
".",
"every",
"(",
"(",
"filter",
")",
"=>",
"filter",
"(",
"aggType",
",",
"indexPattern",
",",
"aggConfig",
",",
"aggFilter",
")",
")",
";",
"return",
"isAggTypeAllowed",
";",
"}",
")",
";",
"return",
"allowedAggTypes",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
5407,
null,
584,
null,
530,
null,
5,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5407,
null,
584,
null,
530,
null,
5,
null,
null,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
584,
null,
941,
null,
5,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
5407,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
28016,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661591 | [
"import",
"{",
"IAggConfig",
",",
"IndexPatternField",
"}",
"from",
"'../../../data/public'",
";",
"type",
"AggTypeFieldFilter",
"=",
"(",
"field",
":",
"IndexPatternField",
",",
"aggConfig",
":",
"IAggConfig",
")",
"=>",
"boolean",
";",
"const",
"filters",
"=",
"[",
"/**\n * Check index pattern aggregation restrictions\n * and limit available fields for a given aggType based on that.\n */",
"(",
"field",
",",
"aggConfig",
")",
"=>",
"{",
"const",
"indexPattern",
"=",
"aggConfig",
".",
"getIndexPattern",
"(",
")",
";",
"const",
"aggRestrictions",
"=",
"indexPattern",
".",
"getAggregationRestrictions",
"(",
")",
";",
"if",
"(",
"!",
"aggRestrictions",
")",
"{",
"return",
"true",
";",
"}",
"const",
"aggName",
"=",
"aggConfig",
".",
"type",
"&&",
"aggConfig",
".",
"type",
".",
"name",
";",
"const",
"aggFields",
"=",
"aggRestrictions",
"[",
"aggName",
"]",
";",
"return",
"!",
"!",
"aggFields",
"&&",
"!",
"!",
"aggFields",
"[",
"field",
".",
"name",
"]",
";",
"}",
",",
"]",
";",
"export",
"function",
"filterAggTypeFields",
"(",
"fields",
",",
"aggConfig",
")",
"{",
"const",
"allowedAggTypeFields",
"=",
"fields",
".",
"filter",
"(",
"(",
"field",
")",
"=>",
"{",
"const",
"isAggTypeFieldAllowed",
"=",
"filters",
".",
"every",
"(",
"(",
"filter",
")",
"=>",
"filter",
"(",
"field",
",",
"aggConfig",
")",
")",
";",
"return",
"isAggTypeFieldAllowed",
";",
"}",
")",
";",
"return",
"allowedAggTypeFields",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
668,
null,
530,
null,
null,
null,
null,
584,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
28017,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
5,
null,
941,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
668,
null,
null,
null,
null,
8,
null,
null,
null,
null,
null,
null,
28018,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661592 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"IndexPattern",
"}",
"from",
"'src/plugins/data/public'",
";",
"/**\n * A hidden parameter can be hidden from the UI completely.\n */",
"interface",
"Param",
"{",
"hidden",
"?",
":",
"boolean",
";",
"help",
"?",
":",
"string",
";",
"}",
"/**\n * A fixed parameter has a fixed value for a specific field.\n * It can optionally also be hidden.\n */",
"export",
"type",
"FixedParam",
"=",
"Partial",
"<",
"Param",
">",
"&",
"{",
"fixedValue",
":",
"any",
";",
"}",
";",
"/**\n * Numeric interval parameters must always be set in the editor to a multiple of\n * the specified base. It can optionally also be hidden.\n */",
"export",
"type",
"NumericIntervalParam",
"=",
"Partial",
"<",
"Param",
">",
"&",
"{",
"base",
":",
"number",
";",
"}",
";",
"/**\n * Time interval parameters must always be set in the editor to a multiple of\n * the specified base. It can optionally also be hidden.\n */",
"export",
"type",
"TimeIntervalParam",
"=",
"Partial",
"<",
"Param",
">",
"&",
"{",
"default",
":",
"string",
";",
"timeBase",
":",
"string",
";",
"}",
";",
"export",
"type",
"EditorParamConfig",
"=",
"NumericIntervalParam",
"|",
"TimeIntervalParam",
"|",
"FixedParam",
"|",
"Param",
";",
"export",
"interface",
"EditorConfig",
"{",
"[",
"paramName",
"]",
":",
"EditorParamConfig",
";",
"}",
"export",
"function",
"getEditorConfig",
"(",
"indexPattern",
",",
"aggTypeName",
",",
"fieldName",
")",
"{",
"const",
"aggRestrictions",
"=",
"indexPattern",
".",
"getAggregationRestrictions",
"(",
")",
";",
"if",
"(",
"!",
"aggRestrictions",
"||",
"!",
"aggTypeName",
"||",
"!",
"fieldName",
")",
"{",
"return",
"{",
"}",
";",
"}",
"if",
"(",
"aggTypeName",
"===",
"'terms'",
")",
"{",
"return",
"{",
"otherBucket",
":",
"{",
"hidden",
":",
"true",
",",
"}",
",",
"missingBucket",
":",
"{",
"hidden",
":",
"true",
",",
"}",
",",
"}",
";",
"}",
"const",
"fieldAgg",
"=",
"aggRestrictions",
"[",
"aggTypeName",
"]",
"&&",
"aggRestrictions",
"[",
"aggTypeName",
"]",
"[",
"fieldName",
"]",
";",
"if",
"(",
"!",
"fieldAgg",
")",
"{",
"return",
"{",
"}",
";",
"}",
"if",
"(",
"aggTypeName",
"===",
"'histogram'",
")",
"{",
"const",
"interval",
"=",
"fieldAgg",
".",
"interval",
";",
"return",
"interval",
"?",
"{",
"intervalBase",
":",
"{",
"fixedValue",
":",
"interval",
",",
"}",
",",
"interval",
":",
"{",
"base",
":",
"interval",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.editorConfig.histogram.interval.helpText'",
",",
"{",
"defaultMessage",
":",
"'Must be a multiple of configuration interval: {interval}'",
",",
"values",
":",
"{",
"interval",
"}",
",",
"}",
")",
",",
"}",
",",
"}",
":",
"{",
"}",
";",
"}",
"if",
"(",
"aggTypeName",
"===",
"'date_histogram'",
")",
"{",
"const",
"interval",
"=",
"fieldAgg",
".",
"calendar_interval",
"||",
"fieldAgg",
".",
"fixed_interval",
";",
"return",
"{",
"useNormalizedOpenSearchInterval",
":",
"{",
"fixedValue",
":",
"false",
",",
"}",
",",
"interval",
":",
"{",
"default",
":",
"interval",
",",
"timeBase",
":",
"interval",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.editorConfig.dateHistogram.customInterval.helpText'",
",",
"{",
"defaultMessage",
":",
"'Must be a multiple of configuration interval: {interval}'",
",",
"values",
":",
"{",
"interval",
"}",
",",
"}",
")",
",",
"}",
",",
"}",
";",
"}",
"return",
"{",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13943,
null,
584,
null,
2,
null,
2,
null,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661593 | [
"import",
"_",
",",
"{",
"defaults",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Optional",
"}",
"from",
"'@osd/utility-types'",
";",
"import",
"{",
"AggGroupNames",
",",
"AggParam",
",",
"AggGroupName",
"}",
"from",
"'../../data/public'",
";",
"export",
"interface",
"ISchemas",
"{",
"[",
"AggGroupNames",
".",
"Buckets",
"]",
":",
"Schema",
"[",
"]",
";",
"[",
"AggGroupNames",
".",
"Metrics",
"]",
":",
"Schema",
"[",
"]",
";",
"all",
":",
"Schema",
"[",
"]",
";",
"}",
"export",
"interface",
"Schema",
"{",
"aggFilter",
":",
"string",
"[",
"]",
";",
"editor",
":",
"boolean",
"|",
"string",
";",
"group",
":",
"AggGroupName",
";",
"max",
":",
"number",
";",
"min",
":",
"number",
";",
"name",
":",
"string",
";",
"params",
":",
"AggParam",
"[",
"]",
";",
"title",
":",
"string",
";",
"defaults",
":",
"unknown",
";",
"hideCustomLabel",
"?",
":",
"boolean",
";",
"mustBeFirst",
"?",
":",
"boolean",
";",
"aggSettings",
"?",
":",
"any",
";",
"}",
"export",
"class",
"Schemas",
"implements",
"ISchemas",
"{",
"all",
":",
"Schema",
"[",
"]",
"=",
"[",
"]",
";",
"[",
"AggGroupNames",
".",
"Buckets",
"]",
":",
"Schema",
"[",
"]",
"=",
"[",
"]",
";",
"[",
"AggGroupNames",
".",
"Metrics",
"]",
":",
"Schema",
"[",
"]",
"=",
"[",
"]",
";",
"constructor",
"(",
"schemas",
")",
"{",
"_",
"(",
"schemas",
"||",
"[",
"]",
")",
".",
"chain",
"(",
")",
".",
"map",
"(",
"(",
"schema",
")",
"=>",
"{",
"if",
"(",
"!",
"schema",
".",
"name",
")",
"throw",
"new",
"Error",
"(",
"'all schema must have a unique name'",
")",
";",
"if",
"(",
"schema",
".",
"name",
"===",
"'split'",
")",
"{",
"schema",
".",
"params",
"=",
"[",
"{",
"name",
":",
"'row'",
",",
"default",
":",
"true",
",",
"}",
",",
"]",
"as",
"AggParam",
"[",
"]",
";",
"}",
"defaults",
"(",
"schema",
",",
"{",
"min",
":",
"0",
",",
"max",
":",
"Infinity",
",",
"group",
":",
"AggGroupNames",
".",
"Buckets",
",",
"title",
":",
"schema",
".",
"name",
",",
"aggFilter",
":",
"'*'",
",",
"editor",
":",
"false",
",",
"params",
":",
"[",
"]",
",",
"}",
")",
";",
"return",
"schema",
"as",
"Schema",
";",
"}",
")",
".",
"tap",
"(",
"(",
"fullSchemas",
")",
"=>",
"{",
"this",
".",
"all",
"=",
"fullSchemas",
";",
"}",
")",
".",
"groupBy",
"(",
"'group'",
")",
".",
"forOwn",
"(",
"(",
"group",
",",
"groupName",
")",
"=>",
"{",
"this",
"[",
"groupName",
"]",
"=",
"group",
";",
"}",
")",
".",
"commit",
"(",
")",
";",
"}",
"}",
"export",
"const",
"getSchemaByName",
"=",
"(",
"schemas",
",",
"schemaName",
"?",
")",
"=>",
"{",
"return",
"schemas",
".",
"find",
"(",
"(",
"s",
")",
"=>",
"s",
".",
"name",
"===",
"schemaName",
")",
"||",
"(",
"{",
"}",
"as",
"Schema",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
151,
null,
null,
5,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
151,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661594 | [
"import",
"{",
"IAggConfig",
"}",
"from",
"'src/plugins/data/public'",
";",
"export",
"enum",
"AGGS_ACTION_KEYS",
"{",
"TOUCHED",
"=",
"'aggsTouched'",
",",
"VALID",
"=",
"'aggsValid'",
"}",
"interface",
"AggsItem",
"{",
"touched",
":",
"boolean",
";",
"valid",
":",
"boolean",
";",
"}",
"export",
"interface",
"AggsState",
"{",
"[",
"aggId",
"]",
":",
"AggsItem",
";",
"}",
"export",
"interface",
"AggsAction",
"{",
"type",
":",
"AGGS_ACTION_KEYS",
";",
"payload",
":",
"boolean",
";",
"aggId",
":",
"string",
";",
"newState",
"?",
":",
"AggsState",
";",
"}",
"function",
"aggGroupReducer",
"(",
"state",
",",
"action",
")",
"{",
"const",
"aggState",
"=",
"state",
"[",
"action",
".",
"aggId",
"]",
"||",
"{",
"touched",
":",
"false",
",",
"valid",
":",
"true",
"}",
";",
"switch",
"(",
"action",
".",
"type",
")",
"{",
"case",
"AGGS_ACTION_KEYS",
".",
"TOUCHED",
":",
"return",
"{",
"...",
"state",
",",
"[",
"action",
".",
"aggId",
"]",
":",
"{",
"...",
"aggState",
",",
"touched",
":",
"action",
".",
"payload",
"}",
"}",
";",
"case",
"AGGS_ACTION_KEYS",
".",
"VALID",
":",
"return",
"{",
"...",
"state",
",",
"[",
"action",
".",
"aggId",
"]",
":",
"{",
"...",
"aggState",
",",
"valid",
":",
"action",
".",
"payload",
"}",
"}",
";",
"default",
":",
"throw",
"new",
"Error",
"(",
")",
";",
"}",
"}",
"function",
"initAggsState",
"(",
"group",
")",
"{",
"return",
"group",
".",
"reduce",
"(",
"(",
"state",
",",
"agg",
")",
"=>",
"{",
"state",
"[",
"agg",
".",
"id",
"]",
"=",
"{",
"touched",
":",
"false",
",",
"valid",
":",
"true",
"}",
";",
"return",
"state",
";",
"}",
",",
"{",
"}",
"as",
"AggsState",
")",
";",
"}",
"export",
"{",
"aggGroupReducer",
",",
"initAggsState",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5334,
null,
5334,
null,
26169,
null,
null,
null,
9412,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5334,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
5334,
null,
530,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661595 | [
"import",
"{",
"findIndex",
",",
"isEmpty",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"IAggConfig",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"AggsState",
"}",
"from",
"'./agg_group_state'",
";",
"import",
"{",
"Schema",
",",
"getSchemaByName",
"}",
"from",
"'../schemas'",
";",
"const",
"isAggRemovable",
"=",
"(",
"agg",
",",
"group",
",",
"schemas",
")",
"=>",
"{",
"const",
"schema",
"=",
"getSchemaByName",
"(",
"schemas",
",",
"agg",
".",
"schema",
")",
";",
"const",
"metricCount",
"=",
"group",
".",
"reduce",
"(",
"(",
"count",
",",
"aggregation",
")",
"=>",
"(",
"aggregation",
".",
"schema",
"===",
"agg",
".",
"schema",
"?",
"++",
"count",
":",
"count",
")",
",",
"0",
")",
";",
"return",
"metricCount",
">",
"schema",
".",
"min",
";",
"}",
";",
"const",
"getEnabledMetricAggsCount",
"=",
"(",
"group",
")",
"=>",
"{",
"return",
"group",
".",
"reduce",
"(",
"(",
"count",
",",
"aggregation",
")",
"=>",
"aggregation",
".",
"schema",
"===",
"'metric'",
"&&",
"aggregation",
".",
"enabled",
"?",
"++",
"count",
":",
"count",
",",
"0",
")",
";",
"}",
";",
"const",
"calcAggIsTooLow",
"=",
"(",
"agg",
",",
"aggIndex",
",",
"group",
",",
"schemas",
")",
"=>",
"{",
"const",
"schema",
"=",
"getSchemaByName",
"(",
"schemas",
",",
"agg",
".",
"schema",
")",
";",
"if",
"(",
"!",
"schema",
".",
"mustBeFirst",
")",
"{",
"return",
"false",
";",
"}",
"const",
"firstDifferentSchema",
"=",
"findIndex",
"(",
"group",
",",
"(",
"aggr",
")",
"=>",
"{",
"return",
"aggr",
".",
"schema",
"!==",
"agg",
".",
"schema",
";",
"}",
")",
";",
"if",
"(",
"firstDifferentSchema",
"===",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"return",
"aggIndex",
">",
"firstDifferentSchema",
";",
"}",
";",
"function",
"isInvalidAggsTouched",
"(",
"aggsState",
")",
"{",
"const",
"invalidAggs",
"=",
"Object",
".",
"values",
"(",
"aggsState",
")",
".",
"filter",
"(",
"(",
"agg",
")",
"=>",
"!",
"agg",
".",
"valid",
")",
";",
"if",
"(",
"isEmpty",
"(",
"invalidAggs",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"invalidAggs",
".",
"every",
"(",
"(",
"agg",
")",
"=>",
"agg",
".",
"touched",
")",
";",
"}",
"export",
"{",
"isAggRemovable",
",",
"calcAggIsTooLow",
",",
"isInvalidAggsTouched",
",",
"getEnabledMetricAggsCount",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
941,
null,
5,
null,
5,
null,
null,
null,
null,
151,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
3,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
941,
null,
3,
null,
5,
null,
5,
null,
null,
null,
null,
151,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
5334,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9412,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
9412,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661596 | [
"import",
"React",
",",
"{",
"Fragment",
",",
"useState",
",",
"useEffect",
",",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"htmlIdGenerator",
",",
"EuiButtonIcon",
",",
"EuiButtonEmpty",
",",
"EuiFieldText",
",",
"EuiFlexItem",
",",
"EuiFlexGroup",
",",
"EuiFormErrorText",
",",
"EuiIcon",
",",
"EuiLink",
",",
"EuiSpacer",
",",
"EuiText",
",",
"EuiFormRow",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"dateMath",
"from",
"'@elastic/datemath'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"isEqual",
",",
"omit",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"useMount",
"}",
"from",
"'react-use'",
";",
"import",
"{",
"DocLinksStart",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"const",
"FROM_PLACEHOLDER",
"=",
"'\\u2212\\u221E'",
";",
"const",
"TO_PLACEHOLDER",
"=",
"'+\\u221E'",
";",
"const",
"generateId",
"=",
"htmlIdGenerator",
"(",
")",
";",
"const",
"validateDateMath",
"=",
"(",
"value",
"=",
"''",
")",
"=>",
"{",
"if",
"(",
"!",
"value",
")",
"{",
"return",
"true",
";",
"}",
"const",
"moment",
"=",
"dateMath",
".",
"parse",
"(",
"value",
")",
";",
"return",
"moment",
"&&",
"moment",
".",
"isValid",
"(",
")",
";",
"}",
";",
"interface",
"DateRangeValues",
"{",
"from",
"?",
":",
"string",
";",
"to",
"?",
":",
"string",
";",
"}",
"interface",
"DateRangeValuesModel",
"extends",
"DateRangeValues",
"{",
"id",
":",
"string",
";",
"}",
"function",
"DateRangesParamEditor",
"(",
"{",
"value",
"=",
"[",
"]",
",",
"setValue",
",",
"setValidity",
",",
"}",
")",
"{",
"const",
"{",
"services",
"}",
"=",
"useOpenSearchDashboards",
"<",
"{",
"docLinks",
":",
"DocLinksStart",
";",
"}",
">",
"(",
")",
";",
"const",
"[",
"ranges",
",",
"setRanges",
"]",
"=",
"useState",
"(",
"(",
")",
"=>",
"value",
".",
"map",
"(",
"(",
"range",
")",
"=>",
"(",
"{",
"...",
"range",
",",
"id",
":",
"generateId",
"(",
")",
"}",
")",
")",
")",
";",
"const",
"hasInvalidRange",
"=",
"value",
".",
"some",
"(",
"(",
"{",
"from",
",",
"to",
"}",
")",
"=>",
"(",
"!",
"from",
"&&",
"!",
"to",
")",
"||",
"!",
"validateDateMath",
"(",
"from",
")",
"||",
"!",
"validateDateMath",
"(",
"to",
")",
")",
";",
"const",
"updateRanges",
"=",
"useCallback",
"(",
"(",
"rangeValues",
")",
"=>",
"{",
"setValue",
"(",
"rangeValues",
".",
"map",
"(",
"(",
"range",
")",
"=>",
"omit",
"(",
"range",
",",
"'id'",
")",
")",
")",
";",
"setRanges",
"(",
"rangeValues",
")",
";",
"}",
",",
"[",
"setValue",
"]",
")",
";",
"const",
"onAddRange",
"=",
"useCallback",
"(",
"(",
")",
"=>",
"updateRanges",
"(",
"[",
"...",
"ranges",
",",
"{",
"id",
":",
"generateId",
"(",
")",
"}",
"]",
")",
",",
"[",
"ranges",
",",
"updateRanges",
",",
"]",
")",
";",
"useMount",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"value",
".",
"length",
")",
"{",
"onAddRange",
"(",
")",
";",
"}",
"}",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"value",
".",
"length",
"!==",
"ranges",
".",
"length",
"||",
"value",
".",
"some",
"(",
"(",
"range",
",",
"index",
")",
"=>",
"!",
"isEqual",
"(",
"range",
",",
"omit",
"(",
"ranges",
"[",
"index",
"]",
",",
"'id'",
")",
")",
")",
")",
"{",
"setRanges",
"(",
"value",
".",
"map",
"(",
"(",
"range",
")",
"=>",
"(",
"{",
"...",
"range",
",",
"id",
":",
"generateId",
"(",
")",
"}",
")",
")",
")",
";",
"}",
"}",
",",
"[",
"ranges",
",",
"value",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"setValidity",
"(",
"!",
"hasInvalidRange",
")",
";",
"}",
",",
"[",
"hasInvalidRange",
",",
"setValidity",
"]",
")",
";",
"const",
"onRemoveRange",
"=",
"(",
"id",
")",
"=>",
"updateRanges",
"(",
"ranges",
".",
"filter",
"(",
"(",
"range",
")",
"=>",
"range",
".",
"id",
"!==",
"id",
")",
")",
";",
"const",
"onChangeRange",
"=",
"(",
"id",
",",
"key",
",",
"newValue",
")",
"=>",
"updateRanges",
"(",
"ranges",
".",
"map",
"(",
"(",
"range",
")",
"=>",
"range",
".",
"id",
"===",
"id",
"?",
"{",
"...",
"range",
",",
"[",
"key",
"]",
":",
"newValue",
"===",
"''",
"?",
"undefined",
":",
"newValue",
",",
"}",
":",
"range",
")",
")",
";",
"return",
"(",
"<",
"EuiFormRow",
"compressed",
"fullWidth",
">",
"<",
">",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
">",
"<",
"EuiLink",
"href",
"=",
"{",
"services",
".",
"docLinks",
".",
"links",
".",
"noDocumentation",
".",
"dateMath",
"}",
"target",
"=",
"\"_blank\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.controls.dateRanges.acceptedDateFormatsLinkText\"",
"defaultMessage",
"=",
"\"Acceptable date formats\"",
"/",
">",
"<",
"/EuiLink>",
"<",
"/EuiText>",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"{",
"ranges",
".",
"map",
"(",
"(",
"{",
"from",
",",
"to",
",",
"id",
"}",
",",
"index",
")",
"=>",
"{",
"const",
"deleteBtnTitle",
"=",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.dateRanges.removeRangeButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Remove the range of {from} to {to}'",
",",
"values",
":",
"{",
"from",
":",
"from",
"||",
"FROM_PLACEHOLDER",
",",
"to",
":",
"to",
"||",
"TO_PLACEHOLDER",
"}",
",",
"}",
")",
";",
"const",
"areBothEmpty",
"=",
"!",
"from",
"&&",
"!",
"to",
";",
"return",
"(",
"<",
"Fragment",
"key",
"=",
"{",
"id",
"}",
">",
"<",
"EuiFlexGroup",
"responsive",
"=",
"{",
"false",
"}",
"gutterSize",
"=",
"\"s\"",
"alignItems",
"=",
"\"center\"",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiFieldText",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.dateRanges.fromColumnLabel'",
",",
"{",
"defaultMessage",
":",
"'From'",
",",
"description",
":",
"'Beginning of a date range, e.g. *From* 2018-02-26 To 2018-02-28'",
",",
"}",
")",
"}",
"compressed",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"areBothEmpty",
"||",
"!",
"validateDateMath",
"(",
"from",
")",
"}",
"placeholder",
"=",
"{",
"FROM_PLACEHOLDER",
"}",
"value",
"=",
"{",
"from",
"||",
"''",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"onChangeRange",
"(",
"id",
",",
"'from'",
",",
"ev",
".",
"target",
".",
"value",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorDateRange${",
"index",
"}__from`",
"}",
"/>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiIcon",
"type",
"=",
"\"sortRight\"",
"color",
"=",
"\"subdued\"",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
">",
"<",
"EuiFieldText",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.dateRanges.toColumnLabel'",
",",
"{",
"defaultMessage",
":",
"'To'",
",",
"description",
":",
"'End of a date range, e.g. From 2018-02-26 *To* 2018-02-28'",
",",
"}",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`visEditorDateRange${",
"index",
"}__to`",
"}",
"compressed",
"fullWidth",
"=",
"{",
"true",
"}",
"isInvalid",
"=",
"{",
"areBothEmpty",
"||",
"!",
"validateDateMath",
"(",
"to",
")",
"}",
"placeholder",
"=",
"{",
"TO_PLACEHOLDER",
"}",
"value",
"=",
"{",
"to",
"||",
"''",
"}",
"onChange",
"=",
"{",
"(",
"ev",
")",
"=>",
"onChangeRange",
"(",
"id",
",",
"'to'",
",",
"ev",
".",
"target",
".",
"value",
")",
"}",
"/>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButtonIcon",
"title",
"=",
"{",
"deleteBtnTitle",
"}",
"aria",
"-",
"label",
"=",
"{",
"deleteBtnTitle",
"}",
"disabled",
"=",
"{",
"value",
".",
"length",
"===",
"1",
"}",
"color",
"=",
"\"danger\"",
"iconType",
"=",
"\"trash\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"onRemoveRange",
"(",
"id",
")",
"}",
"/>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"<",
"/Fragment>);",
"}",
")",
"}",
"{",
"hasInvalidRange",
"&&",
"(",
"<",
"EuiFormErrorText",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.controls.dateRanges.errorMessage\"",
"defaultMessage",
"=",
"\"Each range should have at least one valid date.\"",
"/",
">",
"<",
"/EuiFormErrorText>)}",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiButtonEmpty",
"iconType",
"=",
"\"plusInCircleFilled\"",
"onClick",
"=",
"{",
"onAddRange",
"}",
"size",
"=",
"\"xs\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"visEditorAddDateRange\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"visDefaultEditor.controls.dateRanges.addRangeButtonLabel\"",
"defaultMessage",
"=",
"\"Add range\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>",
"<",
"/>",
"<",
"/EuiFormRow>);",
"}",
"export",
"{",
"DateRangesParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661597 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"SwitchParamEditor",
"}",
"from",
"'./switch'",
";",
"import",
"{",
"AggParamEditorProps",
"}",
"from",
"'../agg_param_props'",
";",
"function",
"DropPartialsParamEditor",
"(",
"props",
")",
"{",
"return",
"(",
"<",
"SwitchParamEditor",
"dataTestSubj",
"=",
"\"dropPartialBucketsCheckbox\"",
"displayLabel",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.dropPartialBucketsLabel'",
",",
"{",
"defaultMessage",
":",
"'Drop partial buckets'",
",",
"}",
")",
"}",
"displayToolTip",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'visDefaultEditor.controls.dropPartialBucketsTooltip'",
",",
"{",
"defaultMessage",
":",
"\"Remove buckets that span time outside the time range so the histogram doesn't start and end with incomplete buckets.\"",
",",
"}",
")",
"}",
"{",
"...",
"props",
"}",
"/>);",
"}",
"export",
"{",
"DropPartialsParamEditor",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1358,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661598 | [
"import",
"{",
"useCallback",
"}",
"from",
"'react'",
";",
"import",
"{",
"IAggConfig",
",",
"AggParamType",
"}",
"from",
"'src/plugins/data/public'",
";",
"type",
"SetValue",
"=",
"(",
"value",
"?",
":",
"IAggConfig",
")",
"=>",
"void",
";",
"function",
"useSubAggParamsHandlers",
"(",
"agg",
",",
"aggParam",
",",
"subAgg",
",",
"setValue",
")",
"{",
"const",
"setAggParamValue",
"=",
"useCallback",
"(",
"(",
"aggId",
",",
"paramName",
",",
"val",
")",
"=>",
"{",
"const",
"parsedParams",
"=",
"subAgg",
".",
"toJSON",
"(",
")",
";",
"const",
"params",
"=",
"{",
"...",
"parsedParams",
",",
"params",
":",
"{",
"...",
"parsedParams",
".",
"params",
",",
"[",
"paramName",
"]",
":",
"val",
",",
"}",
",",
"}",
";",
"setValue",
"(",
"aggParam",
".",
"makeAgg",
"(",
"agg",
",",
"params",
")",
")",
";",
"}",
",",
"[",
"agg",
",",
"aggParam",
",",
"setValue",
",",
"subAgg",
"]",
")",
";",
"const",
"onAggTypeChange",
"=",
"useCallback",
"(",
"(",
"aggId",
",",
"aggType",
")",
"=>",
"{",
"const",
"parsedAgg",
"=",
"subAgg",
".",
"toJSON",
"(",
")",
";",
"const",
"params",
"=",
"{",
"...",
"parsedAgg",
",",
"type",
":",
"aggType",
",",
"}",
";",
"setValue",
"(",
"aggParam",
".",
"makeAgg",
"(",
"agg",
",",
"params",
")",
")",
";",
"}",
",",
"[",
"agg",
",",
"aggParam",
",",
"setValue",
",",
"subAgg",
"]",
")",
";",
"return",
"{",
"onAggTypeChange",
",",
"setAggParamValue",
"}",
";",
"}",
"export",
"{",
"useSubAggParamsHandlers",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
941,
null,
5618,
null,
941,
null,
9193,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661599 | [
"param",
"{",
"Array",
"<",
"string",
">",
"}",
"list",
"param",
"{",
"Object",
"}",
"options",
"property",
"return",
"{",
"String",
"}",
"export",
"function",
"formatListAsProse",
"(",
"list",
",",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"inclusive",
"=",
"true",
"}",
"=",
"options",
";",
"const",
"count",
"=",
"list",
".",
"length",
";",
"const",
"conjunction",
"=",
"inclusive",
"?",
"'and'",
":",
"'or'",
";",
"if",
"(",
"count",
"<=",
"2",
")",
"{",
"return",
"list",
".",
"join",
"(",
"` ${",
"conjunction",
"} `",
")",
";",
"}",
"return",
"list",
".",
"slice",
"(",
"0",
",",
"-",
"1",
")",
".",
"concat",
"(",
"`${",
"conjunction",
"} ${",
"list",
"[",
"count",
"-",
"1",
"]",
"}`",
")",
".",
"join",
"(",
"', '",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
5,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |