(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{"0H9l":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("q1tI"),o=n.n(r),a=n("9LhM"),i=function(e){var t=e.queryError,n=!!t,r=n?100:10,i=t?t.message:null;return o.a.createElement(a.a,{in:n,duration:r},o.a.createElement("div",{className:"alert-container"},o.a.createElement("div",{className:"alert-error alert"},o.a.createElement("div",{className:"alert-icon"},o.a.createElement("i",{className:"fa fa-exclamation-triangle"})),o.a.createElement("div",{className:"alert-body"},o.a.createElement("div",{className:"alert-title"},i)))))}},"5llT":function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n("q1tI"),o=n.n(r),a=n("kDDq"),i=n("Obii"),s=n("kDLi");function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(){var e=g(["\n    label: show-all-time-series;\n    cursor: pointer;\n    color: ",";\n  "]);return h=function(){return e},e}function m(){var e=g(["\n    label: disclaimer-icon;\n    color: ",";\n    margin-right: ",";\n  "]);return m=function(){return e},e}function b(){var e=g(["\n    label: time-series-disclaimer;\n    width: 300px;\n    margin: "," auto;\n    padding: 10px 0;\n    border-radius: ",";\n    text-align: center;\n    background-color: ",";\n  "]);return b=function(){return e},e}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var y=function(e){function t(){var e,n;l(this,t);for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];return(n=p(this,(e=f(t)).call.apply(e,[this].concat(a)))).state={hiddenSeries:[],showAllTimeSeries:!1},n.onShowAllTimeSeries=function(){n.setState({showAllTimeSeries:!0})},n.onClickGraphButton=function(){var e=n.props,t=e.onToggleGraph,r=e.showingGraph;t&&t(null!=r&&r)},n.onChangeTime=function(e,t){(0,n.props.onUpdateTimeRange)({from:e,to:t})},n.renderGraph=function(){var e=n.props,t=e.width,r=e.series,a=e.onHiddenSeriesChanged,c=e.timeZone,l=e.absoluteRange,u=e.showPanel,p=e.showingGraph,f=e.showingTable,d=e.showBars,h=e.showLines,m=e.isStacked,b=n.state.showAllTimeSeries;if(!r)return null;var g={from:Object(i.dateTimeForTimeZone)(c,l.from),to:Object(i.dateTimeForTimeZone)(c,l.to),raw:{from:Object(i.dateTimeForTimeZone)(c,l.from),to:Object(i.dateTimeForTimeZone)(c,l.to)}},y=!1===u?100:p&&f?200:400,v=h?1:5,w=b?r:r.slice(0,20);return o.a.createElement(s.GraphSeriesToggler,{series:w,onHiddenSeriesChanged:a},(function(e){var r=e.onSeriesToggle,a=e.toggledSeries;return o.a.createElement(s.GraphWithLegend,{displayMode:s.LegendDisplayMode.List,height:y,isLegendVisible:!0,placement:"under",width:t,timeRange:g,timeZone:c,showBars:d,showLines:h,showPoints:!1,onToggleSort:function(){},series:a,isStacked:m,lineWidth:v,onSeriesToggle:r,onHorizontalRegionSelected:n.onChangeTime},o.a.createElement(s.Chart.Tooltip,{mode:d?"multi":"single"}))}))},n}var n,r,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props,t=e.series,n=e.showPanel,r=e.showingGraph,i=e.loading,c=e.theme,l=this.state.showAllTimeSeries,u=function(e){return{timeSeriesDisclaimer:Object(a.css)(b(),e.spacing.sm,e.border.radius.md,Object(s.selectThemeVariant)({light:e.colors.white,dark:e.colors.dark4},e.type)),disclaimerIcon:Object(a.css)(m(),e.colors.yellow,e.spacing.xs),showAllTimeSeries:Object(a.css)(h(),e.colors.linkExternal)}}(c);return o.a.createElement(o.a.Fragment,null,t&&t.length>20&&!l&&o.a.createElement("div",{className:Object(a.cx)([u.timeSeriesDisclaimer])},o.a.createElement("i",{className:Object(a.cx)(["fa fa-fw fa-warning",u.disclaimerIcon])}),"Showing only ".concat(20," time series. "),o.a.createElement("span",{className:Object(a.cx)([u.showAllTimeSeries]),onClick:this.onShowAllTimeSeries},"Show all ".concat(t.length))),n&&o.a.createElement(s.Collapse,{label:"Graph",collapsible:!0,isOpen:r,loading:i,onToggle:this.onClickGraphButton},this.renderGraph()),!n&&this.renderGraph())}}])&&u(n.prototype,r),c&&u(n,c),t}(r.PureComponent),v=Object(s.withTheme)(y);v.displayName="ExploreGraphPanel"},"6Pa6":function(e,t,n){"use strict";var r=n("q1tI"),o=n.n(r),a=n("kDDq"),i=n("m257"),s=n("w9yp"),c=n("SMGL"),l=n("kDLi"),u=n("Obii"),p=n("Xmxp"),f=n("GQ3c");function d(){var e=v(["\n          margin-bottom: ",";\n        "]);return d=function(){return e},e}function h(){var e=v(["\n          font-weight: ",";\n        "]);return h=function(){return e},e}function m(){var e=v(["\n      margin-left: ",";\n    "]);return m=function(){return e},e}function b(){var e=v(["\n      display: flex;\n      align-items: center;\n    "]);return b=function(){return e},e}function g(){var e=v(["\n      max-width: 200px;\n    "]);return g=function(){return e},e}function y(){var e=v(["\n      padding-left: ",";\n      font-size: ",";\n      .space-between {\n        margin-bottom: ",";\n      }\n    "]);return y=function(){return e},e}function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var w=Object(l.stylesFactory)((function(e){return{container:Object(a.css)(y(),e.spacing.sm,e.typography.size.sm,e.spacing.lg),input:Object(a.css)(g()),switch:Object(a.css)(b()),label:Object(a.css)(m(),e.spacing.md)}})),O=[{value:2,label:"2 days"},{value:5,label:"5 days"},{value:7,label:"1 week"},{value:14,label:"2 weeks"}];function x(e){var t=e.retentionPeriod,n=e.starredTabAsFirstTab,r=e.activeDatasourceOnly,i=e.onChangeRetentionPeriod,s=e.toggleStarredTabAsFirstTab,c=e.toggleactiveDatasourceOnly,m=e.deleteRichHistory,b=Object(l.useTheme)(),g=w(b),y=O.find((function(e){return e.value===t}));return o.a.createElement("div",{className:g.container},o.a.createElement(l.Forms.Field,{label:"History time span",description:"Select the period of time for which Grafana will save your query history",className:"space-between"},o.a.createElement("div",{className:g.input},o.a.createElement(l.Forms.Select,{value:y,options:O,onChange:i}))),o.a.createElement(l.Forms.Field,{label:"Default active tab",description:" ",className:"space-between"},o.a.createElement("div",{className:g.switch},o.a.createElement(l.Forms.Switch,{value:n,onChange:s}),o.a.createElement("div",{className:g.label},"Change the default active tab from “Query history” to “Starred”"))),o.a.createElement(l.Forms.Field,{label:"Data source behaviour",description:" ",className:"space-between"},o.a.createElement("div",{className:g.switch},o.a.createElement(l.Forms.Switch,{value:r,onChange:c}),o.a.createElement("div",{className:g.label},"Only show queries for data source currently active in Explore"))),o.a.createElement("div",{className:Object(a.css)(h(),b.typography.weight.bold)},"Clear query history"),o.a.createElement("div",{className:Object(a.css)(d(),b.spacing.sm)},"Delete all of your query history, permanently."),o.a.createElement(l.Forms.Button,{variant:"destructive",onClick:function(){p.b.emit(f.CoreEvents.showConfirmModal,{title:"Delete",text:"Are you sure you want to permanently delete your query history?",yesText:"Delete",icon:"fa-trash",onConfirm:function(){m(),p.b.emit(u.AppEvents.alertSuccess,["Query history deleted"])}})}},"Clear query history"))}var E=n("LvDl"),j=n("vGfD");function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function k(){var e=M(["\n      font-size: ",";\n      font-weight: ",";\n      margin-left: ",";\n    "]);return k=function(){return e},e}function C(){var e=M(["\n      height: 60px;\n      margin-top: ",";\n      display: flex;\n      justify-content: center;\n      font-weight: ",";\n      font-size: ",";\n      a {\n        font-weight: ",";\n        margin-left: ",";\n      }\n    "]);return C=function(){return e},e}function T(){var e=M(["\n      font-size: ",";\n      margin: "," "," "," ",";\n    "]);return T=function(){return e},e}function R(){var e=M(["\n      display: flex;\n      align-items: flex-start;\n      justify-content: flex-start;\n      margin-top: ",";\n      h4 {\n        margin: 0 10px 0 0;\n      }\n    "]);return R=function(){return e},e}function P(){var e=M(["\n      width: 170px;\n    "]);return P=function(){return e},e}function N(){var e=M(["\n      width: 60%;\n      .gf-form-select-box__multi-value {\n        background-color: ",";\n        padding: "," "," "," ",";\n        border-radius: ",";\n      }\n    "]);return N=function(){return e},e}function z(){var e=M(["\n      display: flex;\n      justify-content: space-between;\n    "]);return z=function(){return e},e}function L(){var e=M(["\n      position: fixed;\n    "]);return L=function(){return e},e}function D(){var e=M(["\n      width: 127px;\n      margin-right: ",";\n      .slider {\n        bottom: 10px;\n        height: ",";\n        width: 127px;\n        padding: "," 0;\n      }\n    "]);return D=function(){return e},e}function I(){var e=M(["\n      width: calc(",");\n    "]);return I=function(){return e},e}function _(){var e=M(["\n      display: flex;\n      .label-slider {\n        font-size: ",";\n        &:last-of-type {\n          margin-top: ",";\n        }\n        &:first-of-type {\n          font-weight: ",";\n          margin-bottom: ",";\n        }\n      }\n    "]);return _=function(){return e},e}function M(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var A=Object(l.stylesFactory)((function(e,t){var n=e.isLight?e.colors.gray5:e.colors.dark4,r="".concat(t-200,"px");return{container:Object(a.css)(_(),e.typography.size.sm,e.spacing.lg,e.typography.weight.semibold,e.spacing.md),containerContent:Object(a.css)(I(),"100% - 134px"),containerSlider:Object(a.css)(D(),e.spacing.sm,r,e.spacing.sm),slider:Object(a.css)(L()),selectors:Object(a.css)(z()),multiselect:Object(a.css)(N(),n,e.spacing.xxs,e.spacing.xs,e.spacing.xxs,e.spacing.sm,e.border.radius.sm),sort:Object(a.css)(P()),sessionName:Object(a.css)(R(),e.spacing.lg),heading:Object(a.css)(T(),e.typography.heading.h4,e.spacing.md,e.spacing.xxs,e.spacing.sm,e.spacing.xxs),feedback:Object(a.css)(C(),e.spacing.lg,e.typography.weight.light,e.typography.size.sm,e.typography.weight.semibold,e.spacing.xxs),queries:Object(a.css)(k(),e.typography.size.sm,e.typography.weight.regular,e.spacing.xs)}}));function F(e){var t=e.datasourceFilters,n=e.onSelectDatasourceFilters,a=e.queries,i=e.onChangeSortOrder,c=e.sortOrder,u=e.activeDatasourceOnly,p=e.retentionPeriod,f=e.exploreId,d=e.height,h=S(Object(r.useState)([0,p]),2),m=h[0],b=h[1],g=Object(l.useTheme)(),y=A(g,d),v=Object(E.uniqBy)(a,"datasourceName").map((function(e){return e.datasourceName})),w=Object(s.e)(v),O=null==t?void 0:t.map((function(e){return e.value})),x=t?null==a?void 0:a.filter((function(e){return null==O?void 0:O.includes(e.datasourceName)})):a,k=Object(s.n)(x,c),C=null==k?void 0:k.filter((function(e){return e.ts<Object(s.f)(m[0],!0)&&e.ts>Object(s.f)(m[1],!1)})),T=Object(s.m)(C,c);return o.a.createElement("div",{className:y.container},o.a.createElement("div",{className:y.containerSlider},o.a.createElement("div",{className:y.slider},o.a.createElement("div",{className:"label-slider"},"Filter history ",o.a.createElement("br",null),"between"),o.a.createElement("div",{className:"label-slider"},Object(s.l)(m[0])),o.a.createElement("div",{className:"slider"},o.a.createElement(l.Slider,{tooltipAlwaysVisible:!1,min:0,max:p,value:m,orientation:"vertical",formatTooltipResult:s.l,reverse:!0,onAfterChange:b})),o.a.createElement("div",{className:"label-slider"},Object(s.l)(m[1])))),o.a.createElement("div",{className:y.containerContent},o.a.createElement("div",{className:y.selectors},!u&&o.a.createElement("div",{"aria-label":"Filter datasources",className:y.multiselect},o.a.createElement(l.Select,{isMulti:!0,options:w,value:t,placeholder:"Filter queries for specific data sources(s)",onChange:n})),o.a.createElement("div",{"aria-label":"Sort queries",className:y.sort},o.a.createElement(l.Select,{value:se.filter((function(e){return e.value===c})),options:se,placeholder:"Sort queries by",onChange:function(e){return i(e.value)}}))),Object.keys(T).map((function(e){return o.a.createElement("div",{key:e},o.a.createElement("div",{className:y.heading},e," ",o.a.createElement("span",{className:y.queries},T[e].length," queries")),T[e].map((function(e){var t=w.findIndex((function(t){return t.label===e.datasourceName}));return o.a.createElement(j.a,{query:e,key:e.ts,exploreId:f,dsImg:w[t].imgUrl,isRemoved:w[t].isRemoved})})))})),o.a.createElement("div",{className:y.feedback},"Query history is a beta feature. The history is local to your browser and is not shared with others.",o.a.createElement("a",{href:"https://github.com/grafana/grafana/issues/new/choose"},"Feedback?"))))}function q(){var e=G(["\n      height: 60px;\n      margin-top: ",";\n      display: flex;\n      justify-content: center;\n      font-weight: ",";\n      font-size: ",";\n      a {\n        font-weight: ",";\n        margin-left: ",";\n      }\n    "]);return q=function(){return e},e}function B(){var e=G(["\n      width: 170px;\n    "]);return B=function(){return e},e}function H(){var e=G(["\n      width: 60%;\n      .gf-form-select-box__multi-value {\n        background-color: ",";\n        padding: "," "," "," ",";\n        border-radius: ",";\n      }\n    "]);return H=function(){return e},e}function Q(){var e=G(["\n      display: flex;\n      justify-content: space-between;\n    "]);return Q=function(){return e},e}function W(){var e=G(["\n      width: 100%;\n    "]);return W=function(){return e},e}function U(){var e=G(["\n      display: flex;\n    "]);return U=function(){return e},e}function G(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Z,K=Object(l.stylesFactory)((function(e){var t=e.isLight?e.colors.gray5:e.colors.dark4;return{container:Object(a.css)(U()),containerContent:Object(a.css)(W()),selectors:Object(a.css)(Q()),multiselect:Object(a.css)(H(),t,e.spacing.xxs,e.spacing.xs,e.spacing.xxs,e.spacing.sm,e.border.radius.sm),sort:Object(a.css)(B()),feedback:Object(a.css)(q(),e.spacing.lg,e.typography.weight.light,e.typography.size.sm,e.typography.weight.semibold,e.spacing.xxs)}}));function X(e){var t=e.datasourceFilters,n=e.onSelectDatasourceFilters,r=e.queries,a=e.onChangeSortOrder,i=e.sortOrder,c=e.activeDatasourceOnly,u=e.exploreId,p=Object(l.useTheme)(),f=K(p),d=Object(E.uniqBy)(r,"datasourceName").map((function(e){return e.datasourceName})),h=Object(s.e)(d),m=null==t?void 0:t.map((function(e){return e.value})),b=r.filter((function(e){return!0===e.starred})),g=t?null==b?void 0:b.filter((function(e){return null==m?void 0:m.includes(e.datasourceName)})):b,y=Object(s.n)(g,i);return o.a.createElement("div",{className:f.container},o.a.createElement("div",{className:f.containerContent},o.a.createElement("div",{className:f.selectors},!c&&o.a.createElement("div",{"aria-label":"Filter datasources",className:f.multiselect},o.a.createElement(l.Select,{isMulti:!0,options:h,value:t,placeholder:"Filter queries for specific data sources(s)",onChange:n})),o.a.createElement("div",{"aria-label":"Sort queries",className:f.sort},o.a.createElement(l.Select,{options:se,value:se.filter((function(e){return e.value===i})),placeholder:"Sort queries by",onChange:function(e){return a(e.value)}}))),y.map((function(e){var t=h.findIndex((function(t){return t.label===e.datasourceName}));return o.a.createElement(j.a,{query:e,key:e.ts,exploreId:u,dsImg:h[t].imgUrl,isRemoved:h[t].isRemoved})})),o.a.createElement("div",{className:f.feedback},"Query history is a beta feature. The history is local to your browser and is not shared with others.",o.a.createElement("a",{href:"https://github.com/grafana/grafana/issues/new/choose"},"Feedback?"))))}function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(){var e=ie(["\n            min-height: 100% !important;\n          "]);return V=function(){return e},e}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $(e,t){return!t||"object"!==Y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e,t){return(te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ne(){var e=ie(["\n      background-color: ",";\n      padding-top: ",";\n      border-color: ",";\n      ul {\n        margin-left: ",";\n      }\n    "]);return ne=function(){return e},e}function re(){var e=ie(["\n      position: absolute;\n      right: ",";\n      cursor: pointer;\n    "]);return re=function(){return e},e}function oe(){var e=ie(["\n      background-color: ",";\n      padding: ",";\n    "]);return oe=function(){return e},e}function ae(){var e=ie(["\n      height: 100%;\n      background-color: ",";\n    "]);return ae=function(){return e},e}function ie(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,"b",(function(){return Z})),n.d(t,"c",(function(){return se})),n.d(t,"a",(function(){return ue})),function(e){e.RichHistory="Query history",e.Starred="Starred",e.Settings="Settings"}(Z||(Z={}));var se=[{label:"Time ascending",value:i.c.Ascending},{label:"Time descending",value:i.c.Descending},{label:"Data source A-Z",value:i.c.DatasourceAZ},{label:"Data source Z-A",value:i.c.DatasourceZA}],ce=Object(l.stylesFactory)((function(e){var t=e.isLight?e.colors.gray5:e.colors.dark6,n=e.isLight?e.colors.white:e.colors.black,r=e.isLight?e.colors.gray7:e.colors.dark2;return{container:Object(a.css)(ae(),r),tabContent:Object(a.css)(oe(),r,e.spacing.md),close:Object(a.css)(re(),e.spacing.sm),tabs:Object(a.css)(ne(),n,e.spacing.sm,t,e.spacing.md)}})),le=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=$(this,ee(t).call(this,e))).onChangeRetentionPeriod=function(e){n.setState({retentionPeriod:e.value}),c.a.set(s.a.retentionPeriod,e.value)},n.toggleStarredTabAsFirstTab=function(){var e=!n.state.starredTabAsFirstTab;n.setState({starredTabAsFirstTab:e}),c.a.set(s.a.starredTabAsFirstTab,e)},n.toggleactiveDatasourceOnly=function(){var e=!n.state.activeDatasourceOnly;n.setState({activeDatasourceOnly:e}),c.a.set(s.a.activeDatasourceOnly,e)},n.onSelectDatasourceFilters=function(e){c.a.setObject(s.a.datasourceFilters,e),n.setState({datasourceFilters:e})},n.onSelectTab=function(e){n.setState({activeTab:e.value})},n.onChangeSortOrder=function(e){return n.setState({sortOrder:e})},n.state={activeTab:n.props.firstTab,sortOrder:i.c.Descending,datasourceFilters:c.a.getObject(s.a.datasourceFilters,null),retentionPeriod:c.a.getObject(s.a.retentionPeriod,7),starredTabAsFirstTab:c.a.getBool(s.a.starredTabAsFirstTab,!1),activeDatasourceOnly:c.a.getBool(s.a.activeDatasourceOnly,!1)},n}var n,r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(t,e),n=t,(r=[{key:"updateFilters",value:function(){this.state.activeDatasourceOnly&&this.props.activeDatasourceInstance?this.onSelectDatasourceFilters([{label:this.props.activeDatasourceInstance,value:this.props.activeDatasourceInstance}]):this.onSelectDatasourceFilters(this.state.datasourceFilters)}},{key:"componentDidMount",value:function(){this.updateFilters()}},{key:"componentDidUpdate",value:function(e,t){this.props.activeDatasourceInstance===e.activeDatasourceInstance&&this.state.activeDatasourceOnly===t.activeDatasourceOnly||this.updateFilters()}},{key:"render",value:function(){var e,t=this,n=this.state,r=n.datasourceFilters,i=n.sortOrder,s=n.activeTab,c=n.activeDatasourceOnly,u=n.retentionPeriod,p=this.props,f=p.theme,d=p.richHistory,h=p.height,m=p.exploreId,b=p.deleteRichHistory,g=p.onClose,y=ce(f),v=[{label:"Query history",value:Z.RichHistory,content:o.a.createElement(F,{queries:d,sortOrder:i,datasourceFilters:r,activeDatasourceOnly:c,retentionPeriod:u,onChangeSortOrder:this.onChangeSortOrder,onSelectDatasourceFilters:this.onSelectDatasourceFilters,exploreId:m,height:h}),icon:"fa fa-history"},{label:"Starred",value:Z.Starred,content:o.a.createElement(X,{queries:d,sortOrder:i,datasourceFilters:r,activeDatasourceOnly:c,onChangeSortOrder:this.onChangeSortOrder,onSelectDatasourceFilters:this.onSelectDatasourceFilters,exploreId:m}),icon:"fa fa-star"},{label:"Settings",value:Z.Settings,content:o.a.createElement(x,{retentionPeriod:this.state.retentionPeriod,starredTabAsFirstTab:this.state.starredTabAsFirstTab,activeDatasourceOnly:this.state.activeDatasourceOnly,onChangeRetentionPeriod:this.onChangeRetentionPeriod,toggleStarredTabAsFirstTab:this.toggleStarredTabAsFirstTab,toggleactiveDatasourceOnly:this.toggleactiveDatasourceOnly,deleteRichHistory:b}),icon:"gicon gicon-preferences"}];return o.a.createElement("div",{className:y.container},o.a.createElement(l.TabsBar,{className:y.tabs},v.map((function(e){return o.a.createElement(l.Tab,{key:e.value,label:e.label,active:e.value===s,onChangeTab:function(){return t.onSelectTab(e)},icon:e.icon})})),o.a.createElement("div",{className:y.close,onClick:g},o.a.createElement("i",{className:"fa fa-times",title:"Close query history"}))),o.a.createElement(l.CustomScrollbar,{className:Object(a.css)(V())},o.a.createElement(l.TabContent,{className:y.tabContent},null===(e=v.find((function(e){return e.value===s})))||void 0===e?void 0:e.content)))}}])&&J(n.prototype,r),u&&J(n,u),t}(r.PureComponent),ue=Object(l.withTheme)(le)},"75pU":function(e,t){function n(e,t,n,r){var o,a=null==(o=r)||"number"==typeof o||"boolean"==typeof o?r:n(r),i=t.get(a);return void 0===i&&(i=e.call(this,r),t.set(a,i)),i}function r(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),a=t.get(o);return void 0===a&&(a=e.apply(this,r),t.set(o,a)),a}function o(e,t,n,r,o){return n.bind(t,e,r,o)}function a(e,t){return o(e,this,1===e.length?n:r,t.cache.create(),t.serializer)}function i(){return JSON.stringify(arguments)}function s(){this.cache=Object.create(null)}s.prototype.has=function(e){return e in this.cache},s.prototype.get=function(e){return this.cache[e]},s.prototype.set=function(e,t){this.cache[e]=t};var c={create:function(){return new s}};e.exports=function(e,t){var n=t&&t.cache?t.cache:c,r=t&&t.serializer?t.serializer:i;return(t&&t.strategy?t.strategy:a)(e,{cache:n,serializer:r})},e.exports.strategies={variadic:function(e,t){return o(e,this,r,t.cache.create(),t.serializer)},monadic:function(e,t){return o(e,this,n,t.cache.create(),t.serializer)}}},"9BUi":function(e,t,n){"use strict";(function(e){var r=n("q1tI"),o=n.n(r),a=n("sEfC"),i=n.n(a),s=n("OFL0"),c=n.n(s),l=n("0cfB"),u=n("/MKj"),p=n("y2tl"),f=n("kYjj"),d=n("Efza"),h=n("Obii"),m=n("OTXG"),b=n("0H9l");function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var k=function(){},C=function(e){function t(){var e,n;O(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(n=E(this,(e=j(t)).call.apply(e,[this].concat(o)))).state={textEditModeEnabled:!1},n.onRunQuery=function(){var e=n.props.exploreId;n.props.runQueries(e)},n.onChange=function(e,t){var r=n.props,o=r.datasourceInstance,a=r.exploreId,i=r.index;n.props.changeQuery(a,e,i,t),e&&!t&&o.getHighlighterExpression&&0===i&&n.updateLogsHighlights(e)},n.onClickToggleDisabled=function(){var e=n.props,t=e.exploreId,r=e.index,o=e.query,a=v({},o,{hide:!o.hide});n.props.changeQuery(t,a,r,!0)},n.onClickRemoveButton=function(){var e=n.props,t=e.exploreId,r=e.index;n.props.removeQueryRowAction({exploreId:t,index:r}),n.props.runQueries(t)},n.onClickToggleEditorMode=function(){n.setState({textEditModeEnabled:!n.state.textEditModeEnabled})},n.updateLogsHighlights=i()((function(e){var t=n.props.datasourceInstance;if(t.getHighlighterExpression){var r=n.props.exploreId,o=t.getHighlighterExpression(e);n.props.highlightLogsExpressionAction({exploreId:r,expressions:o})}}),500),n}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(t,e),n=t,(r=[{key:"componentWillUnmount",value:function(){console.log("QueryRow will unmount")}},{key:"render",value:function(){var e,t,n,r=this.props,a=r.datasourceInstance,i=r.history,s=r.query,l=r.exploreEvents,u=r.range,d=r.absoluteRange,m=r.queryResponse,g=r.mode,y=r.latency,v=g===h.ExploreMode.Metrics&&c()(a,"components.QueryCtrl.prototype.toggleEditorMode"),w=m.state===h.LoadingState.NotStarted,O=m.error&&m.error.refId===s.refId?[m.error]:[];if(g===h.ExploreMode.Metrics&&(null===(e=a.components)||void 0===e?void 0:e.ExploreMetricsQueryField))n=a.components.ExploreMetricsQueryField;else if(g===h.ExploreMode.Logs&&(null===(t=a.components)||void 0===t?void 0:t.ExploreLogsQueryField))n=a.components.ExploreLogsQueryField;else{var x;n=null===(x=a.components)||void 0===x?void 0:x.ExploreQueryField}return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"query-row"},o.a.createElement("div",{className:"query-row-field flex-shrink-1"},n?o.a.createElement(n,{datasource:a,query:s,history:i,onRunQuery:this.onRunQuery,onBlur:k,onChange:this.onChange,data:m,absoluteRange:d,exploreMode:g}):o.a.createElement(p.a,{error:O,datasource:a,onQueryChange:this.onChange,onExecuteQuery:this.onRunQuery,initialQuery:s,exploreEvents:l,range:u,textEditModeEnabled:this.state.textEditModeEnabled})),o.a.createElement(f.a,{canToggleEditorModes:v,isDisabled:s.hide,isNotStarted:w,latency:y,onClickToggleEditorMode:this.onClickToggleEditorMode,onClickToggleDisabled:this.onClickToggleDisabled,onClickRemoveButton:this.onClickRemoveButton})),O.length>0&&o.a.createElement(b.a,{queryError:O[0]}))}}])&&x(n.prototype,r),a&&x(n,a),t}(r.PureComponent);var T={changeQuery:d.e,highlightLogsExpressionAction:m.i,modifyQueries:d.k,removeQueryRowAction:m.s,runQueries:d.n};t.a=Object(l.hot)(e)(Object(u.connect)((function(e,t){var n=t.exploreId,r=t.index,o=e.explore[n],a=o.datasourceInstance,i=o.history,s=o.queries,c=o.range,l=o.absoluteRange,u=o.mode,p=o.queryResponse,f=o.latency;return{datasourceInstance:a,history:i,query:s[r],range:c,absoluteRange:l,queryResponse:p,mode:u,latency:f}}),T)(C))}).call(this,n("3UD+")(e))},Bdd1:function(e,t,n){"use strict";var r=n("q1tI"),o=n.n(r),a=n("kDDq"),i=n("Zss7"),s=n.n(i),c=n("kDLi"),l=n("Obii");function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(e){function t(){var e,n;p(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(n=d(this,(e=h(t)).call.apply(e,[this].concat(o)))).state={elapsed:0},n.tick=function(){var e=Date.now()-n.offset;n.setState({elapsed:e})},n}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(r=[{key:"start",value:function(){this.offset=Date.now(),this.timer=window.setInterval(this.tick,150)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.time?clearInterval(this.timer):this.props.time&&this.start(),e.resetKey!==this.props.resetKey&&(clearInterval(this.timer),this.start())}},{key:"componentDidMount",value:function(){this.start()}},{key:"componentWillUnmount",value:function(){clearInterval(this.timer)}},{key:"render",value:function(){var e=this.state.elapsed,t=this.props,n=t.className,r=t.time,a=t.humanize,i="".concat(((r||e)/1e3).toFixed(1),"s");if(a){var s=Object(l.toDuration)(e),c=s.hours(),u=s.minutes(),p=s.seconds();i=c?"".concat(c,"h ").concat(u,"m ").concat(p,"s"):u?" ".concat(u,"m ").concat(p,"s"):"".concat(p,"s")}return o.a.createElement("span",{className:"elapsed-time ".concat(n)},i)}}])&&f(n.prototype,r),a&&f(n,a),t}(r.PureComponent);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(){var e=C(["\n    width: 100%;\n  "]);return x=function(){return e},e}function E(){var e=C(["\n    margin-right: ",";\n  "]);return E=function(){return e},e}function j(){var e=C(["\n    font-size: ",";\n    padding-top: ",";\n    display: flex;\n    align-items: center;\n  "]);return j=function(){return e},e}function S(){var e=C(["\n    label: logs-row-fresh;\n    color: ",";\n    background-color: ",";\n    animation: fade 1s ease-out 1s 1 normal forwards;\n    @keyframes fade {\n      from {\n        background-color: ",";\n      }\n      to {\n        background-color: transparent;\n      }\n    }\n  "]);return S=function(){return e},e}function k(){var e=C(["\n    label: logs-rows-live;\n    font-family: ",";\n    font-size: ",";\n    display: flex;\n    flex-flow: column nowrap;\n    height: 65vh;\n    overflow-y: auto;\n    :first-child {\n      margin-top: auto !important;\n    }\n  "]);return k=function(){return e},e}function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,"a",(function(){return R}));var T=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=v(this,w(t).call(this,e))).liveEndDiv=null,n.scrollContainerRef=o.a.createRef(),n.lastScrollPos=null,n.onScroll=function(e){var t=n.props,r=t.isPaused,o=t.onPause,a=e.currentTarget,i=a.scrollTop,s=a.clientHeight,c=a.scrollHeight-(i+s);c>=5&&!r&&(o(),n.lastScrollPos=c)},n.rowsToRender=function(){var e=n.props.isPaused,t=n.state.logRowsToRender,r=void 0===t?[]:t;return e||(r=r.slice(-100)),r},n.state={logRowsToRender:e.logRows},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(t,e),n=t,i=[{key:"getDerivedStateFromProps",value:function(e,t){return e.isPaused?null:{logRowsToRender:e.logRows}}}],(r=[{key:"componentDidUpdate",value:function(e){if(!e.isPaused&&this.props.isPaused)if(this.lastScrollPos&&this.scrollContainerRef.current){var t=this.scrollContainerRef.current,n=t.clientHeight,r=t.scrollHeight-(this.lastScrollPos+n);this.scrollContainerRef.current.scrollTo(0,r),this.lastScrollPos=null}else this.liveEndDiv&&this.liveEndDiv.scrollIntoView(!1)}},{key:"render",value:function(){var e=this,t=this.props,n=t.theme,r=t.timeZone,i=t.onPause,l=t.onResume,u=t.isPaused,p=function(e){return{logsRowsLive:Object(a.css)(k(),e.typography.fontFamily.monospace,e.typography.size.sm),logsRowFade:Object(a.css)(S(),e.colors.text,s()(e.colors.blueLight).setAlpha(.25).toString(),s()(e.colors.blueLight).setAlpha(.25).toString()),logsRowsIndicator:Object(a.css)(j(),e.typography.size.md,e.spacing.sm),button:Object(a.css)(E(),e.spacing.sm),fullWidth:Object(a.css)(x())}}(n),f="utc"===r,d=Object(c.getLogRowStyles)(n),h=d.logsRow,m=d.logsRowLocalTime,g=d.logsRowMessage;return o.a.createElement("div",null,o.a.createElement("table",{className:p.fullWidth},o.a.createElement("tbody",{onScroll:u?void 0:this.onScroll,className:Object(a.cx)(["logs-rows",p.logsRowsLive]),ref:this.scrollContainerRef},this.rowsToRender().map((function(e){return o.a.createElement("tr",{className:Object(a.cx)(h,p.logsRowFade),key:e.uid},f&&o.a.createElement("td",{className:Object(a.cx)(m),title:"Local: ".concat(e.timeLocal," (").concat(e.timeFromNow,")")},e.timeUtc),!f&&o.a.createElement("td",{className:Object(a.cx)(m),title:"".concat(e.timeUtc," (").concat(e.timeFromNow,")")},e.timeLocal),o.a.createElement("td",{className:Object(a.cx)(g)},e.entry))})),o.a.createElement("tr",{ref:function(t){e.liveEndDiv=t,e.liveEndDiv&&!u&&e.liveEndDiv.scrollIntoView(!1)}}))),o.a.createElement("div",{className:Object(a.cx)([p.logsRowsIndicator])},o.a.createElement("button",{onClick:u?l:i,className:Object(a.cx)("btn btn-secondary",p.button)},o.a.createElement("i",{className:Object(a.cx)("fa",u?"fa-play":"fa-pause")})," ",u?"Resume":"Pause"),o.a.createElement("button",{onClick:this.props.stopLive,className:Object(a.cx)("btn btn-inverse",p.button)},o.a.createElement("i",{className:"fa fa-stop"}),"  Exit live mode"),u||o.a.createElement("span",null,"Last line received: ",o.a.createElement(b,{resetKey:this.props.logRows,humanize:!0})," ago")))}}])&&y(n.prototype,r),i&&y(n,i),t}(r.PureComponent),R=Object(c.withTheme)(T)},Gyt8:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r,o=n("q1tI"),a=n.n(o);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.left="left",e.right="right"}(r||(r={}));var u=Object(o.forwardRef)((function(e,t){var n=e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{iconSide:r.left},{},e),o=n.title,u=n.onClick,p=n.buttonClassName,f=n.iconClassName,d=n.splitted,h=n.iconSide,m=n.disabled,b=s(n,["title","onClick","buttonClassName","iconClassName","splitted","iconSide","disabled"]);return a.a.createElement("div",i({ref:t},b),a.a.createElement("button",{className:"btn navbar-button ".concat(p||""),onClick:u,disabled:m||!1},f&&h===r.left?a.a.createElement("i",{className:"".concat(f)}):null,a.a.createElement("span",{className:"btn-title"},d?"":function(e,t){return t===r.left?" "+e:t===r.right?e+" ":e}(o,h)),f&&h===r.right?a.a.createElement("i",{className:"".concat(f)}):null))}))},JW4h:function(e,t,n){"use strict";(function(e){var r=n("q1tI"),o=n.n(r),a=n("WGjm"),i=n("/MKj"),s=n("0cfB"),c=n("kDDq"),l=n("SMGL"),u=n("kDLi"),p=n("w9yp"),f=n("6Pa6"),d=n("Efza");function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function m(){var e=v(["\n      background: ",";\n      transition: 0.3s background ease-in-out;\n      position: relative;\n      width: 200px !important;\n      left: calc(50% - 100px) !important;\n      cursor: grab;\n      border-radius: 4px;\n\n      &:hover {\n        background-color: ",";\n\n        &:after {\n          border-color: ",";\n        }\n      }\n\n      &:after {\n        content: '';\n        display: block;\n        height: 2px;\n        position: relative;\n        top: 4px;\n        border-top: 4px dotted ",";\n        margin: 0 4px;\n      }\n    "]);return m=function(){return e},e}function b(){var e=v(["\n      opacity: 0;\n      transform: translateY(400px);\n    "]);return b=function(){return e},e}function g(){var e=v(["\n      opacity: 1;\n      transition: transform 0.5s ease-in;\n    "]);return g=function(){return e},e}function y(){var e=v(["\n      position: fixed !important;\n      bottom: 0;\n      background: ",";\n      border-top: 1px solid ",";\n      margin: 0px;\n      margin-right: -",";\n      margin-left: -",";\n    "]);return y=function(){return e},e}function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var w=Object(u.stylesFactory)((function(e){var t=e.isLight?e.colors.gray7:e.colors.dark2,n=e.isLight?e.colors.gray5:e.colors.dark6,r=e.isLight?e.colors.gray5:e.colors.gray15,o=e.isLight?e.colors.gray70:e.colors.gray33,a=e.isLight?e.colors.gray70:e.colors.gray33,i=e.isLight?e.colors.gray5:e.colors.dark7;return{container:Object(c.css)(y(),t,n,e.spacing.md,e.spacing.md),drawerActive:Object(c.css)(g()),drawerNotActive:Object(c.css)(b()),rzHandle:Object(c.css)(m(),r,a,i,o)}}));var O={deleteRichHistory:d.i};t.a=Object(s.hot)(e)(Object(i.connect)((function(e,t){var n=t.exploreId,r=e.explore,o=r[n].datasourceInstance,a=l.a.getBool(p.a.starredTabAsFirstTab,!1)?f.b.Starred:f.b.RichHistory;return{richHistory:r.richHistory,firstTab:a,activeDatasourceInstance:null==o?void 0:o.name}}),O)((function(e){var t=h(Object(r.useState)(!1),2),n=t[0],i=t[1],s=h(Object(r.useState)(400),2),l=s[0],p=s[1];Object(r.useEffect)((function(){var e=setTimeout((function(){return i(!0)}),10);return function(){return clearTimeout(e)}}),[]);var d=e.richHistory,m=e.width,b=e.firstTab,g=e.activeDatasourceInstance,y=e.exploreId,v=e.deleteRichHistory,O=e.onClose,x=Object(u.useTheme)(),E=w(x),j="".concat(m+31.5,"px");return o.a.createElement(a.Resizable,{className:Object(c.cx)(E.container,n?E.drawerActive:E.drawerNotActive),defaultSize:{width:j,height:"400px"},handleClasses:{top:E.rzHandle},enable:{top:!0,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},maxHeight:"100vh",maxWidth:j,minWidth:j,onResize:function(e,t,n){p(Number(n.style.height.slice(0,-2)))}},o.a.createElement(f.a,{richHistory:d,firstTab:b,activeDatasourceInstance:g,exploreId:y,deleteRichHistory:v,onClose:O,height:l}))})))}).call(this,n("3UD+")(e))},Nxm2:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n("q1tI")),c={top:{width:"100%",height:"10px",top:"-5px",left:"0px",cursor:"row-resize"},right:{width:"10px",height:"100%",top:"0px",right:"-5px",cursor:"col-resize"},bottom:{width:"100%",height:"10px",bottom:"-5px",left:"0px",cursor:"row-resize"},left:{width:"10px",height:"100%",top:"0px",left:"-5px",cursor:"col-resize"},topRight:{width:"20px",height:"20px",position:"absolute",right:"-10px",top:"-10px",cursor:"ne-resize"},bottomRight:{width:"20px",height:"20px",position:"absolute",right:"-10px",bottom:"-10px",cursor:"se-resize"},bottomLeft:{width:"20px",height:"20px",position:"absolute",left:"-10px",bottom:"-10px",cursor:"sw-resize"},topLeft:{width:"20px",height:"20px",position:"absolute",left:"-10px",top:"-10px",cursor:"nw-resize"}},l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return o(t,e),t.prototype.render=function(){return s.createElement("div",{className:this.props.className||"",style:a(a({position:"absolute",userSelect:"none"},c[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(s.PureComponent);t.Resizer=l},OFL0:function(e,t,n){var r=n("lvO4"),o=n("4sDh");e.exports=function(e,t){return null!=e&&o(e,t,r)}},OxIB:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n("q1tI"),o=n("/MKj"),a=n("Efza"),i=n("OTXG"),s=n("kDLi");function c(e){var t,n,c,l,u,p,f=(t=e.exploreId,n=Object(o.useDispatch)(),c=Object(r.useCallback)((function(){n(Object(i.x)({exploreId:t,isPaused:!0}))}),[t,n]),l=Object(r.useCallback)((function(){n(Object(i.x)({exploreId:t,isPaused:!1}))}),[t,n]),u=Object(r.useCallback)((function(){c(),n(Object(a.f)(t,s.RefreshPicker.offOption.value)),n(Object(a.n)(t))}),[t,n,c]),p=Object(r.useCallback)((function(){n(Object(a.f)(t,s.RefreshPicker.liveOption.value))}),[t,n]),{pause:c,resume:l,stop:u,start:p});return e.children(f)}},TUgz:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n("q1tI"),o=n.n(r),a=n("kDDq"),i=n("kDLi");function s(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n    max-width: ",";\n    margin-top: ",";\n    align-self: center;\n  "]);return s=function(){return e},e}var c=function(){var e=Object(r.useContext)(i.ThemeContext),t=o.a.createElement(o.a.Fragment,null,o.a.createElement("i",{className:"fa fa-rocket"}),o.a.createElement(o.a.Fragment,null," 小贴士: 您也可以通过配置文件来定义数据源. "),o.a.createElement("a",{href:"http://docs.grafana.org/administration/provisioning/#datasources?utm_source=explore",target:"_blank",rel:"noopener",className:"text-link"},"了解更多")),n=o.a.createElement(i.LinkButton,{size:"lg",href:"/datasources/new",icon:"gicon gicon-datasources"},"添加数据源"),c=Object(a.css)(s(),e.breakpoints.lg,e.spacing.md);return o.a.createElement(i.CallToActionCard,{callToActionElement:n,className:c,footer:t,message:"探索模式需要添加至少一个数据源. 然后才能用探索模式来查询.",theme:e})}},WGjm:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=i(n("q1tI")),l=n("Nxm2"),u=s(n("75pU")),p={width:"auto",height:"auto"},f=u.default((function(e,t,n){return Math.max(Math.min(e,n),t)})),d=u.default((function(e,t){return Math.round(e/t)*t})),h=u.default((function(e,t){return new RegExp(e,"i").test(t)})),m=u.default((function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n}),0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e})),b=u.default((function(e,t){return e.substr(e.length-t.length,t.length)===t})),g=u.default((function(e){return"auto"===(e=e.toString())?e:b(e,"px")?e:b(e,"%")?e:b(e,"vh")?e:b(e,"vw")?e:b(e,"vmax")?e:b(e,"vmin")?e:e+"px"})),y=function(e,t){if(e&&"string"==typeof e){if(b(e,"%"))return t*(n=Number(e.replace("%",""))/100);if(b(e,"vw")){var n=Number(e.replace("vw",""))/100;return window.innerWidth*n}if(b(e,"vh")){n=Number(e.replace("vh",""))/100;return window.innerHeight*n}}return e},v=u.default((function(e,t,n,r,o){return t=y(t,e.width),n=y(n,e.height),r=y(r,e.width),o=y(o,e.height),{maxWidth:void 0===t?void 0:Number(t),maxHeight:void 0===n?void 0:Number(n),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===o?void 0:Number(o)}})),w=["style","className","grid","snap","bounds","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],O=function(e){function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableTop=0,n.targetLeft=0,n.targetTop=0,n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"}},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return o(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||p},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"base",{get:function(){var e=this.parentNode;if(e)for(var t=0,n=[].slice.call(e.children);t<n.length;t++){var r=n[t];if(r instanceof HTMLElement&&r.classList.contains("__resizable_base__"))return r}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if("undefined"!=typeof window&&this.resizable){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&b(e.propsSize[t].toString(),"%")){if(b(e.state[t].toString(),"%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return g(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?g(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?g(t.height):n("height")}},enumerable:!0,configurable:!0}),t.prototype.getParentSize=function(){if(!this.base||!this.parentNode)return{width:window.innerWidth,height:window.innerHeight};var e=!1,t=this.parentNode.style.flexWrap,n=this.base.style.minWidth;"wrap"!==t&&(e=!0,this.parentNode.style.flexWrap="wrap"),this.base.style.position="relative",this.base.style.minWidth="100%";var r={width:this.base.offsetWidth,height:this.base.offsetHeight};return this.base.style.position="absolute",e&&(this.parentNode.style.flexWrap=t),this.base.style.minWidth=n,r},t.prototype.bindEvents=function(){"undefined"!=typeof window&&(window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseleave",this.onMouseUp),window.addEventListener("touchmove",this.onMouseMove),window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){"undefined"!=typeof window&&(window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseleave",this.onMouseUp),window.removeEventListener("touchmove",this.onMouseMove),window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable){var e=window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0});var t=this.parentNode;if(t instanceof HTMLElement&&!this.base){var n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.transform="scale(0, 0)",n.style.left="0",n.style.flex="0",n.classList?n.classList.add("__resizable_base__"):n.className+="__resizable_base__",t.appendChild(n)}}},t.prototype.componentWillUnmount=function(){if("undefined"!=typeof window){this.unbindEvents();var e=this.parentNode;if(!this.base||!e)return;if(!(e instanceof HTMLElement&&this.base instanceof Node))return;e.removeChild(this.base)}},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){if("parent"===this.props.bounds){var n=this.parentNode;if(n instanceof HTMLElement){var r=n.offsetWidth+(this.parentLeft-this.resizableLeft),o=n.offsetHeight+(this.parentTop-this.resizableTop);e=e&&e<r?e:r,t=t&&t<o?t:o}}else if("window"===this.props.bounds){if("undefined"!=typeof window){r=window.innerWidth-this.resizableLeft,o=window.innerHeight-this.resizableTop;e=e&&e<r?e:r,t=t&&t<o?t:o}}else if(this.props.bounds instanceof HTMLElement){r=this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),o=this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop);e=e&&e<r?e:r,t=t&&t<o?t:o}return{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,o=this.state,a=o.direction,i=o.original,s=this.props,c=s.lockAspectRatio,l=s.lockAspectRatioExtraHeight,u=s.lockAspectRatioExtraWidth,p=i.width,f=i.height,d=l||0,m=u||0;return h("right",a)&&(p=i.width+(e-i.x)*r/n,c&&(f=(p-m)/this.ratio+d)),h("left",a)&&(p=i.width-(e-i.x)*r/n,c&&(f=(p-m)/this.ratio+d)),h("bottom",a)&&(f=i.height+(t-i.y)*r/n,c&&(p=(f-d)*this.ratio+m)),h("top",a)&&(f=i.height-(t-i.y)*r/n,c&&(p=(f-d)*this.ratio+m)),{newWidth:p,newHeight:f}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var o=this.props,a=o.lockAspectRatio,i=o.lockAspectRatioExtraHeight,s=o.lockAspectRatioExtraWidth,c=void 0===r.width?10:r.width,l=void 0===n.width||n.width<0?e:n.width,u=void 0===r.height?10:r.height,p=void 0===n.height||n.height<0?t:n.height,d=i||0,h=s||0;if(a){var m=(u-d)*this.ratio+h,b=(p-d)*this.ratio+h,g=(c-h)/this.ratio+d,y=(l-h)/this.ratio+d,v=Math.max(c,m),w=Math.min(l,b),O=Math.max(u,g),x=Math.min(p,y);e=f(e,v,w),t=f(t,O,x)}else e=f(e,c,l),t=f(t,u,p);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e instanceof HTMLElement){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds instanceof HTMLElement){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),o=r.left,a=r.top;this.resizableLeft=o,this.resizableTop=a}},t.prototype.onResizeStart=function(e,t){if(this.resizable){var n,r=0,o=0;if(e.nativeEvent instanceof MouseEvent){if(r=e.nativeEvent.clientX,o=e.nativeEvent.clientY,3===e.nativeEvent.which)return}else e.nativeEvent instanceof TouchEvent&&(r=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY);if(this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var i=window.getComputedStyle(this.resizable);if("auto"!==i.flexBasis){var s=this.parentNode;if(s){var c=window.getComputedStyle(s).flexDirection;this.flexDir=c.startsWith("row")?"row":"column",n=i.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:a(a({},this.state.backgroundStyle),{cursor:window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){if(this.state.isResizing&&this.resizable){var t=this.props,n=t.maxWidth,r=t.maxHeight,o=t.minWidth,a=t.minHeight,i=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,s=e instanceof MouseEvent?e.clientY:e.touches[0].clientY,c=this.state,l=c.direction,u=c.original,p=c.width,f=c.height,h=this.getParentSize(),g=v(h,n,r,o,a);n=g.maxWidth,r=g.maxHeight,o=g.minWidth,a=g.minHeight;var y=this.calculateNewSizeFromDirection(i,s),w=y.newHeight,O=y.newWidth,x=this.calculateNewMaxFromBoundary(n,r),E=this.calculateNewSizeFromAspectRatio(O,w,{width:x.maxWidth,height:x.maxHeight},{width:o,height:a});if(O=E.newWidth,w=E.newHeight,this.props.grid){var j=d(O,this.props.grid[0]),S=d(w,this.props.grid[1]),k=this.props.snapGap||0;O=0===k||Math.abs(j-O)<=k?j:O,w=0===k||Math.abs(S-w)<=k?S:w}this.props.snap&&this.props.snap.x&&(O=m(O,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(w=m(w,this.props.snap.y,this.props.snapGap));var C={width:O-u.width,height:w-u.height};if(p&&"string"==typeof p)if(b(p,"%"))O=O/h.width*100+"%";else if(b(p,"vw")){O=O/window.innerWidth*100+"vw"}else if(b(p,"vh")){O=O/window.innerHeight*100+"vh"}if(f&&"string"==typeof f)if(b(f,"%"))w=w/h.height*100+"%";else if(b(f,"vw")){w=w/window.innerWidth*100+"vw"}else if(b(f,"vh")){w=w/window.innerHeight*100+"vh"}var T={width:this.createSizeForCssProperty(O,"width"),height:this.createSizeForCssProperty(w,"height")};"row"===this.flexDir?T.flexBasis=T.width:"column"===this.flexDir&&(T.flexBasis=T.height),this.setState(T),this.props.onResize&&this.props.onResize(e,l,this.resizable,C)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,o=t.original;if(n&&this.resizable){var i={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,i),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:a(a({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,o=t.handleClasses,a=t.handleWrapperStyle,i=t.handleWrapperClass,s=t.handleComponent;if(!n)return null;var u=Object.keys(n).map((function(t){return!1!==n[t]?c.createElement(l.Resizer,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:o&&o[t]},s&&s[t]?s[t]:null):null}));return c.createElement("span",{className:i,style:a},u)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,n){return-1!==w.indexOf(n)?t:(t[n]=e.props[n],t)}),{}),n=a(a(a({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});return this.state.flexBasis&&(n.flexBasis=this.state.flexBasis),c.createElement("div",a({ref:this.ref,style:n,className:this.props.className},t),this.state.isResizing&&c.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(c.PureComponent);t.Resizable=O},ajrG:function(e,t,n){"use strict";(function(e){var r=n("q1tI"),o=n.n(r),a=n("0cfB"),i=n("/MKj"),s=n("kDLi"),c=n("Obii"),l=n("Efza"),u=n("OTXG"),p=n("5BoW"),f=n("1LJY"),d=n("Bdd1"),h=n("gmR8"),m=n("lMcC"),b=n("OxIB"),g=n("MAcC");function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){v(a,r,o,i,s,"next",e)}function s(e){v(a,r,o,i,s,"throw",e)}i(void 0)}))}}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var k=function(e){function t(){var e,n;O(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(n=E(this,(e=j(t)).call.apply(e,[this].concat(o)))).onChangeTime=function(e){var t=n.props,r=t.exploreId;(0,t.updateTimeRange)({exploreId:r,absoluteRange:e})},n.handleDedupStrategyChange=function(e){n.props.changeDedupStrategy(n.props.exploreId,e)},n.handleToggleLogLevel=function(e){var t=n.props.exploreId;n.props.toggleLogLevelAction({exploreId:t,hiddenLogLevels:e})},n.getLogRowContext=function(){var e=w(regeneratorRuntime.mark((function e(t,r){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null==(o=n.props.datasourceInstance)?void 0:o.getLogRowContext)){e.next=3;break}return e.abrupt("return",o.getLogRowContext(t,r));case 3:return e.abrupt("return",[]);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),n}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props,n=t.loading,r=t.logsHighlighterExpressions,a=t.logRows,i=t.logsMeta,l=t.logsSeries,u=t.dedupedRows,p=t.onClickFilterLabel,f=t.onClickFilterOutLabel,y=t.onStartScanning,v=t.onStopScanning,w=t.absoluteRange,O=t.timeZone,x=t.scanning,E=t.range,j=t.width,S=t.isLive,k=t.exploreId;return o.a.createElement(o.a.Fragment,null,o.a.createElement(m.a,{visible:S},o.a.createElement(s.Collapse,{label:"Logs",loading:!1,isOpen:!0},o.a.createElement(b.a,{exploreId:k},(function(t){return o.a.createElement(d.a,{logRows:a,timeZone:O,stopLive:t.stop,isPaused:e.props.isPaused,onPause:t.pause,onResume:t.resume})})))),o.a.createElement(m.a,{visible:!S},o.a.createElement(s.Collapse,{label:"Logs",loading:n,isOpen:!0},o.a.createElement(h.a,{dedupStrategy:this.props.dedupStrategy||c.LogsDedupStrategy.none,logRows:a,logsMeta:i,logsSeries:l,dedupedRows:u,highlighterExpressions:r,loading:n,onChangeTime:this.onChangeTime,onClickFilterLabel:p,onClickFilterOutLabel:f,onStartScanning:y,onStopScanning:v,onDedupStrategyChange:this.handleDedupStrategyChange,onToggleLogLevel:this.handleToggleLogLevel,absoluteRange:w,timeZone:O,scanning:x,scanRange:E.raw,width:j,getRowContext:this.getLogRowContext,getFieldLinks:g.b}))))}}])&&x(n.prototype,r),a&&x(n,a),t}(r.PureComponent);var C={changeDedupStrategy:l.c,toggleLogLevelAction:u.E,updateTimeRange:l.w};t.a=Object(a.hot)(e)(Object(i.connect)((function(e,t){var n=t.exploreId,r=e.explore[n],o=r.logsHighlighterExpressions,a=r.logsResult,i=r.loading,s=r.scanning,c=r.datasourceInstance,l=r.isLive,u=r.isPaused,d=r.range,h=r.absoluteRange,m=r.dedupStrategy,b=Object(p.a)(r),g=Object(f.a)(e.user);return{loading:i,logsHighlighterExpressions:o,logRows:a&&a.rows,logsMeta:a&&a.meta,logsSeries:a&&a.series,scanning:s,timeZone:g,dedupStrategy:m,dedupedRows:b,datasourceInstance:c,isLive:l,isPaused:u,range:d,absoluteRange:h}}),C)(k))}).call(this,n("3UD+")(e))},bkob:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Q}));var r=n("3WX/"),o=n.n(r),a=n("q1tI"),i=n.n(a),s=n("/MKj"),c=n("0cfB"),l=n("Wwog"),u=n("TSYQ"),p=n.n(u),f=n("kDDq"),d=n("kDLi"),h=n("Obii"),m=n("Wkk1"),b=n("Efza"),g=n("3SGO"),y=n("1LJY"),v=n("p+Sq"),w=n("PbtU"),O=n("kd/b"),x=n("sQnn"),E=n("Gyt8"),j=n("nmUH"),S=n("OxIB"),k=n("5BoW"),C=n("KyLG");function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){z(a,r,o,i,s,"next",e)}function s(e){z(a,r,o,i,s,"throw",e)}i(void 0)}))}}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n      margin-left: 10px;\n      @media (max-width: 1110px) {\n        margin-left: 4px;\n      }\n    "]);return F=function(){return e},e}var q=Object(l.a)((function(){return{liveTailButtons:Object(f.css)(F())}})),B=function(e){function t(){var e,n;D(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return(n=_(this,(e=M(t)).call.apply(e,[this].concat(a)))).onChangeDatasource=function(){var e=L(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.props.changeDatasource(n.props.exploreId,t.value);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.onClearAll=function(){n.props.clearAll(n.props.exploreId)},n.onRunQuery=function(){return n.props.runQueries(n.props.exploreId)},n.onChangeRefreshInterval=function(e){var t=n.props;(0,t.changeRefreshInterval)(t.exploreId,e)},n.onModeChange=function(e){var t=n.props;(0,t.changeMode)(t.exploreId,e)},n.onChangeTimeSync=function(){var e=n.props;(0,e.syncTimes)(e.exploreId)},n.returnToPanel=function(){var e=L(regeneratorRuntime.mark((function e(){var t,r,a,i,s,c,l,u,p,f,d=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=d.length>0&&void 0!==d[0]?d[0]:{},r=t.withChanges,a=void 0!==r&&r,i=n.props,s=i.originPanelId,c=i.queries,l=Object(v.a)(),u=l.getCurrent(),p=w.a.slugifyForUrl(u.title),a&&n.props.setDashboardQueriesToUpdateOnLoad({panelId:s,queries:n.cleanQueries(c)}),f={fullscreen:a||u.meta.fullscreen,edit:a||u.meta.isEditing},n.props.updateLocation({path:"/d/".concat(u.uid,"/:").concat(p),query:P({},o()(f,(function(e){return!e})),{panelId:s})});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n.getSelectedDatasource=function(){var e=n.props.datasourceName,t=Object(k.b)();return e?t.find((function(t){return t.name===e})):void 0},n}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(t,e),n=t,(r=[{key:"cleanQueries",value:function(e){return e.map((function(e){return delete e.context,delete e.key,e}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.datasourceMissing,r=t.closeSplit,o=t.exploreId,a=t.loading,s=t.range,c=t.timeZone,l=t.splitted,u=t.syncedTimes,f=t.refreshInterval,b=t.onChangeTime,g=t.split,y=t.supportedModes,v=t.selectedMode,w=t.hasLiveOption,C=t.isLive,T=t.isPaused,R=t.originPanelId,P=t.datasourceLoading,N=t.containerWidth,z=q(),L=R&&Number.isInteger(R),D=p()("btn","navbar-button",{"btn--radius-right-0":L,"navbar-button navbar-button--border-right-0":L}),I=(l?N<700:N<800)||!1,_=l||N<1210;return i.a.createElement("div",{className:l?"explore-toolbar splitted":"explore-toolbar"},i.a.createElement("div",{className:"explore-toolbar-item"},i.a.createElement("div",{className:"explore-toolbar-header"},i.a.createElement("div",{className:"explore-toolbar-header-title"},"left"===o&&i.a.createElement("span",{className:"navbar-page-btn"},i.a.createElement("i",{className:"gicon gicon-explore"}),"Explore")),l&&i.a.createElement("a",{className:"explore-toolbar-header-close",onClick:function(){return r(o)}},i.a.createElement("i",{className:"fa fa-times fa-fw"})))),i.a.createElement("div",{className:"explore-toolbar-item"},i.a.createElement("div",{className:"explore-toolbar-content"},n?null:i.a.createElement("div",{className:"explore-toolbar-content-item"},i.a.createElement("div",{className:p()("explore-ds-picker",I?"explore-ds-picker--small":"")},i.a.createElement(m.a,{onChange:this.onChangeDatasource,datasources:Object(k.b)(),current:this.getSelectedDatasource(),showLoading:P,hideTextValue:I})),y.length>1?i.a.createElement("div",{className:"query-type-toggle"},i.a.createElement(d.ToggleButtonGroup,{label:"",transparent:!0},i.a.createElement(d.ToggleButton,{key:h.ExploreMode.Metrics,value:h.ExploreMode.Metrics,onChange:this.onModeChange,selected:v===h.ExploreMode.Metrics},"Metrics"),i.a.createElement(d.ToggleButton,{key:h.ExploreMode.Logs,value:h.ExploreMode.Logs,onChange:this.onModeChange,selected:v===h.ExploreMode.Logs},"Logs"))):null),R&&Number.isInteger(R)&&!l&&i.a.createElement("div",{className:"explore-toolbar-content-item"},i.a.createElement(d.Tooltip,{content:"Return to panel",placement:"bottom"},i.a.createElement("button",{className:D,onClick:function(){return e.returnToPanel()}},i.a.createElement("i",{className:"fa fa-arrow-left"}))),L&&i.a.createElement(d.ButtonSelect,{className:"navbar-button--attached btn--radius-left-0$",options:[{label:"Return to panel with changes",value:""}],onChange:function(){return e.returnToPanel({withChanges:!0})},maxMenuHeight:380})),"left"!==o||l?null:i.a.createElement("div",{className:"explore-toolbar-content-item explore-icon-align"},i.a.createElement(E.a,{splitted:l,title:"Split",onClick:g,iconClassName:"fa fa-fw fa-columns icon-margin-right",disabled:C})),!C&&i.a.createElement("div",{className:"explore-toolbar-content-item"},i.a.createElement(O.a,{exploreId:o,range:s,timeZone:c,onChangeTime:b,splitted:l,syncedTimes:u,onChangeTimeSync:this.onChangeTimeSync,hideText:_})),!C&&i.a.createElement("div",{className:"explore-toolbar-content-item explore-icon-align"},i.a.createElement(E.a,{splitted:l,title:"Clear All",onClick:this.onClearAll,iconClassName:"fa fa-fw fa-trash icon-margin-right"})),i.a.createElement("div",{className:"explore-toolbar-content-item"},i.a.createElement(j.a,{refreshInterval:f,onChangeRefreshInterval:this.onChangeRefreshInterval,splitted:l,loading:a||C&&!T,onRun:this.onRunQuery,showDropdown:!C}),f&&i.a.createElement(d.SetInterval,{func:this.onRunQuery,interval:f,loading:a})),w&&i.a.createElement("div",{className:"explore-toolbar-content-item ".concat(z.liveTailButtons)},i.a.createElement(S.a,{exploreId:o},(function(e){return i.a.createElement(x.a,{splitted:l,isLive:C,isPaused:T,start:e.start,pause:e.pause,resume:e.resume,stop:e.stop})}))))))}}])&&I(n.prototype,r),a&&I(n,a),t}(a.PureComponent),H={changeDatasource:b.b,updateLocation:g.c,changeRefreshInterval:b.f,clearAll:b.h,runQueries:b.n,closeSplit:b.q,split:b.r,syncTimes:b.s,changeMode:b.d,setDashboardQueriesToUpdateOnLoad:C.m},Q=Object(c.hot)(e)(Object(s.connect)((function(e,t){var n,r=t.exploreId,o=e.explore.split,a=e.explore.syncedTimes,i=e.explore[r],s=i.datasourceInstance,c=i.datasourceMissing,l=i.range,u=i.refreshInterval,p=i.loading,f=i.supportedModes,d=i.mode,m=i.isLive,b=i.isPaused,g=i.originPanelId,v=i.queries,w=i.datasourceLoading,O=i.containerWidth,x=(null==s?void 0:null===(n=s.meta)||void 0===n?void 0:n.streaming)&&d===h.ExploreMode.Logs;return{datasourceMissing:c,datasourceName:null==s?void 0:s.name,loading:p,range:l,timeZone:Object(y.a)(e.user),splitted:o,refreshInterval:u,supportedModes:f,selectedMode:f.includes(d)?d:f[0],hasLiveOption:x,isLive:m,isPaused:b,originPanelId:g,queries:v,syncedTimes:a,datasourceLoading:w,containerWidth:O}}),H)(B))}).call(this,n("3UD+")(e))},cAtN:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n("q1tI"),o=n.n(r),a=n("9BUi");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=function(e){function t(){return s(this,t),l(this,u(t).apply(this,arguments))}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props,t=e.className,n=void 0===t?"":t,r=e.exploreEvents,i=e.exploreId,s=e.queryKeys;return o.a.createElement("div",{className:n},s.map((function(e,t){return o.a.createElement(a.a,{key:e,exploreEvents:r,exploreId:i,index:t})})))}}])&&c(n.prototype,r),i&&c(n,i),t}(r.PureComponent)},eX1b:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"Wrapper",(function(){return g}));var r=n("q1tI"),o=n.n(r),a=n("0cfB"),i=n("/MKj"),s=n("sBLX"),c=n("sguS"),l=n("kDLi"),u=n("OTXG");function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g=function(e){function t(){return f(this,t),h(this,m(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,e),n=t,(r=[{key:"componentWillUnmount",value:function(){this.props.resetExploreAction({})}},{key:"render",value:function(){var e=this.props.split;return o.a.createElement("div",{className:"page-scrollbar-wrapper"},o.a.createElement(l.CustomScrollbar,{autoHeightMin:"100%",autoHeightMax:"",className:"custom-scrollbar--page"},o.a.createElement("div",{className:"explore-wrapper"},o.a.createElement(l.ErrorBoundaryAlert,{style:"page"},o.a.createElement(c.a,{exploreId:s.a.left})),e&&o.a.createElement(l.ErrorBoundaryAlert,{style:"page"},o.a.createElement(c.a,{exploreId:s.a.right})))))}}])&&d(n.prototype,r),a&&d(n,a),t}(r.Component),y={resetExploreAction:u.t};t.default=Object(a.hot)(e)(Object(i.connect)((function(e){return{split:e.explore.split}}),y)(g))}.call(this,n("3UD+")(e))},gmR8:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n("q1tI"),o=n.n(r),a=n("Obii"),i=n("kDLi"),s=n("SMGL"),c=n("5llT"),l=n("h1VQ");function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g="grafana.explore.logs.showLabels",y="grafana.explore.logs.showTime",v="grafana.explore.logs.wrapLogMessage";var w=function(e){function t(){var e,n;f(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=h(this,(e=m(t)).call.apply(e,[this].concat(o)))).state={showLabels:s.a.getBool(g,!1),showTime:s.a.getBool(y,!0),wrapLogMessage:s.a.getBool(v,!0)},n.onChangeDedup=function(e){var t=n.props.onDedupStrategyChange;return n.props.dedupStrategy===e?t(a.LogsDedupStrategy.none):t(e)},n.onChangeLabels=function(e){var t=e&&e.target;if(t){var r=t.checked;n.setState({showLabels:r}),s.a.set(g,r)}},n.onChangeTime=function(e){var t=e&&e.target;if(t){var r=t.checked;n.setState({showTime:r}),s.a.set(y,r)}},n.onChangewrapLogMessage=function(e){var t=e&&e.target;if(t){var r=t.checked;n.setState({wrapLogMessage:r}),s.a.set(v,r)}},n.onToggleLogLevel=function(e){var t=e.map((function(e){return a.LogLevel[e]}));n.props.onToggleLogLevel(t)},n.onClickScan=function(e){e.preventDefault(),n.props.onStartScanning&&n.props.onStartScanning()},n.onClickStopScan=function(e){e.preventDefault(),n.props.onStopScanning&&n.props.onStopScanning()},n}var n,r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props,n=t.logRows,r=t.logsMeta,s=t.logsSeries,u=t.highlighterExpressions,f=t.loading,d=void 0!==f&&f,h=t.onClickFilterLabel,m=t.onClickFilterOutLabel,b=t.timeZone,g=t.scanning,y=t.scanRange,v=t.width,w=t.dedupedRows,O=t.absoluteRange,x=t.onChangeTime,E=t.getFieldLinks;if(!n)return null;var j=this.state,S=j.showLabels,k=j.showTime,C=j.wrapLogMessage,T=this.props.dedupStrategy,R=n&&n.length>0,P=w?w.reduce((function(e,t){return t.duplicates?e+t.duplicates:e}),0):0,N=r?p(r):[];T!==a.LogsDedupStrategy.none&&N.push({label:"Dedup count",value:P,kind:a.LogsMetaKind.Number});var z=y?"Scanning ".concat(a.rangeUtil.describeTimeRange(y)):"Scanning...",L=s||[];return o.a.createElement("div",{className:"logs-panel"},o.a.createElement("div",{className:"logs-panel-graph"},o.a.createElement(c.a,{series:L,width:v,onHiddenSeriesChanged:this.onToggleLogLevel,loading:d,absoluteRange:O,isStacked:!0,showPanel:!1,showingGraph:!0,showingTable:!0,timeZone:b,showBars:!0,showLines:!1,onUpdateTimeRange:x})),o.a.createElement("div",{className:"logs-panel-options"},o.a.createElement("div",{className:"logs-panel-controls"},o.a.createElement(i.Switch,{label:"Time",checked:k,onChange:this.onChangeTime,transparent:!0}),o.a.createElement(i.Switch,{label:"Unique labels",checked:S,onChange:this.onChangeLabels,transparent:!0}),o.a.createElement(i.Switch,{label:"Wrap lines",checked:C,onChange:this.onChangewrapLogMessage,transparent:!0}),o.a.createElement(i.ToggleButtonGroup,{label:"Dedup",transparent:!0},Object.keys(a.LogsDedupStrategy).map((function(t,n){return o.a.createElement(i.ToggleButton,{key:n,value:t,onChange:e.onChangeDedup,selected:T===t,tooltip:a.LogsDedupDescription[t]},t)}))))),R&&N&&o.a.createElement(l.a,{metaItems:N.map((function(e){return{label:e.label,value:(t=e.value,n=e.kind,n===a.LogsMetaKind.LabelsMap?o.a.createElement("span",{className:"logs-meta-item__labels"},o.a.createElement(i.LogLabels,{labels:t})):t)};var t,n}))}),o.a.createElement(i.LogRows,{logRows:n,deduplicatedRows:w,dedupStrategy:T,getRowContext:this.props.getRowContext,highlighterExpressions:u,rowLimit:n?n.length:void 0,onClickFilterLabel:h,onClickFilterOutLabel:m,showLabels:S,showTime:k,wrapLogMessage:C,timeZone:b,getFieldLinks:E}),!d&&!R&&!g&&o.a.createElement("div",{className:"logs-panel-nodata"},"No logs found.",o.a.createElement("a",{className:"link",onClick:this.onClickScan},"Scan for older logs")),g&&o.a.createElement("div",{className:"logs-panel-nodata"},o.a.createElement("span",null,z),o.a.createElement("a",{className:"link",onClick:this.onClickStopScan},"Stop scan")))}}])&&d(n.prototype,r),u&&d(n,u),t}(r.PureComponent)},h1VQ:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("q1tI"),o=n.n(r),a=n("kDDq"),i=n("kDLi");function s(){var e=p(["\n    font-family: ",";\n  "]);return s=function(){return e},e}function c(){var e=p(["\n    margin-right: calc("," / 2);\n    font-size: ",";\n    font-weight: ",";\n  "]);return c=function(){return e},e}function l(){var e=p(["\n    margin-right: ",";\n    display: flex;\n    align-items: baseline;\n  "]);return l=function(){return e},e}function u(){var e=p(["\n    flex: 1;\n    color: ",";\n    margin-bottom: ",";\n    min-width: 30%;\n    display: flex;\n  "]);return u=function(){return e},e}function p(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var f=Object(i.stylesFactory)((function(e){return{metaContainer:Object(a.css)(u(),e.colors.textWeak,e.spacing.d),metaItem:Object(a.css)(l(),e.spacing.d),metaLabel:Object(a.css)(c(),e.spacing.d,e.typography.size.sm,e.typography.weight.semibold),metaValue:Object(a.css)(s(),e.typography.fontFamily.monospace)}})),d=Object(r.memo)((function(e){var t=Object(r.useContext)(i.ThemeContext),n=f(t),a=e.label,s=e.value;return o.a.createElement("div",{className:n.metaItem},a&&o.a.createElement("span",{className:n.metaLabel},a,":"),o.a.createElement("span",{className:n.metaValue},s))})),h=Object(r.memo)((function(e){var t=Object(r.useContext)(i.ThemeContext),n=f(t),a=e.metaItems;return o.a.createElement("div",{className:n.metaContainer},a.map((function(e,t){return o.a.createElement(d,{key:"".concat(t,"-").concat(e.label),label:e.label,value:e.value})})))}))},kYjj:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("q1tI"),o=n.n(r);function a(e){var t=e.canToggleEditorModes,n=e.onClickToggleEditorMode,r=e.onClickToggleDisabled,a=e.onClickRemoveButton,i=e.isDisabled,s=e.isNotStarted,c=e.latency;return o.a.createElement("div",{className:"gf-form-inline flex-shrink-0"},t&&o.a.createElement("div",{className:"gf-form"},o.a.createElement("button",{"aria-label":"Edit mode button",className:"gf-form-label gf-form-label--btn",onClick:n},o.a.createElement("i",{className:"fa fa-pencil"}))),o.a.createElement("div",{className:"gf-form"},o.a.createElement("button",{disabled:!0,className:"gf-form-label",title:"Query row latency"},"".concat((c/1e3).toFixed(1),"s"))),o.a.createElement("div",{className:"gf-form"},o.a.createElement("button",{disabled:s,className:"gf-form-label gf-form-label--btn",onClick:r,title:"Disable/enable query"},o.a.createElement("i",{className:i?"fa fa-eye-slash":"fa fa-eye"}))),o.a.createElement("div",{className:"gf-form"},o.a.createElement("button",{className:"gf-form-label gf-form-label--btn",onClick:a,title:"Remove query"},o.a.createElement("i",{className:"fa fa-minus"}))))}},"kd/b":function(e,t,n){"use strict";var r=n("q1tI"),o=n.n(r),a=n("Obii"),i=n("TSYQ"),s=n.n(i),c=n("kDDq"),l=n("kDLi");function u(){var e=f(["\n      label: topPadding;\n      padding-top: 1px;\n    "]);return u=function(){return e},e}function p(){var e=f(["\n      label: noRightBorderStyle;\n      border-right: 0;\n    "]);return p=function(){return e},e}function f(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var d=Object(l.stylesFactory)((function(e){return{noRightBorderStyle:Object(c.css)(p()),topPadding:Object(c.css)(u())}}));function h(e){var t,n,r,a=e.onClick,i=e.isSynced,c=Object(l.useTheme)(),u=d(c);return o.a.createElement(l.Tooltip,{content:function(){var t=e.isSynced?"Unsync all views":"Sync all views to this time range";return o.a.createElement(o.a.Fragment,null,t)},placement:"bottom"},o.a.createElement("button",{className:s()("btn navbar-button navbar-button--attached",(t={},n="explore-active-button",r=i,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),"aria-label":i?"Synced times":"Unsynced times",onClick:function(){return a()}},o.a.createElement("i",{className:s()("fa fa-link",u.topPadding,i&&"icon-brand-gradient")})))}var m=n("3Tvq"),b=n("LCjV");function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return j}));var j=function(e){function t(){var e,n;v(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=O(this,(e=x(t)).call.apply(e,[this].concat(o)))).onMoveTimePicker=function(e){var t=n.props,r=t.range,o=t.onChangeTime,i=t.timeZone,s=Object(b.a)(e,r),c=s.from,l=s.to;o({from:Object(a.dateTimeForTimeZone)(i,c),to:Object(a.dateTimeForTimeZone)(i,l)})},n.onMoveForward=function(){return n.onMoveTimePicker(1)},n.onMoveBack=function(){return n.onMoveTimePicker(-1)},n.onChangeTimePicker=function(e){n.props.onChangeTime(e.raw)},n.onZoom=function(){var e=n.props,t=e.range,r=e.onChangeTime,o=e.timeZone,i=Object(b.b)(t,2),s=i.from,c=i.to;r({from:Object(a.dateTimeForTimeZone)(o,s),to:Object(a.dateTimeForTimeZone)(o,c)})},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props,t=e.range,n=e.timeZone,r=e.splitted,a=e.syncedTimes,i=e.onChangeTimeSync,s=e.hideText,c=r?o.a.createElement(h,{onClick:i,isSynced:a}):void 0,l={value:t,timeZone:n,onMoveBackward:this.onMoveBack,onMoveForward:this.onMoveForward,onZoom:this.onZoom,hideText:s};return o.a.createElement(m.a,y({},l,{timeSyncButton:c,isSynced:a,onChange:this.onChangeTimePicker}))}}])&&w(n.prototype,r),i&&w(n,i),t}(r.Component)},lMcC:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("q1tI"),o=n.n(r),a=n("Wwog"),i=n("kDDq"),s=n("1w3K");function c(){var e=f(["\n      label: logsExitActive;\n      opacity: 0;\n      transition: opacity ","ms ease-out ","ms;\n    "]);return c=function(){return e},e}function l(){var e=f(["\n      label: logsExit;\n      position: absolute;\n      opacity: 1;\n      height: auto;\n      width: 100%;\n    "]);return l=function(){return e},e}function u(){var e=f(["\n      label: logsEnterActive;\n      opacity: 1;\n      transition: opacity ","ms ease-out ","ms;\n    "]);return u=function(){return e},e}function p(){var e=f(["\n      label: logsEnter;\n      position: absolute;\n      opacity: 0;\n      height: auto;\n      width: 100%;\n    "]);return p=function(){return e},e}function f(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var d=Object(a.a)((function(){return{logsEnter:Object(i.css)(p()),logsEnterActive:Object(i.css)(u(),500,100),logsExit:Object(i.css)(l()),logsExitActive:Object(i.css)(c(),500,100)}}));function h(e){var t=e.visible,n=e.children,r=d();return o.a.createElement(s.CSSTransition,{in:t,mountOnEnter:!0,unmountOnExit:!0,timeout:600,classNames:{enter:r.logsEnter,enterActive:r.logsEnterActive,exit:r.logsExit,exitActive:r.logsExitActive}},n)}},lvO4:function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e,t){return null!=e&&n.call(e,t)}},nmUH:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n("q1tI"),o=n.n(r),a=n("kDLi"),i=n("Wwog"),s=n("kDDq"),c=n("TSYQ"),l=n.n(c),u=n("Gyt8");function p(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n      label: selectButtonOverride;\n      .select-button-value {\n        color: white !important;\n      }\n    "]);return p=function(){return e},e}var f=Object(i.a)((function(){return{selectButtonOverride:Object(s.css)(p())}}));function d(e){var t=e.splitted,n=e.loading,r=e.onRun,i=e.onChangeRefreshInterval,s=e.refreshInterval,c=e.showDropdown,p=f(),d=o.a.createElement(u.a,{splitted:t,title:"Run Query",onClick:r,buttonClassName:l()("navbar-button--secondary",{"btn--radius-right-0":c}),iconClassName:n?"fa fa-spinner fa-fw fa-spin run-icon":"fa fa-refresh fa-fw"});return c?o.a.createElement(a.RefreshPicker,{onIntervalChanged:i,value:s,buttonSelectClassName:"navbar-button--secondary ".concat(p.selectButtonOverride),refreshButton:d}):d}},sQnn:function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var r=n("q1tI"),o=n.n(r),a=n("TSYQ"),i=n.n(a),s=n("Zss7"),c=n.n(s),l=n("kDDq"),u=n("1w3K"),p=n("kDLi"),f=n("Gyt8");function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(){var e=x(["\n      label: stopButtonExitActive;\n      opacity: 0;\n      width: 0;\n    "]);return h=function(){return e},e}function m(){var e=x(["\n      label: stopButtonExit;\n      width: 32px;\n      opacity: 1;\n      overflow: hidden;\n    "]);return m=function(){return e},e}function b(){var e=x(["\n      label: stopButtonEnterActive;\n      opacity: 1;\n      width: 32px;\n    "]);return b=function(){return e},e}function g(){var e=x(["\n      label: stopButtonEnter;\n      width: 0;\n      opacity: 0;\n      overflow: hidden;\n    "]);return g=function(){return e},e}function y(){var e=x(["\n      label: isPaused;\n      border-color: ",";\n      background: transparent;\n      animation: pulse 3s ease-out 0s infinite normal forwards;\n      &:focus {\n        background: transparent;\n        border-color: ",";\n      }\n      &:hover {\n        background-color: ",";\n      }\n      &:active,\n      &:hover {\n        border-color: ",";\n      }\n      @keyframes pulse {\n        0% {\n          color: ",";\n        }\n        50% {\n          color: ",";\n        }\n        100% {\n          color: ",";\n        }\n      }\n    "]);return y=function(){return e},e}function v(){var e=x(["\n      label: isLive;\n      border-color: ",";\n      color: ",";\n      background: transparent;\n      &:focus {\n        background: transparent;\n        border-color: ",";\n        color: ",";\n      }\n      &:hover {\n        background-color: ",";\n      }\n      &:active,\n      &:hover {\n        border-color: ",";\n        color: ",";\n      }\n    "]);return v=function(){return e},e}function w(){var e=x(["\n      label: liveButton;\n      margin: 0;\n    "]);return w=function(){return e},e}function O(){var e=x(["\n      label: noRightBorderStyle;\n      border-right: 0;\n    "]);return O=function(){return e},e}function x(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=Object(p.stylesFactory)((function(e){var t=Object(p.selectThemeVariant)({light:e.colors.gray5,dark:e.colors.dark1},e.type),n=c()(e.colors.orangeDark).lighten(10).toString(),r=c()(e.colors.orangeDark).desaturate(90).toString();return{noRightBorderStyle:Object(l.css)(O()),liveButton:Object(l.css)(w()),isLive:Object(l.css)(v(),e.colors.orangeDark,e.colors.orangeDark,e.colors.orangeDark,e.colors.orangeDark,t,n,n),isPaused:Object(l.css)(y(),e.colors.orangeDark,e.colors.orangeDark,t,n,r,e.colors.orangeDark,r),stopButtonEnter:Object(l.css)(g()),stopButtonEnterActive:Object(l.css)(b()),stopButtonExit:Object(l.css)(m()),stopButtonExitActive:Object(l.css)(h())}})),j=function(){return o.a.createElement(o.a.Fragment,null,"Live")};function S(e){var t,n=e.start,r=e.pause,a=e.resume,s=e.isLive,c=e.isPaused,l=e.stop,h=e.splitted,m=Object(p.useTheme)(),b=E(m),g=s?c?a:r:n;return o.a.createElement(o.a.Fragment,null,o.a.createElement(p.Tooltip,{content:j,placement:"bottom"},o.a.createElement(f.a,{splitted:h,buttonClassName:i()("btn navbar-button",b.liveButton,(t={},d(t,"btn--radius-right-0 explore-active-button ".concat(b.noRightBorderStyle),s),d(t,b.isLive,s&&!c),d(t,b.isPaused,s&&c),t)),iconClassName:i()("fa",c||!s?"fa-play":"fa-pause",s&&"icon-brand-gradient"),onClick:g,title:" Live"})),o.a.createElement(u.CSSTransition,{mountOnEnter:!0,unmountOnExit:!0,timeout:500,in:s,classNames:{enter:b.stopButtonEnter,enterActive:b.stopButtonEnterActive,exit:b.stopButtonExit,exitActive:b.stopButtonExitActive}},o.a.createElement("div",null,o.a.createElement("button",{className:"btn navbar-button navbar-button--attached explore-active-button ".concat(b.isLive),onClick:l},o.a.createElement("i",{className:i()("fa fa-stop icon-brand-gradient")})))))}},sguS:function(e,t,n){"use strict";(function(e){var r=n("q1tI"),o=n.n(r),a=n("0cfB"),i=n("kDDq"),s=n("/MKj"),c=n("jYz7"),l=n("Wwog"),u=n("SMGL"),p=n("kDLi"),f=n("ajrG"),d=n("cAtN"),h=n("zLRG"),m=n("JW4h"),b=n("Efza"),g=n("Obii"),y=n("m257"),v=n("1524"),w=n("bkob"),O=n("TUgz"),x=n("1LJY"),E=n("0H9l"),j=n("OTXG"),S=n("5llT");function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(){var e=L(["\n      margin: 1em 4px 0 0;\n    "]);return N=function(){return e},e}function z(){var e=L(["\n      label: logsMain;\n      // Is needed for some transition animations to work.\n      position: relative;\n    "]);return z=function(){return e},e}function L(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var D=Object(p.stylesFactory)((function(){return{logsMain:Object(i.css)(z()),button:Object(i.css)(N())}})),I=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=T(this,R(t).call(this,e))).getRef=function(e){n.el=e},n.onChangeTime=function(e){var t=n.props;(0,t.updateTimeRange)({exploreId:t.exploreId,rawRange:e})},n.onClickExample=function(e){n.props.setQueries(n.props.exploreId,[e])},n.onClickFilterLabel=function(e,t){n.onModifyQueries({type:"ADD_FILTER",key:e,value:t})},n.onClickFilterOutLabel=function(e,t){n.onModifyQueries({type:"ADD_FILTER_OUT",key:e,value:t})},n.onClickAddQueryRowButton=function(){var e=n.props,t=e.exploreId,r=e.queryKeys;n.props.addQueryRow(t,r.length)},n.onModifyQueries=function(e,t){var r=n.props.datasourceInstance;if(null==r?void 0:r.modifyQuery){n.props.modifyQueries(n.props.exploreId,e,(function(e,t){return r.modifyQuery(e,t)}),t)}},n.onResize=function(e){n.props.changeSize(n.props.exploreId,e)},n.onStartScanning=function(){n.props.scanStart(n.props.exploreId)},n.onStopScanning=function(){n.props.scanStopAction({exploreId:n.props.exploreId})},n.onToggleGraph=function(e){var t=n.props;(0,t.toggleGraph)(t.exploreId,e)},n.onUpdateTimeRange=function(e){var t=n.props,r=t.exploreId;(0,t.updateTimeRange)({exploreId:r,absoluteRange:e})},n.toggleShowRichHistory=function(){n.setState((function(e){return{showRichHistory:!e.showRichHistory}}))},n.refreshExplore=function(){var e=n.props,t=e.exploreId,r=e.update;(r.queries||r.ui||r.range||r.datasource||r.mode)&&n.props.refreshExplore(t)},n.renderEmptyState=function(){return o.a.createElement("div",{className:"explore-container"},o.a.createElement(O.a,null))},n.exploreEvents=new v.a,n.state={showRichHistory:!1},n}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialized,n=e.exploreId,r=e.initialDatasource,o=e.initialQueries,a=e.initialRange,i=e.mode,s=e.initialUI,c=e.originPanelId,l=this.el?this.el.offsetWidth:0;t||this.props.initializeExplore(n,r,o,a,i,l,this.exploreEvents,s,c)}},{key:"componentWillUnmount",value:function(){this.exploreEvents.removeAllListeners()}},{key:"componentDidUpdate",value:function(e){this.refreshExplore()}},{key:"render",value:function(){var e,t,n,r,a=this,s=this.props,l=s.datasourceInstance,u=s.datasourceMissing,b=s.exploreId,v=s.split,O=s.queryKeys,x=s.mode,j=s.graphResult,k=s.loading,C=s.absoluteRange,T=s.showingGraph,R=s.showingTable,P=s.timeZone,N=s.queryResponse,z=s.syncedTimes,L=s.isLive,I=this.state.showRichHistory,_=v?"explore explore-split":"explore",M=D(),A=null==l?void 0:null===(e=l.components)||void 0===e?void 0:e.ExploreStartPage,F=!N||N.state===g.LoadingState.NotStarted,q=N.error?[N.error]:void 0,B=Object(y.l)(q);return o.a.createElement("div",{className:_,ref:this.getRef},o.a.createElement(w.a,{exploreId:b,onChangeTime:this.onChangeTime}),u?this.renderEmptyState():null,l&&o.a.createElement("div",{className:"explore-container"},o.a.createElement(d.a,{exploreEvents:this.exploreEvents,exploreId:b,queryKeys:O}),o.a.createElement("div",{className:"gf-form"},o.a.createElement("button",{"aria-label":"Add row button",className:"gf-form-label gf-form-label--btn ".concat(M.button),onClick:this.onClickAddQueryRowButton,disabled:L},o.a.createElement("i",{className:"fa fa-fw fa-plus icon-margin-right"}),o.a.createElement("span",{className:"btn-title"}," Add query")),o.a.createElement("button",{"aria-label":"Rich history button",className:Object(i.cx)("gf-form-label gf-form-label--btn ".concat(M.button),(t={},n="explore-active-button",r=I,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),onClick:this.toggleShowRichHistory},o.a.createElement("i",{className:"fa fa-fw fa-history icon-margin-right "}),o.a.createElement("span",{className:"btn-title"}," Query history"))),o.a.createElement(E.a,{queryError:B}),o.a.createElement(c.a,{onResize:this.onResize,disableHeight:!0},(function(e){var t=e.width;return 0===t?null:o.a.createElement("main",{className:"m-t-2 ".concat(M.logsMain),style:{width:t}},o.a.createElement(p.ErrorBoundaryAlert,null,F&&A&&o.a.createElement("div",{className:"grafana-info-box grafana-info-box--max-lg"},o.a.createElement(A,{onClickExample:a.onClickExample,datasource:l,exploreMode:x})),!F&&o.a.createElement(o.a.Fragment,null,x===g.ExploreMode.Metrics&&o.a.createElement(S.a,{series:j,width:t,loading:k,absoluteRange:C,isStacked:!1,showPanel:!0,showingGraph:T,showingTable:R,timeZone:P,onToggleGraph:a.onToggleGraph,onUpdateTimeRange:a.onUpdateTimeRange,showBars:!1,showLines:!0}),x===g.ExploreMode.Metrics&&o.a.createElement(h.a,{width:t,exploreId:b,onClickCell:a.onClickFilterLabel}),x===g.ExploreMode.Logs&&o.a.createElement(f.a,{width:t,exploreId:b,syncedTimes:z,onClickFilterLabel:a.onClickFilterLabel,onClickFilterOutLabel:a.onClickFilterOutLabel,onStartScanning:a.onStartScanning,onStopScanning:a.onStopScanning})),I&&o.a.createElement(m.a,{width:t,exploreId:b,onClose:a.toggleShowRichHistory})))}))))}}])&&C(n.prototype,r),a&&C(n,a),t}(o.a.PureComponent),_=Object(l.a)(y.h),M=Object(l.a)(y.o);var A={changeSize:b.g,initializeExplore:b.j,modifyQueries:b.k,refreshExplore:b.m,scanStart:b.o,scanStopAction:j.w,setQueries:b.p,updateTimeRange:b.w,toggleGraph:b.t,addQueryRow:b.a};t.a=Object(a.hot)(e)(Object(s.connect)((function(e,t){var n,r=t.exploreId,o=e.explore,a=o.split,i=o.syncedTimes,s=o[r],c=Object(x.a)(e.user),l=s.datasourceInstance,p=s.datasourceMissing,f=s.initialized,d=s.queryKeys,h=s.urlState,m=s.update,b=s.isLive,v=s.supportedModes,w=s.mode,O=s.graphResult,E=s.loading,j=s.showingGraph,S=s.showingTable,k=s.absoluteRange,C=s.queryResponse,T=h||{},R=T.datasource,P=T.queries,N=T.range,z=T.mode,L=T.ui,D=T.originPanelId,I=R||u.a.get(Object(y.q)(e.user.orgId)),A=_(P),F=N?M(N,c):Object(y.n)(c,y.a);if(v.length){var q=v.includes(z);n=v.includes(w)?w:q?z:v[0]}else n=[g.ExploreMode.Metrics,g.ExploreMode.Logs].includes(z)?z:void 0;return{datasourceInstance:l,datasourceMissing:p,initialized:f,split:a,queryKeys:d,update:m,initialDatasource:I,initialQueries:A,initialRange:F,mode:n,initialUI:L||y.b,isLive:b,graphResult:O,loading:E,showingGraph:j,showingTable:S,absoluteRange:k,queryResponse:C,originPanelId:D,syncedTimes:i,timeZone:c}}),A)(I))}).call(this,n("3UD+")(e))},vGfD:function(e,t,n){"use strict";(function(e){var r=n("q1tI"),o=n.n(r),a=n("/MKj"),i=n("0cfB"),s=n("kDDq"),c=n("kDLi"),l=n("Obii"),u=n("w9yp"),p=n("Xmxp"),f=n("Efza");function d(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function m(){var e=k(["\n      max-width: ",";\n      display: flex;\n      justify-content: flex-end;\n      button {\n        height: auto;\n        padding: "," ",";\n        span {\n          white-space: normal !important;\n        }\n      }\n    "]);return m=function(){return e},e}function b(){var e=k(["\n      border: 1px solid ",";\n      background: inherit;\n      color: inherit;\n      width: 100%;\n      font-size: ",";\n      &placeholder {\n        padding: 0 ",";\n      }\n    "]);return b=function(){return e},e}function g(){var e=k(["\n      > * {\n        margin-right: ",";\n      }\n    "]);return g=function(){return e},e}function y(){var e=k(["\n      overflow-wrap: break-word;\n      font-size: ",";\n      font-weight: ",";\n      margin-top: ",";\n    "]);return y=function(){return e},e}function v(){var e=k(["\n      width: calc(100% + ",");\n      margin-top: ",";\n    "]);return v=function(){return e},e}function w(){var e=k(["\n      border-top: 1px solid ",";\n      word-break: break-all;\n      padding: 4px 2px;\n      :first-child {\n        border-top: none;\n        padding: 0 0 4px 0;\n      }\n    "]);return w=function(){return e},e}function O(){var e=k(["\n      font-weight: ",";\n      width: calc(100% - ",");\n    "]);return O=function(){return e},e}function x(){var e=k(["\n      max-width: ",";\n      display: flex;\n      justify-content: flex-end;\n      font-size: ",";\n      i {\n        margin: ",";\n        cursor: pointer;\n      }\n    "]);return x=function(){return e},e}function E(){var e=k(["\n      display: flex;\n      align-items: center;\n      font-size: ",";\n      font-weight: ",";\n    "]);return E=function(){return e},e}function j(){var e=k(["\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      padding: ",";\n      border-bottom: none;\n      :first-of-type {\n        border-bottom: 1px solid ",";\n        padding: "," ",";\n      }\n      img {\n        height: ",";\n        max-width: ",";\n        margin-right: ",";\n      }\n    "]);return j=function(){return e},e}function S(){var e=k(["\n      display: flex;\n      flex-direction: column;\n      border: 1px solid ",";\n      margin: "," 0;\n      box-shadow: ",";\n      background-color: ",";\n      border-radius: ",";\n      .starred {\n        color: ",";\n      }\n    "]);return S=function(){return e},e}function k(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var C=Object(c.stylesFactory)((function(e,t){var n=e.isLight?e.colors.gray5:e.colors.gray25,r=e.isLight?t?e.colors.gray95:e.colors.white:t?e.colors.gray15:e.colors.gray05,o=e.isLight?"0px 2px 2px ".concat(n):"0px 2px 4px black";return{queryCard:Object(s.css)(S(),n,e.spacing.sm,o,r,e.border.radius.sm,e.colors.orange),cardRow:Object(s.css)(j(),e.spacing.sm,n,e.spacing.xs,e.spacing.sm,e.typography.size.base,e.typography.size.base,e.spacing.sm),datasourceContainer:Object(s.css)(E(),e.typography.size.sm,e.typography.weight.semibold),queryActionButtons:Object(s.css)(x(),"170px",e.typography.size.base,e.spacing.xs),queryContainer:Object(s.css)(O(),e.typography.weight.semibold,"240px"),queryRow:Object(s.css)(w(),n),updateCommentContainer:Object(s.css)(v(),"240px",e.spacing.sm),comment:Object(s.css)(y(),e.typography.size.sm,e.typography.weight.regular,e.spacing.xs),commentButtonRow:Object(s.css)(g(),e.spacing.sm),textArea:Object(s.css)(b(),n,e.typography.size.sm,e.spacing.sm),runButton:Object(s.css)(m(),"170px",e.spacing.sm,e.spacing.md)}}));var T={changeDatasource:f.b,updateRichHistory:f.v,setQueries:f.p};t.a=Object(i.hot)(e)(Object(a.connect)((function(e,t){var n=t.exploreId,r=e.explore,o=r[n].datasourceInstance;return r[n],{exploreId:n,datasourceInstance:o}}),T)((function(e){var t,n=e.query,a=e.dsImg,i=e.isRemoved,f=e.updateRichHistory,m=e.changeDatasource,b=e.exploreId,g=e.datasourceInstance,y=e.setQueries,v=h(Object(r.useState)(!1),2),w=v[0],O=v[1],x=h(Object(r.useState)(n.comment),2),E=x[0],j=x[1],S=function(){return O(!w)},k=Object(c.useTheme)(),T=C(k,i),R=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.queries.map((function(e,t){return Object(u.d)(n,e,t)})),n.datasourceName===(null==g?void 0:g.name)){e.next=7;break}return e.next=4,m(b,n.datasourceName);case 4:y(b,t),e.next=8;break;case 7:y(b,t);case 8:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){d(a,r,o,i,s,"next",e)}function s(e){d(a,r,o,i,s,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}(),P=o.a.createElement("div",{className:T.updateCommentContainer},o.a.createElement(c.Forms.TextArea,{value:E,placeholder:E?void 0:"An optional description of what the query does.",onChange:function(e){return j(e.currentTarget.value)},className:T.textArea}),o.a.createElement("div",{className:T.commentButtonRow},o.a.createElement(c.Forms.Button,{onClick:function(){f(n.ts,"comment",E),S()}},"Save comment"),o.a.createElement(c.Forms.Button,{variant:"secondary",onClick:function(){S(),j(n.comment)}},"Cancel"))),N=o.a.createElement("div",{className:T.queryActionButtons},o.a.createElement("i",{className:"fa fa-fw fa-comment-o",onClick:S,title:(null===(t=n.comment)||void 0===t?void 0:t.length)>0?"Edit comment":"Add comment"}),o.a.createElement("i",{className:"fa fa-fw fa-copy",onClick:function(){var e=n.queries.join("\n\n");Object(u.c)(e),p.b.emit(l.AppEvents.alertSuccess,["Query copied to clipboard"])},title:"Copy query to clipboard"}),!i&&o.a.createElement("i",{className:"fa fa-fw fa-link",onClick:function(){var e=Object(u.g)(n);Object(u.c)(e),p.b.emit(l.AppEvents.alertSuccess,["Link copied to clipboard"])},title:"Copy link to clipboard"}),o.a.createElement("i",{className:"fa fa-trash",title:"Delete query",onClick:function(){f(n.ts,"delete"),p.b.emit(l.AppEvents.alertSuccess,["Query deleted"])}}),o.a.createElement("i",{className:Object(s.cx)("fa fa-fw",n.starred?"fa-star starred":"fa-star-o"),onClick:function(){f(n.ts,"starred")},title:n.starred?"Unstar query":"Star query"}));return o.a.createElement("div",{className:T.queryCard},o.a.createElement("div",{className:T.cardRow},o.a.createElement("div",{className:T.datasourceContainer},o.a.createElement("img",{src:a,"aria-label":"Data source icon"}),o.a.createElement("div",{"aria-label":"Data source name"},i?"Data source does not exist anymore":n.datasourceName)),N),o.a.createElement("div",{className:Object(s.cx)(T.cardRow)},o.a.createElement("div",{className:T.queryContainer},n.queries.map((function(e,t){return o.a.createElement("div",{"aria-label":"Query text",key:"".concat(e,"-").concat(t),className:T.queryRow},e)})),!w&&n.comment&&o.a.createElement("div",{"aria-label":"Query comment",className:T.comment},n.comment),w&&P),!w&&o.a.createElement("div",{className:T.runButton},o.a.createElement(c.Forms.Button,{variant:"secondary",onClick:R,disabled:i},(null==g?void 0:g.name)===n.datasourceName?"Run query":"Switch data source and run query"))))})))}).call(this,n("3UD+")(e))},y2tl:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n("q1tI"),o=n.n(r),a=n("t8hP"),i=n("NPB1"),s=(n("Vw/f"),n("Obii"));function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e){function t(){return d(this,t),m(this,b(t).apply(this,arguments))}var n,r,c,l,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(l=regeneratorRuntime.mark((function e(){var t,n,r,o,i,s,c,l,p=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.element){e.next=2;break}return e.abrupt("return");case 2:t=this.props,n=t.datasource,r=t.initialQuery,o=t.exploreEvents,i=t.range,this.initTimeSrv(i),s=Object(a.getAngularLoader)(),c=u({datasource:n.name},r),l={ctrl:{datasource:n,target:c,refresh:function(){setTimeout((function(){var e,t,n,r;null===(e=(t=p.props).onQueryChange)||void 0===e||e.call(t,c),null===(n=(r=p.props).onExecuteQuery)||void 0===n||n.call(r)}),1)},onQueryChange:function(){setTimeout((function(){var e,t;null===(e=(t=p.props).onQueryChange)||void 0===e||e.call(t,c)}),1)},events:o,panel:{datasource:n,targets:[c]},dashboard:{}}},this.component=s.load(this.element,l,'<plugin-component type="query-ctrl"> </plugin-component>'),this.angularScope=l.ctrl,setTimeout((function(){var e,t,n,r;null===(e=(t=p.props).onQueryChange)||void 0===e||e.call(t,c),null===(n=(r=p.props).onExecuteQuery)||void 0===n||n.call(r)}),1);case 11:case"end":return e.stop()}}),e,this)})),p=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=l.apply(e,t);function a(e){f(o,n,r,a,i,"next",e)}function i(e){f(o,n,r,a,i,"throw",e)}a(void 0)}))},function(){return p.apply(this,arguments)})},{key:"componentDidUpdate",value:function(e){var t=e.textEditModeEnabled!==this.props.textEditModeEnabled,n=e.error!==this.props.error;this.component&&(t&&this.angularScope&&this.angularScope.toggleEditorMode&&this.angularScope.toggleEditorMode(),(n||t)&&setTimeout(this.component.digest))}},{key:"componentWillUnmount",value:function(){this.component&&this.component.destroy()}},{key:"initTimeSrv",value:function(e){Object(i.a)().init({time:{from:Object(s.dateTime)(e.from),to:Object(s.dateTime)(e.to)},refresh:!1,getTimezone:function(){return"utc"},timeRangeUpdated:function(){return console.log("refreshDashboard!")}})}},{key:"render",value:function(){var e=this;return o.a.createElement("div",{className:"gf-form-query",ref:function(t){return e.element=t},style:{width:"100%"}})}}])&&h(n.prototype,r),c&&h(n,c),t}(r.PureComponent)},zLRG:function(e,t,n){"use strict";(function(e){var r=n("q1tI"),o=n.n(r),a=n("0cfB"),i=n("/MKj"),s=n("kDLi"),c=n("Efza"),l=n("ZFWI"),u=n("eXZ6"),p=n("h1VQ");function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e){function t(){var e,n;d(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(n=m(this,(e=b(t)).call.apply(e,[this].concat(o)))).onClickTableButton=function(){n.props.toggleTable(n.props.exploreId,n.props.showingTable)},n}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(t,e),n=t,(r=[{key:"getTableHeight",value:function(){var e=this.props.tableResult;return e&&0!==e.length?Math.max(Math.min(600,35*e.length)+35):200}},{key:"render",value:function(){var e=this.props,t=e.loading,n=e.onClickCell,r=e.showingTable,a=e.tableResult,i=e.width,c=this.getTableHeight(),f=i-2*l.a.theme.panelPadding-u.i,d=null==a?void 0:a.length;return o.a.createElement(s.Collapse,{label:"Table",loading:t,collapsible:!0,isOpen:r,onToggle:this.onClickTableButton},d?o.a.createElement(s.Table,{data:a,width:f,height:c,onCellClick:n}):o.a.createElement(p.a,{metaItems:[{value:"0 series returned"}]}))}}])&&h(n.prototype,r),a&&h(n,a),t}(r.PureComponent);var v={toggleTable:c.u};t.a=Object(a.hot)(e)(Object(i.connect)((function(e,t){var n=t.exploreId,r=e.explore[n],o=r.loading,a=r.showingTable,i=r.tableResult;return{loading:!(i&&i.length>0)&&o,showingTable:a,tableResult:i}}),v)(y))}).call(this,n("3UD+")(e))}}]);
//# sourceMappingURL=explore.fc25e2ef18cf58c0ed79.js.map