id
stringlengths 1
6
| tokens
sequence | labels
sequence |
---|---|---|
661200 | [
"import",
"{",
"constant",
",",
"noop",
",",
"identity",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"ISearchSource",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"SerializedFieldFormat",
"}",
"from",
"'src/plugins/expressions/common'",
";",
"import",
"type",
"{",
"RequestAdapter",
"}",
"from",
"'src/plugins/inspector/common'",
";",
"import",
"{",
"initParams",
"}",
"from",
"'./agg_params'",
";",
"import",
"{",
"AggConfig",
"}",
"from",
"'./agg_config'",
";",
"import",
"{",
"IAggConfigs",
"}",
"from",
"'./agg_configs'",
";",
"import",
"{",
"BaseParamType",
"}",
"from",
"'./param_types/base'",
";",
"import",
"{",
"AggParamType",
"}",
"from",
"'./param_types/agg'",
";",
"export",
"interface",
"AggTypeConfig",
"<",
"TAggConfig",
"extends",
"AggConfig",
"=",
"AggConfig",
",",
"TParam",
"extends",
"AggParamType",
"<",
"TAggConfig",
">",
"=",
"AggParamType",
"<",
"TAggConfig",
">",
">",
"{",
"name",
":",
"string",
";",
"title",
":",
"string",
";",
"createFilter",
"?",
":",
"(",
"aggConfig",
":",
"TAggConfig",
",",
"key",
":",
"any",
",",
"params",
"?",
":",
"any",
")",
"=>",
"any",
";",
"type",
"?",
":",
"string",
";",
"dslName",
"?",
":",
"string",
";",
"expressionName",
"?",
":",
"string",
";",
"makeLabel",
"?",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
")",
"=>",
"string",
")",
"|",
"(",
"(",
")",
"=>",
"string",
")",
";",
"ordered",
"?",
":",
"any",
";",
"hasNoDsl",
"?",
":",
"boolean",
";",
"params",
"?",
":",
"Array",
"<",
"Partial",
"<",
"TParam",
">",
">",
";",
"getRequestAggs",
"?",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
")",
"=>",
"TAggConfig",
"[",
"]",
")",
"|",
"(",
"(",
")",
"=>",
"TAggConfig",
"[",
"]",
"|",
"void",
")",
";",
"getResponseAggs",
"?",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
")",
"=>",
"TAggConfig",
"[",
"]",
")",
"|",
"(",
"(",
")",
"=>",
"TAggConfig",
"[",
"]",
"|",
"void",
")",
";",
"customLabels",
"?",
":",
"boolean",
";",
"json",
"?",
":",
"boolean",
";",
"decorateAggConfig",
"?",
":",
"(",
")",
"=>",
"any",
";",
"postFlightRequest",
"?",
":",
"(",
"resp",
":",
"any",
",",
"aggConfigs",
":",
"IAggConfigs",
",",
"aggConfig",
":",
"TAggConfig",
",",
"searchSource",
":",
"ISearchSource",
",",
"inspectorRequestAdapter",
":",
"RequestAdapter",
",",
"abortSignal",
"?",
":",
"AbortSignal",
")",
"=>",
"Promise",
"<",
"any",
">",
";",
"getSerializedFormat",
"?",
":",
"(",
"agg",
":",
"TAggConfig",
")",
"=>",
"SerializedFieldFormat",
";",
"getValue",
"?",
":",
"(",
"agg",
":",
"TAggConfig",
",",
"bucket",
":",
"any",
")",
"=>",
"any",
";",
"getKey",
"?",
":",
"(",
"bucket",
":",
"any",
",",
"key",
":",
"any",
",",
"agg",
":",
"TAggConfig",
")",
"=>",
"any",
";",
"}",
"export",
"type",
"IAggType",
"=",
"AggType",
";",
"export",
"class",
"AggType",
"<",
"TAggConfig",
"extends",
"AggConfig",
"=",
"AggConfig",
",",
"TParam",
"extends",
"AggParamType",
"<",
"TAggConfig",
">",
"=",
"AggParamType",
"<",
"TAggConfig",
">",
">",
"{",
"property",
"type",
"{",
"string",
"}",
"name",
":",
"string",
";",
"type",
":",
"string",
";",
"subtype",
"?",
":",
"string",
";",
"property",
"type",
"{",
"string",
"}",
"dslName",
":",
"string",
";",
"property",
"type",
"{",
"string",
"}",
"expressionName",
"?",
":",
"string",
";",
"property",
"type",
"{",
"string",
"}",
"title",
":",
"string",
";",
"method",
"param",
"{",
"AggConfig",
"}",
"aggConfig",
"returns",
"{",
"string",
"}",
"makeLabel",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
")",
"=>",
"string",
")",
"|",
"(",
"(",
")",
"=>",
"string",
")",
";",
"property",
"type",
"{",
"object",
"|",
"undefined",
"}",
"ordered",
":",
"any",
";",
"type",
"{",
"Boolean",
"}",
"hasNoDsl",
":",
"boolean",
";",
"param",
"{",
"object",
"}",
"aggConfig",
"param",
"{",
"mixed",
"}",
"key",
"returns",
"{",
"object",
"}",
"createFilter",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
",",
"key",
":",
"any",
",",
"params",
"?",
":",
"any",
")",
"=>",
"any",
")",
"|",
"undefined",
";",
"property",
"type",
"{",
"AggParams",
"}",
"params",
":",
"TParam",
"[",
"]",
";",
"method",
"returns",
"{",
"array",
"[",
"AggConfig",
"]",
"}",
"getRequestAggs",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
")",
"=>",
"TAggConfig",
"[",
"]",
")",
"|",
"(",
"(",
")",
"=>",
"TAggConfig",
"[",
"]",
"|",
"void",
")",
";",
"method",
"returns",
"{",
"array",
"[",
"AggConfig",
"]",
"|",
"undefined",
"}",
"getResponseAggs",
":",
"(",
"(",
"aggConfig",
":",
"TAggConfig",
")",
"=>",
"TAggConfig",
"[",
"]",
")",
"|",
"(",
"(",
")",
"=>",
"TAggConfig",
"[",
"]",
"|",
"void",
")",
";",
"/**\n * A function that will be called each time an aggConfig of this type\n * is created, giving the agg type a chance to modify the agg config\n */",
"decorateAggConfig",
":",
"(",
")",
"=>",
"any",
";",
"param",
"aggConfigs",
"param",
"aggConfig",
"param",
"searchSourceAggs",
"param",
"resp",
"param",
"nestedSearchSource",
"return",
"{",
"Promise",
"}",
"postFlightRequest",
":",
"(",
"resp",
":",
"any",
",",
"aggConfigs",
":",
"IAggConfigs",
",",
"aggConfig",
":",
"TAggConfig",
",",
"searchSource",
":",
"ISearchSource",
",",
"inspectorRequestAdapter",
":",
"RequestAdapter",
",",
"abortSignal",
"?",
":",
"AbortSignal",
")",
"=>",
"Promise",
"<",
"any",
">",
";",
"param",
"{",
"agg",
"}",
"agg",
"return",
"{",
"SerializedFieldFormat",
"}",
"getSerializedFormat",
":",
"(",
"agg",
":",
"TAggConfig",
")",
"=>",
"SerializedFieldFormat",
";",
"getValue",
":",
"(",
"agg",
":",
"TAggConfig",
",",
"bucket",
":",
"any",
")",
"=>",
"any",
";",
"getKey",
"?",
":",
"(",
"bucket",
":",
"any",
",",
"key",
":",
"any",
",",
"agg",
":",
"TAggConfig",
")",
"=>",
"any",
";",
"paramByName",
"=",
"(",
"name",
")",
"=>",
"{",
"return",
"this",
".",
"params",
".",
"find",
"(",
"(",
"p",
")",
"=>",
"p",
".",
"name",
"===",
"name",
")",
";",
"}",
";",
"class",
"private",
"param",
"{",
"object",
"}",
"config",
"constructor",
"(",
"config",
")",
"{",
"this",
".",
"name",
"=",
"config",
".",
"name",
";",
"this",
".",
"type",
"=",
"config",
".",
"type",
"||",
"'metrics'",
";",
"this",
".",
"dslName",
"=",
"config",
".",
"dslName",
"||",
"config",
".",
"name",
";",
"this",
".",
"expressionName",
"=",
"config",
".",
"expressionName",
";",
"this",
".",
"title",
"=",
"config",
".",
"title",
";",
"this",
".",
"makeLabel",
"=",
"config",
".",
"makeLabel",
"||",
"constant",
"(",
"this",
".",
"name",
")",
";",
"this",
".",
"ordered",
"=",
"config",
".",
"ordered",
";",
"this",
".",
"hasNoDsl",
"=",
"!",
"!",
"config",
".",
"hasNoDsl",
";",
"if",
"(",
"config",
".",
"createFilter",
")",
"{",
"this",
".",
"createFilter",
"=",
"config",
".",
"createFilter",
";",
"}",
"if",
"(",
"config",
".",
"params",
"&&",
"config",
".",
"params",
".",
"length",
"&&",
"config",
".",
"params",
"[",
"0",
"]",
"instanceof",
"BaseParamType",
")",
"{",
"this",
".",
"params",
"=",
"config",
".",
"params",
"as",
"TParam",
"[",
"]",
";",
"}",
"else",
"{",
"const",
"params",
"=",
"config",
".",
"params",
"?",
"[",
"...",
"config",
".",
"params",
"]",
":",
"[",
"]",
";",
"if",
"(",
"config",
".",
"json",
"!==",
"false",
")",
"{",
"params",
".",
"push",
"(",
"{",
"name",
":",
"'json'",
",",
"type",
":",
"'json'",
",",
"advanced",
":",
"true",
",",
"}",
")",
";",
"}",
"if",
"(",
"config",
".",
"customLabels",
"!==",
"false",
")",
"{",
"params",
".",
"push",
"(",
"{",
"name",
":",
"'customLabel'",
",",
"displayName",
":",
"i18n",
".",
"translate",
"(",
"'data.search.aggs.string.customLabel'",
",",
"{",
"defaultMessage",
":",
"'Custom label'",
",",
"}",
")",
",",
"type",
":",
"'string'",
",",
"write",
":",
"noop",
",",
"}",
")",
";",
"}",
"this",
".",
"params",
"=",
"initParams",
"(",
"params",
")",
";",
"}",
"this",
".",
"getRequestAggs",
"=",
"config",
".",
"getRequestAggs",
"||",
"noop",
";",
"this",
".",
"getResponseAggs",
"=",
"config",
".",
"getResponseAggs",
"||",
"(",
"(",
")",
"=>",
"{",
"}",
")",
";",
"this",
".",
"decorateAggConfig",
"=",
"config",
".",
"decorateAggConfig",
"||",
"(",
"(",
")",
"=>",
"(",
"{",
"}",
")",
")",
";",
"this",
".",
"postFlightRequest",
"=",
"config",
".",
"postFlightRequest",
"||",
"identity",
";",
"this",
".",
"getSerializedFormat",
"=",
"config",
".",
"getSerializedFormat",
"||",
"(",
"(",
"agg",
")",
"=>",
"{",
"return",
"agg",
".",
"params",
".",
"field",
"?",
"agg",
".",
"aggConfigs",
".",
"indexPattern",
".",
"getFormatterForField",
"(",
"agg",
".",
"params",
".",
"field",
")",
".",
"toJSON",
"(",
")",
":",
"{",
"}",
";",
"}",
")",
";",
"this",
".",
"getValue",
"=",
"config",
".",
"getValue",
"||",
"(",
"(",
"agg",
",",
"bucket",
")",
"=>",
"{",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4798,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26111,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2433,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2433,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661201 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"Assign",
",",
"Ensure",
"}",
"from",
"'@osd/utility-types'",
";",
"import",
"{",
"ISearchSource",
"}",
"from",
"'src/plugins/data/public'",
";",
"import",
"{",
"ExpressionAstFunction",
",",
"ExpressionAstArgument",
",",
"SerializedFieldFormat",
",",
"}",
"from",
"'src/plugins/expressions/common'",
";",
"import",
"{",
"ISearchOptions",
"}",
"from",
"'../opensearch_search'",
";",
"import",
"{",
"IAggType",
"}",
"from",
"'./agg_type'",
";",
"import",
"{",
"writeParams",
"}",
"from",
"'./agg_params'",
";",
"import",
"{",
"IAggConfigs",
"}",
"from",
"'./agg_configs'",
";",
"type",
"State",
"=",
"string",
"|",
"number",
"|",
"boolean",
"|",
"null",
"|",
"undefined",
"|",
"SerializableState",
";",
"internal",
"export",
"interface",
"SerializableState",
"{",
"[",
"key",
"]",
":",
"State",
"|",
"State",
"[",
"]",
";",
"}",
"internal",
"export",
"type",
"AggConfigSerialized",
"=",
"Ensure",
"<",
"{",
"type",
":",
"string",
";",
"enabled",
"?",
":",
"boolean",
";",
"id",
"?",
":",
"string",
";",
"params",
"?",
":",
"{",
"}",
"|",
"SerializableState",
";",
"schema",
"?",
":",
"string",
";",
"}",
",",
"SerializableState",
">",
";",
"export",
"type",
"AggConfigOptions",
"=",
"Assign",
"<",
"AggConfigSerialized",
",",
"{",
"type",
":",
"IAggType",
";",
"}",
">",
";",
"name",
"description",
"export",
"type",
"IAggConfig",
"=",
"AggConfig",
";",
"export",
"class",
"AggConfig",
"{",
"param",
"{",
"array",
"[",
"object",
"]",
"}",
"list",
"return",
"{",
"array",
"}",
"static",
"ensureIds",
"(",
"list",
")",
"{",
"const",
"have",
"=",
"[",
"]",
";",
"const",
"haveNot",
"=",
"[",
"]",
";",
"list",
".",
"forEach",
"(",
"function",
"(",
"obj",
")",
"{",
"(",
"obj",
".",
"id",
"?",
"have",
":",
"haveNot",
")",
".",
"push",
"(",
"obj",
")",
";",
"}",
")",
";",
"let",
"nextId",
"=",
"AggConfig",
".",
"nextId",
"(",
"have",
")",
";",
"haveNot",
".",
"forEach",
"(",
"function",
"(",
"obj",
")",
"{",
"obj",
".",
"id",
"=",
"String",
"(",
"nextId",
"++",
")",
";",
"}",
")",
";",
"return",
"list",
";",
"}",
"return",
"{",
"array",
"}",
"static",
"nextId",
"(",
"list",
")",
"{",
"return",
"(",
"1",
"+",
"list",
".",
"reduce",
"(",
"function",
"(",
"max",
",",
"obj",
")",
"{",
"return",
"Math",
".",
"max",
"(",
"max",
",",
"+",
"obj",
".",
"id",
"||",
"0",
")",
";",
"}",
",",
"0",
")",
")",
";",
"}",
"public",
"aggConfigs",
":",
"IAggConfigs",
";",
"public",
"id",
":",
"string",
";",
"public",
"enabled",
":",
"boolean",
";",
"public",
"params",
":",
"any",
";",
"public",
"parent",
"?",
":",
"IAggConfigs",
";",
"public",
"brandNew",
"?",
":",
"boolean",
";",
"public",
"schema",
"?",
":",
"string",
";",
"private",
"__type",
":",
"IAggType",
";",
"private",
"__typeDecorations",
":",
"any",
";",
"private",
"subAggs",
":",
"AggConfig",
"[",
"]",
"=",
"[",
"]",
";",
"constructor",
"(",
"aggConfigs",
",",
"opts",
")",
"{",
"this",
".",
"aggConfigs",
"=",
"aggConfigs",
";",
"this",
".",
"id",
"=",
"String",
"(",
"opts",
".",
"id",
"||",
"AggConfig",
".",
"nextId",
"(",
"aggConfigs",
".",
"aggs",
"as",
"any",
")",
")",
";",
"this",
".",
"enabled",
"=",
"typeof",
"opts",
".",
"enabled",
"===",
"'boolean'",
"?",
"opts",
".",
"enabled",
":",
"true",
";",
"this",
".",
"params",
"=",
"{",
"}",
";",
"this",
".",
"setType",
"(",
"opts",
".",
"type",
")",
";",
"if",
"(",
"opts",
".",
"schema",
")",
"{",
"this",
".",
"schema",
"=",
"opts",
".",
"schema",
";",
"}",
"this",
".",
"setParams",
"(",
"opts",
".",
"params",
"||",
"{",
"}",
")",
";",
"this",
".",
"__type",
"=",
"this",
".",
"__type",
";",
"}",
"param",
"{",
"object",
"}",
"from",
"return",
"{",
"undefined",
"}",
"setParams",
"(",
"from",
")",
"{",
"from",
"=",
"from",
"||",
"this",
".",
"params",
"||",
"{",
"}",
";",
"const",
"to",
"=",
"(",
"this",
".",
"params",
"=",
"{",
"}",
"as",
"any",
")",
";",
"this",
".",
"getAggParams",
"(",
")",
".",
"forEach",
"(",
"(",
"aggParam",
")",
"=>",
"{",
"let",
"val",
"=",
"from",
"[",
"aggParam",
".",
"name",
"]",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"if",
"(",
"aggParam",
".",
"default",
"==",
"null",
")",
"return",
";",
"if",
"(",
"!",
"_",
".",
"isFunction",
"(",
"aggParam",
".",
"default",
")",
")",
"{",
"val",
"=",
"aggParam",
".",
"default",
";",
"}",
"else",
"{",
"val",
"=",
"aggParam",
".",
"default",
"(",
"this",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"return",
";",
"}",
"}",
"if",
"(",
"aggParam",
".",
"deserialize",
")",
"{",
"const",
"isTyped",
"=",
"_",
".",
"isFunction",
"(",
"aggParam",
".",
"valueType",
")",
";",
"const",
"isType",
"=",
"isTyped",
"&&",
"val",
"instanceof",
"aggParam",
".",
"valueType",
";",
"const",
"isObject",
"=",
"!",
"isTyped",
"&&",
"_",
".",
"isObject",
"(",
"val",
")",
";",
"const",
"isDeserialized",
"=",
"isType",
"||",
"isObject",
";",
"if",
"(",
"!",
"isDeserialized",
")",
"{",
"val",
"=",
"aggParam",
".",
"deserialize",
"(",
"val",
",",
"this",
")",
";",
"}",
"to",
"[",
"aggParam",
".",
"name",
"]",
"=",
"val",
";",
"return",
";",
"}",
"to",
"[",
"aggParam",
".",
"name",
"]",
"=",
"_",
".",
"cloneDeep",
"(",
"val",
")",
";",
"}",
")",
";",
"}",
"getParam",
"(",
"key",
")",
"{",
"return",
"_",
".",
"get",
"(",
"this",
".",
"params",
",",
"key",
")",
";",
"}",
"write",
"(",
"aggs",
"?",
")",
"{",
"return",
"writeParams",
"<",
"AggConfig",
">",
"(",
"this",
".",
"type",
".",
"params",
",",
"this",
",",
"aggs",
")",
";",
"}",
"isFilterable",
"(",
")",
"{",
"return",
"_",
".",
"isFunction",
"(",
"this",
".",
"type",
".",
"createFilter",
")",
";",
"}",
"createFilter",
"(",
"key",
",",
"params",
"=",
"{",
"}",
")",
"{",
"const",
"createFilter",
"=",
"this",
".",
"type",
".",
"createFilter",
";",
"if",
"(",
"!",
"createFilter",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"`The \"${",
"this",
".",
"type",
".",
"title",
"}\" aggregation does not support filtering.`",
")",
";",
"}",
"const",
"field",
"=",
"this",
".",
"getField",
"(",
")",
";",
"const",
"label",
"=",
"this",
".",
"getFieldDisplayName",
"(",
")",
";",
"if",
"(",
"field",
"&&",
"!",
"field",
".",
"filterable",
")",
"{",
"let",
"message",
"=",
"`The \"${",
"label",
"}\" field can not be used for filtering.`",
";",
"if",
"(",
"field",
".",
"scripted",
")",
"{",
"message",
"=",
"`The \"${",
"label",
"}\" field is scripted and can not be used for filtering.`",
";",
"}",
"throw",
"new",
"TypeError",
"(",
"message",
")",
";",
"}",
"return",
"createFilter",
"(",
"this",
",",
"key",
",",
"params",
")",
";",
"}",
"param",
"{",
"SearchSource",
"}",
"searchSource",
"param",
"{",
"ISearchOptions",
"}",
"options",
"return",
"{",
"Promise",
"<",
"undefined",
">",
"}",
"onSearchRequestStart",
"(",
"searchSource",
",",
"options",
"?",
")",
"{",
"if",
"(",
"!",
"this",
".",
"type",
")",
"{",
"return",
"Promise",
".",
"resolve",
"(",
")",
";",
"}",
"return",
"Promise",
".",
"all",
"(",
"this",
".",
"type",
".",
"params",
".",
"map",
"(",
"(",
"param",
")",
"=>",
"param",
".",
"modifyAggConfigOnSearchRequestStart",
"(",
"this",
",",
"searchSource",
",",
"options",
")",
")",
")",
";",
"}",
"param",
"{",
"AggConfigs",
"}",
"aggConfigs",
"return",
"{",
"void",
"|",
"Object",
"}",
"toDsl",
"(",
"aggConfigs",
"?",
")",
"{",
"if",
"(",
"this",
".",
"type",
".",
"hasNoDsl",
")",
"return",
";",
"const",
"output",
"=",
"this",
".",
"write",
"(",
"aggConfigs",
")",
"as",
"any",
";",
"const",
"configDsl",
"=",
"{",
"}",
"as",
"any",
";",
"configDsl",
"[",
"this",
".",
"type",
".",
"dslName",
"||",
"this",
".",
"type",
".",
"name",
"]",
"=",
"output",
".",
"params",
";",
"if",
"(",
"this",
".",
"subAggs",
".",
"length",
"&&",
"!",
"output",
".",
"subAggs",
")",
"output",
".",
"subAggs",
"=",
"this",
".",
"subAggs",
";",
"if",
"(",
"output",
".",
"subAggs",
")",
"{",
"const",
"subDslLvl",
"=",
"configDsl",
".",
"aggs",
"||",
"(",
"configDsl",
".",
"aggs",
"=",
"{",
"}",
")",
";",
"output",
".",
"subAggs",
".",
"forEach",
"(",
"function",
"nestAdhocSubAggs",
"(",
"subAggConfig",
")",
"{",
"subDslLvl",
"[",
"subAggConfig",
".",
"id",
"]",
"=",
"subAggConfig",
".",
"toDsl",
"(",
"aggConfigs",
")",
";",
"}",
")",
";",
"}",
"if",
"(",
"output",
".",
"parentAggs",
")",
"{",
"const",
"subDslLvl",
"=",
"configDsl",
".",
"parentAggs",
"||",
"(",
"configDsl",
".",
"parentAggs",
"=",
"{",
"}",
")",
";",
"output",
".",
"parentAggs",
".",
"forEach",
"(",
"function",
"nestAdhocSubAggs",
"(",
"subAggConfig",
")",
"{",
"subDslLvl",
"[",
"subAggConfig",
".",
"id",
"]",
"=",
"subAggConfig",
".",
"toDsl",
"(",
"aggConfigs",
")",
";",
"}",
")",
";",
"}",
"return",
"configDsl",
";",
"}",
"returns",
"serialize",
"(",
")",
"{",
"const",
"params",
"=",
"this",
".",
"params",
";",
"const",
"outParams",
"=",
"_",
".",
"transform",
"(",
"this",
".",
"getAggParams",
"(",
")",
",",
"(",
"out",
",",
"aggParam",
")",
"=>",
"{",
"let",
"val",
"=",
"params",
"[",
"aggParam",
".",
"name",
"]",
";",
"if",
"(",
"val",
"==",
"null",
")",
"return",
";",
"if",
"(",
"aggParam",
".",
"serialize",
")",
"val",
"=",
"aggParam",
".",
"serialize",
"(",
"val",
",",
"this",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"return",
";",
"out",
"[",
"aggParam",
".",
"name",
"]",
"=",
"_",
".",
"cloneDeep",
"(",
"val",
")",
";",
"}",
",",
"{",
"}",
")",
";",
"return",
"{",
"id",
":",
"this",
".",
"id",
",",
"enabled",
":",
"this",
".",
"enabled",
",",
"type",
":",
"this",
".",
"type",
"&&",
"this",
".",
"type",
".",
"name",
",",
"params",
":",
"outParams",
"as",
"SerializableState",
",",
"...",
"(",
"this",
".",
"schema",
"&&",
"{",
"schema",
":",
"this",
".",
"schema",
"}",
")",
",",
"}",
";",
"}",
"deprecated",
"toJSON",
"(",
")",
"{",
"return",
"this",
".",
"serialize",
"(",
")",
";",
"}",
"public",
"toSerializedFieldFormat",
"(",
")",
"{",
"return",
"this",
".",
"type",
"?",
"this",
".",
"type",
".",
"getSerializedFormat",
"(",
"this",
")",
":",
"{",
"}",
";",
"}",
"returns",
"toExpressionAst",
"(",
")",
"{",
"const",
"functionName",
"=",
"this",
".",
"type",
"&&",
"this",
".",
"type",
".",
"expressionName",
";",
"const",
"{",
"type",
",",
"...",
"rest",
"}",
"=",
"this",
".",
"serialize",
"(",
")",
";",
"if",
"(",
"!",
"functionName",
"||",
"!",
"rest",
".",
"params",
")",
"{",
"return",
";",
"}",
"const",
"params",
"=",
"Object",
".",
"entries",
"(",
"rest",
".",
"params",
")",
".",
"reduce",
"(",
"(",
"acc",
",",
"[",
"key",
",",
"value",
"]",
")",
"=>",
"{",
"const",
"deserializedParam",
"=",
"this",
".",
"getAggParams",
"(",
")",
".",
"find",
"(",
"(",
"p",
")",
"=>",
"p",
".",
"name",
"===",
"key",
")",
";",
"if",
"(",
"deserializedParam",
"&&",
"deserializedParam",
".",
"toExpressionAst",
")",
"{",
"const",
"paramExpressionAst",
"=",
"deserializedParam",
".",
"toExpressionAst",
"(",
"this",
".",
"getParam",
"(",
"key",
")",
")",
";",
"if",
"(",
"paramExpressionAst",
")",
"{",
"acc",
"[",
"key",
"]",
"=",
"[",
"{",
"type",
":",
"'expression'",
",",
"chain",
":",
"[",
"paramExpressionAst",
"]",
",",
"}",
",",
"]",
";",
"}",
"}",
"else",
"if",
"(",
"typeof",
"value",
"===",
"'object'",
")",
"{",
"acc",
"[",
"key",
"]",
"=",
"[",
"JSON",
".",
"stringify",
"(",
"value",
")",
"]",
";",
"}",
"else",
"if",
"(",
"typeof",
"value",
"!==",
"'undefined'",
")",
"{",
"acc",
"[",
"key",
"]",
"=",
"[",
"value",
"]",
";",
"}",
"return",
"acc",
";",
"}",
",",
"{",
"}",
"as",
"Record",
"<",
"string",
",",
"ExpressionAstArgument",
"[",
"]",
">",
")",
";",
"return",
"{",
"type",
":",
"'function'",
",",
"function",
":",
"functionName",
",",
"arguments",
":",
"{",
"...",
"params",
",",
"id",
":",
"[",
"this",
".",
"id",
"]",
",",
"enabled",
":",
"[",
"this",
".",
"enabled",
"]",
",",
"...",
"(",
"this",
".",
"schema",
"?",
"{",
"schema",
":",
"[",
"this",
".",
"schema",
"]",
"}",
":",
"{",
"}",
")",
",",
"}",
",",
"}",
";",
"}",
"getAggParams",
"(",
")",
"{",
"return",
"[",
"...",
"(",
"_",
".",
"hasIn",
"(",
"this",
",",
"'type.params'",
")",
"?",
"this",
".",
"type",
".",
"params",
":",
"[",
"]",
")",
"]",
";",
"}",
"getRequestAggs",
"(",
")",
"{",
"return",
"(",
"this",
".",
"type",
"&&",
"this",
".",
"type",
".",
"getRequestAggs",
"(",
"this",
")",
")",
"||",
"[",
"this",
"]",
";",
"}",
"getResponseAggs",
"(",
")",
"{",
"return",
"(",
"this",
".",
"type",
"&&",
"this",
".",
"type",
".",
"getResponseAggs",
"(",
"this",
")",
")",
"||",
"[",
"this",
"]",
";",
"}",
"getValue",
"(",
"bucket",
")",
"{",
"return",
"this",
".",
"type",
".",
"getValue",
"(",
"this",
",",
"bucket",
")",
";",
"}",
"getKey",
"(",
"bucket",
",",
"key",
"?",
")",
"{",
"if",
"(",
"this",
".",
"type",
".",
"getKey",
")",
"{",
"return",
"this",
".",
"type",
".",
"getKey",
"(",
"bucket",
",",
"key",
",",
"this",
")",
";",
"}",
"else",
"{",
"return",
"''",
";",
"}",
"}",
"getFieldDisplayName",
"(",
")",
"{",
"const",
"field",
"=",
"this",
".",
"getField",
"(",
")",
";",
"return",
"field",
"?",
"field",
".",
"displayName",
"||",
"this",
".",
"fieldName",
"(",
")",
":",
"''",
";",
"}",
"getField",
"(",
")",
"{",
"return",
"this",
".",
"params",
".",
"field",
";",
"}",
"makeLabel",
"(",
"percentageMode",
"=",
"false",
")",
"{",
"if",
"(",
"this",
".",
"params",
".",
"customLabel",
")",
"{",
"return",
"this",
".",
"params",
".",
"customLabel",
";",
"}",
"if",
"(",
"!",
"this",
".",
"type",
")",
"return",
"''",
";",
"return",
"percentageMode",
"?",
"i18n",
".",
"translate",
"(",
"'data.search.aggs.percentageOfLabel'",
",",
"{",
"defaultMessage",
":",
"'Percentage of {label}'",
",",
"values",
":",
"{",
"label",
":",
"this",
".",
"type",
".",
"makeLabel",
"(",
"this",
")",
"}",
",",
"}",
")",
":",
"`${",
"this",
".",
"type",
".",
"makeLabel",
"(",
"this",
")",
"}`",
";",
"}",
"getIndexPattern",
"(",
")",
"{",
"return",
"this",
".",
"aggConfigs",
".",
"indexPattern",
";",
"}",
"getTimeRange",
"(",
")",
"{",
"return",
"this",
".",
"aggConfigs",
".",
"timeRange",
";",
"}",
"fieldName",
"(",
")",
"{",
"const",
"field",
"=",
"this",
".",
"getField",
"(",
")",
";",
"return",
"field",
"?",
"field",
".",
"name",
":",
"''",
";",
"}",
"fieldIsTimeField",
"(",
")",
"{",
"const",
"indexPattern",
"=",
"this",
".",
"getIndexPattern",
"(",
")",
";",
"if",
"(",
"!",
"indexPattern",
")",
"return",
"false",
";",
"const",
"timeFieldName",
"=",
"indexPattern",
".",
"timeFieldName",
";",
"return",
"timeFieldName",
"&&",
"this",
".",
"fieldName",
"(",
")",
"===",
"timeFieldName",
";",
"}",
"public",
"get",
"type",
"(",
")",
"{",
"return",
"this",
".",
"__type",
";",
"}",
"public",
"set",
"type",
"(",
"type",
")",
"{",
"if",
"(",
"this",
".",
"__typeDecorations",
")",
"{",
"_",
".",
"forOwn",
"(",
"this",
".",
"__typeDecorations",
",",
"(",
"prop",
",",
"name",
")",
"=>",
"{",
"delete",
"this",
"[",
"name",
"]",
";",
"}",
")",
";",
"}",
"if",
"(",
"type",
"&&",
"_",
".",
"isFunction",
"(",
"type",
".",
"decorateAggConfig",
")",
")",
"{",
"this",
".",
"__typeDecorations",
"=",
"type",
".",
"decorateAggConfig",
"(",
")",
";",
"Object",
".",
"defineProperties",
"(",
"this",
",",
"this",
".",
"__typeDecorations",
")",
";",
"}",
"this",
".",
"__type",
"=",
"type",
";",
"let",
"availableFields",
"=",
"[",
"]",
";",
"const",
"fieldParam",
"=",
"this",
".",
"type",
"&&",
"this",
".",
"type",
".",
"params",
".",
"find",
"(",
"(",
"p",
")",
"=>",
"p",
".",
"type",
"===",
"'field'",
")",
";",
"if",
"(",
"fieldParam",
")",
"{",
"availableFields",
"=",
"fieldParam",
".",
"getAvailableFields",
"(",
"this",
")",
";",
"}",
"this",
".",
"setParams",
"(",
"{",
"field",
":",
"availableFields",
".",
"find",
"(",
"(",
"field",
")",
"=>",
"field",
".",
"name",
"===",
"this",
".",
"getField",
"(",
")",
")",
",",
"}",
")",
";",
"}",
"public",
"setType",
"(",
"type",
")",
"{",
"this",
".",
"type",
"=",
"type",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
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,
3,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2050,
null,
26112,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5618,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
2050,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
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,
7,
null,
3208,
null,
1488,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2050,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8958,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8958,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5617,
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,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
17,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5618,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5618,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5617,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
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,
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,
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,
584,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1285,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
584,
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,
5407,
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,
5,
null,
null,
null,
null,
null,
5618,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5407,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661202 | [
"import",
"{",
"ExpressionsServiceSetup",
"}",
"from",
"'src/plugins/expressions/common'",
";",
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"GetConfigFn",
"}",
"from",
"'../../types'",
";",
"import",
"{",
"AggConfigs",
",",
"AggTypesRegistry",
",",
"getAggTypes",
",",
"getAggTypesFunctions",
",",
"getCalculateAutoTimeExpression",
",",
"}",
"from",
"'./'",
";",
"import",
"{",
"AggsCommonSetup",
",",
"AggsCommonStart",
"}",
"from",
"'./types'",
";",
"internal",
"export",
"const",
"aggsRequiredUiSettings",
"=",
"[",
"'dateFormat'",
",",
"'dateFormat:scaled'",
",",
"'dateFormat:tz'",
",",
"UI_SETTINGS",
".",
"HISTOGRAM_BAR_TARGET",
",",
"UI_SETTINGS",
".",
"HISTOGRAM_MAX_BARS",
",",
"UI_SETTINGS",
".",
"SEARCH_QUERY_LANGUAGE",
",",
"UI_SETTINGS",
".",
"QUERY_ALLOW_LEADING_WILDCARDS",
",",
"UI_SETTINGS",
".",
"QUERY_STRING_OPTIONS",
",",
"UI_SETTINGS",
".",
"COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX",
",",
"]",
";",
"internal",
"export",
"interface",
"AggsCommonSetupDependencies",
"{",
"registerFunction",
":",
"ExpressionsServiceSetup",
"[",
"'registerFunction'",
"]",
";",
"}",
"internal",
"export",
"interface",
"AggsCommonStartDependencies",
"{",
"getConfig",
":",
"GetConfigFn",
";",
"}",
"/**\n * The aggs service provides a means of modeling and manipulating the various\n * OpenSearch aggregations supported by OpenSearch Dashboards, providing the ability to\n * output the correct DSL when you are ready to send your request to OpenSearch.\n */",
"export",
"class",
"AggsCommonService",
"{",
"private",
"readonly",
"aggTypesRegistry",
"=",
"new",
"AggTypesRegistry",
"(",
")",
";",
"public",
"setup",
"(",
"{",
"registerFunction",
"}",
")",
"{",
"const",
"aggTypesSetup",
"=",
"this",
".",
"aggTypesRegistry",
".",
"setup",
"(",
")",
";",
"const",
"aggTypes",
"=",
"getAggTypes",
"(",
")",
";",
"aggTypes",
".",
"buckets",
".",
"forEach",
"(",
"(",
"{",
"name",
",",
"fn",
"}",
")",
"=>",
"aggTypesSetup",
".",
"registerBucket",
"(",
"name",
",",
"fn",
")",
")",
";",
"aggTypes",
".",
"metrics",
".",
"forEach",
"(",
"(",
"{",
"name",
",",
"fn",
"}",
")",
"=>",
"aggTypesSetup",
".",
"registerMetric",
"(",
"name",
",",
"fn",
")",
")",
";",
"const",
"aggFunctions",
"=",
"getAggTypesFunctions",
"(",
")",
";",
"aggFunctions",
".",
"forEach",
"(",
"(",
"fn",
")",
"=>",
"registerFunction",
"(",
"fn",
")",
")",
";",
"return",
"{",
"types",
":",
"aggTypesSetup",
",",
"}",
";",
"}",
"public",
"start",
"(",
"{",
"getConfig",
"}",
")",
"{",
"const",
"aggTypesStart",
"=",
"this",
".",
"aggTypesRegistry",
".",
"start",
"(",
")",
";",
"return",
"{",
"calculateAutoTimeExpression",
":",
"getCalculateAutoTimeExpression",
"(",
"getConfig",
")",
",",
"createAggConfigs",
":",
"(",
"indexPattern",
",",
"configStates",
"=",
"[",
"]",
",",
"schemas",
")",
"=>",
"{",
"return",
"new",
"AggConfigs",
"(",
"indexPattern",
",",
"configStates",
",",
"{",
"typesRegistry",
":",
"aggTypesStart",
",",
"}",
")",
";",
"}",
",",
"types",
":",
"aggTypesStart",
",",
"}",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
18002,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661203 | [
"import",
"{",
"IIndexPattern",
"}",
"from",
"'../../index_patterns'",
";",
"import",
"{",
"OpenSearchQuerySortValue",
",",
"SortOptions",
"}",
"from",
"'./types'",
";",
"export",
"function",
"normalizeSortRequest",
"(",
"sortObject",
",",
"indexPattern",
",",
"defaultSortOptions",
"=",
"{",
"}",
")",
"{",
"const",
"sortArray",
"=",
"Array",
".",
"isArray",
"(",
"sortObject",
")",
"?",
"sortObject",
":",
"[",
"sortObject",
"]",
";",
"return",
"sortArray",
".",
"map",
"(",
"function",
"(",
"sortable",
")",
"{",
"return",
"normalize",
"(",
"sortable",
",",
"indexPattern",
",",
"defaultSortOptions",
")",
";",
"}",
")",
";",
"}",
"/**\n * Normalize the sort description to the more verbose format (e.g. { someField: \"desc\" } into\n * { someField: { \"order\": \"desc\"}}), and convert sorts on scripted fields into the proper script\n * for OpenSearch. Mix in the default options according to the advanced settings.\n */",
"function",
"normalize",
"(",
"sortable",
",",
"indexPattern",
",",
"defaultSortOptions",
")",
"{",
"const",
"[",
"[",
"sortField",
",",
"sortOrder",
"]",
"]",
"=",
"Object",
".",
"entries",
"(",
"sortable",
")",
";",
"const",
"order",
"=",
"typeof",
"sortOrder",
"===",
"'object'",
"?",
"sortOrder",
":",
"{",
"order",
":",
"sortOrder",
"}",
";",
"if",
"(",
"indexPattern",
"&&",
"typeof",
"indexPattern",
"!==",
"'string'",
")",
"{",
"const",
"indexField",
"=",
"indexPattern",
".",
"fields",
".",
"find",
"(",
"(",
"{",
"name",
"}",
")",
"=>",
"name",
"===",
"sortField",
")",
";",
"if",
"(",
"indexField",
"&&",
"indexField",
".",
"scripted",
"&&",
"indexField",
".",
"sortable",
")",
"{",
"return",
"{",
"_script",
":",
"{",
"script",
":",
"{",
"source",
":",
"indexField",
".",
"script",
",",
"lang",
":",
"indexField",
".",
"lang",
",",
"}",
",",
"type",
":",
"castSortType",
"(",
"indexField",
".",
"type",
")",
",",
"...",
"order",
",",
"}",
",",
"}",
";",
"}",
"}",
"const",
"{",
"unmapped_type",
",",
"...",
"otherSortOptions",
"}",
"=",
"defaultSortOptions",
";",
"return",
"{",
"[",
"sortField",
"]",
":",
"{",
"...",
"order",
",",
"...",
"(",
"sortField",
"===",
"'_score'",
"?",
"otherSortOptions",
":",
"defaultSortOptions",
")",
"}",
",",
"}",
";",
"}",
"function",
"castSortType",
"(",
"type",
")",
"{",
"if",
"(",
"[",
"'number'",
"]",
".",
"includes",
"(",
"type",
")",
")",
"{",
"return",
"'number'",
";",
"}",
"else",
"if",
"(",
"[",
"'string'",
",",
"'boolean'",
"]",
".",
"includes",
"(",
"type",
")",
")",
"{",
"return",
"'string'",
";",
"}",
"throw",
"new",
"Error",
"(",
"`Unsupported script sort type: ${",
"type",
"}`",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
7378,
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,
13940,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
13940,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
28013,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
680,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661204 | [
"interface",
"DocvalueField",
"{",
"field",
":",
"string",
";",
"[",
"key",
"]",
":",
"unknown",
";",
"}",
"export",
"function",
"filterDocvalueFields",
"(",
"docvalueFields",
",",
"fields",
")",
"{",
"return",
"docvalueFields",
".",
"filter",
"(",
"(",
"docValue",
")",
"=>",
"{",
"const",
"docvalueFieldName",
"=",
"typeof",
"docValue",
"===",
"'string'",
"?",
"docValue",
":",
"docValue",
".",
"field",
";",
"return",
"fields",
".",
"includes",
"(",
"docvalueFieldName",
")",
";",
"}",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
13,
null,
5,
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
] |
661205 | [
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../constants'",
";",
"import",
"{",
"GetConfigFn",
"}",
"from",
"'../../../types'",
";",
"import",
"{",
"ISearchRequestParams",
"}",
"from",
"'../../index'",
";",
"import",
"{",
"SearchRequest",
"}",
"from",
"'./types'",
";",
"const",
"sessionId",
"=",
"Date",
".",
"now",
"(",
")",
";",
"export",
"function",
"getSearchParams",
"(",
"getConfig",
")",
"{",
"return",
"{",
"preference",
":",
"getPreference",
"(",
"getConfig",
")",
",",
"}",
";",
"}",
"export",
"function",
"getPreference",
"(",
"getConfig",
")",
"{",
"const",
"setRequestPreference",
"=",
"getConfig",
"(",
"UI_SETTINGS",
".",
"COURIER_SET_REQUEST_PREFERENCE",
")",
";",
"if",
"(",
"setRequestPreference",
"===",
"'sessionId'",
")",
"return",
"sessionId",
";",
"return",
"setRequestPreference",
"===",
"'custom'",
"?",
"getConfig",
"(",
"UI_SETTINGS",
".",
"COURIER_CUSTOM_REQUEST_PREFERENCE",
")",
":",
"undefined",
";",
"}",
"public",
"export",
"function",
"getSearchParamsFromRequest",
"(",
"searchRequest",
",",
"dependencies",
")",
"{",
"const",
"{",
"getConfig",
"}",
"=",
"dependencies",
";",
"const",
"searchParams",
"=",
"getSearchParams",
"(",
"getConfig",
")",
";",
"return",
"{",
"index",
":",
"searchRequest",
".",
"index",
".",
"title",
"||",
"searchRequest",
".",
"index",
",",
"body",
":",
"searchRequest",
".",
"body",
",",
"...",
"searchParams",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
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,
6,
null,
13400,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13400,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26116,
null,
1441,
null,
6,
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
] |
661206 | [
"import",
"{",
"SearchResponse",
"}",
"from",
"'elasticsearch'",
";",
"import",
"{",
"OsdError",
"}",
"from",
"'../../../../../opensearch_dashboards_utils/common'",
";",
"import",
"{",
"SearchError",
"}",
"from",
"'./types'",
";",
"param",
"{",
"Error",
"}",
"err",
"param",
"{",
"Object",
"}",
"resp",
"export",
"class",
"RequestFailure",
"extends",
"OsdError",
"{",
"public",
"resp",
"?",
":",
"SearchResponse",
"<",
"any",
">",
";",
"constructor",
"(",
"err",
"=",
"null",
",",
"resp",
"?",
")",
"{",
"super",
"(",
"`Request to OpenSearch failed: ${",
"JSON",
".",
"stringify",
"(",
"resp",
"||",
"err",
"?.",
"message",
")",
"}`",
")",
";",
"this",
".",
"resp",
"=",
"resp",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
18848,
null,
null,
null,
3681,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661207 | [
"import",
"{",
"getPreference",
"}",
"from",
"'../fetch'",
";",
"import",
"{",
"SearchStrategyProvider",
",",
"SearchStrategySearchParams",
"}",
"from",
"'./types'",
";",
"export",
"const",
"defaultSearchStrategy",
"=",
"{",
"id",
":",
"'default'",
",",
"search",
":",
"(",
"params",
")",
"=>",
"{",
"return",
"msearch",
"(",
"params",
")",
";",
"}",
",",
"}",
";",
"function",
"msearch",
"(",
"{",
"searchRequests",
",",
"getConfig",
",",
"legacy",
"}",
")",
"{",
"const",
"{",
"callMsearch",
",",
"loadingCount$",
"}",
"=",
"legacy",
";",
"const",
"requests",
"=",
"searchRequests",
".",
"map",
"(",
"(",
"{",
"index",
",",
"body",
"}",
")",
"=>",
"{",
"return",
"{",
"header",
":",
"{",
"index",
":",
"index",
".",
"title",
"||",
"index",
",",
"preference",
":",
"getPreference",
"(",
"getConfig",
")",
",",
"}",
",",
"body",
",",
"}",
";",
"}",
")",
";",
"const",
"abortController",
"=",
"new",
"AbortController",
"(",
")",
";",
"let",
"resolved",
"=",
"false",
";",
"loadingCount$",
".",
"next",
"(",
"loadingCount$",
".",
"getValue",
"(",
")",
"+",
"1",
")",
";",
"const",
"cleanup",
"=",
"(",
")",
"=>",
"{",
"if",
"(",
"!",
"resolved",
")",
"{",
"resolved",
"=",
"true",
";",
"loadingCount$",
".",
"next",
"(",
"loadingCount$",
".",
"getValue",
"(",
")",
"-",
"1",
")",
";",
"loadingCount$",
".",
"complete",
"(",
")",
";",
"}",
"}",
";",
"const",
"searching",
"=",
"callMsearch",
"(",
"{",
"body",
":",
"{",
"searches",
":",
"requests",
"}",
",",
"signal",
":",
"abortController",
".",
"signal",
",",
"}",
")",
".",
"then",
"(",
"(",
"res",
")",
"=>",
"res",
"?.",
"body",
"?.",
"responses",
")",
".",
"finally",
"(",
"(",
")",
"=>",
"cleanup",
"(",
")",
")",
";",
"return",
"{",
"abort",
":",
"(",
")",
"=>",
"{",
"abortController",
".",
"abort",
"(",
")",
";",
"cleanup",
"(",
")",
";",
"}",
",",
"searching",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26117,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13401,
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
] |
661208 | [
"import",
"{",
"SearchResponse",
"}",
"from",
"'elasticsearch'",
";",
"import",
"{",
"FetchHandlers",
",",
"SearchRequest",
"}",
"from",
"'../fetch'",
";",
"import",
"{",
"defaultSearchStrategy",
"}",
"from",
"'./default_search_strategy'",
";",
"import",
"{",
"ISearchOptions",
"}",
"from",
"'../../index'",
";",
"export",
"function",
"callClient",
"(",
"searchRequests",
",",
"requestsOptions",
"=",
"[",
"]",
",",
"fetchHandlers",
")",
"{",
"const",
"requestOptionEntries",
"=",
"searchRequests",
".",
"map",
"(",
"(",
"request",
",",
"i",
")",
"=>",
"[",
"request",
",",
"requestsOptions",
"[",
"i",
"]",
"]",
")",
";",
"const",
"requestOptionsMap",
"=",
"new",
"Map",
"<",
"SearchRequest",
",",
"ISearchOptions",
">",
"(",
"requestOptionEntries",
")",
";",
"const",
"requestResponseMap",
"=",
"new",
"Map",
"<",
"SearchRequest",
",",
"Promise",
"<",
"SearchResponse",
"<",
"any",
">",
">",
">",
"(",
")",
";",
"const",
"{",
"searching",
",",
"abort",
"}",
"=",
"defaultSearchStrategy",
".",
"search",
"(",
"{",
"searchRequests",
",",
"...",
"fetchHandlers",
",",
"}",
")",
";",
"searchRequests",
".",
"forEach",
"(",
"(",
"request",
",",
"i",
")",
"=>",
"{",
"const",
"response",
"=",
"searching",
".",
"then",
"(",
"(",
"results",
")",
"=>",
"fetchHandlers",
".",
"onResponse",
"(",
"request",
",",
"results",
"[",
"i",
"]",
")",
")",
";",
"const",
"{",
"abortSignal",
"=",
"null",
"}",
"=",
"requestOptionsMap",
".",
"get",
"(",
"request",
")",
"||",
"{",
"}",
";",
"if",
"(",
"abortSignal",
")",
"abortSignal",
".",
"addEventListener",
"(",
"'abort'",
",",
"abort",
")",
";",
"requestResponseMap",
".",
"set",
"(",
"request",
",",
"response",
")",
";",
"}",
")",
";",
"return",
"searchRequests",
".",
"map",
"(",
"(",
"request",
")",
"=>",
"requestResponseMap",
".",
"get",
"(",
"request",
")",
"!",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
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,
5,
null,
null,
null,
null,
8959,
null,
null,
null,
13,
null,
null,
null,
null,
null,
null,
1441,
null,
3,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
19,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
19,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1441,
null,
3,
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,
null,
null,
null,
null,
null,
1441,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661209 | [
"import",
"{",
"SearchResponse",
"}",
"from",
"'elasticsearch'",
";",
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../constants'",
";",
"import",
"{",
"FetchHandlers",
",",
"SearchRequest",
"}",
"from",
"'../fetch'",
";",
"import",
"{",
"ISearchOptions",
"}",
"from",
"'../../index'",
";",
"import",
"{",
"callClient",
"}",
"from",
"'./call_client'",
";",
"/**\n * This function introduces a slight delay in the request process to allow multiple requests to queue\n * up (e.g. when a dashboard is loading).\n */",
"export",
"async",
"function",
"fetchSoon",
"(",
"request",
",",
"options",
",",
"fetchHandlers",
")",
"{",
"const",
"msToDelay",
"=",
"fetchHandlers",
".",
"getConfig",
"(",
"UI_SETTINGS",
".",
"COURIER_BATCH_SEARCHES",
")",
"?",
"50",
":",
"0",
";",
"return",
"delayedFetch",
"(",
"request",
",",
"options",
",",
"fetchHandlers",
",",
"msToDelay",
")",
";",
"}",
"param",
"fn",
"param",
"ms",
"return",
"function",
"delay",
"<",
"T",
">",
"(",
"fn",
",",
"ms",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
")",
"=>",
"{",
"setTimeout",
"(",
"(",
")",
"=>",
"resolve",
"(",
"fn",
"(",
")",
")",
",",
"ms",
")",
";",
"}",
")",
";",
"}",
"let",
"requestsToFetch",
"=",
"[",
"]",
";",
"let",
"requestOptions",
"=",
"[",
"]",
";",
"let",
"fetchInProgress",
"=",
"null",
";",
"param",
"request",
"param",
"ms",
"return",
"async",
"function",
"delayedFetch",
"(",
"request",
",",
"options",
",",
"fetchHandlers",
",",
"ms",
")",
"{",
"if",
"(",
"ms",
"===",
"0",
")",
"{",
"return",
"callClient",
"(",
"[",
"request",
"]",
",",
"[",
"options",
"]",
",",
"fetchHandlers",
")",
"[",
"0",
"]",
";",
"}",
"const",
"i",
"=",
"requestsToFetch",
".",
"length",
";",
"requestsToFetch",
"=",
"[",
"...",
"requestsToFetch",
",",
"request",
"]",
";",
"requestOptions",
"=",
"[",
"...",
"requestOptions",
",",
"options",
"]",
";",
"const",
"responses",
"=",
"await",
"(",
"fetchInProgress",
"=",
"fetchInProgress",
"||",
"delay",
"(",
"(",
")",
"=>",
"{",
"const",
"response",
"=",
"callClient",
"(",
"requestsToFetch",
",",
"requestOptions",
",",
"fetchHandlers",
")",
";",
"requestsToFetch",
"=",
"[",
"]",
";",
"requestOptions",
"=",
"[",
"]",
";",
"fetchInProgress",
"=",
"null",
";",
"return",
"response",
";",
"}",
",",
"ms",
")",
")",
";",
"return",
"responses",
"[",
"i",
"]",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
1441,
null,
1488,
null,
8959,
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,
7,
null,
null,
null,
null,
11,
null,
3,
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,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
1441,
null,
1488,
null,
8959,
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,
5,
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
] |
661210 | [
"import",
"{",
"SavedObjectReference",
"}",
"from",
"'src/core/types'",
";",
"import",
"{",
"Filter",
"}",
"from",
"'../../opensearch_query/filters'",
";",
"import",
"{",
"SearchSourceFields",
"}",
"from",
"'./types'",
";",
"export",
"const",
"extractReferences",
"=",
"(",
"state",
")",
":",
"[",
"SearchSourceFields",
"&",
"{",
"indexRefName",
"?",
":",
"string",
";",
"}",
",",
"SavedObjectReference",
"[",
"]",
"]",
"=>",
"{",
"let",
"searchSourceFields",
"=",
"{",
"...",
"state",
"}",
";",
"const",
"references",
"=",
"[",
"]",
";",
"if",
"(",
"searchSourceFields",
".",
"index",
")",
"{",
"const",
"indexId",
"=",
"searchSourceFields",
".",
"index",
".",
"id",
"||",
"(",
"(",
"searchSourceFields",
".",
"index",
"as",
"any",
")",
"as",
"string",
")",
";",
"const",
"refName",
"=",
"'kibanaSavedObjectMeta.searchSourceJSON.index'",
";",
"references",
".",
"push",
"(",
"{",
"name",
":",
"refName",
",",
"type",
":",
"'index-pattern'",
",",
"id",
":",
"indexId",
",",
"}",
")",
";",
"searchSourceFields",
"=",
"{",
"...",
"searchSourceFields",
",",
"indexRefName",
":",
"refName",
",",
"index",
":",
"undefined",
",",
"}",
";",
"}",
"if",
"(",
"searchSourceFields",
".",
"filter",
")",
"{",
"searchSourceFields",
"=",
"{",
"...",
"searchSourceFields",
",",
"filter",
":",
"(",
"searchSourceFields",
".",
"filter",
"as",
"Filter",
"[",
"]",
")",
".",
"map",
"(",
"(",
"filterRow",
",",
"i",
")",
"=>",
"{",
"if",
"(",
"!",
"filterRow",
".",
"meta",
"||",
"!",
"filterRow",
".",
"meta",
".",
"index",
")",
"{",
"return",
"filterRow",
";",
"}",
"const",
"refName",
"=",
"`kibanaSavedObjectMeta.searchSourceJSON.filter[${",
"i",
"}].meta.index`",
";",
"references",
".",
"push",
"(",
"{",
"name",
":",
"refName",
",",
"type",
":",
"'index-pattern'",
",",
"id",
":",
"filterRow",
".",
"meta",
".",
"index",
",",
"}",
")",
";",
"return",
"{",
"...",
"filterRow",
",",
"meta",
":",
"{",
"...",
"filterRow",
".",
"meta",
",",
"indexRefName",
":",
"refName",
",",
"index",
":",
"undefined",
",",
"}",
",",
"}",
";",
"}",
")",
",",
"}",
";",
"}",
"return",
"[",
"searchSourceFields",
",",
"references",
"]",
";",
"}",
";"
] | [
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,
2672,
null,
null,
null,
null,
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,
2,
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,
158,
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,
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
] |
661211 | [
"name",
"description",
"import",
"{",
"setWith",
"}",
"from",
"'@elastic/safer-lodash-set'",
";",
"import",
"{",
"uniqueId",
",",
"uniq",
",",
"extend",
",",
"pick",
",",
"difference",
",",
"omit",
",",
"isObject",
",",
"keys",
",",
"isFunction",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"normalizeSortRequest",
"}",
"from",
"'./normalize_sort_request'",
";",
"import",
"{",
"filterDocvalueFields",
"}",
"from",
"'./filter_docvalue_fields'",
";",
"import",
"{",
"fieldWildcardFilter",
"}",
"from",
"'../../../../opensearch_dashboards_utils/common'",
";",
"import",
"{",
"IIndexPattern",
"}",
"from",
"'../../index_patterns'",
";",
"import",
"{",
"IOpenSearchSearchRequest",
",",
"IOpenSearchSearchResponse",
",",
"ISearchOptions",
"}",
"from",
"'../..'",
";",
"import",
"{",
"IOpenSearchDashboardsSearchRequest",
",",
"IOpenSearchDashboardsSearchResponse",
"}",
"from",
"'../types'",
";",
"import",
"{",
"ISearchSource",
",",
"SearchSourceOptions",
",",
"SearchSourceFields",
"}",
"from",
"'./types'",
";",
"import",
"{",
"FetchHandlers",
",",
"RequestFailure",
",",
"getSearchParamsFromRequest",
",",
"SearchRequest",
"}",
"from",
"'./fetch'",
";",
"import",
"{",
"getOpenSearchQueryConfig",
",",
"buildOpenSearchQuery",
",",
"Filter",
",",
"UI_SETTINGS",
",",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"getHighlightRequest",
"}",
"from",
"'../../../common/field_formats'",
";",
"import",
"{",
"fetchSoon",
"}",
"from",
"'./legacy'",
";",
"import",
"{",
"extractReferences",
"}",
"from",
"'./extract_references'",
";",
"internal",
"export",
"const",
"searchSourceRequiredUiSettings",
"=",
"[",
"'dateFormat:tz'",
",",
"UI_SETTINGS",
".",
"COURIER_BATCH_SEARCHES",
",",
"UI_SETTINGS",
".",
"COURIER_CUSTOM_REQUEST_PREFERENCE",
",",
"UI_SETTINGS",
".",
"COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX",
",",
"UI_SETTINGS",
".",
"COURIER_MAX_CONCURRENT_SHARD_REQUESTS",
",",
"UI_SETTINGS",
".",
"COURIER_SET_REQUEST_PREFERENCE",
",",
"UI_SETTINGS",
".",
"DOC_HIGHLIGHT",
",",
"UI_SETTINGS",
".",
"META_FIELDS",
",",
"UI_SETTINGS",
".",
"QUERY_ALLOW_LEADING_WILDCARDS",
",",
"UI_SETTINGS",
".",
"QUERY_STRING_OPTIONS",
",",
"UI_SETTINGS",
".",
"SEARCH_INCLUDE_FROZEN",
",",
"UI_SETTINGS",
".",
"SORT_OPTIONS",
",",
"]",
";",
"export",
"interface",
"SearchSourceDependencies",
"extends",
"FetchHandlers",
"{",
"search",
":",
"<",
"SearchStrategyRequest",
"extends",
"IOpenSearchDashboardsSearchRequest",
"=",
"IOpenSearchSearchRequest",
",",
"SearchStrategyResponse",
"extends",
"IOpenSearchDashboardsSearchResponse",
"=",
"IOpenSearchSearchResponse",
">",
"(",
"request",
":",
"SearchStrategyRequest",
",",
"options",
":",
"ISearchOptions",
")",
"=>",
"Promise",
"<",
"SearchStrategyResponse",
">",
";",
"}",
"public",
"export",
"class",
"SearchSource",
"{",
"private",
"id",
":",
"string",
"=",
"uniqueId",
"(",
"'data_source'",
")",
";",
"private",
"searchStrategyId",
"?",
":",
"string",
";",
"private",
"parent",
"?",
":",
"SearchSource",
";",
"private",
"requestStartHandlers",
":",
"Array",
"<",
"(",
"searchSource",
":",
"SearchSource",
",",
"options",
"?",
":",
"ISearchOptions",
")",
"=>",
"Promise",
"<",
"unknown",
">",
">",
"=",
"[",
"]",
";",
"private",
"inheritOptions",
":",
"SearchSourceOptions",
"=",
"{",
"}",
";",
"public",
"history",
":",
"SearchRequest",
"[",
"]",
"=",
"[",
"]",
";",
"private",
"fields",
":",
"SearchSourceFields",
";",
"private",
"readonly",
"dependencies",
":",
"SearchSourceDependencies",
";",
"constructor",
"(",
"fields",
"=",
"{",
"}",
",",
"dependencies",
")",
"{",
"this",
".",
"fields",
"=",
"fields",
";",
"this",
".",
"dependencies",
"=",
"dependencies",
";",
"}",
"/** ***\n * PUBLIC API\n *****/",
"param",
"searchStrategyId",
"setPreferredSearchStrategyId",
"(",
"searchStrategyId",
")",
"{",
"this",
".",
"searchStrategyId",
"=",
"searchStrategyId",
";",
"}",
"param",
"field",
"param",
"value",
"setField",
"<",
"K",
"extends",
"keyof",
"SearchSourceFields",
">",
"(",
"field",
",",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"delete",
"this",
".",
"fields",
"[",
"field",
"]",
";",
"}",
"else",
"{",
"this",
".",
"fields",
"[",
"field",
"]",
"=",
"value",
";",
"}",
"return",
"this",
";",
"}",
"private",
"param",
"newFields",
"setFields",
"(",
"newFields",
")",
"{",
"this",
".",
"fields",
"=",
"newFields",
";",
"return",
"this",
";",
"}",
"/**\n * returns search source id\n */",
"getId",
"(",
")",
"{",
"return",
"this",
".",
"id",
";",
"}",
"/**\n * returns all search source fields\n */",
"getFields",
"(",
")",
"{",
"return",
"{",
"...",
"this",
".",
"fields",
"}",
";",
"}",
"/**\n * Gets a single field from the fields\n */",
"getField",
"<",
"K",
"extends",
"keyof",
"SearchSourceFields",
">",
"(",
"field",
",",
"recurse",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"recurse",
"||",
"this",
".",
"fields",
"[",
"field",
"]",
"!==",
"void",
"0",
")",
"{",
"return",
"this",
".",
"fields",
"[",
"field",
"]",
";",
"}",
"const",
"parent",
"=",
"this",
".",
"getParent",
"(",
")",
";",
"return",
"parent",
"&&",
"parent",
".",
"getField",
"(",
"field",
")",
";",
"}",
"/**\n * Get the field from our own fields, don't traverse up the chain\n */",
"getOwnField",
"<",
"K",
"extends",
"keyof",
"SearchSourceFields",
">",
"(",
"field",
")",
"{",
"return",
"this",
".",
"getField",
"(",
"field",
",",
"false",
")",
";",
"}",
"deprecated",
"create",
"(",
")",
"{",
"return",
"new",
"SearchSource",
"(",
"{",
"}",
",",
"this",
".",
"dependencies",
")",
";",
"}",
"/**\n * creates a copy of this search source (without its children)\n */",
"createCopy",
"(",
")",
"{",
"const",
"newSearchSource",
"=",
"new",
"SearchSource",
"(",
"{",
"}",
",",
"this",
".",
"dependencies",
")",
";",
"newSearchSource",
".",
"setFields",
"(",
"{",
"...",
"this",
".",
"fields",
"}",
")",
";",
"newSearchSource",
".",
"setField",
"(",
"'index'",
",",
"this",
".",
"getField",
"(",
"'index'",
")",
")",
";",
"newSearchSource",
".",
"setParent",
"(",
"this",
".",
"getParent",
"(",
")",
")",
";",
"return",
"newSearchSource",
";",
"}",
"param",
"options",
"createChild",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"childSearchSource",
"=",
"new",
"SearchSource",
"(",
"{",
"}",
",",
"this",
".",
"dependencies",
")",
";",
"childSearchSource",
".",
"setParent",
"(",
"this",
",",
"options",
")",
";",
"return",
"childSearchSource",
";",
"}",
"param",
"{",
"SearchSource",
"}",
"parent",
"param",
"{",
"SearchSourceOptions",
"}",
"options",
"return",
"{",
"this",
"}",
"setParent",
"(",
"parent",
"?",
",",
"options",
"=",
"{",
"}",
")",
"{",
"this",
".",
"parent",
"=",
"parent",
"as",
"SearchSource",
";",
"this",
".",
"inheritOptions",
"=",
"options",
";",
"return",
"this",
";",
"}",
"return",
"{",
"undefined",
"|",
"searchSource",
"}",
"getParent",
"(",
")",
"{",
"return",
"this",
".",
"parent",
";",
"}",
"async",
"async",
"fetch",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"getConfig",
"}",
"=",
"this",
".",
"dependencies",
";",
"await",
"this",
".",
"requestIsStarting",
"(",
"options",
")",
";",
"const",
"searchRequest",
"=",
"await",
"this",
".",
"flatten",
"(",
")",
";",
"this",
".",
"history",
"=",
"[",
"searchRequest",
"]",
";",
"let",
"response",
";",
"if",
"(",
"getConfig",
"(",
"UI_SETTINGS",
".",
"COURIER_BATCH_SEARCHES",
")",
")",
"{",
"response",
"=",
"await",
"this",
".",
"legacyFetch",
"(",
"searchRequest",
",",
"options",
")",
";",
"}",
"else",
"{",
"response",
"=",
"await",
"this",
".",
"fetchSearch",
"(",
"searchRequest",
",",
"options",
")",
";",
"}",
"if",
"(",
"(",
"response",
"as",
"any",
")",
".",
"error",
")",
"{",
"throw",
"new",
"RequestFailure",
"(",
"null",
",",
"response",
")",
";",
"}",
"return",
"response",
";",
"}",
"param",
"{",
"Function",
"}",
"handler",
"return",
"{",
"undefined",
"}",
"onRequestStart",
"(",
"handler",
")",
"{",
"this",
".",
"requestStartHandlers",
".",
"push",
"(",
"handler",
")",
";",
"}",
"/**\n * Returns body contents of the search request, often referred as query DSL.\n */",
"async",
"getSearchRequestBody",
"(",
")",
"{",
"const",
"searchRequest",
"=",
"await",
"this",
".",
"flatten",
"(",
")",
";",
"return",
"searchRequest",
".",
"body",
";",
"}",
"return",
"{",
"undefined",
"}",
"destroy",
"(",
")",
"{",
"this",
".",
"requestStartHandlers",
".",
"length",
"=",
"0",
";",
"}",
"/** ****\n * PRIVATE APIS\n ******/",
"return",
"{",
"Promise",
"<",
"SearchResponse",
"<",
"unknown",
">",
">",
"}",
"private",
"fetchSearch",
"(",
"searchRequest",
",",
"options",
")",
"{",
"const",
"{",
"search",
",",
"getConfig",
",",
"onResponse",
"}",
"=",
"this",
".",
"dependencies",
";",
"const",
"params",
"=",
"getSearchParamsFromRequest",
"(",
"searchRequest",
",",
"{",
"getConfig",
",",
"}",
")",
";",
"return",
"search",
"(",
"{",
"params",
",",
"indexType",
":",
"searchRequest",
".",
"indexType",
"}",
",",
"options",
")",
".",
"then",
"(",
"(",
"{",
"rawResponse",
"}",
")",
"=>",
"onResponse",
"(",
"searchRequest",
",",
"rawResponse",
")",
")",
";",
"}",
"return",
"{",
"Promise",
"<",
"SearchResponse",
"<",
"unknown",
">",
">",
"}",
"private",
"async",
"legacyFetch",
"(",
"searchRequest",
",",
"options",
")",
"{",
"const",
"{",
"getConfig",
",",
"legacy",
",",
"onResponse",
"}",
"=",
"this",
".",
"dependencies",
";",
"return",
"await",
"fetchSoon",
"(",
"searchRequest",
",",
"{",
"...",
"(",
"this",
".",
"searchStrategyId",
"&&",
"{",
"searchStrategyId",
":",
"this",
".",
"searchStrategyId",
"}",
")",
",",
"...",
"options",
",",
"}",
",",
"{",
"getConfig",
",",
"onResponse",
",",
"legacy",
",",
"}",
")",
";",
"}",
"param",
"options",
"return",
"{",
"Promise",
"<",
"undefined",
">",
"}",
"private",
"requestIsStarting",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"handlers",
"=",
"[",
"...",
"this",
".",
"requestStartHandlers",
"]",
";",
"if",
"(",
"this",
".",
"inheritOptions",
".",
"callParentStartHandlers",
")",
"{",
"let",
"searchSource",
"=",
"this",
".",
"getParent",
"(",
")",
";",
"while",
"(",
"searchSource",
")",
"{",
"handlers",
".",
"push",
"(",
"...",
"searchSource",
".",
"requestStartHandlers",
")",
";",
"searchSource",
"=",
"searchSource",
".",
"getParent",
"(",
")",
";",
"}",
"}",
"return",
"Promise",
".",
"all",
"(",
"handlers",
".",
"map",
"(",
"(",
"fn",
")",
"=>",
"fn",
"(",
"this",
",",
"options",
")",
")",
")",
";",
"}",
"param",
"{",
"object",
"}",
"data",
"param",
"{",
"*",
"}",
"val",
"param",
"{",
"*",
"}",
"key",
"return",
"{",
"undefined",
"}",
"private",
"mergeProp",
"<",
"K",
"extends",
"keyof",
"SearchSourceFields",
">",
"(",
"data",
",",
"val",
",",
"key",
")",
"{",
"val",
"=",
"typeof",
"val",
"===",
"'function'",
"?",
"val",
"(",
"this",
")",
":",
"val",
";",
"if",
"(",
"val",
"==",
"null",
"||",
"!",
"key",
")",
"return",
";",
"const",
"addToRoot",
"=",
"(",
"rootKey",
",",
"value",
")",
"=>",
"{",
"data",
"[",
"rootKey",
"]",
"=",
"value",
";",
"}",
";",
"/**\n * Add the key and val to the body of the request\n */",
"const",
"addToBody",
"=",
"(",
"bodyKey",
",",
"value",
")",
"=>",
"{",
"if",
"(",
"data",
".",
"body",
"[",
"bodyKey",
"]",
"==",
"null",
")",
"{",
"data",
".",
"body",
"[",
"bodyKey",
"]",
"=",
"value",
";",
"}",
"}",
";",
"const",
"{",
"getConfig",
"}",
"=",
"this",
".",
"dependencies",
";",
"switch",
"(",
"key",
")",
"{",
"case",
"'filter'",
":",
"return",
"addToRoot",
"(",
"'filters'",
",",
"(",
"data",
".",
"filters",
"||",
"[",
"]",
")",
".",
"concat",
"(",
"val",
")",
")",
";",
"case",
"'query'",
":",
"return",
"addToRoot",
"(",
"key",
",",
"(",
"data",
"[",
"key",
"]",
"||",
"[",
"]",
")",
".",
"concat",
"(",
"val",
")",
")",
";",
"case",
"'fields'",
":",
"const",
"fields",
"=",
"uniq",
"(",
"(",
"data",
"[",
"key",
"]",
"||",
"[",
"]",
")",
".",
"concat",
"(",
"val",
")",
")",
";",
"return",
"addToRoot",
"(",
"key",
",",
"fields",
")",
";",
"case",
"'index'",
":",
"case",
"'type'",
":",
"case",
"'highlightAll'",
":",
"return",
"key",
"&&",
"data",
"[",
"key",
"]",
"==",
"null",
"&&",
"addToRoot",
"(",
"key",
",",
"val",
")",
";",
"case",
"'searchAfter'",
":",
"return",
"addToBody",
"(",
"'search_after'",
",",
"val",
")",
";",
"case",
"'source'",
":",
"return",
"addToBody",
"(",
"'_source'",
",",
"val",
")",
";",
"case",
"'sort'",
":",
"const",
"sort",
"=",
"normalizeSortRequest",
"(",
"val",
",",
"this",
".",
"getField",
"(",
"'index'",
")",
",",
"getConfig",
"(",
"UI_SETTINGS",
".",
"SORT_OPTIONS",
")",
")",
";",
"return",
"addToBody",
"(",
"key",
",",
"sort",
")",
";",
"default",
":",
"return",
"addToBody",
"(",
"key",
",",
"val",
")",
";",
"}",
"}",
"returns",
"{",
"Promise",
"}",
"resolved",
"private",
"mergeProps",
"(",
"root",
"=",
"this",
",",
"searchRequest",
"=",
"{",
"body",
":",
"{",
"}",
"}",
")",
"{",
"Object",
".",
"entries",
"(",
"this",
".",
"fields",
")",
".",
"forEach",
"(",
"(",
"[",
"key",
",",
"value",
"]",
")",
"=>",
"{",
"this",
".",
"mergeProp",
"(",
"searchRequest",
",",
"value",
",",
"key",
"as",
"keyof",
"SearchSourceFields",
")",
";",
"}",
")",
";",
"if",
"(",
"this",
".",
"parent",
")",
"{",
"this",
".",
"parent",
".",
"mergeProps",
"(",
"root",
",",
"searchRequest",
")",
";",
"}",
"return",
"searchRequest",
";",
"}",
"private",
"getIndexType",
"(",
"index",
"?",
")",
"{",
"if",
"(",
"this",
".",
"searchStrategyId",
")",
"{",
"return",
"this",
".",
"searchStrategyId",
"===",
"'default'",
"?",
"undefined",
":",
"this",
".",
"searchStrategyId",
";",
"}",
"else",
"{",
"return",
"index",
"?.",
"type",
";",
"}",
"}",
"private",
"flatten",
"(",
")",
"{",
"const",
"searchRequest",
"=",
"this",
".",
"mergeProps",
"(",
")",
";",
"searchRequest",
".",
"body",
"=",
"searchRequest",
".",
"body",
"||",
"{",
"}",
";",
"const",
"{",
"body",
",",
"index",
",",
"fields",
",",
"query",
",",
"filters",
",",
"highlightAll",
"}",
"=",
"searchRequest",
";",
"searchRequest",
".",
"indexType",
"=",
"this",
".",
"getIndexType",
"(",
"index",
")",
";",
"const",
"computedFields",
"=",
"index",
"?",
"index",
".",
"getComputedFields",
"(",
")",
":",
"{",
"}",
";",
"body",
".",
"stored_fields",
"=",
"computedFields",
".",
"storedFields",
";",
"body",
".",
"script_fields",
"=",
"body",
".",
"script_fields",
"||",
"{",
"}",
";",
"extend",
"(",
"body",
".",
"script_fields",
",",
"computedFields",
".",
"scriptFields",
")",
";",
"const",
"defaultDocValueFields",
"=",
"computedFields",
".",
"docvalueFields",
"?",
"computedFields",
".",
"docvalueFields",
":",
"[",
"]",
";",
"body",
".",
"docvalue_fields",
"=",
"body",
".",
"docvalue_fields",
"||",
"defaultDocValueFields",
";",
"if",
"(",
"!",
"body",
".",
"hasOwnProperty",
"(",
"'_source'",
")",
"&&",
"index",
")",
"{",
"body",
".",
"_source",
"=",
"index",
".",
"getSourceFiltering",
"(",
")",
";",
"}",
"const",
"{",
"getConfig",
"}",
"=",
"this",
".",
"dependencies",
";",
"if",
"(",
"body",
".",
"_source",
")",
"{",
"const",
"filter",
"=",
"fieldWildcardFilter",
"(",
"body",
".",
"_source",
".",
"excludes",
",",
"getConfig",
"(",
"UI_SETTINGS",
".",
"META_FIELDS",
")",
")",
";",
"body",
".",
"docvalue_fields",
"=",
"body",
".",
"docvalue_fields",
".",
"filter",
"(",
"(",
"docvalueField",
")",
"=>",
"filter",
"(",
"docvalueField",
".",
"field",
")",
")",
";",
"}",
"if",
"(",
"fields",
")",
"{",
"body",
".",
"docvalue_fields",
"=",
"filterDocvalueFields",
"(",
"body",
".",
"docvalue_fields",
",",
"fields",
")",
";",
"body",
".",
"script_fields",
"=",
"pick",
"(",
"body",
".",
"script_fields",
",",
"fields",
")",
";",
"const",
"remainingFields",
"=",
"difference",
"(",
"fields",
",",
"keys",
"(",
"body",
".",
"script_fields",
")",
")",
";",
"body",
".",
"stored_fields",
"=",
"remainingFields",
";",
"setWith",
"(",
"body",
",",
"'_source.includes'",
",",
"remainingFields",
",",
"(",
"nsValue",
")",
"=>",
"isObject",
"(",
"nsValue",
")",
"?",
"{",
"}",
":",
"nsValue",
")",
";",
"}",
"const",
"opensearchQueryConfigs",
"=",
"getOpenSearchQueryConfig",
"(",
"{",
"get",
":",
"getConfig",
"}",
")",
";",
"body",
".",
"query",
"=",
"buildOpenSearchQuery",
"(",
"index",
",",
"query",
",",
"filters",
",",
"opensearchQueryConfigs",
")",
";",
"if",
"(",
"highlightAll",
"&&",
"body",
".",
"query",
")",
"{",
"body",
".",
"highlight",
"=",
"getHighlightRequest",
"(",
"body",
".",
"query",
",",
"getConfig",
"(",
"UI_SETTINGS",
".",
"DOC_HIGHLIGHT",
")",
")",
";",
"delete",
"searchRequest",
".",
"highlightAll",
";",
"}",
"return",
"searchRequest",
";",
"}",
"/**\n * serializes search source fields (which can later be passed to ",
"ISearchStartSearchSource",
")\n ",
"public",
"getSerializedFields",
"(",
")",
"{",
"const",
"{",
"filter",
":",
"originalFilters",
",",
"...",
"searchSourceFields",
"}",
"=",
"omit",
"(",
"this",
".",
"getFields",
"(",
")",
",",
"[",
"'sort'",
",",
"'size'",
",",
"]",
")",
";",
"let",
"serializedSearchSourceFields",
"=",
"{",
"...",
"searchSourceFields",
",",
"index",
":",
"(",
"searchSourceFields",
".",
"index",
"?",
"searchSourceFields",
".",
"index",
".",
"id",
":",
"undefined",
")",
"as",
"any",
",",
"}",
";",
"if",
"(",
"originalFilters",
")",
"{",
"const",
"filters",
"=",
"this",
".",
"getFilters",
"(",
"originalFilters",
")",
";",
"serializedSearchSourceFields",
"=",
"{",
"...",
"serializedSearchSourceFields",
",",
"filter",
":",
"filters",
",",
"}",
";",
"}",
"return",
"serializedSearchSourceFields",
";",
"}",
"public",
"public",
"serialize",
"(",
")",
"{",
"const",
"[",
"searchSourceFields",
",",
"references",
"]",
"=",
"extractReferences",
"(",
"this",
".",
"getSerializedFields",
"(",
")",
")",
";",
"return",
"{",
"searchSourceJSON",
":",
"JSON",
".",
"stringify",
"(",
"searchSourceFields",
")",
",",
"references",
"}",
";",
"}",
"private",
"getFilters",
"(",
"filterField",
")",
"{",
"if",
"(",
"!",
"filterField",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"filterField",
")",
")",
"{",
"return",
"filterField",
";",
"}",
"if",
"(",
"isFunction",
"(",
"filterField",
")",
")",
"{",
"return",
"this",
".",
"getFilters",
"(",
"filterField",
"(",
")",
")",
";",
"}",
"return",
"[",
"filterField",
"]",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2672,
null,
null,
null,
null,
6323,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
68,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2672,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
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,
68,
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,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
68,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1901,
null,
null,
null,
null,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1901,
null,
6,
null,
null,
null,
null,
null,
null,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3208,
null,
null,
26118,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
1488,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1441,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
1441,
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,
7,
null,
1441,
null,
1488,
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,
7,
null,
1441,
null,
1488,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
1488,
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,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
null,
null,
null,
null,
null,
1441,
null,
null,
null,
68,
null,
null,
null,
null,
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,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
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,
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,
1441,
null,
null,
null,
null,
null,
1441,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
737,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1441,
null,
null,
null,
null,
1441,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5330,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2672,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2672,
null,
null,
null,
null,
null,
null,
null,
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,
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,
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
] |
661212 | [
"import",
"{",
"migrateLegacyQuery",
"}",
"from",
"'./migrate_legacy_query'",
";",
"import",
"{",
"SearchSource",
",",
"SearchSourceDependencies",
"}",
"from",
"'./search_source'",
";",
"import",
"{",
"IndexPatternsContract",
"}",
"from",
"'../../index_patterns/index_patterns'",
";",
"import",
"{",
"SearchSourceFields",
"}",
"from",
"'./types'",
";",
"param",
"indexPatterns",
"param",
"searchSourceDependencies",
"return",
"public",
"export",
"const",
"createSearchSource",
"=",
"(",
"indexPatterns",
",",
"searchSourceDependencies",
")",
"=>",
"async",
"(",
"searchSourceFields",
"=",
"{",
"}",
")",
"=>",
"{",
"const",
"fields",
"=",
"{",
"...",
"searchSourceFields",
"}",
";",
"if",
"(",
"fields",
".",
"index",
"&&",
"typeof",
"fields",
".",
"index",
"===",
"'string'",
")",
"{",
"fields",
".",
"index",
"=",
"await",
"indexPatterns",
".",
"get",
"(",
"searchSourceFields",
".",
"index",
"as",
"any",
")",
";",
"}",
"const",
"searchSource",
"=",
"new",
"SearchSource",
"(",
"fields",
",",
"searchSourceDependencies",
")",
";",
"const",
"query",
"=",
"searchSource",
".",
"getOwnField",
"(",
"'query'",
")",
";",
"if",
"(",
"typeof",
"query",
"!==",
"'undefined'",
")",
"{",
"searchSource",
".",
"setField",
"(",
"'query'",
",",
"migrateLegacyQuery",
"(",
"query",
")",
")",
";",
"}",
"return",
"searchSource",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5329,
null,
6323,
null,
null,
null,
null,
2672,
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,
1901,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661213 | [
"import",
"{",
"SavedObjectReference",
"}",
"from",
"'src/core/types'",
";",
"import",
"{",
"SearchSourceFields",
"}",
"from",
"'./types'",
";",
"export",
"const",
"injectReferences",
"=",
"(",
"searchSourceFields",
",",
"references",
")",
"=>",
"{",
"const",
"searchSourceReturnFields",
"=",
"{",
"...",
"searchSourceFields",
"}",
";",
"if",
"(",
"searchSourceFields",
".",
"indexRefName",
")",
"{",
"const",
"reference",
"=",
"references",
".",
"find",
"(",
"(",
"ref",
")",
"=>",
"ref",
".",
"name",
"===",
"searchSourceFields",
".",
"indexRefName",
")",
";",
"if",
"(",
"!",
"reference",
")",
"{",
"throw",
"new",
"Error",
"(",
"`Could not find reference for ${",
"searchSourceFields",
".",
"indexRefName",
"}`",
")",
";",
"}",
"searchSourceReturnFields",
".",
"index",
"=",
"reference",
".",
"id",
";",
"delete",
"searchSourceReturnFields",
".",
"indexRefName",
";",
"}",
"if",
"(",
"searchSourceReturnFields",
".",
"filter",
"&&",
"Array",
".",
"isArray",
"(",
"searchSourceReturnFields",
".",
"filter",
")",
")",
"{",
"searchSourceReturnFields",
".",
"filter",
".",
"forEach",
"(",
"(",
"filterRow",
")",
"=>",
"{",
"if",
"(",
"!",
"filterRow",
".",
"meta",
"||",
"!",
"filterRow",
".",
"meta",
".",
"indexRefName",
")",
"{",
"return",
";",
"}",
"const",
"reference",
"=",
"references",
".",
"find",
"(",
"(",
"ref",
")",
"=>",
"ref",
".",
"name",
"===",
"filterRow",
".",
"meta",
".",
"indexRefName",
")",
";",
"if",
"(",
"!",
"reference",
")",
"{",
"throw",
"new",
"Error",
"(",
"`Could not find reference for ${",
"filterRow",
".",
"meta",
".",
"indexRefName",
"}`",
")",
";",
"}",
"filterRow",
".",
"meta",
".",
"index",
"=",
"reference",
".",
"id",
";",
"delete",
"filterRow",
".",
"meta",
".",
"indexRefName",
";",
"}",
")",
";",
"}",
"return",
"searchSourceReturnFields",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2672,
null,
null,
null,
null,
5,
null,
null,
null,
null,
2672,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661214 | [
"import",
"{",
"SearchSourceFields",
"}",
"from",
"'./types'",
";",
"import",
"{",
"InvalidJSONProperty",
"}",
"from",
"'../../../../opensearch_dashboards_utils/common'",
";",
"export",
"const",
"parseSearchSourceJSON",
"=",
"(",
"searchSourceJSON",
")",
"=>",
"{",
"let",
"searchSourceValues",
";",
"try",
"{",
"searchSourceValues",
"=",
"JSON",
".",
"parse",
"(",
"searchSourceJSON",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"throw",
"new",
"InvalidJSONProperty",
"(",
"`Invalid JSON in search source. ${",
"e",
".",
"message",
"} JSON: ${",
"searchSourceJSON",
"}`",
")",
";",
"}",
"if",
"(",
"!",
"searchSourceValues",
"||",
"typeof",
"searchSourceValues",
"!==",
"'object'",
")",
"{",
"throw",
"new",
"InvalidJSONProperty",
"(",
"'Invalid JSON in search source.'",
")",
";",
"}",
"return",
"searchSourceValues",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2672,
null,
null,
2,
null,
null,
null,
null,
2672,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661215 | [
"import",
"{",
"createSearchSource",
",",
"SearchSource",
",",
"SearchSourceDependencies",
"}",
"from",
"'./'",
";",
"import",
"{",
"IndexPatternsContract",
"}",
"from",
"'../../index_patterns/index_patterns'",
";",
"export",
"class",
"SearchSourceService",
"{",
"public",
"setup",
"(",
")",
"{",
"}",
"public",
"start",
"(",
"indexPatterns",
",",
"dependencies",
")",
"{",
"return",
"{",
"/**\n * creates searchsource based on serialized search source fields\n */",
"create",
":",
"createSearchSource",
"(",
"indexPatterns",
",",
"dependencies",
")",
",",
"/**\n * creates an enpty search source\n */",
"createEmpty",
":",
"(",
")",
"=>",
"{",
"return",
"new",
"SearchSource",
"(",
"{",
"}",
",",
"dependencies",
")",
";",
"}",
",",
"}",
";",
"}",
"public",
"stop",
"(",
")",
"{",
"}",
"}"
] | [
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,
6,
null,
5329,
null,
6323,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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
] |
661216 | [
"import",
"{",
"groupBy",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"IAggConfig",
"}",
"from",
"'../aggs'",
";",
"import",
"{",
"TabbedAggColumn",
"}",
"from",
"'./types'",
";",
"const",
"getColumn",
"=",
"(",
"agg",
",",
"i",
")",
":",
"TabbedAggColumn",
"=>",
"{",
"let",
"name",
"=",
"''",
";",
"try",
"{",
"name",
"=",
"agg",
".",
"makeLabel",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"}",
"return",
"{",
"aggConfig",
":",
"agg",
",",
"id",
":",
"`col-${",
"i",
"}-${",
"agg",
".",
"id",
"}`",
",",
"name",
",",
"}",
";",
"}",
";",
"param",
"{",
"AggConfigs",
"}",
"aggs",
"param",
"{",
"boolean",
"}",
"minimalColumns",
"export",
"function",
"tabifyGetColumns",
"(",
"aggs",
",",
"minimalColumns",
")",
"{",
"if",
"(",
"minimalColumns",
")",
"{",
"return",
"aggs",
".",
"map",
"(",
"(",
"agg",
",",
"i",
")",
"=>",
"getColumn",
"(",
"agg",
",",
"i",
")",
")",
";",
"}",
"const",
"columns",
"=",
"[",
"]",
";",
"const",
"grouped",
"=",
"groupBy",
"(",
"aggs",
",",
"(",
"agg",
")",
"=>",
"{",
"return",
"agg",
".",
"type",
".",
"type",
";",
"}",
")",
";",
"if",
"(",
"!",
"grouped",
".",
"buckets",
")",
"{",
"return",
"grouped",
".",
"metrics",
".",
"map",
"(",
"(",
"agg",
",",
"i",
")",
"=>",
"getColumn",
"(",
"agg",
",",
"i",
")",
")",
";",
"}",
"let",
"columnIndex",
"=",
"0",
";",
"grouped",
".",
"buckets",
".",
"forEach",
"(",
"(",
"agg",
")",
"=>",
"{",
"columns",
".",
"push",
"(",
"getColumn",
"(",
"agg",
",",
"columnIndex",
"++",
")",
")",
";",
"grouped",
".",
"metrics",
".",
"forEach",
"(",
"(",
"metric",
")",
"=>",
"{",
"columns",
".",
"push",
"(",
"getColumn",
"(",
"metric",
",",
"columnIndex",
"++",
")",
")",
";",
"}",
")",
";",
"}",
")",
";",
"return",
"columns",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3123,
null,
null,
941,
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,
5,
null,
5,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
530,
null,
3,
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,
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
] |
661217 | [
"import",
"{",
"isEmpty",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"IAggConfigs",
"}",
"from",
"'../aggs'",
";",
"import",
"{",
"tabifyGetColumns",
"}",
"from",
"'./get_columns'",
";",
"import",
"{",
"TabbedResponseWriterOptions",
",",
"TabbedAggColumn",
",",
"TabbedAggRow",
",",
"TabbedTable",
"}",
"from",
"'./types'",
";",
"interface",
"BufferColumn",
"{",
"id",
":",
"string",
";",
"value",
":",
"string",
"|",
"number",
";",
"}",
"/**\n * Writer class that collects information about an aggregation response and\n * produces a table, or a series of tables.\n */",
"export",
"class",
"TabbedAggResponseWriter",
"{",
"columns",
":",
"TabbedAggColumn",
"[",
"]",
";",
"rows",
":",
"TabbedAggRow",
"[",
"]",
"=",
"[",
"]",
";",
"bucketBuffer",
":",
"BufferColumn",
"[",
"]",
"=",
"[",
"]",
";",
"metricBuffer",
":",
"BufferColumn",
"[",
"]",
"=",
"[",
"]",
";",
"private",
"readonly",
"partialRows",
":",
"boolean",
";",
"param",
"{",
"AggConfigs",
"}",
"aggs",
"param",
"{",
"boolean",
"}",
"metricsAtAllLevels",
"param",
"{",
"boolean",
"}",
"partialRows",
"constructor",
"(",
"aggs",
",",
"{",
"metricsAtAllLevels",
"=",
"false",
",",
"partialRows",
"=",
"false",
"}",
")",
"{",
"this",
".",
"partialRows",
"=",
"partialRows",
";",
"this",
".",
"columns",
"=",
"tabifyGetColumns",
"(",
"aggs",
".",
"getResponseAggs",
"(",
")",
",",
"!",
"metricsAtAllLevels",
")",
";",
"this",
".",
"rows",
"=",
"[",
"]",
";",
"}",
"/**\n * Create a new row by reading the row buffer and bucketBuffer\n */",
"row",
"(",
")",
"{",
"const",
"rowBuffer",
"=",
"{",
"}",
";",
"this",
".",
"bucketBuffer",
".",
"forEach",
"(",
"(",
"bucket",
")",
"=>",
"{",
"rowBuffer",
"[",
"bucket",
".",
"id",
"]",
"=",
"bucket",
".",
"value",
";",
"}",
")",
";",
"this",
".",
"metricBuffer",
".",
"forEach",
"(",
"(",
"metric",
")",
"=>",
"{",
"rowBuffer",
"[",
"metric",
".",
"id",
"]",
"=",
"metric",
".",
"value",
";",
"}",
")",
";",
"const",
"isPartialRow",
"=",
"!",
"this",
".",
"columns",
".",
"every",
"(",
"(",
"column",
")",
"=>",
"rowBuffer",
".",
"hasOwnProperty",
"(",
"column",
".",
"id",
")",
")",
";",
"const",
"removePartial",
"=",
"isPartialRow",
"&&",
"!",
"this",
".",
"partialRows",
";",
"if",
"(",
"!",
"isEmpty",
"(",
"rowBuffer",
")",
"&&",
"!",
"removePartial",
")",
"{",
"this",
".",
"rows",
".",
"push",
"(",
"rowBuffer",
")",
";",
"}",
"}",
"response",
"(",
")",
"{",
"return",
"{",
"columns",
":",
"this",
".",
"columns",
",",
"rows",
":",
"this",
".",
"rows",
",",
"}",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2050,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661218 | [
"import",
"{",
"get",
",",
"isPlainObject",
",",
"keys",
",",
"findKey",
"}",
"from",
"'lodash'",
";",
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"IAggConfig",
"}",
"from",
"'../aggs'",
";",
"import",
"{",
"AggResponseBucket",
",",
"TabbedRangeFilterParams",
",",
"TimeRangeInformation",
"}",
"from",
"'./types'",
";",
"type",
"AggParams",
"=",
"IAggConfig",
"[",
"'params'",
"]",
"&",
"{",
"drop_partials",
":",
"boolean",
";",
"ranges",
":",
"TabbedRangeFilterParams",
"[",
"]",
";",
"}",
";",
"const",
"isRangeEqual",
"=",
"(",
"range1",
",",
"range2",
")",
"=>",
"range1",
"?.",
"from",
"===",
"range2",
"?.",
"from",
"&&",
"range1",
"?.",
"to",
"===",
"range2",
"?.",
"to",
";",
"export",
"class",
"TabifyBuckets",
"{",
"length",
":",
"number",
";",
"objectMode",
":",
"boolean",
";",
"buckets",
":",
"any",
";",
"_keys",
":",
"any",
"[",
"]",
"=",
"[",
"]",
";",
"constructor",
"(",
"aggResp",
",",
"aggParams",
"?",
",",
"timeRange",
"?",
")",
"{",
"if",
"(",
"aggResp",
"&&",
"aggResp",
".",
"buckets",
")",
"{",
"this",
".",
"buckets",
"=",
"aggResp",
".",
"buckets",
";",
"}",
"else",
"if",
"(",
"aggResp",
")",
"{",
"this",
".",
"buckets",
"=",
"[",
"aggResp",
"]",
";",
"}",
"else",
"{",
"this",
".",
"buckets",
"=",
"[",
"]",
";",
"}",
"this",
".",
"objectMode",
"=",
"isPlainObject",
"(",
"this",
".",
"buckets",
")",
";",
"if",
"(",
"this",
".",
"objectMode",
")",
"{",
"this",
".",
"_keys",
"=",
"keys",
"(",
"this",
".",
"buckets",
")",
";",
"this",
".",
"length",
"=",
"this",
".",
"_keys",
".",
"length",
";",
"}",
"else",
"{",
"this",
".",
"length",
"=",
"this",
".",
"buckets",
".",
"length",
";",
"}",
"if",
"(",
"this",
".",
"length",
"&&",
"aggParams",
")",
"{",
"this",
".",
"orderBucketsAccordingToParams",
"(",
"aggParams",
")",
";",
"if",
"(",
"aggParams",
".",
"drop_partials",
")",
"{",
"this",
".",
"dropPartials",
"(",
"aggParams",
",",
"timeRange",
")",
";",
"}",
"}",
"}",
"forEach",
"(",
"fn",
")",
"{",
"const",
"buckets",
"=",
"this",
".",
"buckets",
";",
"if",
"(",
"this",
".",
"objectMode",
")",
"{",
"this",
".",
"_keys",
".",
"forEach",
"(",
"(",
"key",
")",
"=>",
"{",
"fn",
"(",
"buckets",
"[",
"key",
"]",
",",
"key",
")",
";",
"}",
")",
";",
"}",
"else",
"{",
"buckets",
".",
"forEach",
"(",
"(",
"bucket",
")",
"=>",
"{",
"fn",
"(",
"bucket",
",",
"bucket",
".",
"key",
")",
";",
"}",
")",
";",
"}",
"}",
"private",
"orderBucketsAccordingToParams",
"(",
"params",
")",
"{",
"if",
"(",
"params",
".",
"filters",
"&&",
"this",
".",
"objectMode",
")",
"{",
"this",
".",
"_keys",
"=",
"params",
".",
"filters",
".",
"map",
"(",
"(",
"filter",
")",
"=>",
"{",
"const",
"query",
"=",
"get",
"(",
"filter",
",",
"'input.query.query_string.query'",
",",
"filter",
".",
"input",
".",
"query",
")",
";",
"const",
"queryString",
"=",
"typeof",
"query",
"===",
"'string'",
"?",
"query",
":",
"JSON",
".",
"stringify",
"(",
"query",
")",
";",
"return",
"filter",
".",
"label",
"||",
"queryString",
"||",
"'*'",
";",
"}",
")",
";",
"}",
"else",
"if",
"(",
"params",
".",
"ranges",
"&&",
"this",
".",
"objectMode",
")",
"{",
"this",
".",
"_keys",
"=",
"params",
".",
"ranges",
".",
"map",
"(",
"(",
"range",
")",
"=>",
"findKey",
"(",
"this",
".",
"buckets",
",",
"(",
"el",
")",
"=>",
"isRangeEqual",
"(",
"el",
",",
"range",
")",
")",
")",
";",
"}",
"else",
"if",
"(",
"params",
".",
"ranges",
"&&",
"params",
".",
"field",
".",
"type",
"!==",
"'date'",
")",
"{",
"let",
"ranges",
"=",
"params",
".",
"ranges",
";",
"if",
"(",
"params",
".",
"ipRangeType",
")",
"{",
"ranges",
"=",
"params",
".",
"ipRangeType",
"===",
"'mask'",
"?",
"ranges",
".",
"mask",
":",
"ranges",
".",
"fromTo",
";",
"}",
"this",
".",
"buckets",
"=",
"ranges",
".",
"map",
"(",
"(",
"range",
")",
"=>",
"{",
"if",
"(",
"range",
".",
"mask",
")",
"{",
"return",
"this",
".",
"buckets",
".",
"find",
"(",
"(",
"el",
")",
"=>",
"el",
".",
"key",
"===",
"range",
".",
"mask",
")",
";",
"}",
"return",
"this",
".",
"buckets",
".",
"find",
"(",
"(",
"el",
")",
"=>",
"isRangeEqual",
"(",
"el",
",",
"range",
")",
")",
";",
"}",
")",
";",
"}",
"}",
"private",
"dropPartials",
"(",
"params",
",",
"timeRange",
"?",
")",
"{",
"if",
"(",
"!",
"timeRange",
"||",
"this",
".",
"buckets",
".",
"length",
"<=",
"1",
"||",
"this",
".",
"objectMode",
"||",
"!",
"timeRange",
".",
"timeFields",
".",
"includes",
"(",
"params",
".",
"field",
".",
"name",
")",
")",
"{",
"return",
";",
"}",
"const",
"interval",
"=",
"this",
".",
"buckets",
"[",
"1",
"]",
".",
"key",
"-",
"this",
".",
"buckets",
"[",
"0",
"]",
".",
"key",
";",
"this",
".",
"buckets",
"=",
"this",
".",
"buckets",
".",
"filter",
"(",
"(",
"bucket",
")",
"=>",
"{",
"if",
"(",
"moment",
"(",
"bucket",
".",
"key",
")",
".",
"isBefore",
"(",
"timeRange",
".",
"from",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"moment",
"(",
"bucket",
".",
"key",
"+",
"interval",
")",
".",
"isAfter",
"(",
"timeRange",
".",
"to",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}",
")",
";",
"this",
".",
"length",
"=",
"this",
".",
"buckets",
".",
"length",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5331,
null,
5331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8960,
null,
null,
13402,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
4417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
8960,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5331,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
8960,
null,
13402,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661219 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"TabbedAggResponseWriter",
"}",
"from",
"'./response_writer'",
";",
"import",
"{",
"TabifyBuckets",
"}",
"from",
"'./buckets'",
";",
"import",
"{",
"TabbedResponseWriterOptions",
"}",
"from",
"'./types'",
";",
"import",
"{",
"AggResponseBucket",
"}",
"from",
"'./types'",
";",
"import",
"{",
"AggGroupNames",
",",
"IAggConfigs",
"}",
"from",
"'../aggs'",
";",
"/**\n * Sets up the ResponseWriter and kicks off bucket collection.\n */",
"export",
"function",
"tabifyAggResponse",
"(",
"aggConfigs",
",",
"opensearchResponse",
",",
"respOpts",
"?",
")",
"{",
"/**\n * read an aggregation from a bucket, which *might* be found at key (if\n * the response came in object form), and will recurse down the aggregation\n * tree and will pass the read values to the ResponseWriter.\n */",
"function",
"collectBucket",
"(",
"aggs",
",",
"write",
",",
"bucket",
",",
"key",
",",
"aggScale",
")",
"{",
"const",
"column",
"=",
"write",
".",
"columns",
".",
"shift",
"(",
")",
";",
"if",
"(",
"column",
")",
"{",
"const",
"agg",
"=",
"column",
".",
"aggConfig",
";",
"const",
"aggInfo",
"=",
"agg",
".",
"write",
"(",
"aggs",
")",
";",
"aggScale",
"*=",
"aggInfo",
".",
"metricScale",
"||",
"1",
";",
"switch",
"(",
"agg",
".",
"type",
".",
"type",
")",
"{",
"case",
"AggGroupNames",
".",
"Buckets",
":",
"const",
"aggBucket",
"=",
"get",
"(",
"bucket",
",",
"agg",
".",
"id",
")",
";",
"const",
"tabifyBuckets",
"=",
"new",
"TabifyBuckets",
"(",
"aggBucket",
",",
"agg",
".",
"params",
",",
"respOpts",
"?.",
"timeRange",
")",
";",
"if",
"(",
"tabifyBuckets",
".",
"length",
")",
"{",
"tabifyBuckets",
".",
"forEach",
"(",
"(",
"subBucket",
",",
"tabifyBucketKey",
")",
"=>",
"{",
"const",
"bucketValue",
"=",
"agg",
".",
"getKey",
"(",
"subBucket",
",",
"tabifyBucketKey",
")",
";",
"const",
"hasBucketValue",
"=",
"typeof",
"bucketValue",
"!==",
"'undefined'",
";",
"if",
"(",
"hasBucketValue",
")",
"{",
"write",
".",
"bucketBuffer",
".",
"push",
"(",
"{",
"id",
":",
"column",
".",
"id",
",",
"value",
":",
"bucketValue",
"}",
")",
";",
"}",
"collectBucket",
"(",
"aggs",
",",
"write",
",",
"subBucket",
",",
"agg",
".",
"getKey",
"(",
"subBucket",
",",
"tabifyBucketKey",
")",
",",
"aggScale",
")",
";",
"if",
"(",
"hasBucketValue",
")",
"{",
"write",
".",
"bucketBuffer",
".",
"pop",
"(",
")",
";",
"}",
"}",
")",
";",
"}",
"else",
"if",
"(",
"respOpts",
"?.",
"partialRows",
")",
"{",
"write",
".",
"columns",
".",
"unshift",
"(",
"column",
")",
";",
"passEmptyBuckets",
"(",
"aggs",
",",
"write",
",",
"bucket",
",",
"key",
",",
"aggScale",
")",
";",
"write",
".",
"columns",
".",
"shift",
"(",
")",
";",
"}",
"else",
"{",
"write",
".",
"row",
"(",
")",
";",
"}",
"break",
";",
"case",
"AggGroupNames",
".",
"Metrics",
":",
"let",
"value",
"=",
"agg",
".",
"getValue",
"(",
"bucket",
")",
";",
"if",
"(",
"aggScale",
"!==",
"1",
")",
"{",
"value",
"*=",
"aggScale",
";",
"}",
"write",
".",
"metricBuffer",
".",
"push",
"(",
"{",
"id",
":",
"column",
".",
"id",
",",
"value",
"}",
")",
";",
"if",
"(",
"!",
"write",
".",
"columns",
".",
"length",
")",
"{",
"write",
".",
"row",
"(",
")",
";",
"}",
"else",
"{",
"collectBucket",
"(",
"aggs",
",",
"write",
",",
"bucket",
",",
"key",
",",
"aggScale",
")",
";",
"}",
"write",
".",
"metricBuffer",
".",
"pop",
"(",
")",
";",
"break",
";",
"}",
"write",
".",
"columns",
".",
"unshift",
"(",
"column",
")",
";",
"}",
"}",
"function",
"passEmptyBuckets",
"(",
"aggs",
",",
"write",
",",
"bucket",
",",
"key",
",",
"aggScale",
")",
"{",
"const",
"column",
"=",
"write",
".",
"columns",
".",
"shift",
"(",
")",
";",
"if",
"(",
"column",
")",
"{",
"const",
"agg",
"=",
"column",
".",
"aggConfig",
";",
"switch",
"(",
"agg",
".",
"type",
".",
"type",
")",
"{",
"case",
"AggGroupNames",
".",
"Metrics",
":",
"write",
".",
"columns",
".",
"unshift",
"(",
"column",
")",
";",
"collectBucket",
"(",
"aggs",
",",
"write",
",",
"bucket",
",",
"key",
",",
"aggScale",
")",
";",
"return",
";",
"case",
"AggGroupNames",
".",
"Buckets",
":",
"passEmptyBuckets",
"(",
"aggs",
",",
"write",
",",
"bucket",
",",
"key",
",",
"aggScale",
")",
";",
"}",
"write",
".",
"columns",
".",
"unshift",
"(",
"column",
")",
";",
"}",
"}",
"const",
"write",
"=",
"new",
"TabbedAggResponseWriter",
"(",
"aggConfigs",
",",
"respOpts",
"||",
"{",
"}",
")",
";",
"const",
"topLevelBucket",
"=",
"{",
"...",
"opensearchResponse",
".",
"aggregations",
",",
"doc_count",
":",
"opensearchResponse",
".",
"hits",
".",
"total",
",",
"}",
";",
"collectBucket",
"(",
"aggConfigs",
",",
"write",
",",
"topLevelBucket",
",",
"''",
",",
"1",
")",
";",
"return",
"write",
".",
"response",
"(",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2050,
null,
17,
null,
20,
null,
null,
null,
null,
null,
4,
null,
2050,
null,
8961,
null,
4417,
null,
2,
null,
3,
null,
null,
null,
3123,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
530,
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,
26119,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
2050,
null,
8961,
null,
4417,
null,
2,
null,
3,
null,
null,
null,
3123,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8961,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4417,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661220 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"{",
"Required",
"}",
"from",
"'@osd/utility-types'",
";",
"import",
"{",
"EuiComboBox",
",",
"EuiComboBoxProps",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"SavedObjectsClientContract",
",",
"SimpleSavedObject",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"getTitle",
"}",
"from",
"'../../../common/index_patterns/lib'",
";",
"export",
"type",
"IndexPatternSelectProps",
"=",
"Required",
"<",
"Omit",
"<",
"EuiComboBoxProps",
"<",
"any",
">",
",",
"'isLoading'",
"|",
"'onSearchChange'",
"|",
"'options'",
"|",
"'selectedOptions'",
">",
",",
"'onChange'",
"|",
"'placeholder'",
">",
"&",
"{",
"indexPatternId",
":",
"string",
";",
"fieldTypes",
"?",
":",
"string",
"[",
"]",
";",
"onNoIndexPatterns",
"?",
":",
"(",
")",
"=>",
"void",
";",
"savedObjectsClient",
":",
"SavedObjectsClientContract",
";",
"}",
";",
"interface",
"IndexPatternSelectState",
"{",
"isLoading",
":",
"boolean",
";",
"options",
":",
"[",
"]",
";",
"selectedIndexPattern",
":",
"{",
"value",
":",
"string",
";",
"label",
":",
"string",
";",
"}",
"|",
"undefined",
";",
"searchValue",
":",
"string",
"|",
"undefined",
";",
"}",
"const",
"getIndexPatterns",
"=",
"async",
"(",
"client",
",",
"search",
",",
"fields",
")",
"=>",
"{",
"const",
"resp",
"=",
"await",
"client",
".",
"find",
"(",
"{",
"type",
":",
"'index-pattern'",
",",
"fields",
",",
"search",
":",
"`${",
"search",
"}*`",
",",
"searchFields",
":",
"[",
"'title'",
"]",
",",
"perPage",
":",
"100",
",",
"}",
")",
";",
"return",
"resp",
".",
"savedObjects",
";",
"}",
";",
"export",
"default",
"class",
"IndexPatternSelect",
"extends",
"Component",
"<",
"IndexPatternSelectProps",
">",
"{",
"private",
"isMounted",
":",
"boolean",
"=",
"false",
";",
"state",
":",
"IndexPatternSelectState",
";",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"this",
".",
"state",
"=",
"{",
"isLoading",
":",
"false",
",",
"options",
":",
"[",
"]",
",",
"selectedIndexPattern",
":",
"undefined",
",",
"searchValue",
":",
"undefined",
",",
"}",
";",
"}",
"componentWillUnmount",
"(",
")",
"{",
"this",
".",
"isMounted",
"=",
"false",
";",
"this",
".",
"debouncedFetch",
".",
"cancel",
"(",
")",
";",
"}",
"componentDidMount",
"(",
")",
"{",
"this",
".",
"isMounted",
"=",
"true",
";",
"this",
".",
"fetchOptions",
"(",
")",
";",
"this",
".",
"fetchSelectedIndexPattern",
"(",
"this",
".",
"props",
".",
"indexPatternId",
")",
";",
"}",
"UNSAFE_componentWillReceiveProps",
"(",
"nextProps",
")",
"{",
"if",
"(",
"nextProps",
".",
"indexPatternId",
"!==",
"this",
".",
"props",
".",
"indexPatternId",
")",
"{",
"this",
".",
"fetchSelectedIndexPattern",
"(",
"nextProps",
".",
"indexPatternId",
")",
";",
"}",
"}",
"fetchSelectedIndexPattern",
"=",
"async",
"(",
"indexPatternId",
")",
"=>",
"{",
"if",
"(",
"!",
"indexPatternId",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"selectedIndexPattern",
":",
"undefined",
",",
"}",
")",
";",
"return",
";",
"}",
"let",
"indexPatternTitle",
";",
"try",
"{",
"indexPatternTitle",
"=",
"await",
"getTitle",
"(",
"this",
".",
"props",
".",
"savedObjectsClient",
",",
"indexPatternId",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"isMounted",
")",
"{",
"return",
";",
"}",
"this",
".",
"setState",
"(",
"{",
"selectedIndexPattern",
":",
"{",
"value",
":",
"indexPatternId",
",",
"label",
":",
"indexPatternTitle",
",",
"}",
",",
"}",
")",
";",
"}",
";",
"debouncedFetch",
"=",
"_",
".",
"debounce",
"(",
"async",
"(",
"searchValue",
")",
"=>",
"{",
"const",
"{",
"fieldTypes",
",",
"onNoIndexPatterns",
",",
"savedObjectsClient",
"}",
"=",
"this",
".",
"props",
";",
"const",
"savedObjectFields",
"=",
"[",
"'title'",
"]",
";",
"if",
"(",
"fieldTypes",
")",
"{",
"savedObjectFields",
".",
"push",
"(",
"'fields'",
")",
";",
"}",
"let",
"savedObjects",
"=",
"await",
"getIndexPatterns",
"(",
"savedObjectsClient",
",",
"searchValue",
",",
"savedObjectFields",
")",
";",
"if",
"(",
"fieldTypes",
")",
"{",
"savedObjects",
"=",
"savedObjects",
".",
"filter",
"(",
"(",
"savedObject",
")",
"=>",
"{",
"try",
"{",
"const",
"indexPatternFields",
"=",
"JSON",
".",
"parse",
"(",
"savedObject",
".",
"attributes",
".",
"fields",
"as",
"any",
")",
";",
"return",
"indexPatternFields",
".",
"some",
"(",
"(",
"field",
")",
"=>",
"{",
"return",
"fieldTypes",
"?.",
"includes",
"(",
"field",
".",
"type",
")",
";",
"}",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"return",
"false",
";",
"}",
"}",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"isMounted",
")",
"{",
"return",
";",
"}",
"if",
"(",
"searchValue",
"===",
"this",
".",
"state",
".",
"searchValue",
")",
"{",
"const",
"options",
"=",
"savedObjects",
".",
"map",
"(",
"(",
"indexPatternSavedObject",
")",
"=>",
"{",
"return",
"{",
"label",
":",
"indexPatternSavedObject",
".",
"attributes",
".",
"title",
",",
"value",
":",
"indexPatternSavedObject",
".",
"id",
",",
"}",
";",
"}",
")",
";",
"this",
".",
"setState",
"(",
"{",
"isLoading",
":",
"false",
",",
"options",
",",
"}",
")",
";",
"if",
"(",
"onNoIndexPatterns",
"&&",
"searchValue",
"===",
"''",
"&&",
"options",
".",
"length",
"===",
"0",
")",
"{",
"onNoIndexPatterns",
"(",
")",
";",
"}",
"}",
"}",
",",
"300",
")",
";",
"fetchOptions",
"=",
"(",
"searchValue",
"=",
"''",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"isLoading",
":",
"true",
",",
"searchValue",
",",
"}",
",",
"this",
".",
"debouncedFetch",
".",
"bind",
"(",
"null",
",",
"searchValue",
")",
")",
";",
"}",
";",
"onChange",
"=",
"(",
"selectedOptions",
")",
"=>",
"{",
"this",
".",
"props",
".",
"onChange",
"(",
"_",
".",
"get",
"(",
"selectedOptions",
",",
"'0.value'",
")",
")",
";",
"}",
";",
"render",
"(",
")",
"{",
"const",
"{",
"fieldTypes",
",",
"onChange",
",",
"indexPatternId",
",",
"placeholder",
",",
"onNoIndexPatterns",
",",
"savedObjectsClient",
",",
"...",
"rest",
"}",
"=",
"this",
".",
"props",
";",
"return",
"(",
"<",
"EuiComboBox",
"{",
"...",
"rest",
"}",
"placeholder",
"=",
"{",
"placeholder",
"}",
"singleSelection",
"=",
"{",
"true",
"}",
"isLoading",
"=",
"{",
"this",
".",
"state",
".",
"isLoading",
"}",
"onSearchChange",
"=",
"{",
"this",
".",
"fetchOptions",
"}",
"options",
"=",
"{",
"this",
".",
"state",
".",
"options",
"}",
"selectedOptions",
"=",
"{",
"this",
".",
"state",
".",
"selectedIndexPattern",
"?",
"[",
"this",
".",
"state",
".",
"selectedIndexPattern",
"]",
":",
"[",
"]",
"}",
"onChange",
"=",
"{",
"this",
".",
"onChange",
"}",
"/",
">",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
1020,
null,
2,
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,
8740,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
4,
null,
8740,
null,
null,
null,
null,
null,
null,
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,
2,
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,
3480,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3480,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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
] |
661221 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"SavedObjectsClientContract",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IndexPatternSelect",
",",
"IndexPatternSelectProps",
"}",
"from",
"'./'",
";",
"export",
"function",
"createIndexPatternSelect",
"(",
"savedObjectsClient",
")",
"{",
"return",
"(",
"props",
")",
"=>",
"(",
"<",
"IndexPatternSelect",
"{",
"...",
"props",
"}",
"savedObjectsClient",
"=",
"{",
"savedObjectsClient",
"}",
"/",
">",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1020,
null,
null,
null,
null,
171,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661222 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"type",
"{",
"IndexPatternSelectProps",
"}",
"from",
"'./index_pattern_select'",
";",
"const",
"Fallback",
"=",
"(",
")",
"=>",
"<",
"div",
"/>;",
"const",
"LazyIndexPatternSelect",
"=",
"React",
".",
"lazy",
"(",
"(",
")",
"=>",
"import",
"(",
"'./index_pattern_select'",
")",
")",
";",
"export",
"const",
"IndexPatternSelect",
"=",
"(",
"props",
")",
"=>",
"(",
"<",
"React",
".",
"Suspense",
"fallback",
"=",
"{",
"<",
"Fallback",
"/",
">",
"}",
">",
"<",
"LazyIndexPatternSelect",
"{",
"...",
"props",
"}",
"/",
">",
"<",
"/React.Suspense>);",
"export",
"*",
"from",
"'./create_index_pattern_select'",
";",
"export",
"type",
"{",
"IndexPatternSelectProps",
"}",
"from",
"'./index_pattern_select'",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8740,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661223 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FILTERS",
"}",
"from",
"'../../../../../common/opensearch_query/filters'",
";",
"export",
"interface",
"Operator",
"{",
"message",
":",
"string",
";",
"type",
":",
"FILTERS",
";",
"negate",
":",
"boolean",
";",
"fieldTypes",
"?",
":",
"string",
"[",
"]",
";",
"}",
"export",
"const",
"isOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.isOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'is'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"PHRASE",
",",
"negate",
":",
"false",
",",
"}",
";",
"export",
"const",
"isNotOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.isNotOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'is not'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"PHRASE",
",",
"negate",
":",
"true",
",",
"}",
";",
"export",
"const",
"isOneOfOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.isOneOfOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'is one of'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"PHRASES",
",",
"negate",
":",
"false",
",",
"fieldTypes",
":",
"[",
"'string'",
",",
"'number'",
",",
"'date'",
",",
"'ip'",
",",
"'geo_point'",
",",
"'geo_shape'",
"]",
",",
"}",
";",
"export",
"const",
"isNotOneOfOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.isNotOneOfOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'is not one of'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"PHRASES",
",",
"negate",
":",
"true",
",",
"fieldTypes",
":",
"[",
"'string'",
",",
"'number'",
",",
"'date'",
",",
"'ip'",
",",
"'geo_point'",
",",
"'geo_shape'",
"]",
",",
"}",
";",
"export",
"const",
"isBetweenOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.isBetweenOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'is between'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"RANGE",
",",
"negate",
":",
"false",
",",
"fieldTypes",
":",
"[",
"'number'",
",",
"'date'",
",",
"'ip'",
"]",
",",
"}",
";",
"export",
"const",
"isNotBetweenOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.isNotBetweenOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'is not between'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"RANGE",
",",
"negate",
":",
"true",
",",
"fieldTypes",
":",
"[",
"'number'",
",",
"'date'",
",",
"'ip'",
"]",
",",
"}",
";",
"export",
"const",
"existsOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.existsOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'exists'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"EXISTS",
",",
"negate",
":",
"false",
",",
"}",
";",
"export",
"const",
"doesNotExistOperator",
"=",
"{",
"message",
":",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.doesNotExistOperatorOptionLabel'",
",",
"{",
"defaultMessage",
":",
"'does not exist'",
",",
"}",
")",
",",
"type",
":",
"FILTERS",
".",
"EXISTS",
",",
"negate",
":",
"true",
",",
"}",
";",
"export",
"const",
"FILTER_OPERATORS",
"=",
"[",
"isOperator",
",",
"isNotOperator",
",",
"isOneOfOperator",
",",
"isNotOneOfOperator",
",",
"isBetweenOperator",
",",
"isNotBetweenOperator",
",",
"existsOperator",
",",
"doesNotExistOperator",
",",
"]",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
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,
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,
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,
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,
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,
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,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661224 | [
"import",
"{",
"EuiComboBox",
",",
"EuiComboBoxOptionOption",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"React",
"from",
"'react'",
";",
"export",
"interface",
"GenericComboBoxProps",
"<",
"T",
">",
"{",
"options",
":",
"T",
"[",
"]",
";",
"selectedOptions",
":",
"T",
"[",
"]",
";",
"getLabel",
":",
"(",
"value",
":",
"T",
")",
"=>",
"string",
";",
"onChange",
":",
"(",
"values",
":",
"T",
"[",
"]",
")",
"=>",
"void",
";",
"[",
"propName",
"]",
":",
"any",
";",
"}",
"/**\n * A generic combo box. Instead of accepting a set of options that contain a `label`, it accepts\n * any type of object. It also accepts a `getLabel` function that each object will be sent through\n * to get the label to be passed to the combo box. The `onChange` will trigger with the actual\n * selected objects, rather than an option object.\n */",
"export",
"function",
"GenericComboBox",
"<",
"T",
">",
"(",
"props",
")",
"{",
"const",
"{",
"options",
",",
"selectedOptions",
",",
"getLabel",
",",
"onChange",
",",
"...",
"otherProps",
"}",
"=",
"props",
";",
"const",
"labels",
"=",
"options",
".",
"map",
"(",
"getLabel",
")",
";",
"const",
"euiOptions",
"=",
"labels",
".",
"map",
"(",
"(",
"label",
")",
"=>",
"(",
"{",
"label",
"}",
")",
")",
";",
"const",
"selectedEuiOptions",
"=",
"selectedOptions",
".",
"filter",
"(",
"(",
"option",
")",
"=>",
"{",
"return",
"options",
".",
"indexOf",
"(",
"option",
")",
"!==",
"-",
"1",
";",
"}",
")",
".",
"map",
"(",
"(",
"option",
")",
"=>",
"{",
"return",
"euiOptions",
"[",
"options",
".",
"indexOf",
"(",
"option",
")",
"]",
";",
"}",
")",
";",
"const",
"onComboBoxChange",
"=",
"(",
"newOptions",
")",
"=>",
"{",
"const",
"newValues",
"=",
"newOptions",
".",
"map",
"(",
"(",
"{",
"label",
"}",
")",
"=>",
"{",
"return",
"options",
"[",
"labels",
".",
"indexOf",
"(",
"label",
")",
"]",
";",
"}",
")",
";",
"onChange",
"(",
"newValues",
")",
";",
"}",
";",
"return",
"(",
"<",
"EuiComboBox",
"options",
"=",
"{",
"euiOptions",
"}",
"selectedOptions",
"=",
"{",
"selectedEuiOptions",
"}",
"onChange",
"=",
"{",
"onComboBoxChange",
"}",
"sortMatchesBy",
"=",
"\"startsWith\"",
"{",
"...",
"otherProps",
"}",
"/>);",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4418,
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,
5,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
11,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
null,
5,
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
] |
661225 | [
"import",
"dateMath",
"from",
"'@elastic/datemath'",
";",
"import",
"{",
"FILTER_OPERATORS",
",",
"Operator",
"}",
"from",
"'./filter_operators'",
";",
"import",
"{",
"CidrMask",
",",
"isFilterable",
",",
"IIndexPattern",
",",
"IFieldType",
",",
"Ipv4Address",
",",
"Filter",
",",
"FieldFilter",
",",
"}",
"from",
"'../../../../../common'",
";",
"export",
"function",
"getFieldFromFilter",
"(",
"filter",
",",
"indexPattern",
")",
"{",
"return",
"indexPattern",
".",
"fields",
".",
"find",
"(",
"(",
"field",
")",
"=>",
"field",
".",
"name",
"===",
"filter",
".",
"meta",
".",
"key",
")",
";",
"}",
"export",
"function",
"getOperatorFromFilter",
"(",
"filter",
")",
"{",
"return",
"FILTER_OPERATORS",
".",
"find",
"(",
"(",
"operator",
")",
"=>",
"{",
"return",
"filter",
".",
"meta",
".",
"type",
"===",
"operator",
".",
"type",
"&&",
"filter",
".",
"meta",
".",
"negate",
"===",
"operator",
".",
"negate",
";",
"}",
")",
";",
"}",
"export",
"function",
"getFilterableFields",
"(",
"indexPattern",
")",
"{",
"return",
"indexPattern",
".",
"fields",
".",
"filter",
"(",
"isFilterable",
")",
";",
"}",
"export",
"function",
"getOperatorOptions",
"(",
"field",
")",
"{",
"return",
"FILTER_OPERATORS",
".",
"filter",
"(",
"(",
"operator",
")",
"=>",
"{",
"return",
"!",
"operator",
".",
"fieldTypes",
"||",
"operator",
".",
"fieldTypes",
".",
"includes",
"(",
"field",
".",
"type",
")",
";",
"}",
")",
";",
"}",
"export",
"function",
"validateParams",
"(",
"params",
",",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"'date'",
":",
"const",
"moment",
"=",
"typeof",
"params",
"===",
"'string'",
"?",
"dateMath",
".",
"parse",
"(",
"params",
")",
":",
"null",
";",
"return",
"Boolean",
"(",
"typeof",
"params",
"===",
"'string'",
"&&",
"moment",
"&&",
"moment",
".",
"isValid",
"(",
")",
")",
";",
"case",
"'ip'",
":",
"try",
"{",
"return",
"params",
".",
"includes",
"(",
"'/'",
")",
"?",
"Boolean",
"(",
"new",
"CidrMask",
"(",
"params",
")",
")",
":",
"Boolean",
"(",
"new",
"Ipv4Address",
"(",
"params",
")",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"return",
"false",
";",
"}",
"default",
":",
"return",
"true",
";",
"}",
"}",
"export",
"function",
"isFilterValid",
"(",
"indexPattern",
"?",
",",
"field",
"?",
",",
"operator",
"?",
",",
"params",
"?",
")",
"{",
"if",
"(",
"!",
"indexPattern",
"||",
"!",
"field",
"||",
"!",
"operator",
")",
"{",
"return",
"false",
";",
"}",
"switch",
"(",
"operator",
".",
"type",
")",
"{",
"case",
"'phrase'",
":",
"return",
"validateParams",
"(",
"params",
",",
"field",
".",
"type",
")",
";",
"case",
"'phrases'",
":",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"params",
")",
"||",
"!",
"params",
".",
"length",
")",
"{",
"return",
"false",
";",
"}",
"return",
"params",
".",
"every",
"(",
"(",
"phrase",
")",
"=>",
"validateParams",
"(",
"phrase",
",",
"field",
".",
"type",
")",
")",
";",
"case",
"'range'",
":",
"if",
"(",
"typeof",
"params",
"!==",
"'object'",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"(",
"!",
"params",
".",
"from",
"||",
"validateParams",
"(",
"params",
".",
"from",
",",
"field",
".",
"type",
")",
")",
"&&",
"(",
"!",
"params",
".",
"to",
"||",
"validateParams",
"(",
"params",
".",
"to",
",",
"field",
".",
"type",
")",
")",
")",
";",
"case",
"'exists'",
":",
"return",
"true",
";",
"default",
":",
"throw",
"new",
"Error",
"(",
"`Unknown operator type: ${",
"operator",
".",
"type",
"}`",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
680,
null,
8183,
null,
737,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
680,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
158,
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,
737,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
680,
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,
8,
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,
8,
null,
737,
null,
null,
680,
null,
null,
1172,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661226 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"debounce",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"withOpenSearchDashboards",
",",
"OpenSearchDashboardsReactContextValue",
",",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"IDataPluginServices",
",",
"IIndexPattern",
",",
"IFieldType",
"}",
"from",
"'../../..'",
";",
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../../common'",
";",
"export",
"interface",
"PhraseSuggestorProps",
"{",
"opensearchDashboards",
":",
"OpenSearchDashboardsReactContextValue",
"<",
"IDataPluginServices",
">",
";",
"indexPattern",
":",
"IIndexPattern",
";",
"field",
"?",
":",
"IFieldType",
";",
"}",
"export",
"interface",
"PhraseSuggestorState",
"{",
"suggestions",
":",
"string",
"[",
"]",
";",
"isLoading",
":",
"boolean",
";",
"}",
"/**\n * Since both \"phrase\" and \"phrases\" filter inputs suggest values (if enabled and the field is\n * aggregatable), we pull out the common logic for requesting suggestions into this component\n * which both of them extend.\n */",
"export",
"class",
"PhraseSuggestorUI",
"<",
"T",
"extends",
"PhraseSuggestorProps",
">",
"extends",
"React",
".",
"Component",
"<",
"T",
",",
"PhraseSuggestorState",
">",
"{",
"private",
"services",
"=",
"this",
".",
"props",
".",
"opensearchDashboards",
".",
"services",
";",
"private",
"abortController",
"?",
":",
"AbortController",
";",
"public",
"state",
":",
"PhraseSuggestorState",
"=",
"{",
"suggestions",
":",
"[",
"]",
",",
"isLoading",
":",
"false",
",",
"}",
";",
"public",
"componentDidMount",
"(",
")",
"{",
"this",
".",
"updateSuggestions",
"(",
")",
";",
"}",
"public",
"componentWillUnmount",
"(",
")",
"{",
"if",
"(",
"this",
".",
"abortController",
")",
"this",
".",
"abortController",
".",
"abort",
"(",
")",
";",
"}",
"protected",
"isSuggestingValues",
"(",
")",
"{",
"const",
"shouldSuggestValues",
"=",
"this",
".",
"services",
".",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"FILTERS_EDITOR_SUGGEST_VALUES",
")",
";",
"const",
"{",
"field",
"}",
"=",
"this",
".",
"props",
";",
"return",
"shouldSuggestValues",
"&&",
"field",
"&&",
"field",
".",
"aggregatable",
"&&",
"field",
".",
"type",
"===",
"'string'",
";",
"}",
"protected",
"onSearchChange",
"=",
"(",
"value",
")",
"=>",
"{",
"this",
".",
"updateSuggestions",
"(",
"`${",
"value",
"}`",
")",
";",
"}",
";",
"protected",
"updateSuggestions",
"=",
"debounce",
"(",
"async",
"(",
"query",
"=",
"''",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"abortController",
")",
"this",
".",
"abortController",
".",
"abort",
"(",
")",
";",
"this",
".",
"abortController",
"=",
"new",
"AbortController",
"(",
")",
";",
"const",
"{",
"indexPattern",
",",
"field",
"}",
"=",
"this",
".",
"props",
"as",
"PhraseSuggestorProps",
";",
"if",
"(",
"!",
"field",
"||",
"!",
"this",
".",
"isSuggestingValues",
"(",
")",
")",
"{",
"return",
";",
"}",
"this",
".",
"setState",
"(",
"{",
"isLoading",
":",
"true",
"}",
")",
";",
"const",
"suggestions",
"=",
"await",
"this",
".",
"services",
".",
"data",
".",
"autocomplete",
".",
"getValueSuggestions",
"(",
"{",
"indexPattern",
",",
"field",
",",
"query",
",",
"signal",
":",
"this",
".",
"abortController",
".",
"signal",
",",
"}",
")",
";",
"this",
".",
"setState",
"(",
"{",
"suggestions",
",",
"isLoading",
":",
"false",
"}",
")",
";",
"}",
",",
"500",
")",
";",
"}",
"export",
"const",
"PhraseSuggestor",
"=",
"withOpenSearchDashboards",
"(",
"PhraseSuggestorUI",
"as",
"any",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4,
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,
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
] |
661227 | [
"import",
"{",
"EuiFieldNumber",
",",
"EuiFieldText",
",",
"EuiSelect",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"InjectedIntl",
",",
"injectI18n",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"isEmpty",
"}",
"from",
"'lodash'",
";",
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"{",
"validateParams",
"}",
"from",
"'./lib/filter_editor_utils'",
";",
"interface",
"Props",
"{",
"value",
"?",
":",
"string",
"|",
"number",
";",
"type",
":",
"string",
";",
"onChange",
":",
"(",
"value",
":",
"string",
"|",
"number",
"|",
"boolean",
")",
"=>",
"void",
";",
"onBlur",
"?",
":",
"(",
"value",
":",
"string",
"|",
"number",
"|",
"boolean",
")",
"=>",
"void",
";",
"fullWidth",
"?",
":",
"boolean",
";",
"placeholder",
":",
"string",
";",
"intl",
":",
"InjectedIntl",
";",
"controlOnly",
"?",
":",
"boolean",
";",
"className",
"?",
":",
"string",
";",
"}",
"class",
"ValueInputTypeUI",
"extends",
"Component",
"<",
"Props",
">",
"{",
"public",
"render",
"(",
")",
"{",
"const",
"value",
"=",
"this",
".",
"props",
".",
"value",
";",
"let",
"inputElement",
";",
"switch",
"(",
"this",
".",
"props",
".",
"type",
")",
"{",
"case",
"'string'",
":",
"inputElement",
"=",
"(",
"<",
"EuiFieldText",
"fullWidth",
"=",
"{",
"this",
".",
"props",
".",
"fullWidth",
"}",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"placeholder",
"}",
"value",
"=",
"{",
"value",
"}",
"onChange",
"=",
"{",
"this",
".",
"onChange",
"}",
"controlOnly",
"=",
"{",
"this",
".",
"props",
".",
"controlOnly",
"}",
"className",
"=",
"{",
"this",
".",
"props",
".",
"className",
"}",
"/",
">",
")",
";",
"break",
";",
"case",
"'number'",
":",
"inputElement",
"=",
"(",
"<",
"EuiFieldNumber",
"fullWidth",
"=",
"{",
"this",
".",
"props",
".",
"fullWidth",
"}",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"placeholder",
"}",
"value",
"=",
"{",
"typeof",
"value",
"===",
"'string'",
"?",
"parseFloat",
"(",
"value",
")",
":",
"value",
"}",
"onChange",
"=",
"{",
"this",
".",
"onChange",
"}",
"controlOnly",
"=",
"{",
"this",
".",
"props",
".",
"controlOnly",
"}",
"className",
"=",
"{",
"this",
".",
"props",
".",
"className",
"}",
"/",
">",
")",
";",
"break",
";",
"case",
"'date'",
":",
"inputElement",
"=",
"(",
"<",
"EuiFieldText",
"fullWidth",
"=",
"{",
"this",
".",
"props",
".",
"fullWidth",
"}",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"placeholder",
"}",
"value",
"=",
"{",
"value",
"}",
"onChange",
"=",
"{",
"this",
".",
"onChange",
"}",
"onBlur",
"=",
"{",
"this",
".",
"onBlur",
"}",
"isInvalid",
"=",
"{",
"!",
"isEmpty",
"(",
"value",
")",
"&&",
"!",
"validateParams",
"(",
"value",
",",
"this",
".",
"props",
".",
"type",
")",
"}",
"controlOnly",
"=",
"{",
"this",
".",
"props",
".",
"controlOnly",
"}",
"className",
"=",
"{",
"this",
".",
"props",
".",
"className",
"}",
"/",
">",
")",
";",
"break",
";",
"case",
"'ip'",
":",
"inputElement",
"=",
"(",
"<",
"EuiFieldText",
"fullWidth",
"=",
"{",
"this",
".",
"props",
".",
"fullWidth",
"}",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"placeholder",
"}",
"value",
"=",
"{",
"value",
"}",
"onChange",
"=",
"{",
"this",
".",
"onChange",
"}",
"isInvalid",
"=",
"{",
"!",
"isEmpty",
"(",
"value",
")",
"&&",
"!",
"validateParams",
"(",
"value",
",",
"this",
".",
"props",
".",
"type",
")",
"}",
"controlOnly",
"=",
"{",
"this",
".",
"props",
".",
"controlOnly",
"}",
"className",
"=",
"{",
"this",
".",
"props",
".",
"className",
"}",
"/",
">",
")",
";",
"break",
";",
"case",
"'boolean'",
":",
"inputElement",
"=",
"(",
"<",
"EuiSelect",
"fullWidth",
"=",
"{",
"this",
".",
"props",
".",
"fullWidth",
"}",
"options",
"=",
"{",
"[",
"{",
"value",
":",
"undefined",
",",
"text",
":",
"this",
".",
"props",
".",
"placeholder",
"}",
",",
"{",
"value",
":",
"'true'",
",",
"text",
":",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.trueOptionLabel'",
",",
"defaultMessage",
":",
"'true'",
",",
"}",
")",
",",
"}",
",",
"{",
"value",
":",
"'false'",
",",
"text",
":",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.falseOptionLabel'",
",",
"defaultMessage",
":",
"'false'",
",",
"}",
")",
",",
"}",
",",
"]",
"}",
"value",
"=",
"{",
"value",
"}",
"onChange",
"=",
"{",
"this",
".",
"onBoolChange",
"}",
"className",
"=",
"{",
"this",
".",
"props",
".",
"className",
"}",
"/",
">",
")",
";",
"break",
";",
"default",
":",
"break",
";",
"}",
"return",
"inputElement",
";",
"}",
"private",
"onBoolChange",
"=",
"(",
"event",
")",
"=>",
"{",
"const",
"boolValue",
"=",
"event",
".",
"target",
".",
"value",
"===",
"'true'",
";",
"this",
".",
"props",
".",
"onChange",
"(",
"boolValue",
")",
";",
"}",
";",
"private",
"onChange",
"=",
"(",
"event",
")",
"=>",
"{",
"const",
"params",
"=",
"event",
".",
"target",
".",
"value",
";",
"this",
".",
"props",
".",
"onChange",
"(",
"params",
")",
";",
"}",
";",
"private",
"onBlur",
"=",
"(",
"event",
")",
"=>",
"{",
"if",
"(",
"this",
".",
"props",
".",
"onBlur",
")",
"{",
"const",
"params",
"=",
"event",
".",
"target",
".",
"value",
";",
"this",
".",
"props",
".",
"onBlur",
"(",
"params",
")",
";",
"}",
"}",
";",
"}",
"export",
"const",
"ValueInputType",
"=",
"injectI18n",
"(",
"ValueInputTypeUI",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
154,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
105,
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,
105,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
105,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661228 | [
"import",
"{",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"InjectedIntl",
",",
"injectI18n",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"uniq",
"}",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"GenericComboBox",
",",
"GenericComboBoxProps",
"}",
"from",
"'./generic_combo_box'",
";",
"import",
"{",
"PhraseSuggestorUI",
",",
"PhraseSuggestorProps",
"}",
"from",
"'./phrase_suggestor'",
";",
"import",
"{",
"ValueInputType",
"}",
"from",
"'./value_input_type'",
";",
"import",
"{",
"withOpenSearchDashboards",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"interface",
"Props",
"extends",
"PhraseSuggestorProps",
"{",
"value",
"?",
":",
"string",
";",
"onChange",
":",
"(",
"value",
":",
"string",
"|",
"number",
"|",
"boolean",
")",
"=>",
"void",
";",
"intl",
":",
"InjectedIntl",
";",
"}",
"class",
"PhraseValueInputUI",
"extends",
"PhraseSuggestorUI",
"<",
"Props",
">",
"{",
"public",
"render",
"(",
")",
"{",
"return",
"(",
"<",
"EuiFormRow",
"fullWidth",
"=",
"{",
"true",
"}",
"label",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.valueInputLabel'",
",",
"defaultMessage",
":",
"'Value'",
",",
"}",
")",
"}",
">",
"{",
"this",
".",
"isSuggestingValues",
"(",
")",
"?",
"(",
"this",
".",
"renderWithSuggestions",
"(",
")",
")",
":",
"(",
"<",
"ValueInputType",
"fullWidth",
"=",
"{",
"true",
"}",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.valueInputPlaceholder'",
",",
"defaultMessage",
":",
"'Enter a value'",
",",
"}",
")",
"}",
"value",
"=",
"{",
"this",
".",
"props",
".",
"value",
"}",
"onChange",
"=",
"{",
"this",
".",
"props",
".",
"onChange",
"}",
"type",
"=",
"{",
"this",
".",
"props",
".",
"field",
"?",
"this",
".",
"props",
".",
"field",
".",
"type",
":",
"'string'",
"}",
"/",
">",
")",
"}",
"<",
"/EuiFormRow>);",
"}",
"private",
"renderWithSuggestions",
"(",
")",
"{",
"const",
"{",
"suggestions",
"}",
"=",
"this",
".",
"state",
";",
"const",
"{",
"value",
",",
"intl",
",",
"onChange",
"}",
"=",
"this",
".",
"props",
";",
"const",
"valueAsStr",
"=",
"String",
"(",
"value",
")",
";",
"const",
"options",
"=",
"value",
"?",
"uniq",
"(",
"[",
"valueAsStr",
",",
"...",
"suggestions",
"]",
")",
":",
"suggestions",
";",
"return",
"(",
"<",
"StringComboBox",
"placeholder",
"=",
"{",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.valueSelectPlaceholder'",
",",
"defaultMessage",
":",
"'Select a value'",
",",
"}",
")",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"options",
"=",
"{",
"options",
"}",
"getLabel",
"=",
"{",
"(",
"option",
")",
"=>",
"option",
"}",
"selectedOptions",
"=",
"{",
"value",
"?",
"[",
"valueAsStr",
"]",
":",
"[",
"]",
"}",
"onChange",
"=",
"{",
"(",
"[",
"newValue",
"=",
"''",
"]",
")",
"=>",
"onChange",
"(",
"newValue",
")",
"}",
"onSearchChange",
"=",
"{",
"this",
".",
"onSearchChange",
"}",
"singleSelection",
"=",
"{",
"{",
"asPlainText",
":",
"true",
"}",
"}",
"onCreateOption",
"=",
"{",
"onChange",
"}",
"isClearable",
"=",
"{",
"false",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterParamsComboBox phraseParamsComboxBox\"",
"/",
">",
")",
";",
"}",
"}",
"function",
"StringComboBox",
"(",
"props",
")",
"{",
"return",
"GenericComboBox",
"(",
"props",
")",
";",
"}",
"export",
"const",
"PhraseValueInput",
"=",
"injectI18n",
"(",
"withOpenSearchDashboards",
"(",
"PhraseValueInputUI",
")",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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
] |
661229 | [
"import",
"{",
"EuiFormRow",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"InjectedIntl",
",",
"injectI18n",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"uniq",
"}",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"GenericComboBox",
",",
"GenericComboBoxProps",
"}",
"from",
"'./generic_combo_box'",
";",
"import",
"{",
"PhraseSuggestorUI",
",",
"PhraseSuggestorProps",
"}",
"from",
"'./phrase_suggestor'",
";",
"import",
"{",
"withOpenSearchDashboards",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"interface",
"Props",
"extends",
"PhraseSuggestorProps",
"{",
"values",
"?",
":",
"string",
"[",
"]",
";",
"onChange",
":",
"(",
"values",
":",
"string",
"[",
"]",
")",
"=>",
"void",
";",
"intl",
":",
"InjectedIntl",
";",
"}",
"class",
"PhrasesValuesInputUI",
"extends",
"PhraseSuggestorUI",
"<",
"Props",
">",
"{",
"public",
"render",
"(",
")",
"{",
"const",
"{",
"suggestions",
"}",
"=",
"this",
".",
"state",
";",
"const",
"{",
"values",
",",
"intl",
",",
"onChange",
"}",
"=",
"this",
".",
"props",
";",
"const",
"options",
"=",
"values",
"?",
"uniq",
"(",
"[",
"...",
"values",
",",
"...",
"suggestions",
"]",
")",
":",
"suggestions",
";",
"return",
"(",
"<",
"EuiFormRow",
"fullWidth",
"=",
"{",
"true",
"}",
"label",
"=",
"{",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.valuesSelectLabel'",
",",
"defaultMessage",
":",
"'Values'",
",",
"}",
")",
"}",
">",
"<",
"StringComboBox",
"placeholder",
"=",
"{",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.valuesSelectPlaceholder'",
",",
"defaultMessage",
":",
"'Select values'",
",",
"}",
")",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
"options",
"=",
"{",
"options",
"}",
"getLabel",
"=",
"{",
"(",
"option",
")",
"=>",
"option",
"}",
"selectedOptions",
"=",
"{",
"values",
"||",
"[",
"]",
"}",
"onSearchChange",
"=",
"{",
"this",
".",
"onSearchChange",
"}",
"onCreateOption",
"=",
"{",
"(",
"option",
")",
"=>",
"onChange",
"(",
"[",
"...",
"(",
"values",
"||",
"[",
"]",
")",
",",
"option",
"]",
")",
"}",
"onChange",
"=",
"{",
"onChange",
"}",
"isClearable",
"=",
"{",
"false",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterParamsComboBox phrasesParamsComboxBox\"",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"}",
"function",
"StringComboBox",
"(",
"props",
")",
"{",
"return",
"GenericComboBox",
"(",
"props",
")",
";",
"}",
"export",
"const",
"PhrasesValuesInput",
"=",
"injectI18n",
"(",
"withOpenSearchDashboards",
"(",
"PhrasesValuesInputUI",
")",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661230 | [
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"EuiFormControlLayoutDelimited",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"InjectedIntl",
",",
"injectI18n",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"useOpenSearchDashboards",
"}",
"from",
"'../../../../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"IFieldType",
"}",
"from",
"'../../..'",
";",
"import",
"{",
"ValueInputType",
"}",
"from",
"'./value_input_type'",
";",
"interface",
"RangeParams",
"{",
"from",
":",
"number",
"|",
"string",
";",
"to",
":",
"number",
"|",
"string",
";",
"}",
"type",
"RangeParamsPartial",
"=",
"Partial",
"<",
"RangeParams",
">",
";",
"interface",
"Props",
"{",
"field",
"?",
":",
"IFieldType",
";",
"value",
"?",
":",
"RangeParams",
";",
"onChange",
":",
"(",
"params",
":",
"RangeParamsPartial",
")",
"=>",
"void",
";",
"intl",
":",
"InjectedIntl",
";",
"}",
"function",
"RangeValueInputUI",
"(",
"props",
")",
"{",
"const",
"opensearchDashboards",
"=",
"useOpenSearchDashboards",
"(",
")",
";",
"const",
"type",
"=",
"props",
".",
"field",
"?",
"props",
".",
"field",
".",
"type",
":",
"'string'",
";",
"const",
"tzConfig",
"=",
"opensearchDashboards",
".",
"services",
".",
"uiSettings",
"!",
".",
"get",
"(",
"'dateFormat:tz'",
")",
";",
"const",
"formatDateChange",
"=",
"(",
"value",
")",
"=>",
"{",
"if",
"(",
"typeof",
"value",
"!==",
"'string'",
"&&",
"typeof",
"value",
"!==",
"'number'",
")",
"return",
"value",
";",
"const",
"momentParsedValue",
"=",
"moment",
"(",
"value",
")",
".",
"tz",
"(",
"tzConfig",
")",
";",
"if",
"(",
"momentParsedValue",
".",
"isValid",
"(",
")",
")",
"return",
"momentParsedValue",
"?.",
"format",
"(",
"'YYYY-MM-DDTHH:mm:ss.SSSZ'",
")",
";",
"return",
"value",
";",
"}",
";",
"const",
"onFromChange",
"=",
"(",
"value",
")",
"=>",
"{",
"if",
"(",
"typeof",
"value",
"!==",
"'string'",
"&&",
"typeof",
"value",
"!==",
"'number'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Range params must be a string or number'",
")",
";",
"}",
"props",
".",
"onChange",
"(",
"{",
"from",
":",
"value",
",",
"to",
":",
"get",
"(",
"props",
",",
"'value.to'",
")",
"}",
")",
";",
"}",
";",
"const",
"onToChange",
"=",
"(",
"value",
")",
"=>",
"{",
"if",
"(",
"typeof",
"value",
"!==",
"'string'",
"&&",
"typeof",
"value",
"!==",
"'number'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Range params must be a string or number'",
")",
";",
"}",
"props",
".",
"onChange",
"(",
"{",
"from",
":",
"get",
"(",
"props",
",",
"'value.from'",
")",
",",
"to",
":",
"value",
"}",
")",
";",
"}",
";",
"return",
"(",
"<",
"div",
">",
"<",
"EuiFormControlLayoutDelimited",
"fullWidth",
"=",
"{",
"true",
"}",
"aria",
"-",
"label",
"=",
"{",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.rangeInputLabel'",
",",
"defaultMessage",
":",
"'Range'",
",",
"}",
")",
"}",
"startControl",
"=",
"{",
"<",
"ValueInputType",
"controlOnly",
"type",
"=",
"{",
"type",
"}",
"value",
"=",
"{",
"props",
".",
"value",
"?",
"props",
".",
"value",
".",
"from",
":",
"undefined",
"}",
"onChange",
"=",
"{",
"onFromChange",
"}",
"onBlur",
"=",
"{",
"(",
"value",
")",
"=>",
"{",
"onFromChange",
"(",
"formatDateChange",
"(",
"value",
")",
")",
";",
"}",
"}",
"placeholder",
"=",
"{",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.rangeStartInputPlaceholder'",
",",
"defaultMessage",
":",
"'Start of the range'",
",",
"}",
")",
"}",
"/",
">",
"}",
"endControl",
"=",
"{",
"<",
"ValueInputType",
"controlOnly",
"type",
"=",
"{",
"type",
"}",
"value",
"=",
"{",
"props",
".",
"value",
"?",
"props",
".",
"value",
".",
"to",
":",
"undefined",
"}",
"onChange",
"=",
"{",
"onToChange",
"}",
"onBlur",
"=",
"{",
"(",
"value",
")",
"=>",
"{",
"onToChange",
"(",
"formatDateChange",
"(",
"value",
")",
")",
";",
"}",
"}",
"placeholder",
"=",
"{",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.rangeEndInputPlaceholder'",
",",
"defaultMessage",
":",
"'End of the range'",
",",
"}",
")",
"}",
"/",
">",
"}",
"/>",
"<",
"/div>);",
"}",
"export",
"const",
"RangeValueInput",
"=",
"injectI18n",
"(",
"RangeValueInputUI",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4680,
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,
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,
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
] |
661231 | [
"import",
"{",
"EuiButton",
",",
"EuiButtonEmpty",
",",
"EuiCodeEditor",
",",
"EuiFieldText",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiForm",
",",
"EuiFormRow",
",",
"EuiPopoverTitle",
",",
"EuiSpacer",
",",
"EuiSwitch",
",",
"EuiSwitchEvent",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
",",
"InjectedIntl",
",",
"injectI18n",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"{",
"GenericComboBox",
",",
"GenericComboBoxProps",
"}",
"from",
"'./generic_combo_box'",
";",
"import",
"{",
"getFieldFromFilter",
",",
"getFilterableFields",
",",
"getOperatorFromFilter",
",",
"getOperatorOptions",
",",
"isFilterValid",
",",
"}",
"from",
"'./lib/filter_editor_utils'",
";",
"import",
"{",
"Operator",
"}",
"from",
"'./lib/filter_operators'",
";",
"import",
"{",
"PhraseValueInput",
"}",
"from",
"'./phrase_value_input'",
";",
"import",
"{",
"PhrasesValuesInput",
"}",
"from",
"'./phrases_values_input'",
";",
"import",
"{",
"RangeValueInput",
"}",
"from",
"'./range_value_input'",
";",
"import",
"{",
"IIndexPattern",
",",
"IFieldType",
"}",
"from",
"'../../..'",
";",
"import",
"{",
"Filter",
",",
"getIndexPatternFromFilter",
",",
"FieldFilter",
",",
"buildFilter",
",",
"buildCustomFilter",
",",
"cleanFilter",
",",
"getFilterParams",
",",
"}",
"from",
"'../../../../common'",
";",
"interface",
"Props",
"{",
"filter",
":",
"Filter",
";",
"indexPatterns",
":",
"IIndexPattern",
"[",
"]",
";",
"onSubmit",
":",
"(",
"filter",
":",
"Filter",
")",
"=>",
"void",
";",
"onCancel",
":",
"(",
")",
"=>",
"void",
";",
"intl",
":",
"InjectedIntl",
";",
"}",
"interface",
"State",
"{",
"selectedIndexPattern",
"?",
":",
"IIndexPattern",
";",
"selectedField",
"?",
":",
"IFieldType",
";",
"selectedOperator",
"?",
":",
"Operator",
";",
"params",
":",
"any",
";",
"useCustomLabel",
":",
"boolean",
";",
"customLabel",
":",
"string",
"|",
"null",
";",
"queryDsl",
":",
"string",
";",
"isCustomEditorOpen",
":",
"boolean",
";",
"}",
"class",
"FilterEditorUI",
"extends",
"Component",
"<",
"Props",
",",
"State",
">",
"{",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"this",
".",
"state",
"=",
"{",
"selectedIndexPattern",
":",
"this",
".",
"getIndexPatternFromFilter",
"(",
")",
",",
"selectedField",
":",
"this",
".",
"getFieldFromFilter",
"(",
")",
",",
"selectedOperator",
":",
"this",
".",
"getSelectedOperator",
"(",
")",
",",
"params",
":",
"getFilterParams",
"(",
"props",
".",
"filter",
")",
",",
"useCustomLabel",
":",
"props",
".",
"filter",
".",
"meta",
".",
"alias",
"!==",
"null",
",",
"customLabel",
":",
"props",
".",
"filter",
".",
"meta",
".",
"alias",
",",
"queryDsl",
":",
"JSON",
".",
"stringify",
"(",
"cleanFilter",
"(",
"props",
".",
"filter",
")",
",",
"null",
",",
"2",
")",
",",
"isCustomEditorOpen",
":",
"this",
".",
"isUnknownFilterType",
"(",
")",
",",
"}",
";",
"}",
"public",
"render",
"(",
")",
"{",
"return",
"(",
"<",
"div",
">",
"<",
"EuiPopoverTitle",
">",
"<",
"EuiFlexGroup",
"alignItems",
"=",
"\"baseline\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"data.filter.filterEditor.editFilterPopupTitle\"",
"defaultMessage",
"=",
"\"Edit filter\"",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
"className",
"=",
"\"filterEditor__hiddenItem\"",
"/",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButtonEmpty",
"size",
"=",
"\"xs\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"editQueryDSL\"",
"onClick",
"=",
"{",
"this",
".",
"toggleCustomEditor",
"}",
">",
"{",
"this",
".",
"state",
".",
"isCustomEditorOpen",
"?",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"data.filter.filterEditor.editFilterValuesButtonLabel\"",
"defaultMessage",
"=",
"\"Edit filter values\"",
"/",
">",
")",
":",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"data.filter.filterEditor.editQueryDslButtonLabel\"",
"defaultMessage",
"=",
"\"Edit as Query DSL\"",
"/",
">",
")",
"}",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"/EuiPopoverTitle>",
"<",
"div",
"className",
"=",
"\"globalFilterItem__editorForm\"",
">",
"<",
"EuiForm",
">",
"{",
"this",
".",
"renderIndexPatternInput",
"(",
")",
"}",
"{",
"this",
".",
"state",
".",
"isCustomEditorOpen",
"?",
"this",
".",
"renderCustomEditor",
"(",
")",
":",
"this",
".",
"renderRegularEditor",
"(",
")",
"}",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"EuiSwitch",
"id",
"=",
"\"filterEditorCustomLabelSwitch\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"createCustomLabel\"",
"label",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.createCustomLabelSwitchLabel'",
",",
"defaultMessage",
":",
"'Create custom label?'",
",",
"}",
")",
"}",
"checked",
"=",
"{",
"this",
".",
"state",
".",
"useCustomLabel",
"}",
"onChange",
"=",
"{",
"this",
".",
"onCustomLabelSwitchChange",
"}",
"/",
">",
"{",
"this",
".",
"state",
".",
"useCustomLabel",
"&&",
"(",
"<",
"div",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/>",
"<",
"EuiFormRow",
"fullWidth",
"=",
"{",
"true",
"}",
"label",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.createCustomLabelInputLabel'",
",",
"defaultMessage",
":",
"'Custom label'",
",",
"}",
")",
"}",
">",
"<",
"EuiFieldText",
"fullWidth",
"=",
"{",
"true",
"}",
"value",
"=",
"{",
"`${",
"this",
".",
"state",
".",
"customLabel",
"}`",
"}",
"onChange",
"=",
"{",
"this",
".",
"onCustomLabelChange",
"}",
"/",
">",
"<",
"/EuiFormRow>",
"<",
"/div>)}",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"EuiFlexGroup",
"direction",
"=",
"\"rowReverse\"",
"alignItems",
"=",
"\"center\"",
"responsive",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButton",
"fill",
"onClick",
"=",
"{",
"this",
".",
"onSubmit",
"}",
"isDisabled",
"=",
"{",
"!",
"this",
".",
"isFilterValid",
"(",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"saveFilter\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"data.filter.filterEditor.saveButtonLabel\"",
"defaultMessage",
"=",
"\"Save\"",
"/",
">",
"<",
"/EuiButton>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButtonEmpty",
"flush",
"=",
"\"right\"",
"onClick",
"=",
"{",
"this",
".",
"props",
".",
"onCancel",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"cancelSaveFilter\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"data.filter.filterEditor.cancelButtonLabel\"",
"defaultMessage",
"=",
"\"Cancel\"",
"/",
">",
"<",
"/EuiButtonEmpty>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"/",
">",
"<",
"/EuiFlexGroup>",
"<",
"/EuiForm>",
"<",
"/div>",
"<",
"/div>);",
"}",
"private",
"renderIndexPatternInput",
"(",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"indexPatterns",
".",
"length",
"<=",
"1",
"&&",
"this",
".",
"props",
".",
"indexPatterns",
".",
"find",
"(",
"(",
"indexPattern",
")",
"=>",
"indexPattern",
"===",
"this",
".",
"getIndexPatternFromFilter",
"(",
")",
")",
")",
"{",
"/**\n * Don't render the index pattern selector if there's just one \\ zero index patterns\n * and if the index pattern the filter was LOADED with is in the indexPatterns list.\n **/",
"return",
"''",
";",
"}",
"const",
"{",
"selectedIndexPattern",
"}",
"=",
"this",
".",
"state",
";",
"return",
"(",
"<",
"EuiFlexGroup",
">",
"<",
"EuiFlexItem",
">",
"<",
"EuiFormRow",
"label",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.indexPatternSelectLabel'",
",",
"defaultMessage",
":",
"'Index Pattern'",
",",
"}",
")",
"}",
">",
"<",
"IndexPatternComboBox",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterBar.indexPatternSelectPlaceholder'",
",",
"defaultMessage",
":",
"'Select an index pattern'",
",",
"}",
")",
"}",
"options",
"=",
"{",
"this",
".",
"props",
".",
"indexPatterns",
"}",
"selectedOptions",
"=",
"{",
"selectedIndexPattern",
"?",
"[",
"selectedIndexPattern",
"]",
":",
"[",
"]",
"}",
"getLabel",
"=",
"{",
"(",
"indexPattern",
")",
"=>",
"indexPattern",
".",
"title",
"}",
"onChange",
"=",
"{",
"this",
".",
"onIndexPatternChange",
"}",
"singleSelection",
"=",
"{",
"{",
"asPlainText",
":",
"true",
"}",
"}",
"isClearable",
"=",
"{",
"false",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterIndexPatternsSelect\"",
"/",
">",
"<",
"/EuiFormRow>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>);",
"}",
"private",
"renderRegularEditor",
"(",
")",
"{",
"return",
"(",
"<",
"div",
">",
"<",
"EuiFlexGroup",
"responsive",
"=",
"{",
"false",
"}",
"gutterSize",
"=",
"\"s\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"2",
"}",
">",
"{",
"this",
".",
"renderFieldInput",
"(",
")",
"}",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
"style",
"=",
"{",
"{",
"flexBasis",
":",
"160",
"}",
"}",
">",
"{",
"this",
".",
"renderOperatorInput",
"(",
")",
"}",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"div",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterParams\"",
">",
"{",
"this",
".",
"renderParamsEditor",
"(",
")",
"}",
"<",
"/div>",
"<",
"/div>);",
"}",
"private",
"renderFieldInput",
"(",
")",
"{",
"const",
"{",
"selectedIndexPattern",
",",
"selectedField",
"}",
"=",
"this",
".",
"state",
";",
"const",
"fields",
"=",
"selectedIndexPattern",
"?",
"getFilterableFields",
"(",
"selectedIndexPattern",
")",
":",
"[",
"]",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.fieldSelectLabel'",
",",
"defaultMessage",
":",
"'Field'",
",",
"}",
")",
"}",
">",
"<",
"FieldComboBox",
"id",
"=",
"\"fieldInput\"",
"fullWidth",
"=",
"{",
"true",
"}",
"isDisabled",
"=",
"{",
"!",
"selectedIndexPattern",
"}",
"placeholder",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.fieldSelectPlaceholder'",
",",
"defaultMessage",
":",
"'Select a field first'",
",",
"}",
")",
"}",
"options",
"=",
"{",
"fields",
"}",
"selectedOptions",
"=",
"{",
"selectedField",
"?",
"[",
"selectedField",
"]",
":",
"[",
"]",
"}",
"getLabel",
"=",
"{",
"(",
"field",
")",
"=>",
"field",
".",
"name",
"}",
"onChange",
"=",
"{",
"this",
".",
"onFieldChange",
"}",
"singleSelection",
"=",
"{",
"{",
"asPlainText",
":",
"true",
"}",
"}",
"isClearable",
"=",
"{",
"false",
"}",
"className",
"=",
"\"globalFilterEditor__fieldInput\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterFieldSuggestionList\"",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"private",
"renderOperatorInput",
"(",
")",
"{",
"const",
"{",
"selectedField",
",",
"selectedOperator",
"}",
"=",
"this",
".",
"state",
";",
"const",
"operators",
"=",
"selectedField",
"?",
"getOperatorOptions",
"(",
"selectedField",
")",
":",
"[",
"]",
";",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.operatorSelectLabel'",
",",
"defaultMessage",
":",
"'Operator'",
",",
"}",
")",
"}",
">",
"<",
"OperatorComboBox",
"isDisabled",
"=",
"{",
"!",
"selectedField",
"}",
"placeholder",
"=",
"{",
"selectedField",
"?",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.operatorSelectPlaceholderSelect'",
",",
"defaultMessage",
":",
"'Select'",
",",
"}",
")",
":",
"this",
".",
"props",
".",
"intl",
".",
"formatMessage",
"(",
"{",
"id",
":",
"'data.filter.filterEditor.operatorSelectPlaceholderWaiting'",
",",
"defaultMessage",
":",
"'Waiting'",
",",
"}",
")",
"}",
"options",
"=",
"{",
"operators",
"}",
"selectedOptions",
"=",
"{",
"selectedOperator",
"?",
"[",
"selectedOperator",
"]",
":",
"[",
"]",
"}",
"getLabel",
"=",
"{",
"(",
"{",
"message",
"}",
")",
"=>",
"message",
"}",
"onChange",
"=",
"{",
"this",
".",
"onOperatorChange",
"}",
"singleSelection",
"=",
"{",
"{",
"asPlainText",
":",
"true",
"}",
"}",
"isClearable",
"=",
"{",
"false",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterOperatorList\"",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"private",
"renderCustomEditor",
"(",
")",
"{",
"return",
"(",
"<",
"EuiFormRow",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'data.filter.filterEditor.queryDslLabel'",
",",
"{",
"defaultMessage",
":",
"'OpenSearch Query DSL'",
",",
"}",
")",
"}",
"fullWidth",
"=",
"{",
"true",
"}",
">",
"<",
"EuiCodeEditor",
"value",
"=",
"{",
"this",
".",
"state",
".",
"queryDsl",
"}",
"onChange",
"=",
"{",
"this",
".",
"onQueryDslChange",
"}",
"mode",
"=",
"\"json\"",
"width",
"=",
"\"100%\"",
"height",
"=",
"\"250px\"",
"/",
">",
"<",
"/EuiFormRow>);",
"}",
"private",
"renderParamsEditor",
"(",
")",
"{",
"const",
"indexPattern",
"=",
"this",
".",
"state",
".",
"selectedIndexPattern",
";",
"if",
"(",
"!",
"indexPattern",
"||",
"!",
"this",
".",
"state",
".",
"selectedOperator",
")",
"{",
"return",
"''",
";",
"}",
"switch",
"(",
"this",
".",
"state",
".",
"selectedOperator",
".",
"type",
")",
"{",
"case",
"'exists'",
":",
"return",
"''",
";",
"case",
"'phrase'",
":",
"return",
"(",
"<",
"PhraseValueInput",
"indexPattern",
"=",
"{",
"indexPattern",
"}",
"field",
"=",
"{",
"this",
".",
"state",
".",
"selectedField",
"}",
"value",
"=",
"{",
"this",
".",
"state",
".",
"params",
"}",
"onChange",
"=",
"{",
"this",
".",
"onParamsChange",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"phraseValueInput\"",
"/",
">",
")",
";",
"case",
"'phrases'",
":",
"return",
"(",
"<",
"PhrasesValuesInput",
"indexPattern",
"=",
"{",
"indexPattern",
"}",
"field",
"=",
"{",
"this",
".",
"state",
".",
"selectedField",
"}",
"values",
"=",
"{",
"this",
".",
"state",
".",
"params",
"}",
"onChange",
"=",
"{",
"this",
".",
"onParamsChange",
"}",
"/",
">",
")",
";",
"case",
"'range'",
":",
"return",
"(",
"<",
"RangeValueInput",
"field",
"=",
"{",
"this",
".",
"state",
".",
"selectedField",
"}",
"value",
"=",
"{",
"this",
".",
"state",
".",
"params",
"}",
"onChange",
"=",
"{",
"this",
".",
"onParamsChange",
"}",
"/",
">",
")",
";",
"}",
"}",
"private",
"toggleCustomEditor",
"=",
"(",
")",
"=>",
"{",
"const",
"isCustomEditorOpen",
"=",
"!",
"this",
".",
"state",
".",
"isCustomEditorOpen",
";",
"this",
".",
"setState",
"(",
"{",
"isCustomEditorOpen",
"}",
")",
";",
"}",
";",
"private",
"isUnknownFilterType",
"(",
")",
"{",
"const",
"{",
"type",
"}",
"=",
"this",
".",
"props",
".",
"filter",
".",
"meta",
";",
"return",
"!",
"!",
"type",
"&&",
"!",
"[",
"'phrase'",
",",
"'phrases'",
",",
"'range'",
",",
"'exists'",
"]",
".",
"includes",
"(",
"type",
")",
";",
"}",
"private",
"getIndexPatternFromFilter",
"(",
")",
"{",
"return",
"getIndexPatternFromFilter",
"(",
"this",
".",
"props",
".",
"filter",
",",
"this",
".",
"props",
".",
"indexPatterns",
")",
";",
"}",
"private",
"getFieldFromFilter",
"(",
")",
"{",
"const",
"indexPattern",
"=",
"this",
".",
"getIndexPatternFromFilter",
"(",
")",
";",
"return",
"indexPattern",
"&&",
"getFieldFromFilter",
"(",
"this",
".",
"props",
".",
"filter",
"as",
"FieldFilter",
",",
"indexPattern",
")",
";",
"}",
"private",
"getSelectedOperator",
"(",
")",
"{",
"return",
"getOperatorFromFilter",
"(",
"this",
".",
"props",
".",
"filter",
")",
";",
"}",
"private",
"isFilterValid",
"(",
")",
"{",
"const",
"{",
"isCustomEditorOpen",
",",
"queryDsl",
",",
"selectedIndexPattern",
":",
"indexPattern",
",",
"selectedField",
":",
"field",
",",
"selectedOperator",
":",
"operator",
",",
"params",
",",
"}",
"=",
"this",
".",
"state",
";",
"if",
"(",
"isCustomEditorOpen",
")",
"{",
"try",
"{",
"return",
"Boolean",
"(",
"JSON",
".",
"parse",
"(",
"queryDsl",
")",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",
"isFilterValid",
"(",
"indexPattern",
",",
"field",
",",
"operator",
",",
"params",
")",
";",
"}",
"private",
"onIndexPatternChange",
"=",
"(",
"[",
"selectedIndexPattern",
"]",
")",
"=>",
"{",
"const",
"selectedField",
"=",
"undefined",
";",
"const",
"selectedOperator",
"=",
"undefined",
";",
"const",
"params",
"=",
"undefined",
";",
"this",
".",
"setState",
"(",
"{",
"selectedIndexPattern",
",",
"selectedField",
",",
"selectedOperator",
",",
"params",
"}",
")",
";",
"}",
";",
"private",
"onFieldChange",
"=",
"(",
"[",
"selectedField",
"]",
")",
"=>",
"{",
"const",
"selectedOperator",
"=",
"undefined",
";",
"const",
"params",
"=",
"undefined",
";",
"this",
".",
"setState",
"(",
"{",
"selectedField",
",",
"selectedOperator",
",",
"params",
"}",
")",
";",
"}",
";",
"private",
"onOperatorChange",
"=",
"(",
"[",
"selectedOperator",
"]",
")",
"=>",
"{",
"const",
"params",
"=",
"get",
"(",
"this",
".",
"state",
".",
"selectedOperator",
",",
"'type'",
")",
"===",
"get",
"(",
"selectedOperator",
",",
"'type'",
")",
"?",
"this",
".",
"state",
".",
"params",
":",
"undefined",
";",
"this",
".",
"setState",
"(",
"{",
"selectedOperator",
",",
"params",
"}",
")",
";",
"}",
";",
"private",
"onCustomLabelSwitchChange",
"=",
"(",
"event",
")",
"=>",
"{",
"const",
"useCustomLabel",
"=",
"event",
".",
"target",
".",
"checked",
";",
"const",
"customLabel",
"=",
"event",
".",
"target",
".",
"checked",
"?",
"''",
":",
"null",
";",
"this",
".",
"setState",
"(",
"{",
"useCustomLabel",
",",
"customLabel",
"}",
")",
";",
"}",
";",
"private",
"onCustomLabelChange",
"=",
"(",
"event",
")",
"=>",
"{",
"const",
"customLabel",
"=",
"event",
".",
"target",
".",
"value",
";",
"this",
".",
"setState",
"(",
"{",
"customLabel",
"}",
")",
";",
"}",
";",
"private",
"onParamsChange",
"=",
"(",
"params",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"params",
"}",
")",
";",
"}",
";",
"private",
"onQueryDslChange",
"=",
"(",
"queryDsl",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"queryDsl",
"}",
")",
";",
"}",
";",
"private",
"onSubmit",
"=",
"(",
")",
"=>",
"{",
"const",
"{",
"selectedIndexPattern",
":",
"indexPattern",
",",
"selectedField",
":",
"field",
",",
"selectedOperator",
":",
"operator",
",",
"params",
",",
"useCustomLabel",
",",
"customLabel",
",",
"isCustomEditorOpen",
",",
"queryDsl",
",",
"}",
"=",
"this",
".",
"state",
";",
"const",
"{",
"$state",
"}",
"=",
"this",
".",
"props",
".",
"filter",
";",
"if",
"(",
"!",
"$state",
"||",
"!",
"$state",
".",
"store",
")",
"{",
"return",
";",
"}",
"const",
"alias",
"=",
"useCustomLabel",
"?",
"customLabel",
":",
"null",
";",
"if",
"(",
"isCustomEditorOpen",
")",
"{",
"const",
"{",
"index",
",",
"disabled",
",",
"negate",
"}",
"=",
"this",
".",
"props",
".",
"filter",
".",
"meta",
";",
"const",
"newIndex",
"=",
"index",
"||",
"this",
".",
"props",
".",
"indexPatterns",
"[",
"0",
"]",
".",
"id",
"!",
";",
"const",
"body",
"=",
"JSON",
".",
"parse",
"(",
"queryDsl",
")",
";",
"const",
"filter",
"=",
"buildCustomFilter",
"(",
"newIndex",
",",
"body",
",",
"disabled",
",",
"negate",
",",
"alias",
",",
"$state",
".",
"store",
")",
";",
"this",
".",
"props",
".",
"onSubmit",
"(",
"filter",
")",
";",
"}",
"else",
"if",
"(",
"indexPattern",
"&&",
"field",
"&&",
"operator",
")",
"{",
"const",
"filter",
"=",
"buildFilter",
"(",
"indexPattern",
",",
"field",
",",
"operator",
".",
"type",
",",
"operator",
".",
"negate",
",",
"this",
".",
"props",
".",
"filter",
".",
"meta",
".",
"disabled",
",",
"params",
"??",
"''",
",",
"alias",
",",
"$state",
".",
"store",
")",
";",
"this",
".",
"props",
".",
"onSubmit",
"(",
"filter",
")",
";",
"}",
"}",
";",
"}",
"function",
"IndexPatternComboBox",
"(",
"props",
")",
"{",
"return",
"GenericComboBox",
"(",
"props",
")",
";",
"}",
"function",
"FieldComboBox",
"(",
"props",
")",
"{",
"return",
"GenericComboBox",
"(",
"props",
")",
";",
"}",
"function",
"OperatorComboBox",
"(",
"props",
")",
"{",
"return",
"GenericComboBox",
"(",
"props",
")",
";",
"}",
"export",
"const",
"FilterEditor",
"=",
"injectI18n",
"(",
"FilterEditorUI",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661232 | [
"import",
"{",
"EuiBadge",
",",
"useInnerText",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"React",
",",
"{",
"FC",
"}",
"from",
"'react'",
";",
"import",
"{",
"FilterLabel",
"}",
"from",
"'../'",
";",
"import",
"{",
"Filter",
",",
"isFilterPinned",
"}",
"from",
"'../../../../common'",
";",
"import",
"type",
"{",
"FilterLabelStatus",
"}",
"from",
"'../filter_item'",
";",
"interface",
"Props",
"{",
"filter",
":",
"Filter",
";",
"valueLabel",
":",
"string",
";",
"filterLabelStatus",
":",
"FilterLabelStatus",
";",
"errorMessage",
"?",
":",
"string",
";",
"[",
"propName",
"]",
":",
"any",
";",
"}",
"export",
"const",
"FilterView",
"=",
"(",
"{",
"filter",
",",
"iconOnClick",
",",
"onClick",
",",
"valueLabel",
",",
"errorMessage",
",",
"filterLabelStatus",
",",
"...",
"rest",
"}",
")",
"=>",
"{",
"const",
"[",
"ref",
",",
"innerText",
"]",
"=",
"useInnerText",
"(",
")",
";",
"let",
"title",
"=",
"errorMessage",
"||",
"i18n",
".",
"translate",
"(",
"'data.filter.filterBar.moreFilterActionsMessage'",
",",
"{",
"defaultMessage",
":",
"'Filter: {innerText}. Select for more filter actions.'",
",",
"values",
":",
"{",
"innerText",
"}",
",",
"}",
")",
";",
"if",
"(",
"isFilterPinned",
"(",
"filter",
")",
")",
"{",
"title",
"=",
"`${",
"i18n",
".",
"translate",
"(",
"'data.filter.filterBar.pinnedFilterPrefix'",
",",
"{",
"defaultMessage",
":",
"'Pinned'",
",",
"}",
")",
"} ${",
"title",
"}`",
";",
"}",
"if",
"(",
"filter",
".",
"meta",
".",
"disabled",
")",
"{",
"title",
"=",
"`${",
"i18n",
".",
"translate",
"(",
"'data.filter.filterBar.disabledFilterPrefix'",
",",
"{",
"defaultMessage",
":",
"'Disabled'",
",",
"}",
")",
"} ${",
"title",
"}`",
";",
"}",
"return",
"(",
"<",
"EuiBadge",
"title",
"=",
"{",
"title",
"}",
"color",
"=",
"\"hollow\"",
"iconType",
"=",
"\"cross\"",
"iconSide",
"=",
"\"right\"",
"closeButtonProps",
"=",
"{",
"{",
"tabIndex",
":",
"-",
"1",
",",
"}",
"}",
"iconOnClick",
"=",
"{",
"iconOnClick",
"}",
"iconOnClickAriaLabel",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'data.filter.filterBar.filterItemBadgeIconAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Delete'",
",",
"}",
")",
"}",
"onClick",
"=",
"{",
"onClick",
"}",
"onClickAriaLabel",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'data.filter.filterBar.filterItemBadgeAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Filter actions'",
",",
"}",
")",
"}",
"{",
"...",
"rest",
"}",
">",
"<",
"span",
"ref",
"=",
"{",
"ref",
"}",
">",
"<",
"FilterLabel",
"filter",
"=",
"{",
"filter",
"}",
"valueLabel",
"=",
"{",
"valueLabel",
"}",
"filterLabelStatus",
"=",
"{",
"filterLabelStatus",
"}",
"/",
">",
"<",
"/span>",
"<",
"/EuiBadge>);",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
45,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661233 | [
"import",
"{",
"identity",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"SerializedFieldFormat",
"}",
"from",
"'../../../../expressions/common/types'",
";",
"import",
"{",
"FieldFormat",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"FormatFactory",
"}",
"from",
"'../../../common/field_formats/utils'",
";",
"import",
"{",
"getFormatWithAggs",
"}",
"from",
"'../../../common/search/aggs'",
";",
"import",
"{",
"DataPublicPluginStart",
",",
"IFieldFormat",
"}",
"from",
"'../../../public'",
";",
"import",
"{",
"getUiSettings",
"}",
"from",
"'../../../public/services'",
";",
"const",
"getConfig",
"=",
"(",
"key",
",",
"defaultOverride",
"?",
")",
":",
"any",
"=>",
"getUiSettings",
"(",
")",
".",
"get",
"(",
"key",
",",
"defaultOverride",
")",
";",
"const",
"DefaultFieldFormat",
"=",
"FieldFormat",
".",
"from",
"(",
"identity",
")",
";",
"export",
"const",
"deserializeFieldFormat",
"=",
"function",
"(",
"this",
",",
"serializedFieldFormat",
"?",
")",
"{",
"if",
"(",
"!",
"serializedFieldFormat",
")",
"{",
"return",
"new",
"DefaultFieldFormat",
"(",
")",
";",
"}",
"const",
"getFormat",
"=",
"(",
"mapping",
")",
":",
"IFieldFormat",
"=>",
"{",
"const",
"{",
"id",
",",
"params",
"=",
"{",
"}",
"}",
"=",
"mapping",
";",
"if",
"(",
"id",
")",
"{",
"const",
"Format",
"=",
"this",
".",
"getType",
"(",
"id",
")",
";",
"if",
"(",
"Format",
")",
"{",
"return",
"new",
"Format",
"(",
"params",
",",
"getConfig",
")",
";",
"}",
"}",
"return",
"new",
"DefaultFieldFormat",
"(",
")",
";",
"}",
";",
"const",
"getFieldFormat",
"=",
"getFormatWithAggs",
"(",
"getFormat",
")",
";",
"return",
"getFieldFormat",
"(",
"serializedFieldFormat",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2173,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
16563,
null,
null,
null,
null,
null,
3513,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3020,
null,
null,
3513,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2173,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661234 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"memoize",
",",
"noop",
"}",
"from",
"'lodash'",
";",
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"FieldFormat",
",",
"OSD_FIELD_TYPES",
",",
"FIELD_FORMAT_IDS",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"TextContextTypeConvert",
"}",
"from",
"'../../../common/field_formats/types'",
";",
"export",
"class",
"DateFormat",
"extends",
"FieldFormat",
"{",
"static",
"id",
"=",
"FIELD_FORMAT_IDS",
".",
"DATE",
";",
"static",
"title",
"=",
"i18n",
".",
"translate",
"(",
"'data.fieldFormats.date.title'",
",",
"{",
"defaultMessage",
":",
"'Date'",
",",
"}",
")",
";",
"static",
"fieldType",
"=",
"OSD_FIELD_TYPES",
".",
"DATE",
";",
"private",
"memoizedConverter",
":",
"Function",
"=",
"noop",
";",
"private",
"memoizedPattern",
":",
"string",
"=",
"''",
";",
"private",
"timeZone",
":",
"string",
"=",
"''",
";",
"getParamDefaults",
"(",
")",
"{",
"return",
"{",
"pattern",
":",
"this",
".",
"getConfig",
"!",
"(",
"'dateFormat'",
")",
",",
"timezone",
":",
"this",
".",
"getConfig",
"!",
"(",
"'dateFormat:tz'",
")",
",",
"}",
";",
"}",
"textConvert",
":",
"TextContextTypeConvert",
"=",
"(",
"val",
")",
"=>",
"{",
"const",
"pattern",
"=",
"this",
".",
"param",
"(",
"'pattern'",
")",
";",
"const",
"timezone",
"=",
"this",
".",
"param",
"(",
"'timezone'",
")",
";",
"const",
"timezoneChanged",
"=",
"this",
".",
"timeZone",
"!==",
"timezone",
";",
"const",
"datePatternChanged",
"=",
"this",
".",
"memoizedPattern",
"!==",
"pattern",
";",
"if",
"(",
"timezoneChanged",
"||",
"datePatternChanged",
")",
"{",
"this",
".",
"timeZone",
"=",
"timezone",
";",
"this",
".",
"memoizedPattern",
"=",
"pattern",
";",
"this",
".",
"memoizedConverter",
"=",
"memoize",
"(",
"function",
"converter",
"(",
"value",
")",
"{",
"if",
"(",
"value",
"===",
"null",
"||",
"value",
"===",
"undefined",
")",
"{",
"return",
"'-'",
";",
"}",
"const",
"date",
"=",
"moment",
"(",
"value",
")",
";",
"if",
"(",
"date",
".",
"isValid",
"(",
")",
")",
"{",
"return",
"date",
".",
"format",
"(",
"pattern",
")",
";",
"}",
"else",
"{",
"return",
"value",
";",
"}",
"}",
")",
";",
"}",
"return",
"this",
".",
"memoizedConverter",
"(",
"val",
")",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
8,
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
] |
661235 | [
"import",
"{",
"baseFormatters",
"}",
"from",
"'../../common'",
";",
"import",
"{",
"DateFormat",
",",
"DateNanosFormat",
"}",
"from",
"'./converters'",
";",
"export",
"const",
"baseFormattersPublic",
"=",
"[",
"DateFormat",
",",
"DateNanosFormat",
",",
"...",
"baseFormatters",
"]",
";"
] | [
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
] |
661236 | [
"import",
"{",
"CoreSetup",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"FieldFormatsRegistry",
",",
"UI_SETTINGS",
"}",
"from",
"'../../common'",
";",
"import",
"{",
"deserializeFieldFormat",
"}",
"from",
"'./utils/deserialize'",
";",
"import",
"{",
"FormatFactory",
"}",
"from",
"'../../common/field_formats/utils'",
";",
"import",
"{",
"baseFormattersPublic",
"}",
"from",
"'./constants'",
";",
"export",
"class",
"FieldFormatsService",
"{",
"private",
"readonly",
"fieldFormatsRegistry",
":",
"FieldFormatsRegistry",
"=",
"new",
"FieldFormatsRegistry",
"(",
")",
";",
"public",
"setup",
"(",
"core",
")",
"{",
"core",
".",
"uiSettings",
".",
"getUpdate$",
"(",
")",
".",
"subscribe",
"(",
"(",
"{",
"key",
",",
"newValue",
"}",
")",
"=>",
"{",
"if",
"(",
"key",
"===",
"UI_SETTINGS",
".",
"FORMAT_DEFAULT_TYPE_MAP",
")",
"{",
"this",
".",
"fieldFormatsRegistry",
".",
"parseDefaultTypeMap",
"(",
"newValue",
")",
";",
"}",
"}",
")",
";",
"const",
"getConfig",
"=",
"core",
".",
"uiSettings",
".",
"get",
".",
"bind",
"(",
"core",
".",
"uiSettings",
")",
";",
"this",
".",
"fieldFormatsRegistry",
".",
"init",
"(",
"getConfig",
",",
"{",
"parsedUrl",
":",
"{",
"origin",
":",
"window",
".",
"location",
".",
"origin",
",",
"pathname",
":",
"window",
".",
"location",
".",
"pathname",
",",
"basePath",
":",
"core",
".",
"http",
".",
"basePath",
".",
"get",
"(",
")",
",",
"}",
",",
"}",
",",
"baseFormattersPublic",
")",
";",
"return",
"this",
".",
"fieldFormatsRegistry",
"as",
"FieldFormatsSetup",
";",
"}",
"public",
"start",
"(",
")",
"{",
"this",
".",
"fieldFormatsRegistry",
".",
"deserialize",
"=",
"deserializeFieldFormat",
".",
"bind",
"(",
"this",
".",
"fieldFormatsRegistry",
"as",
"FieldFormatsStart",
")",
";",
"return",
"this",
".",
"fieldFormatsRegistry",
"as",
"FieldFormatsStart",
";",
"}",
"}",
"public",
"export",
"type",
"FieldFormatsSetup",
"=",
"Pick",
"<",
"FieldFormatsRegistry",
",",
"'register'",
">",
";",
"public",
"export",
"type",
"FieldFormatsStart",
"=",
"Omit",
"<",
"FieldFormatsRegistry",
",",
"'init'",
"&",
"'register'",
">",
"&",
"{",
"deserialize",
":",
"FormatFactory",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
20843,
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,
10174,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661237 | [
"import",
"{",
"EuiCallOut",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"CoreStart",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"toMountPoint",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"let",
"bannerId",
";",
"export",
"const",
"onRedirectNoIndexPattern",
"=",
"(",
"capabilities",
",",
"navigateToApp",
",",
"overlays",
")",
"=>",
"(",
")",
"=>",
"{",
"const",
"canManageIndexPatterns",
"=",
"capabilities",
".",
"management",
".",
"opensearchDashboards",
".",
"indexPatterns",
";",
"const",
"redirectTarget",
"=",
"canManageIndexPatterns",
"?",
"'/management/opensearch-dashboards/indexPatterns'",
":",
"'/home'",
";",
"let",
"timeoutId",
";",
"if",
"(",
"timeoutId",
")",
"{",
"clearTimeout",
"(",
"timeoutId",
")",
";",
"}",
"const",
"bannerMessage",
"=",
"i18n",
".",
"translate",
"(",
"'data.indexPatterns.ensureDefaultIndexPattern.bannerLabel'",
",",
"{",
"defaultMessage",
":",
"'To visualize and explore data in OpenSearch Dashboards, you must create an index pattern to retrieve data from OpenSearch.'",
",",
"}",
")",
";",
"bannerId",
"=",
"overlays",
".",
"banners",
".",
"replace",
"(",
"bannerId",
",",
"toMountPoint",
"(",
"<",
"EuiCallOut",
"color",
"=",
"\"warning\"",
"iconType",
"=",
"\"iInCircle\"",
"title",
"=",
"{",
"bannerMessage",
"}",
"/",
">",
")",
")",
";",
"timeoutId",
"=",
"setTimeout",
"(",
"(",
")",
"=>",
"{",
"overlays",
".",
"banners",
".",
"remove",
"(",
"bannerId",
")",
";",
"timeoutId",
"=",
"undefined",
";",
"}",
",",
"15000",
")",
";",
"if",
"(",
"redirectTarget",
"===",
"'/home'",
")",
"{",
"navigateToApp",
"(",
"'home'",
")",
";",
"}",
"else",
"{",
"navigateToApp",
"(",
"'management'",
",",
"{",
"path",
":",
"`/opensearch-dashboards/indexPatterns?bannerMessage=${",
"bannerMessage",
"}`",
",",
"}",
")",
";",
"}",
"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,
2,
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,
2,
null,
null,
null,
null,
null,
null,
null,
null,
1102,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661238 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiButton",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"CoreStart",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"toMountPoint",
"}",
"from",
"'../../../../opensearch_dashboards_react/public'",
";",
"export",
"const",
"onUnsupportedTimePattern",
"=",
"(",
"toasts",
",",
"navigateToApp",
")",
"=>",
"(",
"{",
"id",
",",
"title",
",",
"index",
"}",
")",
"=>",
"{",
"const",
"warningTitle",
"=",
"i18n",
".",
"translate",
"(",
"'data.indexPatterns.warningTitle'",
",",
"{",
"defaultMessage",
":",
"'Support for time interval index patterns removed'",
",",
"}",
")",
";",
"const",
"warningText",
"=",
"i18n",
".",
"translate",
"(",
"'data.indexPatterns.warningText'",
",",
"{",
"defaultMessage",
":",
"'Currently querying all indices matching {index}. {title} should be migrated to a wildcard-based index pattern.'",
",",
"values",
":",
"{",
"title",
",",
"index",
"}",
",",
"}",
")",
";",
"toasts",
".",
"addWarning",
"(",
"{",
"title",
":",
"warningTitle",
",",
"text",
":",
"toMountPoint",
"(",
"<",
"div",
">",
"<",
"p",
">",
"{",
"warningText",
"}",
"<",
"/p>",
"<",
"EuiFlexGroup",
"justifyContent",
"=",
"\"flexEnd\"",
"gutterSize",
"=",
"\"s\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiButton",
"size",
"=",
"\"s\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"navigateToApp",
"(",
"'management'",
",",
"{",
"path",
":",
"`/opensearch-dashboards/index_patterns/index_pattern/${",
"id",
"!",
"||",
"''",
"}`",
",",
"}",
")",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"data.indexPatterns.editIndexPattern\"",
"defaultMessage",
"=",
"\"Edit index pattern\"",
"/",
">",
"<",
"/EuiButton>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"/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,
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
] |
661239 | [
"import",
"{",
"HttpSetup",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IndexPatternMissingIndices",
"}",
"from",
"'../../../common/index_patterns/lib'",
";",
"import",
"{",
"GetFieldsOptions",
",",
"IIndexPatternsApiClient",
"}",
"from",
"'../../../common/index_patterns/types'",
";",
"const",
"API_BASE_URL",
"=",
"`/api/index_patterns/`",
";",
"export",
"class",
"IndexPatternsApiClient",
"implements",
"IIndexPatternsApiClient",
"{",
"private",
"http",
":",
"HttpSetup",
";",
"constructor",
"(",
"http",
")",
"{",
"this",
".",
"http",
"=",
"http",
";",
"}",
"private",
"_request",
"(",
"url",
",",
"query",
")",
"{",
"return",
"this",
".",
"http",
".",
"fetch",
"(",
"url",
",",
"{",
"query",
",",
"}",
")",
".",
"catch",
"(",
"(",
"resp",
")",
"=>",
"{",
"if",
"(",
"resp",
".",
"body",
".",
"statusCode",
"===",
"404",
"&&",
"resp",
".",
"body",
".",
"attributes",
"?.",
"code",
"===",
"'no_matching_indices'",
")",
"{",
"throw",
"new",
"IndexPatternMissingIndices",
"(",
"resp",
".",
"body",
".",
"message",
")",
";",
"}",
"throw",
"new",
"Error",
"(",
"resp",
".",
"body",
".",
"message",
"||",
"resp",
".",
"body",
".",
"error",
"||",
"`${",
"resp",
".",
"body",
".",
"statusCode",
"} Response`",
")",
";",
"}",
")",
";",
"}",
"private",
"_getUrl",
"(",
"path",
")",
"{",
"return",
"API_BASE_URL",
"+",
"path",
".",
"filter",
"(",
"Boolean",
")",
".",
"map",
"(",
"encodeURIComponent",
")",
".",
"join",
"(",
"'/'",
")",
";",
"}",
"getFieldsForTimePattern",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"pattern",
",",
"lookBack",
",",
"metaFields",
"}",
"=",
"options",
";",
"const",
"url",
"=",
"this",
".",
"_getUrl",
"(",
"[",
"'_fields_for_time_pattern'",
"]",
")",
";",
"return",
"this",
".",
"_request",
"(",
"url",
",",
"{",
"pattern",
",",
"look_back",
":",
"lookBack",
",",
"meta_fields",
":",
"metaFields",
",",
"}",
")",
".",
"then",
"(",
"(",
"resp",
")",
"=>",
"resp",
".",
"fields",
")",
";",
"}",
"getFieldsForWildcard",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"const",
"{",
"pattern",
",",
"metaFields",
",",
"type",
",",
"params",
"}",
"=",
"options",
";",
"let",
"url",
";",
"let",
"query",
";",
"if",
"(",
"type",
")",
"{",
"url",
"=",
"this",
".",
"_getUrl",
"(",
"[",
"type",
",",
"'_fields_for_wildcard'",
"]",
")",
";",
"query",
"=",
"{",
"pattern",
",",
"meta_fields",
":",
"metaFields",
",",
"params",
":",
"JSON",
".",
"stringify",
"(",
"params",
")",
",",
"}",
";",
"}",
"else",
"{",
"url",
"=",
"this",
".",
"_getUrl",
"(",
"[",
"'_fields_for_wildcard'",
"]",
")",
";",
"query",
"=",
"{",
"pattern",
",",
"meta_fields",
":",
"metaFields",
",",
"}",
";",
"}",
"return",
"this",
".",
"_request",
"(",
"url",
",",
"query",
")",
".",
"then",
"(",
"(",
"resp",
")",
"=>",
"resp",
".",
"fields",
")",
";",
"}",
"}"
] | [
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,
4411,
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,
2,
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,
4588,
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,
4588,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661240 | [
"import",
"{",
"omit",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"SavedObjectsClient",
",",
"SimpleSavedObject",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"SavedObjectsClientCommon",
",",
"SavedObjectsClientCommonFindArgs",
",",
"SavedObject",
",",
"}",
"from",
"'../../common/index_patterns'",
";",
"type",
"SOClient",
"=",
"Pick",
"<",
"SavedObjectsClient",
",",
"'find'",
"|",
"'get'",
"|",
"'update'",
"|",
"'create'",
"|",
"'delete'",
">",
";",
"const",
"simpleSavedObjectToSavedObject",
"=",
"<",
"T",
">",
"(",
"simpleSavedObject",
")",
":",
"SavedObject",
"<",
"T",
">",
"=>",
"(",
"{",
"version",
":",
"simpleSavedObject",
".",
"_version",
",",
"...",
"omit",
"(",
"simpleSavedObject",
",",
"'_version'",
")",
",",
"}",
"as",
"any",
")",
";",
"export",
"class",
"SavedObjectsClientPublicToCommon",
"implements",
"SavedObjectsClientCommon",
"{",
"private",
"savedObjectClient",
":",
"SOClient",
";",
"constructor",
"(",
"savedObjectClient",
")",
"{",
"this",
".",
"savedObjectClient",
"=",
"savedObjectClient",
";",
"}",
"async",
"find",
"<",
"T",
"=",
"unknown",
">",
"(",
"options",
")",
"{",
"const",
"response",
"=",
"(",
"await",
"this",
".",
"savedObjectClient",
".",
"find",
"<",
"T",
">",
"(",
"options",
")",
")",
".",
"savedObjects",
";",
"return",
"response",
".",
"map",
"<",
"SavedObject",
"<",
"T",
">",
">",
"(",
"simpleSavedObjectToSavedObject",
")",
";",
"}",
"async",
"get",
"<",
"T",
"=",
"unknown",
">",
"(",
"type",
",",
"id",
")",
"{",
"const",
"response",
"=",
"await",
"this",
".",
"savedObjectClient",
".",
"get",
"<",
"T",
">",
"(",
"type",
",",
"id",
")",
";",
"return",
"simpleSavedObjectToSavedObject",
"<",
"T",
">",
"(",
"response",
")",
";",
"}",
"async",
"update",
"<",
"T",
"=",
"unknown",
">",
"(",
"type",
",",
"id",
",",
"attributes",
",",
"options",
")",
"{",
"const",
"response",
"=",
"await",
"this",
".",
"savedObjectClient",
".",
"update",
"(",
"type",
",",
"id",
",",
"attributes",
",",
"options",
")",
";",
"return",
"simpleSavedObjectToSavedObject",
"<",
"T",
">",
"(",
"response",
")",
";",
"}",
"async",
"create",
"(",
"type",
",",
"attributes",
",",
"options",
")",
"{",
"const",
"response",
"=",
"await",
"this",
".",
"savedObjectClient",
".",
"create",
"(",
"type",
",",
"attributes",
",",
"options",
")",
";",
"return",
"simpleSavedObjectToSavedObject",
"(",
"response",
")",
";",
"}",
"delete",
"(",
"type",
",",
"id",
")",
"{",
"return",
"this",
".",
"savedObjectClient",
".",
"delete",
"(",
"type",
",",
"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,
3480,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26120,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
null,
null,
null,
20844,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2,
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,
7,
null,
null,
null,
null,
null,
null,
2,
null,
2,
null,
17,
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,
7,
null,
2,
null,
17,
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,
2,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661241 | [
"import",
"{",
"EventEmitter",
"}",
"from",
"'events'",
";",
"import",
"{",
"InspectorViewDescription",
"}",
"from",
"'./types'",
";",
"import",
"{",
"Adapters",
"}",
"from",
"'../common'",
";",
"callback",
"viewShouldShowFunc",
"param",
"{",
"object",
"}",
"adapters",
"returns",
"{",
"boolean",
"}",
"/**\n * A registry that will hold inspector views.\n */",
"export",
"class",
"InspectorViewRegistry",
"extends",
"EventEmitter",
"{",
"private",
"views",
":",
"InspectorViewDescription",
"[",
"]",
"=",
"[",
"]",
";",
"param",
"{",
"InspectorViewDescription",
"}",
"view",
"public",
"register",
"(",
"view",
")",
"{",
"if",
"(",
"!",
"view",
")",
"{",
"return",
";",
"}",
"this",
".",
"views",
".",
"push",
"(",
"view",
")",
";",
"this",
".",
"views",
".",
"sort",
"(",
"(",
"a",
",",
"b",
")",
"=>",
"(",
"a",
".",
"order",
"||",
"Number",
".",
"MAX_VALUE",
")",
"-",
"(",
"b",
".",
"order",
"||",
"Number",
".",
"MAX_VALUE",
")",
")",
";",
"this",
".",
"emit",
"(",
"'change'",
")",
";",
"}",
"returns",
"{",
"InspectorViewDescription",
"[",
"]",
"}",
"public",
"getAll",
"(",
")",
"{",
"return",
"this",
".",
"views",
";",
"}",
"param",
"{",
"object",
"}",
"adapters",
"returns",
"{",
"InspectorViewDescription",
"[",
"]",
"}",
"public",
"getVisible",
"(",
"adapters",
"?",
")",
"{",
"if",
"(",
"!",
"adapters",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"this",
".",
"views",
".",
"filter",
"(",
"(",
"view",
")",
"=>",
"!",
"view",
".",
"shouldShow",
"||",
"view",
".",
"shouldShow",
"(",
"adapters",
")",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
3429,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3429,
null,
3429,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5,
null,
2434,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3429,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661242 | [
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"EuiButtonEmpty",
",",
"EuiContextMenuItem",
",",
"EuiContextMenuPanel",
",",
"EuiPopover",
",",
"EuiToolTip",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"InspectorViewDescription",
"}",
"from",
"'../types'",
";",
"interface",
"Props",
"{",
"views",
":",
"InspectorViewDescription",
"[",
"]",
";",
"onViewSelected",
":",
"(",
"view",
":",
"InspectorViewDescription",
")",
"=>",
"void",
";",
"selectedView",
":",
"InspectorViewDescription",
";",
"}",
"interface",
"State",
"{",
"isSelectorOpen",
":",
"boolean",
";",
"}",
"export",
"class",
"InspectorViewChooser",
"extends",
"Component",
"<",
"Props",
",",
"State",
">",
"{",
"static",
"propTypes",
"=",
"{",
"views",
":",
"PropTypes",
".",
"array",
".",
"isRequired",
",",
"onViewSelected",
":",
"PropTypes",
".",
"func",
".",
"isRequired",
",",
"selectedView",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"}",
";",
"state",
":",
"State",
"=",
"{",
"isSelectorOpen",
":",
"false",
",",
"}",
";",
"toggleSelector",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"(",
"prev",
")",
"=>",
"(",
"{",
"isSelectorOpen",
":",
"!",
"prev",
".",
"isSelectorOpen",
",",
"}",
")",
")",
";",
"}",
";",
"closeSelector",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"isSelectorOpen",
":",
"false",
",",
"}",
")",
";",
"}",
";",
"renderView",
"=",
"(",
"view",
",",
"index",
")",
"=>",
"{",
"return",
"(",
"<",
"EuiContextMenuItem",
"key",
"=",
"{",
"index",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"{",
"this",
".",
"props",
".",
"onViewSelected",
"(",
"view",
")",
";",
"this",
".",
"closeSelector",
"(",
")",
";",
"}",
"}",
"toolTipContent",
"=",
"{",
"view",
".",
"help",
"}",
"toolTipPosition",
"=",
"\"left\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`inspectorViewChooser${",
"view",
".",
"title",
"}`",
"}",
">",
"{",
"view",
".",
"title",
"}",
"<",
"/EuiContextMenuItem>);",
"}",
";",
"renderViewButton",
"(",
")",
"{",
"return",
"(",
"<",
"EuiButtonEmpty",
"size",
"=",
"\"s\"",
"iconType",
"=",
"\"arrowDown\"",
"iconSide",
"=",
"\"right\"",
"onClick",
"=",
"{",
"this",
".",
"toggleSelector",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorViewChooser\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.view\"",
"defaultMessage",
"=",
"\"View: {viewName}\"",
"values",
"=",
"{",
"{",
"viewName",
":",
"this",
".",
"props",
".",
"selectedView",
".",
"title",
"}",
"}",
"/>",
"<",
"/EuiButtonEmpty>);",
"}",
"renderSingleView",
"(",
")",
"{",
"return",
"(",
"<",
"EuiToolTip",
"position",
"=",
"\"bottom\"",
"content",
"=",
"{",
"this",
".",
"props",
".",
"selectedView",
".",
"help",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.view\"",
"defaultMessage",
"=",
"\"View: {viewName}\"",
"values",
"=",
"{",
"{",
"viewName",
":",
"this",
".",
"props",
".",
"selectedView",
".",
"title",
"}",
"}",
"/>",
"<",
"/EuiToolTip>);",
"}",
"render",
"(",
")",
"{",
"const",
"{",
"views",
"}",
"=",
"this",
".",
"props",
";",
"if",
"(",
"views",
".",
"length",
"<",
"2",
")",
"{",
"return",
"this",
".",
"renderSingleView",
"(",
")",
";",
"}",
"const",
"triggerButton",
"=",
"this",
".",
"renderViewButton",
"(",
")",
";",
"return",
"(",
"<",
"EuiPopover",
"id",
"=",
"\"inspectorViewChooser\"",
"ownFocus",
"button",
"=",
"{",
"triggerButton",
"}",
"isOpen",
"=",
"{",
"this",
".",
"state",
".",
"isSelectorOpen",
"}",
"closePopover",
"=",
"{",
"this",
".",
"closeSelector",
"}",
"panelPaddingSize",
"=",
"\"none\"",
"anchorPosition",
"=",
"\"downRight\"",
"repositionOnScroll",
">",
"<",
"EuiContextMenuPanel",
"items",
"=",
"{",
"views",
".",
"map",
"(",
"this",
".",
"renderView",
")",
"}",
"/>",
"<",
"/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,
3429,
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
] |
661243 | [
"import",
"{",
"isObject",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"saveAs",
"}",
"from",
"'@elastic/filesaver'",
";",
"import",
"{",
"DataViewColumn",
",",
"DataViewRow",
"}",
"from",
"'../types'",
";",
"const",
"LINE_FEED_CHARACTER",
"=",
"'\\r\\n'",
";",
"const",
"nonAlphaNumRE",
"=",
"/[^a-zA-Z0-9]/",
";",
"const",
"allDoubleQuoteRE",
"=",
"/\"/g",
";",
"function",
"escape",
"(",
"val",
",",
"quoteValues",
")",
"{",
"if",
"(",
"isObject",
"(",
"val",
")",
")",
"{",
"val",
"=",
"(",
"val",
"as",
"any",
")",
".",
"valueOf",
"(",
")",
";",
"}",
"val",
"=",
"String",
"(",
"val",
")",
";",
"if",
"(",
"quoteValues",
"&&",
"nonAlphaNumRE",
".",
"test",
"(",
"val",
")",
")",
"{",
"val",
"=",
"`\"${",
"val",
".",
"replace",
"(",
"allDoubleQuoteRE",
",",
"'\"\"'",
")",
"}\"`",
";",
"}",
"return",
"val",
";",
"}",
"function",
"buildCsv",
"(",
"columns",
",",
"rows",
",",
"csvSeparator",
",",
"quoteValues",
",",
"valueFormatter",
"?",
")",
"{",
"const",
"header",
"=",
"columns",
".",
"map",
"(",
"(",
"col",
")",
"=>",
"escape",
"(",
"col",
".",
"name",
",",
"quoteValues",
")",
")",
";",
"const",
"orderedFieldNames",
"=",
"columns",
".",
"map",
"(",
"(",
"col",
")",
"=>",
"col",
".",
"field",
")",
";",
"const",
"csvRows",
"=",
"rows",
".",
"map",
"(",
"(",
"row",
")",
"=>",
"{",
"return",
"orderedFieldNames",
".",
"map",
"(",
"(",
"field",
")",
"=>",
"escape",
"(",
"valueFormatter",
"?",
"valueFormatter",
"(",
"row",
"[",
"field",
"]",
")",
":",
"row",
"[",
"field",
"]",
",",
"quoteValues",
")",
")",
";",
"}",
")",
";",
"return",
"(",
"[",
"header",
",",
"...",
"csvRows",
"]",
".",
"map",
"(",
"(",
"row",
")",
"=>",
"row",
".",
"join",
"(",
"csvSeparator",
")",
")",
".",
"join",
"(",
"LINE_FEED_CHARACTER",
")",
"+",
"LINE_FEED_CHARACTER",
")",
";",
"}",
"export",
"function",
"exportAsCsv",
"(",
"{",
"filename",
",",
"columns",
",",
"rows",
",",
"valueFormatter",
",",
"csvSeparator",
",",
"quoteValues",
",",
"}",
")",
"{",
"const",
"type",
"=",
"'text/csv;charset=utf-8'",
";",
"const",
"csv",
"=",
"new",
"Blob",
"(",
"[",
"buildCsv",
"(",
"columns",
",",
"rows",
",",
"csvSeparator",
",",
"quoteValues",
",",
"valueFormatter",
")",
"]",
",",
"{",
"type",
",",
"}",
")",
";",
"saveAs",
"(",
"csv",
",",
"filename",
")",
";",
"}"
] | [
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,
27,
null,
null,
null,
null,
27,
null,
null,
null,
null,
2,
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,
null,
null,
null,
null,
null,
null,
2,
null,
5,
null,
5,
null,
2,
null,
8,
null,
33,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
14367,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
14367,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
3614,
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,
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
] |
661244 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"EuiButton",
",",
"EuiContextMenuItem",
",",
"EuiContextMenuPanel",
",",
"EuiPopover",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"DataViewColumn",
",",
"DataViewRow",
"}",
"from",
"'../types'",
";",
"import",
"{",
"exportAsCsv",
"}",
"from",
"'../lib/export_csv'",
";",
"interface",
"DataDownloadOptionsState",
"{",
"isPopoverOpen",
":",
"boolean",
";",
"}",
"interface",
"DataDownloadOptionsProps",
"{",
"title",
":",
"string",
";",
"columns",
":",
"DataViewColumn",
"[",
"]",
";",
"rows",
":",
"DataViewRow",
"[",
"]",
";",
"csvSeparator",
":",
"string",
";",
"quoteValues",
":",
"boolean",
";",
"isFormatted",
"?",
":",
"boolean",
";",
"}",
"class",
"DataDownloadOptions",
"extends",
"Component",
"<",
"DataDownloadOptionsProps",
",",
"DataDownloadOptionsState",
">",
"{",
"static",
"propTypes",
"=",
"{",
"title",
":",
"PropTypes",
".",
"string",
".",
"isRequired",
",",
"csvSeparator",
":",
"PropTypes",
".",
"string",
".",
"isRequired",
",",
"quoteValues",
":",
"PropTypes",
".",
"bool",
".",
"isRequired",
",",
"isFormatted",
":",
"PropTypes",
".",
"bool",
",",
"columns",
":",
"PropTypes",
".",
"array",
",",
"rows",
":",
"PropTypes",
".",
"array",
",",
"}",
";",
"state",
"=",
"{",
"isPopoverOpen",
":",
"false",
",",
"}",
";",
"onTogglePopover",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"(",
"state",
")",
"=>",
"(",
"{",
"isPopoverOpen",
":",
"!",
"state",
".",
"isPopoverOpen",
",",
"}",
")",
")",
";",
"}",
";",
"closePopover",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"isPopoverOpen",
":",
"false",
",",
"}",
")",
";",
"}",
";",
"exportCsv",
"=",
"(",
"customParams",
"=",
"{",
"}",
")",
"=>",
"{",
"let",
"filename",
"=",
"this",
".",
"props",
".",
"title",
";",
"if",
"(",
"!",
"filename",
"||",
"filename",
".",
"length",
"===",
"0",
")",
"{",
"filename",
"=",
"i18n",
".",
"translate",
"(",
"'inspector.data.downloadOptionsUnsavedFilename'",
",",
"{",
"defaultMessage",
":",
"'unsaved'",
",",
"}",
")",
";",
"}",
"exportAsCsv",
"(",
"{",
"filename",
":",
"`${",
"filename",
"}.csv`",
",",
"columns",
":",
"this",
".",
"props",
".",
"columns",
",",
"rows",
":",
"this",
".",
"props",
".",
"rows",
",",
"csvSeparator",
":",
"this",
".",
"props",
".",
"csvSeparator",
",",
"quoteValues",
":",
"this",
".",
"props",
".",
"quoteValues",
",",
"...",
"customParams",
",",
"}",
")",
";",
"}",
";",
"exportFormattedCsv",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"exportCsv",
"(",
"{",
"valueFormatter",
":",
"(",
"item",
")",
"=>",
"item",
".",
"formatted",
",",
"}",
")",
";",
"}",
";",
"exportFormattedAsRawCsv",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"exportCsv",
"(",
"{",
"valueFormatter",
":",
"(",
"item",
")",
"=>",
"item",
".",
"raw",
",",
"}",
")",
";",
"}",
";",
"renderUnformattedDownload",
"(",
")",
"{",
"return",
"(",
"<",
"EuiButton",
"size",
"=",
"\"s\"",
"onClick",
"=",
"{",
"this",
".",
"exportCsv",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.downloadCSVButtonLabel\"",
"defaultMessage",
"=",
"\"Download CSV\"",
"/",
">",
"<",
"/EuiButton>);",
"}",
"renderFormattedDownloads",
"(",
")",
"{",
"const",
"button",
"=",
"(",
"<",
"EuiButton",
"iconType",
"=",
"\"arrowDown\"",
"iconSide",
"=",
"\"right\"",
"size",
"=",
"\"s\"",
"onClick",
"=",
"{",
"this",
".",
"onTogglePopover",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.downloadCSVToggleButtonLabel\"",
"defaultMessage",
"=",
"\"Download CSV\"",
"/",
">",
"<",
"/EuiButton>);",
"const",
"items",
"=",
"[",
"<",
"EuiContextMenuItem",
"key",
"=",
"\"csv\"",
"onClick",
"=",
"{",
"this",
".",
"exportFormattedCsv",
"}",
"toolTipContent",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.formattedCSVButtonTooltip\"",
"defaultMessage",
"=",
"\"Download the data in table format\"",
"/",
">",
"}",
"toolTipPosition",
"=",
"\"left\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.formattedCSVButtonLabel\"",
"defaultMessage",
"=",
"\"Formatted CSV\"",
"/",
">",
"<",
"/EuiContextMenuItem>,",
"<",
"EuiContextMenuItem",
"key",
"=",
"\"rawCsv\"",
"onClick",
"=",
"{",
"this",
".",
"exportFormattedAsRawCsv",
"}",
"toolTipContent",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.rawCSVButtonTooltip\"",
"defaultMessage",
"=",
"\"Download the data as provided, for example, dates as timestamps\"",
"/",
">",
"}",
"toolTipPosition",
"=",
"\"left\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.rawCSVButtonLabel\"",
"defaultMessage",
"=",
"\"Raw CSV\"",
"/",
">",
"<",
"/EuiContextMenuItem>,",
"]",
";",
"return",
"(",
"<",
"EuiPopover",
"id",
"=",
"\"inspectorDownloadData\"",
"button",
"=",
"{",
"button",
"}",
"isOpen",
"=",
"{",
"this",
".",
"state",
".",
"isPopoverOpen",
"}",
"closePopover",
"=",
"{",
"this",
".",
"closePopover",
"}",
"panelPaddingSize",
"=",
"\"none\"",
"repositionOnScroll",
">",
"<",
"EuiContextMenuPanel",
"className",
"=",
"\"eui-textNoWrap\"",
"items",
"=",
"{",
"items",
"}",
"/",
">",
"<",
"/EuiPopover>);",
"}",
"render",
"(",
")",
"{",
"return",
"this",
".",
"props",
".",
"isFormatted",
"?",
"this",
".",
"renderFormattedDownloads",
"(",
")",
":",
"this",
".",
"renderUnformattedDownload",
"(",
")",
";",
"}",
"}",
"export",
"{",
"DataDownloadOptions",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661245 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"EuiButtonIcon",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiInMemoryTable",
",",
"EuiSpacer",
",",
"EuiToolTip",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"DataDownloadOptions",
"}",
"from",
"'./download_options'",
";",
"import",
"{",
"DataViewRow",
",",
"DataViewColumn",
"}",
"from",
"'../types'",
";",
"import",
"{",
"TabularData",
"}",
"from",
"'../../../../common/adapters/data/types'",
";",
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'../../../../../../core/public'",
";",
"interface",
"DataTableFormatState",
"{",
"columns",
":",
"DataViewColumn",
"[",
"]",
";",
"rows",
":",
"DataViewRow",
"[",
"]",
";",
"}",
"interface",
"DataTableFormatProps",
"{",
"data",
":",
"TabularData",
";",
"exportTitle",
":",
"string",
";",
"uiSettings",
":",
"IUiSettingsClient",
";",
"isFormatted",
"?",
":",
"boolean",
";",
"}",
"export",
"class",
"DataTableFormat",
"extends",
"Component",
"<",
"DataTableFormatProps",
",",
"DataTableFormatState",
">",
"{",
"static",
"propTypes",
"=",
"{",
"data",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"exportTitle",
":",
"PropTypes",
".",
"string",
".",
"isRequired",
",",
"uiSettings",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"isFormatted",
":",
"PropTypes",
".",
"bool",
",",
"}",
";",
"csvSeparator",
"=",
"this",
".",
"props",
".",
"uiSettings",
".",
"get",
"(",
"'csv:separator'",
",",
"','",
")",
";",
"quoteValues",
"=",
"this",
".",
"props",
".",
"uiSettings",
".",
"get",
"(",
"'csv:quoteValues'",
",",
"true",
")",
";",
"state",
"=",
"{",
"}",
"as",
"DataTableFormatState",
";",
"static",
"renderCell",
"(",
"dataColumn",
",",
"value",
",",
"isFormatted",
"=",
"false",
")",
"{",
"return",
"(",
"<",
"EuiFlexGroup",
"responsive",
"=",
"{",
"false",
"}",
"gutterSize",
"=",
"\"s\"",
"alignItems",
"=",
"\"center\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"{",
"isFormatted",
"?",
"value",
".",
"formatted",
":",
"value",
"}",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiFlexGroup",
"responsive",
"=",
"{",
"false",
"}",
"gutterSize",
"=",
"\"none\"",
"alignItems",
"=",
"\"center\"",
">",
"{",
"dataColumn",
".",
"filter",
"&&",
"(",
"<",
"EuiToolTip",
"position",
"=",
"\"bottom\"",
"content",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.filterForValueButtonTooltip\"",
"defaultMessage",
"=",
"\"Filter for value\"",
"/",
">",
"}",
">",
"<",
"EuiButtonIcon",
"iconType",
"=",
"\"plusInCircle\"",
"color",
"=",
"\"text\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'inspector.data.filterForValueButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Filter for value'",
",",
"}",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterForInspectorCellValue\"",
"className",
"=",
"\"insDataTableFormat__filter\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"dataColumn",
".",
"filter",
"(",
"value",
")",
"}",
"/>",
"<",
"/EuiToolTip>)}",
"{",
"dataColumn",
".",
"filterOut",
"&&",
"(",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiToolTip",
"position",
"=",
"\"bottom\"",
"content",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.filterOutValueButtonTooltip\"",
"defaultMessage",
"=",
"\"Filter out value\"",
"/",
">",
"}",
">",
"<",
"EuiButtonIcon",
"iconType",
"=",
"\"minusInCircle\"",
"color",
"=",
"\"text\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'inspector.data.filterOutValueButtonAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Filter out value'",
",",
"}",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"filterOutInspectorCellValue\"",
"className",
"=",
"\"insDataTableFormat__filter\"",
"onClick",
"=",
"{",
"(",
")",
"=>",
"dataColumn",
".",
"filterOut",
"(",
"value",
")",
"}",
"/>",
"<",
"/EuiToolTip>",
"<",
"/EuiFlexItem>)}",
"<",
"/EuiFlexGroup>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>);",
"}",
"static",
"getDerivedStateFromProps",
"(",
"{",
"data",
",",
"isFormatted",
"}",
")",
"{",
"if",
"(",
"!",
"data",
")",
"{",
"return",
"{",
"columns",
":",
"null",
",",
"rows",
":",
"null",
",",
"}",
";",
"}",
"const",
"columns",
"=",
"data",
".",
"columns",
".",
"map",
"(",
"(",
"dataColumn",
")",
"=>",
"(",
"{",
"name",
":",
"dataColumn",
".",
"name",
",",
"field",
":",
"dataColumn",
".",
"field",
",",
"sortable",
":",
"isFormatted",
"?",
"(",
"row",
")",
"=>",
"row",
"[",
"dataColumn",
".",
"field",
"]",
".",
"raw",
":",
"true",
",",
"render",
":",
"(",
"value",
")",
"=>",
"DataTableFormat",
".",
"renderCell",
"(",
"dataColumn",
",",
"value",
",",
"isFormatted",
")",
",",
"}",
")",
")",
";",
"return",
"{",
"columns",
",",
"rows",
":",
"data",
".",
"rows",
"}",
";",
"}",
"render",
"(",
")",
"{",
"const",
"{",
"columns",
",",
"rows",
"}",
"=",
"this",
".",
"state",
";",
"const",
"pagination",
"=",
"{",
"pageSizeOptions",
":",
"[",
"10",
",",
"20",
",",
"50",
"]",
",",
"initialPageSize",
":",
"20",
",",
"}",
";",
"return",
"(",
"<",
">",
"<",
"EuiFlexGroup",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"true",
"}",
"/",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"DataDownloadOptions",
"isFormatted",
"=",
"{",
"this",
".",
"props",
".",
"isFormatted",
"}",
"title",
"=",
"{",
"this",
".",
"props",
".",
"exportTitle",
"}",
"csvSeparator",
"=",
"{",
"this",
".",
"csvSeparator",
"}",
"quoteValues",
"=",
"{",
"this",
".",
"quoteValues",
"}",
"columns",
"=",
"{",
"columns",
"}",
"rows",
"=",
"{",
"rows",
"}",
"/",
">",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"EuiInMemoryTable",
"className",
"=",
"\"insDataTableFormat__table\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorTable\"",
"columns",
"=",
"{",
"columns",
"}",
"items",
"=",
"{",
"rows",
"}",
"sorting",
"=",
"{",
"true",
"}",
"pagination",
"=",
"{",
"pagination",
"}",
"/",
">",
"<",
"/>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661246 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiEmptyPrompt",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiLoadingChart",
",",
"EuiPanel",
",",
"EuiSpacer",
",",
"EuiText",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"DataTableFormat",
"}",
"from",
"'./data_table'",
";",
"import",
"{",
"InspectorViewProps",
"}",
"from",
"'../../../types'",
";",
"import",
"{",
"Adapters",
"}",
"from",
"'../../../../common'",
";",
"import",
"{",
"TabularLoaderOptions",
",",
"TabularData",
",",
"TabularCallback",
",",
"}",
"from",
"'../../../../common/adapters/data/types'",
";",
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'../../../../../../core/public'",
";",
"interface",
"DataViewComponentState",
"{",
"tabularData",
":",
"TabularData",
"|",
"null",
";",
"tabularOptions",
":",
"TabularLoaderOptions",
";",
"adapters",
":",
"Adapters",
";",
"tabularPromise",
":",
"TabularCallback",
"|",
"null",
";",
"}",
"interface",
"DataViewComponentProps",
"extends",
"InspectorViewProps",
"{",
"uiSettings",
":",
"IUiSettingsClient",
";",
"}",
"export",
"class",
"DataViewComponent",
"extends",
"Component",
"<",
"DataViewComponentProps",
",",
"DataViewComponentState",
">",
"{",
"static",
"propTypes",
"=",
"{",
"uiSettings",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"adapters",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"title",
":",
"PropTypes",
".",
"string",
".",
"isRequired",
",",
"}",
";",
"state",
"=",
"{",
"}",
"as",
"DataViewComponentState",
";",
"_isMounted",
"=",
"false",
";",
"static",
"getDerivedStateFromProps",
"(",
"nextProps",
",",
"state",
")",
"{",
"if",
"(",
"state",
"&&",
"nextProps",
".",
"adapters",
"===",
"state",
".",
"adapters",
")",
"{",
"return",
"null",
";",
"}",
"return",
"{",
"adapters",
":",
"nextProps",
".",
"adapters",
",",
"tabularData",
":",
"null",
",",
"tabularOptions",
":",
"{",
"}",
",",
"tabularPromise",
":",
"nextProps",
".",
"adapters",
".",
"data",
".",
"getTabular",
"(",
")",
",",
"}",
";",
"}",
"onUpdateData",
"=",
"(",
"type",
")",
"=>",
"{",
"if",
"(",
"type",
"===",
"'tabular'",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"tabularData",
":",
"null",
",",
"tabularOptions",
":",
"{",
"}",
",",
"tabularPromise",
":",
"this",
".",
"props",
".",
"adapters",
".",
"data",
".",
"getTabular",
"(",
")",
",",
"}",
")",
";",
"}",
"}",
";",
"async",
"finishLoadingData",
"(",
")",
"{",
"const",
"{",
"tabularPromise",
"}",
"=",
"this",
".",
"state",
";",
"if",
"(",
"tabularPromise",
")",
"{",
"const",
"tabularData",
"=",
"await",
"tabularPromise",
";",
"if",
"(",
"this",
".",
"_isMounted",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"tabularData",
":",
"tabularData",
".",
"data",
",",
"tabularOptions",
":",
"tabularData",
".",
"options",
",",
"tabularPromise",
":",
"null",
",",
"}",
")",
";",
"}",
"}",
"}",
"componentDidMount",
"(",
")",
"{",
"this",
".",
"_isMounted",
"=",
"true",
";",
"this",
".",
"props",
".",
"adapters",
".",
"data",
".",
"on",
"(",
"'change'",
",",
"this",
".",
"onUpdateData",
")",
";",
"this",
".",
"finishLoadingData",
"(",
")",
";",
"}",
"componentWillUnmount",
"(",
")",
"{",
"this",
".",
"_isMounted",
"=",
"false",
";",
"this",
".",
"props",
".",
"adapters",
".",
"data",
".",
"removeListener",
"(",
"'change'",
",",
"this",
".",
"onUpdateData",
")",
";",
"}",
"componentDidUpdate",
"(",
")",
"{",
"this",
".",
"finishLoadingData",
"(",
")",
";",
"}",
"static",
"renderNoData",
"(",
")",
"{",
"return",
"(",
"<",
"EuiEmptyPrompt",
"title",
"=",
"{",
"<",
"h2",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.noDataAvailableTitle\"",
"defaultMessage",
"=",
"\"No data available\"",
"/",
">",
"<",
"/h2>} body={<React.Fragment>",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.noDataAvailableDescription\"",
"defaultMessage",
"=",
"\"The element did not provide any data.\"",
"/",
">",
"<",
"/p>",
"<",
"/React.Fragment>}/",
">",
")",
";",
"}",
"static",
"renderLoading",
"(",
")",
"{",
"return",
"(",
"<",
"EuiFlexGroup",
"justifyContent",
"=",
"\"center\"",
"alignItems",
"=",
"\"center\"",
"style",
"=",
"{",
"{",
"height",
":",
"'100%'",
"}",
"}",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"EuiPanel",
"className",
"=",
"\"eui-textCenter\"",
">",
"<",
"EuiLoadingChart",
"size",
"=",
"\"m\"",
"/",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"s\"",
"/",
">",
"<",
"EuiText",
">",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.data.gatheringDataLabel\"",
"defaultMessage",
"=",
"\"Gathering data\"",
"/",
">",
"<",
"/p>",
"<",
"/EuiText>",
"<",
"/EuiPanel>",
"<",
"/EuiFlexItem>",
"<",
"/EuiFlexGroup>);",
"}",
"render",
"(",
")",
"{",
"if",
"(",
"this",
".",
"state",
".",
"tabularPromise",
")",
"{",
"return",
"DataViewComponent",
".",
"renderLoading",
"(",
")",
";",
"}",
"else",
"if",
"(",
"!",
"this",
".",
"state",
".",
"tabularData",
")",
"{",
"return",
"DataViewComponent",
".",
"renderNoData",
"(",
")",
";",
"}",
"return",
"(",
"<",
"DataTableFormat",
"data",
"=",
"{",
"this",
".",
"state",
".",
"tabularData",
"}",
"isFormatted",
"=",
"{",
"this",
".",
"state",
".",
"tabularOptions",
".",
"returnsFormattedValues",
"}",
"exportTitle",
"=",
"{",
"this",
".",
"props",
".",
"title",
"}",
"uiSettings",
"=",
"{",
"this",
".",
"props",
".",
"uiSettings",
"}",
"/",
">",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
8962,
null,
26122,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
7,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26123,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
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
] |
661247 | [
"import",
"React",
"from",
"'react'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"DataViewComponent",
"}",
"from",
"'./components/data_view'",
";",
"import",
"{",
"InspectorViewDescription",
",",
"InspectorViewProps",
"}",
"from",
"'../../types'",
";",
"import",
"{",
"Adapters",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'../../../../../core/public'",
";",
"export",
"const",
"getDataViewDescription",
"=",
"(",
"uiSettings",
")",
":",
"InspectorViewDescription",
"=>",
"(",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'inspector.data.dataTitle'",
",",
"{",
"defaultMessage",
":",
"'Data'",
",",
"}",
")",
",",
"order",
":",
"10",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'inspector.data.dataDescriptionTooltip'",
",",
"{",
"defaultMessage",
":",
"'View the data behind the visualization'",
",",
"}",
")",
",",
"shouldShow",
"(",
"adapters",
")",
"{",
"return",
"Boolean",
"(",
"adapters",
".",
"data",
")",
";",
"}",
",",
"component",
":",
"(",
"props",
")",
"=>",
"(",
"<",
"DataViewComponent",
"{",
"...",
"props",
"}",
"uiSettings",
"=",
"{",
"uiSettings",
"}",
"/",
">",
")",
",",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3429,
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,
8,
null,
2434,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8962,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661248 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"EuiBadge",
",",
"EuiButtonEmpty",
",",
"EuiContextMenuPanel",
",",
"EuiContextMenuItem",
",",
"EuiFlexGroup",
",",
"EuiFlexItem",
",",
"EuiLoadingSpinner",
",",
"EuiPopover",
",",
"EuiTextColor",
",",
"EuiToolTip",
",",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"RequestStatus",
"}",
"from",
"'../../../../common/adapters'",
";",
"import",
"{",
"Request",
"}",
"from",
"'../../../../common/adapters/request/types'",
";",
"interface",
"RequestSelectorState",
"{",
"isPopoverOpen",
":",
"boolean",
";",
"}",
"interface",
"RequestSelectorProps",
"{",
"requests",
":",
"Request",
"[",
"]",
";",
"selectedRequest",
":",
"Request",
";",
"onRequestChanged",
":",
"Function",
";",
"}",
"export",
"class",
"RequestSelector",
"extends",
"Component",
"<",
"RequestSelectorProps",
",",
"RequestSelectorState",
">",
"{",
"static",
"propTypes",
"=",
"{",
"requests",
":",
"PropTypes",
".",
"array",
".",
"isRequired",
",",
"selectedRequest",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"onRequestChanged",
":",
"PropTypes",
".",
"func",
",",
"}",
";",
"state",
"=",
"{",
"isPopoverOpen",
":",
"false",
",",
"}",
";",
"togglePopover",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"(",
"prevState",
")",
"=>",
"(",
"{",
"isPopoverOpen",
":",
"!",
"prevState",
".",
"isPopoverOpen",
",",
"}",
")",
")",
";",
"}",
";",
"closePopover",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setState",
"(",
"{",
"isPopoverOpen",
":",
"false",
",",
"}",
")",
";",
"}",
";",
"renderRequestDropdownItem",
"=",
"(",
"request",
",",
"index",
")",
"=>",
"{",
"const",
"hasFailed",
"=",
"request",
".",
"status",
"===",
"RequestStatus",
".",
"ERROR",
";",
"const",
"inProgress",
"=",
"request",
".",
"status",
"===",
"RequestStatus",
".",
"PENDING",
";",
"return",
"(",
"<",
"EuiContextMenuItem",
"key",
"=",
"{",
"index",
"}",
"icon",
"=",
"{",
"request",
"===",
"this",
".",
"props",
".",
"selectedRequest",
"?",
"'check'",
":",
"'empty'",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"{",
"this",
".",
"props",
".",
"onRequestChanged",
"(",
"request",
")",
";",
"this",
".",
"closePopover",
"(",
")",
";",
"}",
"}",
"toolTipContent",
"=",
"{",
"request",
".",
"description",
"}",
"toolTipPosition",
"=",
"\"left\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`inspectorRequestChooser${",
"request",
".",
"name",
"}`",
"}",
">",
"<",
"EuiTextColor",
"color",
"=",
"{",
"hasFailed",
"?",
"'danger'",
":",
"'default'",
"}",
">",
"{",
"request",
".",
"name",
"}",
"{",
"hasFailed",
"&&",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.failedLabel\"",
"defaultMessage",
"=",
"\" (failed)\"",
"/",
">",
")",
"}",
"{",
"inProgress",
"&&",
"(",
"<",
"EuiLoadingSpinner",
"size",
"=",
"\"s\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'inspector.requests.requestInProgressAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Request in progress'",
",",
"}",
")",
"}",
"className",
"=",
"\"insRequestSelector__menuSpinner\"",
"/",
">",
")",
"}",
"<",
"/EuiTextColor>",
"<",
"/EuiContextMenuItem>);",
"}",
";",
"renderRequestDropdown",
"(",
")",
"{",
"const",
"button",
"=",
"(",
"<",
"EuiButtonEmpty",
"iconType",
"=",
"\"arrowDown\"",
"iconSide",
"=",
"\"right\"",
"size",
"=",
"\"s\"",
"onClick",
"=",
"{",
"this",
".",
"togglePopover",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorRequestChooser\"",
">",
"{",
"this",
".",
"props",
".",
"selectedRequest",
".",
"name",
"}",
"<",
"/EuiButtonEmpty>);",
"return",
"(",
"<",
"EuiPopover",
"id",
"=",
"\"inspectorRequestChooser\"",
"button",
"=",
"{",
"button",
"}",
"isOpen",
"=",
"{",
"this",
".",
"state",
".",
"isPopoverOpen",
"}",
"closePopover",
"=",
"{",
"this",
".",
"closePopover",
"}",
"panelPaddingSize",
"=",
"\"none\"",
"anchorPosition",
"=",
"\"downLeft\"",
"repositionOnScroll",
">",
"<",
"EuiContextMenuPanel",
"items",
"=",
"{",
"this",
".",
"props",
".",
"requests",
".",
"map",
"(",
"this",
".",
"renderRequestDropdownItem",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorRequestChooserMenuPanel\"",
"/",
">",
"<",
"/EuiPopover>);",
"}",
"render",
"(",
")",
"{",
"const",
"{",
"selectedRequest",
",",
"requests",
"}",
"=",
"this",
".",
"props",
";",
"return",
"(",
"<",
"EuiFlexGroup",
"alignItems",
"=",
"\"center\"",
"gutterSize",
"=",
"\"xs\"",
">",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"<",
"strong",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestLabel\"",
"defaultMessage",
"=",
"\"Request:\"",
"/",
">",
"<",
"/strong>",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"true",
"}",
">",
"{",
"requests",
".",
"length",
"<=",
"1",
"&&",
"(",
"<",
"div",
"className",
"=",
"\"insRequestSelector__singleRequest\"",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorRequestName\"",
">",
"{",
"selectedRequest",
".",
"name",
"}",
"<",
"/div>)}",
"{",
"requests",
".",
"length",
">",
"1",
"&&",
"this",
".",
"renderRequestDropdown",
"(",
")",
"}",
"<",
"/EuiFlexItem>",
"<",
"EuiFlexItem",
"grow",
"=",
"{",
"false",
"}",
">",
"{",
"selectedRequest",
".",
"status",
"!==",
"RequestStatus",
".",
"PENDING",
"&&",
"(",
"<",
"EuiToolTip",
"position",
"=",
"\"left\"",
"title",
"=",
"{",
"selectedRequest",
".",
"status",
"===",
"RequestStatus",
".",
"OK",
"?",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestSucceededTooltipTitle\"",
"defaultMessage",
"=",
"\"Request succeeded\"",
"/",
">",
")",
":",
"(",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestFailedTooltipTitle\"",
"defaultMessage",
"=",
"\"Request failed\"",
"/",
">",
")",
"}",
"content",
"=",
"{",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestTooltipDescription\"",
"defaultMessage",
"=",
"\"The total time the request took.\"",
"/",
">",
"}",
">",
"<",
"EuiBadge",
"color",
"=",
"{",
"selectedRequest",
".",
"status",
"===",
"RequestStatus",
".",
"OK",
"?",
"'secondary'",
":",
"'danger'",
"}",
"iconType",
"=",
"{",
"selectedRequest",
".",
"status",
"===",
"RequestStatus",
".",
"OK",
"?",
"'check'",
":",
"'cross'",
"}",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestTimeLabel\"",
"defaultMessage",
"=",
"\"{requestTime}ms\"",
"values",
"=",
"{",
"{",
"requestTime",
":",
"selectedRequest",
".",
"time",
"}",
"}",
"/>",
"<",
"/EuiBadge>",
"<",
"/EuiToolTip>)}",
"{",
"selectedRequest",
".",
"status",
"===",
"RequestStatus",
".",
"PENDING",
"&&",
"(",
"<",
"EuiLoadingSpinner",
"size",
"=",
"\"m\"",
"aria",
"-",
"label",
"=",
"{",
"i18n",
".",
"translate",
"(",
"'inspector.requests.requestInProgressAriaLabel'",
",",
"{",
"defaultMessage",
":",
"'Request in progress'",
",",
"}",
")",
"}",
"/>)}",
"<",
"/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,
13404,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
40,
null,
3,
null,
null,
null,
null,
8,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661249 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"EuiCodeBlock",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"Request",
"}",
"from",
"'../../../../../common/adapters/request/types'",
";",
"import",
"{",
"RequestDetailsProps",
"}",
"from",
"'../types'",
";",
"export",
"class",
"RequestDetailsResponse",
"extends",
"Component",
"<",
"RequestDetailsProps",
">",
"{",
"static",
"propTypes",
"=",
"{",
"request",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"}",
";",
"static",
"shouldShow",
"=",
"(",
"request",
")",
"=>",
"Boolean",
"(",
"RequestDetailsResponse",
".",
"getResponseJson",
"(",
"request",
")",
")",
";",
"static",
"getResponseJson",
"=",
"(",
"request",
")",
"=>",
"(",
"request",
".",
"response",
"?",
"request",
".",
"response",
".",
"json",
":",
"null",
")",
";",
"render",
"(",
")",
"{",
"const",
"responseJSON",
"=",
"RequestDetailsResponse",
".",
"getResponseJson",
"(",
"this",
".",
"props",
".",
"request",
")",
";",
"if",
"(",
"!",
"responseJSON",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
"EuiCodeBlock",
"language",
"=",
"\"json\"",
"paddingSize",
"=",
"\"s\"",
"isCopyable",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorResponseBody\"",
">",
"{",
"JSON",
".",
"stringify",
"(",
"responseJSON",
",",
"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,
40,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
40,
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
] |
661250 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"EuiTab",
",",
"EuiTabs",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"RequestDetailsRequest",
",",
"RequestDetailsResponse",
",",
"RequestDetailsStats",
"}",
"from",
"'./details'",
";",
"import",
"{",
"RequestDetailsProps",
"}",
"from",
"'./types'",
";",
"interface",
"RequestDetailsState",
"{",
"availableDetails",
":",
"DetailViewData",
"[",
"]",
";",
"selectedDetail",
":",
"DetailViewData",
"|",
"null",
";",
"}",
"export",
"interface",
"DetailViewData",
"{",
"name",
":",
"string",
";",
"label",
":",
"string",
";",
"component",
":",
"any",
";",
"}",
"const",
"DETAILS",
"=",
"[",
"{",
"name",
":",
"'Statistics'",
",",
"label",
":",
"i18n",
".",
"translate",
"(",
"'inspector.requests.statisticsTabLabel'",
",",
"{",
"defaultMessage",
":",
"'Statistics'",
",",
"}",
")",
",",
"component",
":",
"RequestDetailsStats",
",",
"}",
",",
"{",
"name",
":",
"'Request'",
",",
"label",
":",
"i18n",
".",
"translate",
"(",
"'inspector.requests.requestTabLabel'",
",",
"{",
"defaultMessage",
":",
"'Request'",
",",
"}",
")",
",",
"component",
":",
"RequestDetailsRequest",
",",
"}",
",",
"{",
"name",
":",
"'Response'",
",",
"label",
":",
"i18n",
".",
"translate",
"(",
"'inspector.requests.responseTabLabel'",
",",
"{",
"defaultMessage",
":",
"'Response'",
",",
"}",
")",
",",
"component",
":",
"RequestDetailsResponse",
",",
"}",
",",
"]",
";",
"export",
"class",
"RequestDetails",
"extends",
"Component",
"<",
"RequestDetailsProps",
",",
"RequestDetailsState",
">",
"{",
"static",
"propTypes",
"=",
"{",
"request",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"}",
";",
"state",
"=",
"{",
"availableDetails",
":",
"[",
"]",
",",
"selectedDetail",
":",
"null",
",",
"}",
";",
"static",
"getDerivedStateFromProps",
"(",
"nextProps",
",",
"prevState",
")",
"{",
"const",
"selectedDetail",
"=",
"prevState",
"&&",
"prevState",
".",
"selectedDetail",
";",
"const",
"availableDetails",
"=",
"DETAILS",
".",
"filter",
"(",
"(",
"detail",
")",
"=>",
"!",
"detail",
".",
"component",
".",
"shouldShow",
"||",
"detail",
".",
"component",
".",
"shouldShow",
"(",
"nextProps",
".",
"request",
")",
")",
";",
"if",
"(",
"selectedDetail",
"&&",
"availableDetails",
".",
"includes",
"(",
"selectedDetail",
")",
")",
"{",
"return",
"{",
"availableDetails",
"}",
";",
"}",
"return",
"{",
"availableDetails",
",",
"selectedDetail",
":",
"availableDetails",
"[",
"0",
"]",
",",
"}",
";",
"}",
"selectDetailsTab",
"=",
"(",
"detail",
")",
"=>",
"{",
"if",
"(",
"detail",
"!==",
"this",
".",
"state",
".",
"selectedDetail",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"selectedDetail",
":",
"detail",
",",
"}",
")",
";",
"}",
"}",
";",
"static",
"getSelectedDetailComponent",
"(",
"detail",
")",
"{",
"return",
"detail",
"?",
"detail",
".",
"component",
":",
"null",
";",
"}",
"renderDetailTab",
"=",
"(",
"detail",
")",
"=>",
"{",
"return",
"(",
"<",
"EuiTab",
"key",
"=",
"{",
"detail",
".",
"name",
"}",
"isSelected",
"=",
"{",
"detail",
"===",
"this",
".",
"state",
".",
"selectedDetail",
"}",
"onClick",
"=",
"{",
"(",
")",
"=>",
"this",
".",
"selectDetailsTab",
"(",
"detail",
")",
"}",
"data",
"-",
"test",
"-",
"subj",
"=",
"{",
"`inspectorRequestDetail${",
"detail",
".",
"name",
"}`",
"}",
">",
"{",
"detail",
".",
"label",
"}",
"<",
"/EuiTab>);",
"}",
";",
"render",
"(",
")",
"{",
"const",
"{",
"selectedDetail",
",",
"availableDetails",
"}",
"=",
"this",
".",
"state",
";",
"const",
"DetailComponent",
"=",
"RequestDetails",
".",
"getSelectedDetailComponent",
"(",
"selectedDetail",
")",
";",
"if",
"(",
"!",
"availableDetails",
".",
"length",
"||",
"!",
"DetailComponent",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"<",
">",
"<",
"EuiTabs",
"size",
"=",
"\"s\"",
">",
"{",
"this",
".",
"state",
".",
"availableDetails",
".",
"map",
"(",
"this",
".",
"renderDetailTab",
")",
"}",
"<",
"/EuiTabs>",
"<",
"DetailComponent",
"request",
"=",
"{",
"this",
".",
"props",
".",
"request",
"}",
"/",
">",
"<",
"/>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
6,
null,
26124,
null,
26125,
null,
null,
null,
5332,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
5332,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5332,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5332,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5332,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661251 | [
"import",
"React",
",",
"{",
"Component",
"}",
"from",
"'react'",
";",
"import",
"PropTypes",
"from",
"'prop-types'",
";",
"import",
"{",
"FormattedMessage",
"}",
"from",
"'@osd/i18n/react'",
";",
"import",
"{",
"EuiEmptyPrompt",
",",
"EuiSpacer",
",",
"EuiText",
",",
"EuiTextColor",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"{",
"RequestStatus",
"}",
"from",
"'../../../../common/adapters'",
";",
"import",
"{",
"Request",
"}",
"from",
"'../../../../common/adapters/request/types'",
";",
"import",
"{",
"InspectorViewProps",
"}",
"from",
"'../../../types'",
";",
"import",
"{",
"RequestSelector",
"}",
"from",
"'./request_selector'",
";",
"import",
"{",
"RequestDetails",
"}",
"from",
"'./request_details'",
";",
"interface",
"RequestSelectorState",
"{",
"requests",
":",
"Request",
"[",
"]",
";",
"request",
":",
"Request",
";",
"}",
"export",
"class",
"RequestsViewComponent",
"extends",
"Component",
"<",
"InspectorViewProps",
",",
"RequestSelectorState",
">",
"{",
"static",
"propTypes",
"=",
"{",
"adapters",
":",
"PropTypes",
".",
"object",
".",
"isRequired",
",",
"title",
":",
"PropTypes",
".",
"string",
".",
"isRequired",
",",
"}",
";",
"constructor",
"(",
"props",
")",
"{",
"super",
"(",
"props",
")",
";",
"props",
".",
"adapters",
".",
"requests",
".",
"on",
"(",
"'change'",
",",
"this",
".",
"_onRequestsChange",
")",
";",
"const",
"requests",
"=",
"props",
".",
"adapters",
".",
"requests",
".",
"getRequests",
"(",
")",
";",
"this",
".",
"state",
"=",
"{",
"requests",
",",
"request",
":",
"requests",
".",
"length",
"?",
"requests",
"[",
"0",
"]",
":",
"null",
",",
"}",
";",
"}",
"_onRequestsChange",
"=",
"(",
")",
"=>",
"{",
"const",
"requests",
"=",
"this",
".",
"props",
".",
"adapters",
".",
"requests",
".",
"getRequests",
"(",
")",
";",
"const",
"newState",
"=",
"{",
"requests",
"}",
"as",
"RequestSelectorState",
";",
"if",
"(",
"!",
"requests",
".",
"includes",
"(",
"this",
".",
"state",
".",
"request",
")",
")",
"{",
"newState",
".",
"request",
"=",
"requests",
".",
"length",
"?",
"requests",
"[",
"0",
"]",
":",
"null",
";",
"}",
"this",
".",
"setState",
"(",
"newState",
")",
";",
"}",
";",
"selectRequest",
"=",
"(",
"request",
")",
"=>",
"{",
"if",
"(",
"request",
"!==",
"this",
".",
"state",
".",
"request",
")",
"{",
"this",
".",
"setState",
"(",
"{",
"request",
"}",
")",
";",
"}",
"}",
";",
"componentWillUnmount",
"(",
")",
"{",
"this",
".",
"props",
".",
"adapters",
".",
"requests",
".",
"removeListener",
"(",
"'change'",
",",
"this",
".",
"_onRequestsChange",
")",
";",
"}",
"static",
"renderEmptyRequests",
"(",
")",
"{",
"return",
"(",
"<",
"EuiEmptyPrompt",
"data",
"-",
"test",
"-",
"subj",
"=",
"\"inspectorNoRequestsMessage\"",
"title",
"=",
"{",
"<",
"h2",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.noRequestsLoggedTitle\"",
"defaultMessage",
"=",
"\"No requests logged\"",
"/",
">",
"<",
"/h2>} body={<React.Fragment>",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.noRequestsLoggedDescription.elementHasNotLoggedAnyRequestsText\"",
"defaultMessage",
"=",
"\"The element hasn't logged any requests (yet).\"",
"/",
">",
"<",
"/p>",
"<",
"p",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.noRequestsLoggedDescription.whatDoesItUsuallyMeanText\"",
"defaultMessage",
"=",
"\"This usually means that there was no need to fetch any data or",
"that",
"the",
"element",
"has",
"not",
"yet",
"started",
"fetching",
"data",
".",
"\"/>",
"<",
"/p>",
"<",
"/React.Fragment>}/",
">",
")",
";",
"}",
"render",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"state",
".",
"requests",
"||",
"!",
"this",
".",
"state",
".",
"requests",
".",
"length",
")",
"{",
"return",
"RequestsViewComponent",
".",
"renderEmptyRequests",
"(",
")",
";",
"}",
"const",
"failedCount",
"=",
"this",
".",
"state",
".",
"requests",
".",
"filter",
"(",
"(",
"req",
")",
"=>",
"req",
".",
"status",
"===",
"RequestStatus",
".",
"ERROR",
")",
".",
"length",
";",
"return",
"(",
"<",
">",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
">",
"<",
"p",
"role",
"=",
"\"status\"",
"aria",
"-",
"live",
"=",
"\"polite\"",
"aria",
"-",
"atomic",
"=",
"\"true\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestWasMadeDescription\"",
"defaultMessage",
"=",
"\"{requestsCount, plural, one {# request was} other {# requests were} } made{failedRequests}\"",
"values",
"=",
"{",
"{",
"requestsCount",
":",
"this",
".",
"state",
".",
"requests",
".",
"length",
",",
"failedRequests",
":",
"failedCount",
">",
"0",
"?",
"(",
"<",
"EuiTextColor",
"color",
"=",
"\"danger\"",
">",
"<",
"FormattedMessage",
"id",
"=",
"\"inspector.requests.requestWasMadeDescription.requestHadFailureText\"",
"defaultMessage",
"=",
"\", {failedCount} had a failure\"",
"values",
"=",
"{",
"{",
"failedCount",
"}",
"}",
"/>",
"<",
"/EuiTextColor>) : (''),",
"}",
"}",
"/>",
"<",
"/p>",
"<",
"/EuiText>",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"<",
"RequestSelector",
"requests",
"=",
"{",
"this",
".",
"state",
".",
"requests",
"}",
"selectedRequest",
"=",
"{",
"this",
".",
"state",
".",
"request",
"}",
"onRequestChanged",
"=",
"{",
"this",
".",
"selectRequest",
"}",
"/",
">",
"<",
"EuiSpacer",
"size",
"=",
"\"xs\"",
"/",
">",
"{",
"this",
".",
"state",
".",
"request",
"&&",
"this",
".",
"state",
".",
"request",
".",
"description",
"&&",
"(",
"<",
"EuiText",
"size",
"=",
"\"xs\"",
">",
"<",
"p",
">",
"{",
"this",
".",
"state",
".",
"request",
".",
"description",
"}",
"<",
"/p>",
"<",
"/EuiText>)}",
"<",
"EuiSpacer",
"size",
"=",
"\"m\"",
"/",
">",
"{",
"this",
".",
"state",
".",
"request",
"&&",
"<",
"RequestDetails",
"request",
"=",
"{",
"this",
".",
"state",
".",
"request",
"}",
"/>}",
"<",
"/>);",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8962,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13404,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
40,
null,
null,
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,
40,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661252 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"RequestsViewComponent",
"}",
"from",
"'./components/requests_view'",
";",
"import",
"{",
"InspectorViewDescription",
"}",
"from",
"'../../types'",
";",
"import",
"{",
"Adapters",
"}",
"from",
"'../../../common'",
";",
"export",
"const",
"getRequestsViewDescription",
"=",
"(",
")",
":",
"InspectorViewDescription",
"=>",
"(",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'inspector.requests.requestsTitle'",
",",
"{",
"defaultMessage",
":",
"'Requests'",
",",
"}",
")",
",",
"order",
":",
"20",
",",
"help",
":",
"i18n",
".",
"translate",
"(",
"'inspector.requests.requestsDescriptionTooltip'",
",",
"{",
"defaultMessage",
":",
"'View the requests that collected the data'",
",",
"}",
")",
",",
"shouldShow",
"(",
"adapters",
")",
"{",
"return",
"Boolean",
"(",
"adapters",
".",
"requests",
")",
";",
"}",
",",
"component",
":",
"RequestsViewComponent",
",",
"}",
")",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3429,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
2434,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661253 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"*",
"as",
"React",
"from",
"'react'",
";",
"import",
"{",
"PluginInitializerContext",
",",
"CoreSetup",
",",
"CoreStart",
",",
"Plugin",
"}",
"from",
"'../../../core/public'",
";",
"import",
"{",
"toMountPoint",
"}",
"from",
"'../../opensearch_dashboards_react/public'",
";",
"import",
"{",
"InspectorViewRegistry",
"}",
"from",
"'./view_registry'",
";",
"import",
"{",
"InspectorOptions",
",",
"InspectorSession",
"}",
"from",
"'./types'",
";",
"import",
"{",
"InspectorPanel",
"}",
"from",
"'./ui/inspector_panel'",
";",
"import",
"{",
"Adapters",
"}",
"from",
"'../common'",
";",
"import",
"{",
"getRequestsViewDescription",
",",
"getDataViewDescription",
"}",
"from",
"'./views'",
";",
"export",
"interface",
"Setup",
"{",
"registerView",
":",
"InspectorViewRegistry",
"[",
"'register'",
"]",
";",
"__LEGACY",
":",
"{",
"views",
":",
"InspectorViewRegistry",
";",
"}",
";",
"}",
"export",
"interface",
"Start",
"{",
"param",
"{",
"object",
"}",
"adapters",
"returns",
"{",
"boolean",
"}",
"isAvailable",
":",
"(",
"adapters",
"?",
":",
"Adapters",
")",
"=>",
"boolean",
";",
"/**\n * Opens the inspector panel for the given adapters and close any previously opened\n * inspector panel. The previously panel will be closed also if no new panel will be\n * opened (e.g. because of the passed adapters no view is available). You can use\n * ",
"InspectorSession",
"on the return value to close that opened panel again.\n *\n * ",
"param",
"{",
"object",
"}",
"adapters",
"param",
"{",
"InspectorOptions",
"}",
"options",
"return",
"{",
"InspectorSession",
"}",
"throws",
"open",
":",
"(",
"adapters",
":",
"Adapters",
",",
"options",
"?",
":",
"InspectorOptions",
")",
"=>",
"InspectorSession",
";",
"}",
"export",
"class",
"InspectorPublicPlugin",
"implements",
"Plugin",
"<",
"Setup",
",",
"Start",
">",
"{",
"views",
":",
"InspectorViewRegistry",
"|",
"undefined",
";",
"constructor",
"(",
"initializerContext",
")",
"{",
"}",
"public",
"async",
"setup",
"(",
"core",
")",
"{",
"this",
".",
"views",
"=",
"new",
"InspectorViewRegistry",
"(",
")",
";",
"this",
".",
"views",
".",
"register",
"(",
"getDataViewDescription",
"(",
"core",
".",
"uiSettings",
")",
")",
";",
"this",
".",
"views",
".",
"register",
"(",
"getRequestsViewDescription",
"(",
")",
")",
";",
"return",
"{",
"registerView",
":",
"this",
".",
"views",
"!",
".",
"register",
".",
"bind",
"(",
"this",
".",
"views",
")",
",",
"__LEGACY",
":",
"{",
"views",
":",
"this",
".",
"views",
",",
"}",
",",
"}",
";",
"}",
"public",
"start",
"(",
"core",
")",
"{",
"const",
"isAvailable",
"=",
"(",
"adapters",
")",
"=>",
"this",
".",
"views",
"!",
".",
"getVisible",
"(",
"adapters",
")",
".",
"length",
">",
"0",
";",
"const",
"closeButtonLabel",
"=",
"i18n",
".",
"translate",
"(",
"'inspector.closeButton'",
",",
"{",
"defaultMessage",
":",
"'Close Inspector'",
",",
"}",
")",
";",
"const",
"open",
"=",
"(",
"adapters",
",",
"options",
"=",
"{",
"}",
")",
"=>",
"{",
"const",
"views",
"=",
"this",
".",
"views",
"!",
".",
"getVisible",
"(",
"adapters",
")",
";",
"if",
"(",
"!",
"views",
"||",
"views",
".",
"length",
"===",
"0",
")",
"{",
"throw",
"new",
"Error",
"(",
"`Tried to open an inspector without views being available.\n Make sure to call Inspector.isAvailable() with the same adapters before to check\n if an inspector can be shown.`",
")",
";",
"}",
"return",
"core",
".",
"overlays",
".",
"openFlyout",
"(",
"toMountPoint",
"(",
"<",
"InspectorPanel",
"views",
"=",
"{",
"views",
"}",
"adapters",
"=",
"{",
"adapters",
"}",
"title",
"=",
"{",
"options",
".",
"title",
"}",
"/",
">",
")",
",",
"{",
"'data-test-subj'",
":",
"'inspectorPanel'",
",",
"closeButtonAriaLabel",
":",
"closeButtonLabel",
",",
"}",
")",
";",
"}",
";",
"return",
"{",
"isAvailable",
",",
"open",
",",
"}",
";",
"}",
"public",
"stop",
"(",
")",
"{",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
6,
null,
557,
null,
null,
null,
null,
null,
null,
2434,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2434,
null,
23185,
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,
4,
null,
null,
null,
null,
null
] |
661254 | [
"import",
"{",
"i18n",
"}",
"from",
"'@osd/i18n'",
";",
"import",
"{",
"RenderErrorHandlerFnType",
",",
"ExpressionRenderError",
"}",
"from",
"'./types'",
";",
"import",
"{",
"getNotifications",
"}",
"from",
"'./services'",
";",
"import",
"{",
"IInterpreterRenderHandlers",
"}",
"from",
"'../common'",
";",
"export",
"const",
"renderErrorHandler",
"=",
"(",
"element",
",",
"error",
",",
"handlers",
")",
"=>",
"{",
"if",
"(",
"error",
".",
"name",
"===",
"'AbortError'",
")",
"{",
"handlers",
".",
"done",
"(",
")",
";",
"return",
";",
"}",
"getNotifications",
"(",
")",
".",
"toasts",
".",
"addError",
"(",
"error",
",",
"{",
"title",
":",
"i18n",
".",
"translate",
"(",
"'expressions.defaultErrorRenderer.errorTitle'",
",",
"{",
"defaultMessage",
":",
"'Error in visualisation'",
",",
"}",
")",
",",
"toastMessage",
":",
"error",
".",
"message",
",",
"}",
")",
";",
"handlers",
".",
"done",
"(",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
24363,
null,
null,
15,
null,
7659,
null,
12650,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661255 | [
"import",
"{",
"BehaviorSubject",
",",
"Observable",
",",
"Subject",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"filter",
",",
"map",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"defaults",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Adapters",
"}",
"from",
"'../../inspector/public'",
";",
"import",
"{",
"IExpressionLoaderParams",
"}",
"from",
"'./types'",
";",
"import",
"{",
"ExpressionAstExpression",
"}",
"from",
"'../common'",
";",
"import",
"{",
"ExecutionContract",
"}",
"from",
"'../common/execution/execution_contract'",
";",
"import",
"{",
"ExpressionRenderHandler",
"}",
"from",
"'./render'",
";",
"import",
"{",
"getExpressionsService",
"}",
"from",
"'./services'",
";",
"type",
"Data",
"=",
"any",
";",
"export",
"class",
"ExpressionLoader",
"{",
"data$",
":",
"Observable",
"<",
"Data",
">",
";",
"update$",
":",
"ExpressionRenderHandler",
"[",
"'update$'",
"]",
";",
"render$",
":",
"ExpressionRenderHandler",
"[",
"'render$'",
"]",
";",
"events$",
":",
"ExpressionRenderHandler",
"[",
"'events$'",
"]",
";",
"loading$",
":",
"Observable",
"<",
"void",
">",
";",
"private",
"execution",
":",
"ExecutionContract",
"|",
"undefined",
";",
"private",
"renderHandler",
":",
"ExpressionRenderHandler",
";",
"private",
"dataSubject",
":",
"Subject",
"<",
"Data",
">",
";",
"private",
"loadingSubject",
":",
"Subject",
"<",
"boolean",
">",
";",
"private",
"data",
":",
"Data",
";",
"private",
"params",
":",
"IExpressionLoaderParams",
"=",
"{",
"}",
";",
"constructor",
"(",
"element",
",",
"expression",
"?",
",",
"params",
"?",
")",
"{",
"this",
".",
"dataSubject",
"=",
"new",
"Subject",
"(",
")",
";",
"this",
".",
"data$",
"=",
"this",
".",
"dataSubject",
".",
"asObservable",
"(",
")",
";",
"this",
".",
"loadingSubject",
"=",
"new",
"BehaviorSubject",
"<",
"boolean",
">",
"(",
"false",
")",
";",
"this",
".",
"loading$",
"=",
"this",
".",
"loadingSubject",
".",
"asObservable",
"(",
")",
".",
"pipe",
"(",
"filter",
"(",
"(",
"_",
")",
"=>",
"_",
"===",
"true",
")",
",",
"map",
"(",
"(",
")",
"=>",
"void",
"0",
")",
")",
";",
"this",
".",
"renderHandler",
"=",
"new",
"ExpressionRenderHandler",
"(",
"element",
",",
"{",
"onRenderError",
":",
"params",
"&&",
"params",
".",
"onRenderError",
",",
"}",
")",
";",
"this",
".",
"render$",
"=",
"this",
".",
"renderHandler",
".",
"render$",
";",
"this",
".",
"update$",
"=",
"this",
".",
"renderHandler",
".",
"update$",
";",
"this",
".",
"events$",
"=",
"this",
".",
"renderHandler",
".",
"events$",
";",
"this",
".",
"update$",
".",
"subscribe",
"(",
"(",
"value",
")",
"=>",
"{",
"if",
"(",
"value",
")",
"{",
"const",
"{",
"newExpression",
",",
"newParams",
"}",
"=",
"value",
";",
"this",
".",
"update",
"(",
"newExpression",
",",
"newParams",
")",
";",
"}",
"}",
")",
";",
"this",
".",
"data$",
".",
"subscribe",
"(",
"(",
"data",
")",
"=>",
"{",
"this",
".",
"render",
"(",
"data",
")",
";",
"}",
")",
";",
"this",
".",
"render$",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"this",
".",
"loadingSubject",
".",
"next",
"(",
"false",
")",
";",
"}",
")",
";",
"this",
".",
"setParams",
"(",
"params",
")",
";",
"if",
"(",
"expression",
")",
"{",
"this",
".",
"loadingSubject",
".",
"next",
"(",
"true",
")",
";",
"this",
".",
"loadData",
"(",
"expression",
",",
"this",
".",
"params",
")",
";",
"}",
"}",
"destroy",
"(",
")",
"{",
"this",
".",
"dataSubject",
".",
"complete",
"(",
")",
";",
"this",
".",
"loadingSubject",
".",
"complete",
"(",
")",
";",
"this",
".",
"renderHandler",
".",
"destroy",
"(",
")",
";",
"if",
"(",
"this",
".",
"execution",
")",
"{",
"this",
".",
"execution",
".",
"cancel",
"(",
")",
";",
"}",
"}",
"cancel",
"(",
")",
"{",
"if",
"(",
"this",
".",
"execution",
")",
"{",
"this",
".",
"execution",
".",
"cancel",
"(",
")",
";",
"}",
"}",
"getExpression",
"(",
")",
"{",
"if",
"(",
"this",
".",
"execution",
")",
"{",
"return",
"this",
".",
"execution",
".",
"getExpression",
"(",
")",
";",
"}",
"}",
"getAst",
"(",
")",
"{",
"if",
"(",
"this",
".",
"execution",
")",
"{",
"return",
"this",
".",
"execution",
".",
"getAst",
"(",
")",
";",
"}",
"}",
"getElement",
"(",
")",
"{",
"return",
"this",
".",
"renderHandler",
".",
"getElement",
"(",
")",
";",
"}",
"inspect",
"(",
")",
"{",
"return",
"this",
".",
"execution",
"?",
"(",
"this",
".",
"execution",
".",
"inspect",
"(",
")",
"as",
"Adapters",
")",
":",
"undefined",
";",
"}",
"update",
"(",
"expression",
"?",
",",
"params",
"?",
")",
"{",
"this",
".",
"setParams",
"(",
"params",
")",
";",
"this",
".",
"loadingSubject",
".",
"next",
"(",
"true",
")",
";",
"if",
"(",
"expression",
")",
"{",
"this",
".",
"loadData",
"(",
"expression",
",",
"this",
".",
"params",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"data",
")",
"{",
"this",
".",
"render",
"(",
"this",
".",
"data",
")",
";",
"}",
"}",
"private",
"loadData",
"=",
"async",
"(",
"expression",
",",
"params",
")",
":",
"Promise",
"<",
"void",
">",
"=>",
"{",
"if",
"(",
"this",
".",
"execution",
"&&",
"this",
".",
"execution",
".",
"isPending",
")",
"{",
"this",
".",
"execution",
".",
"cancel",
"(",
")",
";",
"}",
"this",
".",
"setParams",
"(",
"params",
")",
";",
"this",
".",
"execution",
"=",
"getExpressionsService",
"(",
")",
".",
"execute",
"(",
"expression",
",",
"params",
".",
"context",
",",
"{",
"search",
":",
"params",
".",
"searchContext",
",",
"variables",
":",
"params",
".",
"variables",
"||",
"{",
"}",
",",
"inspectorAdapters",
":",
"params",
".",
"inspectorAdapters",
",",
"}",
")",
";",
"const",
"prevDataHandler",
"=",
"this",
".",
"execution",
";",
"const",
"data",
"=",
"await",
"prevDataHandler",
".",
"getData",
"(",
")",
";",
"if",
"(",
"this",
".",
"execution",
"!==",
"prevDataHandler",
")",
"{",
"return",
";",
"}",
"this",
".",
"dataSubject",
".",
"next",
"(",
"data",
")",
";",
"}",
";",
"private",
"render",
"(",
"data",
")",
"{",
"this",
".",
"renderHandler",
".",
"render",
"(",
"data",
",",
"this",
".",
"params",
".",
"uiState",
")",
";",
"}",
"private",
"setParams",
"(",
"params",
"?",
")",
"{",
"if",
"(",
"!",
"params",
"||",
"!",
"Object",
".",
"keys",
"(",
"params",
")",
".",
"length",
")",
"{",
"return",
";",
"}",
"if",
"(",
"params",
".",
"searchContext",
")",
"{",
"this",
".",
"params",
".",
"searchContext",
"=",
"defaults",
"(",
"{",
"}",
",",
"params",
".",
"searchContext",
",",
"this",
".",
"params",
".",
"searchContext",
"||",
"{",
"}",
")",
"as",
"any",
";",
"}",
"if",
"(",
"params",
".",
"uiState",
"&&",
"this",
".",
"params",
")",
"{",
"this",
".",
"params",
".",
"uiState",
"=",
"params",
".",
"uiState",
";",
"}",
"if",
"(",
"params",
".",
"variables",
"&&",
"this",
".",
"params",
")",
"{",
"this",
".",
"params",
".",
"variables",
"=",
"params",
".",
"variables",
";",
"}",
"this",
".",
"params",
".",
"inspectorAdapters",
"=",
"(",
"params",
".",
"inspectorAdapters",
"||",
"this",
".",
"execution",
"?.",
"inspect",
"(",
")",
")",
"as",
"Adapters",
";",
"}",
"}",
"export",
"type",
"IExpressionLoader",
"=",
"(",
"element",
":",
"HTMLElement",
",",
"expression",
":",
"string",
"|",
"ExpressionAstExpression",
",",
"params",
":",
"IExpressionLoaderParams",
")",
"=>",
"ExpressionLoader",
";",
"export",
"const",
"loader",
"=",
"(",
"element",
",",
"expression",
",",
"params",
")",
"=>",
"{",
"return",
"new",
"ExpressionLoader",
"(",
"element",
",",
"expression",
",",
"params",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
15,
null,
null,
null,
null,
4089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4,
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,
2945,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
15,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2434,
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,
4089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13941,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
294,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4,
null,
4089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
23186,
null,
null,
15,
null,
null,
null,
4089,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661256 | [
"import",
"React",
",",
"{",
"useRef",
",",
"useEffect",
",",
"useState",
",",
"useLayoutEffect",
"}",
"from",
"'react'",
";",
"import",
"classNames",
"from",
"'classnames'",
";",
"import",
"{",
"Observable",
",",
"Subscription",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"filter",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"useShallowCompareEffect",
"from",
"'react-use/lib/useShallowCompareEffect'",
";",
"import",
"{",
"EuiLoadingChart",
",",
"EuiProgress",
"}",
"from",
"'@elastic/eui'",
";",
"import",
"theme",
"from",
"'@elastic/eui/dist/eui_theme_light.json'",
";",
"import",
"{",
"IExpressionLoaderParams",
",",
"ExpressionRenderError",
"}",
"from",
"'./types'",
";",
"import",
"{",
"ExpressionAstExpression",
",",
"IInterpreterRenderHandlers",
"}",
"from",
"'../common'",
";",
"import",
"{",
"ExpressionLoader",
"}",
"from",
"'./loader'",
";",
"import",
"{",
"ExpressionRendererEvent",
"}",
"from",
"'./render'",
";",
"export",
"interface",
"ReactExpressionRendererProps",
"extends",
"IExpressionLoaderParams",
"{",
"className",
"?",
":",
"string",
";",
"dataAttrs",
"?",
":",
"string",
"[",
"]",
";",
"expression",
":",
"string",
"|",
"ExpressionAstExpression",
";",
"renderError",
"?",
":",
"(",
"message",
"?",
":",
"string",
"|",
"null",
",",
"error",
"?",
":",
"ExpressionRenderError",
"|",
"null",
")",
"=>",
"React",
".",
"ReactElement",
"|",
"React",
".",
"ReactElement",
"[",
"]",
";",
"padding",
"?",
":",
"'xs'",
"|",
"'s'",
"|",
"'m'",
"|",
"'l'",
"|",
"'xl'",
";",
"onEvent",
"?",
":",
"(",
"event",
":",
"ExpressionRendererEvent",
")",
"=>",
"void",
";",
"/**\n * An observable which can be used to re-run the expression without destroying the component\n */",
"reload$",
"?",
":",
"Observable",
"<",
"unknown",
">",
";",
"}",
"export",
"type",
"ReactExpressionRendererType",
"=",
"React",
".",
"ComponentType",
"<",
"ReactExpressionRendererProps",
">",
";",
"interface",
"State",
"{",
"isEmpty",
":",
"boolean",
";",
"isLoading",
":",
"boolean",
";",
"error",
":",
"null",
"|",
"ExpressionRenderError",
";",
"}",
"export",
"type",
"ExpressionRendererComponent",
"=",
"React",
".",
"FC",
"<",
"ReactExpressionRendererProps",
">",
";",
"const",
"defaultState",
"=",
"{",
"isEmpty",
":",
"true",
",",
"isLoading",
":",
"false",
",",
"error",
":",
"null",
",",
"}",
";",
"export",
"const",
"ReactExpressionRenderer",
"=",
"(",
"{",
"className",
",",
"dataAttrs",
",",
"padding",
",",
"renderError",
",",
"expression",
",",
"onEvent",
",",
"reload$",
",",
"...",
"expressionLoaderOptions",
"}",
")",
"=>",
"{",
"const",
"mountpoint",
"=",
"useRef",
"(",
"null",
")",
";",
"const",
"[",
"state",
",",
"setState",
"]",
"=",
"useState",
"<",
"State",
">",
"(",
"{",
"...",
"defaultState",
"}",
")",
";",
"const",
"hasCustomRenderErrorHandler",
"=",
"!",
"!",
"renderError",
";",
"const",
"expressionLoaderRef",
"=",
"useRef",
"(",
"null",
")",
";",
"const",
"hasHandledErrorRef",
"=",
"useRef",
"(",
"false",
")",
";",
"const",
"errorRenderHandlerRef",
"=",
"useRef",
"(",
"null",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"subs",
"=",
"[",
"]",
";",
"expressionLoaderRef",
".",
"current",
"=",
"new",
"ExpressionLoader",
"(",
"mountpoint",
".",
"current",
"!",
",",
"expression",
",",
"{",
"...",
"expressionLoaderOptions",
",",
"onRenderError",
":",
"hasCustomRenderErrorHandler",
"?",
"(",
"domNode",
",",
"error",
",",
"handlers",
")",
"=>",
"{",
"errorRenderHandlerRef",
".",
"current",
"=",
"handlers",
";",
"setState",
"(",
"(",
")",
"=>",
"(",
"{",
"...",
"defaultState",
",",
"isEmpty",
":",
"false",
",",
"error",
",",
"}",
")",
")",
";",
"if",
"(",
"expressionLoaderOptions",
".",
"onRenderError",
")",
"{",
"expressionLoaderOptions",
".",
"onRenderError",
"(",
"domNode",
",",
"error",
",",
"handlers",
")",
";",
"}",
"}",
":",
"expressionLoaderOptions",
".",
"onRenderError",
",",
"}",
")",
";",
"if",
"(",
"onEvent",
")",
"{",
"subs",
".",
"push",
"(",
"expressionLoaderRef",
".",
"current",
".",
"events$",
".",
"subscribe",
"(",
"(",
"event",
")",
"=>",
"{",
"onEvent",
"(",
"event",
")",
";",
"}",
")",
")",
";",
"}",
"subs",
".",
"push",
"(",
"expressionLoaderRef",
".",
"current",
".",
"loading$",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"hasHandledErrorRef",
".",
"current",
"=",
"false",
";",
"setState",
"(",
"(",
"prevState",
")",
"=>",
"(",
"{",
"...",
"prevState",
",",
"isLoading",
":",
"true",
"}",
")",
")",
";",
"}",
")",
",",
"expressionLoaderRef",
".",
"current",
".",
"render$",
".",
"pipe",
"(",
"filter",
"(",
"(",
")",
"=>",
"!",
"hasHandledErrorRef",
".",
"current",
")",
")",
".",
"subscribe",
"(",
"(",
"item",
")",
"=>",
"{",
"setState",
"(",
"(",
")",
"=>",
"(",
"{",
"...",
"defaultState",
",",
"isEmpty",
":",
"false",
",",
"}",
")",
")",
";",
"}",
")",
")",
";",
"return",
"(",
")",
"=>",
"{",
"subs",
".",
"forEach",
"(",
"(",
"s",
")",
"=>",
"s",
".",
"unsubscribe",
"(",
")",
")",
";",
"if",
"(",
"expressionLoaderRef",
".",
"current",
")",
"{",
"expressionLoaderRef",
".",
"current",
".",
"destroy",
"(",
")",
";",
"expressionLoaderRef",
".",
"current",
"=",
"null",
";",
"}",
"errorRenderHandlerRef",
".",
"current",
"=",
"null",
";",
"}",
";",
"}",
",",
"[",
"hasCustomRenderErrorHandler",
",",
"onEvent",
"]",
")",
";",
"useEffect",
"(",
"(",
")",
"=>",
"{",
"const",
"subscription",
"=",
"reload$",
"?.",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"expressionLoaderRef",
".",
"current",
")",
"{",
"expressionLoaderRef",
".",
"current",
".",
"update",
"(",
"expression",
",",
"expressionLoaderOptions",
")",
";",
"}",
"}",
")",
";",
"return",
"(",
")",
"=>",
"subscription",
"?.",
"unsubscribe",
"(",
")",
";",
"}",
",",
"[",
"reload$",
",",
"expression",
",",
"...",
"Object",
".",
"values",
"(",
"expressionLoaderOptions",
")",
"]",
")",
";",
"useShallowCompareEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"expressionLoaderRef",
".",
"current",
")",
"{",
"expressionLoaderRef",
".",
"current",
".",
"update",
"(",
"expression",
",",
"expressionLoaderOptions",
")",
";",
"}",
"}",
",",
"[",
"{",
"expression",
",",
"...",
"expressionLoaderOptions",
"}",
"]",
")",
";",
"useLayoutEffect",
"(",
"(",
")",
"=>",
"{",
"if",
"(",
"state",
".",
"error",
"&&",
"errorRenderHandlerRef",
".",
"current",
")",
"{",
"hasHandledErrorRef",
".",
"current",
"=",
"true",
";",
"errorRenderHandlerRef",
".",
"current",
".",
"done",
"(",
")",
";",
"errorRenderHandlerRef",
".",
"current",
"=",
"null",
";",
"}",
"}",
",",
"[",
"state",
".",
"error",
"]",
")",
";",
"const",
"classes",
"=",
"classNames",
"(",
"'expExpressionRenderer'",
",",
"{",
"'expExpressionRenderer-isEmpty'",
":",
"state",
".",
"isEmpty",
",",
"'expExpressionRenderer-hasError'",
":",
"!",
"!",
"state",
".",
"error",
",",
"className",
",",
"}",
")",
";",
"const",
"expressionStyles",
"=",
"{",
"}",
";",
"if",
"(",
"padding",
")",
"{",
"expressionStyles",
".",
"padding",
"=",
"theme",
".",
"paddingSizes",
"[",
"padding",
"]",
";",
"}",
"return",
"(",
"<",
"div",
"{",
"...",
"dataAttrs",
"}",
"className",
"=",
"{",
"classes",
"}",
">",
"{",
"state",
".",
"isEmpty",
"&&",
"<",
"EuiLoadingChart",
"mono",
"size",
"=",
"\"l\"",
"/",
">",
"}",
"{",
"state",
".",
"isLoading",
"&&",
"<",
"EuiProgress",
"size",
"=",
"\"xs\"",
"color",
"=",
"\"accent\"",
"position",
"=",
"\"absolute\"",
"/",
">",
"}",
"{",
"!",
"state",
".",
"isLoading",
"&&",
"state",
".",
"error",
"&&",
"renderError",
"&&",
"renderError",
"(",
"state",
".",
"error",
".",
"message",
",",
"state",
".",
"error",
")",
"}",
"<",
"div",
"className",
"=",
"\"expExpressionRenderer__expression\"",
"style",
"=",
"{",
"expressionStyles",
"}",
"ref",
"=",
"{",
"mountpoint",
"}",
"/",
">",
"<",
"/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,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661257 | [
"import",
"{",
"PluginInitializerContext",
",",
"CoreSetup",
",",
"CoreStart",
",",
"Plugin",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"ExpressionsService",
",",
"ExpressionsServiceSetup",
",",
"ExpressionsServiceStart",
",",
"ExecutionContext",
",",
"}",
"from",
"'../common'",
";",
"import",
"{",
"setRenderersRegistry",
",",
"setNotifications",
",",
"setExpressionsService",
"}",
"from",
"'./services'",
";",
"import",
"{",
"ReactExpressionRenderer",
"}",
"from",
"'./react_expression_renderer'",
";",
"import",
"{",
"ExpressionLoader",
",",
"loader",
"}",
"from",
"'./loader'",
";",
"import",
"{",
"render",
",",
"ExpressionRenderHandler",
"}",
"from",
"'./render'",
";",
"export",
"type",
"ExpressionsSetup",
"=",
"ExpressionsServiceSetup",
";",
"export",
"interface",
"ExpressionsStart",
"extends",
"ExpressionsServiceStart",
"{",
"ExpressionLoader",
":",
"typeof",
"ExpressionLoader",
";",
"ExpressionRenderHandler",
":",
"typeof",
"ExpressionRenderHandler",
";",
"loader",
":",
"typeof",
"loader",
";",
"ReactExpressionRenderer",
":",
"typeof",
"ReactExpressionRenderer",
";",
"render",
":",
"typeof",
"render",
";",
"}",
"export",
"class",
"ExpressionsPublicPlugin",
"implements",
"Plugin",
"<",
"ExpressionsSetup",
",",
"ExpressionsStart",
">",
"{",
"private",
"readonly",
"expressions",
":",
"ExpressionsService",
"=",
"new",
"ExpressionsService",
"(",
")",
";",
"constructor",
"(",
"initializerContext",
")",
"{",
"}",
"private",
"configureExecutor",
"(",
"core",
")",
"{",
"const",
"{",
"executor",
"}",
"=",
"this",
".",
"expressions",
";",
"const",
"getSavedObject",
"=",
"async",
"(",
"type",
",",
"id",
")",
"=>",
"{",
"const",
"[",
"start",
"]",
"=",
"await",
"core",
".",
"getStartServices",
"(",
")",
";",
"return",
"start",
".",
"savedObjects",
".",
"client",
".",
"get",
"(",
"type",
",",
"id",
")",
";",
"}",
";",
"executor",
".",
"extendContext",
"(",
"{",
"environment",
":",
"'client'",
",",
"getSavedObject",
",",
"}",
")",
";",
"}",
"public",
"setup",
"(",
"core",
")",
"{",
"this",
".",
"configureExecutor",
"(",
"core",
")",
";",
"const",
"{",
"expressions",
"}",
"=",
"this",
";",
"const",
"{",
"renderers",
"}",
"=",
"expressions",
";",
"setRenderersRegistry",
"(",
"renderers",
")",
";",
"setExpressionsService",
"(",
"expressions",
")",
";",
"const",
"setup",
"=",
"expressions",
".",
"setup",
"(",
")",
";",
"return",
"Object",
".",
"freeze",
"(",
"setup",
")",
";",
"}",
"public",
"start",
"(",
"core",
")",
"{",
"setNotifications",
"(",
"core",
".",
"notifications",
")",
";",
"const",
"{",
"expressions",
"}",
"=",
"this",
";",
"const",
"start",
"=",
"{",
"...",
"expressions",
".",
"start",
"(",
")",
",",
"ExpressionLoader",
",",
"ExpressionRenderHandler",
",",
"loader",
",",
"ReactExpressionRenderer",
",",
"render",
",",
"}",
";",
"return",
"Object",
".",
"freeze",
"(",
"start",
")",
";",
"}",
"public",
"stop",
"(",
")",
"{",
"this",
".",
"expressions",
".",
"stop",
"(",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4,
null,
501,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
23188,
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,
7534,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
14867,
null,
557,
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,
4,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661258 | [
"import",
"{",
"memoize",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"CoreSetup",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IIndexPattern",
",",
"IFieldType",
",",
"UI_SETTINGS",
"}",
"from",
"'../../../common'",
";",
"function",
"resolver",
"(",
"title",
",",
"field",
",",
"query",
",",
"boolFilter",
")",
"{",
"const",
"ttl",
"=",
"Math",
".",
"floor",
"(",
"Date",
".",
"now",
"(",
")",
"/",
"1000",
"/",
"60",
")",
";",
"return",
"[",
"ttl",
",",
"query",
",",
"title",
",",
"field",
".",
"name",
",",
"JSON",
".",
"stringify",
"(",
"boolFilter",
")",
"]",
".",
"join",
"(",
"'|'",
")",
";",
"}",
"export",
"type",
"ValueSuggestionsGetFn",
"=",
"(",
"args",
":",
"ValueSuggestionsGetFnArgs",
")",
"=>",
"Promise",
"<",
"any",
"[",
"]",
">",
";",
"interface",
"ValueSuggestionsGetFnArgs",
"{",
"indexPattern",
":",
"IIndexPattern",
";",
"field",
":",
"IFieldType",
";",
"query",
":",
"string",
";",
"boolFilter",
"?",
":",
"any",
"[",
"]",
";",
"signal",
"?",
":",
"AbortSignal",
";",
"}",
"export",
"const",
"getEmptyValueSuggestions",
"=",
"(",
"(",
")",
"=>",
"Promise",
".",
"resolve",
"(",
"[",
"]",
")",
")",
"as",
"ValueSuggestionsGetFn",
";",
"export",
"const",
"setupValueSuggestionProvider",
"=",
"(",
"core",
")",
":",
"ValueSuggestionsGetFn",
"=>",
"{",
"const",
"requestSuggestions",
"=",
"memoize",
"(",
"(",
"index",
",",
"field",
",",
"query",
",",
"boolFilter",
"=",
"[",
"]",
",",
"signal",
"?",
")",
"=>",
"core",
".",
"http",
".",
"fetch",
"(",
"`/api/opensearch-dashboards/suggestions/values/${",
"index",
"}`",
",",
"{",
"method",
":",
"'POST'",
",",
"body",
":",
"JSON",
".",
"stringify",
"(",
"{",
"query",
",",
"field",
":",
"field",
".",
"name",
",",
"boolFilter",
"}",
")",
",",
"signal",
",",
"}",
")",
",",
"resolver",
")",
";",
"return",
"async",
"(",
"{",
"indexPattern",
",",
"field",
",",
"query",
",",
"boolFilter",
",",
"signal",
",",
"}",
")",
":",
"Promise",
"<",
"any",
"[",
"]",
">",
"=>",
"{",
"const",
"shouldSuggestValues",
"=",
"core",
"!",
".",
"uiSettings",
".",
"get",
"<",
"boolean",
">",
"(",
"UI_SETTINGS",
".",
"FILTERS_EDITOR_SUGGEST_VALUES",
")",
";",
"const",
"{",
"title",
"}",
"=",
"indexPattern",
";",
"if",
"(",
"field",
".",
"type",
"===",
"'boolean'",
")",
"{",
"return",
"[",
"true",
",",
"false",
"]",
";",
"}",
"else",
"if",
"(",
"!",
"shouldSuggestValues",
"||",
"!",
"field",
".",
"aggregatable",
"||",
"field",
".",
"type",
"!==",
"'string'",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"await",
"requestSuggestions",
"(",
"title",
",",
"field",
",",
"query",
",",
"boolFilter",
",",
"signal",
")",
";",
"}",
";",
"}",
";"
] | [
null,
null,
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,
680,
null,
2,
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,
13405,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13405,
null,
null,
501,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2,
null,
680,
null,
2,
null,
null,
null,
null,
null,
null,
511,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661259 | [
"import",
"{",
"CoreSetup",
",",
"PluginInitializerContext",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"QuerySuggestionGetFn",
"}",
"from",
"'./providers/query_suggestion_provider'",
";",
"import",
"{",
"getEmptyValueSuggestions",
",",
"setupValueSuggestionProvider",
",",
"ValueSuggestionsGetFn",
",",
"}",
"from",
"'./providers/value_suggestion_provider'",
";",
"import",
"{",
"ConfigSchema",
"}",
"from",
"'../../config'",
";",
"export",
"class",
"AutocompleteService",
"{",
"autocompleteConfig",
":",
"ConfigSchema",
"[",
"'autocomplete'",
"]",
";",
"constructor",
"(",
"initializerContext",
")",
"{",
"const",
"{",
"autocomplete",
"}",
"=",
"initializerContext",
".",
"config",
".",
"get",
"<",
"ConfigSchema",
">",
"(",
")",
";",
"this",
".",
"autocompleteConfig",
"=",
"autocomplete",
";",
"}",
"private",
"readonly",
"querySuggestionProviders",
":",
"Map",
"<",
"string",
",",
"QuerySuggestionGetFn",
">",
"=",
"new",
"Map",
"(",
")",
";",
"private",
"getValueSuggestions",
"?",
":",
"ValueSuggestionsGetFn",
";",
"private",
"addQuerySuggestionProvider",
"=",
"(",
"language",
",",
"provider",
")",
":",
"void",
"=>",
"{",
"if",
"(",
"language",
"&&",
"provider",
"&&",
"this",
".",
"autocompleteConfig",
".",
"querySuggestions",
".",
"enabled",
")",
"{",
"this",
".",
"querySuggestionProviders",
".",
"set",
"(",
"language",
",",
"provider",
")",
";",
"}",
"}",
";",
"private",
"getQuerySuggestions",
":",
"QuerySuggestionGetFn",
"=",
"(",
"args",
")",
"=>",
"{",
"const",
"{",
"language",
"}",
"=",
"args",
";",
"const",
"provider",
"=",
"this",
".",
"querySuggestionProviders",
".",
"get",
"(",
"language",
")",
";",
"if",
"(",
"provider",
")",
"{",
"return",
"provider",
"(",
"args",
")",
";",
"}",
"}",
";",
"private",
"hasQuerySuggestions",
"=",
"(",
"language",
")",
"=>",
"this",
".",
"querySuggestionProviders",
".",
"has",
"(",
"language",
")",
";",
"public",
"public",
"setup",
"(",
"core",
")",
"{",
"this",
".",
"getValueSuggestions",
"=",
"this",
".",
"autocompleteConfig",
".",
"valueSuggestions",
".",
"enabled",
"?",
"setupValueSuggestionProvider",
"(",
"core",
")",
":",
"getEmptyValueSuggestions",
";",
"return",
"{",
"addQuerySuggestionProvider",
":",
"this",
".",
"addQuerySuggestionProvider",
",",
"obsolete",
"/** please use \"getProvider\" only from the start contract **/",
"getQuerySuggestions",
":",
"this",
".",
"getQuerySuggestions",
",",
"}",
";",
"}",
"public",
"public",
"start",
"(",
")",
"{",
"return",
"{",
"getQuerySuggestions",
":",
"this",
".",
"getQuerySuggestions",
",",
"hasQuerySuggestions",
":",
"this",
".",
"hasQuerySuggestions",
",",
"getValueSuggestions",
":",
"this",
".",
"getValueSuggestions",
"!",
",",
"}",
";",
"}",
"internal",
"public",
"clearProviders",
"(",
")",
"{",
"this",
".",
"querySuggestionProviders",
".",
"clear",
"(",
")",
";",
"}",
"}",
"public",
"export",
"type",
"AutocompleteSetup",
"=",
"ReturnType",
"<",
"AutocompleteService",
"[",
"'setup'",
"]",
">",
";",
"public",
"export",
"type",
"AutocompleteStart",
"=",
"ReturnType",
"<",
"AutocompleteService",
"[",
"'start'",
"]",
">",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
13942,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26128,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
13942,
null,
null,
null,
null,
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,
6,
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,
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,
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
] |
661260 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"*",
"as",
"Rx",
"from",
"'rxjs'",
";",
"import",
"{",
"map",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"const",
"defaultIsDuplicate",
"=",
"(",
"oldItem",
",",
"newItem",
")",
"=>",
"{",
"return",
"_",
".",
"isEqual",
"(",
"oldItem",
",",
"newItem",
")",
";",
"}",
";",
"interface",
"PersistedLogOptions",
"<",
"T",
"=",
"any",
">",
"{",
"maxLength",
"?",
":",
"number",
"|",
"string",
";",
"filterDuplicates",
"?",
":",
"boolean",
";",
"isDuplicate",
"?",
":",
"(",
"oldItem",
":",
"T",
",",
"newItem",
":",
"T",
")",
"=>",
"boolean",
";",
"}",
"export",
"class",
"PersistedLog",
"<",
"T",
"=",
"any",
">",
"{",
"public",
"name",
":",
"string",
";",
"public",
"maxLength",
"?",
":",
"number",
";",
"public",
"filterDuplicates",
"?",
":",
"boolean",
";",
"public",
"isDuplicate",
":",
"(",
"oldItem",
":",
"T",
",",
"newItem",
":",
"T",
")",
"=>",
"boolean",
";",
"public",
"storage",
":",
"IStorageWrapper",
";",
"public",
"items",
":",
"T",
"[",
"]",
";",
"private",
"update$",
"=",
"new",
"Rx",
".",
"BehaviorSubject",
"(",
"undefined",
")",
";",
"constructor",
"(",
"name",
",",
"options",
"=",
"{",
"}",
",",
"storage",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"maxLength",
"=",
"typeof",
"options",
".",
"maxLength",
"===",
"'string'",
"?",
"(",
"this",
".",
"maxLength",
"=",
"parseInt",
"(",
"options",
".",
"maxLength",
",",
"10",
")",
")",
":",
"options",
".",
"maxLength",
";",
"this",
".",
"filterDuplicates",
"=",
"options",
".",
"filterDuplicates",
"||",
"false",
";",
"this",
".",
"isDuplicate",
"=",
"options",
".",
"isDuplicate",
"||",
"defaultIsDuplicate",
";",
"this",
".",
"storage",
"=",
"storage",
";",
"this",
".",
"items",
"=",
"this",
".",
"storage",
".",
"get",
"(",
"this",
".",
"name",
")",
"||",
"[",
"]",
";",
"if",
"(",
"this",
".",
"maxLength",
"!==",
"undefined",
"&&",
"!",
"isNaN",
"(",
"this",
".",
"maxLength",
")",
")",
"{",
"this",
".",
"items",
"=",
"_",
".",
"take",
"(",
"this",
".",
"items",
",",
"this",
".",
"maxLength",
")",
";",
"}",
"}",
"public",
"add",
"(",
"val",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"this",
".",
"items",
";",
"}",
"if",
"(",
"this",
".",
"filterDuplicates",
")",
"{",
"_",
".",
"remove",
"(",
"this",
".",
"items",
",",
"(",
"item",
")",
"=>",
"{",
"return",
"this",
".",
"isDuplicate",
"(",
"item",
",",
"val",
")",
";",
"}",
")",
";",
"}",
"this",
".",
"items",
".",
"unshift",
"(",
"val",
")",
";",
"if",
"(",
"this",
".",
"maxLength",
"&&",
"!",
"isNaN",
"(",
"this",
".",
"maxLength",
")",
")",
"{",
"this",
".",
"items",
"=",
"_",
".",
"take",
"(",
"this",
".",
"items",
",",
"this",
".",
"maxLength",
")",
";",
"}",
"this",
".",
"storage",
".",
"set",
"(",
"this",
".",
"name",
",",
"this",
".",
"items",
")",
";",
"this",
".",
"update$",
".",
"next",
"(",
"undefined",
")",
";",
"return",
"this",
".",
"items",
";",
"}",
"public",
"get",
"(",
")",
"{",
"return",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"items",
")",
";",
"}",
"public",
"get$",
"(",
")",
"{",
"return",
"this",
".",
"update$",
".",
"pipe",
"(",
"map",
"(",
"(",
")",
"=>",
"this",
".",
"get",
"(",
")",
")",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
23131,
null,
null,
null,
null,
5834,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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
] |
661261 | [
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"import",
"{",
"PersistedLog",
"}",
"from",
"'../persisted_log'",
";",
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../common'",
";",
"internal",
"export",
"function",
"getQueryLog",
"(",
"uiSettings",
",",
"storage",
",",
"appName",
",",
"language",
")",
"{",
"return",
"new",
"PersistedLog",
"(",
"`typeahead:${",
"appName",
"}-${",
"language",
"}`",
",",
"{",
"maxLength",
":",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"HISTORY_LIMIT",
")",
",",
"filterDuplicates",
":",
"true",
",",
"}",
",",
"storage",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7139,
null,
1828,
null,
5834,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661262 | [
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"import",
"{",
"Query",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"getQueryLog",
"}",
"from",
"'./get_query_log'",
";",
"interface",
"AddToQueryLogDependencies",
"{",
"uiSettings",
":",
"IUiSettingsClient",
";",
"storage",
":",
"IStorageWrapper",
";",
"}",
"export",
"function",
"createAddToQueryLog",
"(",
"{",
"storage",
",",
"uiSettings",
"}",
")",
"{",
"param",
"appName",
"param",
"query",
"return",
"function",
"addToQueryLog",
"(",
"appName",
",",
"{",
"language",
",",
"query",
"}",
")",
"{",
"const",
"persistedLog",
"=",
"getQueryLog",
"(",
"uiSettings",
",",
"storage",
",",
"appName",
",",
"language",
")",
";",
"persistedLog",
".",
"add",
"(",
"query",
")",
";",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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
] |
661263 | [
"import",
"_",
"from",
"'lodash'",
";",
"returns",
"{",
"object",
"}",
"param",
"userInput",
"export",
"function",
"fromUser",
"(",
"userInput",
")",
"{",
"const",
"matchAll",
"=",
"''",
";",
"if",
"(",
"_",
".",
"isEmpty",
"(",
"userInput",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"_",
".",
"isObject",
"(",
"userInput",
")",
")",
"{",
"return",
"userInput",
";",
"}",
"userInput",
"=",
"userInput",
"||",
"''",
";",
"if",
"(",
"typeof",
"userInput",
"===",
"'string'",
")",
"{",
"const",
"trimmedUserInput",
"=",
"userInput",
".",
"trim",
"(",
")",
";",
"if",
"(",
"trimmedUserInput",
".",
"length",
"===",
"0",
")",
"{",
"return",
"matchAll",
";",
"}",
"if",
"(",
"trimmedUserInput",
"[",
"0",
"]",
"===",
"'{'",
")",
"{",
"try",
"{",
"return",
"JSON",
".",
"parse",
"(",
"trimmedUserInput",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"return",
"userInput",
";",
"}",
"}",
"else",
"{",
"return",
"userInput",
";",
"}",
"}",
"}"
] | [
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,
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
] |
661264 | [
"export",
"type",
"QueryLanguage",
"=",
"'kuery'",
"|",
"'lucene'",
";",
"export",
"function",
"getDefaultQuery",
"(",
"language",
"=",
"'kuery'",
")",
"{",
"return",
"{",
"query",
":",
"''",
",",
"language",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
24364,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661265 | [
"/**\n * This helper automatically handles matching pairs.\n * Specifically, it does the following:\n *\n * 1. If the key is a closer, and the character in front of the cursor is the\n * same, simply move the cursor forward.\n * 2. If the key is an opener, insert the opener at the beginning of the\n * selection, and the closer at the end of the selection, and move the\n * selection forward.\n * 3. If the backspace is hit, and the characters before and after the cursor\n * are a pair, remove both characters and move the cursor backward.\n */",
"const",
"pairs",
"=",
"[",
"'()'",
",",
"'[]'",
",",
"'{}'",
",",
"`''`",
",",
"'\"\"'",
"]",
";",
"const",
"openers",
"=",
"pairs",
".",
"map",
"(",
"(",
"pair",
")",
"=>",
"pair",
"[",
"0",
"]",
")",
";",
"const",
"closers",
"=",
"pairs",
".",
"map",
"(",
"(",
"pair",
")",
"=>",
"pair",
"[",
"1",
"]",
")",
";",
"interface",
"MatchPairsOptions",
"{",
"value",
":",
"string",
";",
"selectionStart",
":",
"number",
";",
"selectionEnd",
":",
"number",
";",
"key",
":",
"string",
";",
"metaKey",
":",
"boolean",
";",
"updateQuery",
":",
"(",
"query",
":",
"string",
",",
"selectionStart",
":",
"number",
",",
"selectionEnd",
":",
"number",
")",
"=>",
"void",
";",
"preventDefault",
":",
"(",
")",
"=>",
"void",
";",
"}",
"export",
"function",
"matchPairs",
"(",
"{",
"value",
",",
"selectionStart",
",",
"selectionEnd",
",",
"key",
",",
"metaKey",
",",
"updateQuery",
",",
"preventDefault",
",",
"}",
")",
"{",
"if",
"(",
"shouldMoveCursorForward",
"(",
"key",
",",
"value",
",",
"selectionStart",
",",
"selectionEnd",
")",
")",
"{",
"preventDefault",
"(",
")",
";",
"updateQuery",
"(",
"value",
",",
"selectionStart",
"+",
"1",
",",
"selectionEnd",
"+",
"1",
")",
";",
"}",
"else",
"if",
"(",
"shouldInsertMatchingCloser",
"(",
"key",
",",
"value",
",",
"selectionStart",
",",
"selectionEnd",
")",
")",
"{",
"preventDefault",
"(",
")",
";",
"const",
"newValue",
"=",
"value",
".",
"substr",
"(",
"0",
",",
"selectionStart",
")",
"+",
"key",
"+",
"value",
".",
"substring",
"(",
"selectionStart",
",",
"selectionEnd",
")",
"+",
"closers",
"[",
"openers",
".",
"indexOf",
"(",
"key",
")",
"]",
"+",
"value",
".",
"substr",
"(",
"selectionEnd",
")",
";",
"updateQuery",
"(",
"newValue",
",",
"selectionStart",
"+",
"1",
",",
"selectionEnd",
"+",
"1",
")",
";",
"}",
"else",
"if",
"(",
"shouldRemovePair",
"(",
"key",
",",
"metaKey",
",",
"value",
",",
"selectionStart",
",",
"selectionEnd",
")",
")",
"{",
"preventDefault",
"(",
")",
";",
"const",
"newValue",
"=",
"value",
".",
"substr",
"(",
"0",
",",
"selectionEnd",
"-",
"1",
")",
"+",
"value",
".",
"substr",
"(",
"selectionEnd",
"+",
"1",
")",
";",
"updateQuery",
"(",
"newValue",
",",
"selectionStart",
"-",
"1",
",",
"selectionEnd",
"-",
"1",
")",
";",
"}",
"}",
"function",
"shouldMoveCursorForward",
"(",
"key",
",",
"value",
",",
"selectionStart",
",",
"selectionEnd",
")",
"{",
"if",
"(",
"!",
"closers",
".",
"includes",
"(",
"key",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"selectionStart",
"!==",
"selectionEnd",
")",
"{",
"return",
"false",
";",
"}",
"return",
"value",
".",
"charAt",
"(",
"selectionEnd",
")",
"===",
"key",
";",
"}",
"function",
"shouldInsertMatchingCloser",
"(",
"key",
",",
"value",
",",
"selectionStart",
",",
"selectionEnd",
")",
"{",
"if",
"(",
"!",
"openers",
".",
"includes",
"(",
"key",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"selectionStart",
"!==",
"selectionEnd",
")",
"{",
"return",
"true",
";",
"}",
"const",
"precedingCharacter",
"=",
"value",
".",
"charAt",
"(",
"selectionStart",
"-",
"1",
")",
";",
"const",
"followingCharacter",
"=",
"value",
".",
"charAt",
"(",
"selectionStart",
"+",
"1",
")",
";",
"if",
"(",
"precedingCharacter",
"===",
"'\\\\'",
")",
"{",
"return",
"false",
";",
"}",
"return",
"!",
"(",
"[",
"'\"'",
",",
"`'`",
"]",
".",
"includes",
"(",
"key",
")",
"&&",
"(",
"isAlphanumeric",
"(",
"precedingCharacter",
")",
"||",
"isAlphanumeric",
"(",
"followingCharacter",
")",
")",
")",
";",
"}",
"function",
"shouldRemovePair",
"(",
"key",
",",
"metaKey",
",",
"value",
",",
"selectionStart",
",",
"selectionEnd",
")",
"{",
"if",
"(",
"key",
"!==",
"'Backspace'",
"||",
"metaKey",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"selectionStart",
"!==",
"selectionEnd",
")",
"{",
"return",
"false",
";",
"}",
"return",
"pairs",
".",
"includes",
"(",
"value",
".",
"substr",
"(",
"selectionEnd",
"-",
"1",
",",
"2",
")",
")",
";",
"}",
"function",
"isAlphanumeric",
"(",
"value",
"=",
"''",
")",
"{",
"return",
"value",
".",
"match",
"(",
"/[a-zA-Z0-9_]/",
")",
";",
"}"
] | [
null,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5,
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,
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
] |
661266 | [
"param",
"text",
"returns",
"{",
"string",
"}",
"export",
"function",
"toUser",
"(",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"typeof",
"text",
"===",
"'object'",
")",
"{",
"if",
"(",
"text",
".",
"query_string",
")",
"{",
"return",
"toUser",
"(",
"text",
".",
"query_string",
".",
"query",
")",
";",
"}",
"return",
"JSON",
".",
"stringify",
"(",
"text",
")",
";",
"}",
"return",
"''",
"+",
"text",
";",
"}"
] | [
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
] |
661267 | [
"import",
"{",
"Filter",
",",
"FilterStateStore",
"}",
"from",
"'../../../../common'",
";",
"param",
"{",
"object",
"}",
"first",
"param",
"{",
"object",
"}",
"second",
"returns",
"{",
"number",
"}",
"export",
"const",
"sortFilters",
"=",
"(",
"{",
"$state",
":",
"a",
"}",
",",
"{",
"$state",
":",
"b",
"}",
")",
":",
"number",
"=>",
"{",
"if",
"(",
"a",
"!",
".",
"store",
"===",
"b",
"!",
".",
"store",
")",
"{",
"return",
"0",
";",
"}",
"else",
"{",
"return",
"a",
"!",
".",
"store",
"===",
"FilterStateStore",
".",
"GLOBAL_STATE",
"&&",
"b",
"!",
".",
"store",
"!==",
"FilterStateStore",
".",
"GLOBAL_STATE",
"?",
"-",
"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,
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
] |
661268 | [
"import",
"{",
"Filter",
",",
"FILTERS",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapSpatialFilter",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"filter",
".",
"meta",
"&&",
"filter",
".",
"meta",
".",
"key",
"&&",
"filter",
".",
"meta",
".",
"alias",
"&&",
"filter",
".",
"meta",
".",
"type",
"===",
"FILTERS",
".",
"SPATIAL_FILTER",
")",
"{",
"return",
"{",
"key",
":",
"filter",
".",
"meta",
".",
"key",
",",
"type",
":",
"filter",
".",
"meta",
".",
"type",
",",
"value",
":",
"''",
",",
"}",
";",
"}",
"throw",
"filter",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661269 | [
"import",
"{",
"Filter",
",",
"isMatchAllFilter",
",",
"FILTERS",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapMatchAll",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"isMatchAllFilter",
"(",
"filter",
")",
")",
"{",
"return",
"{",
"type",
":",
"FILTERS",
".",
"MATCH_ALL",
",",
"key",
":",
"filter",
".",
"meta",
".",
"field",
",",
"value",
":",
"filter",
".",
"meta",
".",
"formattedValue",
"||",
"'all'",
",",
"}",
";",
"}",
"throw",
"filter",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661270 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"PhraseFilter",
",",
"FilterValueFormatter",
",",
"getPhraseFilterValue",
",",
"getPhraseFilterField",
",",
"FILTERS",
",",
"isScriptedPhraseFilter",
",",
"Filter",
",",
"isPhraseFilter",
",",
"}",
"from",
"'../../../../../common'",
";",
"const",
"getScriptedPhraseValue",
"=",
"(",
"filter",
")",
"=>",
"get",
"(",
"filter",
",",
"[",
"'script'",
",",
"'script'",
",",
"'params'",
",",
"'value'",
"]",
")",
";",
"const",
"getFormattedValueFn",
"=",
"(",
"value",
")",
"=>",
"{",
"return",
"(",
"formatter",
"?",
")",
"=>",
"{",
"return",
"formatter",
"?",
"formatter",
".",
"convert",
"(",
"value",
")",
":",
"value",
";",
"}",
";",
"}",
";",
"const",
"getParams",
"=",
"(",
"filter",
")",
"=>",
"{",
"const",
"scriptedPhraseValue",
"=",
"getScriptedPhraseValue",
"(",
"filter",
")",
";",
"const",
"isScriptedFilter",
"=",
"Boolean",
"(",
"scriptedPhraseValue",
")",
";",
"const",
"key",
"=",
"isScriptedFilter",
"?",
"filter",
".",
"meta",
".",
"field",
"||",
"''",
":",
"getPhraseFilterField",
"(",
"filter",
")",
";",
"const",
"query",
"=",
"scriptedPhraseValue",
"||",
"getPhraseFilterValue",
"(",
"filter",
")",
";",
"const",
"params",
"=",
"{",
"query",
"}",
";",
"return",
"{",
"key",
",",
"params",
",",
"type",
":",
"FILTERS",
".",
"PHRASE",
",",
"value",
":",
"getFormattedValueFn",
"(",
"query",
")",
",",
"}",
";",
"}",
";",
"export",
"const",
"isMapPhraseFilter",
"=",
"(",
"filter",
")",
":",
"filter",
"is",
"PhraseFilter",
"=>",
"isPhraseFilter",
"(",
"filter",
")",
"||",
"isScriptedPhraseFilter",
"(",
"filter",
")",
";",
"export",
"const",
"mapPhrase",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"!",
"isMapPhraseFilter",
"(",
"filter",
")",
")",
"{",
"throw",
"filter",
";",
"}",
"return",
"getParams",
"(",
"filter",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5043,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6653,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
5043,
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,
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,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661271 | [
"import",
"{",
"Filter",
",",
"isPhrasesFilter",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapPhrases",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"!",
"isPhrasesFilter",
"(",
"filter",
")",
")",
"{",
"throw",
"filter",
";",
"}",
"const",
"{",
"type",
",",
"key",
",",
"value",
",",
"params",
"}",
"=",
"filter",
".",
"meta",
";",
"return",
"{",
"type",
",",
"key",
",",
"value",
",",
"params",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661272 | [
"import",
"{",
"get",
",",
"hasIn",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"FilterValueFormatter",
",",
"RangeFilter",
",",
"isScriptedRangeFilter",
",",
"isRangeFilter",
",",
"Filter",
",",
"FILTERS",
",",
"}",
"from",
"'../../../../../common'",
";",
"const",
"getFormattedValueFn",
"=",
"(",
"left",
",",
"right",
")",
"=>",
"{",
"return",
"(",
"formatter",
"?",
")",
"=>",
"{",
"let",
"displayValue",
"=",
"`${",
"left",
"} to ${",
"right",
"}`",
";",
"if",
"(",
"formatter",
")",
"{",
"const",
"convert",
"=",
"formatter",
".",
"getConverterFor",
"(",
"'text'",
")",
";",
"displayValue",
"=",
"`${",
"convert",
"(",
"left",
")",
"} to ${",
"convert",
"(",
"right",
")",
"}`",
";",
"}",
"return",
"displayValue",
";",
"}",
";",
"}",
";",
"const",
"getFirstRangeKey",
"=",
"(",
"filter",
")",
"=>",
"filter",
".",
"range",
"&&",
"Object",
".",
"keys",
"(",
"filter",
".",
"range",
")",
"[",
"0",
"]",
";",
"const",
"getRangeByKey",
"=",
"(",
"filter",
",",
"key",
")",
"=>",
"get",
"(",
"filter",
",",
"[",
"'range'",
",",
"key",
"]",
")",
";",
"function",
"getParams",
"(",
"filter",
")",
"{",
"const",
"isScriptedRange",
"=",
"isScriptedRangeFilter",
"(",
"filter",
")",
";",
"const",
"key",
"=",
"(",
"isScriptedRange",
"?",
"filter",
".",
"meta",
".",
"field",
":",
"getFirstRangeKey",
"(",
"filter",
")",
")",
"||",
"''",
";",
"const",
"params",
"=",
"isScriptedRange",
"?",
"get",
"(",
"filter",
",",
"'script.script.params'",
")",
":",
"getRangeByKey",
"(",
"filter",
",",
"key",
")",
";",
"let",
"left",
"=",
"hasIn",
"(",
"params",
",",
"'gte'",
")",
"?",
"params",
".",
"gte",
":",
"params",
".",
"gt",
";",
"if",
"(",
"left",
"==",
"null",
")",
"left",
"=",
"-",
"Infinity",
";",
"let",
"right",
"=",
"hasIn",
"(",
"params",
",",
"'lte'",
")",
"?",
"params",
".",
"lte",
":",
"params",
".",
"lt",
";",
"if",
"(",
"right",
"==",
"null",
")",
"right",
"=",
"Infinity",
";",
"const",
"value",
"=",
"getFormattedValueFn",
"(",
"left",
",",
"right",
")",
";",
"return",
"{",
"type",
":",
"FILTERS",
".",
"RANGE",
",",
"key",
",",
"value",
",",
"params",
"}",
";",
"}",
"export",
"const",
"isMapRangeFilter",
"=",
"(",
"filter",
")",
":",
"filter",
"is",
"RangeFilter",
"=>",
"isRangeFilter",
"(",
"filter",
")",
"||",
"isScriptedRangeFilter",
"(",
"filter",
")",
";",
"export",
"const",
"mapRange",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"!",
"isMapRangeFilter",
"(",
"filter",
")",
")",
"{",
"throw",
"filter",
";",
"}",
"return",
"getParams",
"(",
"filter",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
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,
6653,
null,
null,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26131,
null,
null,
null,
null,
null,
null,
null,
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,
1865,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1865,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
1865,
null,
null,
null,
8,
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,
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,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661273 | [
"import",
"{",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Filter",
",",
"isExistsFilter",
",",
"FILTERS",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapExists",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"isExistsFilter",
"(",
"filter",
")",
")",
"{",
"return",
"{",
"type",
":",
"FILTERS",
".",
"EXISTS",
",",
"value",
":",
"FILTERS",
".",
"EXISTS",
",",
"key",
":",
"get",
"(",
"filter",
",",
"'exists.field'",
")",
",",
"}",
";",
"}",
"throw",
"filter",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661274 | [
"import",
"{",
"Filter",
",",
"isMissingFilter",
",",
"FILTERS",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapMissing",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"isMissingFilter",
"(",
"filter",
")",
")",
"{",
"return",
"{",
"type",
":",
"FILTERS",
".",
"MISSING",
",",
"value",
":",
"FILTERS",
".",
"MISSING",
",",
"key",
":",
"filter",
".",
"missing",
".",
"field",
",",
"}",
";",
"}",
"throw",
"filter",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661275 | [
"import",
"{",
"FILTERS",
",",
"Filter",
",",
"isQueryStringFilter",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapQueryString",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"isQueryStringFilter",
"(",
"filter",
")",
")",
"{",
"return",
"{",
"type",
":",
"FILTERS",
".",
"QUERY_STRING",
",",
"key",
":",
"'query'",
",",
"value",
":",
"filter",
".",
"query",
".",
"query_string",
".",
"query",
",",
"}",
";",
"}",
"throw",
"filter",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661276 | [
"import",
"{",
"FilterValueFormatter",
",",
"GeoBoundingBoxFilter",
",",
"FILTERS",
",",
"isGeoBoundingBoxFilter",
",",
"Filter",
",",
"}",
"from",
"'../../../../../common'",
";",
"const",
"getFormattedValueFn",
"=",
"(",
"params",
")",
"=>",
"{",
"return",
"(",
"formatter",
"?",
")",
"=>",
"{",
"const",
"corners",
"=",
"formatter",
"?",
"{",
"topLeft",
":",
"formatter",
".",
"convert",
"(",
"params",
".",
"top_left",
")",
",",
"bottomRight",
":",
"formatter",
".",
"convert",
"(",
"params",
".",
"bottom_right",
")",
",",
"}",
":",
"{",
"topLeft",
":",
"JSON",
".",
"stringify",
"(",
"params",
".",
"top_left",
")",
",",
"bottomRight",
":",
"JSON",
".",
"stringify",
"(",
"params",
".",
"bottom_right",
")",
",",
"}",
";",
"return",
"corners",
".",
"topLeft",
"+",
"' to '",
"+",
"corners",
".",
"bottomRight",
";",
"}",
";",
"}",
";",
"const",
"getParams",
"=",
"(",
"filter",
")",
"=>",
"{",
"const",
"key",
"=",
"Object",
".",
"keys",
"(",
"filter",
".",
"geo_bounding_box",
")",
".",
"filter",
"(",
"(",
"k",
")",
"=>",
"k",
"!==",
"'ignore_unmapped'",
")",
"[",
"0",
"]",
";",
"const",
"params",
"=",
"filter",
".",
"geo_bounding_box",
"[",
"key",
"]",
";",
"return",
"{",
"key",
",",
"params",
",",
"type",
":",
"FILTERS",
".",
"GEO_BOUNDING_BOX",
",",
"value",
":",
"getFormattedValueFn",
"(",
"params",
")",
",",
"}",
";",
"}",
";",
"export",
"const",
"mapGeoBoundingBox",
"=",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"!",
"isGeoBoundingBoxFilter",
"(",
"filter",
")",
")",
"{",
"throw",
"filter",
";",
"}",
"return",
"getParams",
"(",
"filter",
")",
";",
"}",
";"
] | [
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,
6653,
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,
6,
null,
null,
13396,
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,
6,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661277 | [
"import",
"{",
"FilterValueFormatter",
",",
"GeoPolygonFilter",
",",
"FILTERS",
",",
"Filter",
",",
"isGeoPolygonFilter",
",",
"}",
"from",
"'../../../../../common'",
";",
"const",
"POINTS_SEPARATOR",
"=",
"', '",
";",
"const",
"getFormattedValueFn",
"=",
"(",
"points",
")",
"=>",
"{",
"return",
"(",
"formatter",
"?",
")",
"=>",
"{",
"return",
"points",
".",
"map",
"(",
"(",
"point",
")",
"=>",
"(",
"formatter",
"?",
"formatter",
".",
"convert",
"(",
"point",
")",
":",
"JSON",
".",
"stringify",
"(",
"point",
")",
")",
")",
".",
"join",
"(",
"POINTS_SEPARATOR",
")",
";",
"}",
";",
"}",
";",
"function",
"getParams",
"(",
"filter",
")",
"{",
"const",
"key",
"=",
"Object",
".",
"keys",
"(",
"filter",
".",
"geo_polygon",
")",
".",
"filter",
"(",
"(",
"k",
")",
"=>",
"k",
"!==",
"'ignore_unmapped'",
")",
"[",
"0",
"]",
";",
"const",
"params",
"=",
"filter",
".",
"geo_polygon",
"[",
"key",
"]",
";",
"return",
"{",
"key",
",",
"params",
",",
"type",
":",
"FILTERS",
".",
"GEO_POLYGON",
",",
"value",
":",
"getFormattedValueFn",
"(",
"params",
".",
"points",
"||",
"[",
"]",
")",
",",
"}",
";",
"}",
"export",
"function",
"mapGeoPolygon",
"(",
"filter",
")",
"{",
"if",
"(",
"!",
"isGeoPolygonFilter",
"(",
"filter",
")",
")",
"{",
"throw",
"filter",
";",
"}",
"return",
"getParams",
"(",
"filter",
")",
";",
"}"
] | [
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,
5,
null,
null,
null,
null,
null,
6653,
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,
6,
null,
13397,
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,
6,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661278 | [
"import",
"{",
"find",
",",
"keys",
",",
"get",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Filter",
",",
"FILTERS",
"}",
"from",
"'../../../../../common'",
";",
"export",
"const",
"mapDefault",
"=",
"(",
"filter",
")",
"=>",
"{",
"const",
"metaProperty",
"=",
"/(^\\$|meta)/",
";",
"const",
"key",
"=",
"find",
"(",
"keys",
"(",
"filter",
")",
",",
"(",
"item",
")",
"=>",
"!",
"item",
".",
"match",
"(",
"metaProperty",
")",
")",
";",
"if",
"(",
"key",
")",
"{",
"const",
"type",
"=",
"FILTERS",
".",
"CUSTOM",
";",
"const",
"value",
"=",
"JSON",
".",
"stringify",
"(",
"get",
"(",
"filter",
",",
"key",
",",
"{",
"}",
")",
")",
";",
"return",
"{",
"type",
",",
"key",
",",
"value",
"}",
";",
"}",
"throw",
"filter",
";",
"}",
";"
] | [
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,
158,
null,
null,
null,
null,
27,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26132,
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
] |
661279 | [
"import",
"{",
"Filter",
"}",
"from",
"'../../../../common'",
";",
"const",
"noop",
"=",
"(",
")",
"=>",
"{",
"throw",
"new",
"Error",
"(",
"'No mappings have been found for filter.'",
")",
";",
"}",
";",
"export",
"const",
"generateMappingChain",
"=",
"(",
"fn",
",",
"next",
"=",
"noop",
")",
"=>",
"{",
"return",
"(",
"filter",
")",
"=>",
"{",
"try",
"{",
"return",
"fn",
"(",
"filter",
")",
";",
"}",
"catch",
"(",
"result",
")",
"{",
"if",
"(",
"result",
"===",
"filter",
")",
"{",
"return",
"next",
"(",
"filter",
")",
";",
"}",
"throw",
"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,
33,
null,
33,
null,
null,
null,
null,
null,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661280 | [
"import",
"{",
"reduceRight",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"mapSpatialFilter",
"}",
"from",
"'./mappers/map_spatial_filter'",
";",
"import",
"{",
"mapMatchAll",
"}",
"from",
"'./mappers/map_match_all'",
";",
"import",
"{",
"mapPhrase",
"}",
"from",
"'./mappers/map_phrase'",
";",
"import",
"{",
"mapPhrases",
"}",
"from",
"'./mappers/map_phrases'",
";",
"import",
"{",
"mapRange",
"}",
"from",
"'./mappers/map_range'",
";",
"import",
"{",
"mapExists",
"}",
"from",
"'./mappers/map_exists'",
";",
"import",
"{",
"mapMissing",
"}",
"from",
"'./mappers/map_missing'",
";",
"import",
"{",
"mapQueryString",
"}",
"from",
"'./mappers/map_query_string'",
";",
"import",
"{",
"mapGeoBoundingBox",
"}",
"from",
"'./mappers/map_geo_bounding_box'",
";",
"import",
"{",
"mapGeoPolygon",
"}",
"from",
"'./mappers/map_geo_polygon'",
";",
"import",
"{",
"mapDefault",
"}",
"from",
"'./mappers/map_default'",
";",
"import",
"{",
"generateMappingChain",
"}",
"from",
"'./generate_mapping_chain'",
";",
"import",
"{",
"Filter",
"}",
"from",
"'../../../../common'",
";",
"export",
"function",
"mapFilter",
"(",
"filter",
")",
"{",
"/** Mappers **/",
"const",
"mappers",
"=",
"[",
"mapSpatialFilter",
",",
"mapMatchAll",
",",
"mapRange",
",",
"mapPhrase",
",",
"mapPhrases",
",",
"mapExists",
",",
"mapMissing",
",",
"mapQueryString",
",",
"mapGeoBoundingBox",
",",
"mapGeoPolygon",
",",
"mapDefault",
",",
"]",
";",
"const",
"noop",
"=",
"(",
")",
"=>",
"{",
"throw",
"new",
"Error",
"(",
"'No mappings have been found for filter.'",
")",
";",
"}",
";",
"const",
"mapFn",
"=",
"reduceRight",
"<",
"Function",
",",
"Function",
">",
"(",
"mappers",
",",
"(",
"memo",
",",
"map",
")",
"=>",
"generateMappingChain",
"(",
"map",
",",
"memo",
")",
",",
"noop",
")",
";",
"const",
"mapped",
"=",
"mapFn",
"(",
"filter",
")",
";",
"filter",
".",
"meta",
"=",
"filter",
".",
"meta",
"||",
"{",
"}",
";",
"filter",
".",
"meta",
".",
"type",
"=",
"mapped",
".",
"type",
";",
"filter",
".",
"meta",
".",
"key",
"=",
"mapped",
".",
"key",
";",
"filter",
".",
"meta",
".",
"value",
"=",
"mapped",
".",
"value",
";",
"filter",
".",
"meta",
".",
"params",
"=",
"mapped",
".",
"params",
";",
"filter",
".",
"meta",
".",
"disabled",
"=",
"Boolean",
"(",
"filter",
".",
"meta",
".",
"disabled",
")",
";",
"filter",
".",
"meta",
".",
"negate",
"=",
"Boolean",
"(",
"filter",
".",
"meta",
".",
"negate",
")",
";",
"filter",
".",
"meta",
".",
"alias",
"=",
"filter",
".",
"meta",
".",
"alias",
"||",
"null",
";",
"return",
"filter",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
158,
null,
158,
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
] |
661281 | [
"import",
"{",
"compact",
",",
"flatten",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"mapFilter",
"}",
"from",
"'./map_filter'",
";",
"import",
"{",
"Filter",
"}",
"from",
"'../../../../common'",
";",
"export",
"const",
"mapAndFlattenFilters",
"=",
"(",
"filters",
")",
"=>",
"{",
"return",
"compact",
"(",
"flatten",
"(",
"filters",
")",
")",
".",
"map",
"(",
"(",
"item",
")",
"=>",
"mapFilter",
"(",
"item",
")",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
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,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661282 | [
"import",
"{",
"filter",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Filter",
",",
"compareFilters",
",",
"COMPARE_ALL_OPTIONS",
"}",
"from",
"'../../../../common'",
";",
"const",
"isEnabled",
"=",
"(",
"f",
")",
"=>",
"f",
"&&",
"f",
".",
"meta",
"&&",
"!",
"f",
".",
"meta",
".",
"disabled",
";",
"returns",
"{",
"bool",
"}",
"export",
"const",
"onlyDisabledFiltersChanged",
"=",
"(",
"newFilters",
"?",
",",
"oldFilters",
"?",
")",
"=>",
"{",
"const",
"newEnabledFilters",
"=",
"filter",
"(",
"newFilters",
"||",
"[",
"]",
",",
"isEnabled",
")",
";",
"const",
"oldEnabledFilters",
"=",
"filter",
"(",
"oldFilters",
"||",
"[",
"]",
",",
"isEnabled",
")",
";",
"return",
"compareFilters",
"(",
"oldEnabledFilters",
",",
"newEnabledFilters",
",",
"COMPARE_ALL_OPTIONS",
")",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
null,
158,
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,
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
] |
661283 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"Subject",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"sortFilters",
"}",
"from",
"'./lib/sort_filters'",
";",
"import",
"{",
"mapAndFlattenFilters",
"}",
"from",
"'./lib/map_and_flatten_filters'",
";",
"import",
"{",
"onlyDisabledFiltersChanged",
"}",
"from",
"'./lib/only_disabled'",
";",
"import",
"{",
"PartitionedFilters",
"}",
"from",
"'./types'",
";",
"import",
"{",
"FilterStateStore",
",",
"Filter",
",",
"uniqFilters",
",",
"isFilterPinned",
",",
"compareFilters",
",",
"COMPARE_ALL_OPTIONS",
",",
"UI_SETTINGS",
",",
"}",
"from",
"'../../../common'",
";",
"export",
"class",
"FilterManager",
"{",
"private",
"filters",
":",
"Filter",
"[",
"]",
"=",
"[",
"]",
";",
"private",
"updated$",
":",
"Subject",
"<",
"void",
">",
"=",
"new",
"Subject",
"(",
")",
";",
"private",
"fetch$",
":",
"Subject",
"<",
"void",
">",
"=",
"new",
"Subject",
"(",
")",
";",
"private",
"uiSettings",
":",
"IUiSettingsClient",
";",
"constructor",
"(",
"uiSettings",
")",
"{",
"this",
".",
"uiSettings",
"=",
"uiSettings",
";",
"}",
"private",
"mergeIncomingFilters",
"(",
"partitionedFilters",
")",
"{",
"const",
"globalFilters",
"=",
"partitionedFilters",
".",
"globalFilters",
";",
"const",
"appFilters",
"=",
"partitionedFilters",
".",
"appFilters",
";",
"const",
"cleanedAppFilters",
"=",
"[",
"]",
";",
"_",
".",
"each",
"(",
"appFilters",
",",
"function",
"(",
"filter",
",",
"i",
")",
"{",
"const",
"match",
"=",
"_",
".",
"find",
"(",
"globalFilters",
",",
"function",
"(",
"globalFilter",
")",
"{",
"return",
"compareFilters",
"(",
"globalFilter",
",",
"filter",
")",
";",
"}",
")",
";",
"if",
"(",
"!",
"match",
")",
"{",
"return",
"cleanedAppFilters",
".",
"push",
"(",
"filter",
")",
";",
"}",
"_",
".",
"assignIn",
"(",
"match",
".",
"meta",
",",
"filter",
".",
"meta",
")",
";",
"}",
")",
";",
"return",
"FilterManager",
".",
"mergeFilters",
"(",
"cleanedAppFilters",
",",
"globalFilters",
")",
";",
"}",
"private",
"static",
"mergeFilters",
"(",
"appFilters",
",",
"globalFilters",
")",
"{",
"return",
"uniqFilters",
"(",
"appFilters",
".",
"reverse",
"(",
")",
".",
"concat",
"(",
"globalFilters",
".",
"reverse",
"(",
")",
")",
")",
".",
"reverse",
"(",
")",
";",
"}",
"private",
"static",
"partitionFilters",
"(",
"filters",
")",
"{",
"const",
"[",
"globalFilters",
",",
"appFilters",
"]",
"=",
"_",
".",
"partition",
"(",
"filters",
",",
"isFilterPinned",
")",
";",
"return",
"{",
"globalFilters",
",",
"appFilters",
",",
"}",
";",
"}",
"private",
"handleStateUpdate",
"(",
"newFilters",
")",
"{",
"newFilters",
".",
"sort",
"(",
"sortFilters",
")",
";",
"const",
"filtersUpdated",
"=",
"!",
"compareFilters",
"(",
"this",
".",
"filters",
",",
"newFilters",
",",
"COMPARE_ALL_OPTIONS",
")",
";",
"const",
"updatedOnlyDisabledFilters",
"=",
"onlyDisabledFiltersChanged",
"(",
"newFilters",
",",
"this",
".",
"filters",
")",
";",
"this",
".",
"filters",
"=",
"newFilters",
";",
"if",
"(",
"filtersUpdated",
")",
"{",
"this",
".",
"updated$",
".",
"next",
"(",
")",
";",
"if",
"(",
"!",
"updatedOnlyDisabledFilters",
")",
"{",
"this",
".",
"fetch$",
".",
"next",
"(",
")",
";",
"}",
"}",
"}",
"public",
"getFilters",
"(",
")",
"{",
"return",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"filters",
")",
";",
"}",
"public",
"getAppFilters",
"(",
")",
"{",
"const",
"{",
"appFilters",
"}",
"=",
"this",
".",
"getPartitionedFilters",
"(",
")",
";",
"return",
"appFilters",
";",
"}",
"public",
"getGlobalFilters",
"(",
")",
"{",
"const",
"{",
"globalFilters",
"}",
"=",
"this",
".",
"getPartitionedFilters",
"(",
")",
";",
"return",
"globalFilters",
";",
"}",
"public",
"getPartitionedFilters",
"(",
")",
"{",
"return",
"FilterManager",
".",
"partitionFilters",
"(",
"this",
".",
"getFilters",
"(",
")",
")",
";",
"}",
"public",
"getUpdates$",
"(",
")",
"{",
"return",
"this",
".",
"updated$",
".",
"asObservable",
"(",
")",
";",
"}",
"public",
"getFetches$",
"(",
")",
"{",
"return",
"this",
".",
"fetch$",
".",
"asObservable",
"(",
")",
";",
"}",
"public",
"addFilters",
"(",
"filters",
",",
"pinFilterStatus",
"=",
"this",
".",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"FILTERS_PINNED_BY_DEFAULT",
")",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"filters",
")",
")",
"{",
"filters",
"=",
"[",
"filters",
"]",
";",
"}",
"if",
"(",
"filters",
".",
"length",
"===",
"0",
")",
"{",
"return",
";",
"}",
"const",
"store",
"=",
"pinFilterStatus",
"?",
"FilterStateStore",
".",
"GLOBAL_STATE",
":",
"FilterStateStore",
".",
"APP_STATE",
";",
"FilterManager",
".",
"setFiltersStore",
"(",
"filters",
",",
"store",
")",
";",
"const",
"mappedFilters",
"=",
"mapAndFlattenFilters",
"(",
"filters",
")",
";",
"const",
"newPartitionedFilters",
"=",
"FilterManager",
".",
"partitionFilters",
"(",
"mappedFilters",
")",
";",
"const",
"currentFilters",
"=",
"this",
".",
"getPartitionedFilters",
"(",
")",
";",
"currentFilters",
".",
"appFilters",
".",
"push",
"(",
"...",
"newPartitionedFilters",
".",
"appFilters",
")",
";",
"currentFilters",
".",
"globalFilters",
".",
"push",
"(",
"...",
"newPartitionedFilters",
".",
"globalFilters",
")",
";",
"const",
"newFilters",
"=",
"this",
".",
"mergeIncomingFilters",
"(",
"currentFilters",
")",
";",
"this",
".",
"handleStateUpdate",
"(",
"newFilters",
")",
";",
"}",
"public",
"setFilters",
"(",
"newFilters",
",",
"pinFilterStatus",
"=",
"this",
".",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"FILTERS_PINNED_BY_DEFAULT",
")",
")",
"{",
"const",
"store",
"=",
"pinFilterStatus",
"?",
"FilterStateStore",
".",
"GLOBAL_STATE",
":",
"FilterStateStore",
".",
"APP_STATE",
";",
"FilterManager",
".",
"setFiltersStore",
"(",
"newFilters",
",",
"store",
")",
";",
"const",
"mappedFilters",
"=",
"mapAndFlattenFilters",
"(",
"newFilters",
")",
";",
"const",
"newPartitionedFilters",
"=",
"FilterManager",
".",
"partitionFilters",
"(",
"mappedFilters",
")",
";",
"const",
"mergedFilters",
"=",
"this",
".",
"mergeIncomingFilters",
"(",
"newPartitionedFilters",
")",
";",
"this",
".",
"handleStateUpdate",
"(",
"mergedFilters",
")",
";",
"}",
"param",
"newGlobalFilters",
"public",
"setGlobalFilters",
"(",
"newGlobalFilters",
")",
"{",
"newGlobalFilters",
"=",
"mapAndFlattenFilters",
"(",
"newGlobalFilters",
")",
";",
"FilterManager",
".",
"setFiltersStore",
"(",
"newGlobalFilters",
",",
"FilterStateStore",
".",
"GLOBAL_STATE",
",",
"true",
")",
";",
"const",
"{",
"appFilters",
"}",
"=",
"this",
".",
"getPartitionedFilters",
"(",
")",
";",
"const",
"newFilters",
"=",
"this",
".",
"mergeIncomingFilters",
"(",
"{",
"appFilters",
",",
"globalFilters",
":",
"newGlobalFilters",
",",
"}",
")",
";",
"this",
".",
"handleStateUpdate",
"(",
"newFilters",
")",
";",
"}",
"param",
"newAppFilters",
"public",
"setAppFilters",
"(",
"newAppFilters",
")",
"{",
"newAppFilters",
"=",
"mapAndFlattenFilters",
"(",
"newAppFilters",
")",
";",
"FilterManager",
".",
"setFiltersStore",
"(",
"newAppFilters",
",",
"FilterStateStore",
".",
"APP_STATE",
",",
"true",
")",
";",
"const",
"{",
"globalFilters",
"}",
"=",
"this",
".",
"getPartitionedFilters",
"(",
")",
";",
"const",
"newFilters",
"=",
"this",
".",
"mergeIncomingFilters",
"(",
"{",
"globalFilters",
",",
"appFilters",
":",
"newAppFilters",
",",
"}",
")",
";",
"this",
".",
"handleStateUpdate",
"(",
"newFilters",
")",
";",
"}",
"public",
"removeFilter",
"(",
"filter",
")",
"{",
"const",
"filterIndex",
"=",
"_",
".",
"findIndex",
"(",
"this",
".",
"filters",
",",
"(",
"item",
")",
"=>",
"{",
"return",
"_",
".",
"isEqual",
"(",
"item",
".",
"meta",
",",
"filter",
".",
"meta",
")",
"&&",
"_",
".",
"isEqual",
"(",
"item",
".",
"query",
",",
"filter",
".",
"query",
")",
";",
"}",
")",
";",
"if",
"(",
"filterIndex",
">=",
"0",
")",
"{",
"const",
"newFilters",
"=",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"filters",
")",
";",
"newFilters",
".",
"splice",
"(",
"filterIndex",
",",
"1",
")",
";",
"this",
".",
"handleStateUpdate",
"(",
"newFilters",
")",
";",
"}",
"}",
"public",
"removeAll",
"(",
")",
"{",
"this",
".",
"setFilters",
"(",
"[",
"]",
")",
";",
"}",
"public",
"static",
"setFiltersStore",
"(",
"filters",
",",
"store",
",",
"shouldOverrideStore",
"=",
"false",
")",
"{",
"_",
".",
"map",
"(",
"filters",
",",
"(",
"filter",
")",
"=>",
"{",
"if",
"(",
"shouldOverrideStore",
"||",
"filter",
".",
"$state",
"===",
"undefined",
")",
"{",
"filter",
".",
"$state",
"=",
"{",
"store",
"}",
";",
"}",
"}",
")",
";",
"}",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
5,
null,
4419,
null,
null,
null,
5,
null,
null,
null,
null,
null,
null,
5,
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,
5,
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,
null,
4419,
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,
4,
null,
5,
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,
5,
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,
4419,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
4276,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4419,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4419,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4,
null,
5,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4276,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4419,
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,
4,
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,
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,
4,
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,
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,
4,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
4,
null,
5,
null,
4276,
null,
8,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661284 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"IFieldType",
",",
"IIndexPattern",
",",
"Filter",
",",
"isExistsFilter",
",",
"isPhraseFilter",
",",
"getPhraseFilterValue",
",",
"getPhraseFilterField",
",",
"isScriptedPhraseFilter",
",",
"buildFilter",
",",
"FilterStateStore",
",",
"FILTERS",
",",
"}",
"from",
"'../../../../common'",
";",
"import",
"{",
"FilterManager",
"}",
"from",
"'../filter_manager'",
";",
"function",
"getExistingFilter",
"(",
"appFilters",
",",
"fieldName",
",",
"value",
")",
"{",
"return",
"_",
".",
"find",
"(",
"appFilters",
",",
"function",
"(",
"filter",
")",
"{",
"if",
"(",
"!",
"filter",
")",
"return",
";",
"if",
"(",
"fieldName",
"===",
"'_exists_'",
"&&",
"isExistsFilter",
"(",
"filter",
")",
")",
"{",
"return",
"filter",
".",
"exists",
"!",
".",
"field",
"===",
"value",
";",
"}",
"if",
"(",
"isPhraseFilter",
"(",
"filter",
")",
")",
"{",
"return",
"getPhraseFilterField",
"(",
"filter",
")",
"===",
"fieldName",
"&&",
"getPhraseFilterValue",
"(",
"filter",
")",
"===",
"value",
";",
"}",
"if",
"(",
"isScriptedPhraseFilter",
"(",
"filter",
")",
")",
"{",
"return",
"filter",
".",
"meta",
".",
"field",
"===",
"fieldName",
"&&",
"filter",
".",
"script",
"!",
".",
"script",
".",
"params",
".",
"value",
"===",
"value",
";",
"}",
"}",
")",
"as",
"any",
";",
"}",
"function",
"updateExistingFilter",
"(",
"existingFilter",
",",
"negate",
")",
"{",
"existingFilter",
".",
"meta",
".",
"disabled",
"=",
"false",
";",
"if",
"(",
"existingFilter",
".",
"meta",
".",
"negate",
"!==",
"negate",
")",
"{",
"existingFilter",
".",
"meta",
".",
"negate",
"=",
"!",
"existingFilter",
".",
"meta",
".",
"negate",
";",
"}",
"}",
"param",
"{",
"FilterManager",
"}",
"filterManager",
"param",
"{",
"Field",
"|",
"string",
"}",
"field",
"param",
"{",
"any",
"}",
"values",
"param",
"{",
"string",
"}",
"operation",
"param",
"{",
"string",
"}",
"index",
"returns",
"{",
"object",
"}",
"export",
"function",
"generateFilters",
"(",
"filterManager",
",",
"field",
",",
"values",
",",
"operation",
",",
"index",
")",
"{",
"values",
"=",
"Array",
".",
"isArray",
"(",
"values",
")",
"?",
"values",
":",
"[",
"values",
"]",
";",
"const",
"fieldObj",
"=",
"(",
"_",
".",
"isObject",
"(",
"field",
")",
"?",
"field",
":",
"{",
"name",
":",
"field",
",",
"}",
")",
"as",
"IFieldType",
";",
"const",
"fieldName",
"=",
"fieldObj",
".",
"name",
";",
"const",
"newFilters",
"=",
"[",
"]",
";",
"const",
"appFilters",
"=",
"filterManager",
".",
"getAppFilters",
"(",
")",
";",
"const",
"negate",
"=",
"operation",
"===",
"'-'",
";",
"let",
"filter",
";",
"_",
".",
"each",
"(",
"values",
",",
"function",
"(",
"value",
")",
"{",
"const",
"existing",
"=",
"getExistingFilter",
"(",
"appFilters",
",",
"fieldName",
",",
"value",
")",
";",
"if",
"(",
"existing",
")",
"{",
"updateExistingFilter",
"(",
"existing",
",",
"negate",
")",
";",
"filter",
"=",
"existing",
";",
"}",
"else",
"{",
"const",
"tmpIndexPattern",
"=",
"{",
"id",
":",
"index",
"}",
"as",
"IIndexPattern",
";",
"const",
"filterType",
"=",
"fieldName",
"===",
"'_exists_'",
"?",
"FILTERS",
".",
"EXISTS",
":",
"FILTERS",
".",
"PHRASE",
";",
"const",
"actualFieldObj",
"=",
"fieldName",
"===",
"'_exists_'",
"?",
"(",
"{",
"name",
":",
"value",
"}",
"as",
"IFieldType",
")",
":",
"fieldObj",
";",
"const",
"isNullFilter",
"=",
"value",
"===",
"null",
"||",
"value",
"===",
"undefined",
";",
"filter",
"=",
"buildFilter",
"(",
"tmpIndexPattern",
",",
"actualFieldObj",
",",
"isNullFilter",
"?",
"FILTERS",
".",
"EXISTS",
":",
"filterType",
",",
"isNullFilter",
"?",
"!",
"negate",
":",
"negate",
",",
"false",
",",
"value",
",",
"null",
",",
"FilterStateStore",
".",
"APP_STATE",
")",
";",
"}",
"newFilters",
".",
"push",
"(",
"filter",
")",
";",
"}",
")",
";",
"return",
"newFilters",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
158,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
158,
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,
5,
null,
9191,
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,
680,
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,
5,
null,
null,
null,
null,
null,
5,
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,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
737,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
680,
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
] |
661285 | [
"import",
"{",
"IUiSettingsClient",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"import",
"{",
"TimeHistory",
",",
"Timefilter",
",",
"TimeHistoryContract",
",",
"TimefilterContract",
"}",
"from",
"'./index'",
";",
"import",
"{",
"UI_SETTINGS",
"}",
"from",
"'../../../common'",
";",
"internal",
"export",
"interface",
"TimeFilterServiceDependencies",
"{",
"uiSettings",
":",
"IUiSettingsClient",
";",
"storage",
":",
"IStorageWrapper",
";",
"}",
"export",
"class",
"TimefilterService",
"{",
"public",
"setup",
"(",
"{",
"uiSettings",
",",
"storage",
"}",
")",
"{",
"const",
"timefilterConfig",
"=",
"{",
"timeDefaults",
":",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"TIMEPICKER_TIME_DEFAULTS",
")",
",",
"refreshIntervalDefaults",
":",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"TIMEPICKER_REFRESH_INTERVAL_DEFAULTS",
")",
",",
"}",
";",
"const",
"history",
"=",
"new",
"TimeHistory",
"(",
"storage",
")",
";",
"const",
"timefilter",
"=",
"new",
"Timefilter",
"(",
"timefilterConfig",
",",
"history",
")",
";",
"return",
"{",
"timefilter",
",",
"history",
",",
"}",
";",
"}",
"public",
"start",
"(",
")",
"{",
"}",
"public",
"stop",
"(",
")",
"{",
"}",
"}",
"public",
"export",
"interface",
"TimefilterSetup",
"{",
"timefilter",
":",
"TimefilterContract",
";",
"history",
":",
"TimeHistoryContract",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26133,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661286 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"RefreshInterval",
"}",
"from",
"'../../../../common'",
";",
"import",
"{",
"InputTimeRange",
"}",
"from",
"'../types'",
";",
"const",
"valueOf",
"=",
"function",
"(",
"o",
")",
"{",
"if",
"(",
"o",
")",
"return",
"o",
".",
"valueOf",
"(",
")",
";",
"}",
";",
"export",
"function",
"areRefreshIntervalsDifferent",
"(",
"rangeA",
",",
"rangeB",
")",
"{",
"if",
"(",
"_",
".",
"isObject",
"(",
"rangeA",
")",
"&&",
"_",
".",
"isObject",
"(",
"rangeB",
")",
")",
"{",
"if",
"(",
"valueOf",
"(",
"rangeA",
".",
"value",
")",
"!==",
"valueOf",
"(",
"rangeB",
".",
"value",
")",
"||",
"valueOf",
"(",
"rangeA",
".",
"pause",
")",
"!==",
"valueOf",
"(",
"rangeB",
".",
"pause",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"else",
"{",
"return",
"!",
"_",
".",
"isEqual",
"(",
"rangeA",
",",
"rangeB",
")",
";",
"}",
"return",
"false",
";",
"}",
"export",
"function",
"areTimeRangesDifferent",
"(",
"rangeA",
",",
"rangeB",
")",
"{",
"if",
"(",
"rangeA",
"&&",
"rangeB",
"&&",
"_",
".",
"isObject",
"(",
"rangeA",
")",
"&&",
"_",
".",
"isObject",
"(",
"rangeB",
")",
")",
"{",
"if",
"(",
"valueOf",
"(",
"rangeA",
".",
"to",
")",
"!==",
"valueOf",
"(",
"rangeB",
".",
"to",
")",
"||",
"valueOf",
"(",
"rangeA",
".",
"from",
")",
"!==",
"valueOf",
"(",
"rangeB",
".",
"from",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"else",
"{",
"return",
"!",
"_",
".",
"isEqual",
"(",
"rangeA",
",",
"rangeB",
")",
";",
"}",
"return",
"false",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
6114,
null,
6114,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
8963,
null,
8963,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661287 | [
"import",
"{",
"parse",
"}",
"from",
"'query-string'",
";",
"internal",
"export",
"function",
"parseQueryString",
"(",
")",
"{",
"const",
"hrefSplit",
"=",
"window",
".",
"location",
".",
"href",
".",
"split",
"(",
"'?'",
")",
";",
"if",
"(",
"hrefSplit",
".",
"length",
"<=",
"1",
")",
"{",
"return",
"{",
"}",
";",
"}",
"return",
"parse",
"(",
"hrefSplit",
"[",
"1",
"]",
",",
"{",
"sort",
":",
"false",
"}",
")",
";",
"}"
] | [
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
] |
661288 | [
"import",
"{",
"parseQueryString",
"}",
"from",
"'./parse_querystring'",
";",
"internal",
"export",
"function",
"getForceNow",
"(",
")",
"{",
"const",
"forceNow",
"=",
"parseQueryString",
"(",
")",
".",
"forceNow",
"as",
"string",
";",
"if",
"(",
"!",
"forceNow",
")",
"{",
"return",
";",
"}",
"const",
"ticks",
"=",
"Date",
".",
"parse",
"(",
"forceNow",
")",
";",
"if",
"(",
"isNaN",
"(",
"ticks",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"`forceNow query parameter, ${",
"forceNow",
"}, can't be parsed by Date.parse`",
")",
";",
"}",
"return",
"new",
"Date",
"(",
"ticks",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26,
null,
null,
null,
null,
2,
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
] |
661289 | [
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"import",
"{",
"PersistedLog",
"}",
"from",
"'../persisted_log'",
";",
"import",
"{",
"TimeRange",
"}",
"from",
"'../../../common'",
";",
"export",
"class",
"TimeHistory",
"{",
"private",
"history",
":",
"PersistedLog",
"<",
"TimeRange",
">",
";",
"constructor",
"(",
"storage",
")",
"{",
"const",
"historyOptions",
"=",
"{",
"maxLength",
":",
"10",
",",
"filterDuplicates",
":",
"true",
",",
"isDuplicate",
":",
"(",
"oldItem",
",",
"newItem",
")",
"=>",
"{",
"return",
"oldItem",
".",
"from",
"===",
"newItem",
".",
"from",
"&&",
"oldItem",
".",
"to",
"===",
"newItem",
".",
"to",
";",
"}",
",",
"}",
";",
"this",
".",
"history",
"=",
"new",
"PersistedLog",
"(",
"'opensearchDashboards.timepicker.timeHistory'",
",",
"historyOptions",
",",
"storage",
")",
";",
"}",
"add",
"(",
"time",
")",
"{",
"if",
"(",
"!",
"time",
"||",
"!",
"time",
".",
"from",
"||",
"!",
"time",
".",
"to",
")",
"{",
"return",
";",
"}",
"const",
"justStringsTime",
"=",
"{",
"from",
":",
"moment",
".",
"isMoment",
"(",
"time",
".",
"from",
")",
"?",
"time",
".",
"from",
".",
"toISOString",
"(",
")",
":",
"time",
".",
"from",
",",
"to",
":",
"moment",
".",
"isMoment",
"(",
"time",
".",
"to",
")",
"?",
"time",
".",
"to",
".",
"toISOString",
"(",
")",
":",
"time",
".",
"to",
",",
"}",
";",
"this",
".",
"history",
".",
"add",
"(",
"justStringsTime",
")",
";",
"}",
"get",
"(",
")",
"{",
"return",
"this",
".",
"history",
".",
"get",
"(",
")",
";",
"}",
"}",
"export",
"type",
"TimeHistoryContract",
"=",
"PublicMethodsOf",
"<",
"TimeHistory",
">",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5834,
null,
null,
null,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1285,
null,
1285,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
1285,
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
] |
661290 | [
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"Subject",
",",
"BehaviorSubject",
"}",
"from",
"'rxjs'",
";",
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"areRefreshIntervalsDifferent",
",",
"areTimeRangesDifferent",
"}",
"from",
"'./lib/diff_time_picker_vals'",
";",
"import",
"{",
"getForceNow",
"}",
"from",
"'./lib/get_force_now'",
";",
"import",
"{",
"TimefilterConfig",
",",
"InputTimeRange",
",",
"TimeRangeBounds",
"}",
"from",
"'./types'",
";",
"import",
"{",
"calculateBounds",
",",
"getTime",
",",
"RefreshInterval",
",",
"TimeRange",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"TimeHistoryContract",
"}",
"from",
"'./time_history'",
";",
"import",
"{",
"IndexPattern",
"}",
"from",
"'../../index_patterns'",
";",
"export",
"class",
"Timefilter",
"{",
"private",
"enabledUpdated$",
"=",
"new",
"BehaviorSubject",
"(",
"false",
")",
";",
"private",
"timeUpdate$",
"=",
"new",
"Subject",
"(",
")",
";",
"private",
"refreshIntervalUpdate$",
"=",
"new",
"Subject",
"(",
")",
";",
"private",
"autoRefreshFetch$",
"=",
"new",
"Subject",
"(",
")",
";",
"private",
"fetch$",
"=",
"new",
"Subject",
"(",
")",
";",
"private",
"_time",
":",
"TimeRange",
";",
"private",
"_refreshInterval",
"!",
":",
"RefreshInterval",
";",
"private",
"_history",
":",
"TimeHistoryContract",
";",
"private",
"_isTimeRangeSelectorEnabled",
":",
"boolean",
"=",
"false",
";",
"private",
"_isAutoRefreshSelectorEnabled",
":",
"boolean",
"=",
"false",
";",
"private",
"_autoRefreshIntervalId",
":",
"number",
"=",
"0",
";",
"private",
"readonly",
"timeDefaults",
":",
"TimeRange",
";",
"private",
"readonly",
"refreshIntervalDefaults",
":",
"RefreshInterval",
";",
"constructor",
"(",
"config",
",",
"timeHistory",
")",
"{",
"this",
".",
"_history",
"=",
"timeHistory",
";",
"this",
".",
"timeDefaults",
"=",
"config",
".",
"timeDefaults",
";",
"this",
".",
"refreshIntervalDefaults",
"=",
"config",
".",
"refreshIntervalDefaults",
";",
"this",
".",
"_time",
"=",
"config",
".",
"timeDefaults",
";",
"this",
".",
"setRefreshInterval",
"(",
"config",
".",
"refreshIntervalDefaults",
")",
";",
"}",
"public",
"isTimeRangeSelectorEnabled",
"(",
")",
"{",
"return",
"this",
".",
"_isTimeRangeSelectorEnabled",
";",
"}",
"public",
"isAutoRefreshSelectorEnabled",
"(",
")",
"{",
"return",
"this",
".",
"_isAutoRefreshSelectorEnabled",
";",
"}",
"public",
"getEnabledUpdated$",
"=",
"(",
")",
"=>",
"{",
"return",
"this",
".",
"enabledUpdated$",
".",
"asObservable",
"(",
")",
";",
"}",
";",
"public",
"getTimeUpdate$",
"=",
"(",
")",
"=>",
"{",
"return",
"this",
".",
"timeUpdate$",
".",
"asObservable",
"(",
")",
";",
"}",
";",
"public",
"getRefreshIntervalUpdate$",
"=",
"(",
")",
"=>",
"{",
"return",
"this",
".",
"refreshIntervalUpdate$",
".",
"asObservable",
"(",
")",
";",
"}",
";",
"public",
"getAutoRefreshFetch$",
"=",
"(",
")",
"=>",
"{",
"return",
"this",
".",
"autoRefreshFetch$",
".",
"asObservable",
"(",
")",
";",
"}",
";",
"public",
"getFetch$",
"=",
"(",
")",
"=>",
"{",
"return",
"this",
".",
"fetch$",
".",
"asObservable",
"(",
")",
";",
"}",
";",
"public",
"getTime",
"=",
"(",
")",
":",
"TimeRange",
"=>",
"{",
"const",
"{",
"from",
",",
"to",
"}",
"=",
"this",
".",
"_time",
";",
"return",
"{",
"...",
"this",
".",
"_time",
",",
"from",
":",
"moment",
".",
"isMoment",
"(",
"from",
")",
"?",
"from",
".",
"toISOString",
"(",
")",
":",
"from",
",",
"to",
":",
"moment",
".",
"isMoment",
"(",
"to",
")",
"?",
"to",
".",
"toISOString",
"(",
")",
":",
"to",
",",
"}",
";",
"}",
";",
"param",
"{",
"Object",
"}",
"time",
"property",
"property",
"public",
"setTime",
"=",
"(",
"time",
")",
"=>",
"{",
"const",
"newTime",
"=",
"Object",
".",
"assign",
"(",
"this",
".",
"getTime",
"(",
")",
",",
"time",
")",
";",
"if",
"(",
"areTimeRangesDifferent",
"(",
"this",
".",
"getTime",
"(",
")",
",",
"newTime",
")",
")",
"{",
"this",
".",
"_time",
"=",
"{",
"from",
":",
"newTime",
".",
"from",
",",
"to",
":",
"newTime",
".",
"to",
",",
"}",
";",
"this",
".",
"_history",
".",
"add",
"(",
"this",
".",
"_time",
")",
";",
"this",
".",
"timeUpdate$",
".",
"next",
"(",
")",
";",
"this",
".",
"fetch$",
".",
"next",
"(",
")",
";",
"}",
"}",
";",
"public",
"getRefreshInterval",
"=",
"(",
")",
"=>",
"{",
"return",
"_",
".",
"clone",
"(",
"this",
".",
"_refreshInterval",
")",
";",
"}",
";",
"param",
"{",
"Object",
"}",
"refreshInterval",
"property",
"property",
"public",
"setRefreshInterval",
"=",
"(",
"refreshInterval",
")",
"=>",
"{",
"const",
"prevRefreshInterval",
"=",
"this",
".",
"getRefreshInterval",
"(",
")",
";",
"const",
"newRefreshInterval",
"=",
"{",
"...",
"prevRefreshInterval",
",",
"...",
"refreshInterval",
"}",
";",
"if",
"(",
"newRefreshInterval",
".",
"value",
"<=",
"0",
")",
"{",
"newRefreshInterval",
".",
"value",
"=",
"0",
";",
"newRefreshInterval",
".",
"pause",
"=",
"true",
";",
"}",
"this",
".",
"_refreshInterval",
"=",
"{",
"value",
":",
"newRefreshInterval",
".",
"value",
",",
"pause",
":",
"newRefreshInterval",
".",
"pause",
",",
"}",
";",
"if",
"(",
"prevRefreshInterval",
"&&",
"areRefreshIntervalsDifferent",
"(",
"prevRefreshInterval",
",",
"newRefreshInterval",
")",
")",
"{",
"this",
".",
"refreshIntervalUpdate$",
".",
"next",
"(",
")",
";",
"if",
"(",
"!",
"newRefreshInterval",
".",
"pause",
"&&",
"newRefreshInterval",
".",
"value",
"!==",
"0",
")",
"{",
"this",
".",
"fetch$",
".",
"next",
"(",
")",
";",
"}",
"}",
"clearInterval",
"(",
"this",
".",
"_autoRefreshIntervalId",
")",
";",
"if",
"(",
"!",
"newRefreshInterval",
".",
"pause",
")",
"{",
"this",
".",
"_autoRefreshIntervalId",
"=",
"window",
".",
"setInterval",
"(",
"(",
")",
"=>",
"this",
".",
"autoRefreshFetch$",
".",
"next",
"(",
")",
",",
"newRefreshInterval",
".",
"value",
")",
";",
"}",
"}",
";",
"public",
"createFilter",
"=",
"(",
"indexPattern",
",",
"timeRange",
"?",
")",
"=>",
"{",
"return",
"getTime",
"(",
"indexPattern",
",",
"timeRange",
"?",
"timeRange",
":",
"this",
".",
"_time",
",",
"{",
"forceNow",
":",
"this",
".",
"getForceNow",
"(",
")",
",",
"}",
")",
";",
"}",
";",
"public",
"getBounds",
"(",
")",
"{",
"return",
"this",
".",
"calculateBounds",
"(",
"this",
".",
"_time",
")",
";",
"}",
"public",
"calculateBounds",
"(",
"timeRange",
")",
"{",
"return",
"calculateBounds",
"(",
"timeRange",
",",
"{",
"forceNow",
":",
"this",
".",
"getForceNow",
"(",
")",
"}",
")",
";",
"}",
"public",
"getActiveBounds",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isTimeRangeSelectorEnabled",
"(",
")",
")",
"{",
"return",
"this",
".",
"getBounds",
"(",
")",
";",
"}",
"}",
"/**\n * Show the time bounds selector part of the time filter\n */",
"public",
"enableTimeRangeSelector",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"_isTimeRangeSelectorEnabled",
"=",
"true",
";",
"this",
".",
"enabledUpdated$",
".",
"next",
"(",
"true",
")",
";",
"}",
";",
"/**\n * Hide the time bounds selector part of the time filter\n */",
"public",
"disableTimeRangeSelector",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"_isTimeRangeSelectorEnabled",
"=",
"false",
";",
"this",
".",
"enabledUpdated$",
".",
"next",
"(",
"false",
")",
";",
"}",
";",
"/**\n * Show the auto refresh part of the time filter\n */",
"public",
"enableAutoRefreshSelector",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"_isAutoRefreshSelectorEnabled",
"=",
"true",
";",
"this",
".",
"enabledUpdated$",
".",
"next",
"(",
"true",
")",
";",
"}",
";",
"/**\n * Hide the auto refresh part of the time filter\n */",
"public",
"disableAutoRefreshSelector",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"_isAutoRefreshSelectorEnabled",
"=",
"false",
";",
"this",
".",
"enabledUpdated$",
".",
"next",
"(",
"false",
")",
";",
"}",
";",
"public",
"getTimeDefaults",
"(",
")",
"{",
"return",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"timeDefaults",
")",
";",
"}",
"public",
"getRefreshIntervalDefaults",
"(",
")",
"{",
"return",
"_",
".",
"cloneDeep",
"(",
"this",
".",
"refreshIntervalDefaults",
")",
";",
"}",
"private",
"getForceNow",
"=",
"(",
")",
"=>",
"{",
"return",
"getForceNow",
"(",
")",
";",
"}",
";",
"}",
"export",
"type",
"TimefilterContract",
"=",
"PublicMethodsOf",
"<",
"Timefilter",
">",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26137,
null,
23190,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
8963,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
584,
null,
1285,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2831,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2831,
null,
1285,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2831,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1285,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6114,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661291 | [
"import",
"moment",
"from",
"'moment'",
";",
"import",
"{",
"keys",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"TimefilterContract",
"}",
"from",
"'../../timefilter'",
";",
"import",
"{",
"RangeFilter",
",",
"TimeRange",
"}",
"from",
"'../../../../common'",
";",
"export",
"function",
"convertRangeFilterToTimeRange",
"(",
"filter",
")",
"{",
"const",
"key",
"=",
"keys",
"(",
"filter",
".",
"range",
")",
"[",
"0",
"]",
";",
"const",
"values",
"=",
"filter",
".",
"range",
"[",
"key",
"]",
";",
"return",
"{",
"from",
":",
"moment",
"(",
"values",
".",
"gt",
"||",
"values",
".",
"gte",
")",
",",
"to",
":",
"moment",
"(",
"values",
".",
"lt",
"||",
"values",
".",
"lte",
")",
",",
"}",
";",
"}",
"export",
"function",
"convertRangeFilterToTimeRangeString",
"(",
"filter",
")",
"{",
"const",
"{",
"from",
",",
"to",
"}",
"=",
"convertRangeFilterToTimeRange",
"(",
"filter",
")",
";",
"return",
"{",
"from",
":",
"from",
"?.",
"toISOString",
"(",
")",
",",
"to",
":",
"to",
"?.",
"toISOString",
"(",
")",
",",
"}",
";",
"}",
"export",
"function",
"changeTimeFilter",
"(",
"timeFilter",
",",
"filter",
")",
"{",
"timeFilter",
".",
"setTime",
"(",
"convertRangeFilterToTimeRange",
"(",
"filter",
")",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
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,
1865,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
4088,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
1285,
null,
1865,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
6901,
null,
1865,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661292 | [
"import",
"{",
"keys",
",",
"partition",
"}",
"from",
"'lodash'",
";",
"import",
"{",
"Filter",
",",
"isRangeFilter",
",",
"RangeFilter",
",",
"TimeRange",
"}",
"from",
"'../../../../common'",
";",
"import",
"{",
"convertRangeFilterToTimeRangeString",
"}",
"from",
"'./change_time_filter'",
";",
"export",
"function",
"extractTimeFilter",
"(",
"timeFieldName",
",",
"filters",
")",
"{",
"const",
"[",
"timeRangeFilter",
",",
"restOfFilters",
"]",
"=",
"partition",
"(",
"filters",
",",
"(",
"obj",
")",
"=>",
"{",
"let",
"key",
";",
"if",
"(",
"isRangeFilter",
"(",
"obj",
")",
")",
"{",
"key",
"=",
"keys",
"(",
"obj",
".",
"range",
")",
"[",
"0",
"]",
";",
"}",
"return",
"Boolean",
"(",
"key",
"&&",
"key",
"===",
"timeFieldName",
")",
";",
"}",
")",
";",
"return",
"{",
"restOfFilters",
",",
"timeRangeFilter",
":",
"timeRangeFilter",
"[",
"0",
"]",
"as",
"RangeFilter",
"|",
"undefined",
",",
"}",
";",
"}",
"export",
"function",
"extractTimeRange",
"(",
"filters",
",",
"timeFieldName",
"?",
")",
"{",
"if",
"(",
"!",
"timeFieldName",
")",
"return",
"{",
"restOfFilters",
":",
"filters",
",",
"timeRange",
":",
"undefined",
"}",
";",
"const",
"{",
"timeRangeFilter",
",",
"restOfFilters",
"}",
"=",
"extractTimeFilter",
"(",
"timeFieldName",
",",
"filters",
")",
";",
"return",
"{",
"restOfFilters",
",",
"timeRange",
":",
"timeRangeFilter",
"?",
"convertRangeFilterToTimeRangeString",
"(",
"timeRangeFilter",
")",
":",
"undefined",
",",
"}",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
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,
2,
null,
5,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
158,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661293 | [
"import",
"dateMath",
"from",
"'@elastic/datemath'",
";",
"import",
"{",
"TimeRange",
"}",
"from",
"'../../../../common'",
";",
"export",
"function",
"validateTimeRange",
"(",
"time",
"?",
")",
"{",
"if",
"(",
"!",
"time",
")",
"return",
"false",
";",
"const",
"momentDateFrom",
"=",
"dateMath",
".",
"parse",
"(",
"time",
".",
"from",
")",
";",
"const",
"momentDateTo",
"=",
"dateMath",
".",
"parse",
"(",
"time",
".",
"to",
")",
";",
"return",
"!",
"!",
"(",
"momentDateFrom",
"&&",
"momentDateFrom",
".",
"isValid",
"(",
")",
"&&",
"momentDateTo",
"&&",
"momentDateTo",
".",
"isValid",
"(",
")",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
8,
null,
1285,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661294 | [
"import",
"{",
"SavedObjectsClientContract",
",",
"SavedObjectAttributes",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"SavedQueryAttributes",
",",
"SavedQuery",
",",
"SavedQueryService",
"}",
"from",
"'./types'",
";",
"type",
"SerializedSavedQueryAttributes",
"=",
"SavedObjectAttributes",
"&",
"SavedQueryAttributes",
"&",
"{",
"query",
":",
"{",
"query",
":",
"string",
";",
"language",
":",
"string",
";",
"}",
";",
"}",
";",
"export",
"const",
"createSavedQueryService",
"=",
"(",
"savedObjectsClient",
")",
":",
"SavedQueryService",
"=>",
"{",
"const",
"saveQuery",
"=",
"async",
"(",
"attributes",
",",
"{",
"overwrite",
"=",
"false",
"}",
"=",
"{",
"}",
")",
"=>",
"{",
"if",
"(",
"!",
"attributes",
".",
"title",
".",
"length",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Cannot create saved query without a title'",
")",
";",
"}",
"const",
"query",
"=",
"{",
"query",
":",
"typeof",
"attributes",
".",
"query",
".",
"query",
"===",
"'string'",
"?",
"attributes",
".",
"query",
".",
"query",
":",
"JSON",
".",
"stringify",
"(",
"attributes",
".",
"query",
".",
"query",
")",
",",
"language",
":",
"attributes",
".",
"query",
".",
"language",
",",
"}",
";",
"const",
"queryObject",
"=",
"{",
"title",
":",
"attributes",
".",
"title",
".",
"trim",
"(",
")",
",",
"description",
":",
"attributes",
".",
"description",
",",
"query",
",",
"}",
";",
"if",
"(",
"attributes",
".",
"filters",
")",
"{",
"queryObject",
".",
"filters",
"=",
"attributes",
".",
"filters",
";",
"}",
"if",
"(",
"attributes",
".",
"timefilter",
")",
"{",
"queryObject",
".",
"timefilter",
"=",
"attributes",
".",
"timefilter",
";",
"}",
"let",
"rawQueryResponse",
";",
"if",
"(",
"!",
"overwrite",
")",
"{",
"rawQueryResponse",
"=",
"await",
"savedObjectsClient",
".",
"create",
"(",
"'query'",
",",
"queryObject",
",",
"{",
"id",
":",
"attributes",
".",
"title",
",",
"}",
")",
";",
"}",
"else",
"{",
"rawQueryResponse",
"=",
"await",
"savedObjectsClient",
".",
"create",
"(",
"'query'",
",",
"queryObject",
",",
"{",
"id",
":",
"attributes",
".",
"title",
",",
"overwrite",
":",
"true",
",",
"}",
")",
";",
"}",
"if",
"(",
"rawQueryResponse",
".",
"error",
")",
"{",
"throw",
"new",
"Error",
"(",
"rawQueryResponse",
".",
"error",
".",
"message",
")",
";",
"}",
"return",
"parseSavedQueryObject",
"(",
"rawQueryResponse",
")",
";",
"}",
";",
"const",
"getAllSavedQueries",
"=",
"async",
"(",
")",
":",
"Promise",
"<",
"SavedQuery",
"[",
"]",
">",
"=>",
"{",
"const",
"count",
"=",
"await",
"getSavedQueryCount",
"(",
")",
";",
"const",
"response",
"=",
"await",
"savedObjectsClient",
".",
"find",
"<",
"SerializedSavedQueryAttributes",
">",
"(",
"{",
"type",
":",
"'query'",
",",
"perPage",
":",
"count",
",",
"page",
":",
"1",
",",
"}",
")",
";",
"return",
"response",
".",
"savedObjects",
".",
"map",
"(",
"(",
"savedObject",
")",
"=>",
"parseSavedQueryObject",
"(",
"savedObject",
")",
")",
";",
"}",
";",
"const",
"findSavedQueries",
"=",
"async",
"(",
"searchText",
"=",
"''",
",",
"perPage",
"=",
"50",
",",
"activePage",
"=",
"1",
")",
":",
"Promise",
"<",
"{",
"total",
":",
"number",
";",
"queries",
":",
"SavedQuery",
"[",
"]",
";",
"}",
">",
"=>",
"{",
"const",
"response",
"=",
"await",
"savedObjectsClient",
".",
"find",
"<",
"SerializedSavedQueryAttributes",
">",
"(",
"{",
"type",
":",
"'query'",
",",
"search",
":",
"searchText",
",",
"searchFields",
":",
"[",
"'title^5'",
",",
"'description'",
"]",
",",
"sortField",
":",
"'_score'",
",",
"perPage",
",",
"page",
":",
"activePage",
",",
"}",
")",
";",
"return",
"{",
"total",
":",
"response",
".",
"total",
",",
"queries",
":",
"response",
".",
"savedObjects",
".",
"map",
"(",
"(",
"savedObject",
")",
"=>",
"parseSavedQueryObject",
"(",
"savedObject",
")",
")",
",",
"}",
";",
"}",
";",
"const",
"getSavedQuery",
"=",
"async",
"(",
"id",
")",
":",
"Promise",
"<",
"SavedQuery",
">",
"=>",
"{",
"const",
"savedObject",
"=",
"await",
"savedObjectsClient",
".",
"get",
"<",
"SerializedSavedQueryAttributes",
">",
"(",
"'query'",
",",
"id",
")",
";",
"if",
"(",
"savedObject",
".",
"error",
")",
"{",
"throw",
"new",
"Error",
"(",
"savedObject",
".",
"error",
".",
"message",
")",
";",
"}",
"return",
"parseSavedQueryObject",
"(",
"savedObject",
")",
";",
"}",
";",
"const",
"deleteSavedQuery",
"=",
"async",
"(",
"id",
")",
"=>",
"{",
"return",
"await",
"savedObjectsClient",
".",
"delete",
"(",
"'query'",
",",
"id",
")",
";",
"}",
";",
"const",
"parseSavedQueryObject",
"=",
"(",
"savedQuery",
")",
"=>",
"{",
"let",
"queryString",
";",
"try",
"{",
"queryString",
"=",
"JSON",
".",
"parse",
"(",
"savedQuery",
".",
"attributes",
".",
"query",
".",
"query",
")",
";",
"}",
"catch",
"(",
"error",
")",
"{",
"queryString",
"=",
"savedQuery",
".",
"attributes",
".",
"query",
".",
"query",
";",
"}",
"const",
"savedQueryItems",
"=",
"{",
"title",
":",
"savedQuery",
".",
"attributes",
".",
"title",
"||",
"''",
",",
"description",
":",
"savedQuery",
".",
"attributes",
".",
"description",
"||",
"''",
",",
"query",
":",
"{",
"query",
":",
"queryString",
",",
"language",
":",
"savedQuery",
".",
"attributes",
".",
"query",
".",
"language",
",",
"}",
",",
"}",
";",
"if",
"(",
"savedQuery",
".",
"attributes",
".",
"filters",
")",
"{",
"savedQueryItems",
".",
"filters",
"=",
"savedQuery",
".",
"attributes",
".",
"filters",
";",
"}",
"if",
"(",
"savedQuery",
".",
"attributes",
".",
"timefilter",
")",
"{",
"savedQueryItems",
".",
"timefilter",
"=",
"savedQuery",
".",
"attributes",
".",
"timefilter",
";",
"}",
"return",
"{",
"id",
":",
"savedQuery",
".",
"id",
",",
"attributes",
":",
"savedQueryItems",
",",
"}",
";",
"}",
";",
"const",
"getSavedQueryCount",
"=",
"async",
"(",
")",
":",
"Promise",
"<",
"number",
">",
"=>",
"{",
"const",
"response",
"=",
"await",
"savedObjectsClient",
".",
"find",
"<",
"SerializedSavedQueryAttributes",
">",
"(",
"{",
"type",
":",
"'query'",
",",
"perPage",
":",
"0",
",",
"page",
":",
"1",
",",
"}",
")",
";",
"return",
"response",
".",
"total",
";",
"}",
";",
"return",
"{",
"saveQuery",
",",
"getAllSavedQueries",
",",
"findSavedQueries",
",",
"getSavedQuery",
",",
"deleteSavedQuery",
",",
"getSavedQueryCount",
",",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
26138,
null,
null,
1020,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
8964,
null,
null,
null,
null,
null,
null,
null,
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,
26139,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
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,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
null,
null,
null,
2,
null,
null,
null,
3,
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,
6,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
7,
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,
7,
null,
null,
null,
2,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
6,
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,
8964,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661295 | [
"import",
"{",
"Subscription",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"filter",
",",
"map",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"_",
"from",
"'lodash'",
";",
"import",
"{",
"BaseStateContainer",
"}",
"from",
"'../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"QuerySetup",
",",
"QueryStart",
"}",
"from",
"'../query_service'",
";",
"import",
"{",
"QueryState",
",",
"QueryStateChange",
"}",
"from",
"'./types'",
";",
"import",
"{",
"FilterStateStore",
",",
"COMPARE_ALL_OPTIONS",
",",
"compareFilters",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"validateTimeRange",
"}",
"from",
"'../timefilter'",
";",
"param",
"QueryService",
"param",
"stateContainer",
"export",
"const",
"connectToQueryState",
"=",
"<",
"S",
"extends",
"QueryState",
">",
"(",
"{",
"timefilter",
":",
"{",
"timefilter",
"}",
",",
"filterManager",
",",
"queryString",
",",
"state$",
",",
"}",
",",
"stateContainer",
",",
"syncConfig",
")",
"=>",
"{",
"const",
"syncKeys",
"=",
"[",
"]",
";",
"if",
"(",
"syncConfig",
".",
"time",
")",
"{",
"syncKeys",
".",
"push",
"(",
"'time'",
")",
";",
"}",
"if",
"(",
"syncConfig",
".",
"query",
")",
"{",
"syncKeys",
".",
"push",
"(",
"'query'",
")",
";",
"}",
"if",
"(",
"syncConfig",
".",
"refreshInterval",
")",
"{",
"syncKeys",
".",
"push",
"(",
"'refreshInterval'",
")",
";",
"}",
"if",
"(",
"syncConfig",
".",
"filters",
")",
"{",
"switch",
"(",
"syncConfig",
".",
"filters",
")",
"{",
"case",
"true",
":",
"syncKeys",
".",
"push",
"(",
"'filters'",
")",
";",
"break",
";",
"case",
"FilterStateStore",
".",
"APP_STATE",
":",
"syncKeys",
".",
"push",
"(",
"'appFilters'",
")",
";",
"break",
";",
"case",
"FilterStateStore",
".",
"GLOBAL_STATE",
":",
"syncKeys",
".",
"push",
"(",
"'globalFilters'",
")",
";",
"break",
";",
"}",
"}",
"const",
"initialState",
"=",
"{",
"...",
"stateContainer",
".",
"get",
"(",
")",
"}",
";",
"let",
"initialDirty",
"=",
"false",
";",
"if",
"(",
"syncConfig",
".",
"time",
"&&",
"!",
"_",
".",
"isEqual",
"(",
"initialState",
".",
"time",
",",
"timefilter",
".",
"getTime",
"(",
")",
")",
")",
"{",
"initialState",
".",
"time",
"=",
"timefilter",
".",
"getTime",
"(",
")",
";",
"initialDirty",
"=",
"true",
";",
"}",
"if",
"(",
"syncConfig",
".",
"refreshInterval",
"&&",
"!",
"_",
".",
"isEqual",
"(",
"initialState",
".",
"refreshInterval",
",",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
")",
")",
"{",
"initialState",
".",
"refreshInterval",
"=",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
";",
"initialDirty",
"=",
"true",
";",
"}",
"if",
"(",
"syncConfig",
".",
"filters",
")",
"{",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"initialState",
".",
"filters",
"||",
"!",
"compareFilters",
"(",
"initialState",
".",
"filters",
",",
"filterManager",
".",
"getFilters",
"(",
")",
",",
"COMPARE_ALL_OPTIONS",
")",
")",
"{",
"initialState",
".",
"filters",
"=",
"filterManager",
".",
"getFilters",
"(",
")",
";",
"initialDirty",
"=",
"true",
";",
"}",
"}",
"else",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"FilterStateStore",
".",
"GLOBAL_STATE",
")",
"{",
"if",
"(",
"!",
"initialState",
".",
"filters",
"||",
"!",
"compareFilters",
"(",
"initialState",
".",
"filters",
",",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
",",
"{",
"...",
"COMPARE_ALL_OPTIONS",
",",
"state",
":",
"false",
",",
"}",
")",
")",
"{",
"initialState",
".",
"filters",
"=",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
";",
"initialDirty",
"=",
"true",
";",
"}",
"}",
"else",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"FilterStateStore",
".",
"APP_STATE",
")",
"{",
"if",
"(",
"!",
"initialState",
".",
"filters",
"||",
"!",
"compareFilters",
"(",
"initialState",
".",
"filters",
",",
"filterManager",
".",
"getAppFilters",
"(",
")",
",",
"{",
"...",
"COMPARE_ALL_OPTIONS",
",",
"state",
":",
"false",
",",
"}",
")",
")",
"{",
"initialState",
".",
"filters",
"=",
"filterManager",
".",
"getAppFilters",
"(",
")",
";",
"initialDirty",
"=",
"true",
";",
"}",
"}",
"}",
"if",
"(",
"initialDirty",
")",
"{",
"stateContainer",
".",
"set",
"(",
"{",
"...",
"stateContainer",
".",
"get",
"(",
")",
",",
"...",
"initialState",
"}",
")",
";",
"}",
"let",
"updateInProgress",
"=",
"false",
";",
"const",
"subs",
"=",
"[",
"state$",
".",
"pipe",
"(",
"filter",
"(",
"(",
"{",
"changes",
",",
"state",
"}",
")",
"=>",
"{",
"if",
"(",
"updateInProgress",
")",
"return",
"false",
";",
"return",
"syncKeys",
".",
"some",
"(",
"(",
"syncKey",
")",
"=>",
"changes",
"[",
"syncKey",
"]",
")",
";",
"}",
")",
",",
"map",
"(",
"(",
"{",
"changes",
"}",
")",
"=>",
"{",
"const",
"newState",
"=",
"{",
"}",
";",
"if",
"(",
"syncConfig",
".",
"time",
"&&",
"changes",
".",
"time",
")",
"{",
"newState",
".",
"time",
"=",
"timefilter",
".",
"getTime",
"(",
")",
";",
"}",
"if",
"(",
"syncConfig",
".",
"query",
"&&",
"changes",
".",
"query",
")",
"{",
"newState",
".",
"query",
"=",
"queryString",
".",
"getQuery",
"(",
")",
";",
"}",
"if",
"(",
"syncConfig",
".",
"refreshInterval",
"&&",
"changes",
".",
"refreshInterval",
")",
"{",
"newState",
".",
"refreshInterval",
"=",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
";",
"}",
"if",
"(",
"syncConfig",
".",
"filters",
")",
"{",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"true",
"&&",
"changes",
".",
"filters",
")",
"{",
"newState",
".",
"filters",
"=",
"filterManager",
".",
"getFilters",
"(",
")",
";",
"}",
"else",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"FilterStateStore",
".",
"GLOBAL_STATE",
"&&",
"changes",
".",
"globalFilters",
")",
"{",
"newState",
".",
"filters",
"=",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
";",
"}",
"else",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"FilterStateStore",
".",
"APP_STATE",
"&&",
"changes",
".",
"appFilters",
")",
"{",
"newState",
".",
"filters",
"=",
"filterManager",
".",
"getAppFilters",
"(",
")",
";",
"}",
"}",
"return",
"newState",
";",
"}",
")",
")",
".",
"subscribe",
"(",
"(",
"newState",
")",
"=>",
"{",
"stateContainer",
".",
"set",
"(",
"{",
"...",
"stateContainer",
".",
"get",
"(",
")",
",",
"...",
"newState",
"}",
")",
";",
"}",
")",
",",
"stateContainer",
".",
"state$",
".",
"subscribe",
"(",
"(",
"state",
")",
"=>",
"{",
"updateInProgress",
"=",
"true",
";",
"if",
"(",
"syncConfig",
".",
"time",
")",
"{",
"const",
"time",
"=",
"validateTimeRange",
"(",
"state",
".",
"time",
")",
"?",
"state",
".",
"time",
":",
"timefilter",
".",
"getTimeDefaults",
"(",
")",
";",
"if",
"(",
"!",
"_",
".",
"isEqual",
"(",
"time",
",",
"timefilter",
".",
"getTime",
"(",
")",
")",
")",
"{",
"timefilter",
".",
"setTime",
"(",
"_",
".",
"cloneDeep",
"(",
"time",
"!",
")",
")",
";",
"}",
"}",
"if",
"(",
"syncConfig",
".",
"refreshInterval",
")",
"{",
"const",
"refreshInterval",
"=",
"state",
".",
"refreshInterval",
"||",
"timefilter",
".",
"getRefreshIntervalDefaults",
"(",
")",
";",
"if",
"(",
"!",
"_",
".",
"isEqual",
"(",
"refreshInterval",
",",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
")",
")",
"{",
"timefilter",
".",
"setRefreshInterval",
"(",
"_",
".",
"cloneDeep",
"(",
"refreshInterval",
")",
")",
";",
"}",
"}",
"if",
"(",
"syncConfig",
".",
"query",
")",
"{",
"const",
"curQuery",
"=",
"state",
".",
"query",
"||",
"queryString",
".",
"getQuery",
"(",
")",
";",
"if",
"(",
"!",
"_",
".",
"isEqual",
"(",
"curQuery",
",",
"queryString",
".",
"getQuery",
"(",
")",
")",
")",
"{",
"queryString",
".",
"setQuery",
"(",
"_",
".",
"cloneDeep",
"(",
"curQuery",
")",
")",
";",
"}",
"}",
"if",
"(",
"syncConfig",
".",
"filters",
")",
"{",
"const",
"filters",
"=",
"state",
".",
"filters",
"||",
"[",
"]",
";",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"compareFilters",
"(",
"filters",
",",
"filterManager",
".",
"getFilters",
"(",
")",
",",
"COMPARE_ALL_OPTIONS",
")",
")",
"{",
"filterManager",
".",
"setFilters",
"(",
"_",
".",
"cloneDeep",
"(",
"filters",
")",
")",
";",
"}",
"}",
"else",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"FilterStateStore",
".",
"APP_STATE",
")",
"{",
"if",
"(",
"!",
"compareFilters",
"(",
"filters",
",",
"filterManager",
".",
"getAppFilters",
"(",
")",
",",
"{",
"...",
"COMPARE_ALL_OPTIONS",
",",
"state",
":",
"false",
",",
"}",
")",
")",
"{",
"filterManager",
".",
"setAppFilters",
"(",
"_",
".",
"cloneDeep",
"(",
"filters",
")",
")",
";",
"}",
"}",
"else",
"if",
"(",
"syncConfig",
".",
"filters",
"===",
"FilterStateStore",
".",
"GLOBAL_STATE",
")",
"{",
"if",
"(",
"!",
"compareFilters",
"(",
"filters",
",",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
",",
"{",
"...",
"COMPARE_ALL_OPTIONS",
",",
"state",
":",
"false",
",",
"}",
")",
")",
"{",
"filterManager",
".",
"setGlobalFilters",
"(",
"_",
".",
"cloneDeep",
"(",
"filters",
")",
")",
";",
"}",
"}",
"}",
"updateInProgress",
"=",
"false",
";",
"}",
")",
",",
"]",
";",
"return",
"(",
")",
"=>",
"{",
"subs",
".",
"forEach",
"(",
"(",
"s",
")",
"=>",
"s",
".",
"unsubscribe",
"(",
")",
")",
";",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661296 | [
"import",
"{",
"createStateContainer",
",",
"IOsdUrlStateStorage",
",",
"syncState",
",",
"}",
"from",
"'../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"QuerySetup",
",",
"QueryStart",
"}",
"from",
"'../query_service'",
";",
"import",
"{",
"connectToQueryState",
"}",
"from",
"'./connect_to_query_state'",
";",
"import",
"{",
"QueryState",
"}",
"from",
"'./types'",
";",
"import",
"{",
"FilterStateStore",
"}",
"from",
"'../../../common/opensearch_query/filters'",
";",
"const",
"GLOBAL_STATE_STORAGE_KEY",
"=",
"'_g'",
";",
"param",
"QueryService",
"param",
"osdUrlStateStorage",
"export",
"const",
"syncQueryStateWithUrl",
"=",
"(",
"query",
",",
"osdUrlStateStorage",
")",
"=>",
"{",
"const",
"{",
"timefilter",
":",
"{",
"timefilter",
"}",
",",
"filterManager",
",",
"}",
"=",
"query",
";",
"const",
"defaultState",
"=",
"{",
"time",
":",
"timefilter",
".",
"getTime",
"(",
")",
",",
"refreshInterval",
":",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
",",
"filters",
":",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
",",
"}",
";",
"const",
"initialStateFromUrl",
"=",
"osdUrlStateStorage",
".",
"get",
"<",
"QueryState",
">",
"(",
"GLOBAL_STATE_STORAGE_KEY",
")",
";",
"const",
"hasInheritedQueryFromUrl",
"=",
"Boolean",
"(",
"initialStateFromUrl",
"&&",
"Object",
".",
"keys",
"(",
"initialStateFromUrl",
")",
".",
"length",
")",
";",
"const",
"initialState",
"=",
"{",
"...",
"defaultState",
",",
"...",
"initialStateFromUrl",
",",
"}",
";",
"const",
"globalQueryStateContainer",
"=",
"createStateContainer",
"(",
"initialState",
")",
";",
"const",
"stopSyncingWithStateContainer",
"=",
"connectToQueryState",
"(",
"query",
",",
"globalQueryStateContainer",
",",
"{",
"refreshInterval",
":",
"true",
",",
"time",
":",
"true",
",",
"filters",
":",
"FilterStateStore",
".",
"GLOBAL_STATE",
",",
"}",
")",
";",
"if",
"(",
"!",
"initialStateFromUrl",
")",
"{",
"osdUrlStateStorage",
".",
"set",
"<",
"QueryState",
">",
"(",
"GLOBAL_STATE_STORAGE_KEY",
",",
"initialState",
",",
"{",
"replace",
":",
"true",
",",
"}",
")",
";",
"}",
"globalQueryStateContainer",
".",
"set",
"(",
"initialState",
")",
";",
"const",
"{",
"start",
",",
"stop",
":",
"stopSyncingWithUrl",
"}",
"=",
"syncState",
"(",
"{",
"stateStorage",
":",
"osdUrlStateStorage",
",",
"stateContainer",
":",
"{",
"...",
"globalQueryStateContainer",
",",
"set",
":",
"(",
"state",
")",
"=>",
"{",
"if",
"(",
"state",
")",
"{",
"globalQueryStateContainer",
".",
"set",
"(",
"state",
")",
";",
"}",
"}",
",",
"}",
",",
"storageKey",
":",
"GLOBAL_STATE_STORAGE_KEY",
",",
"}",
")",
";",
"start",
"(",
")",
";",
"return",
"{",
"stop",
":",
"(",
")",
"=>",
"{",
"stopSyncingWithStateContainer",
"(",
")",
";",
"stopSyncingWithUrl",
"(",
")",
";",
"}",
",",
"hasInheritedQueryFromUrl",
",",
"}",
";",
"}",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
6,
null,
null,
141,
null,
8581,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2236,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
2236,
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,
2236,
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,
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
] |
661297 | [
"import",
"{",
"BehaviorSubject",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"skip",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"CoreStart",
"}",
"from",
"'opensearch-dashboards/public'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"import",
"{",
"Query",
",",
"UI_SETTINGS",
"}",
"from",
"'../../../common'",
";",
"export",
"class",
"QueryStringManager",
"{",
"private",
"query$",
":",
"BehaviorSubject",
"<",
"Query",
">",
";",
"constructor",
"(",
"private",
"readonly",
"storage",
",",
"private",
"readonly",
"uiSettings",
")",
"{",
"this",
".",
"query$",
"=",
"new",
"BehaviorSubject",
"<",
"Query",
">",
"(",
"this",
".",
"getDefaultQuery",
"(",
")",
")",
";",
"}",
"private",
"getDefaultLanguage",
"(",
")",
"{",
"return",
"(",
"this",
".",
"storage",
".",
"get",
"(",
"'opensearchDashboards.userQueryLanguage'",
")",
"||",
"this",
".",
"uiSettings",
".",
"get",
"(",
"UI_SETTINGS",
".",
"SEARCH_QUERY_LANGUAGE",
")",
")",
";",
"}",
"public",
"getDefaultQuery",
"(",
")",
"{",
"return",
"{",
"query",
":",
"''",
",",
"language",
":",
"this",
".",
"getDefaultLanguage",
"(",
")",
",",
"}",
";",
"}",
"public",
"formatQuery",
"(",
"query",
")",
"{",
"if",
"(",
"!",
"query",
")",
"{",
"return",
"this",
".",
"getDefaultQuery",
"(",
")",
";",
"}",
"else",
"if",
"(",
"typeof",
"query",
"===",
"'string'",
")",
"{",
"return",
"{",
"query",
",",
"language",
":",
"this",
".",
"getDefaultLanguage",
"(",
")",
",",
"}",
";",
"}",
"else",
"{",
"return",
"query",
";",
"}",
"}",
"public",
"getUpdates$",
"=",
"(",
")",
"=>",
"{",
"return",
"this",
".",
"query$",
".",
"asObservable",
"(",
")",
".",
"pipe",
"(",
"skip",
"(",
"1",
")",
")",
";",
"}",
";",
"public",
"getQuery",
"=",
"(",
")",
":",
"Query",
"=>",
"{",
"return",
"this",
".",
"query$",
".",
"getValue",
"(",
")",
";",
"}",
";",
"param",
"{",
"Query",
"}",
"query",
"public",
"setQuery",
"=",
"(",
"query",
")",
"=>",
"{",
"const",
"curQuery",
"=",
"this",
".",
"query$",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"query",
"?.",
"language",
"!==",
"curQuery",
".",
"language",
"||",
"query",
"?.",
"query",
"!==",
"curQuery",
".",
"query",
")",
"{",
"this",
".",
"query$",
".",
"next",
"(",
"query",
")",
";",
"}",
"}",
";",
"/**\n * Resets the query to the default one.\n */",
"public",
"clearQuery",
"=",
"(",
")",
"=>",
"{",
"this",
".",
"setQuery",
"(",
"this",
".",
"getDefaultQuery",
"(",
")",
")",
";",
"}",
";",
"}",
"export",
"type",
"QueryStringContract",
"=",
"PublicMethodsOf",
"<",
"QueryStringManager",
">",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
5834,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
186,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
186,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661298 | [
"import",
"{",
"Observable",
",",
"Subscription",
"}",
"from",
"'rxjs'",
";",
"import",
"{",
"map",
",",
"tap",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"TimefilterSetup",
"}",
"from",
"'../timefilter'",
";",
"import",
"{",
"FilterManager",
"}",
"from",
"'../filter_manager'",
";",
"import",
"{",
"QueryState",
",",
"QueryStateChange",
"}",
"from",
"'./index'",
";",
"import",
"{",
"createStateContainer",
"}",
"from",
"'../../../../opensearch_dashboards_utils/public'",
";",
"import",
"{",
"isFilterPinned",
",",
"compareFilters",
",",
"COMPARE_ALL_OPTIONS",
"}",
"from",
"'../../../common'",
";",
"import",
"{",
"QueryStringContract",
"}",
"from",
"'../query_string'",
";",
"export",
"function",
"createQueryStateObservable",
"(",
"{",
"timefilter",
":",
"{",
"timefilter",
"}",
",",
"filterManager",
",",
"queryString",
",",
"}",
")",
"{",
"return",
"new",
"Observable",
"(",
"(",
"subscriber",
")",
"=>",
"{",
"const",
"state",
"=",
"createStateContainer",
"<",
"QueryState",
">",
"(",
"{",
"time",
":",
"timefilter",
".",
"getTime",
"(",
")",
",",
"refreshInterval",
":",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
",",
"filters",
":",
"filterManager",
".",
"getFilters",
"(",
")",
",",
"query",
":",
"queryString",
".",
"getQuery",
"(",
")",
",",
"}",
")",
";",
"let",
"currentChange",
"=",
"{",
"}",
";",
"const",
"subs",
"=",
"[",
"queryString",
".",
"getUpdates$",
"(",
")",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"currentChange",
".",
"query",
"=",
"true",
";",
"state",
".",
"set",
"(",
"{",
"...",
"state",
".",
"get",
"(",
")",
",",
"query",
":",
"queryString",
".",
"getQuery",
"(",
")",
"}",
")",
";",
"}",
")",
",",
"timefilter",
".",
"getTimeUpdate$",
"(",
")",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"currentChange",
".",
"time",
"=",
"true",
";",
"state",
".",
"set",
"(",
"{",
"...",
"state",
".",
"get",
"(",
")",
",",
"time",
":",
"timefilter",
".",
"getTime",
"(",
")",
"}",
")",
";",
"}",
")",
",",
"timefilter",
".",
"getRefreshIntervalUpdate$",
"(",
")",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"currentChange",
".",
"refreshInterval",
"=",
"true",
";",
"state",
".",
"set",
"(",
"{",
"...",
"state",
".",
"get",
"(",
")",
",",
"refreshInterval",
":",
"timefilter",
".",
"getRefreshInterval",
"(",
")",
"}",
")",
";",
"}",
")",
",",
"filterManager",
".",
"getUpdates$",
"(",
")",
".",
"subscribe",
"(",
"(",
")",
"=>",
"{",
"currentChange",
".",
"filters",
"=",
"true",
";",
"const",
"{",
"filters",
"}",
"=",
"state",
".",
"get",
"(",
")",
";",
"const",
"globalOld",
"=",
"filters",
"?.",
"filter",
"(",
"(",
"f",
")",
"=>",
"isFilterPinned",
"(",
"f",
")",
")",
";",
"const",
"appOld",
"=",
"filters",
"?.",
"filter",
"(",
"(",
"f",
")",
"=>",
"!",
"isFilterPinned",
"(",
"f",
")",
")",
";",
"const",
"globalNew",
"=",
"filterManager",
".",
"getGlobalFilters",
"(",
")",
";",
"const",
"appNew",
"=",
"filterManager",
".",
"getAppFilters",
"(",
")",
";",
"if",
"(",
"!",
"globalOld",
"||",
"!",
"compareFilters",
"(",
"globalOld",
",",
"globalNew",
",",
"COMPARE_ALL_OPTIONS",
")",
")",
"{",
"currentChange",
".",
"globalFilters",
"=",
"true",
";",
"}",
"if",
"(",
"!",
"appOld",
"||",
"!",
"compareFilters",
"(",
"appOld",
",",
"appNew",
",",
"COMPARE_ALL_OPTIONS",
")",
")",
"{",
"currentChange",
".",
"appFilters",
"=",
"true",
";",
"}",
"state",
".",
"set",
"(",
"{",
"...",
"state",
".",
"get",
"(",
")",
",",
"filters",
":",
"filterManager",
".",
"getFilters",
"(",
")",
",",
"}",
")",
";",
"}",
")",
",",
"state",
".",
"state$",
".",
"pipe",
"(",
"map",
"(",
"(",
"newState",
")",
"=>",
"(",
"{",
"state",
":",
"newState",
",",
"changes",
":",
"currentChange",
"}",
")",
")",
",",
"tap",
"(",
"(",
")",
"=>",
"{",
"currentChange",
"=",
"{",
"}",
";",
"}",
")",
")",
".",
"subscribe",
"(",
"subscriber",
")",
",",
"]",
";",
"return",
"(",
")",
"=>",
"{",
"subs",
".",
"forEach",
"(",
"(",
"s",
")",
"=>",
"s",
".",
"unsubscribe",
"(",
")",
")",
";",
"}",
";",
"}",
")",
";",
"}"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
18,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |
661299 | [
"import",
"{",
"share",
"}",
"from",
"'rxjs/operators'",
";",
"import",
"{",
"IUiSettingsClient",
",",
"SavedObjectsClientContract",
"}",
"from",
"'src/core/public'",
";",
"import",
"{",
"IStorageWrapper",
"}",
"from",
"'src/plugins/opensearch_dashboards_utils/public'",
";",
"import",
"{",
"FilterManager",
"}",
"from",
"'./filter_manager'",
";",
"import",
"{",
"createAddToQueryLog",
"}",
"from",
"'./lib'",
";",
"import",
"{",
"TimefilterService",
",",
"TimefilterSetup",
"}",
"from",
"'./timefilter'",
";",
"import",
"{",
"createSavedQueryService",
"}",
"from",
"'./saved_query/saved_query_service'",
";",
"import",
"{",
"createQueryStateObservable",
"}",
"from",
"'./state_sync/create_global_query_observable'",
";",
"import",
"{",
"QueryStringManager",
",",
"QueryStringContract",
"}",
"from",
"'./query_string'",
";",
"import",
"{",
"buildOpenSearchQuery",
",",
"getOpenSearchQueryConfig",
"}",
"from",
"'../../common'",
";",
"import",
"{",
"getUiSettings",
"}",
"from",
"'../services'",
";",
"import",
"{",
"IndexPattern",
"}",
"from",
"'..'",
";",
"internal",
"interface",
"QueryServiceSetupDependencies",
"{",
"storage",
":",
"IStorageWrapper",
";",
"uiSettings",
":",
"IUiSettingsClient",
";",
"}",
"interface",
"QueryServiceStartDependencies",
"{",
"savedObjectsClient",
":",
"SavedObjectsClientContract",
";",
"storage",
":",
"IStorageWrapper",
";",
"uiSettings",
":",
"IUiSettingsClient",
";",
"}",
"export",
"class",
"QueryService",
"{",
"filterManager",
"!",
":",
"FilterManager",
";",
"timefilter",
"!",
":",
"TimefilterSetup",
";",
"queryStringManager",
"!",
":",
"QueryStringContract",
";",
"state$",
"!",
":",
"ReturnType",
"<",
"typeof",
"createQueryStateObservable",
">",
";",
"public",
"setup",
"(",
"{",
"storage",
",",
"uiSettings",
"}",
")",
"{",
"this",
".",
"filterManager",
"=",
"new",
"FilterManager",
"(",
"uiSettings",
")",
";",
"const",
"timefilterService",
"=",
"new",
"TimefilterService",
"(",
")",
";",
"this",
".",
"timefilter",
"=",
"timefilterService",
".",
"setup",
"(",
"{",
"uiSettings",
",",
"storage",
",",
"}",
")",
";",
"this",
".",
"queryStringManager",
"=",
"new",
"QueryStringManager",
"(",
"storage",
",",
"uiSettings",
")",
";",
"this",
".",
"state$",
"=",
"createQueryStateObservable",
"(",
"{",
"filterManager",
":",
"this",
".",
"filterManager",
",",
"timefilter",
":",
"this",
".",
"timefilter",
",",
"queryString",
":",
"this",
".",
"queryStringManager",
",",
"}",
")",
".",
"pipe",
"(",
"share",
"(",
")",
")",
";",
"return",
"{",
"filterManager",
":",
"this",
".",
"filterManager",
",",
"timefilter",
":",
"this",
".",
"timefilter",
",",
"queryString",
":",
"this",
".",
"queryStringManager",
",",
"state$",
":",
"this",
".",
"state$",
",",
"}",
";",
"}",
"public",
"start",
"(",
"{",
"savedObjectsClient",
",",
"storage",
",",
"uiSettings",
"}",
")",
"{",
"return",
"{",
"addToQueryLog",
":",
"createAddToQueryLog",
"(",
"{",
"storage",
",",
"uiSettings",
",",
"}",
")",
",",
"filterManager",
":",
"this",
".",
"filterManager",
",",
"queryString",
":",
"this",
".",
"queryStringManager",
",",
"savedQueries",
":",
"createSavedQueryService",
"(",
"savedObjectsClient",
")",
",",
"state$",
":",
"this",
".",
"state$",
",",
"timefilter",
":",
"this",
".",
"timefilter",
",",
"getOpenSearchQuery",
":",
"(",
"indexPattern",
")",
"=>",
"{",
"const",
"timeFilter",
"=",
"this",
".",
"timefilter",
".",
"timefilter",
".",
"createFilter",
"(",
"indexPattern",
")",
";",
"return",
"buildOpenSearchQuery",
"(",
"indexPattern",
",",
"this",
".",
"queryStringManager",
".",
"getQuery",
"(",
")",
",",
"[",
"...",
"this",
".",
"filterManager",
".",
"getFilters",
"(",
")",
",",
"...",
"(",
"timeFilter",
"?",
"[",
"timeFilter",
"]",
":",
"[",
"]",
")",
"]",
",",
"getOpenSearchQueryConfig",
"(",
"getUiSettings",
"(",
")",
")",
")",
";",
"}",
",",
"}",
";",
"}",
"public",
"stop",
"(",
")",
"{",
"}",
"}",
"public",
"export",
"type",
"QuerySetup",
"=",
"ReturnType",
"<",
"QueryService",
"[",
"'setup'",
"]",
">",
";",
"export",
"type",
"QueryStart",
"=",
"ReturnType",
"<",
"QueryService",
"[",
"'start'",
"]",
">",
";"
] | [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
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,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
] |