cent"}])},5556(ne,A,e){"use strict";e.d(A,{Pp:()=>d,kM:()=>h,sQ:()=>s});var t=e(25229);/** * @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT */function n(g,v){return v&&Object.keys(v).length>0&&(g+="?"+c(v)),g}function a(g,v){return encodeURIComponent(g).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,v?"%20":"+").replace(/[!'()*]/g,function(x){return"%"+x.charCodeAt(0).toString(16).toUpperCase()})}function c(g,v=!0){const x=[],m=/\[\]$/,p=v?(u,D)=>a(u,D):(u,D)=>encodeURIComponent(u),y=u=>Object.prototype.toString.call(u)==="[object Array]",E=(u,D)=>{D=typeof D=="function"?D():D===null||D===void 0?"":D,x[x.length]=p(u,!0)+"="+p(D,!0)},b=(u,D)=>{let P,C,S;if(u)if(y(D))for(P=0,C=D.length;P1&&(g+="&"):g+="?",g+=v}return g}function o(){const v=window.location.search.substring(1).split("&"),x={};for(const m of v){const p=m.split("=");if(p.length>1){const y=decodeURIComponent(p[0]),E=decodeURIComponent(p[1]);y in x?x[y]=[...x[y],E]:x[y]=[E]}else if(p.length===1){const y=decodeURIComponent(p[0]);x[y]=!0}}return x}function l(g){const v={},x=(g||"").split("&");for(let m of x){let p,y,E;if(m&&(y=m=m.replace(/\+/g,"%20"),p=m.indexOf("="),p!==-1&&(y=m.substring(0,p),E=m.substring(p+1)),y=f(y),y!==void 0)){E=E!==void 0?f(E):!0;let b;typeof E=="string"&&E!==""?b=E==="true"||E==="false"?E==="true":E:b=E,v.hasOwnProperty(y)?Array.isArray(v[y])?v[y].push(E):v[y]=[v[y],isNaN(b)?E:b]:v[y]=isNaN(b)?E:b}}return v}function f(g){try{return decodeURIComponent(g)}catch{return}}const h={renderUrl:n,toUrlParams:c,appendQueryToUrl:i,getUrlSearchParams:o,parseKeyValue:l,serializeParams:r};function d(g,v){return v!==void 0&&console.warn("`compact` parameter is deprecated and will be removed in a future release"),JSON.stringify(g)}const s=g=>{let v=g.from;(0,t.Ar)(v)&&(v=v.valueOf().toString());let x=g.to;return(0,t.Ar)(x)&&(x=x.valueOf().toString()),{from:v,to:x}}},35987(ne,A,e){"use strict";e.d(A,{An:()=>i,Zz:()=>c,bh:()=>o});var t=e(36394),n=e(8934),a=e(18600);function c(f,h){for(const d of f)switch(d.type){case a.d.ValueToText:if(h==null)continue;const s=d.options[h];if(s)return s;break;case a.d.RangeToText:if(h==null)continue;const g=parseFloat(h);if(isNaN(g))continue;const v=d.options.from??-1/0;if(!isNaN(v)&&gm)continue;return d.options.result;case a.d.RegexToText:if(h==null||typeof h!="string")continue;const y=(0,n.dO)(d.options.pattern);if(h.match(y)){const E={...d.options.result};return E.text!=null&&(E.text=h.replace(y,d.options.result.text||"")),E}case a.d.SpecialValue:switch(d.options.match){case a.W.Null:{if(h==null)return d.options.result;break}case a.W.NaN:{if(typeof h=="number"&&isNaN(h))return d.options.result;break}case a.W.NullAndNaN:{if(typeof h=="number"&&isNaN(h)||h==null)return d.options.result;break}case a.W.True:{if(h===!0||h==="true")return d.options.result;break}case a.W.False:{if(h===!1||h==="false")return d.options.result;break}case a.W.Empty:{if(h==="")return d.options.result;break}}}return null}function r(f){return(typeof f=="number"||typeof f=="string"&&f.trim()!=="")&&!isNaN(f)}var i=(f=>(f[f.ValueToText=1]="ValueToText",f[f.RangeToText=2]="RangeToText",f))(i||{});function o(f,h){const d=[];let s=f.mappingType;if(f.mappingType||(f.valueMaps&&f.valueMaps.length?s=1:f.rangeMaps&&f.rangeMaps.length&&(s=2)),s===1)for(let g=0;g0&&s.unshift(d),s[0]}},94452(ne,A,e){"use strict";e.d(A,{E:()=>n,c:()=>a});const t="__searchFilter",n=c=>c&&typeof c=="string"?c.indexOf(t)!==-1:!1,a=c=>{const{query:r,wildcardChar:i}=c;if(!n(r))return{};let{options:o}=c;return o=o||{searchFilter:""},{__searchFilter:{value:o.searchFilter?`${o.searchFilter}${i}`:`${i}`,text:""}}}},47520(ne,A,e){"use strict";e.d(A,{k:()=>r});var t=e(44240),n=e(39697),a=e(65961),c=e(67791);function r({whileLoading:i,source:o}){return(0,t.h)((0,n.O)(200).pipe((0,a.u)(i),(0,c.Q)(o)),o)}},94777(ne,A,e){"use strict";e.d(A,{$:()=>n});var t=e(96453);class n extends t.F{constructor(c){return super(),this.buffer=c.buffer||[],this.capacity=this.buffer.length,this.tail=c.append!=="head",this.index=0,this.add=this.getAddFunction(),c.capacity&&this.setCapacity(c.capacity),new Proxy(this,{get(r,i,o){if(typeof i!="symbol"){const l=+i;if(String(l)===i)return r.get(l)}return Reflect.get(r,i,o)},set(r,i,o,l){if(typeof i!="symbol"){const f=+i;if(String(f)===i)return r.set(f,o),!0}return Reflect.set(r,i,o,l)}})}getAddFunction(){return this.capacity>this.buffer.length?this.tail?c=>{this.buffer.push(c),this.buffer.length>=this.capacity&&(this.add=this.getAddFunction())}:c=>{this.buffer.unshift(c),this.buffer.length>=this.capacity&&(this.add=this.getAddFunction())}:this.tail?c=>{this.buffer[this.index]=c,this.index=(this.index+1)%this.buffer.length}:c=>{let r=this.index-1;r<0&&(r=this.buffer.length-1),this.buffer[r]=c,this.index=r}}setCapacity(c){if(this.capacity===c)return;const r=this.toArray();if(c>this.length)this.buffer=r;else if(cr,F:()=>a});var t,n;class a{constructor(){this[t]={}}*iterator(){for(let o=0;or,OP:()=>t,PP:()=>d,RT:()=>l,SM:()=>g,Sd:()=>o,_N:()=>h,bS:()=>y,fP:()=>v,fo:()=>c,gs:()=>m,h2:()=>p,k1:()=>a,mk:()=>s,o6:()=>n,qb:()=>f,v9:()=>i,vk:()=>x});const t=1e4,n=1e3,a=30,c=25,r="grafana.datasources.prometheus.browser.labels",i=/^$|^\d+(ms|[Mwdhmsy])$/,o=/(\d+)(.+)/,l=/^(0|[1-9]\d*)(\.\d+)?(e\+?\d+)?$/,f="{}",h=4e4,d=1e3,s='{__name__!=""}',g="__name__",v="Value is not valid, you can use number with time unit specifier: y, M, w, d, h, m, s",x="Value is not valid, you can use only numbers or leave it empty to use default limit or set 0 to have no limit.",m="-Instant",p=["api/v1/query","api/v1/query_range","api/v1/series","api/v1/labels","suggestions"],y="none"},35748(ne,A,e){"use strict";e.d(A,{Uz:()=>i,n6:()=>o});var t=e(92745);const n=["by","group_left","group_right","ignoring","on","offset","without"],a=null,c=()=>[{label:"acos",insertText:"acos",detail:"acos(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-acos","calculates the arccosine of all elements in {{argument}}",{argument:"v"})},{label:"acosh",insertText:"acosh",detail:"acosh(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-acosh","calculates the inverse hyperbolic cosine of all elements in {{argument}}",{argument:"v"})},{label:"asin",insertText:"asin",detail:"asin(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-asin","calculates the arcsine of all elements in {{argument}}",{argument:"v"})},{label:"asinh",insertText:"asinh",detail:"asinh(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-asinh","calculates the inverse hyperbolic sine of all elements in {{argument}}",{argument:"v"})},{label:"atan",insertText:"atan",detail:"atan(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-atan","calculates the arctangent of all elements in {{argument}}",{argument:"v"})},{label:"atanh",insertText:"atanh",detail:"atanh(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-atanh","calculates the inverse hyperbolic tangent of all elements in {{argument}}",{argument:"v"})},{label:"cos",insertText:"cos",detail:"cos(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-cos","calculates the cosine of all elements in {{argument}}",{argument:"v"})},{label:"cosh",insertText:"cosh",detail:"cosh(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-cosh","calculates the hyperbolic cosine of all elements in {{argument}}",{argument:"v"})},{label:"sin",insertText:"sin",detail:"sin(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-sin","calculates the sine of all elements in {{argument}}",{argument:"v"})},{label:"sinh",insertText:"sinh",detail:"sinh(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-sinh","calculates the hyperbolic sine of all elements in {{argument}}",{argument:"v"})},{label:"tan",insertText:"tan",detail:"tan(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-tan","calculates the tangent of all elements in {{argument}}",{argument:"v"})},{label:"tanh",insertText:"tanh",detail:"tanh(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getTrigonometricFunctions.documentation-tanh","calculates the hyperbolic tangent of all elements in {{argument}}",{argument:"v"})}],r=()=>[{label:"sum",insertText:"sum",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-sum","Calculate sum over dimensions")},{label:"min",insertText:"min",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-min","Select minimum over dimensions")},{label:"max",insertText:"max",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-max","Select maximum over dimensions")},{label:"avg",insertText:"avg",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-avg","Calculate the average over dimensions")},{label:"group",insertText:"group",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-group","All values in the resulting vector are 1")},{label:"stddev",insertText:"stddev",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-stddev","Calculate population standard deviation over dimensions")},{label:"stdvar",insertText:"stdvar",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-stdvar","Calculate population standard variance over dimensions")},{label:"count",insertText:"count",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-count","Count number of elements in the vector")},{label:"count_values",insertText:"count_values",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-count-values","Count number of elements with the same value")},{label:"bottomk",insertText:"bottomk",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-bottomk","Smallest k elements by sample value")},{label:"topk",insertText:"topk",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-topk","Largest k elements by sample value")},{label:"quantile",insertText:"quantile",documentation:(0,t.t)("grafana-prometheus.promql.getAggregationOptions.documentation-quantile","Calculate \u03C6-quantile (0 \u2264 \u03C6 \u2264 1) over dimensions")}],i=()=>[...r(),...c(),{insertText:"abs",label:"abs",detail:"abs(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-abs","Returns the input vector with all sample values converted to their absolute value.")},{insertText:"absent",label:"absent",detail:"absent(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-absent","Returns an empty vector if the vector passed to it has any elements and a 1-element vector with the value 1 if the vector passed to it has no elements. This is useful for alerting on when no time series exist for a given metric name and label combination.")},{insertText:"absent_over_time",label:"absent_over_time",detail:"absent(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-absent-over-time","Returns an empty vector if the range vector passed to it has any elements and a 1-element vector with the value 1 if the range vector passed to it has no elements.")},{insertText:"ceil",label:"ceil",detail:"ceil(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-ceil","Rounds the sample values of all elements in `v` up to the nearest integer.")},{insertText:"changes",label:"changes",detail:"changes(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-changes","For each input time series, `changes(v range-vector)` returns the number of times its value has changed within the provided time range as an instant vector.")},{insertText:"clamp",label:"clamp",detail:"clamp(v instant-vector, min scalar, max scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-clamp","Clamps the sample values of all elements in `v` to have a lower limit of `min` and an upper limit of `max`.")},{insertText:"clamp_max",label:"clamp_max",detail:"clamp_max(v instant-vector, max scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-clamp-max","Clamps the sample values of all elements in `v` to have an upper limit of `max`.")},{insertText:"clamp_min",label:"clamp_min",detail:"clamp_min(v instant-vector, min scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-clamp-min","Clamps the sample values of all elements in `v` to have a lower limit of `min`.")},{insertText:"count_scalar",label:"count_scalar",detail:"count_scalar(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-count-scalar","Returns the number of elements in a time series vector as a scalar. This is in contrast to the `count()` aggregation operator, which always returns a vector (an empty one if the input vector is empty) and allows grouping by labels via a `by` clause.")},{insertText:"deg",label:"deg",detail:"deg(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-deg","Converts radians to degrees for all elements in v")},{insertText:"day_of_month",label:"day_of_month",detail:"day_of_month(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-day-of-month","Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.")},{insertText:"day_of_week",label:"day_of_week",detail:"day_of_week(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-day-of-week","Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.")},{insertText:"day_of_year",label:"day_of_year",detail:"day_of_year(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-day-of-year","Returns the day of the year for each of the given times in UTC. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years.")},{insertText:"days_in_month",label:"days_in_month",detail:"days_in_month(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-days-in-month","Returns number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.")},{insertText:"delta",label:"delta",detail:"delta(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-delta","Calculates the difference between the first and last value of each time series element in a range vector `v`, returning an instant vector with the given deltas and equivalent labels. The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers.")},{insertText:"deriv",label:"deriv",detail:"deriv(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-deriv","Calculates the per-second derivative of the time series in a range vector `v`, using simple linear regression.")},{insertText:"double_exponential_smoothing",label:"double_exponential_smoothing",detail:"double_exponential_smoothing(v range-vector, sf scalar, tf scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-double-exponential-smoothing","Produces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.")},{insertText:"drop_common_labels",label:"drop_common_labels",detail:"drop_common_labels(instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-drop-common-labels","Drops all labels that have the same name and value across all series in the input vector.")},{insertText:"exp",label:"exp",detail:"exp(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-exp","Calculates the exponential function for all elements in `v`.\nSpecial cases are:\n* `Exp(+Inf) = +Inf` \n* `Exp(NaN) = NaN`")},{insertText:"floor",label:"floor",detail:"floor(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-floor","Rounds the sample values of all elements in `v` down to the nearest integer.")},{insertText:"histogram_quantile",label:"histogram_quantile",detail:"histogram_quantile(\u03C6 float, b instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-quantile","Calculates the \u03C6-quantile (0 \u2264 \u03C6 \u2264 1) from the buckets `b` of a histogram. The samples in `b` are the counts of observations in each bucket. Each sample must have a label `le` where the label value denotes the inclusive upper bound of the bucket. (Samples without such a label are silently ignored.) The histogram metric type automatically provides time series with the `_bucket` suffix and the appropriate labels.")},{insertText:"holt_winters",label:"holt_winters",detail:"holt_winters(v range-vector, sf scalar, tf scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-holt-winters","Renamed as double_exponential_smoothing in prometheus v3.x. For prometheus versions equal and greater than v3.0 please use double_exponential_smoothing. \n\nProduces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.")},{insertText:"hour",label:"hour",detail:"hour(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-hour","Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.")},{insertText:"idelta",label:"idelta",detail:"idelta(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-idelta","Calculates the difference between the last two samples in the range vector `v`, returning an instant vector with the given deltas and equivalent labels.")},{insertText:"increase",label:"increase",detail:"increase(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-increase","Calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if a counter increases only by integer increments.")},{insertText:"info",label:"info",detail:"info(v instant-vector, [data-label-selector instant-vector])",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-info","Returns latest details and metadata about a group of metrics, such as their labels and current values, without doing any calculations")},{insertText:"irate",label:"irate",detail:"irate(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-irate","Calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.")},{insertText:"label_join",label:"label_join",detail:"label_join(v instant-vector, dst_label string, separator string, src_label_1 string, src_label_2 string, ...)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-label-join","For each timeseries in `v`, joins all the values of all the `src_labels` using `separator` and returns the timeseries with the label `dst_label` containing the joined value. There can be any number of `src_labels` in this function.")},{insertText:"label_replace",label:"label_replace",detail:"label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-label-replace","For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)` matches the regular expression `regex` against the label `src_label`. If it matches, then the timeseries is returned with the label `dst_label` replaced by the expansion of `replacement`. `$1` is replaced with the first matching subgroup, `$2` with the second etc. If the regular expression doesn't match then the timeseries is returned unchanged.")},{insertText:"ln",label:"ln",detail:"ln(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-ln","Calculates the natural logarithm for all elements in `v`.\nSpecial cases are:\n * `ln(+Inf) = +Inf`\n * `ln(0) = -Inf`\n * `ln(x < 0) = NaN`\n * `ln(NaN) = NaN`")},{insertText:"log2",label:"log2",detail:"log2(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-log2","Calculates the binary logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.")},{insertText:"log10",label:"log10",detail:"log10(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-log10","Calculates the decimal logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.")},{insertText:"minute",label:"minute",detail:"minute(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-minute","Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.")},{insertText:"month",label:"month",detail:"month(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-month","Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.")},{insertText:"pi",label:"pi",detail:"pi()",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-pi","Returns pi")},{insertText:"predict_linear",label:"predict_linear",detail:"predict_linear(v range-vector, t scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-predict-linear","Predicts the value of time series `t` seconds from now, based on the range vector `v`, using simple linear regression.")},{insertText:"rad",label:"rad",detail:"rad(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-rad","Converts degrees to radians for all elements in v")},{insertText:"rate",label:"rate",detail:"rate(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-rate","Calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.")},{insertText:"resets",label:"resets",detail:"resets(v range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-resets","For each input time series, `resets(v range-vector)` returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive samples is interpreted as a counter reset.")},{insertText:"round",label:"round",detail:"round(v instant-vector, to_nearest=1 scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-round","Rounds the sample values of all elements in `v` to the nearest integer. Ties are resolved by rounding up. The optional `to_nearest` argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.")},{insertText:"scalar",label:"scalar",detail:"scalar(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-scalar","Given a single-element input vector, `scalar(v instant-vector)` returns the sample value of that single element as a scalar. If the input vector does not have exactly one element, `scalar` will return `NaN`.")},{insertText:"sgn",label:"sgn",detail:"sgn(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-sgn","Returns a vector with all sample values converted to their sign, defined as this: 1 if v is positive, -1 if v is negative and 0 if v is equal to zero.")},{insertText:"sort",label:"sort",detail:"sort(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-sort","Returns vector elements sorted by their sample values, in ascending order.")},{insertText:"sort_desc",label:"sort_desc",detail:"sort_desc(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-sort-desc","Returns vector elements sorted by their sample values, in descending order.")},{insertText:"sqrt",label:"sqrt",detail:"sqrt(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-sqrt","Calculates the square root of all elements in `v`.")},{insertText:"time",label:"time",detail:"time()",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-time","Returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated.")},{insertText:"timestamp",label:"timestamp",detail:"timestamp(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-timestamp","Returns the timestamp of each of the samples of the given vector as the number of seconds since January 1, 1970 UTC.")},{insertText:"vector",label:"vector",detail:"vector(s scalar)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-vector","Returns the scalar `s` as a vector with no labels.")},{insertText:"year",label:"year",detail:"year(v=vector(time()) instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-year","Returns the year for each of the given times in UTC.")},{insertText:"avg_over_time",label:"avg_over_time",detail:"avg_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-avg-over-time","The average value of all points in the specified interval.")},{insertText:"min_over_time",label:"min_over_time",detail:"min_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-min-over-time","The minimum value of all points in the specified interval.")},{insertText:"max_over_time",label:"max_over_time",detail:"max_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-max-over-time","The maximum value of all points in the specified interval.")},{insertText:"sum_over_time",label:"sum_over_time",detail:"sum_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-sum-over-time","The sum of all values in the specified interval.")},{insertText:"count_over_time",label:"count_over_time",detail:"count_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-count-over-time","The count of all values in the specified interval.")},{insertText:"quantile_over_time",label:"quantile_over_time",detail:"quantile_over_time(scalar, range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-quantile-over-time","The \u03C6-quantile (0 \u2264 \u03C6 \u2264 1) of the values in the specified interval.")},{insertText:"stddev_over_time",label:"stddev_over_time",detail:"stddev_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-stddev-over-time","The population standard deviation of the values in the specified interval.")},{insertText:"stdvar_over_time",label:"stdvar_over_time",detail:"stdvar_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-stdvar-over-time","The population standard variance of the values in the specified interval.")},{insertText:"last_over_time",label:"last_over_time",detail:"last_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-last-over-time","The most recent point value in specified interval.")},{insertText:"present_over_time",label:"present_over_time",detail:"present_over_time(range-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-present-over-time","The value 1 for any series in the specified interval.")},{insertText:"histogram_avg",label:"histogram_avg",detail:"histogram_avg(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-avg","Returns the arithmetic average of observed values stored in a native histogram. Samples that are not native histograms are ignored and do not show up in the returned vector.")},{insertText:"histogram_count",label:"histogram_count",detail:"histogram_count(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-count","Returns the count of observations stored in a native histogram.")},{insertText:"histogram_sum",label:"histogram_sum",detail:"histogram_sum(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-sum","Returns the sum of observations stored in a native histogram.")},{insertText:"histogram_fraction",label:"histogram_fraction",detail:"histogram_fraction(lower scalar, upper scalar, v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-fraction","Returns the estimated fraction of observations between the provided lower and upper values.")},{insertText:"histogram_stddev",label:"histogram_stddev",detail:"histogram_stddev(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-stddev","Returns the estimated standard deviation of observations in a native histogram, based on the geometric mean of the buckets where the observations lie.")},{insertText:"histogram_stdvar",label:"histogram_stdvar",detail:"histogram_stdvar(v instant-vector)",documentation:(0,t.t)("grafana-prometheus.promql.getFunctions.documentation-histogram-stdvar","Returns the estimated standard variance of observations in a native histogram.")}],o={comment:{pattern:/#.*/},"context-aggregation":{pattern:/((by|without)\s*)\([^)]*\)/,lookbehind:!0,inside:{"label-key":{pattern:/[^(),\s][^,)]*[^),\s]*/,alias:"attr-name"},punctuation:/[()]/}},"context-labels":{pattern:/\{[^}]*(?=}?)/,greedy:!0,inside:{comment:{pattern:/#.*/},"label-key":{pattern:/[a-z_]\w*(?=\s*(=|!=|=~|!~))/,alias:"attr-name",greedy:!0},"label-value":{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0,alias:"attr-value"},punctuation:/[{]/}},function:new RegExp(`\\b(?:${i().map(l=>l.label).join("|")})(?=\\s*\\()`,"i"),"context-range":[{pattern:/\[[^\]]*(?=])/,inside:{"range-duration":{pattern:/\b\d+[smhdwy]\b/i,alias:"number"}}},{pattern:/(offset\s+)\w+/,lookbehind:!0,inside:{"range-duration":{pattern:/\b\d+[smhdwy]\b/i,alias:"number"}}}],idList:{pattern:/\d+(\|\d+)+/,alias:"number"},number:/\b-?\d+((\.\d*)?([eE][+-]?\d+)?)?\b/,operator:new RegExp(`/[-+*/=%^~]|&&?|\\|?\\||!=?|<(?:=>?|<|>)?|>[>=]?|\\b(?:${n.join("|")})\\b`,"i"),punctuation:/[{};()`,.]/}},31200(ne,A,e){"use strict";e.d(A,{$H:()=>n,Nc:()=>t,Rq:()=>a,p0:()=>i});const t=o=>o===""||a(o)?o:`"${o}"`,n=o=>{if(a(o))return o;let f="U__";for(let h=0;h65535&&h++}return f},a=o=>{if(o.length===0)return!1;for(let l=0;l{const f=o.codePointAt(0);return f===void 0?!1:f>=97&&f<=122||f>=65&&f<=90||f===95||f===58||f>=48&&f<=57&&l>0},r=o=>o>=0&&o<=1114111,i=o=>{const l=[],f=/(=~|!=|!~|=)/;let h="",d="",s=!1,g="";const v=()=>{const x=g.match(f);if(x){const m=x[0];[h,d]=g.split(m),l.push(`${t(h.trim())}${m}"${d.slice(1,-1)}"`)}};for(const x of o)x==='"'&&g[g.length-1]!=="\\"?(s=!s,g+=x):x===","&&!s?(v(),g=""):g+=x;return g&&v(),l.join(",")}},61190(ne,A,e){"use strict";e.d(A,{L:()=>n,y:()=>a});var t=e(43173);function n(c){return{grafana_version:t.$.buildInfo.version,plugin_type:String(c.type),plugin_version:c.info.version,plugin_id:c.id,plugin_name:c.name}}function a(c){return{...n(c.meta),datasource_uid:c.uid}}},77010(ne,A,e){"use strict";e.d(A,{G:()=>o});var t=e(96540),n=e(31595),a=e(17564),c=e(27489),r=e(61190);const i="grafana_plugin_";function o(){const f=(0,n.Q)();return(0,t.useMemo)(()=>{if(!f)throw new Error("No PluginContext found. The usePluginInteractionReporter() hook can only be used from a plugin.");const h=(0,a.S)(f)?(0,r.y)(f.instanceSettings):(0,r.L)(f.meta);return(d,s)=>{if(!l(d))throw new Error(`Interactions reported in plugins should start with: "${i}".`);return(0,c.rR)(d,{...s,...h})}},[f])}function l(f){return f.startsWith(i)&&f.length>i.length}},33749(ne,A,e){"use strict";e.d(A,{fX:()=>a,nB:()=>n,n_:()=>t,p6:()=>c});var t=(r=>(r.DashboardView="dashboard-view",r.DataRequest="data-request",r))(t||{});const n=r=>!!r.payload.page,a=r=>!!r.payload.interactionName,c=r=>!!r.payload.experimentId},27489(ne,A,e){"use strict";e.d(A,{G$:()=>c,Jy:()=>r,Xp:()=>o,rR:()=>i});var t=e(43173),n=e(36490),a=e(78646);const c=l=>{(0,a.x$)().addEvent({type:a.on.MetaAnalytics,payload:l})},r=()=>{const l=n.Ny.getLocation(),f=`${t.$.appSubUrl??""}${l.pathname}${l.search}${l.hash}`;(0,a.x$)().addEvent({type:a.on.Pageview,payload:{page:f}})},i=(l,f)=>{t.$.reportingStaticContext&&t.$.reportingStaticContext instanceof Object&&(f={...f,...t.$.reportingStaticContext}),(0,a.x$)().addEvent({type:a.on.Interaction,payload:{interactionName:l,properties:f}})},o=(l,f,h)=>{(0,a.x$)().addEvent({type:a.on.ExperimentView,payload:{experimentId:l,experimentGroup:f,experimentVariant:h}})}},80839(ne,A,e){"use strict";e.d(A,{s:()=>d});var t=e(74848),n=e(96540),a=e(48480),c=e(29246),r=e(51898),i=e(41654),o=e(18857),l=e(63509),f=e(78282),h=e(36580);class d extends n.PureComponent{constructor(g){super(g),this.dataSourceSrv=(0,f.l)(),this.state={},this.onChange=(v,x)=>{if(x.action==="clear"&&this.props.onClear){this.props.onClear();return}const m=this.dataSourceSrv.getInstanceSettings(v.value);m&&(this.props.onChange(m),this.setState({error:void 0}))}}static{this.defaultProps={autoFocus:!1,openMenuOnFocus:!1,placeholder:"Select data source"}}componentDidMount(){const{current:g}=this.props;this.dataSourceSrv.getInstanceSettings(g)||this.setState({error:"Could not find data source "+g})}getCurrentValue(){const{current:g,hideTextValue:v,noDefault:x}=this.props;if(!g&&x)return;const m=this.dataSourceSrv.getInstanceSettings(g);if(m)return{label:m.name.slice(0,37),value:m.uid,imgUrl:m.meta.info.logos.small,hideText:v,meta:m.meta};const p=(0,a.Iz)(g);return p===h.dR.uid||p===h.dR.name?{label:p,value:p,hideText:v}:{label:(p??"no name")+" - not found",value:p??void 0,imgUrl:"",hideText:v}}getDataSourceOptions(){const{alerting:g,tracing:v,metrics:x,mixed:m,dashboard:p,variables:y,annotations:E,pluginId:b,type:u,filter:D,logs:P}=this.props;return this.dataSourceSrv.getList({alerting:g,tracing:v,metrics:x,logs:P,dashboard:p,mixed:m,variables:y,annotations:E,pluginId:b,filter:D,type:u}).map(S=>({value:S.name,label:`${S.name}${S.isDefault?" (default)":""}`,imgUrl:S.meta.info.logos.small,meta:S.meta}))}render(){const{autoFocus:g,onBlur:v,onClear:x,openMenuOnFocus:m,placeholder:p,width:y,inputId:E,disabled:b=!1,isLoading:u=!1}=this.props,{error:D}=this.state,P=this.getDataSourceOptions(),C=this.getCurrentValue(),S=typeof x=="function";return(0,t.jsx)("div",{"aria-label":"Data source picker select container","data-testid":r.Tp.components.DataSourcePicker.container,children:(0,t.jsx)(o.l6,{isLoading:u,disabled:b,"aria-label":"Select a data source","data-testid":r.Tp.components.DataSourcePicker.inputV2,inputId:E||"data-source-picker",className:"ds-picker select-container",isMulti:!1,isClearable:S,backspaceRemovesValue:!1,onChange:this.onChange,options:P,autoFocus:g,onBlur:v,width:y,openMenuOnFocus:m,maxMenuHeight:500,placeholder:p,noOptionsMessage:"No datasources found",value:C??null,invalid:!!D||!!this.props.invalid,getOptionLabel:R=>R.meta&&(0,c.x)(R.meta.signature)&&R!==C?(0,t.jsxs)(i.B,{alignItems:"center",justifyContent:"space-between",children:[(0,t.jsx)("span",{children:R.label})," ",(0,t.jsx)(l.B,{status:R.meta.signature})]}):R.label||""})})}}},43122(ne,A,e){"use strict";e.d(A,{f:()=>t,p:()=>n});let t=()=>{throw new Error("EmbeddedDashboard requires runtime initialization")};function n(a){t=a}},47700(ne,A,e){"use strict";e.d(A,{N:()=>a,d:()=>c});var t=e(74848);let n;function a(r){n=r}function c(r){return n?(0,t.jsx)(n,{...r}):null}},14477(ne,A,e){"use strict";e.d(A,{a:()=>n,e:()=>a});var t=e(74848);let n=({message:c})=>(0,t.jsxs)("div",{children:["Unable to render data: ",c,"."]});function a(c){n=c}},60311(ne,A,e){"use strict";e.d(A,{Y:()=>a,m:()=>n});var t=e(74848);let n=()=>(0,t.jsx)("div",{children:"PanelRenderer can only be used after Grafana instance has been started."});function a(c){n=c}},88806(ne,A,e){"use strict";e.d(A,{V:()=>n,l:()=>a});var t=e(74848);let n=({children:c})=>(0,t.jsx)("div",{children:c});function a(c){n=c}},92243(ne,A,e){"use strict";e.r(A),e.d(A,{CopyPanelEvent:()=>l.ah,DataSourcePicker:()=>K.s,DataSourceWithBackend:()=>j.iy,EchoEventType:()=>c.on,EmbeddedDashboard:()=>Y.f,FakeEchoSrv:()=>c.c_,FolderPicker:()=>B.d,GrafanaBootConfig:()=>D.p,HealthCheckError:()=>j.b1,HealthStatus:()=>j.VQ,HistoryWrapper:()=>o.K9,LocationServiceProvider:()=>o._K,MetaAnalyticsEventName:()=>P.n_,PanelDataErrorView:()=>w.a,PanelRenderer:()=>V.m,PluginPage:()=>U.V,QueryEditorWithMigration:()=>oe,RefreshEvent:()=>l._,RuntimeDataSource:()=>b,ScopesContext:()=>u.j,StreamingFrameAction:()=>i.Kh,ThemeChangedEvent:()=>l.E8,TimeRangeUpdatedEvent:()=>l.sR,config:()=>D.$,createDataSourcePluginEventProperties:()=>z.y,createMonitoringLogger:()=>L.DW,createPluginEventProperties:()=>z.L,createQueryRunner:()=>O.d,featureEnabled:()=>R.a,frameToMetricFindValue:()=>N.$h,getAppEvents:()=>l.J7,getBackendSrv:()=>t.AI,getCorrelationsService:()=>ie.r,getDataSourceSrv:()=>n.l,getEchoSrv:()=>c.x$,getGrafanaLiveSrv:()=>i.oF,getLimitedComponentsToRender:()=>m.CP,getLocationSrv:()=>a.X,getObservablePluginComponents:()=>x.z,getObservablePluginLinks:()=>v.m,getPluginImportUtils:()=>C.o,getRunRequest:()=>O.XJ,getTemplateSrv:()=>r.w,hasAllPermissions:()=>ae,hasAnyPermission:()=>J,hasPermission:()=>Z,hasPermissionInMetadata:()=>se,isExperimentViewEvent:()=>P.p6,isExpressionReference:()=>j.s9,isFetchError:()=>t.NF,isInteractionEvent:()=>P.fX,isMigrationHandler:()=>q.LZ,isPageviewEvent:()=>P.nB,isPluginExtensionComponent:()=>m.aR,isPluginExtensionLink:()=>m.DG,loadPluginCss:()=>C.PL,locationSearchToObject:()=>o.SE,locationService:()=>o.Ny,logDebug:()=>L.MD,logError:()=>L.vV,logInfo:()=>L.fH,logMeasurement:()=>L.l$,logWarning:()=>L.FF,migrateQuery:()=>q.aX,migrateRequest:()=>q.xt,navigationLogger:()=>o.Lc,registerEchoBackend:()=>c.pl,renderLimitedComponents:()=>m.RC,reportExperimentView:()=>S.Xp,reportInteraction:()=>S.rR,reportMetaAnalytics:()=>S.G$,reportPageview:()=>S.Jy,setAppEvents:()=>l.H8,setBackendSrv:()=>t.u5,setChromeHeaderHeightHook:()=>H._,setCorrelationsService:()=>ie.l,setCurrentUser:()=>p.l,setDataSourceSrv:()=>n.h,setEchoSrv:()=>c.H2,setEmbeddedDashboard:()=>Y.p,setFolderPicker:()=>B.N,setGrafanaLiveSrv:()=>i.S8,setHelpNavItemHook:()=>g.R,setLocationService:()=>o.vG,setLocationSrv:()=>a.T,setMegaMenuOpenHook:()=>W.$,setPluginComponentHook:()=>f.A,setPluginComponentsHook:()=>h.R,setPluginFunctionsHook:()=>s.U,setPluginImportUtils:()=>C.se,setPluginLinksHook:()=>d.q,setQueryRunnerFactory:()=>O.HC,setReturnToPreviousHook:()=>F._,setRunRequest:()=>O.pC,setTemplateSrv:()=>r.d,toDataQueryError:()=>M.u,toDataQueryResponse:()=>N.bE,useChromeHeaderHeight:()=>H.k,useFavoriteDatasources:()=>ee.S,useHelpNavItem:()=>g.X,useLocationService:()=>o.at,useMegaMenuOpen:()=>W.x,usePluginComponent:()=>f.S,usePluginComponents:()=>h.f,usePluginFunctions:()=>s.W,usePluginInteractionReporter:()=>G.G,usePluginLinks:()=>d.U,usePluginUserStorage:()=>re.D,useReturnToPrevious:()=>F.i,useScopes:()=>u.b});var t=e(68143),n=e(78282),a=e(48072),c=e(78646),r=e(2863),i=e(33184),o=e(36490),l=e(75234),f=e(33005),h=e(33604),d=e(46907),s=e(33707),g=e(79409),v=e(58873),x=e(2874),m=e(22099),p=e(6201),y=e(94644),E=e(11594);class b extends y.mA{constructor(fe,ce){const ve={name:"RuntimeDataSource-"+fe,uid:ce,type:fe,id:1,readOnly:!0,jsonData:{},access:"direct",meta:{id:fe,name:"RuntimeDataSource-"+fe,type:E.QE.datasource,info:{author:{name:""},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""},module:"",baseUrl:""}};super(ve),this.instanceSettings=ve}testDatasource(){return Promise.resolve({status:"success",message:""})}}var u=e(69896),D=e(43173),P=e(33749),C=e(39698),S=e(27489),R=e(62061),L=e(25992),j=e(36580),N=e(38866),V=e(60311),w=e(14477),M=e(97534),O=e(83734),U=e(88806),K=e(80839),z=e(61190),G=e(77010),F=e(41071),W=e(45012),H=e(92293),Y=e(43122),te=e(7918);const Z=de=>(0,te.ZU)(de,(0,p.H)()),se=(de,fe)=>(0,te.T6)(de,fe),ae=de=>(0,te.Fj)(de,(0,p.H)()),J=de=>(0,te.jW)(de,(0,p.H)());var k=e(74848),_=e(96540),Q=e(70255),q=e(38353);function oe(de){return ce=>{const[ve,Se]=(0,_.useState)(!1),[je,Ve]=(0,_.useState)(ce.query);return(0,_.useEffect)(()=>{ce.query&&(0,q.LZ)(ce.datasource)?(0,q.aX)(ce.datasource,ce.query).then(he=>{ce.onChange(he),Ve(he),Se(!0)}):Se(!0)},[]),(0,_.useEffect)(()=>{Ve(ce.query)},[ce.query]),ve?(0,k.jsx)(de,{...ce,query:je}):(0,k.jsx)(Q.A,{containerTestId:"react-loading-skeleton-testid",height:75})}}var re=e(55315),ee=e(77870),B=e(47700),ie=e(25076)},25076(ne,A,e){"use strict";e.d(A,{l:()=>n,r:()=>a});let t;function n(c){t=c}function a(){return t}},78646(ne,A,e){"use strict";e.d(A,{H2:()=>a,c_:()=>i,on:()=>t,pl:()=>r,x$:()=>c});var t=(o=>(o.Performance="performance",o.MetaAnalytics="meta-analytics",o.Pageview="pageview",o.Interaction="interaction",o.ExperimentView="experimentview",o.GrafanaJavascriptAgent="grafana-javascript-agent",o))(t||{});let n;function a(o){if(n instanceof i)for(const l of n.buffer)o.addEvent(l.event,l.meta);n=o}function c(){return n||(n=new i),n}const r=o=>{c().addBackend(o)};class i{constructor(){this.buffer=[]}flush(){this.buffer=[]}addBackend(l){}addEvent(l,f){this.buffer.push({event:l,meta:f})}}},36490(ne,A,e){"use strict";e.d(A,{K9:()=>h,Lc:()=>x,Ny:()=>s,SE:()=>d,_K:()=>y,at:()=>p,vG:()=>g});var t=e(74848),n=e(53554),a=e(96540),c=e(49426),r=e(5556),i=e(37615),o=e(60379),l=e(20720),f=e(43173);class h{constructor(b){this.history=b||n.zR({basename:f.$.appSubUrl??"/"}),this.locationObservable=new c.t(this.history.location),this.history.listen(u=>{this.locationObservable.next(u)}),this.partial=this.partial.bind(this),this.push=this.push.bind(this),this.replace=this.replace.bind(this),this.getSearch=this.getSearch.bind(this),this.getHistory=this.getHistory.bind(this),this.getLocation=this.getLocation.bind(this)}getLocationObservable(){return this.locationObservable.asObservable()}getHistory(){return this.history}getSearch(){return new URLSearchParams(this.history.location.search)}partial(b,u){const D=this.history.location,P=this.getSearchObject();for(const S in b)b[S]===null||b[S]===void 0?delete P[S]:P[S]=b[S];const C=r.kM.renderUrl(D.pathname,P);u?this.history.replace(C,this.history.location.state):this.history.push(C,this.history.location.state)}push(b){this.history.push(b)}replace(b){this.history.replace(b)}reload(){const b=this.history.location.state?.routeReloadCounter;this.history.replace({...this.history.location,state:{routeReloadCounter:b?b+1:1}})}getLocation(){return this.history.location}getSearchObject(){return d(this.history.location.search)}update(b){if((0,i.l)("LocationSrv","update","partial, push or replace"),b.partial&&b.query)this.partial(b.query,b.partial);else{const u={pathname:b.path};b.query&&(u.search=r.kM.toUrlParams(b.query)),b.replace?this.replace(u):this.push(u)}}}function d(E){let b=typeof E=="number"?String(E):E;return b.length>0?b.startsWith("?")?r.kM.parseKeyValue(b.substring(1)):r.kM.parseKeyValue(b):{}}let s=new h;const g=E=>{throw new Error("locationService can be only overriden in test environment")},v=(0,o.h)("Router"),x=v.logger;(0,l.h)("location",s,v);const m=a.createContext(void 0);function p(){const E=(0,a.useContext)(m);if(!E)throw new Error("useLocationService must be used within a LocationServiceProvider");return E}const y=({service:E,children:b})=>(0,t.jsx)(m.Provider,{value:E,children:b})},48072(ne,A,e){"use strict";e.d(A,{T:()=>n,X:()=>a});let t;function n(c){t=c}function a(){return t}},83734(ne,A,e){"use strict";e.d(A,{HC:()=>n,XJ:()=>i,d:()=>a,pC:()=>r});let t;const n=o=>{if(t)throw new Error("Runner should only be set when Grafana is starting.");t=o},a=()=>{if(!t)throw new Error("`createQueryRunner` can only be used after Grafana instance has started.");return t()};let c;function r(o){if(c)throw new Error("runRequest function should only be set once, when Grafana is starting.");c=o}function i(){if(!c)throw new Error("getRunRequest can only be used after Grafana instance has started.");return c}},69896(ne,A,e){"use strict";e.d(A,{b:()=>r,j:()=>c});var t=e(96540),n=e(24120),a=e(88483);const c=(0,t.createContext)(void 0);function r(){const i=(0,t.useContext)(c);return(0,n.A)(i?.stateObservable??new a.c,i?.state),(0,t.useMemo)(()=>i?{state:i.state,stateObservable:i.stateObservable,changeScopes:i.changeScopes,setReadOnly:i.setReadOnly,setEnabled:i.setEnabled}:void 0,[i,i?.state])}},78282(ne,A,e){"use strict";e.d(A,{h:()=>n,l:()=>a});let t;function n(c){t=c}function a(){return t}},33184(ne,A,e){"use strict";e.d(A,{Kh:()=>t.Kh,S8:()=>a,oF:()=>c});var t=e(51388);let n;const a=r=>{n=r},c=()=>n},79409(ne,A,e){"use strict";e.d(A,{R:()=>n,X:()=>a});let t;function n(c){if(t)throw new Error("setHelpNavItemHook() function should only be called once, when Grafana is starting.");t=c}function a(){if(!t)throw new Error("useHelpNavItem() can only be used after the Grafana instance has started.");return t()}},2874(ne,A,e){"use strict";e.d(A,{h:()=>n,z:()=>a});let t;function n(c){if(t)throw new Error("setGetObservablePluginComponents() function should only be called once, when Grafana is starting.");t=c}function a(c){if(!t)throw new Error("getObservablePluginComponents() can only be used after the Grafana instance has started.");return t(c)}},58873(ne,A,e){"use strict";e.d(A,{C:()=>n,m:()=>a});let t;function n(c){if(t)throw new Error("setGetObservablePluginLinks() function should only be called once, when Grafana is starting.");t=c}function a(c){if(!t)throw new Error("getObservablePluginLinks() can only be used after the Grafana instance has started.");return t(c)}},33005(ne,A,e){"use strict";e.d(A,{A:()=>n,S:()=>a});let t;function n(c){if(t)throw new Error("setPluginComponentHook() function should only be called once, when Grafana is starting.");t=c}function a(c){if(!t)throw new Error("setPluginComponentHook(options) can only be used after the Grafana instance has started.");return t(c)}},33604(ne,A,e){"use strict";e.d(A,{R:()=>n,f:()=>a});let t;function n(c){if(t)throw new Error("setPluginComponentsHook() function should only be called once, when Grafana is starting.");t=c}function a(c){if(!t)throw new Error("setPluginComponentsHook(options) can only be used after the Grafana instance has started.");return t(c)}},33707(ne,A,e){"use strict";e.d(A,{U:()=>n,W:()=>a});let t;function n(c){if(t)throw new Error("setUsePluginFunctionsHook() function should only be called once, when Grafana is starting.");t=c}function a(c){if(!t)throw new Error("usePluginFunctions(options) can only be used after the Grafana instance has started.");return t(c)}},46907(ne,A,e){"use strict";e.d(A,{U:()=>a,q:()=>n});let t;function n(c){if(t)throw new Error("setPluginLinksHook() function should only be called once, when Grafana is starting.");t=c}function a(c){if(!t)throw new Error("setPluginLinksHook(options) can only be used after the Grafana instance has started.");return t(c)}},22099(ne,A,e){"use strict";e.d(A,{CP:()=>i,DG:()=>c,RC:()=>o,aR:()=>r});var t=e(74848),n=e(96540),a=e(54092);function c(l){return l?l.type===a.u6.link&&("path"in l||"onClick"in l):!1}function r(l){return l?l.type===a.u6.component&&"component"in l:!1}function i({props:l,components:f,limit:h,pluginId:d}){if(!f.length)return null;const s=[];for(const g of f){const{meta:v}=g;if(!(d&&typeof d=="string"&&d!==v.pluginId)&&!(d&&Array.isArray(d)&&!d.includes(v.pluginId))&&!(d instanceof RegExp&&!d.test(v.pluginId))){if(h===void 0){s.push(g);continue}if(n.createElement(g,l)!==null&&s.push(g),s.length>=h)break}}return s}function o({props:l,components:f,limit:h,pluginId:d}){const s=i({props:l,components:f,limit:h,pluginId:d});return s?.length?(0,t.jsx)(t.Fragment,{children:s.map(g=>(0,t.jsx)(g,{...l},g.meta.id))}):null}},2863(ne,A,e){"use strict";e.d(A,{d:()=>n,w:()=>a});let t;const n=c=>{t=c},a=()=>t},6201(ne,A,e){"use strict";e.d(A,{H:()=>a,l:()=>n});let t=null;function n(c){if(t)throw new Error("User should only be set once, when Grafana is starting.");t=c}function a(){if(!t)throw new Error("User can only be used after Grafana instance has started.");return t}},36580(ne,A,e){"use strict";e.d(A,{iy:()=>R,dR:()=>u,b1:()=>P,VQ:()=>C,s9:()=>D});var t=e(62467),n=e(75505),a=e(44240),c=e(63720),r=e(66847),i=e(94644),o=e(48480),l=e(1906),f=e(38619),h=e(77154),d=e(35814),s=e(27489),g=e(43173),v=e(78282),x=e(68143),m=e(33184),p=e(51388),y=e(38866);function E(N){const{intervalMs:V,maxDataPoints:w,requestId:M,panelId:O,queryCachingTTL:U,range:{from:K,to:z}}=N;if(!N.targets.length)return(0,t.of)({data:[]});const G={intervalMs:V,maxDataPoints:w,queryCachingTTL:U,timeRange:{from:K.valueOf().toString(),to:z.valueOf().toString(),timezone:N.timezone}};return(0,x.AI)().fetch({url:`/api/public/dashboards/${g.$.publicDashboardAccessToken}/panels/${O}/query`,method:"POST",data:G,requestId:M}).pipe((0,c.n)(F=>(0,t.of)((0,y.bE)(F,N.targets))),(0,r.W)(F=>(0,t.of)((0,y.bE)(F))))}var b=e(55315);const u=Object.freeze({type:"__expr__",uid:"__expr__",name:"Expression"});function D(N){if(!N)return!1;const V=typeof N=="string"?N:N.type;return V===u.type||V===u.name||V==="-100"}class P extends Error{constructor(V,w){super(V),this.details=w,this.name="HealthCheckError"}}var C=(N=>(N.Unknown="UNKNOWN",N.OK="OK",N.Error="ERROR",N))(C||{}),S=(N=>(N.PluginID="X-Plugin-Id",N.DatasourceUID="X-Datasource-Uid",N.DashboardUID="X-Dashboard-Uid",N.PanelID="X-Panel-Id",N.PanelPluginId="X-Panel-Plugin-Id",N.QueryGroupID="X-Query-Group-Id",N.FromExpression="X-Grafana-From-Expr",N.SkipQueryCache="X-Cache-Skip",N.DashboardTitle="X-Dashboard-Title",N.PanelTitle="X-Panel-Title",N))(S||{});class R extends i.mA{constructor(V){super(V),this.streamOptionsProvider=j,this.userStorage=new b.X(V.type)}query(V){if(g.$.publicDashboardAccessToken)return E(V);const{intervalMs:w,maxDataPoints:M,queryCachingTTL:O,range:U,requestId:K,hideFromInspector:z=!1}=V;let G=V.targets,F=!1;const W=new Set,H=new Set,Y=G.map(ae=>{let J=this.getRef(),k=this.id,_=!0;if(D(ae.datasource))return F=!0,{...ae,datasource:u};if(ae.datasource){const Q=(0,v.l)().getInstanceSettings(ae.datasource,V.scopedVars);if(!Q)throw new Error(`Unknown Datasource: ${JSON.stringify(ae.datasource)}`);const q=Q.rawRef??(0,o.p$)(Q),oe=Q.id;(q.uid!==J.uid||k!==oe)&&(J=q,k=oe,_=!1)}return J.type?.length&&W.add(J.type),J.uid?.length&&H.add(J.uid),{..._?this.applyTemplateVariables(ae,V.scopedVars,V.filters):ae,datasource:J,datasourceId:k,intervalMs:w,maxDataPoints:M,queryCachingTTL:O}});if(!Y.length)return(0,t.of)({data:[]});const te={queries:Y,from:U?.from.valueOf().toString(),to:U?.to.valueOf().toString()},Z=V.headers??{};Z["X-Plugin-Id"]=Array.from(W).join(", "),Z["X-Datasource-Uid"]=Array.from(H).join(", ");let se="/api/ds/query?ds_type="+this.type;return g.$.featureToggles.queryServiceFromExplore&&V.app===l.Jk.Explore&&(se=`/apis/query.grafana.app/v0alpha1/namespaces/${g.$.namespace}/query?ds_type=${this.type}`),g.$.featureToggles.queryServiceFromUI&&(se=`/apis/query.grafana.app/v0alpha1/namespaces/${g.$.namespace}/query?ds_type=${this.type}`),F&&(Z["X-Grafana-From-Expr"]="true",se+="&expression=true"),K&&(se+=`&requestId=${K}`),V.dashboardUID&&(Z["X-Dashboard-Uid"]=V.dashboardUID,V.dashboardTitle&&(Z["X-Dashboard-Title"]=V.dashboardTitle),V.panelId&&(Z["X-Panel-Id"]=`${V.panelId}`),V.panelName&&(Z["X-Panel-Title"]=V.panelName)),V.panelPluginId&&(Z["X-Panel-Plugin-Id"]=`${V.panelPluginId}`),V.queryGroupId&&(Z["X-Query-Group-Id"]=`${V.queryGroupId}`),V.skipQueryCache&&(Z["X-Cache-Skip"]="true"),(0,x.AI)().fetch({url:se,method:"POST",data:te,requestId:K,hideFromInspector:z,headers:Z}).pipe((0,c.n)(ae=>{const J=(0,y.bE)(ae,Y);return J.data?.length&&J.data.find(k=>k.meta?.channel)?L(J,V,this.streamOptionsProvider):(0,t.of)(J)}),(0,r.W)(ae=>(0,t.of)((0,y.bE)(ae))))}getRequestHeaders(){const V={};return V["X-Plugin-Id"]=this.type,V["X-Datasource-Uid"]=this.uid,V}interpolateVariablesInQueries(V,w,M){return V.map(O=>this.applyTemplateVariables(O,w,M))}applyTemplateVariables(V,w,M){return V}async getResource(V,w,M){const O=this.getRequestHeaders();return(await(0,n.s)((0,x.AI)().fetch({...M,method:"GET",headers:M?.headers?{...M.headers,...O}:O,params:w??M?.params,url:`/api/datasources/uid/${this.uid}/resources/${V}`}))).data}async postResource(V,w,M){const O=this.getRequestHeaders();return(await(0,n.s)((0,x.AI)().fetch({...M,method:"POST",headers:M?.headers?{...M.headers,...O}:O,data:w??{...w},url:`/api/datasources/uid/${this.uid}/resources/${V}`}))).data}async callHealthCheck(){return(0,n.s)((0,x.AI)().fetch({method:"GET",url:`/api/datasources/uid/${this.uid}/health`,showErrorAlert:!1,headers:this.getRequestHeaders()})).then(V=>V.data).catch(V=>{let w={plugin_id:this.meta?.id||"",plugin_version:this.meta?.info?.version||"",datasource_healthcheck_status:V?.data?.status||"error",datasource_healthcheck_message:V?.data?.message||""};return(0,s.rR)("datasource_health_check_completed",w),V.data})}async testDatasource(){return this.callHealthCheck().then(V=>V.status==="OK"?{status:"success",message:V.message}:Promise.reject({status:"error",message:V.message,error:new P(V.message,V.details)}))}}function L(N,V,w){const M=(0,m.oF)();if(!M)return(0,t.of)(N);const O=[],U=[];for(const K of N.data){const z=(0,f.DG)(K.meta?.channel);if(z){const G=K;U.push(M.getDataStream({addr:z,buffer:w(V,G),frame:(0,h.Nw)(K)}))}else O.push(K)}return O.length&&U.push((0,t.of)({...N,data:O})),U.length===1?U[0]:(0,a.h)(...U)}const j=(N,V)=>{const w={maxLength:N.maxDataPoints??500,action:p.Kh.Append};return N.rangeRaw?.to==="now"&&(w.maxDelta=N.range.to.valueOf()-N.range.from.valueOf()),w};R=(0,d.Y)(R)},92293(ne,A,e){"use strict";e.d(A,{_:()=>n,k:()=>a});let t;const n=c=>{t=c},a=()=>(t||console.error("useChromeHeaderHeight hook not found"),t?.())},25992(ne,A,e){"use strict";e.d(A,{DW:()=>f,FF:()=>r,MD:()=>i,fH:()=>c,l$:()=>l,vV:()=>o});var t=e(32631),n=e(37930),a=e(43173);function c(h,d){a.$.grafanaJavascriptAgent.enabled&&t.P.api.pushLog([h],{level:n.$b.INFO,context:d})}function r(h,d){a.$.grafanaJavascriptAgent.enabled&&t.P.api.pushLog([h],{level:n.$b.WARN,context:d})}function i(h,d){a.$.grafanaJavascriptAgent.enabled&&t.P.api.pushLog([h],{level:n.$b.DEBUG,context:d})}function o(h,d){a.$.grafanaJavascriptAgent.enabled&&t.P.api.pushError(h,{context:d})}function l(h,d,s){a.$.grafanaJavascriptAgent.enabled&&t.P.api.pushMeasurement({type:h,values:d},{context:s})}function f(h,d){const s=g=>({source:h,...d,...g});return{logDebug:(g,v)=>i(g,s(v)),logInfo:(g,v)=>c(g,s(v)),logWarning:(g,v)=>r(g,s(v)),logError:(g,v)=>o(g,s(v)),logMeasurement:(g,v,x)=>l(g,v,s(x))}}},45012(ne,A,e){"use strict";e.d(A,{$:()=>n,x:()=>a});let t;const n=c=>{t=c},a=()=>t?t():[!1,()=>console.error("MegaMenuOpen hook not found")]},38353(ne,A,e){"use strict";e.d(A,{LZ:()=>c,aX:()=>i,xt:()=>o});var t=e(43173),n=e(68143),a=e(36580);function c(l){return l instanceof a.iy&&"hasBackendMigration"in l&&"shouldMigrate"in l}async function r(l){if(!(t.$.featureToggles.grafanaAPIServerWithExperimentalAPIs||t.$.featureToggles.datasourceAPIServers))return console.warn("migrateQuery is only available with the experimental API server"),l;const s=`/apis/${`${l[0].datasource?.type?.replace(/^(grafana-)?(.*?)(-datasource)?$/,"$2")}.datasource.grafana.app`}/v0alpha1/namespaces/${t.$.namespace}/queryconvert`,g={queries:l.map(x=>({...x,JSON:x}))};return(await(0,n.AI)().post(s,g)).queries.map(x=>x.JSON)}async function i(l,f){return!l.hasBackendMigration||!l.shouldMigrate(f)?f:(await r([f]))[0]}async function o(l,f){if(!l.hasBackendMigration||!f.targets.some(d=>l.shouldMigrate(d)))return f;const h=await r(f.targets);return{...f,targets:h}}},39698(ne,A,e){"use strict";e.d(A,{PL:()=>n,o:()=>r,se:()=>c});var t=e(43173);async function n(i){try{const o=t.$.bootData.user.theme==="light"?i.light:i.dark;return window.System.import(o)}catch(o){console.error(o)}}let a;function c(i){if(a)throw new Error("pluginImportUtils should only be set once, when Grafana is starting.");a=i}function r(){if(!a)throw new Error("pluginImportUtils can only be used after Grafana instance has started.");return a}},38866(ne,A,e){"use strict";e.d(A,{$h:()=>d,bE:()=>o});var t=e(41119),n=e(77154),a=e(95004),c=e(28105),r=e(97534);const i={severity:"info",text:"Cached response"};function o(s,g){const v={data:[],state:c.Gu.Done},x="traceId"in s?s.traceId:void 0;x!=null&&(v.traceIds=[x]);const m=s;if(m.data?.results){const p=m.data.results,y=g?.length?g.map(u=>u.refId):Object.keys(p),E=l(m),b=[];for(const u of y){const D=p[u];D&&(D.refId=u,b.push(D))}for(const u of b){if(u.error){const D={refId:u.refId,message:u.error,status:u.status};x!=null&&(D.traceId=x),v.error||(v.error={...D}),v.errors?v.errors.push({...D}):v.errors=[{...D}],v.state=c.Gu.Error}if(u.frames?.length){for(let D of u.frames){E&&(D=f(D));const P=(0,n.or)(D);P.refId||(P.refId=u.refId),v.data.push(P)}continue}if(u.series?.length)for(const D of u.series)D.refId||(D.refId=u.refId),v.data.push((0,t.Vc)(D));if(u.tables?.length)for(const D of u.tables)D.refId||(D.refId=u.refId),v.data.push((0,t.Vc)(D))}}return m.status&&m.status!==200&&(v.state!==c.Gu.Error&&(v.state=c.Gu.Error),v.error||(v.error=(0,r.u)(s))),v}function l(s){const g=s?.headers;return!g||!g.get?!1:g.get("X-Cache")==="HIT"}function f(s){return{...s,schema:{...s.schema,fields:[...s.schema?.fields??[]],meta:{...s.schema?.meta,notices:[...s.schema?.meta?.notices??[],i],isCachedResponse:!0}}}}function h(s){const g=o(s);if(g.error?.data?.message)return{status:"error",message:g.error.data.message,details:g.error?.data?.error?{message:g.error.data.error}:void 0};if(g.error?.refId&&g.error?.message)return{status:"error",message:g.error.message};throw s}function d(s){if(!s||!s.length)return[];const g=[];let v=s.fields.find(x=>x.type===a.PU.string);if(v||(v=s.fields.find(x=>x.type!==a.PU.time)),v)for(let x=0;xn,i:()=>a});let t;const n=c=>{t=c},a=()=>t?t():()=>console.error("ReturnToPrevious hook not found")},97534(ne,A,e){"use strict";e.d(A,{u:()=>t});function t(n){const a=n||{};if(!a.message){if(typeof n=="string")return{message:n};let c="Query error";a.message?c=a.message:a.data&&a.data.message&&a.data?.message!=="Query data error"?c=a.data.message:a?.data?.message==="Query data error"&&a?.data?.error||a.data&&a.data.error?c=a.data.error:a.status&&(c=`Query error: ${a.status} ${a.statusText}`),a.message=c}return a}},77870(ne,A,e){"use strict";e.d(A,{S:()=>i});var t=e(96540),n=e(43173),a=e(55315);const c="favoriteDatasources",r=new a.X("grafana-runtime");function i(){const[o,l]=(0,t.useState)([]),[f,h]=(0,t.useState)([]),[d,s]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if(!n.$.featureToggles.favoriteDatasources)return;(async()=>{s(!0);const y=await r.getItem(c);if(y){const E=JSON.parse(y);l(E),h(E)}s(!1)})()},[]);const g=(0,t.useCallback)(async p=>{s(!0),await r.setItem(c,JSON.stringify(p)),l(p),s(!1)},[]),v=(0,t.useCallback)(p=>{if(!p.meta.builtIn&&!o.includes(p.uid)){const y=[...o,p.uid];g(y)}},[o,g]),x=(0,t.useCallback)(p=>{const y=o.filter(E=>E!==p.uid);y.length!==o.length&&g(y)},[o,g]),m=(0,t.useCallback)(p=>o.includes(p),[o]);return n.$.featureToggles.favoriteDatasources?{enabled:!0,isLoading:d,favoriteDatasources:o,addFavoriteDatasource:v,removeFavoriteDatasource:x,isFavoriteDatasource:m,initialFavoriteDataSources:f}:{enabled:!1,isLoading:!1,favoriteDatasources:[],initialFavoriteDataSources:[],addFavoriteDatasource:()=>{},removeFavoriteDatasource:()=>{},isFavoriteDatasource:()=>!1}}},55315(ne,A,e){"use strict";e.d(A,{D:()=>h,X:()=>f});var t=e(2543),n=e.n(t),a=e(75505),c=e(31595),r=e(43173),i=e(68143);const o=`/apis/userstorage.grafana.app/v0alpha1/namespaces/${r.$.namespace}/user-storage`;async function l(d){try{const{data:s,...g}=await(0,a.s)((0,i.AI)().fetch({...d,url:o+d.url,data:d.body,showErrorAlert:!1}));return{data:s,meta:g}}catch(s){return d.manageError?d.manageError(s):{error:s}}}class f{constructor(s){this.service=s,this.userUID=r.$.bootData.user.uid===""?r.$.bootData.user.id.toString():r.$.bootData.user.uid,this.resourceName=`${s}:${this.userUID}`,this.canUseUserStorage=r.$.bootData.user.isSignedIn}async init(){if(this.storageSpec!==void 0)return;const s=await l({url:`/${this.resourceName}`,method:"GET",manageError:g=>(0,t.get)(g,"status")===404?(this.storageSpec=null,{error:null}):{error:g}});if("error"in s)return s.error;this.storageSpec=s.data.spec}async getItem(s){return this.canUseUserStorage?(await this.init(),this.storageSpec?this.storageSpec.data[s]:localStorage.getItem(`${this.resourceName}:${s}`)):localStorage.getItem(`${this.resourceName}:${s}`)}async setItem(s,g){if(!this.canUseUserStorage){localStorage.setItem(`${this.resourceName}:${s}`,g);return}const v={data:{[s]:g}};if(await this.init()){localStorage.setItem(`${this.resourceName}:${s}`,g);return}if(!this.storageSpec){await l({url:"/",method:"POST",body:{metadata:{name:this.resourceName,labels:{user:this.userUID,service:this.service}},spec:v},manageError:m=>(localStorage.setItem(`${this.resourceName}:${s}`,g),{error:m})}),this.storageSpec=v;return}this.storageSpec.data[s]=g,await l({headers:{"Content-Type":"application/merge-patch+json"},url:`/${this.resourceName}`,method:"PATCH",body:{spec:v},manageError:m=>(localStorage.setItem(`${this.resourceName}:${s}`,g),{error:m})})}}function h(){const d=(0,c.Q)();if(!d)throw new Error("No PluginContext found. The usePluginUserStorage() hook can only be used from a plugin.");return new f(d?.meta.id)}},97474(ne,A,e){"use strict";e.d(A,{KQ:()=>a,QB:()=>c});var t=e(739);const n="12.3.3",a={barRadius:0,barWidth:.97,fullHighlight:!1,groupWidth:.7,orientation:t.wV.Auto,showValue:t.yL.Auto,stacking:t.gs.None,xTickLabelRotation:0,xTickLabelSpacing:0},c={fillOpacity:80,gradientMode:t.on.None,lineWidth:1}},48390(ne,A,e){"use strict";e.d(A,{K:()=>a});var t=e(739);const n="12.3.3",a={displayMode:t.eX.Gradient,maxVizHeight:300,minVizHeight:16,minVizWidth:8,namePlacement:t.TZ.Auto,showUnfilled:!0,sizing:t.T6.Auto,valueMode:t.$l.Color}},53478(ne,A,e){"use strict";e.d(A,{K:()=>n});const t="12.3.3",n={selectedSeries:0}},74194(ne,A,e){"use strict";e.d(A,{K:()=>a});var t=e(739);const n="12.3.3",a={minVizHeight:75,minVizWidth:75,showThresholdLabels:!1,showThresholdMarkers:!0,sizing:t.T6.Auto}},48850(ne,A,e){"use strict";e.d(A,{KQ:()=>n});const t="12.3.3",n={layers:[]},a={allLayers:!0,id:"zero",lat:0,lon:0,noRepeat:!1,zoom:1};var c=(i=>(i.Details="details",i.None="none",i))(c||{}),r=(i=>(i.Coords="coords",i.Fit="fit",i.Zero="zero",i))(r||{})},97644(ne,A,e){"use strict";e.d(A,{KQ:()=>i});var t=e(739);const n="12.3.3";var a=(o=>(o.Opacity="opacity",o.Scheme="scheme",o))(a||{}),c=(o=>(o.Exponential="exponential",o.Linear="linear",o))(c||{}),r=(o=>(o.X="x",o.Xy="xy",o.Y="y",o))(r||{});const i={calculate:!1,cellGap:1,cellValues:{},color:{scheme:"Oranges",fill:"dark-orange",reverse:!1,exponent:.5,steps:64},exemplars:{color:"rgba(255,0,255,0.7)"},filterValues:{le:1e-9},legend:{show:!0},selectionMode:"x",showValue:t.yL.Auto,tooltip:{mode:t.$N.Single,yHistogram:!1,showColorScale:!1}}},55448(ne,A,e){"use strict";e.d(A,{KQ:()=>a,QB:()=>c});var t=e(739);const n="12.3.3",a={bucketCount:30,bucketOffset:0},c={fillOpacity:80,gradientMode:t.on.None,lineWidth:1}},25346(ne,A,e){"use strict";e.d(A,{K:()=>n});const t="12.3.3",n={showImage:!0}},23130(ne,A,e){"use strict";e.d(A,{KQ:()=>i});const t="12.3.3";var n=(o=>(o.Donut="donut",o.Pie="pie",o))(n||{}),a=(o=>(o.Name="name",o.Percent="percent",o.Value="value",o))(a||{}),c=(o=>(o.Percent="percent",o.Value="value",o))(c||{});const r={values:[]},i={displayLabels:[]}},7698(ne,A,e){"use strict";e.d(A,{K:()=>a});var t=e(739);const n="12.3.3",a={colorMode:t.yp.Value,graphMode:t.$p.Area,justifyMode:t.F8.Auto,percentChangeColorMode:t.CD.Standard,showPercentChange:!1,textMode:t.SV.Auto,wideLayout:!0}},16880(ne,A,e){"use strict";e.d(A,{KQ:()=>a,QB:()=>c});var t=e(739);const n="12.3.3",a={alignValue:"left",mergeValues:!0,perPage:20,rowHeight:.9,showValue:t.yL.Auto},c={fillOpacity:70,lineWidth:0}},93384(ne,A,e){"use strict";e.d(A,{KQ:()=>a,QB:()=>c});var t=e(739);const n="12.3.3",a={colWidth:.9,perPage:20,rowHeight:.9,showValue:t.yL.Auto},c={fillOpacity:70,lineWidth:1}},59740(ne,A,e){"use strict";e.d(A,{K:()=>a});var t=e(739);const n="12.3.3",a={cellHeight:t.qM.Sm,frameIndex:0,showHeader:!0,showTypeIcons:!1,sortBy:[]}},51250(ne,A,e){"use strict";e.d(A,{KQ:()=>i});const t="12.3.3";var n=(o=>(o.Code="code",o.HTML="html",o.Markdown="markdown",o))(n||{}),a=(o=>(o.Go="go",o.Html="html",o.Json="json",o.Markdown="markdown",o.Plaintext="plaintext",o.Sql="sql",o.Typescript="typescript",o.Xml="xml",o.Yaml="yaml",o))(a||{});const c="plaintext",r={language:"plaintext",showLineNumbers:!1,showMiniMap:!1},i={content:`# Title For markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)`,mode:"markdown"}},81166(ne,A,e){"use strict";e.d(A,{KQ:()=>o,QB:()=>i});const t="12.3.3";var n=(l=>(l.Circle="circle",l.Square="square",l))(n||{}),a=(l=>(l.Auto="auto",l.Manual="manual",l))(a||{}),c=(l=>(l.Lines="lines",l.Points="points",l.PointsAndLines="points+lines",l))(c||{});const r={id:""},i={fillOpacity:50,show:"points"},o={series:[]}},21275(ne,A,e){"use strict";e.d(A,{$C:()=>u,CO:()=>i,GW:()=>R,OA:()=>D,Ol:()=>x,QB:()=>S,WL:()=>y,Yb:()=>g,Ye:()=>L,ZG:()=>l,aD:()=>a,bf:()=>c,bt:()=>P,dM:()=>p,lt:()=>E,rw:()=>r,ss:()=>C,yV:()=>b});const t={tags:[]},n={exclude:!1,ids:[]},a={list:[]},c={builtIn:0,enable:!0,hide:!1},r={allowCustomValue:!0,includeAll:!1,multi:!1,options:[],skipUrlSync:!1,staticOptions:[]};var i=(j=>(j[j.never=0]="never",j[j.onDashboardLoad=1]="onDashboardLoad",j[j.onTimeRangeChanged=2]="onTimeRangeChanged",j))(i||{}),o=(j=>(j[j.dontHide=0]="dontHide",j[j.hideLabel=1]="hideLabel",j[j.hideVariable=2]="hideVariable",j[j.inControlsMenu=3]="inControlsMenu",j))(o||{}),l=(j=>(j[j.alphabeticalAsc=1]="alphabeticalAsc",j[j.alphabeticalCaseInsensitiveAsc=5]="alphabeticalCaseInsensitiveAsc",j[j.alphabeticalCaseInsensitiveDesc=6]="alphabeticalCaseInsensitiveDesc",j[j.alphabeticalDesc=2]="alphabeticalDesc",j[j.disabled=0]="disabled",j[j.naturalAsc=7]="naturalAsc",j[j.naturalDesc=8]="naturalDesc",j[j.numericalAsc=3]="numericalAsc",j[j.numericalDesc=4]="numericalDesc",j))(l||{});const f={asDropdown:!1,includeVars:!1,keepTime:!1,tags:[],targetBlank:!1},h={headers:[],queryParams:[]},d={headers:[],queryParams:[]},s={variables:[]};var g=(j=>(j.ContinuousBlPu="continuous-BlPu",j.ContinuousBlYlRd="continuous-BlYlRd",j.ContinuousBlues="continuous-blues",j.ContinuousGrYlRd="continuous-GrYlRd",j.ContinuousGreens="continuous-greens",j.ContinuousPurples="continuous-purples",j.ContinuousRdYlGr="continuous-RdYlGr",j.ContinuousReds="continuous-reds",j.ContinuousYlBl="continuous-YlBl",j.ContinuousYlRd="continuous-YlRd",j.Fixed="fixed",j.PaletteClassic="palette-classic",j.PaletteClassicByName="palette-classic-by-name",j.Shades="shades",j.Thresholds="thresholds",j))(g||{});const v={h:9,w:12,x:0,y:0};var x=(j=>(j.Absolute="absolute",j.Percentage="percentage",j))(x||{});const m={steps:[]};var p=(j=>(j.RangeToText="range",j.RegexToText="regex",j.SpecialValue="special",j.ValueToText="value",j))(p||{}),y=(j=>(j.Empty="empty",j.False="false",j.NaN="nan",j.Null="null",j.NullAndNan="null+nan",j.True="true",j))(y||{});const E={hidden:!1,quick_ranges:[],refresh_intervals:["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"]};var b=(j=>(j[j.Crosshair=1]="Crosshair",j[j.Off=0]="Off",j[j.Tooltip=2]="Tooltip",j))(b||{});const u=0,D={links:[],repeatDirection:"h",targets:[],transformations:[],transparent:!1},P={overrides:[]},C={id:""},S={actions:[],links:[],mappings:[]},R={collapsed:!1,panels:[]},L={editable:!0,fiscalYearStartMonth:0,graphTooltip:0,links:[],panels:[],schemaVersion:42,tags:[],timezone:"browser"}},11393(ne,A,e){"use strict";e.d(A,{Bj:()=>tn,ET:()=>at,FM:()=>qe,G9:()=>nt,IP:()=>Wt,Ku:()=>pt,QB:()=>P,SR:()=>et,X1:()=>ct,bt:()=>D,ft:()=>Oe,iM:()=>a,kH:()=>ke,l_:()=>gt,m6:()=>Ce,ns:()=>wt,pK:()=>dt,t1:()=>ot,uB:()=>_t,xE:()=>Ct});const t=()=>({kind:"AnnotationQuery",spec:n()}),n=()=>({query:a(),enable:!1,hide:!1,iconColor:"",name:"",builtIn:!1,placement:r}),a=()=>({kind:"DataQuery",group:"",version:"v0",spec:{}}),c=()=>({exclude:!1,ids:[]}),r="inControlsMenu",i=()=>"Off",o=()=>l(),l=()=>({kind:"Panel",spec:f()}),f=()=>({id:0,title:"",description:"",links:[],data:d(),vizConfig:b()}),h=()=>({title:"",url:""}),d=()=>({kind:"QueryGroup",spec:s()}),s=()=>({queries:[],transformations:[],queryOptions:E()}),g=()=>({kind:"PanelQuery",spec:v()}),v=()=>({query:a(),refId:"",hidden:!1}),x=()=>({kind:"",spec:m()}),m=()=>({id:"",options:{}}),p=()=>({id:""}),y=()=>"series",E=()=>({}),b=()=>({kind:"VizConfig",group:"",version:"",spec:u()}),u=()=>({options:{},fieldConfig:D()}),D=()=>({defaults:P(),overrides:[]}),P=()=>({}),C=()=>S(),S=()=>({type:"value",options:{}}),R=()=>"value",L=()=>({}),j=()=>({type:"range",options:{from:0,to:0,result:L()}}),N=()=>({type:"regex",options:{pattern:"",result:L()}}),V=()=>({type:"special",options:{match:"true",result:L()}}),w=()=>"true",M=()=>({mode:"absolute",steps:[]}),O=()=>"absolute",U=()=>({value:0,color:""}),K=()=>({mode:"thresholds"}),z=()=>"thresholds",G=()=>"min",F=()=>({type:"fetch",title:""}),W=()=>"fetch",H=()=>({method:"GET",url:""}),Y=()=>"GET",te=()=>({method:"GET",url:"",datasourceUid:""}),Z=()=>({key:"",name:"",type:se}),se="string",ae=()=>({id:""}),J=()=>({kind:"LibraryPanel",spec:k()}),k=()=>({id:0,title:"",libraryPanel:_()}),_=()=>({name:"",uid:""}),Q=()=>({kind:"GridLayout",spec:q()}),q=()=>({items:[]}),oe=()=>({kind:"GridLayoutItem",spec:re()}),re=()=>({x:0,y:0,width:0,height:0,element:ee()}),ee=()=>({kind:"ElementReference",name:""}),B=()=>({mode:ie,value:""}),ie="variable",de=()=>({kind:"RowsLayout",spec:fe()}),fe=()=>({rows:[]}),ce=()=>({kind:"RowsLayoutRow",spec:ve()}),ve=()=>({layout:Q()}),Se=()=>({kind:"ConditionalRenderingGroup",spec:je()}),je=()=>({visibility:"show",condition:"and",items:[]}),Ve=()=>({kind:"ConditionalRenderingVariable",spec:he()}),he=()=>({variable:"",operator:"equals",value:""}),Ue=()=>({kind:"ConditionalRenderingData",spec:pe()}),pe=()=>({value:!1}),be=()=>({kind:"ConditionalRenderingTimeRangeSize",spec:ze()}),ze=()=>({value:""}),Ne=()=>({mode:ie,value:""}),Ie=()=>({kind:"AutoGridLayout",spec:ke()}),ke=()=>({maxColumnCount:3,columnWidthMode:"standard",rowHeightMode:"standard",fillScreen:!1,items:[]}),Ee=()=>({kind:"AutoGridLayoutItem",spec:Ae()}),Ae=()=>({element:ee()}),$e=()=>({mode:ie,value:""}),Fe=()=>({kind:"TabsLayout",spec:We()}),We=()=>({tabs:[]}),Ge=()=>({kind:"TabsLayoutTab",spec:me()}),me=()=>({layout:Q()}),De=()=>({mode:ie,value:""}),xe=()=>({title:"",type:"link",icon:"",tooltip:"",tags:[],asDropdown:!1,targetBlank:!1,includeVars:!1,keepTime:!1,placement:Be}),Me=()=>"link",Be="inControlsMenu",Oe=()=>({timezone:"browser",from:"now-6h",to:"now",autoRefresh:"",autoRefreshIntervals:["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],hideTimepicker:!1,fiscalYearStartMonth:0}),Re=()=>({display:"Last 6 hours",from:"now-6h",to:"now"}),we=()=>Ce(),Ce=()=>({kind:"QueryVariable",spec:_e()}),_e=()=>({name:"",current:{text:"",value:""},hide:"dontHide",refresh:"never",skipUrlSync:!1,query:a(),regex:"",sort:"disabled",options:[],multi:!1,includeAll:!1,allowCustomValue:!0}),Je=()=>({text:"",value:""}),et=()=>"dontHide",qe=()=>"never",nt=()=>"disabled",ot=()=>({kind:"TextVariable",spec:Ze()}),Ze=()=>({name:"",current:{text:"",value:""},query:"",hide:"dontHide",skipUrlSync:!1}),at=()=>({kind:"ConstantVariable",spec:it()}),it=()=>({name:"",query:"",current:{text:"",value:""},hide:"dontHide",skipUrlSync:!1}),ct=()=>({kind:"DatasourceVariable",spec:xt()}),xt=()=>({name:"",pluginId:"",refresh:"never",regex:"",current:{text:"",value:""},options:[],multi:!1,includeAll:!1,hide:"dontHide",skipUrlSync:!1,allowCustomValue:!0}),dt=()=>({kind:"IntervalVariable",spec:vt()}),vt=()=>({name:"",query:"",current:{text:"",value:""},options:[],auto:!1,auto_min:"",auto_count:0,refresh:"never",hide:"dontHide",skipUrlSync:!1}),wt=()=>({kind:"CustomVariable",spec:$t()}),$t=()=>({name:"",query:"",current:Je(),options:[],multi:!1,includeAll:!1,hide:"dontHide",skipUrlSync:!1,allowCustomValue:!0}),_t=()=>({kind:"GroupByVariable",group:"",spec:tn()}),tn=()=>({name:"",current:{text:"",value:""},options:[],multi:!1,hide:"dontHide",skipUrlSync:!1}),gt=()=>({kind:"AdhocVariable",group:"",spec:Wt()}),Wt=()=>({name:"",baseFilters:[],filters:[],defaultKeys:[],hide:"dontHide",skipUrlSync:!1,allowCustomValue:!0}),Xt=()=>({key:"",operator:"",value:"",origin:dn}),dn="dashboard",rt=()=>({text:""}),pt=()=>({kind:"SwitchVariable",spec:mt()}),mt=()=>({name:"",current:"false",enabledValue:"true",disabledValue:"false",hide:"dontHide",skipUrlSync:!1}),Ct=()=>({annotations:[],cursorSync:"Off",editable:!0,elements:{},layout:Q(),links:[],preload:!1,tags:[],timeSettings:Oe(),title:"",variables:[]})},31114(ne,A,e){"use strict";e.d(A,{Gu:()=>a,gB:()=>n});var t=e(739);const n={align:"auto",inspect:!1,wrapHeaderText:!1,cellOptions:{type:t.ob.Auto}};var a=(c=>(c.NotStarted="NotStarted",c.Loading="Loading",c.Streaming="Streaming",c.Done="Done",c.Error="Error",c))(a||{})},59857(ne,A,e){"use strict";e.d(A,{Ye:()=>a,lt:()=>r,rw:()=>c,zL:()=>n});var t=e(21275),n=(g=>(g[g.dontHide=0]="dontHide",g[g.hideLabel=1]="hideLabel",g[g.hideVariable=2]="hideVariable",g[g.inControlsMenu=3]="inControlsMenu",g))(n||{});const a=t.Ye,c={...t.rw},r=t.lt,i=t.OA,o=t.GW,l=t.QB,f=t.bt,h=t.ss,d=t.bf,s=t.aD},27074(ne,A,e){"use strict";e.d(A,{l:()=>d});var t=e(74848),n=e(22803),a=e(73287),c=e(92745),r=e(27489),i=e(76319),o=e(50992),l=e(37386),f=e(63142),h=e(52308);function d({rawSql:g,datasourceType:v}){const[x,m]=(0,a.A)(),p=(0,f.of)(s),y=b=>{m(b),(0,r.rR)("grafana_sql_preview_copied",{datasource:v})},E=(0,t.jsxs)("div",{className:p.labelWrapper,children:[(0,t.jsx)("span",{className:p.label,children:(0,t.jsx)(c.x6,{i18nKey:"grafana-sql.components.preview.label-element.preview",children:"Preview"})}),(0,t.jsx)(i.K,{tooltip:(0,c.t)("grafana-sql.components.preview.label-element.tooltip-copy-to-clipboard","Copy to clipboard"),onClick:()=>y(g),name:"copy"})]});return(0,t.jsx)(l.D,{label:E,className:p.grow,children:(0,t.jsx)(o.B,{language:"sql",height:80,value:(0,h.s)(g),monacoOptions:{scrollbar:{vertical:"hidden"},scrollBeyondLastLine:!1},readOnly:!0,showMiniMap:!1})})}function s(g){return{grow:(0,n.css)({flexGrow:1}),label:(0,n.css)({fontSize:12,fontWeight:g.typography.fontWeightMedium}),labelWrapper:(0,n.css)({display:"flex",justifyContent:"space-between",paddingBottom:g.spacing(.5)})}}},81045(ne,A,e){"use strict";e.d(A,{T:()=>c});var t=e(41778),n=e(11194),a=e(25274);function c(r){let i=r?.editorMode||t.lX.Builder;return r?.editorMode===void 0&&r?.rawSql!==void 0&&(i=t.lX.Code),{...r,refId:r?.refId||"A",format:r?.format!==void 0?r.format:n.gv.Table,rawSql:r?.rawSql||"",editorMode:i,sql:r?.sql??{columns:[(0,a.JD)()],groupBy:[(0,a.xG)()],limit:50}}}},36656(ne,A,e){"use strict";e.d(A,{D:()=>t,_:()=>n});var t=(a=>(a.String="string",a))(t||{}),n=(a=>(a.Property="property",a.Operator="operator",a.Or="or",a.And="and",a.GroupBy="groupBy",a.Function="function",a.FunctionParameter="functionParameter",a))(n||{})},52315(ne,A,e){"use strict";e.d(A,{Uw:()=>n,gv:()=>t.gv,oK:()=>O,u$:()=>N,To:()=>w.T,oF:()=>tn.oF,se:()=>U.s,YW:()=>tn.YW});var t=e(11194);const n=[{name:"AVG"},{name:"COUNT"},{name:"MAX"},{name:"MIN"},{name:"SUM"}],a={name:"Interval",required:!0,options:()=>Promise.resolve([{label:"$__interval",value:"$__interval"}])},c={name:"Fill",required:!1,options:()=>Promise.resolve([{label:"0",value:"0"},{label:"NULL",value:"NULL"},{label:"previous",value:"previous"}])},r=rt=>[{name:"$__timeGroup",description:"Time grouping function",parameters:[rt,a,c]},{name:"$__timeGroupAlias",description:"Time grouping function with time as alias",parameters:[rt,a,c]},{name:"$__time",description:"An expression to rename the column to time",parameters:[rt]},{name:"$__timeEpoch",parameters:[rt]},{name:"$__unixEpochGroup",parameters:[rt,a,c]},{name:"$__unixEpochGroupAlias",parameters:[rt,a,c]}],i=["$__time","$__timeEpoch","$__timeFilter","$__timeFrom","$__timeTo","$__timeGroup","$__timeGroupAlias","$__unixEpochFilter","$__unixEpochNanoFilter","$__unixEpochNanoFrom","$__unixEpochNanoTo","$__unixEpochGroup","$__unixEpochGroupAlias"];var o=e(13288),l=e(75505),f=e(81160),h=e(1906),d=e(94452),s=e(22592),g=e(88673),v=e(41778),x=e(36580),m=e(2863),p=e(27489),y=e(68143),E=e(38866),b=e(2543);class u{transformMetricFindResponse(pt){const mt=[],Ct=pt.fields.find(Dt=>Dt.name==="__text"),Ye=pt.fields.find(Dt=>Dt.name==="__value");if(Ct&&Ye)for(let Dt=0;Dte.e(168).then(e.bind(e,47805)));function N(rt){const pt=(0,R.of)(V);return(0,D.jsx)(C.Suspense,{fallback:(0,D.jsx)(L._,{text:(0,S.t)("grafana-sql.components.sql-query-editor-lazy.text-loading-editor","Loading editor"),className:pt.container}),children:(0,D.jsx)(j,{...rt})})}const V=rt=>({container:(0,P.css)({marginBottom:"unset",marginLeft:rt.spacing(1)})});var w=e(81045);function M(rt){const pt=typeof rt.rawQuery=="string"?rt.rawQuery:null;if(!pt)return rt;const mt=(0,w.T)({refId:"Annotation",...rt.target??{},rawSql:pt});return{...rt,rawQuery:void 0,workspace:void 0,subscription:void 0,queryType:void 0,target:mt}}class O extends x.iy{constructor(pt,mt=(0,m.w)()){super(pt),this.templateSrv=mt,this.interpolateVariable=(Ye,Dt)=>typeof Ye=="string"?Dt.multi||Dt.includeAll?this.getQueryModel().quoteLiteral(Ye):String(Ye).replace(/'/g,"''"):typeof Ye=="number"?Ye:Array.isArray(Ye)?Ye.map(Gt=>this.getQueryModel().quoteLiteral(Gt)).join(","):Ye,this.name=pt.name,this.responseParser=new u,this.id=pt.id;const Ct=pt.jsonData||{};this.interval=Ct.timeInterval||"1m",this.db=this.getDB(),this.preconfiguredDatabase=Ct.database??"",this.annotations={prepareAnnotation:M,QueryEditor:N}}getResponseParser(){return this.responseParser}interpolateVariablesInQueries(pt,mt){let Ct=pt;return pt&&pt.length>0&&(Ct=pt.map(Ye=>({...Ye,datasource:this.getRef(),rawSql:this.templateSrv.replace(Ye.rawSql,mt,this.interpolateVariable),rawQuery:!0}))),Ct}filterQuery(pt){return!pt.hide}applyTemplateVariables(pt,mt){return{refId:pt.refId,datasource:this.getRef(),rawSql:this.templateSrv.replace(pt.rawSql,mt,this.interpolateVariable),format:pt.format}}query(pt){const mt=this.checkForDatabaseIssue(pt);if(mt){const Ct=new Error(mt);return(0,o.$)(()=>Ct)}return pt.targets.forEach(Ct=>{pt.app===h.Jk.Dashboard||pt.app===h.Jk.PanelViewer||(0,p.rR)("grafana_sql_query_executed",{datasource:Ct.datasource?.type,editorMode:Ct.editorMode,format:Ct.format,app:pt.app})}),super.query(pt)}checkForDatabaseIssue(pt){if(this.type==="grafana-postgresql-datasource"&&!this.preconfiguredDatabase)return`You do not currently have a default database configured for this data source. Postgres requires a default database with which to connect. Please configure one through the Data Sources Configuration page, or if you are using a provisioning file, update that configuration file with a default database.`;if(pt.app!==h.Jk.Explore&&this.preconfiguredDatabase){for(const mt of pt.targets)if(mt.editorMode===v.lX.Builder&&mt.dataset&&mt.dataset!==this.preconfiguredDatabase)return`The configuration for this panel's data source has been modified. The previous database used in this panel's saved query is no longer available. Please update the query to use the new database option. Previous query parameters will be preserved until the query is updated.`}}async metricFindQuery(pt,mt){const Ct=mt?.range;if(Ct==null)return[];let Ye="tempvar";mt&&mt.variable&&mt.variable.name&&(Ye=mt.variable.name);const Dt={...mt?.scopedVars,...(0,d.c)({query:pt,wildcardChar:"%",options:mt})},Lt=this.templateSrv.replace(pt,Dt,this.interpolateVariable),Gt={refId:Ye,datasource:this.getRef(),rawSql:Lt,format:t.gv.Table};let qt;try{qt=await this.runMetaQuery(Gt,Ct)}catch(on){throw console.error(on),new Error("error when executing the sql query")}return this.getResponseParser().transformMetricFindResponse(qt)}async runSql(pt,mt){const Ct=(0,s.E2)(),Ye=await this.runMetaQuery({rawSql:pt,format:t.gv.Table,refId:mt?.refId},Ct);return new g.R(Ye)}runMetaQuery(pt,mt){const Ct=pt.refId||"meta",Ye=[{...pt,datasource:pt.datasource||this.getRef(),refId:Ct}];return(0,l.s)((0,y.AI)().fetch({url:"/api/ds/query",method:"POST",headers:this.getRequestHeaders(),data:{from:mt.from.valueOf().toString(),to:mt.to.valueOf().toString(),queries:Ye},requestId:Ct}).pipe((0,f.T)(Dt=>(0,E.bE)(Dt,Ye).data[0]??{fields:[]})))}targetContainsTemplate(pt){let mt=pt.rawSql;return i.forEach(Ct=>{mt=mt?.replace(Ct,"")||""}),this.templateSrv.containsTemplate(mt)}}var U=e(52308),K,z,G;function F({value:rt,defaultValue:pt,onChange:mt,width:Ct}){const[Ye,Dt]=z(!1);return K(G,{type:"number",placeholder:String(pt),value:Ye?"":rt,onChange:Lt=>{if(Lt.currentTarget.value?.trim()==="")Dt(!0),mt(pt);else{Dt(!1);const Gt=Number(Lt.currentTarget.value);Number.isNaN(Gt)||mt(Gt)}},width:Ct})}var W,H,Y,te,Z,se,ae,J,k,_;function Q({labelWidth:rt,onMaxLifetimeChanged:pt,jsonData:mt}){return W(k,{label:W(J,{children:H(ae,{gap:.5,children:[W("span",{children:W(Y,{i18nKey:"grafana-sql.components.connection-limits.max-lifetime",children:"Max lifetime"})}),W(se,{content:W("span",{children:W(Y,{i18nKey:"grafana-sql.components.connection-limits.content-max-lifetime",children:"The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever."})}),children:W(Z,{name:"info-circle",size:"sm"})})]})}),children:W(_,{value:mt.connMaxLifetime,defaultValue:te.sqlConnectionLimits.connMaxLifetime,onChange:pt,width:rt})})}var q,oe,re,ee,B,ie,de,fe,ce,ve;function Se({labelWidth:rt,onMaxConnectionsChanged:pt,jsonData:mt}){return q(ce,{label:q(fe,{children:oe(de,{gap:.5,children:[q("span",{children:q(re,{i18nKey:"grafana-sql.components.connection-limits.max-open",children:"Max open"})}),q(ie,{content:q("span",{children:oe(re,{i18nKey:"grafana-sql.components.connection-limits.content-max-open",children:["The maximum number of open connections to the database. If ",q("i",{children:"Max idle connections"})," is greater than 0 and the ",q("i",{children:"Max open connections"})," is less than ",q("i",{children:"Max idle connections"}),", then",q("i",{children:"Max idle connections"})," will be reduced to match the ",q("i",{children:"Max open connections"})," limit. If set to 0, there is no limit on the number of open connections."]})}),children:q(B,{name:"info-circle",size:"sm"})})]})}),children:q(ve,{value:mt.maxOpenConns,defaultValue:ee.sqlConnectionLimits.maxOpenConns,onChange:pt,width:rt})})}var je,Ve,he,Ue,pe,be,ze,Ne,Ie,ke,Ee,Ae,$e,Fe,We,Ge;const me=rt=>{const{onOptionsChange:pt,options:mt}=rt,Ct=mt.jsonData,Ye=Ct.maxIdleConnsAuto!==void 0?Ct.maxIdleConnsAuto:!1,Dt=Pn=>{const Sn={...mt,jsonData:{...Ct,...Pn}};return pt(Sn)},Lt=Pn=>Sn=>{Dt({[Pn]:Sn})},Gt=Pn=>{Dt(Ye&&Pn?{maxOpenConns:Pn,maxIdleConns:Pn}:{maxOpenConns:Pn})},qt=()=>{let Pn,Sn;Ye?(Sn=Ct.maxOpenConns,Pn=Ct.maxIdleConns):Ct.maxOpenConns!==void 0&&(Sn=Ct.maxOpenConns,Pn=Ct.maxOpenConns),Dt({maxIdleConnsAuto:!Ye,maxIdleConns:Pn,maxOpenConns:Sn})},on=40;return je(pe,{title:he("grafana-sql.components.connection-limits.title-connection-limits","Connection limits"),children:[Ve(We,{labelWidth:on,onMaxConnectionsChanged:Gt,jsonData:Ct}),Ve(Ee,{label:Ve(ke,{children:je(Ie,{gap:.5,children:[Ve("span",{children:Ve(Ue,{i18nKey:"grafana-sql.components.connection-limits.auto-max-idle",children:"Auto max idle"})}),Ve(Ne,{content:Ve("span",{children:je(Ue,{i18nKey:"grafana-sql.components.connection-limits.content-auto-max-idle",values:{defaultMaxIdle:be.sqlConnectionLimits.maxIdleConns},children:["If enabled, automatically set the number of ",Ve("i",{children:"Maximum idle connections"})," to the same value as",Ve("i",{children:" Max open connections"}),". If the number of maximum open connections is not set it will be set to the default (","{{defaultMaxIdle}}",")."]})}),children:Ve(ze,{name:"info-circle",size:"sm"})})]})}),children:Ve($e,{value:Ye,onChange:qt})}),Ve(Ee,{label:Ve(ke,{children:je(Ie,{gap:.5,children:[Ve("span",{children:Ve(Ue,{i18nKey:"grafana-sql.components.connection-limits.max-idle",children:"Max idle"})}),Ve(Ne,{content:Ve("span",{children:je(Ue,{i18nKey:"grafana-sql.components.connection-limits.content-max-idle",children:["The maximum number of connections in the idle connection pool.If ",Ve("i",{children:"Max open connections"})," is greater than 0 but less than the ",Ve("i",{children:"Max idle connections"}),", then the ",Ve("i",{children:"Max idle connections"})," ","will be reduced to match the ",Ve("i",{children:"Max open connections"})," limit. If set to 0, no idle connections are retained."]})}),children:Ve(ze,{name:"info-circle",size:"sm"})})]})}),children:Ye?Ve(Ae,{width:on,children:mt.jsonData.maxIdleConns}):Ve(Ge,{value:Ct.maxIdleConns,defaultValue:be.sqlConnectionLimits.maxIdleConns,onChange:Pn=>{Lt("maxIdleConns")(Pn)},width:on})}),Ve(Fe,{labelWidth:on,onMaxLifetimeChanged:Lt("connMaxLifetime"),jsonData:Ct})]})};var De,xe,Me;const Be=()=>{const rt=Me(Oe);return De("hr",{className:rt.horizontalDivider})},Oe=rt=>({horizontalDivider:xe({borderTop:`1px solid ${rt.colors.border.weak}`,margin:rt.spacing(2,0),width:"100%"})});var Re,we,Ce,_e,Je,et,qe,nt,ot,Ze,at,it;const ct=rt=>{const{editorProps:pt,showCACert:mt,showKeyPair:Ct=!0}=rt,{secureJsonFields:Ye}=pt.options;return Re(we,{children:[Ct?Ce(it,{label:Ce(at,{children:Re(Ze,{gap:.5,children:[Ce("span",{children:Ce(et,{i18nKey:"grafana-sql.components.tlssecrets-config.tlsssl-client-certificate",children:"TLS/SSL Client Certificate"})}),Ce(ot,{content:Ce("span",{children:Ce(et,{i18nKey:"grafana-sql.components.tlssecrets-config.content-tlsssl-client-certificate",children:"To authenticate with an TLS/SSL client certificate, provide the client certificate here."})}),children:Ce(nt,{name:"info-circle",size:"sm"})})]})}),children:Ce(qe,{placeholder:"-----BEGIN CERTIFICATE-----",cols:45,rows:7,isConfigured:Ye&&Ye.tlsClientCert,onChange:_e(pt,"tlsClientCert"),onReset:()=>{Je(pt,"tlsClientCert")}})}):null,mt?Ce(it,{label:Ce(at,{children:Re(Ze,{gap:.5,children:[Ce("span",{children:Ce(et,{i18nKey:"grafana-sql.components.tlssecrets-config.tlsssl-root-certificate",children:"TLS/SSL Root Certificate"})}),Ce(ot,{content:Ce("span",{children:Ce(et,{i18nKey:"grafana-sql.components.tlssecrets-config.content-tlsssl-root-certificate",children:"If the selected TLS/SSL mode requires a server root certificate, provide it here"})}),children:Ce(nt,{name:"info-circle",size:"sm"})})]})}),children:Ce(qe,{placeholder:"-----BEGIN CERTIFICATE-----",cols:45,rows:7,isConfigured:Ye&&Ye.tlsCACert,onChange:_e(pt,"tlsCACert"),onReset:()=>{Je(pt,"tlsCACert")}})}):null,Ct?Ce(it,{label:Ce(at,{children:Re(Ze,{gap:.5,children:[Ce("span",{children:Ce(et,{i18nKey:"grafana-sql.components.tlssecrets-config.tlsssl-client-key",children:"TLS/SSL Client Key"})}),Ce(ot,{content:Ce("span",{children:Ce(et,{i18nKey:"grafana-sql.components.tlssecrets-config.content-tlsssl-client-key",children:"To authenticate with a client TLS/SSL certificate, provide the key here."})}),children:Ce(nt,{name:"info-circle",size:"sm"})})]})}),children:Ce(qe,{placeholder:"-----BEGIN RSA PRIVATE KEY-----",cols:45,rows:7,isConfigured:Ye&&Ye.tlsClientKey,onChange:_e(pt,"tlsClientKey"),onReset:()=>{Je(pt,"tlsClientKey")}})}):null]})};var xt=e(25992);const dt=(0,xt.DW)("features.plugins.sql");var vt,wt,$t;function _t({onOptionsChange:rt,options:pt}){vt(()=>{const mt=pt.jsonData;let Ct={...pt},Ye=!1;if(pt.database&&($t.logDebug(`Migrating from options.database with value ${pt.database} for ${pt.name}`),Ct.database="",Ct.jsonData={...mt,database:pt.database},Ye=!0),mt.maxOpenConns===void 0&&mt.maxIdleConns===void 0&&mt.maxIdleConnsAuto===void 0){const{maxOpenConns:Dt,maxIdleConns:Lt}=wt.sqlConnectionLimits;$t.logDebug(`Setting default max open connections to ${Dt} and setting max idle connection to ${Lt}`),Ct.jsonData={...Ct.jsonData,maxOpenConns:Dt,maxIdleConns:Lt,maxIdleConnsAuto:!0},Ye=!0}if(mt.connMaxLifetime===void 0){const{connMaxLifetime:Dt}=wt.sqlConnectionLimits;Ct.jsonData={...Ct.jsonData,connMaxLifetime:Dt},Ye=!0}Ye&&rt(Ct)},[rt,pt])}var tn=e(25274),gt=e(36656),Wt=e(22480);const Xt=Wt.Y.reduce((rt,pt)=>(rt[pt.code]=async()=>await e(55644)(`./${pt.code}/grafana-sql.json`),rt),{}),dn=async rt=>(await Xt[rt]()).default},11194(ne,A,e){"use strict";e.d(A,{cO:()=>a,gv:()=>n,zL:()=>r});var t=e(47184),n=(i=>(i.Timeseries="time_series",i.Table="table",i))(n||{});const a=[{label:"Time series",value:"time_series"},{label:"Table",value:"table"}],c=i=>({label:i,value:i}),r=t.z??c},52308(ne,A,e){"use strict";e.d(A,{s:()=>n});var t=e(27633);function n(a){return t.Ay.format(a).replace(/(\$ \{ .* \})|(\$ __)|(\$ \w+)/g,c=>c.replace(/\s/g,""))}},25274(ne,A,e){"use strict";e.d(A,{JD:()=>o,Kj:()=>i,YW:()=>c,oF:()=>a,oG:()=>l,xG:()=>r});var t=e(47184),n=e(36656);function a(f){return`SELECT ${f.map(d=>{let s="";return d.name&&d.alias?s+=`${d.name}(${d.parameters?.map(g=>`${g.name}`)}) AS ${d.alias}`:d.name?s+=`${d.name}(${d.parameters?.map(g=>`${g.name}`)})`:d.alias?s+=`${d.parameters?.map(g=>`${g.name}`)} AS ${d.alias}`:s+=`${d.parameters?.map(g=>`${g.name}`)}`,s}).join(", ")} `}const c=f=>{if(!f)return!1;const h=f.some(s=>s.parameters?.length||s.parameters?.some(g=>g.name)),d=f.some(s=>s.name);return h||d};function r(f){return{type:n._.GroupBy,property:{type:n.D.String,name:f}}}function i(f){return{type:n._.Property,property:{type:n.D.String,name:f}}}function o(f){return{type:n._.Function,name:f,parameters:[]}}function l(f){return f?.name?(0,t.z)(f.name):null}},31210(ne,A,e){"use strict";e.d(A,{r:()=>l});var t=e(74848),n=e(96540),a=e(92745),c=e(63142),r=e(45861),i=e(71599),o=e(81538);function l({action:f,...h}){const d=(0,c.$j)(),s=f.style.backgroundColor||d.colors.secondary.main,g=d.colors.getContrastText(s),[v,x]=(0,n.useState)(!1),[m,p]=(0,n.useState)(!1),[y,E]=(0,n.useState)({}),b=f.variables&&f.variables.length>0,u=()=>{b?p(!0):x(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.$n,{variant:"primary",size:"sm",onClick:u,...h,style:{width:"fit-content",backgroundColor:s,color:g},children:f.title}),b&&m&&(0,t.jsx)(o.b,{onDismiss:()=>p(!1),action:f,onShowConfirm:()=>x(!0),variables:y,setVariables:E}),v&&(0,t.jsx)(i.u,{isOpen:!0,title:(0,a.t)("grafana-ui.action-editor.button.confirm-action","Confirm action"),body:f.confirmation(y),confirmText:(0,a.t)("grafana-ui.action-editor.button.confirm","Confirm"),confirmButtonVariant:"primary",onConfirm:()=>{x(!1),f.onClick(new MouseEvent("click"),null,y)},onDismiss:()=>{x(!1)}})]})}},81538(ne,A,e){"use strict";e.d(A,{b:()=>h});var t=e(74848),n=e(22803),a=e(92745),c=e(63142),r=e(45861),i=e(37386),o=e(16780),l=e(63527),f=e(22787);function h({action:s,onDismiss:g,onShowConfirm:v,variables:x,setVariables:m}){const p=(0,c.of)(d),y=()=>{g(),v()};return(0,t.jsxs)(f.a,{isOpen:!0,title:(0,a.t)("grafana-ui.action-editor.button.action-variables-title","Action variables"),onDismiss:g,className:p.variablesModal,children:[(0,t.jsx)(o.n,{children:s.variables.map(E=>(0,t.jsx)(i.D,{label:E.name,children:(0,t.jsx)(l.p,{type:"text",value:x[E.key]??"",onChange:b=>{m({...x,[E.key]:b.currentTarget.value})},placeholder:(0,a.t)("grafana-ui.action-editor.button.variable-value-placeholder","Value"),width:20})},E.name))}),(0,t.jsxs)(f.a.ButtonRow,{children:[(0,t.jsx)(r.$n,{variant:"secondary",onClick:g,children:(0,a.t)("grafana-ui.action-editor.close","Close")}),(0,t.jsx)(r.$n,{variant:"primary",onClick:y,children:(0,a.t)("grafana-ui.action-editor.continue","Continue")})]})]})}const d=()=>({variablesModal:(0,n.css)({zIndex:1e4})})},34999(ne,A,e){"use strict";e.d(A,{F:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(51898),r=e(92745),i=e(63142),o=e(45861),l=e(30703),f=e(31286),h=e(66404);const d=a.forwardRef(({title:v,onRemove:x,children:m,buttonContent:p,elevated:y,bottomSpacing:E,topSpacing:b,className:u,severity:D="error",...P},C)=>{const S=(0,i.$j)(),L=g(S,D,!!v,y,E,b),j={error:"alert",warning:"alert",info:"status",success:"status"},N=P.role||j[D],V=P["aria-label"]||v,w=(0,r.t)("grafana-ui.alert.close-button","Close alert");return(0,t.jsx)("div",{ref:C,className:(0,n.cx)(L.wrapper,u),role:N,"aria-label":V,...P,children:(0,t.jsxs)(f.a,{"data-testid":c.Tp.components.Alert.alertV2(D),display:"flex",backgroundColor:D,borderRadius:"default",paddingY:1,paddingX:2,borderStyle:"solid",borderColor:D,alignItems:"stretch",boxShadow:y?"z3":void 0,children:[(0,t.jsx)(f.a,{paddingTop:1,paddingRight:2,children:(0,t.jsx)("div",{className:L.icon,children:(0,t.jsx)(l.I,{size:"xl",name:s(D)})})}),(0,t.jsxs)(f.a,{paddingY:1,grow:1,children:[(0,t.jsx)(h.E,{color:"primary",weight:"medium",children:v}),m&&(0,t.jsx)("div",{className:L.content,children:m})]}),x&&!p&&(0,t.jsx)("div",{className:L.close,children:(0,t.jsx)(o.$n,{"aria-label":w,icon:"times",onClick:x,type:"button",fill:"text",variant:"secondary"})}),x&&p&&(0,t.jsx)(f.a,{marginLeft:1,display:"flex",alignItems:"center",children:(0,t.jsx)(o.$n,{"aria-label":w,variant:"secondary",onClick:x,type:"button",children:p})})]})})});d.displayName="Alert";const s=v=>{switch(v){case"error":return"exclamation-circle";case"warning":return"exclamation-triangle";case"info":return"info-circle";case"success":return"check"}},g=(v,x,m,p,y,E)=>{const b=v.colors[x];return{wrapper:(0,n.css)({flexGrow:1,marginBottom:v.spacing(y??2),marginTop:v.spacing(E??0),position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,bottom:0,right:0,background:v.colors.background.primary,zIndex:-1}}),icon:(0,n.css)({color:b.text,position:"relative",top:"-1px"}),content:(0,n.css)({color:v.colors.text.primary,paddingTop:m?v.spacing(.5):0,maxHeight:"50vh",overflowY:"auto"}),close:(0,n.css)({position:"relative",color:v.colors.text.secondary,background:"none",display:"flex",top:"-6px",right:"-14px"})}}},99887(ne,A,e){"use strict";e.d(A,{E:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(70255),r=e(84140),i=e(63142),o=e(21348),l=e(30703),f=e(45967);const h=a.memo(({icon:x,color:m,text:p,tooltip:y,className:E,...b})=>{const u=(0,i.of)(v,m),D=(0,t.jsxs)("div",{className:(0,n.cx)(u.wrapper,E),...b,children:[x&&(0,t.jsx)(l.I,{name:x,size:"sm"}),p]});return y?(0,t.jsx)(f.m,{content:y,placement:"auto",children:D}):D});h.displayName="Badge";const d=({rootProps:x})=>{const m=(0,i.of)(g);return(0,t.jsx)(c.A,{width:60,height:22,containerClassName:m.container,...x})},s=(0,o.j)(h,d),g=()=>({container:(0,n.css)({lineHeight:1})}),v=(x,m)=>{let p=x.visualization.getColorByName(m),y="",E="",b="";return x.isDark?(E=(0,r.A)(p).setAlpha(.15).toString(),y=(0,r.A)(p).setAlpha(.25).toString(),b=(0,r.A)(p).lighten(15).toString()):(E=(0,r.A)(p).setAlpha(.15).toString(),y=(0,r.A)(p).setAlpha(.25).toString(),b=(0,r.A)(p).darken(20).toString()),m==="brand"&&(E=x.colors.gradients.brandHorizontal,y="transparent",b=x.colors.primary.contrastText),{wrapper:(0,n.css)({display:"inline-flex",padding:"1px 4px",borderRadius:x.shape.radius.sm,background:E,border:`1px solid ${y}`,color:b,fontWeight:x.typography.fontWeightRegular,gap:x.spacing(.5),fontSize:x.typography.bodySmall.fontSize,lineHeight:x.typography.bodySmall.lineHeight,alignItems:"center"})}}},98005(ne,A,e){"use strict";e.d(A,{xE:()=>P});var t=e(74848),n=e(22803),a=e(96540),c=e(84140),r=e(76637),i=e(55386),o=e(64394),l=e(33553),f=e(38919),h=e(48588),d=e(51898),s=e(739),g=e(53568),v=e(45861),x=e(21539);const m=18,p=50,y=150,E=1.5,b=1,u=10,D=15;class P extends a.PureComponent{static{this.defaultProps={lcdCellWidth:12,value:{text:"100",numeric:100},displayMode:s.eX.Gradient,orientation:f.wV.Horizontal,field:{min:0,max:100,thresholds:{mode:l.O.Absolute,steps:[]}},itemSpacing:8,showUnfilled:!0,isOverflow:!1}}render(){const{onClick:K,className:z,theme:G}=this.props,{title:F}=this.props.value,W=R(this.props);return K?(0,t.jsxs)("button",{type:"button",style:W.wrapper,onClick:K,className:(0,n.cx)((0,v.my)(G),z),children:[(0,t.jsx)("div",{style:W.title,children:F}),this.renderBarAndValue()]}):(0,t.jsxs)("div",{style:W.wrapper,className:z,children:[F&&(0,t.jsx)("div",{style:W.title,children:F}),this.renderBarAndValue()]})}renderBarAndValue(){switch(this.props.displayMode){case"lcd":return this.renderRetroBars();case"basic":case"gradient":default:return this.renderBasicAndGradientBars()}}renderBasicAndGradientBars(){const{value:K,showUnfilled:z,valueDisplayMode:G}=this.props,F=V(this.props);return(0,t.jsxs)("div",{style:F.wrapper,children:[G!==s.$l.Hidden&&(0,t.jsx)(x.i,{"data-testid":d.Tp.components.Panels.Visualization.BarGauge.valueV2,value:K,style:F.value}),z&&(0,t.jsx)("div",{style:F.emptyBar}),(0,t.jsx)("div",{style:F.bar})]})}renderRetroBars(){const{display:K,field:z,value:G,itemSpacing:F,alignmentFactors:W,orientation:H,lcdCellWidth:Y,text:te,valueDisplayMode:Z,isOverflow:se}=this.props,{valueHeight:ae,valueWidth:J,maxBarHeight:k,maxBarWidth:_,wrapperWidth:Q,wrapperHeight:q}=L(this.props),oe=z.min??h.tw,re=z.max??h.d1,ee=C(H),B=re-oe,ie=ee?k:_,de=F,fe=Math.floor(ie/Y),ce=Math.floor((ie-de*fe)/fe),ve=M(this.props),je=O(W||G,ve,J,ae,H,se,te),Ve={width:`${Q}px`,height:`${q}px`,display:"flex"};ee?(Ve.flexDirection="column-reverse",Ve.alignItems="center"):(Ve.flexDirection="row",Ve.alignItems="center",je.justifyContent="flex-end");const he=[];for(let Ue=0;Ue40&&H===s.TZ.Auto||H===s.TZ.Top){if(W?.titleSize)return{fontSize:W?.titleSize,width:0,height:W.titleSize*E,placement:"above"};const Q=Math.max(Math.min(K*.45,p),17);return{fontSize:Q/E,width:0,height:Q,placement:"above"}}const ae=Math.max(K*.6,m)/E,J=(0,g.kD)(Y,ae),k=Math.min(J.width+15,z*.4);return{fontSize:W?.titleSize??ae,height:0,width:k,placement:"left"}}function R(U){const K={display:"flex",overflow:"hidden",width:"100%"},z=S(U),G={fontSize:`${z.fontSize}px`,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",alignItems:"center",alignSelf:"center"};return z.placement==="hidden"?G.display="none":C(U.orientation)?(K.flexDirection="column-reverse",G.textAlign="center"):z.placement==="above"?K.flexDirection="column":(K.flexDirection="row",G.width=`${z.width}px`,G.textAlign="right",G.paddingRight="10px"),{wrapper:K,title:G}}function L(U){const{height:K,width:z,orientation:G,text:F,alignmentFactors:W,valueDisplayMode:H}=U,Y=S(U),te=W??U.value,Z=(0,i.cN)(te);let se=0,ae=0,J=0,k=0,_=0,Q=0;const q=F?.valueSize??Math.max(Y.fontSize,12),re=(0,g.kD)(Z,q).width+u*2;return C(G)?(F?.valueSize?J=F.valueSize*b:J=Math.min(Math.max(K*.1,m),p),k=z,H===s.$l.Hidden&&(J=0,k=0),se=K-(Y.height+J),ae=z,_=z,Q=K-Y.height):(H===s.$l.Hidden?(J=0,k=0):(J=K-Y.height,k=Math.max(Math.min(z*.2,y),re)),se=K-Y.height,ae=z-k-Y.width,Y.placement==="above"?(_=z,Q=K-Y.height):(_=z-Y.width,Q=K)),{valueWidth:k,valueHeight:J,maxBarWidth:ae,maxBarHeight:se,wrapperHeight:Q,wrapperWidth:_}}function j(U,K,z){if(U===null)return{background:o.F,border:o.F};const G=z?z(U).color:null;return G?K===null||isNaN(K.numeric)||U!==null&&U>K.numeric?{background:(0,c.A)(G).setAlpha(.18).toRgbString(),border:"transparent",isLit:!1}:{background:(0,c.A)(G).setAlpha(.95).toRgbString(),backgroundShade:(0,c.A)(G).setAlpha(.55).toRgbString(),border:(0,c.A)(G).setAlpha(.9).toRgbString(),isLit:!0}:{background:o.F,border:o.F}}function N(U,K,z){const G=Math.min((U-K)/(z-K),1);return isNaN(G)?0:G}function V(U){const{displayMode:K,field:z,value:G,alignmentFactors:F,orientation:W,theme:H,text:Y,isOverflow:te}=U,{valueWidth:Z,valueHeight:se,maxBarHeight:ae,maxBarWidth:J}=L(U),k=z.min??h.tw,_=z.max??h.d1,Q=N(G.numeric,k,_),q=M(U),oe=G.color??o.F,ee=O(F||G,q,Z,se,W,te,Y),B=K==="basic",ie={display:"flex",flexGrow:1},de={borderRadius:H.shape.radius.sm,position:"relative"},fe={background:H.colors.background.secondary,flexGrow:1,display:"flex",borderRadius:H.shape.radius.sm,position:"relative"};if(C(W)){const ce=Math.max(Q*ae,1);ie.flexDirection="column",ie.justifyContent="flex-end",de.transition="height 1s",de.height=`${ce}px`,de.width=`${J}px`,fe.bottom="-3px",fe.width=`${Z}px`,B?(de.background=`${(0,c.A)(oe).setAlpha(.35).toRgbString()}`,de.borderTop=`2px solid ${oe}`):de.background=w(U,ae)}else{const ce=Math.max(Q*J,1);ie.flexDirection="row-reverse",ie.justifyContent="flex-end",ie.alignItems="stretch",de.transition="width 1s",de.height=`${ae}px`,de.width=`${ce}px`,fe.left="-3px",fe.height=`${se}px`,B?(de.background=`${(0,c.A)(oe).setAlpha(.35).toRgbString()}`,de.borderRight=`2px solid ${oe}`):de.background=w(U,J)}return{wrapper:ie,bar:de,value:ee,emptyBar:fe}}function w(U,K){const{field:z,value:G,orientation:F,theme:W}=U,H=C(F)?"0deg":"90deg",Y=z.min,te=z.max;let Z="",se=0,ae=(0,r.Hs)(z.color?.mode);if(ae.id===o.Y.Thresholds){const J=z.thresholds;for(let k=0;kM,yp:()=>j,$p:()=>N,F8:()=>V,SV:()=>w});var t=e(74848),n=e(22803),a=e(96540),c=e(45861),r=e(21539),i=e(84140),o=e(95004),l=e(55386),f=e(739),h=e(8255),d=e(53568),s=e(53431),g=e(30703);const v=({percentChange:O,styles:U})=>{let K;return O>0?K="arrow-up":O<0&&(K="arrow-down"),(0,t.jsxs)("div",{style:U.containerStyles,children:[K&&(0,t.jsx)(g.I,{name:K,height:U.iconSize,width:U.iconSize,viewBox:"6 6 12 12"}),x(O)]})},x=O=>(O/100).toLocaleString(void 0,{style:"percent",maximumSignificantDigits:3}),m=1.2,p=30,y=500;class E{constructor(U){this.props=U;const{width:K,height:z,value:G,text:F}=U;this.valueColor=G.color??"gray",this.panelPadding=z>100?12:8,this.textValues=R(U),this.justifyCenter=S(U.justifyMode,this.textValues.title),this.valueToAlignTo=this.textValues.valueToAlignTo,this.titleToAlignTo=this.textValues.titleToAlignTo,this.titleFontSize=0,this.valueFontSize=0,this.percentFontSize=0,this.chartHeight=0,this.chartWidth=0,this.maxTextWidth=K-this.panelPadding*2,this.maxTextHeight=z-this.panelPadding*2,F&&(F.titleSize&&(this.titleFontSize=F.titleSize,this.titleToAlignTo=void 0),F.valueSize&&(this.valueFontSize=F.valueSize,this.valueToAlignTo=""),F.percentSize&&(this.percentFontSize=F.percentSize))}getTitleStyles(){const U={fontSize:`${this.titleFontSize}px`,lineHeight:m};return(this.props.colorMode===j.Background||this.props.colorMode===j.BackgroundSolid)&&(U.color=(0,h.mZ)(this.valueColor,this.props.theme.isDark)),U}getValueStyles(){const U={fontSize:this.valueFontSize,fontWeight:y,lineHeight:m,position:"relative",zIndex:1};switch(this.justifyCenter&&(U.textAlign="center"),this.props.colorMode){case j.Value:U.color=this.valueColor;break;case j.Background:case j.BackgroundSolid:U.color=(0,h.mZ)(this.valueColor,this.props.theme.isDark);break;case j.None:U.color=this.props.theme.colors.text.primary;break}return U}getPercentChangeStyles(U,K,z){const F=this.getValueAndTitleContainerStyles(),W=this.percentFontSize||Math.max(this.valueFontSize/2.5,12);let H=this.percentFontSize?this.percentFontSize-3:Math.max(this.valueFontSize/3,10);const Y=this.props.theme.visualization,te=L(U,K,z,Y),Z={fontSize:W,fontWeight:y,lineHeight:m,position:"relative",display:"flex",alignItems:"center",gap:Math.max(W/3,4),zIndex:1,color:te};switch(this.justifyCenter&&(Z.textAlign="center"),F.flexDirection==="column"&&W>12&&(Z.marginTop=-(W/4)),F.flexDirection==="row"&&(Z.alignItems="baseline",Z.lineHeight=m*2.5),this.props.colorMode){case j.Background:case j.BackgroundSolid:Z.color=(0,h.mZ)(this.valueColor,this.props.theme.isDark);break}return this.props.textMode===w.None&&(Z.fontSize=(0,d.Vr)(x(U),this.maxTextWidth*.8,this.maxTextHeight*.8,m,void 0,y),H=Z.fontSize*.8),{containerStyles:Z,iconSize:H}}getValueAndTitleContainerStyles(){const U={display:"flex",flexWrap:"wrap"};return this.justifyCenter&&(U.alignItems="center",U.justifyContent="center",U.flexGrow=1,U.gap="0.75ch"),U}getPanelStyles(){const{width:U,height:K,theme:z,colorMode:G,textMode:F}=this.props,W={width:`${U}px`,height:`${K}px`,padding:`${F===w.None?2:this.panelPadding}px`,position:"relative",display:"flex"},H=z.isDark?1:-.7;switch(G){case j.Background:const Y=(0,i.A)(this.valueColor).darken(15*H).spin(8).toRgbString(),te=(0,i.A)(this.valueColor).darken(5*H).spin(-8).toRgbString();W.background=`linear-gradient(120deg, ${Y}, ${te})`;break;case j.BackgroundSolid:W.background=(0,i.A)(this.valueColor).toString();break;case j.Value:W.background="transparent";break}return this.justifyCenter&&(W.alignItems="center",W.flexDirection="row"),W}renderChart(){const{sparkline:U,colorMode:K}=this.props;if(!U||U.y?.type!==o.PU.number)return null;let z,G;switch(K){case j.Background:case j.BackgroundSolid:z="rgba(255,255,255,0.4)",G=(0,i.A)(this.valueColor).brighten(40).toRgbString();break;case j.None:case j.Value:default:G=this.valueColor,z=(0,i.A)(this.valueColor).setAlpha(.2).toRgbString();break}const F={custom:{drawStyle:f.GR.Line,lineWidth:1,fillColor:z,lineColor:G}};return(0,t.jsx)("div",{style:this.getChartStyles(),children:(0,t.jsx)(s.O,{height:this.chartHeight,width:this.chartWidth,sparkline:U,config:F,theme:this.props.theme})})}getChartStyles(){return{position:"absolute",right:0,bottom:0}}}class b extends E{constructor(U){super(U);const K=this.titleToAlignTo?.length?.3:1;if(this.valueToAlignTo.length){let z=this.maxTextHeight;U.value.percentChange!=null&&(z=z*.75),this.valueFontSize=(0,d.Vr)(this.valueToAlignTo,this.maxTextWidth*K,z,m,void 0,y)}this.titleToAlignTo?.length&&(this.titleFontSize=(0,d.Vr)(this.titleToAlignTo,this.maxTextWidth*.6,this.maxTextHeight,m,p),this.titleFontSize=Math.min(this.valueFontSize*.7,this.titleFontSize))}getValueAndTitleContainerStyles(){const U=super.getValueAndTitleContainerStyles();return U.flexDirection="row",U.alignItems="center",U.flexGrow=1,this.justifyCenter||(U.justifyContent="space-between"),U}renderChart(){return null}getPanelStyles(){const U=super.getPanelStyles();return U.alignItems="center",U}}class u extends E{constructor(U){super(U);const{width:K,height:z}=U,G=.5,F=.6,W=1-F,H=.4;this.chartWidth=K,this.chartHeight=z*G,this.titleToAlignTo?.length&&(this.titleFontSize=(0,d.Vr)(this.titleToAlignTo,this.maxTextWidth*F,this.maxTextHeight*H,m,p)),this.valueToAlignTo.length&&(this.valueFontSize=(0,d.Vr)(this.valueToAlignTo,this.maxTextWidth*W,this.maxTextHeight*G,m,void 0,y))}getValueAndTitleContainerStyles(){const U=super.getValueAndTitleContainerStyles();return U.flexDirection="row",U.flexGrow=1,this.justifyCenter||(U.justifyContent="space-between"),U}getPanelStyles(){const U=super.getPanelStyles();return U.flexDirection="row",U.justifyContent="space-between",U}}class D extends E{constructor(U){super(U);const{width:K,height:z}=U,G=.15,F=.25;let W=0;this.chartHeight=z*F,this.chartWidth=K,this.titleToAlignTo?.length&&(this.titleFontSize=(0,d.Vr)(this.titleToAlignTo,this.maxTextWidth,z*G,m,p),W=this.titleFontSize*m),this.valueToAlignTo.length&&(this.valueFontSize=(0,d.Vr)(this.valueToAlignTo,this.maxTextWidth,this.maxTextHeight-this.chartHeight-W,m,void 0,y)),this.titleToAlignTo?.length&&(this.titleFontSize=Math.min(this.valueFontSize*.7,this.titleFontSize)),this.chartHeight=z-this.titleFontSize*m-this.valueFontSize*m}getValueAndTitleContainerStyles(){const U=super.getValueAndTitleContainerStyles();return U.flexDirection="column",U.justifyContent="center",U}getPanelStyles(){const U=super.getPanelStyles();return U.flexDirection="column",U}}class P extends E{constructor(U){super(U);const{height:K}=U,z=.15;let G=0;if(this.titleToAlignTo?.length&&(this.titleFontSize=(0,d.Vr)(this.titleToAlignTo,this.maxTextWidth,K*z,m,p),G=this.titleFontSize*m),this.valueToAlignTo.length){let F=this.maxTextHeight-G;U.value.percentChange!=null&&(F=F*.75),this.valueFontSize=(0,d.Vr)(this.valueToAlignTo,this.maxTextWidth,F,m,void 0,y)}this.titleToAlignTo?.length&&(this.titleFontSize=Math.min(this.valueFontSize*.7,this.titleFontSize))}getValueAndTitleContainerStyles(){const U=super.getValueAndTitleContainerStyles();return U.flexDirection="column",U.flexGrow=1,U}renderChart(){return null}getPanelStyles(){const U=super.getPanelStyles();return U.alignItems="center",U}}function C(O){const{width:U,height:K,sparkline:z}=O;return U/K>2.5&&!O.disableWideLayout?K>50&&z&&z.y.values.length>1?new u(O):new b(O):K>100&&z&&z.y.values.length>1?new D(O):new P(O)}function S(O,U){return O===V.Center?!0:(U??"").length===0}function R(O){const{value:U,alignmentFactors:K,count:z}=O;let{textMode:G}=O;const F=K?K.title:U.title,W=(0,l.cN)(K||U);switch(G===w.Auto&&(z??1)===1&&(G=w.Value),G){case w.Name:return{...U,title:void 0,prefix:void 0,suffix:void 0,text:U.title||"",titleToAlignTo:void 0,valueToAlignTo:F??"",tooltip:(0,l.cN)(U)};case w.Value:return{...U,title:void 0,titleToAlignTo:void 0,valueToAlignTo:W,tooltip:U.title};case w.None:return{numeric:U.numeric,color:U.color,title:void 0,text:"",titleToAlignTo:void 0,valueToAlignTo:"1",tooltip:`Name: ${U.title} Value: ${(0,l.cN)(U)}`};case w.ValueAndName:default:return{...U,titleToAlignTo:F,valueToAlignTo:W}}}function L(O,U,K,z){return U===f.CD.SameAsValue?K.color:O*(U===f.CD.Inverted?-1:1)>0?z.getColorByName("green"):z.getColorByName("red")}var j=(O=>(O.Background="background",O.BackgroundSolid="background_solid",O.None="none",O.Value="value",O))(j||{}),N=(O=>(O.None="none",O.Line="line",O.Area="area",O))(N||{}),V=(O=>(O.Auto="auto",O.Center="center",O))(V||{}),w=(O=>(O.Auto="auto",O.Value="value",O.ValueAndName="value_and_name",O.Name="name",O.None="none",O))(w||{});const M=(0,a.memo)(O=>{const{onClick:U,className:K,hasLinks:z,theme:G,justifyMode:F="auto"}=O,W=C({...O,justifyMode:F}),H=W.getPanelStyles(),Y=W.getValueAndTitleContainerStyles(),te=W.getValueStyles(),Z=W.getTitleStyles(),se=W.textValues,ae=O.value.percentChange,J=O.percentChangeColorMode,k=ae!=null&&!Number.isNaN(ae),_=z?void 0:se.tooltip;return U?(0,t.jsxs)("button",{type:"button",className:(0,n.cx)((0,c.my)(G),K),style:H,onClick:U,title:_,children:[(0,t.jsxs)("div",{style:Y,children:[se.title&&(0,t.jsx)("div",{style:Z,children:se.title}),(0,t.jsx)(r.i,{value:se,style:te})]}),W.renderChart()]}):(0,t.jsxs)("div",{className:K,style:H,title:_,children:[(0,t.jsxs)("div",{style:Y,children:[se.title&&(0,t.jsx)("div",{style:Z,children:se.title}),(0,t.jsx)(r.i,{value:se,style:te}),k&&(0,t.jsx)(v,{percentChange:ae,styles:W.getPercentChangeStyles(ae,J,te)})]}),W.renderChart()]})});M.displayName="BigValue"},88977(ne,A,e){"use strict";e.d(A,{J:()=>l});var t=e(74848),n=e(22803),a=e(96540),c=e(23257),r=e.n(c),i=e(63142),o=e(20662);const l=(0,a.forwardRef)(({name:h,value:d,hidden:s,facets:g,onClick:v,className:x,loading:m,searchTerm:p,active:y,style:E,title:b,highlightParts:u,...D},P)=>{const C=(0,i.$j)(),S=f(C),R=p?[p]:[],L=(0,a.useCallback)(N=>{v&&!s&&v(h,d,N)},[v,h,s,d]);let j=d||h;return g&&(j=`${j} (${g})`),(0,t.jsx)("button",{ref:P,onClick:L,style:E,title:b||j,type:"button",role:"option","aria-selected":!!y,className:(0,n.cx)(S.base,y&&S.active,m&&S.loading,s&&S.hidden,x,v&&!s&&S.hover),...D,children:u!==void 0?(0,t.jsx)(o.z,{text:j,highlightClassName:S.matchHighLight,highlightParts:u}):(0,t.jsx)(r(),{textToHighlight:j,searchWords:R,autoEscape:!0,highlightClassName:S.matchHighLight})},j)});l.displayName="Label";const f=h=>({base:(0,n.css)({display:"inline-block",cursor:"pointer",fontSize:h.typography.size.sm,lineHeight:h.typography.bodySmall.lineHeight,backgroundColor:h.colors.background.secondary,color:h.colors.text.primary,whiteSpace:"nowrap",textShadow:"none",padding:h.spacing(.5),borderRadius:h.shape.radius.default,border:"none",marginRight:h.spacing(1),marginBottom:h.spacing(.5)}),loading:(0,n.css)({fontWeight:h.typography.fontWeightMedium,backgroundColor:h.colors.primary.shade,color:h.colors.text.primary,[h.transitions.handleMotion("no-preference","reduce")]:{animation:"pulse 3s ease-out 0s infinite normal forwards"},"@keyframes pulse":{"0%":{color:h.colors.text.primary},"50%":{color:h.colors.text.secondary},"100%":{color:h.colors.text.disabled}}}),active:(0,n.css)({fontWeight:h.typography.fontWeightMedium,backgroundColor:h.colors.primary.main,color:h.colors.primary.contrastText}),matchHighLight:(0,n.css)({background:"inherit",color:h.components.textHighlight.text,backgroundColor:h.components.textHighlight.background}),hidden:(0,n.css)({opacity:.6,cursor:"default",border:"1px solid transparent"}),hover:(0,n.css)({"&:hover":{opacity:.85,cursor:"pointer"}})})},93256(ne,A,e){"use strict";e.d(A,{e:()=>r});var t=e(74848),n=e(22803),a=e(96540),c=e(63142);const r=(0,a.forwardRef)(({className:o,children:l,...f},h)=>{const d=(0,c.of)(i);return(0,t.jsx)("div",{ref:h,className:(0,n.cx)("button-group",d.wrapper,o),...f,children:l})});r.displayName="ButtonGroup";const i=o=>({wrapper:(0,n.css)({display:"flex",borderRadius:o.shape.radius.default,"> .button-group:not(:first-child) > button, > button:not(:first-child)":{borderTopLeftRadius:"unset",borderBottomLeftRadius:"unset",borderLeft:"1px solid rgba(255, 255, 255, 0.12)"},"> .button-group:not(:last-child) > button, > button:not(:last-child)":{borderTopRightRadius:"unset",borderBottomRightRadius:"unset",borderRight:"1px solid rgba(0, 0, 0, 0.12)"}})})},43951(ne,A,e){"use strict";e.d(A,{c:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({message:i,callToActionElement:o,footer:l,className:f})=>{const h=(0,a.of)(r);return(0,t.jsxs)("div",{className:(0,n.cx)([h.wrapper,f]),children:[i&&(0,t.jsx)("div",{className:h.message,children:i}),o,l&&(0,t.jsx)("div",{className:h.footer,children:l})]})},r=i=>({wrapper:(0,n.css)({label:"call-to-action-card",background:i.colors.background.secondary,borderRadius:i.shape.radius.default,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,padding:i.spacing(3),[i.breakpoints.down("sm")]:{padding:i.spacing(3,1)}}),message:(0,n.css)({marginBottom:i.spacing(3),fontStyle:"italic"}),footer:(0,n.css)({marginTop:i.spacing(3)})})},8073(ne,A,e){"use strict";e.d(A,{H:()=>C,Z:()=>f});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(35484),o=e(43856);const l=a.createContext(null),f=({disabled:S,href:R,onClick:L,children:j,isSelected:N,isCompact:V,className:w,noMargin:M,...O})=>{const U=(0,a.useMemo)(()=>a.Children.toArray(j).some(F=>a.isValidElement(F)&&F.type===h),[j]),K=S||!L&&!R,z=L&&!S?L:void 0,G=(0,r.of)(o.i,S,K,N,V,M);return(0,t.jsx)(o.Q,{disableEvents:S,disableHover:K,isSelected:N,className:(0,n.cx)(G.container,w),noMargin:M,...O,children:(0,t.jsxs)(l.Provider,{value:{href:R,onClick:z,disabled:S,isSelected:N},children:[!U&&(0,t.jsx)(h,{}),j]})})};f.displayName="Card";const h=({children:S,className:R,"aria-label":L})=>{const j=(0,a.useContext)(l),N=(0,r.of)(d),{href:V,onClick:w,isSelected:M}=j??{href:void 0,onClick:void 0,isSelected:void 0},O=(0,c.t)("grafana-ui.card.option","option");return(0,t.jsxs)("h2",{className:(0,n.cx)(N.heading,R),children:[V?(0,t.jsx)("a",{href:V,className:N.linkHack,"aria-label":L,onClick:w,children:S}):w?(0,t.jsx)("button",{onClick:w,className:N.linkHack,"aria-label":L,type:"button",children:S}):(0,t.jsx)(t.Fragment,{children:S}),M!==void 0&&(0,t.jsx)("input",{"aria-label":O,type:"radio",checked:M,readOnly:!0})]})};h.displayName="Heading";const d=S=>({heading:(0,n.css)({gridArea:"Heading",justifySelf:"start",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:0,fontSize:S.typography.size.md,letterSpacing:"inherit",lineHeight:S.typography.body.lineHeight,color:S.colors.text.primary,fontWeight:S.typography.fontWeightMedium,"& input[readonly]":{cursor:"inherit"}}),linkHack:(0,n.css)({all:"unset","&::after":{position:"absolute",content:'""',top:0,bottom:0,left:0,right:0,borderRadius:S.shape.radius.default},"&:focus-visible":{outline:"none",outlineOffset:0,boxShadow:"none","&::after":{...(0,i.getFocusStyles)(S),zIndex:1}}})}),s=({children:S,className:R})=>{const L=(0,r.of)(g);return(0,t.jsx)("div",{className:(0,n.cx)(L.tagList,R),children:S})};s.displayName="Tags";const g=S=>({tagList:(0,n.css)({position:"relative",gridArea:"Tags",alignSelf:"center"})}),v=({children:S,className:R})=>{const L=(0,r.of)(x),j=typeof S=="string"?"p":"div";return(0,t.jsx)(j,{className:(0,n.cx)(L.description,R),children:S})};v.displayName="Description";const x=S=>({description:(0,n.css)({width:"100%",gridArea:"Description",margin:S.spacing(1,0,0),color:S.colors.text.secondary,lineHeight:S.typography.body.lineHeight})}),m=({children:S,align:R="start",className:L})=>{const j=(0,r.of)(p);return(0,t.jsx)("div",{className:(0,n.cx)(j.media,L,(0,n.css)({alignSelf:R})),children:S})};m.displayName="Figure";const p=S=>({media:(0,n.css)({position:"relative",gridArea:"Figure",marginRight:S.spacing(2),width:"40px","> img":{width:"100%"},"&:empty":{display:"none"}})}),y=(0,a.memo)(({children:S,className:R,separator:L="|"})=>{const j=(0,r.of)(E);let N=S;const V=a.Children.toArray(S).filter(Boolean);return V.length?(N=V.map((w,M)=>(0,t.jsx)("div",{className:j.metadataItem,children:w},`element_${M}`)),V.length>1&&L&&(N=V.reduce((w,M,O)=>[w,(0,t.jsx)("span",{className:j.separator,children:L},`separator_${O}`),M])),(0,t.jsx)("div",{className:(0,n.cx)(j.metadata,R),children:N})):null});y.displayName="Meta";const E=S=>({metadata:(0,n.css)({gridArea:"Meta",display:"flex",alignItems:"center",width:"100%",fontSize:S.typography.size.sm,color:S.colors.text.secondary,margin:S.spacing(.5,0,0),lineHeight:S.typography.bodySmall.lineHeight,overflowWrap:"anywhere"}),metadataItem:(0,n.css)({zIndex:0}),separator:(0,n.css)({margin:`0 ${S.spacing(1)}`})}),b=({children:S,disabled:R,variant:L,className:j})=>{const N=(0,r.of)(u),w=(0,a.useContext)(l)?.disabled||R,M=L==="primary"?N.actions:N.secondaryActions;return(0,t.jsx)("div",{className:(0,n.cx)(M,j),children:a.Children.map(S,O=>a.isValidElement(O)?(0,a.cloneElement)(O,{disabled:w,...O.props}):null)})},u=S=>({actions:(0,n.css)({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:S.spacing(1),gridArea:"Actions",marginTop:S.spacing(2)}),secondaryActions:(0,n.css)({alignSelf:"center",color:S.colors.text.secondary,display:"flex",flexDirection:"row",flexWrap:"wrap",gap:S.spacing(1),gridArea:"Secondary",marginTop:S.spacing(2)})}),D=({children:S,disabled:R,className:L})=>(0,t.jsx)(b,{variant:"primary",disabled:R,className:L,children:S});D.displayName="Actions";const P=({children:S,disabled:R,className:L})=>(0,t.jsx)(b,{variant:"secondary",disabled:R,className:L,children:S});P.displayName="SecondaryActions";const C=S=>({inner:(0,n.css)({display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",flexWrap:"wrap"}),...d(S),...E(S),...x(S),...p(S),...u(S),...g(S)});f.Heading=h,f.Tags=s,f.Figure=m,f.Meta=y,f.Actions=D,f.SecondaryActions=P,f.Description=v},43856(ne,A,e){"use strict";e.d(A,{Q:()=>o,i:()=>l});var t=e(74848),n=e(22803),a=e(63142),c=e(35484);const r=({children:f,href:h})=>{const{inner:d}=(0,a.of)(i);return h?(0,t.jsx)("a",{className:d,href:h,children:f}):(0,t.jsx)(t.Fragment,{children:f})},i=f=>({inner:(0,n.css)({display:"flex",width:"100%",padding:f.spacing(2)})}),o=({children:f,disableEvents:h,disableHover:d,isSelected:s,className:g,href:v,noMargin:x,...m})=>{const{oldContainer:p}=(0,a.of)(l,h,d,s,void 0,x);return(0,t.jsx)("div",{...m,className:(0,n.cx)(p,g),children:(0,t.jsx)(r,{href:v,children:f})})},l=(f,h=!1,d=!1,s,g,v=!1)=>{const x=s!==void 0;return{container:(0,n.css)({display:"grid",position:"relative",gridTemplateColumns:"auto 1fr auto",gridTemplateRows:"1fr auto auto auto",gridAutoColumns:"1fr",gridAutoFlow:"row",gridTemplateAreas:` "Figure Heading Tags" "Figure Meta Tags" "Figure Description Tags" "Figure Actions Secondary"`,width:"100%",padding:f.spacing(g?1:2),background:f.colors.background.secondary,borderRadius:f.shape.radius.default,marginBottom:f.spacing(v?0:1),pointerEvents:h?"none":"auto",[f.transitions.handleMotion("no-preference","reduce")]:{transition:f.transitions.create(["background-color","box-shadow","border-color","color"],{duration:f.transitions.duration.short})},...!d&&{"&:hover":{background:f.colors.emphasize(f.colors.background.secondary,.03),cursor:"pointer",zIndex:1},"&:focus":(0,c.getFocusStyles)(f)},...x&&{cursor:"pointer"},...s&&{outline:`solid 2px ${f.colors.primary.border}`}}),oldContainer:(0,n.css)({display:"flex",width:"100%",background:f.colors.background.secondary,borderRadius:f.shape.radius.default,position:"relative",pointerEvents:h?"none":"auto",marginBottom:f.spacing(v?0:1),[f.transitions.handleMotion("no-preference","reduce")]:{transition:f.transitions.create(["background-color","box-shadow","border-color","color"],{duration:f.transitions.duration.short})},...!d&&{"&:hover":{background:f.colors.emphasize(f.colors.background.secondary,.03),cursor:"pointer",zIndex:1},"&:focus":(0,c.getFocusStyles)(f)}})}}},56873(ne,A,e){"use strict";e.d(A,{F:()=>g});var t=e(74848),n=e(22803),a=e(18828),c=e(43107),r=e(93225),i=e(59875),o=e(96540),l=e(92745),f=e(63142),h=e(34999),d=e(45861),s=e(76319);const g=({images:x})=>{const[m,p]=(0,o.useState)(null),[y,E]=(0,o.useState)({}),[b,u]=(0,o.useState)(x),D=(0,o.useId)(),P=(0,f.of)(v),C=(0,f.of)(d.my),S=K=>{E(z=>({...z,[K]:!0}))};(0,o.useEffect)(()=>{const K=x.filter(z=>!y[z.path]);u(K)},[y,x]);const R=K=>{p(K)},L=()=>{p(null)},j=()=>{m!==null&&b.length>0&&p((m+1)%b.length)},N=()=>{m!==null&&b.length>0&&p((m-1+b.length)%b.length)},V=K=>{if(m!==null)switch(K.key){case"ArrowRight":j();break;case"ArrowLeft":N();break;case"Escape":L();break;default:break}},w=(0,o.useRef)(null),{overlayProps:M,underlayProps:O}=(0,r.e)({isOpen:m!==null,onClose:L},w),{dialogProps:U}=(0,a.s)({},w);return b.length===0?(0,t.jsx)(h.F,{title:(0,l.t)("carousel.error","Something went wrong loading images"),severity:"warning","data-testid":"alert-warning"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,n.cx)(P.imageGrid),children:b.map((K,z)=>{const G=`${D}-carousel-image-${z}`;return(0,t.jsxs)("button",{"aria-label":(0,l.t)("grafana-ui.carousel.aria-label-open-image","Open image preview"),"aria-describedby":G,type:"button",onClick:()=>R(z),className:(0,n.cx)(C,P.imageButton),children:[(0,t.jsx)("img",{src:K.path,alt:"",onError:()=>S(K.path)}),(0,t.jsx)("p",{id:G,children:K.name})]},K.path)})}),m!==null&&(0,t.jsxs)(i.Sf,{children:[(0,t.jsx)("div",{role:"presentation",className:P.underlay,onClick:L,...O}),(0,t.jsx)(c.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsxs)("div",{"data-testid":"carousel-full-screen",ref:w,...M,...U,onKeyDown:V,className:P.overlay,children:[(0,t.jsx)(s.K,{name:"times","aria-label":(0,l.t)("carousel.close","Close"),size:"xl",onClick:L,className:(0,n.cx)(P.closeButton)}),(0,t.jsx)(s.K,{size:"xl",name:"angle-left","aria-label":(0,l.t)("carousel.previous","Previous"),onClick:N,"data-testid":"previous-button"}),(0,t.jsx)("div",{className:P.imageContainer,"data-testid":"carousel-full-image",children:(0,t.jsx)("img",{className:P.imagePreview,src:b[m].path,alt:b[m].name,onError:()=>S(b[m].path)})}),(0,t.jsx)(s.K,{size:"xl",name:"angle-right","aria-label":(0,l.t)("carousel.next","Next"),onClick:j,"data-testid":"next-button"})]})})]})]})},v=x=>({imageButton:(0,n.css)({textAlign:"left"}),imageContainer:(0,n.css)({display:"flex",justifyContent:"center",flex:1}),imagePreview:(0,n.css)({borderRadius:x.shape.radius.lg,maxWidth:"100%",maxHeight:"80vh",objectFit:"contain"}),imageGrid:(0,n.css)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:x.spacing(2),marginBottom:"20px","& img":{width:"100%",height:"150px",objectFit:"cover",border:x.colors.border.strong,borderRadius:x.shape.radius.default,boxShadow:x.shadows.z1},"& p":{margin:x.spacing(.5,0),fontWeight:x.typography.fontWeightMedium,color:x.colors.text.primary}}),underlay:(0,n.css)({position:"fixed",zIndex:x.zIndex.modalBackdrop,inset:0,backgroundColor:x.components.overlay.background}),overlay:(0,n.css)({alignItems:"center",display:"flex",gap:x.spacing(1),height:"fit-content",marginBottom:"auto",marginTop:"auto",padding:x.spacing(2),position:"fixed",inset:0,zIndex:x.zIndex.modal}),closeButton:(0,n.css)({color:x.colors.text.primary,position:"fixed",top:x.spacing(2),right:x.spacing(2)})})},64913(ne,A,e){"use strict";e.d(A,{v:()=>E});var t=e(74848),n=e(22803),a=e(47078),c=e.n(a),r=e(38092),i=e(96540),o=e(92745),l=e(63142),f=e(30703),h=e(76319),d=e(63527),s=e(41654),g=e(18857),v=e(78121),x=e(21133);const m=(0,n.css)({"&:focus":{outline:"none"}}),p=" / ";class y extends i.PureComponent{constructor(u){super(u),this.flattenOptions=(S,R=[])=>{let L=[];for(const j of S){const N=[...R];N.push(j),!j.items||j.items.length===0?L.push({singleLabel:N[N.length-1].label,label:N.map(V=>V.label).join(this.props.separator||p),value:N.map(V=>V.value)}):L=[...L,...this.flattenOptions(j.items,N)]}return L},this.getSearchableOptions=c()(S=>this.flattenOptions(S)),this.onChange=(S,R)=>{const L=this.props.hideActiveLevelLabel?"":this.props.displayAllSelectedLevels?R.map(N=>N.label).join(this.props.separator||p):R[R.length-1].label,j={rcValue:{value:S,label:L},focusCascade:!0,activeLabel:L,isSearching:!1,inputValue:L};this.setState(j),this.props.onSelect(R[R.length-1].value)},this.onSelect=S=>{const R=S.value||[],L=this.props.displayAllSelectedLevels?S.label:S.singleLabel||"",j={activeLabel:L,inputValue:L,rcValue:{value:R,label:L},isSearching:!1,focusCascade:!1};this.setState(j),this.props.onSelect(R[R.length-1])},this.onCreateOption=S=>{this.setState({activeLabel:S,inputValue:S,rcValue:[],isSearching:!1}),this.props.onSelect(S)},this.onBlur=()=>{this.setState({isSearching:!1,focusCascade:!1}),this.state.activeLabel===""&&this.setState({rcValue:[]}),this.props.onBlur?.()},this.onBlurCascade=()=>{this.setState({focusCascade:!1}),this.props.onBlur?.()},this.onInputKeyDown=S=>{if(["ArrowDown","ArrowUp","Enter","ArrowLeft","ArrowRight"].includes(S.key))return;const R=S.currentTarget.selectionStart,L=S.currentTarget.selectionEnd;let j=S.currentTarget.value;R!==L&&(j=j.substring(0,R??0)+j.substring(L??0)),this.setState({focusCascade:!1,isSearching:!0,inputValue:j})},this.onSelectInputChange=S=>{this.setState({inputValue:S})};const D=this.getSearchableOptions(u.options),{rcValue:P,activeLabel:C}=this.setInitialValue(D,u.initialValue);this.state={isSearching:!1,focusCascade:!1,rcValue:P,activeLabel:C,inputValue:""}}static{this.defaultProps={changeOnSelect:!0}}setInitialValue(u,D){if(!D)return{rcValue:[],activeLabel:""};for(const P of u){const C=P.value||[];if(C[C.length-1]===D)return{rcValue:C,activeLabel:this.props.displayAllSelectedLevels?P.label:P.singleLabel||""}}return this.props.allowCustomValue?{rcValue:[],activeLabel:D}:{rcValue:[],activeLabel:""}}render(){const{allowCustomValue:u,formatCreateLabel:D,placeholder:P,width:C,changeOnSelect:S,options:R,disabled:L,id:j,isClearable:N,theme:V}=this.props,{focusCascade:w,isSearching:M,rcValue:O,activeLabel:U,inputValue:K}=this.state,z=this.getSearchableOptions(R),G=(0,x.T)(V);return(0,t.jsx)("div",{children:M?(0,t.jsx)(g.l6,{allowCustomValue:u,placeholder:P,autoFocus:!w,onChange:this.onSelect,onBlur:this.onBlur,options:z,onCreateOption:this.onCreateOption,formatCreateLabel:D,width:C,onInputChange:this.onSelectInputChange,disabled:L,inputValue:K,inputId:j}):(0,t.jsx)(r.A,{onChange:(0,v.k)(this.onChange),options:R,changeOnSelect:S,value:O.value,fieldNames:{label:"label",value:"value",children:"items"},expandIcon:null,open:this.props.alwaysOpen,disabled:L,dropdownClassName:G.dropdown,children:(0,t.jsx)("div",{className:m,children:(0,t.jsx)(d.p,{autoFocus:this.props.autoFocus,width:C,placeholder:P,onBlur:this.onBlurCascade,value:U,onFocus:F=>{F.currentTarget.select()},onKeyDown:this.onInputKeyDown,onChange:()=>{},suffix:(0,t.jsxs)(s.B,{gap:.5,children:[N&&U!==""&&(0,t.jsx)(h.K,{name:"times","aria-label":(0,o.t)("grafana-ui.cascader.clear-button","Clear selection"),onClick:F=>{F.preventDefault(),F.stopPropagation(),this.setState({rcValue:[],activeLabel:"",inputValue:""}),this.props.onSelect("")}}),(0,t.jsx)(f.I,{name:w?"angle-up":"angle-down"})]}),disabled:L,id:j})})})})}}const E=(0,l.cV)(y)},78121(ne,A,e){"use strict";e.d(A,{W:()=>n,k:()=>t});const t=r=>(i,o)=>{r&&r(i.map(l=>String(l)),a(o))},n=r=>i=>{r&&r(a(i))},a=r=>r.map(c),c=r=>{const i=r.value?String(r.value):"";return{value:i,label:typeof r.label=="string"?r.label:i}}},21133(ne,A,e){"use strict";e.d(A,{T:()=>o});var t=e(22803),n=e(58851);const a=(0,t.keyframes)({"0%":{opacity:0,transformOrigin:"0% 0%",transform:"scaleY(0.8)"},"100%":{opacity:1,transformOrigin:"0% 0%",transform:"scaleY(1)"}}),c=(0,t.keyframes)({"0%":{opacity:1,transformOrigin:"0% 0%",transform:"scaleY(1)"},"100%":{opacity:0,transformOrigin:"0% 0%",transform:"scaleY(0.8)"}}),r=(0,t.keyframes)({"0%":{opacity:0,transformOrigin:"0% 100%",transform:"scaleY(0.8)"},"100%":{opacity:1,transformOrigin:"0% 100%",transform:"scaleY(1)"}}),i=(0,t.keyframes)({"0%":{opacity:1,transformOrigin:"0% 100%",transform:"scaleY(1)"},"100%":{opacity:0,transformOrigin:"0% 100%",transform:"scaleY(0.8)"}}),o=l=>{const f=(0,n.hO)("angle-right");return{dropdown:(0,t.css)({"&.rc-cascader-dropdown":{position:"absolute",zIndex:9999,"&-hidden":{display:"none"}},".rc-cascader":{"&-menus":{overflow:"hidden",background:l.colors.background.elevated,border:"none",borderRadius:l.shape.radius.default,boxShadow:l.shadows.z3,whiteSpace:"nowrap","&.slide-up-enter, &.slide-up-appear":{animationDuration:"0.3s",animationFillMode:"both",transformOrigin:"0 0",opacity:0,animationTimingFunction:"cubic-bezier(0.08, 0.82, 0.17, 1)",animationPlayState:"paused"},"&.slide-up-enter.slide-up-enter-active.rc-cascader-menus-placement, &.slide-up-appear.slide-up-appear-active.rc-cascader-menus-placement":{"&-bottomLeft":{animationName:a,animationPlayState:"running"},"&-topLeft":{animationName:r,animationPlayState:"running"}},"&.slide-up-leave":{animationDuration:"0.3s",animationFillMode:"both",transformOrigin:"0 0",opacity:1,animationTimingFunction:"cubic-bezier(0.6, 0.04, 0.98, 0.34)",animationPlayState:"paused","&.slide-up-leave-active.rc-cascader-menus-placement":{"&-bottomLeft":{animationName:c,animationPlayState:"running"},"&-topLeft":{animationName:i,animationPlayState:"running"}}}},"&-menu":{display:"inline-block",maxWidth:"50vw",height:"192px",listStyle:"none",margin:0,padding:l.spacing(.5),borderRight:`1px solid ${l.colors.border.weak}`,overflow:"auto","&:last-child":{borderRight:0},"&-item":{height:l.spacing(4),lineHeight:l.spacing(4),padding:l.spacing(0,4,0,2),borderRadius:l.shape.radius.default,cursor:"pointer",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",transition:"all 0.3s ease",position:"relative","&:hover":{background:l.colors.action.hover},"&-disabled":{cursor:"not-allowed",color:l.colors.text.disabled,"&:hover":{background:"transparent"},"&:after":{position:"absolute",right:"12px",content:"'loading'",color:l.colors.text.disabled,fontStyle:"italic"}},"&-active":{color:l.colors.text.maxContrast,background:l.colors.background.secondary,"&:hover":{background:l.colors.action.hover}},"&-expand":{position:"relative","&:after":{background:l.colors.text.primary,content:"''",height:l.spacing(3),mask:`url(${f})`,maskType:"luminance",position:"absolute",right:0,top:l.spacing(.5),width:l.spacing(3)}}}}}})}}},8135(ne,A,e){"use strict";e.d(A,{N:()=>a});var t=e(74848),n=e(96540);function a({includeButtonPress:c=!0,parent:r=window,useCapture:i=!1,onClick:o,children:l}){const f=(0,n.useRef)(null),h=(0,n.useCallback)(d=>{const s=f.current;(!s||d.target instanceof Node&&!s.contains(d.target))&&o()},[o]);return(0,n.useEffect)(()=>(r.addEventListener("click",h,i),c&&r.addEventListener("keyup",h,i),()=>{r.removeEventListener("click",h,i),c&&r.removeEventListener("keyup",h,i)}),[c,h,r,i]),(0,t.jsx)("div",{ref:f,children:l})}},47931(ne,A,e){"use strict";e.d(A,{b:()=>h});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(45861),o=e(30703),l=e(53371);const f=2*1e3;function h({onClipboardCopy:g,onClipboardError:v,children:x,getText:m,icon:p,variant:y,...E}){const b=(0,r.of)(s),[u,D]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let R;return u&&(R=setTimeout(()=>{D(!1)},f)),()=>{window.clearTimeout(R)}},[u]);const P=(0,a.useRef)(null),C=(0,a.useCallback)(async()=>{const R=m();try{await d(R,P),D(!0),g?.(R)}catch(L){v?.(R,L)}},[m,g,v]),S=(0,c.t)("clipboard-button.inline-toast.success","Copied");return(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsx)(l.r,{placement:"top",referenceElement:P.current,children:S}),(0,t.jsxs)(i.$n,{onClick:C,icon:p,variant:u?"success":y,...E,className:(0,n.cx)(b.button,u&&b.successButton,E.className),ref:P,children:[x,u&&(0,t.jsx)("div",{className:b.successOverlay,children:(0,t.jsx)(o.I,{name:"check"})})]})]})}const d=async(g,v)=>{if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(g);{const x=document.createElement("textarea");v.current?.appendChild(x),x.value=g,x.focus(),x.select(),document.execCommand("copy"),x.remove()}},s=g=>({button:(0,n.css)({position:"relative"}),successButton:(0,n.css)({"> *":(0,n.css)({visibility:"hidden"})}),successOverlay:(0,n.css)({position:"absolute",top:0,bottom:0,right:0,left:0,visibility:"visible"})})},74475(ne,A,e){"use strict";e.d(A,{M:()=>h});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(96540),i=e(63142),o=e(35484),l=e(30703),f=e(68079);const h=({label:s,isOpen:g,onToggle:v,className:x,contentClassName:m,children:p,labelId:y,loading:E=!1,headerDataTestId:b,contentDataTestId:u,unmountContentWhenClosed:D=!0})=>{const[P,C]=(0,r.useState)(g),S=(0,i.of)(d),R=g!==void 0&&v!==void 0,L=R?g:P,j=M=>{M.target instanceof HTMLElement&&M.target.tagName==="A"||(M.preventDefault(),M.stopPropagation(),v?.(!g),R||C(!P))},{current:N}=(0,r.useRef)((0,a.uniqueId)()),V=y??`collapse-label-${N}`,w=(0,t.jsx)("div",{id:`collapse-content-${N}`,className:(0,n.cx)(S.content,m,{[S.contentHidden]:!D&&!L}),"data-testid":u,children:p});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{onClick:j,className:(0,n.cx)(S.header,x),children:[(0,t.jsx)("button",{type:"button",id:`collapse-button-${N}`,className:S.button,onClick:j,"aria-expanded":L&&!E,"aria-controls":`collapse-content-${N}`,"aria-labelledby":V,children:E?(0,t.jsx)(f.y,{className:S.spinner}):(0,t.jsx)(l.I,{name:L?"angle-down":"angle-right",className:S.icon})}),(0,t.jsx)("div",{className:S.label,id:`collapse-label-${N}`,"data-testid":b,children:s})]}),D?L&&w:w]})},d=s=>({header:(0,n.css)({display:"flex",alignItems:"center",cursor:"pointer",boxSizing:"border-box",position:"relative",justifyContent:"flex-start",fontSize:s.typography.size.lg,padding:`${s.spacing(.5)} 0`,"&:focus-within":(0,o.getFocusStyles)(s)}),button:(0,n.css)({all:"unset",marginRight:s.spacing(1),"&:focus-visible":{outline:"none",outlineOffset:"unset",[s.transitions.handleMotion("no-preference","reduce")]:{transition:"none"},boxShadow:"none"}}),icon:(0,n.css)({color:s.colors.text.secondary}),content:(0,n.css)({padding:`${s.spacing(2)} 0`}),contentHidden:(0,n.css)({display:"none"}),spinner:(0,n.css)({display:"flex",alignItems:"center",width:s.spacing(2)}),label:(0,n.css)({display:"flex",flex:"1 1 auto",fontWeight:s.typography.fontWeightMedium,color:s.colors.text.maxContrast})})},89599(ne,A,e){"use strict";e.d(A,{S:()=>l,a:()=>o});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(76319);const i=f=>({collapse:(0,n.css)({label:"collapse",marginBottom:f.spacing(1),backgroundColor:f.colors.background.primary,border:`1px solid ${f.colors.border.weak}`,position:"relative",borderRadius:f.shape.radius.default,width:"100%",display:"flex",flexDirection:"column",flex:"1 1 0"}),collapseBody:(0,n.css)({label:"collapse__body",padding:f.spacing(f.components.panel.padding),paddingTop:0,flex:1,overflow:"hidden",display:"flex",flexDirection:"column"}),bodyContentWrapper:(0,n.css)({label:"bodyContentWrapper",flex:1}),loader:(0,n.css)({label:"collapse__loader",height:"2px",position:"relative",overflow:"hidden",background:"none",margin:f.spacing(.5)}),loaderActive:(0,n.css)({label:"collapse__loader_active","&:after":{content:"' '",display:"block",width:"25%",top:0,height:"250%",position:"absolute",[f.transitions.handleMotion("no-preference","reduce")]:{animation:"loader 2s cubic-bezier(0.17, 0.67, 0.83, 0.67) 500ms",animationIterationCount:100},[f.transitions.handleMotion("reduce")]:{animationDuration:"10s",animationIterationCount:20},left:"-25%",background:f.colors.primary.main},"@keyframes loader":{from:{left:"-25%",opacity:.1},to:{left:"100%",opacity:1}}}),header:(0,n.css)({cursor:"pointer",label:"collapse__header",padding:f.spacing(1),display:"flex",gap:f.spacing(1)}),button:(0,n.css)({marginRight:0}),headerLabel:(0,n.css)({label:"collapse__header-label",fontWeight:f.typography.fontWeightMedium,fontSize:f.typography.size.md,display:"flex",flex:1})}),o=({isOpen:f,onToggle:h,...d})=>{const[s,g]=(0,a.useState)(f);return(0,t.jsx)(l,{isOpen:s,...d,onToggle:()=>{g(!s),h&&h(!s)}})},l=({isOpen:f,label:h,loading:d,onToggle:s,className:g,children:v})=>{const x=(0,c.of)(i),m=(0,a.useId)(),p=(0,a.useId)(),y=()=>{s&&s(!f)},E=(0,n.cx)([x.collapse,g]),b=d?(0,n.cx)([x.loader,x.loaderActive]):x.loader;return(0,t.jsxs)("div",{className:E,children:[(0,t.jsxs)("div",{className:x.header,onClick:y,children:[(0,t.jsx)(r.K,{"aria-describedby":m,"aria-expanded":f,"aria-controls":p,className:x.button,"aria-labelledby":m,name:f?"angle-down":"angle-right"}),(0,t.jsx)("div",{id:m,className:x.headerLabel,children:h})]}),f&&(0,t.jsxs)("div",{className:x.collapseBody,id:p,children:[(0,t.jsx)("div",{className:b}),(0,t.jsx)("div",{className:x.bodyContentWrapper,children:v})]})]})};l.displayName="Collapse"},12173(ne,A,e){"use strict";e.d(A,{A:()=>h});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(96540),i=e(84140),o=e(63142),l=e(63527);const f=(0,r.forwardRef)(({color:g,onChange:v,isClearable:x=!1,onClick:m,onBlur:p,disabled:y,buttonAriaLabel:E,...b},u)=>{const[D,P]=(0,r.useState)(g),[C,S]=(0,r.useState)(g),R=(0,r.useMemo)(()=>(0,a.debounce)(v,100),[]);(0,r.useEffect)(()=>{const N=(0,i.A)(g);N.isValid()&&g!==C&&(P(N.toString()),S(g))},[g,C]);const L=N=>{const{value:V}=N.currentTarget;if(P(V),V===""&&x){R(V);return}const w=(0,i.A)(V);w.isValid()&&R(w.toString())},j=N=>{(0,i.A)(D).isValid()||P(g),p?.(N)};return(0,t.jsx)(l.p,{...b,value:D,onChange:L,disabled:y,onClick:m,onBlur:j,addonBefore:(0,t.jsx)(d,{onClick:m,ariaLabel:E,disabled:y,color:g}),ref:u})});f.displayName="ColorInput";const h=f,d=({color:g,onClick:v,disabled:x,ariaLabel:m})=>{const p=(0,o.of)(s);return(0,t.jsx)("button",{type:"button",onClick:v,"aria-label":m,disabled:x||!v,className:(0,n.cx)(p,(0,n.css)({backgroundColor:g}))})},s=g=>(0,n.css)({height:"100%",width:`${g.spacing.gridSize*4}px`,borderRadius:`${g.shape.radius.default} 0 0 ${g.shape.radius.default}`,border:`1px solid ${g.colors.border.medium}`})},35427(ne,A,e){"use strict";e.d(A,{Dp:()=>v,sk:()=>g});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(65240),i=e(14226),o=e(2381),l=e(43533),f=e(89772),h=e(13409),d=e(57339);const s=(m,p="ColorPicker")=>class extends a.Component{constructor(){super(...arguments),this.pickerTriggerRef=(0,a.createRef)()}static{this.displayName=p}render(){const{theme:E,children:b,onChange:u,color:D,id:P}=this.props,C=x(E),S=a.createElement(m,{...this.props,children:null,onChange:u});return(0,t.jsx)(l.I,{content:S,hideAfter:300,children:(R,L,j)=>(0,t.jsxs)(t.Fragment,{children:[this.pickerTriggerRef.current&&(0,t.jsx)(o.A,{...j,referenceElement:this.pickerTriggerRef.current,wrapperClassName:C.colorPicker,onMouseLeave:L,onMouseEnter:R,onKeyDown:N=>(0,i.Q)(N,L)}),b?b({ref:this.pickerTriggerRef,showColorPicker:R,hideColorPicker:L}):(0,t.jsx)(h.q,{id:P,ref:this.pickerTriggerRef,onClick:R,onMouseLeave:L,color:E.visualization.getColorByName(D||"#000000"),"aria-label":D})]})})}},g=(0,c.cV)(s(f.$,"ColorPicker")),v=(0,c.cV)(s(d.o,"SeriesColorPicker")),x=(0,r.N)(m=>({colorPicker:(0,n.css)({position:"absolute",zIndex:m.zIndex.tooltip,color:m.colors.text.primary,maxWidth:"400px",fontSize:m.typography.size.sm,maxHeight:"100vh",overflow:"auto"})}))},89772(ne,A,e){"use strict";e.d(A,{$:()=>b});var t=e(74848),n=e(22803),a=e(43107),c=e(96540),r=e(6773),i=e(92745),o=e(63142),l=e(65240),f=e(60208),h=e(54314),d=e(13409),s=e(2543);const v=({hue:D,selectedColor:P,onColorSelect:C,...S})=>{const R=(0,s.upperFirst)(D.name),L=(0,o.of)(x),j=(0,c.useMemo)(()=>[...D.shades].reverse(),[D.shades]);return(0,t.jsxs)("div",{className:L.colorRow,children:[(0,t.jsx)("div",{className:L.colorLabel,children:R}),(0,t.jsx)("div",{...S,className:L.swatchRow,children:j.map(N=>(0,t.jsx)(d.q,{"aria-label":N.name,variant:N.primary?d.h.Large:d.h.Small,isSelected:N.name===P,color:N.color,onClick:()=>C(N.name)},N.name))})]})},x=D=>({colorRow:(0,n.css)({display:"grid",gridTemplateColumns:"25% 1fr",gridColumnGap:D.spacing(2),padding:D.spacing(.5,0),"&:hover":{background:D.colors.background.secondary}}),colorLabel:(0,n.css)({paddingLeft:D.spacing(1),display:"flex",alignItems:"center"}),swatchRow:(0,n.css)({display:"flex",gap:D.spacing(1),alignItems:"center",justifyContent:"space-around",flexDirection:"row"})}),m=({color:D,onChange:P})=>{const C=(0,o.$j)(),S=(0,o.of)(p),R=[];for(const L of C.visualization.hues)R.push((0,t.jsx)(v,{selectedColor:D,hue:L,onColorSelect:P},L.name));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:S.swatches,children:R}),(0,t.jsxs)("div",{className:S.extraColors,children:[(0,t.jsx)(d.q,{isSelected:D==="transparent",color:"rgba(0,0,0,0)",label:(0,i.t)("grafana-ui.named-colors-palette.transparent-swatch","Transparent"),onClick:()=>P("transparent")}),(0,t.jsx)(d.q,{isSelected:D==="text",color:C.colors.text.primary,label:(0,i.t)("grafana-ui.named-colors-palette.text-color-swatch","Text color"),onClick:()=>P("text")})]})]})},p=D=>({container:(0,n.css)({display:"flex",flexDirection:"column"}),extraColors:(0,n.css)({display:"flex",alignItems:"center",justifyContent:"space-around",gap:D.spacing(1),padding:D.spacing(1,0)}),swatches:(0,n.css)({display:"grid",flexGrow:1})});var y=e(32550);class E extends c.Component{constructor(P){super(P),this.handleChange=C=>{const{onChange:S,enableNamedColors:R,theme:L}=this.props;if(R)return S(C);S(r.MV.asHexString(L.visualization.getColorByName(C)))},this.onTabChange=C=>()=>this.setState({activePicker:C}),this.renderPicker=()=>{const{activePicker:C}=this.state,{color:S}=this.props;switch(C){case"spectrum":return(0,t.jsx)(y.A,{color:S,onChange:this.handleChange});case"palette":return(0,t.jsx)(m,{color:S,onChange:this.handleChange});default:return this.renderCustomPicker(C)}},this.renderCustomPicker=C=>{const{customPickers:S,color:R,theme:L}=this.props;return S?c.createElement(S[C].tabComponent,{color:R,theme:L,onChange:this.handleChange}):null},this.renderCustomPickerTabs=()=>{const{customPickers:C}=this.props;return C?(0,t.jsx)(t.Fragment,{children:Object.keys(C).map(S=>(0,t.jsx)(f.o,{label:C[S].name,onChangeTab:this.onTabChange(S)},S))}):null},this.state={activePicker:"palette"}}render(){const{theme:P}=this.props,{activePicker:C}=this.state,S=u(P);return(0,t.jsx)(a.n1,{contain:!0,restoreFocus:!0,autoFocus:!0,children:(0,t.jsxs)("div",{tabIndex:-1,className:S.colorPickerPopover,children:[(0,t.jsxs)(h.U,{children:[(0,t.jsx)(f.o,{label:(0,i.t)("grafana-ui.color-picker-popover.palette-tab","Colors"),onChangeTab:this.onTabChange("palette"),active:C==="palette"}),(0,t.jsx)(f.o,{label:(0,i.t)("grafana-ui.color-picker-popover.spectrum-tab","Custom"),onChangeTab:this.onTabChange("spectrum"),active:C==="spectrum"}),this.renderCustomPickerTabs()]}),(0,t.jsx)("div",{className:S.colorPickerPopoverContent,children:this.renderPicker()})]})})}}const b=(0,o.cV)(E);b.displayName="ColorPickerPopover";const u=(0,l.N)(D=>({colorPickerPopover:(0,n.css)({borderRadius:D.shape.radius.default,boxShadow:D.shadows.z3,background:D.colors.background.elevated,padding:D.spacing(.5),border:`1px solid ${D.colors.border.weak}`}),colorPickerPopoverContent:(0,n.css)({width:"246px",fontSize:D.typography.bodySmall.fontSize,minHeight:"184px",height:"290px",padding:D.spacing(1),display:"flex",flexDirection:"column"}),colorPickerPopoverTabs:(0,n.css)({display:"flex",width:"100%",borderRadius:`${D.shape.radius.default} ${D.shape.radius.default} 0 0`})}))},13409(ne,A,e){"use strict";e.d(A,{h:()=>f,q:()=>h});var t=e(74848),n=e(22803),a=e(95382),c=e(96540),r=e(84140),i=e(51898),o=e(92745),l=e(63142),f=(s=>(s.Small="small",s.Large="large",s))(f||{});const h=c.forwardRef(({color:s,label:g,variant:v="small",isSelected:x,"aria-label":m,...p},y)=>{const E=(0,l.$j)(),{isFocusVisible:b,focusProps:u}=(0,a.o)(),D=d(E,v,s,b,x),P=!!g,C=m||g;return(0,t.jsxs)("div",{ref:y,className:D.wrapper,"data-testid":i.Tp.components.ColorSwatch.name,...p,children:[P&&(0,t.jsx)("span",{className:D.label,children:g}),(0,t.jsx)("button",{className:D.swatch,...u,"aria-label":C?(0,o.t)("grafana-ui.color-swatch.aria-label-selected-color","{{colorLabel}} color",{colorLabel:C}):(0,o.t)("grafana-ui.color-swatch.aria-label-default","Pick a color"),type:"button"})]})}),d=(s,g,v,x,m)=>{const p=(0,r.A)(v),E=g==="small"?"16px":"32px";let b="none";return p.getAlpha()<.1&&(b=`2px solid ${s.colors.border.medium}`),{wrapper:(0,n.css)({display:"flex",alignItems:"center",cursor:"pointer"}),label:(0,n.css)({marginRight:s.spacing(1)}),swatch:(0,n.css)({width:E,height:E,background:`${v}`,border:b,borderRadius:s.shape.radius.circle,outlineOffset:"1px",outline:x?`2px solid ${s.colors.primary.main}`:"none",boxShadow:m?`inset 0 0 0 2px ${v}, inset 0 0 0 4px ${s.colors.getContrastText(v)}`:"none",[s.transitions.handleMotion("no-preference")]:{transition:s.transitions.create(["transform"],{duration:s.transitions.duration.short})},"&:hover":{transform:"scale(1.1)"},"@media (forced-colors: active)":{forcedColorAdjust:"none"}})}};h.displayName="ColorSwatch"},57339(ne,A,e){"use strict";e.d(A,{o:()=>o,t:()=>l});var t=e(74848),n=e(92745),a=e(63142),c=e(18027),r=e(21285),i=e(89772);const o=f=>{const{yaxis:h,onToggleAxis:d,color:s,...g}=f,v=(0,n.t)("grafana-ui.series-color-picker-popover.y-axis-usage","Use right y-axis"),x=d?{yaxis:{name:"Y-Axis",tabComponent(){return(0,t.jsx)(c.I,{labelWidth:20,label:v,children:(0,t.jsx)(r.K,{value:h===2,label:v,onChange:d})})}}}:void 0;return(0,t.jsx)(i.$,{...g,color:s||"#000000",customPickers:x})},l=(0,a.cV)(o)},32550(ne,A,e){"use strict";e.d(A,{$:()=>d,A:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(7612),r=e(65229),i=e(84140),o=e(6773),l=e(63142),f=e(12173);const h=({color:g,onChange:v})=>{const[x,m]=(0,a.useState)(g);(0,r.A)(b=>{v(o.MV.asHexString(p.visualization.getColorByName(b)))},500,[x]);const p=(0,l.$j)(),y=(0,l.of)(d),E=(0,a.useMemo)(()=>x.startsWith("rgba")?x:(0,i.A)(p.visualization.getColorByName(g)).toRgbString(),[x,p,g]);return(0,t.jsxs)("div",{className:y.wrapper,children:[(0,t.jsx)(c.p9,{className:y.root,color:E,onChange:m}),(0,t.jsx)(f.A,{theme:p,color:E,onChange:m,className:y.colorInput})]})},d=g=>({wrapper:(0,n.css)({flexGrow:1}),root:(0,n.css)({"&.react-colorful":{width:"auto"},".react-colorful":{"&__saturation":{borderRadius:`${g.shape.radius.default} ${g.shape.radius.default} 0 0`},"&__alpha":{borderRadius:`0 0 ${g.shape.radius.default} ${g.shape.radius.default}`},"&__alpha, &__hue":{height:g.spacing(2),position:"relative"},"&__pointer":{height:g.spacing(2),width:g.spacing(2)}}}),colorInput:(0,n.css)({marginTop:g.spacing(2)})}),s=h},43243(ne,A,e){"use strict";e.d(A,{G:()=>u});var t=e(74848),n=e(22803),a=e(72181),c=e(31033),r=e(96540),i=e(92745),o=e(63142),l=e(30703),f=e(33033),h=e(63527),d=e(15245),s=e(70733),g=e(92842),v=e(74440),x=e(98869),m=e(75168),p=e(5320),y=e(93521);const E=()=>{},b=4,u=D=>{const{options:P,onChange:C,value:S,placeholder:R,isClearable:L,createCustomValue:j=!1,id:N,width:V,minWidth:w,maxWidth:M,"aria-labelledby":O,"data-testid":U,autoFocus:K,onBlur:z,disabled:G,portalContainer:F,invalid:W,prefixIcon:H}=D,Y=typeof S=="object"?S?.value:S,te=(0,r.useId)().replace(/:/g,"--"),{options:Z,groupStartIndices:se,updateOptions:ae,asyncLoading:J,asyncError:k}=(0,p.II)(D.options,j),_=typeof P=="function",Q=(0,r.useMemo)(()=>{if(_||S==null)return null;const $e=P.findIndex(Fe=>Fe.value===Y);return $e===-1?null:$e},[S,P,Y,_]),q=(0,r.useMemo)(()=>S==null?null:Q!==null&&!_?P[Q]:typeof S=="object"?S:{value:S,label:S.toString()},[Q,_,S,P]),oe=`${te}-downshift-menu`,re=`${te}-downshift-label`,ee=(0,o.of)(x.C3),B=(0,r.useCallback)($e=>{const Fe=Math.max(0,$e.startIndex-$e.overscan),We=Math.min(Z.length-1,$e.endIndex+$e.overscan),Ge=Array.from({length:We-Fe+1},(De,xe)=>Fe+xe),me=Z[Ge[0]];if(me?.group){const De=se.get(me.group);De!==void 0&&Depe.current,estimateSize:$e=>{const Fe=(0,y.S)(Z[$e],$e>0?Z[$e-1]:void 0),We="description"in Z[$e],Ge="group"in Z[$e];let me=x.Aj;return We&&(me=x.pg),Fe&&Ge&&(me+=x.Aj),me},overscan:b,rangeExtractor:B}),{isOpen:de,highlightedIndex:fe,getInputProps:ce,getMenuProps:ve,getItemProps:Se,selectItem:je}=(0,c.Bp)({menuId:oe,labelId:re,inputId:N,items:Z,itemToString:v.y,selectedItem:q,onSelectedItemChange:({selectedItem:$e})=>{(L||$e!==null)&&C($e)},defaultHighlightedIndex:Q??0,scrollIntoView:()=>{},onIsOpenChange:({isOpen:$e,inputValue:Fe})=>{$e&&Fe===""&&ae(Fe)},onHighlightedIndexChange:({highlightedIndex:$e,type:Fe})=>{Fe!==c.Bp.stateChangeTypes.MenuMouseLeave&&ie.scrollToIndex($e)},onStateChange:({inputValue:$e,type:Fe,selectedItem:We})=>{switch(Fe){case c.Bp.stateChangeTypes.InputChange:ae($e??"");break;default:break}},stateReducer($e,Fe){let{changes:We}=Fe;const Ge=$e.isOpen===!1&&We.isOpen===!0,me=$e.isOpen===!0&&We.isOpen===!1;return Ge&&We.inputValue===$e.inputValue&&(We={...We,inputValue:""}),me&&(We.selectedItem?We={...We,inputValue:(0,v.y)(We.selectedItem)}:We.inputValue!==""&&(We={...We,inputValue:""})),We}}),{inputRef:Ve,floatingRef:he,floatStyles:Ue,scrollRef:pe}=(0,m.l)(Z,de),be=V==="auto",ze=be?f.D:h.p,Ne=(de?(0,v.y)(q):null)||R,Ie=D.loading||J,ke=(0,t.jsxs)(t.Fragment,{children:[Y!==void 0&&Y===q?.value&&L&&(0,t.jsx)(l.I,{name:"times",className:ee.clear,title:(0,i.t)("combobox.clear.title","Clear value"),tabIndex:0,role:"button",onClick:()=>{je(null)},onKeyDown:$e=>{($e.key==="Enter"||$e.key===" ")&&je(null)}}),(0,t.jsx)(g.f,{isLoading:Ie||!1,isOpen:de})]}),{Wrapper:Ee,wrapperProps:Ae}=be?{Wrapper:"div",wrapperProps:{className:ee.adaptToParent}}:{Wrapper:r.Fragment};return(0,t.jsxs)(Ee,{...Ae,children:[(0,t.jsx)(ze,{width:be?void 0:V,...be?{minWidth:w,maxWidth:M}:{},autoFocus:K,onBlur:z,prefix:H&&(0,t.jsx)(l.I,{name:H}),disabled:G,invalid:W,className:ee.input,suffix:ke,...ce({ref:Ve,onChange:E,"aria-labelledby":O,placeholder:Ne,"data-testid":U})}),(0,t.jsx)(d.ZL,{root:F,children:(0,t.jsx)("div",{className:(0,n.cx)(ee.menu,!de&&ee.menuClosed),style:{...Ue,pointerEvents:"auto"},...ve({ref:he,"aria-labelledby":O}),children:de&&(0,t.jsx)(s.e,{loading:Ie,options:Z,highlightedIndex:fe,selectedItems:q?[q]:[],scrollRef:pe,getItemProps:Se,error:k})})})]})}},70733(ne,A,e){"use strict";e.d(A,{e:()=>u});var t=e(74848),n=e(22803),a=e(72181),c=e(96540),r=e(63142),i=e(32635),o=e(92807),l=e(92745),f=e(30703),h=e(31286),d=e(41654),s=e(66404);const g=()=>(0,t.jsxs)(m,{children:[(0,t.jsx)(s.E,{color:"warning",children:(0,t.jsx)(f.I,{name:"exclamation-triangle",size:"md"})}),(0,t.jsx)(l.x6,{i18nKey:"combobox.async.error",children:"An error occurred while loading options."})]}),v=()=>(0,t.jsx)(m,{children:(0,t.jsx)(l.x6,{i18nKey:"combobox.options.no-found",children:"No options found."})}),x=()=>(0,t.jsx)(m,{children:(0,t.jsx)(l.x6,{i18nKey:"combobox.options.loading",children:"Loading options..."})}),m=({children:D})=>(0,t.jsx)(h.a,{padding:2,children:(0,t.jsx)(d.B,{justifyContent:"center",alignItems:"center",direction:"column",children:D})});var p=e(98869),y=e(33605),E=e(93521);const b=4,u=({options:D,highlightedIndex:P,selectedItems:C=[],scrollRef:S,getItemProps:R,enableAllOption:L,isMultiSelect:j=!1,error:N=!1,loading:V=!1})=>{const w=(0,r.of)(p.C3),M=(0,c.useCallback)(z=>{const G=(0,E.S)(D[z],z>0?D[z-1]:void 0),F="description"in D[z],W="group"in D[z];let H=p.Aj;return F&&(H=p.pg),G&&W&&(H+=p.Aj),H},[D]),O=(0,a.Te)({count:D.length,getScrollElement:()=>S.current,estimateSize:M,overscan:b}),U=(0,c.useCallback)(z=>C.some(G=>G.value===z.value),[C]),K=L&&D.length>1&&C.length===D.length-1;return(0,t.jsxs)(o.P,{showScrollIndicators:!0,maxHeight:"inherit",ref:S,padding:.5,children:[(0,t.jsx)("div",{style:{height:O.getTotalSize()},className:w.menuUlContainer,children:O.getVirtualItems().map((z,G,F)=>{const W=D[z.index],H=(0,E.S)(W,D[z.index-1]),Y=F.find(ae=>D[ae.index].group===W.group),te=Y&&D[Y.index],Z=`combobox-option-${W.value}`,se=te?`combobox-option-group-${te.value}`:void 0;return(0,t.jsxs)("div",{className:w.listItem,style:{height:z.size,transform:`translateY(${z.start}px)`},children:[H&&(0,t.jsx)("div",{role:"presentation","data-testid":"combobox-option-group",id:se,className:(0,n.cx)(w.optionGroupHeader,W.group&&w.optionGroupLabel,z.index===0&&w.optionFirstGroupHeader),children:W.group}),(0,t.jsxs)("div",{className:(0,n.cx)(w.option,!j&&U(W)&&w.optionSelected,P===z.index&&!W.infoOption&&w.optionFocused,W.infoOption&&w.optionInfo),...R({item:W,index:z.index,id:Z,"aria-describedby":se,disabled:W.infoOption}),children:[j&&(0,t.jsx)("div",{className:w.optionAccessory,children:!W.infoOption&&(0,t.jsx)(i.S,{value:K||U(W),indeterminate:W.value===y.A&&C.length>0&&!K,"aria-labelledby":Z,onClick:ae=>{ae.stopPropagation()},"data-testid":`${Z}-checkbox`},Z)}),(0,t.jsxs)("div",{className:w.optionBody,children:[(0,t.jsx)("div",{className:w.optionLabel,children:W.label??W.value}),W.description&&(0,t.jsx)("div",{className:w.optionDescription,children:W.description})]})]})]},W.value)})}),(0,t.jsxs)("div",{"aria-live":"polite",children:[N&&(0,t.jsx)(g,{}),!V&&D.length===0&&!N&&(0,t.jsx)(v,{}),V&&D.length===0&&(0,t.jsx)(x,{})]})]})}},70683(ne,A,e){"use strict";e.d(A,{f:()=>O});var t=e(74848),n=e(22803),a=e(31033),c=e(96540),r=e(92745),i=e(63142),o=e(30703),l=e(31286),f=e(15245),h=e(66404),d=e(45967),s=e(70733),g=e(92842),v=e(76319);const x=(0,c.forwardRef)(({children:z,onRemove:G,disabled:F,...W},H)=>{const Y=(0,i.of)(m,F),te=(0,r.t)("grafana-ui.value-pill.remove-button","Remove {{children}}",{children:z});return(0,t.jsxs)("span",{className:Y.wrapper,...W,ref:H,children:[(0,t.jsx)("span",{className:Y.text,children:z}),!F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:Y.separator}),(0,t.jsx)(v.K,{name:"times",size:"md","aria-label":te,onClick:Z=>{Z.stopPropagation(),G()}})]})]})});x.displayName="ValuePill";const m=(z,G)=>({wrapper:(0,n.css)({display:"inline-flex",borderRadius:z.shape.radius.sm,color:z.colors.text.primary,background:z.colors.background.secondary,padding:z.spacing(.25),border:G?`1px solid ${z.colors.border.weak}`:"none",fontSize:z.typography.bodySmall.fontSize,flexShrink:0,minWidth:"50px",alignItems:"center","&:first-child:has(+ div)":{flexShrink:1}}),text:(0,n.css)({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:z.spacing(0,1,0,.75)}),separator:(0,n.css)({background:z.colors.border.weak,width:"1px",height:"100%",marginRight:z.spacing(.5)})});var p=e(74440),y=e(98869),E=e(35484),b=e(63527);const u=(z,G,F,W,H,Y,te,Z)=>{const se=(0,b.n)({theme:z,invalid:F}),ae=(0,E.getFocusStyles)(z),J=H&&H!=="auto"?z.spacing(H):"100%",k=Y?z.spacing(Y):"",_=te?z.spacing(te):"";return{container:(0,n.css)({width:H==="auto"?"auto":J,minWidth:k,maxWidth:_,display:H==="auto"?"inline-block":"block"}),wrapper:(0,n.cx)(se.input,(0,n.css)({display:"flex",alignItems:"center",width:"100%",gap:z.spacing(.5),padding:z.spacing(.5),paddingRight:Z?z.spacing(5):28,"&:focus-within":{...ae}})),input:(0,n.css)({border:"none",outline:"none",background:"transparent",flexGrow:1,maxWidth:"100%",minWidth:40,"&::placeholder":{color:z.colors.text.disabled},"&:focus":{outline:"none",cursor:"text"},cursor:"pointer"}),pillWrapper:(0,n.css)({display:"inline-flex",flexWrap:G?"wrap":"nowrap",flexGrow:1,minWidth:"50px",gap:z.spacing(.5)}),restNumber:(0,n.css)({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:z.spacing(0,1),border:W?`1px solid ${z.colors.border.weak}`:"none",borderRadius:z.shape.radius.default,backgroundColor:z.colors.background.secondary,cursor:"pointer","&:hover":{backgroundColor:z.colors.action.hover}}),suffix:se.suffix,disabled:se.inputDisabled}};var D=e(33605),P=e(75168),C=e(49185),S=e(53568);const R=12,L=50,j=10,N=15;function V(z,G,F){const[W,H]=(0,c.useState)(z.length),[Y,{width:te}]=(0,C.A)(),[Z,{width:se}]=(0,C.A)(),[ae,{width:J}]=(0,C.A)(),k=G&&G!=="auto"?G:te;return(0,c.useEffect)(()=>{const _=k-se-J;let Q=0;for(let q=0;q_){H(Math.min(q,N)||1);break}q===z.length-1&&H(z.length)}},[k,se,J,z,H,F]),{measureRef:Y,counterMeasureRef:Z,suffixMeasureRef:ae,shownItems:W}}function w(z){const G=(0,c.useRef)(null),F=(0,c.useRef)(0),[W,H]=(0,c.useState)("");return(0,c.useLayoutEffect)(()=>{if(G.current&&z==null&&F.current===0&&(F.current=G?.current.getBoundingClientRect().width),!G.current||z==null){H("");return}const Y=window.getComputedStyle(G.current).fontSize,te=(0,S.kD)(G.current.value||"",parseInt(Y,10)).width;te{const{placeholder:G,onChange:F,value:W,width:H,enableAllOption:Y,invalid:te,disabled:Z,minWidth:se,maxWidth:ae,isClearable:J,createCustomValue:k=!1,"aria-labelledby":_,"data-testid":Q,portalContainer:q,prefixIcon:oe}=z,re=(0,i.of)(y.C3),[ee,B]=(0,c.useState)(""),ie=(0,c.useMemo)(()=>({label:ee===""?(0,r.t)("multicombobox.all.title","All"):(0,r.t)("multicombobox.all.title-filtered","All (filtered)"),value:D.A}),[ee]),{options:de,updateOptions:fe,asyncLoading:ce,asyncError:ve}=(0,M.II)(z.options,k),Se=(0,c.useMemo)(()=>Y&&de.length>1?[ie,...de]:de,[de,Y,ie]),je=z.loading||ce,Ve=(0,c.useMemo)(()=>W?U(W,typeof z.options!="function"?z.options:de):[],[W,z.options,de]),{measureRef:he,counterMeasureRef:Ue,suffixMeasureRef:pe,shownItems:be}=V(Ve,H,Z),ze=(0,c.useCallback)(et=>Ve.some(qe=>qe.value===et.value),[Ve]),{getSelectedItemProps:Ne,getDropdownProps:Ie,setSelectedItems:ke,addSelectedItem:Ee,removeSelectedItem:Ae,reset:$e}=(0,a.mH)({selectedItems:Ve,onStateChange:({type:et,selectedItems:qe})=>{switch(et){case a.mH.stateChangeTypes.SelectedItemKeyDownBackspace:case a.mH.stateChangeTypes.SelectedItemKeyDownDelete:case a.mH.stateChangeTypes.DropdownKeyDownBackspace:case a.mH.stateChangeTypes.FunctionRemoveSelectedItem:case a.mH.stateChangeTypes.FunctionAddSelectedItem:case a.mH.stateChangeTypes.FunctionSetSelectedItems:case a.mH.stateChangeTypes.FunctionReset:F(qe??[]);break;default:break}},stateReducer:(et,qe)=>{const{changes:nt}=qe;return{...nt,activeIndex:-999}}}),{getToggleButtonProps:Fe,isOpen:We,highlightedIndex:Ge,getMenuProps:me,getInputProps:De,getItemProps:xe}=(0,a.Bp)({items:Se,itemToString:p.y,inputValue:ee,selectedItem:null,stateReducer:(et,qe)=>{const{type:nt}=qe;let{changes:ot}=qe;switch(et.isOpen===!1&&ot.isOpen===!0&&ot.inputValue===et.inputValue&&(ot={...ot,inputValue:""}),nt){case a.Bp.stateChangeTypes.InputKeyDownEnter:case a.Bp.stateChangeTypes.ItemClick:return{...ot,isOpen:!0,highlightedIndex:et.highlightedIndex};case a.Bp.stateChangeTypes.InputBlur:B("");default:return ot}},onIsOpenChange:({isOpen:et,inputValue:qe})=>{et&&qe===""&&fe(qe)},onStateChange:({inputValue:et,type:qe,selectedItem:nt})=>{switch(qe){case a.Bp.stateChangeTypes.InputKeyDownEnter:case a.Bp.stateChangeTypes.ItemClick:if(nt?.infoOption)break;if(nt?.value===D.A){const ot=Ve.length===Se.length-1,Ze=Se.slice(1).filter(it=>!it.infoOption);let at=ot&&ee===""?[]:Ze;if(!ot&&ee!==""&&(at=[...new Set([...Ve,...Ze])]),ot&&ee!==""){const it=new Set(Ze.map(ct=>ct.value));at=Ve.filter(ct=>!it.has(ct.value))}ke(at)}else if(nt&&ze(nt)){const ot=Ve.find(Ze=>Ze.value===nt.value);ot&&Ae(ot)}else nt&&Ee(nt);break;case a.Bp.stateChangeTypes.InputChange:B(et??""),fe(et??"");break;default:break}}}),{inputRef:Me,floatingRef:Be,floatStyles:Oe,scrollRef:Re}=(0,P.l)(Se,We),we=(0,i.of)(u,We,te,Z,H,se,ae,J),Ce=We?Ve.slice(0,N):Ve.slice(0,be),{inputRef:_e,inputWidth:Je}=w(ee);return(0,t.jsxs)("div",{className:we.container,ref:Me,children:[(0,t.jsxs)("div",{className:(0,n.cx)(we.wrapper,{[we.disabled]:Z}),ref:he,children:[oe&&(0,t.jsx)(l.a,{marginLeft:.5,children:(0,t.jsx)(h.E,{color:"secondary",children:(0,t.jsx)(o.I,{name:oe})})}),(0,t.jsxs)("span",{className:we.pillWrapper,children:[Ce.map((et,qe)=>(0,t.jsx)(x,{disabled:Z,onRemove:()=>{Ae(et)},...Ne({selectedItem:et,index:qe}),children:(0,p.y)(et)},`${et.value}${qe}`)),Ve.length>Ce.length&&(0,t.jsxs)(l.a,{display:"flex",direction:"row",marginLeft:.5,gap:1,ref:Ue,children:[(0,t.jsx)(h.E,{children:"..."}),(0,t.jsx)(d.m,{interactive:!0,content:(0,t.jsx)(t.Fragment,{children:Ve.slice(Ce.length).map(et=>(0,t.jsx)("div",{children:(0,p.y)(et)},et.value))}),children:(0,t.jsx)("div",{className:we.restNumber,children:Ve.length-be})})]}),(0,t.jsx)("input",{className:we.input,...De({...Ie({disabled:Z,preventKeyAction:We,placeholder:Ce.length===0?G:"",ref:_e,style:{width:Je}}),"aria-labelledby":_,"data-testid":Q})}),(0,t.jsxs)("div",{className:we.suffix,ref:pe,...Fe(),children:[J&&Ve.length>0&&(0,t.jsx)(o.I,{name:"times",className:re.clear,title:(0,r.t)("multicombobox.clear.title","Clear all"),tabIndex:0,role:"button",onClick:et=>{et.stopPropagation(),$e()},onKeyDown:et=>{(et.key==="Enter"||et.key===" ")&&$e()}}),(0,t.jsx)(g.f,{isLoading:je||!1,isOpen:We})]})]})]}),(0,t.jsx)(f.ZL,{root:q,children:(0,t.jsx)("div",{className:(0,n.cx)(re.menu,!We&&re.menuClosed),style:{...Oe,width:Oe.width+24,pointerEvents:"auto"},...me({ref:Be}),children:We&&(0,t.jsx)(s.e,{loading:je,options:Se,highlightedIndex:Ge,selectedItems:Ve,scrollRef:Re,getItemProps:xe,enableAllOption:Y,isMultiSelect:!0,error:ve})})})]})};function U(z,G){if(K(z))return z;const F=new Map(z.map((H,Y)=>[H,Y])),W=[];for(const H of G){const Y=F.get(H.value);if(Y!==void 0&&(W[Y]=H,F.delete(H.value)),F.size===0)break}for(const[H,Y]of F)W[Y]={value:H};return W}function K(z){return typeof z[0]=="object"}},92842(ne,A,e){"use strict";e.d(A,{f:()=>a});var t=e(74848),n=e(30703);const a=({isLoading:c,isOpen:r})=>{const i=c?"spinner":r?"search":"angle-down";return(0,t.jsx)(n.I,{name:i})}},74440(ne,A,e){"use strict";e.d(A,{o:()=>a,y:()=>n});var t=e(99885);function n(c){return c==null?"":c.label??c.value.toString()}function a(c,r,i){return(0,t.X)(r,i).map(l=>c[l])}},98869(ne,A,e){"use strict";e.d(A,{AK:()=>r,Aj:()=>l,C3:()=>d,pg:()=>f,sh:()=>n,xB:()=>h,zx:()=>c});var t=e(22803);const n=14,a=12,c=500,r=8,i=2,o=1.5,l=i+r*2+n*o,f=l+a*o,h=l*8.5,d=s=>({menuClosed:(0,t.css)({display:"none"}),menu:(0,t.css)({label:"combobox-menu",background:s.components.dropdown.background,boxShadow:s.shadows.z3,zIndex:s.zIndex.dropdown,position:"relative",borderRadius:s.shape.radius.default,overflow:"hidden"}),menuUlContainer:(0,t.css)({label:"combobox-menu-ul-container",listStyle:"none"}),listItem:(0,t.css)({label:"list-item",position:"absolute",width:"100%"}),optionGroupHeader:(0,t.css)({label:"combobox-new-option-group",borderTop:`1px solid ${s.colors.border.weak}`}),optionFirstGroupHeader:(0,t.css)({borderTop:"none"}),optionGroupLabel:(0,t.css)({textOverflow:"ellipsis",overflow:"hidden",letterSpacing:0,color:s.colors.text.secondary,fontSize:s.typography.bodySmall.fontSize,fontWeight:s.typography.fontWeightLight,padding:r}),option:(0,t.css)({label:"combobox-option",position:"relative",display:"flex",width:"100%",gap:s.spacing(1),alignItems:"center",padding:r,marginBottom:i,borderRadius:s.shape.radius.default,fontWeight:s.typography.fontWeightMedium,whiteSpace:"nowrap",overflow:"hidden",cursor:"pointer","&:hover":{background:s.colors.action.hover,"@media (forced-colors: active), (prefers-contrast: more)":{border:`1px solid ${s.colors.primary.border}`}}}),optionAccessory:(0,t.css)({label:"combobox-option-accessory",height:n*o}),optionBody:(0,t.css)({label:"combobox-option-body",display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden"}),optionLabel:(0,t.css)({label:"combobox-option-label",fontSize:n,fontWeight:c,lineHeight:o,letterSpacing:0,textOverflow:"ellipsis",overflow:"hidden"}),optionDescription:(0,t.css)({label:"combobox-option-description",color:s.colors.text.secondary,fontSize:a,fontWeight:s.typography.fontWeightRegular,lineHeight:o,letterSpacing:0,textOverflow:"ellipsis",overflow:"hidden"}),optionFocused:(0,t.css)({label:"combobox-option-focused",background:s.colors.action.focus,"@media (forced-colors: active), (prefers-contrast: more)":{border:`1px solid ${s.colors.primary.border}`}}),optionSelected:(0,t.css)({background:s.colors.action.selected,"&::before":{backgroundImage:s.colors.gradients.brandVertical,borderRadius:s.shape.radius.default,content:'" "',display:"block",height:"100%",position:"absolute",width:s.spacing(.5),left:0,top:0}}),optionInfo:(0,t.css)({label:"combobox-option-info",color:s.colors.text.disabled,cursor:"not-allowed",pointerEvents:"none","&:hover":{background:"transparent"}}),clear:(0,t.css)({label:"combobox-clear",cursor:"pointer",pointerEvents:"auto","&:hover":{color:s.colors.text.primary}}),input:(0,t.css)({label:"combobox-input","> div > div:last-child":{pointerEvents:"none"},"& input":{cursor:"pointer"},"& input:focus":{cursor:"text"}}),adaptToParent:(0,t.css)({label:"combobox-adapt-to-parent",maxWidth:"100%",'[class*="input-wrapper-combobox-input"]':{maxWidth:"100%"}})})},33605(ne,A,e){"use strict";e.d(A,{A:()=>t});const t="__GRAFANA_INTERNAL_MULTICOMBOBOX_ALL_OPTION__"},75168(ne,A,e){"use strict";e.d(A,{l:()=>d});var t=e(83505),n=e(46885),a=e(34743),c=e(96540),r=e(76373),i=e(53568),o=e(98869);const l=1e5,f=16,h=8,d=(g,v)=>{const x=(0,c.useRef)(null),m=(0,c.useRef)(null),p=(0,c.useRef)(null),[y,E]=(0,c.useState)({width:0,height:0}),b=(0,c.useMemo)(()=>s(),[]),u=[(0,a.RK)({allowedPlacements:["bottom-start","bottom-end","top-start","top-end"],boundary:document.getElementById(r.BOUNDARY_ELEMENT_ID)??void 0,crossAxis:!0}),(0,a.Ej)({apply({availableWidth:R,availableHeight:L}){const j=R-f,N=L-f,V=Math.max(j,0),w=Math.min(Math.max(N,o.Aj*6),o.xB);E({width:V,height:w})}})],D={reference:x.current,floating:m.current},{floatingStyles:P}=(0,t.we)({strategy:"fixed",open:v,placement:"bottom-start",middleware:u,elements:D,whileElementsMounted:n.ll}),C=(0,c.useMemo)(()=>{let R="";const L=Math.min(g.length,l);for(let N=0;NR.length?V:R}return(0,i.kD)(R,o.sh,o.zx).width+h+o.AK*2+b},[g,b]),S={...P,width:C,maxWidth:y.width,minWidth:x.current?.offsetWidth,maxHeight:y.height};return{inputRef:x,floatingRef:m,scrollRef:p,floatStyles:S}};function s(){const g=document.createElement("div");g.style.visibility="hidden",g.style.overflow="scroll",document.body.appendChild(g);const v=document.createElement("div");g.appendChild(v);const x=g.offsetWidth-v.offsetWidth;return g.parentNode?.removeChild(g),x}},5320(ne,A,e){"use strict";e.d(A,{II:()=>f});var t=e(2543),n=e(96540),a=e(92745),c=e(74440);function r(d){const s=(0,n.useRef)(0);return(0,n.useCallback)(v=>{s.current++;const x=s.current;return new Promise((m,p)=>{d(v).then(y=>{x===s.current?m(y):p(new i)}).catch(p)})},[d])}class i extends Error{constructor(){super("This result is stale and is discarded"),this.name="StaleResultError",Object.setPrototypeOf(this,new.target.prototype)}}const o=()=>Promise.resolve([]),l=200;function f(d,s){const g=typeof d=="function",v=r(g?d:o),x=(0,n.useMemo)(()=>(0,t.debounce)(V=>v(V).then(w=>{p(w),E(!1),u(!1)}).catch(w=>{w instanceof i||(u(!0),E(!1),w&&console.error("Error loading async options for Combobox",w))}),l),[v]),[m,p]=(0,n.useState)([]),[y,E]=(0,n.useState)(!1),[b,u]=(0,n.useState)(!1),[D,P]=(0,n.useState)(""),C=(0,n.useCallback)(V=>{let w=V;return s&&D&&(V.some(O=>O.value===D)||(w=w.slice(),w.unshift({label:D,value:D,description:(0,a.t)("combobox.custom-value.description","Use custom value")}))),w},[s,D]),S=(0,n.useCallback)(V=>{P(V),g&&(E(!0),x(V))},[x,g]),R=(0,n.useMemo)(()=>g?[]:d.map(c.y),[g,d]),L=(0,n.useMemo)(()=>g?m:(0,c.o)(d,R,D),[m,g,d,R,D]),[j,N]=(0,n.useMemo)(()=>{const{options:V,groupStartIndices:w}=h(L);return[C(V),w]},[L,C]);return{options:j,groupStartIndices:N,updateOptions:S,asyncLoading:y,asyncError:b}}function h(d){const s=new Map,g=new Map;for(const m of d){const p=m.group,y=s.get(p);y?y.push(m):s.set(p,[m])}if(s.size<=1)return d[0]?.group&&g.set(d[0]?.group,0),{options:d,groupStartIndices:g};const v=new Array(d.length);let x=0;for(const[m,p]of s){m&&g.set(m,x);for(const y of p)v[x++]=y}return{options:v,groupStartIndices:g}}},93521(ne,A,e){"use strict";e.d(A,{S:()=>t});const t=(n,a)=>{const c=n.group;return c?a?a.group!==c:!0:!!a?.group}},7075(ne,A,e){"use strict";e.d(A,{Z:()=>o});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(45861);const o=({children:f,className:h,closeOnConfirm:d,confirmText:s="Save",confirmVariant:g="primary",disabled:v=!1,onCancel:x,onClick:m,onConfirm:p,size:y="md"})=>{const E=(0,a.useRef)(null),b=(0,a.useRef)(null),[u,D]=(0,a.useState)(!1),[P,C]=(0,a.useState)(!1),S=(0,r.of)(l);(0,a.useEffect)(()=>{u?(b.current?.focus(),C(!0)):P&&(E.current?.focus(),C(!1))},[P,u]);const R=M=>{M&&M.preventDefault(),D(!0),m?.()},L=M=>{M&&M.preventDefault(),D(!1),E.current?.focus(),x?.()},j=M=>{M&&M.preventDefault(),p?.(),d&&D(!1)},N=(0,n.cx)(h,S.mainButton,{[S.mainButtonHide]:u}),V=(0,n.cx)(S.confirmButton,{[S.confirmButtonHide]:!u}),w=(0,n.cx)(S.confirmButtonContainer,{[S.confirmButtonContainerHide]:!u});return(0,t.jsxs)("div",{className:S.container,children:[(0,t.jsx)("span",{className:N,children:typeof f=="string"?(0,t.jsx)(i.$n,{disabled:v,size:y,fill:"text",onClick:R,ref:E,children:f}):a.cloneElement(f,{disabled:v,onClick:R,ref:E})}),(0,t.jsx)("div",{className:w,children:(0,t.jsxs)("span",{className:V,children:[(0,t.jsx)(i.$n,{size:y,variant:g,onClick:j,ref:b,children:s}),(0,t.jsx)(i.$n,{size:y,fill:"text",onClick:L,children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.confirm-button.cancel",children:"Cancel"})})]})})]})};o.displayName="ConfirmButton";const l=f=>({container:(0,n.css)({alignItems:"center",display:"flex",justifyContent:"flex-end",position:"relative"}),mainButton:(0,n.css)({opacity:1,[f.transitions.handleMotion("no-preference")]:{transition:f.transitions.create(["opacity"],{duration:f.transitions.duration.shortest,easing:f.transitions.easing.easeOut})},zIndex:2}),mainButtonHide:(0,n.css)({opacity:0,[f.transitions.handleMotion("no-preference")]:{transition:f.transitions.create(["opacity","visibility"],{duration:f.transitions.duration.shortest,easing:f.transitions.easing.easeIn})},visibility:"hidden",zIndex:0}),confirmButtonContainer:(0,n.css)({overflow:"visible",position:"absolute",pointerEvents:"all",right:0}),confirmButtonContainerHide:(0,n.css)({overflow:"hidden",pointerEvents:"none"}),confirmButton:(0,n.css)({alignItems:"flex-start",background:f.colors.background.primary,display:"flex",opacity:1,transform:"translateX(0)",[f.transitions.handleMotion("no-preference")]:{transition:f.transitions.create(["opacity","transform"],{duration:f.transitions.duration.shortest,easing:f.transitions.easing.easeOut})},zIndex:1}),confirmButtonHide:(0,n.css)({opacity:0,transform:"translateX(100%)",[f.transitions.handleMotion("no-preference")]:{transition:f.transitions.create(["opacity","transform","visibility"],{duration:f.transitions.duration.shortest,easing:f.transitions.easing.easeIn})},visibility:"hidden"})})},44458(ne,A,e){"use strict";e.d(A,{e:()=>r});var t=e(74848),n=e(92745),a=e(45861),c=e(7075);const r=({size:i,disabled:o,onConfirm:l,"aria-label":f,closeOnConfirm:h})=>(0,t.jsx)(c.Z,{confirmText:(0,n.t)("grafana-ui.confirm-button.confirmText-delete","Delete"),confirmVariant:"destructive",size:i||"md",disabled:o,onConfirm:l,closeOnConfirm:h,children:(0,t.jsx)(a.$n,{"aria-label":f??(0,n.t)("grafana-ui.confirm-button.aria-label-delete","Delete"),variant:"destructive",icon:"times",size:i||"sm"})})},70735(ne,A,e){"use strict";e.d(A,{k:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(49785),r=e(51898),i=e(92745),o=e(63142),l=e(45861),f=e(37386),h=e(63527),d=e(41654);const s=({body:v,confirmPromptText:x,confirmButtonLabel:m,confirmButtonVariant:p,dismissButtonVariant:y,dismissButtonLabel:E,onConfirm:b,onDismiss:u,onAlternative:D,alternativeButtonLabel:P,description:C,justifyButtons:S="flex-end",disabled:R})=>{const[L,j]=(0,a.useState)(R),N=(0,o.of)(g),V=(0,a.useRef)(null),w=K=>{j(x?.toLowerCase().localeCompare(K.currentTarget.value.toLowerCase())!==0)};(0,a.useEffect)(()=>{V.current?.focus()},[]),(0,a.useEffect)(()=>{j(R?!0:!!x)},[x,R]);const M=async()=>{R===void 0&&j(!0);try{await b()}finally{R===void 0&&j(!1)}},{handleSubmit:O}=(0,c.mN)(),U=(0,i.t)("grafana-ui.confirm-content.placeholder",'Type "{{confirmPromptText}}" to confirm',{confirmPromptText:x});return(0,t.jsxs)("form",{onSubmit:O(M),children:[(0,t.jsxs)("div",{className:N.text,children:[v,C?(0,t.jsx)("div",{className:N.description,children:C}):null,x?(0,t.jsx)("div",{className:N.confirmationInput,children:(0,t.jsx)(d.B,{alignItems:"flex-start",children:(0,t.jsx)(f.D,{disabled:R,children:(0,t.jsx)(h.p,{placeholder:U,onChange:w,"data-testid":r.Tp.pages.ConfirmModal.input})})})}):null]}),(0,t.jsx)("div",{className:N.buttonsContainer,children:(0,t.jsxs)(d.B,{justifyContent:S,gap:2,wrap:"wrap",children:[(0,t.jsx)(l.$n,{variant:y,onClick:u,fill:"outline",children:E}),(0,t.jsx)(l.$n,{type:"submit",variant:p,disabled:L,ref:V,"data-testid":r.Tp.pages.ConfirmModal.delete,children:m}),D?(0,t.jsx)(l.$n,{variant:"primary",onClick:D,children:P}):null]})})]})},g=v=>({text:(0,n.css)({fontSize:v.typography.h5.fontSize,color:v.colors.text.primary}),description:(0,n.css)({fontSize:v.typography.body.fontSize}),confirmationInput:(0,n.css)({paddingTop:v.spacing(1)}),buttonsContainer:(0,n.css)({paddingTop:v.spacing(3)})})},71599(ne,A,e){"use strict";e.d(A,{u:()=>i});var t=e(74848),n=e(22803),a=e(63142),c=e(22787),r=e(70735);const i=({isOpen:l,title:f,body:h,description:d,confirmText:s,confirmVariant:g="destructive",confirmationText:v,dismissText:x="Cancel",dismissVariant:m="secondary",alternativeText:p,modalClass:y,icon:E="exclamation-triangle",onConfirm:b,onDismiss:u,onAlternative:D,confirmButtonVariant:P="destructive",disabled:C})=>{const S=(0,a.of)(o);return(0,t.jsx)(c.a,{className:(0,n.cx)(S.modal,y),title:f,icon:E,isOpen:l,onDismiss:u,children:(0,t.jsx)(r.k,{body:h,description:d,confirmButtonLabel:s,dismissButtonLabel:x,dismissButtonVariant:m,confirmPromptText:v,alternativeButtonLabel:p,confirmButtonVariant:P,onConfirm:b,onDismiss:u,onAlternative:D,disabled:C})})},o=()=>({modal:(0,n.css)({width:"500px"})})},97375(ne,A,e){"use strict";e.d(A,{t:()=>o});var t=e(74848),n=e(96540),a=e(29647),c=e(51898),r=e(87063),i=e(15245);const o=n.memo(({x:l,y:f,onClose:h,focusOnOpen:d=!0,renderMenuItems:s,renderHeader:g})=>{const v=(0,n.useRef)(null),[x,m]=(0,n.useState)({});(0,n.useLayoutEffect)(()=>{const u=v.current;if(u){const D=u.getBoundingClientRect(),P=5,C={right:window.innerWidth{h?.()});const p=g?.(),y=s?.(),E=u=>{d&&u(0)},b=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),h?.())};return(0,t.jsx)(i.ZL,{children:(0,t.jsx)(r.W,{header:p,ref:v,style:x,ariaLabel:c.Tp.components.Menu.MenuComponent("Context"),onOpen:E,onClick:h,onKeyDown:b,children:y})})});o.displayName="ContextMenu"},41479(ne,A,e){"use strict";e.d(A,{n:()=>c});var t=e(74848),n=e(96540),a=e(97375);const c=({children:r,renderMenuItems:i,focusOnOpen:o=!0})=>{const[l,f]=(0,n.useState)(!1),[h,d]=(0,n.useState)({x:0,y:0});return(0,t.jsxs)(t.Fragment,{children:[r({openMenu:s=>{f(!0),d({x:s.pageX,y:s.pageY-window.scrollY})}}),l&&(0,t.jsx)(a.t,{onClose:()=>f(!1),x:h.x,y:h.y,renderMenuItems:i,focusOnOpen:o})]})}},52718(ne,A,e){"use strict";e.d(A,{E:()=>l,A:()=>f});var t=e(74848),n=e(22803),a=e(96540),c=e(62295),r=e(63142);const i=({children:s})=>{const[g,v]=(0,a.useState)(!1),[x,m]=(0,a.useState)(!1),p=(0,a.useRef)(null),y=(0,a.useRef)(null),E=(0,r.of)(o);return(0,a.useEffect)(()=>{const b=new IntersectionObserver(u=>{u.forEach(D=>{D.target===p.current?v(!D.isIntersecting):D.target===y.current&&m(!D.isIntersecting)})});return[p,y].forEach(u=>{u.current&&b.observe(u.current)}),()=>b.disconnect()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,n.cx)(E.scrollIndicator,E.scrollTopIndicator,{[E.scrollIndicatorVisible]:g})}),(0,t.jsxs)("div",{className:E.scrollContent,children:[(0,t.jsx)("div",{ref:p}),s,(0,t.jsx)("div",{ref:y})]}),(0,t.jsx)("div",{className:(0,n.cx)(E.scrollIndicator,E.scrollBottomIndicator,{[E.scrollIndicatorVisible]:x})})]})},o=s=>({scrollContent:(0,n.css)({flex:1,position:"relative"}),scrollIndicator:(0,n.css)({height:s.spacing(6),left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,[s.transitions.handleMotion("no-preference","reduce")]:{transition:s.transitions.create("opacity")},zIndex:1}),scrollTopIndicator:(0,n.css)({background:`linear-gradient(0deg, transparent, ${s.colors.background.canvas})`,top:0}),scrollBottomIndicator:(0,n.css)({background:`linear-gradient(180deg, transparent, ${s.colors.background.canvas})`,bottom:0}),scrollIndicatorVisible:(0,n.css)({opacity:1})}),l=({autoHide:s=!1,autoHideTimeout:g=200,setScrollTop:v,className:x,testId:m,autoHeightMin:p="0",autoHeightMax:y="100%",hideTracksWhenNotNeeded:E=!1,hideHorizontalTrack:b,hideVerticalTrack:u,scrollRefCallback:D,showScrollIndicators:P=!1,updateAfterMountMs:C,scrollTop:S,onScroll:R,children:L,divId:j})=>{const N=(0,a.useRef)(null),V=(0,r.of)(h);(0,a.useEffect)(()=>{N.current&&D&&D(N.current.view)},[N,D]),d(N.current,S),(0,a.useEffect)(()=>{C&&setTimeout(()=>{const F=N.current;F?.update&&F.update()},C)},[C]);function w(F,W,H){return H.style&&W&&(H.style.display="none"),(0,t.jsx)("div",{...H,className:F})}const M=(0,a.useCallback)(F=>w("track-horizontal",b,F),[b]),O=(0,a.useCallback)(F=>w("track-vertical",u,F),[u]),U=(0,a.useCallback)(F=>(0,t.jsx)("div",{...F,className:"thumb-horizontal"}),[]),K=(0,a.useCallback)(F=>(0,t.jsx)("div",{...F,className:"thumb-vertical"}),[]),z=(0,a.useCallback)(F=>(F.style&&F.style.WebkitOverflowScrolling==="touch"&&(F.style.WebkitOverflowScrolling="auto"),(0,t.jsx)("div",{...F,className:"scrollbar-view",id:j})),[j]),G=(0,a.useCallback)(()=>{N.current&&v&&v(N.current.getValues())},[v]);return(0,t.jsx)(c.Ay,{"data-testid":m,ref:N,className:(0,n.cx)(V.customScrollbar,x,{[V.scrollbarWithScrollIndicators]:P}),onScrollStop:G,autoHeight:!0,autoHide:s,autoHideTimeout:g,hideTracksWhenNotNeeded:E,autoHeightMax:y,autoHeightMin:p,renderTrackHorizontal:M,renderTrackVertical:O,renderThumbHorizontal:U,renderThumbVertical:K,renderView:z,onScroll:R,children:P?(0,t.jsx)(i,{children:L}):L})},f=l,h=s=>({customScrollbar:(0,n.css)({display:"flex",flexGrow:1,".scrollbar-view":{display:"flex",flexGrow:1,flexDirection:"column"},".track-vertical":{borderRadius:s.shape.borderRadius(2),width:`${s.spacing(1)} !important`,right:0,bottom:s.spacing(.25),top:s.spacing(.25)},".track-horizontal":{borderRadius:s.shape.borderRadius(2),height:`${s.spacing(1)} !important`,right:s.spacing(.25),bottom:s.spacing(.25),left:s.spacing(.25)},".thumb-vertical":{background:s.colors.action.focus,borderRadius:s.shape.borderRadius(2),opacity:0},".thumb-horizontal":{background:s.colors.action.focus,borderRadius:s.shape.borderRadius(2),opacity:0},"&:hover":{".thumb-vertical, .thumb-horizontal":{opacity:1,[s.transitions.handleMotion("no-preference","reduce")]:{transition:"opacity 0.3s ease-in-out"}}}}),scrollbarWithScrollIndicators:(0,n.css)({".scrollbar-view":{position:"static !important"}})});function d(s,g){(0,a.useEffect)(()=>{s&&g!=null&&s.scrollTop(g)},[g,s])}},5753(ne,A,e){"use strict";e.d(A,{R:()=>a});var t=e(74848),n=e(45861);function a({link:c,buttonProps:r}){return(0,t.jsx)("a",{href:c.href,target:c.target,rel:"noreferrer",onClick:c.onClick?i=>{!(i.ctrlKey||i.metaKey||i.shiftKey)&&c.onClick&&(i.preventDefault(),c.onClick(i))}:void 0,children:(0,t.jsx)(n.$n,{icon:c.target==="_blank"?"external-link-alt":"link",variant:"primary",size:"sm",...r,children:c.title})})}},81917(ne,A,e){"use strict";e.d(A,{l:()=>L});var t=e(74848),n=e(22803),a=e(34743),c=e(83505),r=e(46885),i=e(28848),o=e.n(i),l=e(96540),f=e(84596),h=e(75226),d=e(29317),s=e(79609),g=e(38036),v=e(56103),x=e(63142),m=e(76373),p=e(35458),y=e(63527),E=e(15245),b=e(92807),u=e(81563);class D{getBoundingClientRect(){const V=window.getSelection(),w=V&&V.anchorNode;return w&&w.parentElement?w.parentElement.getBoundingClientRect():{top:0,left:0,bottom:0,right:0,width:0,height:0,x:0,y:0,toJSON:()=>{}}}get clientWidth(){return this.getBoundingClientRect().width}get clientHeight(){return this.getBoundingClientRect().height}}const P=(N,V)=>N-V*Math.floor(N/V),C={builtInVariable:{pattern:/(\${\S+?})/}},S=[(0,v.D)({onlyIn:N=>"type"in N&&N.type==="code_block",getSyntax:()=>"links"},{...o().languages,links:C})],R=N=>({input:(0,y.n)({theme:N,invalid:!1}).input,editor:(0,n.css)({".token.builtInVariable":{color:N.colors.success.text},".token.variable":{color:N.colors.primary.text}}),suggestionsWrapper:(0,n.css)({boxShadow:N.shadows.z2}),wrapperOverrides:(0,n.css)({width:"100%","> .slate-query-field__wrapper":{padding:0,backgroundColor:"transparent",border:"none"}})}),L=(0,l.memo)(({value:N,onChange:V,suggestions:w,placeholder:M="http://your-grafana.com/d/000000010/annotations"})=>{const O=(0,l.useRef)(null),U=(0,x.of)(R),[K,z]=(0,l.useState)(!1),[G,F]=(0,l.useState)(0),[W,H]=(0,l.useState)((0,p.mO)(N)),Y=(0,f.A)(W),[te,Z]=(0,l.useState)(0),se=(0,l.useRef)(null);(0,l.useEffect)(()=>{se.current?.scrollTo(0,te)},[te]);const ae=[(0,a.cY)(({rects:B})=>({alignmentAxis:B.reference.width})),...(0,m.getPositioningMiddleware)()],{refs:J,floatingStyles:k}=(0,c.we)({open:K,placement:"bottom-start",onOpenChange:z,middleware:ae,whileElementsMounted:r.ll,strategy:"fixed"}),_=(0,l.useRef)({showingSuggestions:K,suggestions:w,suggestionsIndex:G,linkUrl:W,onChange:V});_.current={showingSuggestions:K,suggestions:w,suggestionsIndex:G,linkUrl:W,onChange:V};const Q=(0,l.useRef)(null);(0,l.useEffect)(()=>{Z(j(Q.current,G))},[G]);const q=l.useCallback((B,ie)=>{if(!_.current.showingSuggestions){if(B.key==="="||B.key==="$"||B.keyCode===32&&B.ctrlKey){const de=new D;return J.setReference(de),z(!0)}return ie()}switch(B.key){case"Backspace":_.current.linkUrl.focusText.getText().length===1&&ie();case"Escape":return z(!1),F(0);case"Enter":return B.preventDefault(),re(_.current.suggestions[_.current.suggestionsIndex]);case"ArrowDown":case"ArrowUp":B.preventDefault();const de=B.key==="ArrowDown"?1:-1;return F(fe=>P(fe+de,_.current.suggestions.length));default:return ie()}},[]);(0,l.useEffect)(()=>{Y&&Y.selection.isFocused&&!W.selection.isFocused&&_.current.onChange(h.default.serialize(W))},[W,Y]);const oe=l.useCallback(({value:B})=>{H(B)},[]),re=(B,ie=O.current)=>{const fe=ee()==="$";B.origin!==s.$0.Template||B.value===g.c.includeVars?ie.insertText(`${fe?"":"$"}{${B.value}}`):ie.insertText(`${fe?"":"$"}{${B.value}:queryparam}`),H(ie.value),z(!1),F(0),_.current.onChange(h.default.serialize(ie.value))},ee=()=>{const B=document.getElementById("data-link-input");let ie="",de,fe;return window.getSelection&&(de=window.getSelection(),de&&de.rangeCount>0&&(fe=de.getRangeAt(0).cloneRange(),fe.collapse(!0),fe.setStart(B,0),ie=fe.toString().slice(-1))),ie};return(0,t.jsx)("div",{className:U.wrapperOverrides,children:(0,t.jsx)("div",{className:"slate-query-field__wrapper",children:(0,t.jsxs)("div",{id:"data-link-input",className:"slate-query-field",children:[K&&(0,t.jsx)(E.ZL,{children:(0,t.jsx)("div",{ref:J.setFloating,style:k,children:(0,t.jsx)(b.P,{maxHeight:"300px",ref:se,onScroll:B=>Z(B.currentTarget.scrollTop),children:(0,t.jsx)(u.k,{activeRef:Q,suggestions:_.current.suggestions,onSuggestionSelect:re,onClose:()=>z(!1),activeIndex:G})})})}),(0,t.jsx)(d.Editor,{schema:p.yx,ref:O,placeholder:M,value:_.current.linkUrl,onChange:oe,onKeyDown:(B,ie,de)=>q(B,de),plugins:S,className:(0,n.cx)(U.editor,U.input,(0,n.css)({padding:"3px 8px"}))})]})})})});L.displayName="DataLinkInput";function j(N,V){return(N?.clientHeight??0)*V}},81563(ne,A,e){"use strict";e.d(A,{k:()=>h});var t=e(74848),n=e(96540),a=e(22803),c=e(2543),r=e.n(c),i=e(29647),o=e(63142),l=e(5585);const f=s=>({list:(0,a.css)({borderBottom:`1px solid ${s.colors.border.weak}`,"&:last-child":{border:"none"}}),wrapper:(0,a.css)({background:s.colors.background.primary,width:"250px"}),item:(0,a.css)({background:"none",padding:"2px 8px",userSelect:"none",color:s.colors.text.primary,cursor:"pointer","&:hover":{background:s.colors.action.hover}}),label:(0,a.css)({color:s.colors.text.secondary}),activeItem:(0,a.css)({background:s.colors.background.secondary,"&:hover":{background:s.colors.background.secondary}}),itemValue:(0,a.css)({fontFamily:s.typography.fontFamilyMonospace,fontSize:s.typography.size.sm})}),h=({suggestions:s,...g})=>{const v=(0,n.useRef)(null);(0,i.A)(v,()=>{g.onClose&&g.onClose()});const x=(0,n.useMemo)(()=>(0,c.groupBy)(s,p=>p.origin),[s]),m=(0,o.of)(f);return(0,t.jsx)("div",{role:"menu",ref:v,className:m.wrapper,children:Object.keys(x).map((p,y)=>{const E=y===0?0:Object.keys(x).reduce((b,u,D)=>D>=y?b:b+x[u].length,0);return(0,n.createElement)(d,{...g,suggestions:x[p],label:(0,c.capitalize)(p),activeIndex:g.activeIndex,activeIndexOffset:E,key:p})})})};h.displayName="DataLinkSuggestions";const d=n.memo(({activeIndex:s,activeIndexOffset:g,label:v,onClose:x,onSuggestionSelect:m,suggestions:p,activeRef:y})=>{const E=(0,o.of)(f);return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(l.B,{className:E.list,items:p,renderItem:(b,u)=>{const D=u+g===s;return(0,t.jsx)("div",{role:"menuitem",tabIndex:0,className:(0,a.cx)(E.item,D&&E.activeItem),ref:D?y:void 0,onClick:()=>{m(b)},title:b.documentation,children:(0,t.jsxs)("span",{className:E.itemValue,children:[(0,t.jsx)("span",{className:E.label,children:v})," ",b.label]})})}})})});d.displayName="DataLinkSuggestionsList"},6399(ne,A,e){"use strict";e.d(A,{e:()=>f});var t=e(74848),n=e(22803),a=e(51898),c=e(63142),r=e(75254),i=e(41479),o=e(30930),l=e(94535);const f=({children:d,links:s,style:g})=>{const v=(0,c.of)(h),x=[{items:(0,r.J)(s),label:s().length?"Data links":""}],m=x[0].items.length,p=()=>x.map((E,b)=>(0,t.jsx)(o.r,{label:E.label,children:(E.items||[]).map((u,D)=>(0,t.jsx)(l.D,{url:u.url,label:u.label,target:u.target,icon:u.icon,active:u.active,onClick:u.onClick,className:v.itemWrapper},`${E.label}-${b}-${D}}`))},`${E.label}${b}`)),y=(0,n.css)({cursor:"context-menu"});if(m>1)return(0,t.jsx)(i.n,{renderMenuItems:p,children:({openMenu:E})=>d({openMenu:E,targetClassName:y})});{const E=s()[0];return(0,t.jsx)("a",{href:E.href,onClick:E.onClick,target:E.target,title:E.title,style:{...g,overflow:"hidden",display:"flex"},"data-testid":a.Tp.components.DataLinksContextMenu.singleLink,children:d({})})}},h=d=>({itemWrapper:(0,n.css)({fontSize:12})})},96822(ne,A,e){"use strict";e.d(A,{e:()=>m});var t=e(74848),n=e(96540),a=e(92745),c=e(45861),r=e(22787),i=e(22803),o=e(63142),l=e(37386),f=e(63527),h=e(21285),d=e(81917);const s=(0,n.memo)(({index:p,value:y,onChange:E,suggestions:b,isLast:u,showOneClick:D=!1})=>{const P=(0,o.of)(g),C=(j,N)=>{E(p,{...y,url:j},N)},S=j=>{E(p,{...y,title:j.target.value})},R=()=>{E(p,{...y,targetBlank:!y.targetBlank})},L=()=>{E(p,{...y,oneClick:!y.oneClick})};return(0,t.jsxs)("div",{className:P.listItem,children:[(0,t.jsx)(l.D,{label:(0,a.t)("grafana-ui.data-link-editor.title-label","Title"),children:(0,t.jsx)(f.p,{id:"link-title",value:y.title,onChange:S,placeholder:(0,a.t)("grafana-ui.data-link-editor.title-placeholder","Show details")})}),(0,t.jsx)(l.D,{label:(0,a.t)("grafana-ui.data-link-editor.url-label","URL"),children:(0,t.jsx)(d.l,{value:y.url,onChange:C,suggestions:b})}),(0,t.jsx)(l.D,{label:(0,a.t)("grafana-ui.data-link-editor.new-tab-label","Open in new tab"),children:(0,t.jsx)(h.d,{id:"new-tab-toggle",value:y.targetBlank||!1,onChange:R})}),D&&(0,t.jsx)(l.D,{label:(0,a.t)("grafana-ui.data-link-inline-editor.one-click","One click"),description:(0,a.t)("grafana-ui.data-link-editor-modal.one-click-description","Only one link can have one click enabled at a time"),children:(0,t.jsx)(h.d,{id:"one-click-toggle",value:y.oneClick||!1,onChange:L})}),u&&(0,t.jsx)(a.x6,{i18nKey:"grafana-ui.data-link-editor.info",className:P.infoText,children:"With data links you can reference data variables like series name, labels and values. Type CMD+Space, CTRL+Space, or $ to open variable suggestions."})]})});s.displayName="DataLinkEditor";const g=p=>({listItem:(0,i.css)({marginBottom:p.spacing()}),infoText:(0,i.css)({paddingBottom:p.spacing(2),marginLeft:"66px",color:p.colors.text.secondary})}),v=({link:p,index:y,onSave:E,onCancel:b,getSuggestions:u,showOneClick:D})=>{const[P,C]=(0,n.useState)(p);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s,{value:P,index:y,isLast:!1,onChange:(S,R)=>{C(R)},suggestions:u(),showOneClick:D}),(0,t.jsxs)(r.a.ButtonRow,{children:[(0,t.jsx)(c.$n,{variant:"secondary",onClick:()=>b(y),fill:"outline",children:(0,t.jsx)(a.x6,{i18nKey:"grafana-ui.data-link-editor-modal.cancel",children:"Cancel"})}),(0,t.jsx)(c.$n,{onClick:()=>{E(y,P)},disabled:P.title.trim()===""||P.url.trim()==="",children:(0,t.jsx)(a.x6,{i18nKey:"grafana-ui.data-link-editor-modal.save",children:"Save"})})]})]})};var x=e(73628);const m=({links:p,getSuggestions:y,showOneClick:E=!1,...b})=>(0,t.jsx)(x.J,{type:"link",items:p,...b,children:(u,D,P,C)=>(0,t.jsx)(v,{index:D,link:u??{title:"",url:""},data:b.data,onSave:P,onCancel:C,getSuggestions:y,showOneClick:E})})},73628(ne,A,e){"use strict";e.d(A,{J:()=>x});var t=e(74848),n=e(22803),a=e(89332),c=e(2543),r=e(96540),i=e(92745),o=e(63142),l=e(45861),f=e(22787),h=e(99887),d=e(30703),s=e(76319);function g({item:p,onEdit:y,onRemove:E,index:b,itemKey:u}){const D=(0,o.of)(v),{title:P="",oneClick:C=!1}=p,S=("type"in p?p[p.type]?.url:p.url)??"",R=P.trim()!=="",L=S.trim()!=="";return(0,t.jsx)(a.sx,{draggableId:u,index:b,children:j=>(0,r.createElement)("div",{className:(0,n.cx)(D.wrapper,D.dragRow),ref:j.innerRef,...j.draggableProps,key:b},(0,t.jsxs)("div",{className:D.linkDetails,children:[(0,t.jsx)("div",{className:(0,n.cx)(D.url,!R&&D.notConfigured),children:R?P:(0,i.t)("grafana-ui.data-links-inline-editor.title-not-provided","Title not provided")}),(0,t.jsx)("div",{className:(0,n.cx)(D.url,!L&&D.notConfigured),title:S,children:L?S:(0,i.t)("grafana-ui.data-links-inline-editor.url-not-provided","Data link url not provided")})]}),(0,t.jsxs)("div",{className:D.icons,children:[C&&(0,t.jsx)(h.E,{color:"blue",text:(0,i.t)("grafana-ui.data-links-inline-editor.one-click","One click"),tooltip:(0,i.t)("grafana-ui.data-links-inline-editor.one-click-enabled","One click enabled")}),(0,t.jsx)(s.K,{name:"pen",onClick:y,className:D.icon,tooltip:(0,i.t)("grafana-ui.data-links-inline-editor.tooltip-edit","Edit")}),(0,t.jsx)(s.K,{name:"trash-alt",onClick:E,className:D.icon,tooltip:(0,i.t)("grafana-ui.data-links-inline-editor.tooltip-remove","Remove")}),(0,t.jsx)("div",{className:D.dragIcon,...j.dragHandleProps,children:(0,t.jsx)(d.I,{name:"draggabledots",size:"lg"})})]}))},u)}const v=p=>({wrapper:(0,n.css)({display:"flex",flexGrow:1,alignItems:"center",justifyContent:"space-between",padding:"5px 0 5px 10px",borderRadius:p.shape.radius.default,background:p.colors.background.secondary,gap:8}),linkDetails:(0,n.css)({display:"flex",flexDirection:"column",flexGrow:1,maxWidth:"calc(100% - 100px)"}),errored:(0,n.css)({color:p.colors.error.text,fontStyle:"italic"}),notConfigured:(0,n.css)({fontStyle:"italic"}),title:(0,n.css)({color:p.colors.text.primary,fontSize:p.typography.size.sm,fontWeight:p.typography.fontWeightMedium}),url:(0,n.css)({color:p.colors.text.secondary,fontSize:p.typography.size.sm,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),dragRow:(0,n.css)({position:"relative",margin:"8px"}),icons:(0,n.css)({display:"flex",padding:6,alignItems:"center",gap:8}),dragIcon:(0,n.css)({cursor:"grab",color:p.colors.text.secondary,margin:p.spacing(0,.5)}),icon:(0,n.css)({color:p.colors.text.secondary})});function x({type:p,items:y,onChange:E,data:b,children:u}){const[D,P]=(0,r.useState)(null),[C,S]=(0,r.useState)(!1),[R,L]=(0,r.useState)([]);(0,r.useEffect)(()=>{L(y??[])},[y]);const j=(0,o.of)(m),N=D!==null,V=(z,G)=>{if(C){const W=G.title,H=G.url??G.fetch?.url??"";if(W.trim()===""&&H.trim()===""){S(!1),P(null);return}else P(null),S(!1)}G.oneClick===!0&&R.forEach(W=>{W.oneClick&&(W.oneClick=!1)});const F=(0,c.cloneDeep)(R);F[z]=G,E(F),P(null)},w=z=>{C&&S(!1),P(null)},M=()=>{let z=(0,c.cloneDeep)(R);P(z.length),S(!0)},O=z=>{const G=(0,c.cloneDeep)(R);G.splice(z,1),E(G)},U=z=>{if(y==null||z.destination==null)return;const G=(0,c.cloneDeep)(R),F=G[z.source.index];G.splice(z.source.index,1),G.splice(z.destination.index,0,F),L(G),E(G)},K=z=>{let G="";switch(p){case"link":G=z==="edit"?(0,i.t)("grafana-ui.data-links-inline-editor.edit-link","Edit link"):(0,i.t)("grafana-ui.data-links-inline-editor.add-link","Add link");break;case"action":G=z==="edit"?(0,i.t)("grafana-ui.action-editor.inline.edit-action","Edit action"):(0,i.t)("grafana-ui.action-editor.inline.add-action","Add action");break}return G};return(0,t.jsxs)("div",{className:j.container,children:[(0,t.jsx)(a.JY,{onDragEnd:U,children:(0,t.jsx)(a.gL,{droppableId:"sortable-links",direction:"vertical",children:z=>(0,t.jsxs)("div",{className:j.wrapper,ref:z.innerRef,...z.droppableProps,children:[R.map((G,F)=>{const W=`${G.title}/${F}`;return(0,t.jsx)(g,{index:F,item:G,onChange:V,onEdit:()=>P(F),onRemove:()=>O(F),data:b,itemKey:W},W)}),z.placeholder]})})}),N&&D!==null&&(0,t.jsx)(f.a,{title:K(C?"add":"edit"),isOpen:!0,closeOnBackdropClick:!1,onDismiss:()=>{w(D)},children:u(R[D],D,V,w)}),(0,t.jsx)(l.$n,{size:"sm",icon:"plus",onClick:M,variant:"secondary",className:j.button,children:K("add")})]})}const m=p=>({container:(0,n.css)({position:"relative"}),wrapper:(0,n.css)({marginBottom:p.spacing(2),display:"flex",flexDirection:"column"}),button:(0,n.css)({marginLeft:p.spacing(1)})})},45558(ne,A,e){"use strict";e.d(A,{K:()=>l});var t=e(74848),n=e(92745),a=e(45861),c=e(18027),r=e(97095),i=e(63527),o=e(87105);const l=({hasCert:f,label:h,onChange:d,onClick:s,placeholder:g,useGrow:v})=>(0,t.jsxs)(r.C,{children:[(0,t.jsx)(c.I,{label:h,labelWidth:14,disabled:f,grow:v,children:f?(0,t.jsx)(i.p,{type:"text",value:"configured",width:24}):(0,t.jsx)(o.f,{rows:7,onChange:d,placeholder:g,required:!0})}),f&&(0,t.jsx)(a.$n,{variant:"secondary",onClick:s,style:{marginLeft:4},children:(0,t.jsx)(n.x6,{i18nKey:"grafana-ui.data-source-settings.cert-key-reset",children:"Reset"})})]})},55803(ne,A,e){"use strict";e.d(A,{P:()=>v});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(96540),i=e(92745),o=e(63142),l=e(45861),f=e(94959),h=e(30703),d=e(23659);const s=()=>({layout:(0,n.css)({display:"flex",alignItems:"center",marginBottom:"4px","> *":{marginLeft:"4px",marginBottom:0,height:"100%","&:first-child, &:last-child":{marginLeft:0}}})}),g=({header:m,onBlur:p,onChange:y,onRemove:E,onReset:b})=>{const u=(0,o.of)(s);return(0,t.jsxs)("div",{className:u.layout,children:[(0,t.jsx)(f.z,{label:(0,i.t)("grafana-ui.data-source-settings.custom-headers-header","Header"),name:"name",placeholder:"X-Custom-Header",labelWidth:5,value:m.name||"",onChange:D=>y({...m,name:D.target.value}),onBlur:p}),(0,t.jsx)(d.L,{label:(0,i.t)("grafana-ui.data-source-settings.custom-headers-header-value","Value"),"aria-label":(0,i.t)("grafana-ui.data-source-settings.custom-headers-header-value","Value"),name:"value",isConfigured:m.configured,value:m.value,labelWidth:5,inputWidth:m.configured?11:12,placeholder:(0,i.t)("grafana-ui.data-source-settings.custom-headers-header-placeholder","Header Value"),onReset:()=>b(m.id),onChange:D=>y({...m,value:D.target.value}),onBlur:p}),(0,t.jsx)(l.$n,{type:"button","aria-label":(0,i.t)("grafana-ui.data-source-settings.custom-headers-header-remove","Remove header"),variant:"secondary",size:"xs",onClick:D=>E(m.id),children:(0,t.jsx)(h.I,{name:"trash-alt"})})]})};g.displayName="CustomHeaderRow";class v extends r.PureComponent{constructor(p){super(p),this.state={headers:[]},this.updateSettings=()=>{const{headers:u}=this.state,D=Object.fromEntries(Object.entries(this.props.dataSourceConfig.jsonData).filter(([C,S])=>!C.startsWith("httpHeaderName"))),P=Object.fromEntries(Object.entries(this.props.dataSourceConfig.secureJsonData||{}).filter(([C,S])=>!C.startsWith("httpHeaderValue")));for(const[C,S]of u.entries())D[`httpHeaderName${C+1}`]=S.name,S.configured||(P[`httpHeaderValue${C+1}`]=S.value);this.props.onChange({...this.props.dataSourceConfig,jsonData:D,secureJsonData:P})},this.onHeaderAdd=()=>{this.setState(u=>({headers:[...u.headers,{id:(0,a.uniqueId)(),name:"",value:"",configured:!1}]}))},this.onHeaderChange=(u,D)=>{this.setState(({headers:P})=>({headers:P.map((C,S)=>u!==S?C:{...D})}))},this.onHeaderReset=u=>{this.setState(({headers:D})=>({headers:D.map((P,C)=>P.id!==u?P:{...P,value:"",configured:!1})}))},this.onHeaderRemove=u=>{this.setState(({headers:D})=>({headers:D.filter(P=>P.id!==u)}),this.updateSettings)};const{jsonData:y,secureJsonData:E,secureJsonFields:b}=this.props.dataSourceConfig;this.state={headers:Object.keys(y).sort().filter(u=>u.startsWith("httpHeaderName")).map((u,D)=>({id:(0,a.uniqueId)(),name:y[u],value:E!==void 0?E[u]:"",configured:b&&b[`httpHeaderValue${D+1}`]||!1}))}}render(){const{headers:p}=this.state,{dataSourceConfig:y}=this.props;return(0,t.jsxs)("div",{className:"gf-form-group",children:[(0,t.jsx)("div",{className:"gf-form",children:(0,t.jsx)("h6",{children:(0,t.jsx)(i.x6,{i18nKey:"grafana-ui.data-source-settings.custom-headers-title",children:"Custom HTTP Headers"})})}),(0,t.jsx)("div",{children:p.map((E,b)=>(0,t.jsx)(g,{header:E,onChange:u=>{this.onHeaderChange(b,u)},onBlur:this.updateSettings,onRemove:this.onHeaderRemove,onReset:this.onHeaderReset},E.id))}),!y.readOnly&&(0,t.jsx)("div",{className:"gf-form",children:(0,t.jsx)(l.$n,{variant:"secondary",icon:"plus",type:"button",onClick:E=>{this.onHeaderAdd()},children:(0,t.jsx)(i.x6,{i18nKey:"grafana-ui.data-source-settings.custom-headers-add",children:"Add header"})})})]})}}var x=null},96004(ne,A,e){"use strict";e.d(A,{t:()=>V});var t=e(74848),n=e(22803),a=e(96540),c=e(51898),r=e(92745),i=e(63142),o=e(34999),l=e(45861),f=e(37386),h=e(18027),d=e(77824),s=e(30703),g=e(63527),v=e(41654),x=e(21285),m=e(10928),p=e(66404),y=e(94959),E=e(23659);const b=({dataSourceConfig:w,onChange:M})=>{const O=w.secureJsonData?w.secureJsonData.basicAuthPassword:"",U=()=>{M({...w,secureJsonData:{...w.secureJsonData,basicAuthPassword:""},secureJsonFields:{...w.secureJsonFields,basicAuthPassword:!1}})},K=z=>{M({...w,secureJsonData:{...w.secureJsonData,basicAuthPassword:z.currentTarget.value}})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.I,{disabled:w.readOnly,children:(0,t.jsx)(y.z,{label:(0,r.t)("grafana-ui.data-source-basic-auth-settings.user-label","User"),labelWidth:10,inputWidth:18,placeholder:(0,r.t)("grafana-ui.data-source-basic-auth-settings.user-placeholder","user"),value:w.basicAuthUser,onChange:z=>M({...w,basicAuthUser:z.currentTarget.value})})}),(0,t.jsx)(h.I,{disabled:w.readOnly,children:(0,t.jsx)(E.L,{isConfigured:!!(w.secureJsonFields&&w.secureJsonFields.basicAuthPassword),value:O||"",inputWidth:18,labelWidth:10,onReset:U,onChange:K})})]})};var u=e(55803);const D=26,P=({dataSourceConfig:w,onChange:M,showForwardOAuthIdentityOption:O=!0})=>{const U=(0,i.of)(C);return(0,t.jsxs)("div",{className:U,children:[(0,t.jsxs)(v.B,{direction:"row",gap:.5,children:[(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-proxy-settings.ts-client-auth-label","TLS Client Auth"),labelWidth:D,disabled:w.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-tls-client-auth",value:w.jsonData.tlsAuth||!1,onChange:K=>M({...w.jsonData,tlsAuth:K.currentTarget.checked})})}),(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-proxy-settings.with-ca-cert-label","With CA Cert"),tooltip:(0,r.t)("grafana-ui.data-source-http-proxy-settings.with-ca-cert-tooltip","Needed for verifying self-signed TLS Certs"),labelWidth:D,disabled:w.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-ca-cert",value:w.jsonData.tlsAuthWithCACert||!1,onChange:K=>M({...w.jsonData,tlsAuthWithCACert:K.currentTarget.checked})})})]}),(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-proxy-settings.skip-tls-verify-label","Skip TLS Verify"),labelWidth:D,disabled:w.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-skip-tls-verify",value:w.jsonData.tlsSkipVerify||!1,onChange:K=>M({...w.jsonData,tlsSkipVerify:K.currentTarget.checked})})}),O&&(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-proxy-settings.oauth-identity-label","Forward OAuth Identity"),tooltip:(0,r.t)("grafana-ui.data-source-http-proxy-settings.oauth-identity-tooltip","Forward the user's upstream OAuth identity to the data source (Their access token gets passed along)."),labelWidth:D,disabled:w.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-forward-oauth",value:w.jsonData.oauthPassThru||!1,onChange:K=>M({...w.jsonData,oauthPassThru:K.currentTarget.checked})})})]})},C=w=>(0,n.css)({display:"grid",gridTemplateColumns:"auto",gap:0});var S=e(3936),R=e(37235);const L="grafana-http-access-help",j=()=>(0,t.jsxs)(o.F,{severity:"info",title:(0,r.t)("grafana-ui.data-source-http-settings.access-help-title","Access help"),topSpacing:3,id:L,children:[(0,t.jsx)("p",{children:(0,t.jsxs)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.access-help-details",children:["Access mode controls how requests to the data source will be handled.",(0,t.jsxs)("strong",{children:["\xA0",(0,t.jsx)("i",{children:"Server"})]})," ","should be the preferred way if nothing else is stated."]})}),(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.server-mode-title",children:(0,t.jsx)(p.E,{weight:"medium",children:"Server access mode (Default):"})}),(0,t.jsx)("p",{children:(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.server-mode-description",children:"All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the grafana backend/server if you select this access mode."})}),(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.browser-mode-title",children:(0,t.jsx)(p.E,{weight:"medium",children:"Browser access mode:"})}),(0,t.jsx)("p",{children:(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.browser-mode-description",children:"All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode."})})]}),N=26,V=w=>{const{defaultUrl:M,dataSourceConfig:O,onChange:U,showAccessOptions:K,sigV4AuthToggleEnabled:z,showForwardOAuthIdentityOption:G,azureAuthSettings:F,renderSigV4Editor:W,secureSocksDSProxyEnabled:H,urlLabel:Y,urlDocs:te}=w,Z=(0,a.useMemo)(()=>[{label:(0,r.t)("grafana-ui.data-source-http-settings.server-mode-label","Server (default)"),value:"proxy"},{label:(0,r.t)("grafana-ui.data-source-http-settings.browser-mode-label","Browser"),value:"direct"}],[]),se=(0,a.useMemo)(()=>Z[0],[Z]),[ae,J]=(0,a.useState)(!1),[k,_]=(0,a.useState)(!1),Q=(0,i.$j)();let q;const oe=(0,a.useCallback)(ie=>{const de=F?.azureAuthSupported&&F.getAzureAuthEnabled(O)||!1;if(_(de),de){const fe=O.jsonData.oauthPassThru!==void 0?O.jsonData.oauthPassThru:!1;ie={...ie,jsonData:{...O.jsonData,oauthPassThru:de?!1:fe}}}U({...O,...ie})},[F,O,U]);switch(O.access){case"direct":q=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.direct-url-tooltip",children:["Your access method is ",(0,t.jsx)("em",{children:"Browser"}),", this means the URL needs to be accessible from the browser."]}),te]});break;case"proxy":q=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.proxy-url-tooltip",children:["Your access method is ",(0,t.jsx)("em",{children:"Server"}),", this means the URL needs to be accessible from the grafana backend/server."]}),te]});break;default:q=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.default-url-tooltip",children:"Specify a complete HTTP URL (for example http://your_server:8080)"}),te]})}const re=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/.test(O.url),ee=(0,n.css)({display:"grid",gridTemplateColumns:"auto 1fr",gap:Q.spacing(.5)}),B=(0,a.useId)();return(0,t.jsxs)(v.B,{direction:"column",gap:5,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"page-heading",children:(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.heading",children:"HTTP"})}),(0,t.jsx)(f.D,{label:Y??"URL",description:q,invalid:!re,error:!re&&(0,r.t)("grafana-ui.data-source-http-settings.invalid-url-error","Invalid URL"),disabled:O.readOnly,children:(0,t.jsx)(g.p,{id:B,width:40,placeholder:M,value:O.url,"data-testid":c.Tp.components.DataSource.DataSourceHttpSettings.urlInput,onChange:ie=>oe({url:ie.currentTarget.value})})}),K&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.D,{label:(0,r.t)("grafana-ui.data-source-http-settings.access-label","Access"),disabled:O.readOnly,children:(0,t.jsxs)(v.B,{direction:"row",gap:.5,children:[(0,t.jsx)(d.z,{"aria-label":(0,r.t)("grafana-ui.data-source-http-settings.access-label","Access"),options:Z,value:Z.find(ie=>ie.value===O.access)?.value||se.value,onChange:ie=>oe({access:ie})}),(0,t.jsx)(l.$n,{type:"button",variant:"secondary",size:"md",fill:"outline",onClick:()=>J(ie=>!ie),"aria-expanded":ae,"aria-controls":L,children:(0,t.jsxs)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.access-help",children:["Help\xA0",(0,t.jsx)(s.I,{name:ae?"angle-down":"angle-right"})]})})]})}),ae&&(0,t.jsx)(j,{})]}),O.access==="proxy"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.D,{label:(0,r.t)("grafana-ui.data-source-http-settings.allowed-cookies","Allowed cookies"),description:(0,r.t)("grafana-ui.data-source-http-settings.allowed-cookies-description","Grafana proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source."),children:(0,t.jsx)(m.u,{tags:O.jsonData.keepCookies,width:40,onChange:ie=>oe({jsonData:{...O.jsonData,keepCookies:ie}}),disabled:O.readOnly})}),(0,t.jsx)(f.D,{label:(0,r.t)("grafana-ui.data-source-http-settings.timeout-label","Timeout"),description:(0,r.t)("grafana-ui.data-source-http-settings.timeout-description","HTTP request timeout in seconds"),disabled:O.readOnly,children:(0,t.jsx)(g.p,{type:"number",width:40,placeholder:(0,r.t)("grafana-ui.data-source-http-settings.timeout-placeholder","Timeout in seconds"),value:O.jsonData.timeout,onChange:ie=>{oe({jsonData:{...O.jsonData,timeout:parseInt(ie.currentTarget.value,10)}})}})})]})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"page-heading",children:(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.auth",children:"Auth"})}),(0,t.jsxs)(v.B,{direction:"column",gap:4,children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:ee,children:[(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-settings.basic-auth-label","Basic auth"),labelWidth:N,disabled:O.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-basic-auth",value:O.basicAuth,onChange:ie=>{oe({basicAuth:ie.currentTarget.checked})}})}),(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-settings.with-credentials-label","With Credentials"),tooltip:(0,r.t)("grafana-ui.data-source-http-settings.with-credentials-tooltip","Whether credentials such as cookies or auth headers should be sent with cross-site requests."),labelWidth:N,disabled:O.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-with-credentials",value:O.withCredentials,onChange:ie=>{oe({withCredentials:ie.currentTarget.checked})}})}),F?.azureAuthSupported&&(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-settings.azure-auth-label","Azure Authentication"),tooltip:(0,r.t)("grafana-ui.data-source-http-settings.azure-auth-tooltip","Use Azure authentication for Azure endpoint."),labelWidth:N,disabled:O.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-azure-auth",value:k,onChange:ie=>{oe(F.setAzureAuthEnabled(O,ie.currentTarget.checked))}})}),z&&(0,t.jsx)(h.I,{label:(0,r.t)("grafana-ui.data-source-http-settings.sigv4-auth-label","SigV4 auth"),labelWidth:N,disabled:O.readOnly,children:(0,t.jsx)(x.K,{id:"http-settings-sigv4-auth",value:O.jsonData.sigV4Auth||!1,onChange:ie=>{oe({jsonData:{...O.jsonData,sigV4Auth:ie.currentTarget.checked}})}})})]}),O.access==="proxy"&&(0,t.jsx)(P,{dataSourceConfig:O,onChange:ie=>oe({jsonData:ie}),showForwardOAuthIdentityOption:k?!1:G})]}),O.basicAuth&&(0,t.jsxs)("section",{children:[(0,t.jsx)(p.E,{variant:"h6",element:"h4",children:(0,t.jsx)(r.x6,{i18nKey:"grafana-ui.data-source-http-settings.basic-auth",children:"Basic Auth Details"})}),(0,t.jsx)(b,{...w})]}),F?.azureAuthSupported&&k&&F.azureSettingsUI&&(0,t.jsx)(F.azureSettingsUI,{dataSourceConfig:O,onChange:U}),O.jsonData.sigV4Auth&&z&&W,(O.jsonData.tlsAuth||O.jsonData.tlsAuthWithCACert)&&(0,t.jsx)(R.j,{dataSourceConfig:O,onChange:U}),O.access==="proxy"&&(0,t.jsx)(u.P,{dataSourceConfig:O,onChange:U})]})]}),H&&(0,t.jsx)(S.Y,{options:O,onOptionsChange:U})]})}},3936(ne,A,e){"use strict";e.d(A,{Y:()=>r});var t=e(74848),n=e(92745),a=e(21285),c=e(18027);function r({options:i,onOptionsChange:o}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"page-heading",children:(0,t.jsx)(n.x6,{i18nKey:"grafana-ui.data-source-settings.secure-socks-heading",children:"Secure Socks Proxy"})}),(0,t.jsx)("div",{className:"gf-form-group",children:(0,t.jsx)("div",{className:"gf-form-inline",children:(0,t.jsx)("div",{className:"gf-form",children:(0,t.jsx)(c.I,{labelWidth:26,label:(0,n.t)("grafana-ui.data-source-settings.secure-socks-label","Enabled"),tooltip:(0,n.t)("grafana-ui.data-source-settings.secure-socks-tooltip","Connect to this datasource via the secure socks proxy."),children:(0,t.jsx)(a.K,{value:i.jsonData.enableSecureSocksProxy??!1,onChange:l=>o({...i,jsonData:{...i.jsonData,enableSecureSocksProxy:l.currentTarget.checked}})})})})})})]})}},37235(ne,A,e){"use strict";e.d(A,{j:()=>l});var t=e(74848),n=e(22803),a=e(92745),c=e(94959),r=e(30703),i=e(45967),o=e(45558);const l=({dataSourceConfig:f,onChange:h})=>{const d=f.secureJsonFields&&f.secureJsonFields.tlsCACert,s=f.secureJsonFields&&f.secureJsonFields.tlsClientCert,g=f.secureJsonFields&&f.secureJsonFields.tlsClientKey,v=f.jsonData&&f.jsonData.serverName,x=b=>u=>{u.preventDefault();const D={...f.secureJsonFields};D[b]=!1,h({...f,secureJsonFields:D})},m=b=>u=>{const D={...f.secureJsonData};D[b]=u.currentTarget.value,h({...f,secureJsonData:D})},p=b=>{const u={...f.jsonData,serverName:b.currentTarget.value};h({...f,jsonData:u})},y="-----BEGIN CERTIFICATE-----";return(0,t.jsxs)("div",{className:"gf-form-group",children:[(0,t.jsxs)("div",{className:(0,n.cx)("gf-form",(0,n.css)({alignItems:"baseline"})),children:[(0,t.jsx)("h6",{children:(0,t.jsx)(a.x6,{i18nKey:"grafana-ui.data-source-settings.tls-heading",children:"TLS/SSL Auth Details"})}),(0,t.jsx)(i.m,{placement:"right-end",content:(0,a.t)("grafana-ui.data-source-settings.tls-tooltip","TLS/SSL Certs are encrypted and stored in the Grafana database."),theme:"info",children:(0,t.jsx)(r.I,{name:"info-circle",size:"xs",style:{marginLeft:"10px"}})})]}),(0,t.jsxs)("div",{children:[f.jsonData.tlsAuthWithCACert&&(0,t.jsx)(o.K,{hasCert:!!d,onChange:m("tlsCACert"),placeholder:(0,a.t)("grafana-ui.data-source-settings.tls-certification-placeholder","Begins with {{certificateBeginsWith}}",{certificateBeginsWith:y}),label:(0,a.t)("grafana-ui.data-source-settings.tls-certification-label","CA Cert"),onClick:x("tlsCACert")}),f.jsonData.tlsAuth&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"gf-form",children:(0,t.jsx)(c.z,{label:(0,a.t)("grafana-ui.data-source-settings.tls-server-name-label","ServerName"),labelWidth:7,inputWidth:30,placeholder:"domain.example.com",value:v&&f.jsonData.serverName,onChange:p})}),(0,t.jsx)(o.K,{hasCert:!!s,label:(0,a.t)("grafana-ui.data-source-settings.tls-client-certification-label","Client Cert"),onChange:m("tlsClientCert"),placeholder:(0,a.t)("grafana-ui.data-source-settings.tls-certification-placeholder","Begins with {{certificateBeginsWith}}",{certificateBeginsWith:y}),onClick:x("tlsClientCert")}),(0,t.jsx)(o.K,{hasCert:!!g,label:(0,a.t)("grafana-ui.data-source-settings.tls-client-key-label","Client Key"),placeholder:(0,a.t)("grafana-ui.data-source-settings.tls-client-key-placeholder","Begins with {{privateKeyBeginsWith}}",{privateKeyBeginsWith:"-----BEGIN RSA PRIVATE KEY-----"}),onChange:m("tlsClientKey"),onClick:x("tlsClientKey")})]})]})]})}},96396(ne,A,e){"use strict";e.d(A,{l:()=>f});var t=e(74848),n=e(22803),a=e(96540),c=e(93581),r=e(63142),i=e(8135),o=e(30703),l=e(66630);const f=(0,a.memo)(s=>{const g=(0,r.of)(d),{isOpen:v,onClose:x}=s;return v?(0,t.jsx)(i.N,{useCapture:!0,includeButtonPress:!1,onClick:x,children:(0,t.jsx)("div",{className:g.modal,"data-testid":"date-picker",children:(0,t.jsx)(h,{...s})})}):null});f.displayName="DatePicker";const h=(0,a.memo)(({value:s,minDate:g,maxDate:v,onChange:x})=>{const m=(0,r.of)(l.h2);return(0,t.jsx)(c.Ay,{className:m.body,tileClassName:m.title,value:s||new Date,minDate:g,maxDate:v,nextLabel:(0,t.jsx)(o.I,{name:"angle-right"}),prevLabel:(0,t.jsx)(o.I,{name:"angle-left"}),onChange:p=>{p&&!Array.isArray(p)&&x(p)},locale:"en"})});h.displayName="Body";const d=s=>({modal:(0,n.css)({zIndex:s.zIndex.modal,boxShadow:s.shadows.z3,backgroundColor:s.colors.background.primary,border:`1px solid ${s.colors.border.weak}`,borderTopLeftRadius:s.shape.radius.default,borderBottomLeftRadius:s.shape.radius.default,"button:disabled":{color:s.colors.text.disabled}})})},43482(ne,A,e){"use strict";e.d(A,{l:()=>s});var t=e(74848),n=e(22803),a=e(83505),c=e(46885),r=e(96540),i=e(25229),o=e(63142),l=e(76373),f=e(63527),h=e(96396);const d=v=>(0,i.KQ)(v).format("L"),s=(0,r.forwardRef)(({value:v,minDate:x,maxDate:m,onChange:p,closeOnSelect:y,placeholder:E="Date",...b},u)=>{const[D,P]=(0,r.useState)(!1),C=(0,o.of)(g),S="bottom-start",R=(0,l.getPositioningMiddleware)(S),{context:L,refs:j,floatingStyles:N}=(0,a.we)({open:D,placement:S,onOpenChange:P,middleware:R,whileElementsMounted:c.ll,strategy:"fixed"}),V=(0,a.kp)(L),w=(0,a.s9)(L),{getReferenceProps:M,getFloatingProps:O}=(0,a.bv)([w,V]);return(0,r.useImperativeHandle)(u,()=>j.domReference.current,[j.domReference]),(0,t.jsxs)("div",{className:C.container,children:[(0,t.jsx)(f.p,{ref:j.setReference,type:"text",autoComplete:"off",placeholder:E,value:v&&d(v),onChange:U=>{U.target.value===""&&p("")},className:C.input,...b,...M()}),(0,t.jsx)("div",{className:C.popover,ref:j.setFloating,style:N,...O(),children:(0,t.jsx)(h.l,{isOpen:D,value:v&&typeof v!="string"?v:(0,i.KQ)().toDate(),minDate:x,maxDate:m,onChange:U=>{p(U),y&&P(!1)},onClose:()=>P(!1)})})]})});s.displayName="DatePickerWithInput";const g=v=>({container:(0,n.css)({position:"relative"}),input:(0,n.css)({"input[type='date']::-webkit-inner-spin-button, input[type='date']::-webkit-calendar-picker-indicator":{display:"none",WebkitAppearance:"none"}}),popover:(0,n.css)({zIndex:v.zIndex.tooltip})})},27282(ne,A,e){"use strict";e.d(A,{K:()=>N});var t=e(74848),n=e(22803),a=e(83505),c=e(46885),r=e(18828),i=e(43107),o=e(93225),l=e(96540),f=e(93581),h=e(49045),d=e(60188),s=e(25229),g=e(80011),v=e(51898),x=e(92745),m=e(63142),p=e(76373),y=e(45861),E=e(18027),b=e(30703),u=e(63527),D=e(41654),P=e(35621),C=e(15245),S=e(11527),R=e(66630),L=e(62348),j=e(41e3);const N=({date:O,maxDate:U,minDate:K,label:z,onChange:G,disabledHours:F,disabledMinutes:W,disabledSeconds:H,timeZone:Y,showSeconds:te=!0,clearable:Z=!1})=>{const[se,ae]=(0,l.useState)(!1),J=(0,l.useRef)(null),{overlayProps:k,underlayProps:_}=(0,o.e)({onClose:()=>ae(!1),isDismissable:!0,isOpen:se,shouldCloseOnInteractOutside:Se=>{const je=document.getElementsByClassName(S.i)[0];return!(je&&je.contains(Se))}},J),{dialogProps:Q}=(0,r.s)({},J),q=(0,m.$j)(),{modalBackdrop:oe}=(0,m.of)(P.o),re=(0,h.A)(`(min-width: ${q.breakpoints.values.lg}px)`),ee="bottom-start",B=(0,m.of)(M),ie=(0,p.getPositioningMiddleware)(ee),{refs:de,floatingStyles:fe}=(0,a.we)({open:se,placement:ee,onOpenChange:ae,middleware:ie,whileElementsMounted:c.ll,strategy:"fixed"}),ce=(0,l.useCallback)(Se=>{ae(!1),G(Se)},[G]),ve=(0,l.useCallback)(Se=>{Se.preventDefault(),ae(!0)},[ae]);return(0,t.jsxs)("div",{"data-testid":"date-time-picker",style:{position:"relative"},children:[(0,t.jsx)(V,{date:O,onChange:G,isFullscreen:re,onOpen:ve,label:z,ref:de.setReference,showSeconds:te,clearable:Z,timeZone:Y}),se?re?(0,t.jsx)(C.ZL,{children:(0,t.jsx)(i.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsx)("div",{ref:J,...k,...Q,children:(0,t.jsx)(w,{date:O,onChange:ce,isFullscreen:!0,onClose:()=>ae(!1),maxDate:U,minDate:K,ref:de.setFloating,style:fe,showSeconds:te,disabledHours:F,disabledMinutes:W,disabledSeconds:H,timeZone:Y})})})}):(0,t.jsxs)(C.ZL,{children:[(0,t.jsx)("div",{className:oe,..._}),(0,t.jsx)(i.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsx)("div",{ref:J,...k,...Q,children:(0,t.jsx)("div",{className:B.modal,children:(0,t.jsx)(w,{date:O,maxDate:U,minDate:K,onChange:ce,isFullscreen:!1,onClose:()=>ae(!1),showSeconds:te,disabledHours:F,disabledMinutes:W,disabledSeconds:H,timeZone:Y})})})})]}):null]})},V=l.forwardRef(({date:O,label:U,onChange:K,onOpen:z,timeZone:G,showSeconds:F=!0,clearable:W=!1},H)=>{const Y=(0,m.of)(M),te=F?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm",[Z,se]=(0,l.useState)(()=>({value:O?(0,g.LE)(O,{timeZone:G}):W?"":(0,g.LE)((0,s.KQ)(),{timeZone:G}),invalid:!1}));(0,l.useEffect)(()=>{if(O){const Q=(0,g.LE)(O,{format:te,timeZone:G});se({invalid:!(0,L.f)(Q),value:(0,s.Ar)(O)?Q:O})}},[O,te,G]);const ae=(0,l.useCallback)(Q=>{const q=!(0,L.f)(Q.currentTarget.value);se({value:Q.currentTarget.value,invalid:q})},[]),J=(0,l.useCallback)(()=>{if(!Z.invalid&&Z.value){const Q=(0,s.oZ)((0,d.O)({timeZone:G}),Z.value);K(Q)}},[Z,K,G]),k=(0,l.useCallback)(()=>{se({value:"",invalid:!1}),K()},[K]),_=(0,t.jsx)(y.$n,{"aria-label":(0,x.t)("grafana-ui.date-time-picker.calendar-icon-label","Time picker"),icon:"calendar-alt",variant:"secondary",onClick:z});return(0,t.jsx)(E.I,{label:U,invalid:!!(Z.value&&Z.invalid),className:Y.field,children:(0,t.jsx)(u.p,{onChange:ae,addonAfter:_,value:Z.value,onBlur:J,"data-testid":v.XF.DateTimePicker.input,placeholder:(0,x.t)("grafana-ui.date-time-picker.select-placeholder","Select date/time"),ref:H,suffix:W&&Z.value&&(0,t.jsx)(b.I,{name:"times",className:Y.clearIcon,onClick:k})})})});V.displayName="DateTimeInput";const w=l.forwardRef(({date:O,onClose:U,onChange:K,isFullscreen:z,maxDate:G,minDate:F,style:W,showSeconds:H=!0,disabledHours:Y,disabledMinutes:te,disabledSeconds:Z,timeZone:se},ae)=>{const J=(0,m.of)(R.h2),k=(0,m.of)(M),[_,Q]=(0,l.useState)(()=>O&&O.isValid()?(0,s.oZ)((0,d.O)({timeZone:se}),O):(0,s.oZ)((0,d.O)({timeZone:se}),new Date)),[q,oe]=(0,l.useState)(()=>O&&O.isValid()?(0,j.Q)(O.toDate(),(0,d.O)({timeZone:se})):(0,j.Q)(new Date,(0,d.O)({timeZone:se}))),re=(0,l.useCallback)(ie=>{ie&&!Array.isArray(ie)&&oe(ie)},[]),ee=(0,l.useCallback)(ie=>{Q(ie)},[]),B=()=>{const ie=(0,s.KQ)(_);ie.set("date",q.getDate()),ie.set("month",q.getMonth()),ie.set("year",q.getFullYear()),K(ie)};return(0,t.jsxs)("div",{className:(0,n.cx)(k.container,{[k.fullScreen]:z}),style:W,ref:ae,children:[(0,t.jsx)(f.Ay,{next2Label:null,prev2Label:null,value:q,nextLabel:(0,t.jsx)(b.I,{name:"angle-right"}),nextAriaLabel:(0,x.t)("grafana-ui.date-time-picker.next-label","Next month"),prevLabel:(0,t.jsx)(b.I,{name:"angle-left"}),prevAriaLabel:(0,x.t)("grafana-ui.date-time-picker.previous-label","Previous month"),onChange:re,locale:"en",className:J.body,tileClassName:J.title,maxDate:G,minDate:F}),(0,t.jsx)("div",{className:k.time,children:(0,t.jsx)(S.R,{showSeconds:H,onChange:ee,value:_,disabledHours:Y,disabledMinutes:te,disabledSeconds:Z})}),(0,t.jsxs)(D.B,{children:[(0,t.jsx)(y.$n,{type:"button",onClick:B,children:(0,t.jsx)(x.x6,{i18nKey:"grafana-ui.date-time-picker.apply",children:"Apply"})}),(0,t.jsx)(y.$n,{variant:"secondary",type:"button",onClick:U,children:(0,t.jsx)(x.x6,{i18nKey:"grafana-ui.date-time-picker.cancel",children:"Cancel"})})]})]})});w.displayName="DateTimeCalendar";const M=O=>({container:(0,n.css)({padding:O.spacing(1),border:`1px ${O.colors.border.weak} solid`,borderRadius:O.shape.radius.default,backgroundColor:O.colors.background.primary,zIndex:O.zIndex.modal}),fullScreen:(0,n.css)({position:"absolute"}),time:(0,n.css)({marginBottom:O.spacing(2)}),modal:(0,n.css)({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:O.zIndex.modal,maxWidth:"280px"}),clearIcon:(0,n.css)({cursor:"pointer"}),field:(0,n.css)({marginBottom:0,width:"100%"})})},90929(ne,A,e){"use strict";e.d(A,{N:()=>N});var t=e(74848),n=e(22803),a=e(83505),c=e(46885),r=e(18828),i=e(43107),o=e(93225),l=e(96540),f=e(92745),h=e(63142),d=e(76373),s=e(45861),g=e(37386),v=e(30703),x=e(63527),m=e(92807),p=e(47087),y=e(44398),E=e(8431);const b=/^now$|^now(\-|\+)(\d{1,10})([wdhms])$/,u=M=>({from:S(M.from),to:S(M.to)}),D=M=>{const O=L(M.from),U=L(M.to);return{from:O,to:U,display:`${O} to ${U}`}},P=(M,O=Date.now())=>C(M)?S(M)>Math.ceil(O/1e3)?{isValid:!1,errorMessage:"Can not enter value prior to January 1, 1970."}:{isValid:!0}:{isValid:!1,errorMessage:"Value not in relative time format."},C=M=>b.test(M),S=M=>{const O=b.exec(M);if(!O||O.length!==4)return 0;const[,U,K,z]=O,G=parseInt(K,10);if(isNaN(G))return 0;const F=G*R[z];return U==="+"?F*-1:F},R={w:604800,d:86400,h:3600,m:60,s:1},L=M=>{if(M===0)return"now";const O=Math.abs(M);return M<0?`now+${j(O)}`:`now-${j(O)}`};function j(M){const O=[{unit:"w",value:604800},{unit:"d",value:86400},{unit:"h",value:3600},{unit:"m",value:60},{unit:"s",value:1}];for(const{unit:K,value:z}of O)if(M%z===0)return`${M/z}${K}`;const U=O[O.length-1];return`${M}${U.unit}`}function N(M){const{timeRange:O,onChange:U}=M,[K,z]=(0,l.useState)(!1),G=(0,l.useCallback)(()=>z(!1),[]),F=D(O),[W,H]=(0,l.useState)({value:F.from,validation:P(F.from)}),[Y,te]=(0,l.useState)({value:F.to,validation:P(F.to)}),Z=(0,l.useRef)(null),{overlayProps:se,underlayProps:ae}=(0,o.e)({onClose:()=>z(!1),isDismissable:!0,isOpen:K},Z),{dialogProps:J}=(0,r.s)({},Z),k=(0,E.O)().filter(he=>C(he.from)),_="bottom-start",Q=(0,d.getPositioningMiddleware)(_),{context:q,refs:oe,floatingStyles:re}=(0,a.we)({open:K,placement:_,onOpenChange:z,middleware:Q,whileElementsMounted:c.ll,strategy:"fixed"}),ee=(0,a.kp)(q),B=(0,a.s9)(q),{getReferenceProps:ie,getFloatingProps:de}=(0,a.bv)([B,ee]),fe=(0,h.of)(V(W.validation.errorMessage,Y.validation.errorMessage)),ce=he=>{const Ue=u(he);Ue&&(G(),H({...W,value:he.from}),te({...Y,value:he.to}),U(Ue))},ve=(0,l.useCallback)(he=>{he.stopPropagation(),he.preventDefault(),z(!K)},[K]),Se=he=>{if(he.preventDefault(),!Y.validation.isValid||!W.validation.isValid)return;const Ue=u({from:W.value,to:Y.value,display:""});Ue&&(U(Ue),z(!1))},{from:je,to:Ve}=F;return(0,t.jsxs)("div",{className:fe.container,children:[(0,t.jsxs)("button",{ref:oe.setReference,className:fe.pickerInput,type:"button",onClick:ve,...ie(),children:[(0,t.jsx)("span",{className:fe.clockIcon,children:(0,t.jsx)(v.I,{name:"clock-nine"})}),(0,t.jsx)("span",{children:(0,t.jsxs)(f.x6,{i18nKey:"time-picker.time-range.from-to",children:[{timeOptionFrom:je}," to ",{timeOptionTo:Ve}]})}),(0,t.jsx)("span",{className:fe.caretIcon,children:(0,t.jsx)(v.I,{name:K?"angle-up":"angle-down",size:"lg"})})]}),K&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{role:"presentation",className:fe.backdrop,...ae}),(0,t.jsx)(i.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsx)("div",{ref:Z,...se,...J,children:(0,t.jsx)("div",{className:fe.content,ref:oe.setFloating,style:re,...de(),children:(0,t.jsxs)("div",{className:fe.body,children:[(0,t.jsx)("div",{className:fe.leftSide,children:(0,t.jsx)(m.P,{showScrollIndicators:!0,children:(0,t.jsx)(y.l,{title:(0,f.t)("time-picker.time-range.example-title","Example time ranges"),options:k,onChange:ce,value:F})})}),(0,t.jsxs)("div",{className:fe.rightSide,children:[(0,t.jsx)("div",{className:fe.title,children:(0,t.jsx)(p.e,{children:(0,t.jsx)(f.x6,{i18nKey:"time-picker.time-range.specify",children:"Specify time range"})})}),(0,t.jsx)(g.D,{label:(0,f.t)("time-picker.time-range.from-label","From"),invalid:!W.validation.isValid,error:W.validation.errorMessage,children:(0,t.jsx)(x.p,{onClick:he=>he.stopPropagation(),onBlur:()=>H({...W,validation:P(W.value)}),onChange:he=>H({...W,value:he.currentTarget.value}),value:W.value})}),(0,t.jsx)(g.D,{label:(0,f.t)("time-picker.time-range.to-label","To"),invalid:!Y.validation.isValid,error:Y.validation.errorMessage,children:(0,t.jsx)(x.p,{onClick:he=>he.stopPropagation(),onBlur:()=>te({...Y,validation:P(Y.value)}),onChange:he=>te({...Y,value:he.currentTarget.value}),value:Y.value})}),(0,t.jsx)(s.$n,{"aria-label":(0,f.t)("time-picker.time-range.submit-button-label","TimePicker submit button"),onClick:Se,children:(0,t.jsx)(f.x6,{i18nKey:"time-picker.time-range.apply",children:"Apply time range"})})]})]})})})})]})]})}const V=(M,O)=>U=>{const K=(0,x.n)({theme:U,invalid:!1}),G=250+w(U,M)+w(U,O);return{backdrop:(0,n.css)({position:"fixed",zIndex:U.zIndex.modalBackdrop,top:0,right:0,bottom:0,left:0}),container:(0,n.css)({display:"flex",position:"relative"}),pickerInput:(0,n.cx)(K.input,K.wrapper,(0,n.css)({display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",paddingRight:0,paddingLeft:0,lineHeight:`${U.spacing.gridSize*U.components.height.md-2}px`})),caretIcon:(0,n.cx)(K.suffix,(0,n.css)({position:"relative",marginLeft:U.spacing(.5)})),clockIcon:(0,n.cx)(K.prefix,(0,n.css)({position:"relative",marginRight:U.spacing(.5)})),content:(0,n.css)({background:U.colors.background.primary,boxShadow:U.shadows.z3,position:"absolute",zIndex:U.zIndex.modal,width:"500px",top:"100%",borderRadius:U.shape.radius.default,border:`1px solid ${U.colors.border.weak}`,left:0,whiteSpace:"normal"}),body:(0,n.css)({display:"flex",height:`${G}px`}),description:(0,n.css)({color:U.colors.text.secondary,fontSize:U.typography.size.sm}),leftSide:(0,n.css)({width:"50% !important",borderRight:`1px solid ${U.colors.border.medium}`}),rightSide:(0,n.css)({width:"50%",padding:U.spacing(1)}),title:(0,n.css)({marginBottom:U.spacing(1)})}};function w(M,O){return O?O.length>34?M.spacing.gridSize*6.5:M.spacing.gridSize*4:0}},11527(ne,A,e){"use strict";e.d(A,{R:()=>s,i:()=>d});var t=e(74848),n=e(22803),a=e(84783),c=e(34235),r=e(24938),i=e(25229),o=e(63142),l=e(35484),f=e(3343),h=e(30703);const d="time-of-day-picker-panel",s=({minuteStep:m=1,showHour:p=!0,showSeconds:y=!1,value:E,size:b="auto",disabled:u,disabledHours:D,disabledMinutes:P,disabledSeconds:C,id:S,placeholder:R,...L})=>{const j=(0,o.of)(x),N=L.allowEmpty??!1;return(0,t.jsx)(a.Ay,{id:S,generateConfig:c.A,locale:r.A,allowClear:N&&{clearIcon:(0,t.jsx)(h.I,{name:"times",className:j.clearIcon})},className:(0,n.cx)((0,f.lH)()[b],j.input),classNames:{popup:(0,n.cx)(j.picker,d)},defaultValue:L.allowEmpty?void 0:(0,i.AN)(),disabled:u,disabledTime:()=>({disabledHours:D,disabledMinutes:P,disabledSeconds:C}),format:g(p,y),minuteStep:m,onChange:V=>{if((0,i.u8)(V))return L.allowEmpty?L.onChange(V?(0,i.KQ)(V):void 0):L.onChange((0,i.KQ)(V))},picker:"time",placeholder:R,showNow:!1,needConfirm:!1,suffixIcon:(0,t.jsx)(v,{wrapperStyle:j.caretWrapper}),value:E&&(0,i.AN)(E)})};function g(m=!0,p=!1){const y=m?"HH:":"",E=p?":ss":"";return y+"mm"+E}const v=({wrapperStyle:m=""})=>(0,t.jsx)("div",{className:m,children:(0,t.jsx)(h.I,{name:"angle-down"})}),x=m=>{const p=m.components.input.background,y=m.colors.action.hover,E=m.shape.radius.default,b=m.components.input.borderColor;return{caretWrapper:(0,n.css)({position:"relative",top:"50%",transform:"translateY(-50%)",display:"inline-block",color:m.colors.text.secondary}),clearIcon:(0,n.css)({color:m.colors.text.secondary,"&:hover":{color:m.colors.text.maxContrast}}),picker:(0,n.css)({"&.rc-picker-dropdown":{boxShadow:"none",zIndex:m.zIndex.portal},".rc-picker-time-panel-column":{fontSize:m.typography.htmlFontSize,backgroundColor:p,color:m.colors.text.secondary,padding:"unset",overflowY:"auto",scrollbarWidth:"thin",width:m.spacing(8),li:{paddingRight:m.spacing(2),width:"auto","&.rc-picker-time-panel-cell-selected":{backgroundColor:"inherit",border:`1px solid ${m.colors.action.selectedBorder}`,borderRadius:E,color:m.colors.text.primary},"&:hover":{background:y,color:m.colors.text.primary},"&.rc-picker-time-panel-cell-disabled":{color:m.colors.action.disabledText}},".rc-picker-time-panel-cell-inner":{color:"inherit"},"&:not(:last-of-type)":{borderRight:`1px solid ${b}`}},".rc-picker-panel":{boxShadow:m.shadows.z3,backgroundColor:p,borderColor:b,borderRadius:E,overflow:"hidden"}}),input:(0,n.css)({"&.rc-picker-focused":{border:"none",".rc-picker-input":(0,l.getFocusStyles)(m)},"&.rc-picker-disabled":{".rc-picker-input":{backgroundColor:m.colors.action.disabledBackground,color:m.colors.action.disabledText,border:`1px solid ${m.colors.action.disabledBackground}`,"&:focus":{boxShadow:"none"}}},".rc-picker-input":{backgroundColor:p,borderRadius:E,borderColor:b,borderStyle:"solid",borderWidth:"1px",color:m.colors.text.primary,height:m.spacing(4),padding:m.spacing(0,1),input:{color:"unset",backgroundColor:"unset","&:focus":{outline:"none"},"&::placeholder":{color:m.colors.text.disabled}}},".rc-picker-clear":{alignItems:"center",display:"flex",insetInlineEnd:"unset",position:"relative"}})}}},72296(ne,A,e){"use strict";e.d(A,{A:()=>c,X:()=>r});var t=e(74848),n=e(96540);const a=(0,n.createContext)(void 0);function c({children:i}){const[o,l]=(0,n.useState)(0),[f,h]=(0,n.useState)(),d=(0,n.useMemo)(()=>({sync:s=>h(s),unSync:()=>h(void 0),addPicker:()=>l(s=>s+1),removePicker:()=>{l(s=>{const g=s-1;return g<2&&h(void 0),g})},syncPossible:o>1,synced:!!f,syncedValue:f}),[o,f]);return(0,t.jsx)(a.Provider,{value:d,children:i})}function r(i){const o=(0,n.useContext)(a);return(0,n.useEffect)(()=>o?(o.addPicker(),i&&o.sync(i),()=>{o.removePicker()}):()=>{},[]),(0,n.useMemo)(()=>o&&{sync:o.sync,unSync:o.unSync,syncPossible:o.syncPossible,synced:o.synced,syncedValue:o.syncedValue},[o])}},56265(ne,A,e){"use strict";e.d(A,{b:()=>p});var t=e(74848),n=e(22803),a=e(83505),c=e(43107),r=e(96540),i=e(25229),o=e(22592),l=e(51898),f=e(63142),h=e(30703),d=e(63527),s=e(4364),g=e(83692),v=e(8431),x=e(62348);const m=()=>{},p=({value:E,onChange:b,onChangeTimeZone:u=m,clearable:D,weekStart:P,hideTimeZone:C=!0,timeZone:S="browser",placeholder:R="Select time range",isReversed:L=!0,hideQuickRanges:j=!1,disabled:N=!1,showIcon:V=!1})=>{const[w,M]=(0,r.useState)(!1),O=(0,f.of)(y,N),U=se=>{se.stopPropagation(),se.preventDefault(),!N&&M(!w)},K=()=>{M(!1)},z=se=>{K(),b(se)},G=se=>{se.stopPropagation();const ae=(0,i.KQ)(null),J=(0,i.KQ)(null);b({from:ae,to:J,raw:{from:ae,to:J}})},{refs:F,floatingStyles:W,context:H}=(0,a.we)({open:w,onOpenChange:M,placement:"bottom-start",strategy:"fixed"}),Y=(0,a.s9)(H,{bubbles:{outsidePress:!1}}),{getReferenceProps:te,getFloatingProps:Z}=(0,a.bv)([Y]);return(0,t.jsxs)("div",{className:O.container,children:[(0,t.jsxs)("button",{type:"button",className:O.pickerInput,"data-testid":l.Tp.components.TimePicker.openButton,onClick:U,ref:F.setReference,...te(),children:[V&&(0,t.jsx)(h.I,{name:"clock-nine",size:"sm",className:O.icon}),(0,t.jsx)(g.f,{value:E,timeZone:S,placeholder:R}),!N&&(0,t.jsxs)("span",{className:O.caretIcon,children:[(0,x.X)(E)&&D&&(0,t.jsx)(h.I,{className:O.clearIcon,name:"times",size:"lg",onClick:G}),(0,t.jsx)(h.I,{name:w?"angle-up":"angle-down",size:"lg"})]})]}),w&&(0,t.jsx)(c.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsx)("section",{className:O.content,ref:F.setFloating,style:W,...Z(),children:(0,t.jsx)(s.r,{timeZone:S,value:(0,x.X)(E)?E:(0,o.E2)(),onChange:z,quickOptions:(0,v.O)(),onChangeTimeZone:u,className:O.content,hideTimeZone:C,isReversed:L,hideQuickRanges:j,weekStart:P})})})]})},y=(E,b=!1)=>{const u=(0,d.n)({theme:E,invalid:!1});return{container:(0,n.css)({display:"flex",position:"relative"}),content:(0,n.css)({marginLeft:0,position:"absolute",top:"116%",zIndex:E.zIndex.modal}),pickerInput:(0,n.cx)(u.input,b&&u.inputDisabled,u.wrapper,(0,n.css)({display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",paddingRight:0,lineHeight:`${E.spacing.gridSize*4-2}px`})),caretIcon:(0,n.cx)(u.suffix,(0,n.css)({position:"relative",top:"-1px",marginLeft:E.spacing(.5)})),clearIcon:(0,n.css)({marginRight:E.spacing(.5),"&:hover":{color:E.colors.text.maxContrast}}),placeholder:(0,n.css)({color:E.colors.text.disabled,opacity:1}),icon:(0,n.css)({marginRight:E.spacing(.5)})}}},91867(ne,A,e){"use strict";e.d(A,{_8:()=>N,xS:()=>j,$6:()=>R});var t=e(74848),n=e(22803),a=e(18828),c=e(43107),r=e(93225),i=e(96540),o=e(62717),l=e(80011),f=e(17548),h=e(33239),d=e(51898),s=e(92745),g=e(63142),v=e(93256),x=e(35621),m=e(15245),p=e(7895),y=e(45967),E=e(4364),b=e(34788),u=e(8431),D=e(84596),P=e(72296);function C(O){const{onClick:U,isSynced:K}=O,z=()=>{const G=K?"Unsync all views":"Sync all views to this time range";return(0,t.jsx)(t.Fragment,{children:G})};return(0,t.jsx)(y.m,{content:z,placement:"bottom",children:(0,t.jsx)(p.I,{icon:"link",variant:K?"active":"canvas","aria-label":K?(0,s.t)("grafana-ui.time-sync-button.aria-label-unsync","Unsync times"):(0,s.t)("grafana-ui.time-sync-button.aria-label-sync","Sync times"),onClick:U})})}function S(O){const{value:U,onChangeProp:K,isSyncedProp:z,initialIsSynced:G,timeSyncButtonProp:F}=O,W=(0,P.X)(G&&U?U:void 0),H=W?.synced,Y=W?.syncedValue,te=W?.sync,Z=!!(O.isSyncedProp===void 0&&W),se=(0,i.useCallback)(Q=>{K(Q),Z&&H&&te?.(Q)},[K,Z,te,H]),ae=(0,D.A)(U),J=(0,D.A)(W?.syncedValue);(0,i.useEffect)(()=>{Z&&H&&(U!==ae&&U!==Y?te?.(U):Y&&Y!==J&&Y!==U&&K(Y))},[Z,H,Y,te,J,U,ae,K]);const k=Z?W?.synced:z,_=Z?W?.syncPossible&&(0,t.jsx)(C,{isSynced:W?.synced,onClick:()=>W?.synced?W.unSync():W.sync(U)}):F;return{onChangeWithSync:se,isSynced:k,timeSyncButton:_}}function R(O){const[U,K]=(0,i.useState)(!1),{value:z,onMoveBackward:G,onMoveForward:F,moveForwardTooltip:W,moveBackwardTooltip:H,onZoom:Y,onError:te,timeZone:Z,fiscalYearStartMonth:se,history:ae,onChangeTimeZone:J,onChangeFiscalYearStartMonth:k,quickRanges:_,hideQuickRanges:Q,widthOverride:q,isOnCanvas:oe,onToolbarTimePickerClick:re,weekStart:ee,initialIsSynced:B}=O,{onChangeWithSync:ie,isSynced:de,timeSyncButton:fe}=S({initialIsSynced:B,value:z,onChangeProp:O.onChange,isSyncedProp:O.isSynced,timeSyncButtonProp:O.timeSyncButton}),ce=Ae=>{ie(Ae),K(!1)};(0,i.useEffect)(()=>{U&&re&&re()},[U,re]);const ve=()=>{K(Ae=>!Ae)},Se=()=>{K(!1)},je=(0,i.createRef)(),Ve=(0,i.createRef)(),{overlayProps:he,underlayProps:Ue}=(0,r.e)({onClose:Se,isDismissable:!0,isOpen:U,shouldCloseOnInteractOutside:Ae=>{const $e=(0,m.gF)();return!Ve.current?.contains(Ae)&&!$e.contains(Ae)}},je),{dialogProps:pe}=(0,a.s)({},je),be=(0,g.of)(w),{modalBackdrop:ze}=(0,g.of)(x.o),Ne=de?"active":oe?"canvas":"default",ke=z?.to?.isBefore(z.from)?"exclamation-triangle":"clock-nine",Ee=V(z,Z,_);return(0,t.jsxs)(v.e,{className:be.container,children:[(0,t.jsx)(p.I,{variant:Ne,onClick:G,icon:"angle-double-left",type:"button",iconSize:"xl",tooltip:H??(0,s.t)("time-picker.range-picker.backwards-time-aria-label","Move time range backwards"),narrow:!0}),(0,t.jsx)(y.m,{ref:Ve,content:(0,t.jsx)(j,{timeRange:z,timeZone:Z}),placement:"bottom",interactive:!0,children:(0,t.jsx)(p.I,{"data-testid":d.Tp.components.TimePicker.openButton,"aria-label":(0,s.t)("time-picker.range-picker.current-time-selected","Time range selected: {{currentTimeRange}}",{currentTimeRange:Ee}),"aria-controls":"TimePickerContent",onClick:ve,icon:ke,isOpen:U,type:"button",variant:Ne,children:(0,t.jsx)(N,{...O})})}),U&&(0,t.jsxs)("div",{"data-testid":d.Tp.components.TimePicker.overlayContent,children:[(0,t.jsx)("div",{role:"presentation",className:(0,n.cx)(ze,be.backdrop),...Ue}),(0,t.jsx)(c.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsx)("section",{className:be.content,ref:je,...he,...pe,children:(0,t.jsx)(E.r,{timeZone:Z,fiscalYearStartMonth:se,value:z,onChange:ce,quickOptions:_||(0,u.O)(),history:ae,showHistory:!0,widthOverride:q,onChangeTimeZone:J,onChangeFiscalYearStartMonth:k,hideQuickRanges:Q,onError:te,weekStart:ee})})})]}),fe,(0,t.jsx)(p.I,{onClick:F,icon:"angle-double-right",type:"button",variant:Ne,iconSize:"xl",tooltip:W??(0,s.t)("time-picker.range-picker.forwards-time-aria-label","Move time range forwards"),narrow:!0}),(0,t.jsx)(y.m,{content:L,placement:"bottom",children:(0,t.jsx)(p.I,{"aria-label":(0,s.t)("time-picker.range-picker.zoom-out-button","Zoom out time range"),onClick:Y,icon:"search-minus",type:"button",variant:Ne})})]})}R.displayName="TimeRangePicker";const L=()=>(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(s.x6,{i18nKey:"time-picker.range-picker.zoom-out-tooltip",children:["Time range zoom out ",(0,t.jsx)("br",{})," CTRL+Z"]})}),j=({timeRange:O,timeZone:U})=>{const K=(0,g.of)(M),z=Date.now(),G=U?(0,o.QZ)(U,z):void 0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,l.LE)(O.from,{timeZone:U}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)(s.x6,{i18nKey:"time-picker.range-picker.to",children:"to"})}),(0,l.LE)(O.to,{timeZone:U})]}),(0,t.jsxs)("div",{className:K.container,children:[(0,t.jsx)("span",{className:K.utc,children:(0,o.le)(U)}),(0,t.jsx)(b.E,{info:G})]})]})},N=(0,i.memo)(({hideText:O,value:U,timeZone:K,quickRanges:z})=>{const G=(0,g.of)(M);return O?null:(0,t.jsxs)("span",{className:G.container,"aria-live":"polite","aria-atomic":"true",children:[(0,t.jsx)("span",{children:V(U,K,z)}),(0,t.jsx)("span",{className:G.utc,children:f.describeTimeRangeAbbreviation(U,K)})]})});N.displayName="TimePickerButtonLabel";const V=(O,U,K)=>{const z={to:h.isMathString(O.raw.to)?O.raw.to:O.to,from:h.isMathString(O.raw.from)?O.raw.from:O.from};return f.describeTimeRange(z,U,K)},w=O=>({container:(0,n.css)({position:"relative",display:"flex",verticalAlign:"middle"}),backdrop:(0,n.css)({display:"none",[O.breakpoints.down("sm")]:{display:"block"}}),content:(0,n.css)({position:"absolute",right:0,top:"116%",zIndex:O.zIndex.dropdown,[O.breakpoints.down("sm")]:{position:"fixed",right:"50%",top:"50%",transform:"translate(50%, -50%)",zIndex:O.zIndex.modal}})}),M=O=>({container:(0,n.css)({display:"flex",alignItems:"center",whiteSpace:"nowrap",columnGap:O.spacing(.5)}),utc:(0,n.css)({color:O.v1.palette.orange,fontSize:O.typography.size.sm,paddingLeft:"6px",lineHeight:"28px",verticalAlign:"bottom",fontWeight:O.typography.fontWeightMedium})})},66630(ne,A,e){"use strict";e.d(A,{h2:()=>m,nB:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(93581),r=e(44922),i=e(92745),o=e(63142),l=e(30703),f=e(5857),h=e(41e3);const d={saturday:"islamic",sunday:"gregory",monday:"iso8601"};function s({onChange:p,from:y,to:E,timeZone:b,weekStart:u}){const D=g(y,E,new Date,b),P=v(p,b),C=(0,o.of)(m),S=(0,f.rL)(u);return(0,t.jsx)(c.Ay,{selectRange:!0,next2Label:null,prev2Label:null,className:C.body,tileClassName:C.title,value:D,nextLabel:(0,t.jsx)(l.I,{name:"angle-right"}),nextAriaLabel:(0,i.t)("time-picker.calendar.next-month","Next month"),prevLabel:(0,t.jsx)(l.I,{name:"angle-left"}),prevAriaLabel:(0,i.t)("time-picker.calendar.previous-month","Previous month"),onChange:P,locale:"en",calendarType:d[S]})}s.displayName="Body";function g(p,y,E=new Date,b){let u=p.isValid()?p.toDate():E,D=y.isValid()?y.toDate():E;return b&&(u=(0,h.Q)(u,b),D=(0,h.Q)(D,b)),u>D?[D,u]:[u,D]}function v(p,y){return(0,a.useCallback)(E=>{if(!Array.isArray(E))return console.error("onCalendarChange: should be run in selectRange={true}");if(E[0]&&E[1]){const b=(0,r.b)(x(E[0]),{timeZone:y}),u=(0,r.b)(x(E[1]),{timeZone:y});p(b,u)}},[p,y])}function x(p){return[p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds()]}const m=p=>{const y=".react-calendar__tile--hasActive:not(.react-calendar__tile--range)";return{title:(0,n.css)({color:p.colors.text.primary,backgroundColor:p.colors.background.primary,fontSize:p.typography.size.md,border:"1px solid transparent","&:hover, &:focus":{position:"relative"},"&:disabled":{color:p.colors.action.disabledText,cursor:"not-allowed"}}),body:(0,n.css)({zIndex:p.zIndex.modal,backgroundColor:p.colors.background.elevated,width:"268px",".react-calendar__navigation":{display:"flex"},".react-calendar__navigation__label, .react-calendar__navigation__arrow, .react-calendar__navigation":{paddingTop:"4px",backgroundColor:"inherit",color:p.colors.text.primary,border:0,fontWeight:p.typography.fontWeightMedium},".react-calendar__month-view__weekdays":{backgroundColor:"inherit",textAlign:"center",color:p.colors.primary.text,abbr:{border:0,textDecoration:"none",cursor:"default",display:"block",padding:"4px 0 4px 0"}},".react-calendar__month-view__days":{backgroundColor:"inherit"},".react-calendar__tile, .react-calendar__tile--now":{marginBottom:"4px",backgroundColor:"inherit",height:"26px"},".react-calendar__navigation__label, .react-calendar__navigation > button:focus, .time-picker-calendar-tile:focus":{outline:0},".react-calendar__tile--hover":{backgroundColor:p.colors.action.hover,borderRadius:0},".react-calendar__tile--hoverStart":{borderTopLeftRadius:p.shape.radius.pill,borderBottomLeftRadius:p.shape.radius.pill},".react-calendar__tile--hoverEnd":{borderTopRightRadius:p.shape.radius.pill,borderBottomRightRadius:p.shape.radius.pill},".react-calendar__tile:hover:not(.react-calendar__tile--hover):not(.react-calendar__tile--active):not(.react-calendar__tile--hasActive)":{backgroundColor:p.colors.action.hover,borderRadius:p.shape.radius.pill},[`${y}, .react-calendar__tile--rangeStart:not(.react-calendar__tile--hover)`]:{borderTopLeftRadius:p.shape.radius.pill,borderBottomLeftRadius:p.shape.radius.pill},[`${y}, .react-calendar__tile--rangeEnd:not(.react-calendar__tile--hover)`]:{borderTopRightRadius:p.shape.radius.pill,borderBottomRightRadius:p.shape.radius.pill},[`${y}, .react-calendar__tile--active, .react-calendar__tile--rangeEnd, .react-calendar__tile--rangeStart`]:{color:p.colors.primary.contrastText,fontWeight:p.typography.fontWeightMedium,background:p.colors.primary.main,border:"0px"}})}}},4364(ne,A,e){"use strict";e.d(A,{r:()=>ve});var t=e(74848),n=e(22803),a=e(96540),c=e(25229),r=e(17548),i=e(51898),o=e(92745),l=e(63142),f=e(35484),h=e(12737),d=e(30703),s=e(89640),g=e(2543),v=e(62717),x=e(45861),m=e(43243),p=e(37386),y=e(60208),E=e(13941),b=e(54314),u=e(59310),D=e(34788),P=e(44229),C=e(27228),S=e(8431);const R=Ie=>{const{timeZone:ke,fiscalYearStartMonth:Ee,timestamp:Ae=Date.now(),onChangeTimeZone:$e,onChangeFiscalYearStartMonth:Fe}=Ie,[We,Ge]=(0,a.useState)(!1),[me,De]=(0,a.useState)("tz"),xe=(0,a.useId)(),Me=(0,a.useId)(),Be=(0,a.useId)(),Oe=(0,a.useCallback)(Ce=>{Ce&&Ce.stopPropagation(),Ge(!We)},[We,Ge]),Re=(0,l.of)(L);if(!(0,g.isString)(ke))return null;const we=(0,v.QZ)(ke,Ae);return we?(0,t.jsxs)("div",{children:[(0,t.jsxs)("section",{"aria-label":(0,o.t)("time-picker.footer.time-zone-selection","Time zone selection"),className:Re.container,children:[(0,t.jsxs)("div",{className:Re.timeZoneContainer,children:[(0,t.jsxs)("div",{className:Re.timeZone,children:[(0,t.jsx)(C.U,{title:we.name}),(0,t.jsx)("div",{className:Re.spacer}),(0,t.jsx)(D.E,{info:we})]}),(0,t.jsx)(P.X,{timeZone:ke,timestamp:Ae})]}),(0,t.jsx)("div",{className:Re.spacer}),(0,t.jsx)(x.$n,{"data-testid":i.Tp.components.TimeZonePicker.changeTimeSettingsButton,variant:"secondary",onClick:Oe,size:"sm","aria-expanded":We,"aria-controls":xe,icon:We?"angle-up":"angle-down",children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.footer.change-settings-button",children:"Change time settings"})})]}),We?(0,t.jsxs)("div",{className:Re.editContainer,id:xe,children:[(0,t.jsxs)(b.U,{children:[(0,t.jsx)(y.o,{label:(0,o.t)("time-picker.footer.time-zone-option","Time zone"),active:me==="tz",onChangeTab:()=>{De("tz")},"aria-controls":Me}),(0,t.jsx)(y.o,{label:(0,o.t)("time-picker.footer.fiscal-year-option","Fiscal year"),active:me==="fy",onChangeTab:()=>{De("fy")},"aria-controls":Be})]}),(0,t.jsx)(E.J,{className:Re.noBackground,children:me==="tz"?(0,t.jsx)("section",{role:"tabpanel","data-testid":i.Tp.components.TimeZonePicker.containerV2,id:Me,className:(0,n.cx)(Re.timeZoneContainer,Re.timeSettingContainer),children:(0,t.jsx)(u.U,{includeInternal:!0,onChange:Ce=>{Oe(),(0,g.isString)(Ce)&&$e(Ce)},onBlur:Oe,menuShouldPortal:!1})}):(0,t.jsx)("section",{role:"tabpanel","data-testid":i.Tp.components.TimeZonePicker.containerV2,id:Be,className:(0,n.cx)(Re.timeZoneContainer,Re.timeSettingContainer),children:(0,t.jsx)(p.D,{className:Re.fiscalYearField,label:(0,o.t)("time-picker.footer.fiscal-year-start","Fiscal year start month"),children:(0,t.jsx)(m.G,{value:Ee??null,options:(0,S.L)(),onChange:Ce=>{Fe&&Fe(Ce?.value??0)}})})})})]}):null]}):null},L=Ie=>({container:(0,n.css)({borderTop:`1px solid ${Ie.colors.border.weak}`,padding:Ie.spacing(1.5),display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"}),editContainer:(0,n.css)({borderTop:`1px solid ${Ie.colors.border.weak}`,padding:Ie.spacing(1.5),paddingTop:0,justifyContent:"space-between",alignItems:"center"}),spacer:(0,n.css)({marginLeft:"7px"}),timeSettingContainer:(0,n.css)({paddingTop:Ie.spacing(1)}),noBackground:(0,n.css)({background:"inherit"}),fiscalYearField:(0,n.css)({marginBottom:0}),timeZoneContainer:(0,n.css)({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1}),timeZone:(0,n.css)({display:"flex",flexDirection:"row",alignItems:"baseline",flexGrow:1})});var j=e(47087),N=e(44922),V=e(80011),w=e(63527),M=e(45967),O=e(67511),U=e(62348),K=e(18828),z=e(43107),G=e(93225),F=e(59875),W=e(35621),H=e(66630),Y=e(41654);function te({onClose:Ie,onApply:ke}){return(0,t.jsxs)(Y.B,{gap:2,justifyContent:"space-between",children:[(0,t.jsx)(x.$n,{variant:"secondary",onClick:Ie,children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.calendar.cancel-button",children:"Cancel"})}),(0,t.jsx)(x.$n,{onClick:ke,children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.calendar.apply-button",children:"Apply time range"})})]})}te.displayName="Footer";var Z=e(76319);function se({onClose:Ie}){return(0,t.jsxs)(Y.B,{justifyContent:"space-between",children:[(0,t.jsx)(j.e,{children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.calendar.select-time",children:"Select a time range"})}),(0,t.jsx)(Z.K,{"data-testid":i.Tp.components.TimePicker.calendar.closeButton,tooltip:(0,o.t)("time-picker.calendar.close","Close calendar"),name:"times",variant:"secondary",onClick:Ie})]})}se.displayName="Header";const ae=(Ie,ke=!1)=>({container:(0,n.css)({top:0,position:"absolute",[`${ke?"left":"right"}`]:"546px"}),modalContainer:(0,n.css)({label:"modalContainer",margin:"0 auto"}),calendar:(0,n.css)({display:"flex",flexDirection:"column",gap:Ie.spacing(1),padding:Ie.spacing(1),label:"calendar",boxShadow:Ie.shadows.z3,backgroundColor:Ie.colors.background.elevated,border:`1px solid ${Ie.colors.border.weak}`,borderRadius:Ie.shape.radius.default}),modal:(0,n.css)({label:"modal",boxShadow:Ie.shadows.z3,left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)",zIndex:Ie.zIndex.modal})});function J(Ie){const ke=(0,l.$j)(),{modalBackdrop:Ee}=(0,l.of)(W.o),Ae=ae(ke,Ie.isReversed),{isOpen:$e,isFullscreen:Fe,onClose:We}=Ie,Ge=(0,a.createRef)(),{dialogProps:me}=(0,K.s)({"aria-label":i.Tp.components.TimePicker.calendar.label},Ge),{overlayProps:De}=(0,G.e)({isDismissable:!0,isOpen:$e,onClose:We},Ge),xe=!Fe;if(!$e)return null;const Me=(0,t.jsxs)("section",{className:Ae.calendar,ref:Ge,...De,...me,"data-testid":i.Tp.components.TimePicker.calendar.label,children:[(0,t.jsx)(se,{...Ie}),(0,t.jsx)(H.nB,{...Ie}),xe&&(0,t.jsx)(te,{...Ie})]});return xe?(0,t.jsxs)(F.Sf,{children:[(0,t.jsx)("div",{className:Ee}),(0,t.jsx)(z.n1,{contain:!0,autoFocus:!0,restoreFocus:!0,children:(0,t.jsx)("div",{className:Ae.modal,children:(0,t.jsx)("div",{className:Ae.modalContainer,children:Me})})})]}):(0,t.jsx)(z.n1,{contain:!0,restoreFocus:!0,autoFocus:!0,children:(0,t.jsx)("div",{className:Ae.container,children:Me})})}const k=(0,a.memo)(J);J.displayName="TimePickerCalendar";const _={default:()=>(0,o.t)("time-picker.range-content.default-error",'Please enter a past date or "{{now}}"',{now:"now"}),range:()=>(0,o.t)("time-picker.range-content.range-error",`"From" can't be after "To"`)},Q=Ie=>{const{value:ke,isFullscreen:Ee=!1,timeZone:Ae,onApply:$e,isReversed:Fe,fiscalYearStartMonth:We,onError:Ge,weekStart:me}=Ie,[De,xe]=oe(ke.raw.from,ke.raw.to,Ae),Me=(0,l.of)(ee),[Be,Oe]=(0,a.useState)(De),[Re,we]=(0,a.useState)(xe),[Ce,_e]=(0,a.useState)(!1),Je=(0,a.useId)(),et=(0,a.useId)();(0,a.useEffect)(()=>{const[vt,wt]=oe(ke.raw.from,ke.raw.to,Ae);Oe(vt),we(wt)},[ke.raw.from,ke.raw.to,Ae]);const qe=(0,a.useCallback)(vt=>{vt.preventDefault(),_e(!0)},[_e]),nt=(0,a.useCallback)(()=>{if(Re.invalid||Be.invalid)return;const vt={from:Be.value,to:Re.value},wt=r.convertRawToRange(vt,Ae,We,O.d);$e(wt)},[Be.invalid,Be.value,$e,Ae,Re.invalid,Re.value,We]),ot=(0,a.useCallback)((vt,wt)=>{const[$t,_t]=oe(vt,wt,Ae);Oe($t),we(_t)},[Ae]),Ze=vt=>{vt.key==="Enter"&&nt()},at=()=>{const vt=ke.raw,wt=r.formatRawTimeRange(vt);navigator.clipboard.writeText(JSON.stringify(wt))},it=async()=>{const vt=await navigator.clipboard.readText();let wt;try{wt=JSON.parse(vt)}catch{Ge&&Ge(vt);return}const[$t,_t]=oe(wt.from,wt.to,Ae);Oe($t),we(_t)},ct=r.convertRawToRange({from:"now/fy",to:"now/fy"},Ae,We),xt=(0,t.jsx)("div",{className:Me.tooltip,children:r.isFiscal(ke)?(0,t.jsx)(M.m,{content:(0,o.t)("time-picker.range-content.fiscal-year","Fiscal year: {{from}} - {{to}}",{from:ct.from.format("MMM-DD"),to:ct.to.format("MMM-DD")}),children:(0,t.jsx)(d.I,{name:"info-circle"})}):null}),dt=(0,t.jsx)(x.$n,{"aria-label":(0,o.t)("time-picker.range-content.open-input-calendar","Open calendar"),"data-testid":i.Tp.components.TimePicker.calendar.openButton,icon:"calendar-alt",variant:"secondary",type:"button",onClick:qe});return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:Me.fieldContainer,children:[(0,t.jsx)(p.D,{label:(0,o.t)("time-picker.range-content.from-input","From"),invalid:Be.invalid,error:Be.errorMessage,children:(0,t.jsx)(w.p,{id:Je,onClick:vt=>vt.stopPropagation(),onChange:vt=>ot(vt.currentTarget.value,Re.value),addonAfter:dt,onKeyDown:Ze,"data-testid":i.Tp.components.TimePicker.fromField,value:Be.value})}),xt]}),(0,t.jsxs)("div",{className:Me.fieldContainer,children:[(0,t.jsx)(p.D,{label:(0,o.t)("time-picker.range-content.to-input","To"),invalid:Re.invalid,error:Re.errorMessage,children:(0,t.jsx)(w.p,{id:et,onClick:vt=>vt.stopPropagation(),onChange:vt=>ot(Be.value,vt.currentTarget.value),addonAfter:dt,onKeyDown:Ze,"data-testid":i.Tp.components.TimePicker.toField,value:Re.value})}),xt]}),(0,t.jsxs)("div",{className:Me.buttonsContainer,children:[(0,t.jsx)(x.$n,{"data-testid":i.Tp.components.TimePicker.copyTimeRange,icon:"copy",variant:"secondary",tooltip:(0,o.t)("time-picker.copy-paste.tooltip-copy","Copy time range to clipboard"),type:"button",onClick:at}),(0,t.jsx)(x.$n,{"data-testid":i.Tp.components.TimePicker.pasteTimeRange,icon:"clipboard-alt",variant:"secondary",tooltip:(0,o.t)("time-picker.copy-paste.tooltip-paste","Paste time range"),type:"button",onClick:it}),(0,t.jsx)(x.$n,{"data-testid":i.Tp.components.TimePicker.applyTimeRange,type:"button",onClick:nt,children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.range-content.apply-button",children:"Apply time range"})})]}),(0,t.jsx)(k,{isFullscreen:Ee,isOpen:Ce,from:(0,N.b)(Be.value,{timeZone:Ae}),to:(0,N.b)(Re.value,{timeZone:Ae}),onApply:nt,onClose:()=>_e(!1),onChange:ot,timeZone:Ae,isReversed:Fe,weekStart:me})]})};function q(Ie,ke,Ee){const Ae={from:Ie,to:ke},$e=r.convertRawToRange(Ae,Ee,void 0,O.d);return!($e.from.isSame($e.to)||$e.from.isBefore($e.to))}function oe(Ie,ke,Ee){const Ae=re(Ie,Ee),$e=re(ke,Ee),Fe=!(0,U.f)(Ae,!1,Ee),We=!(0,U.f)($e,!0,Ee),Ge=q(Ae,$e,Ee)&&!We;return[{value:Ae,invalid:Fe||Ge,errorMessage:Ge&&!Fe?_.range():_.default()},{value:$e,invalid:We,errorMessage:_.default()}]}function re(Ie,ke){if((0,c.Ar)(Ie))return(0,V.LE)(Ie,{timeZone:ke,format:O.d});if(Ie.endsWith("Z")){const Ee=(0,N.b)(Ie);return(0,V.LE)(Ee,{timeZone:ke,format:O.d})}return Ie}function ee(Ie){return{fieldContainer:(0,n.css)({display:"flex"}),buttonsContainer:(0,n.css)({display:"flex",gap:Ie.spacing(.5),marginTop:Ie.spacing(1)}),tooltip:(0,n.css)({paddingLeft:Ie.spacing(1),paddingTop:Ie.spacing(3)})}}var B=e(44398),ie=e(27629);const de=(Ie,ke)=>r.convertRawToRange({from:Ie.from,to:Ie.to},ke,void 0,O.d),fe=(Ie,ke)=>{const Ee=(0,V.LE)(Ie.from,{timeZone:ke,format:O.d}),Ae=(0,V.LE)(Ie.to,{timeZone:ke,format:O.d});let $e=`${Ee} to ${Ae}`;return(0,ie.$)("localeFormatPreference")&&($e=r.describeTimeRange(Ie,ke)),{from:Ee,to:Ae,display:$e}},ce=Ie=>{const{quickOptions:ke=[],isReversed:Ee,isFullscreen:Ae,hideQuickRanges:$e,timeZone:Fe,fiscalYearStartMonth:We,value:Ge,onChange:me,history:De,showHistory:xe,className:Me,hideTimeZone:Be,onChangeTimeZone:Oe,onChangeFiscalYearStartMonth:Re}=Ie,we=!De?.length,Ce=Ae&&xe||!Ae&&(xe&&!we||!$e),_e=(0,l.of)(pe,Ee,$e,Ce,Ae),Je=he(De,Fe),et=Ue(Ge.raw,ke),[qe,nt]=(0,a.useState)(""),ot=ke.filter(at=>at.display.toLowerCase().includes(qe.toLowerCase())),Ze=at=>me(de(at));return(0,t.jsxs)("div",{id:"TimePickerContent",className:(0,n.cx)(_e.container,Me),children:[(0,t.jsxs)("div",{className:_e.body,children:[(!Ae||!$e)&&(0,t.jsxs)("div",{className:_e.rightSide,children:[(0,t.jsx)("div",{className:_e.timeRangeFilter,children:(0,t.jsx)(h.Z,{width:0,value:qe,onChange:nt,placeholder:(0,o.t)("time-picker.content.filter-placeholder","Search quick ranges")})}),(0,t.jsxs)("div",{className:_e.scrollContent,children:[!Ae&&(0,t.jsx)(Se,{...Ie,historyOptions:Je}),!$e&&(0,t.jsx)(B.l,{options:ot,onChange:Ze,value:et})]})]}),Ae&&(0,t.jsx)("div",{className:_e.leftSide,children:(0,t.jsx)(je,{...Ie,historyOptions:Je})})]}),!Be&&Ae&&(0,t.jsx)(R,{timeZone:Fe,fiscalYearStartMonth:We,onChangeTimeZone:Oe,onChangeFiscalYearStartMonth:Re})]})},ve=Ie=>{const{widthOverride:ke}=Ie,Ee=(0,l.$j)(),Ae=(ke||window.innerWidth)>=Ee.breakpoints.values.lg;return(0,t.jsx)(ce,{...Ie,isFullscreen:Ae})},Se=Ie=>{const{value:ke,hideQuickRanges:Ee,onChange:Ae,timeZone:$e,historyOptions:Fe=[],showHistory:We,onError:Ge,weekStart:me}=Ie,De=(0,l.of)(be),xe=(0,c.Ar)(ke.raw.from)||(0,c.Ar)(ke.raw.to),[Me,Be]=(0,a.useState)(!xe),Oe=Ee?!1:Me,Re=we=>Ae(de(we,$e));return(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("div",{className:De.header,children:(0,t.jsxs)("button",{type:"button",className:De.expandButton,onClick:()=>{Ee||Be(!Oe)},"data-testid":i.Tp.components.TimePicker.absoluteTimeRangeTitle,"aria-expanded":!Oe,"aria-controls":"expanded-timerange",children:[(0,t.jsx)(j.e,{children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.absolute.title",children:"Absolute time range"})}),!Ee&&(0,t.jsx)(d.I,{name:Oe?"angle-down":"angle-up"})]})}),!Oe&&(0,t.jsxs)("div",{className:De.body,id:"expanded-timerange",children:[(0,t.jsx)("div",{className:De.form,children:(0,t.jsx)(Q,{value:ke,onApply:Ae,timeZone:$e,isFullscreen:!1,onError:Ge,weekStart:me})}),We&&(0,t.jsx)(B.l,{title:(0,o.t)("time-picker.absolute.recent-title","Recently used absolute ranges"),options:Fe,onChange:Re,placeholderEmpty:null})]})]})},je=Ie=>{const{onChange:ke,value:Ee,timeZone:Ae,fiscalYearStartMonth:$e,isReversed:Fe,historyOptions:We,onError:Ge,weekStart:me}=Ie,De=(0,l.of)(ze,Ie.hideQuickRanges),xe=Me=>ke(de(Me,Ae));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:De.container,children:[(0,t.jsx)("div",{className:De.title,"data-testid":i.Tp.components.TimePicker.absoluteTimeRangeTitle,children:(0,t.jsx)(j.e,{children:(0,t.jsx)(o.x6,{i18nKey:"time-picker.absolute.title",children:"Absolute time range"})})}),(0,t.jsx)(Q,{value:Ee,timeZone:Ae,fiscalYearStartMonth:$e,onApply:ke,isFullscreen:!0,isReversed:Fe,onError:Ge,weekStart:me})]}),Ie.showHistory&&(0,t.jsx)("div",{className:De.recent,children:(0,t.jsx)(B.l,{title:(0,o.t)("time-picker.absolute.recent-title","Recently used absolute ranges"),options:We||[],onChange:xe,placeholderEmpty:(0,t.jsx)(Ve,{})})})]})},Ve=(0,a.memo)(()=>{const Ie=(0,l.of)(Ne),ke=(0,o.t)("time-picker.content.empty-recent-list-info","It looks like you haven't used this time picker before. As soon as you enter some time intervals, recently used intervals will appear here.");return(0,t.jsxs)("div",{className:Ie.container,children:[(0,t.jsx)("div",{children:(0,t.jsx)("span",{children:ke})}),(0,t.jsx)(o.x6,{i18nKey:"time-picker.content.empty-recent-list-docs",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(s.Y,{href:"https://grafana.com/docs/grafana/latest/dashboards/time-range-controls",external:!0,children:"Read the documentation"}),(0,t.jsx)("span",{children:" to find out more about how to enter custom time ranges."})]})})]})});function he(Ie,ke){return!Array.isArray(Ie)||Ie.length===0?[]:Ie.map(Ee=>fe(Ee,ke))}Ve.displayName="EmptyRecentList";const Ue=(Ie,ke)=>(0,a.useMemo)(()=>{if(r.isRelativeTimeRange(Ie))return ke.find(Ee=>Ee.from===Ie.from&&Ee.to===Ie.to)},[Ie,ke]),pe=(Ie,ke,Ee,Ae,$e)=>({container:(0,n.css)({background:Ie.colors.background.elevated,boxShadow:Ie.shadows.z3,width:`${$e?"546px":"262px"}`,borderRadius:Ie.shape.radius.default,border:`1px solid ${Ie.colors.border.weak}`,[`${ke?"left":"right"}`]:0,display:"flex",flexDirection:"column"}),body:(0,n.css)({display:"flex",flexDirection:"row-reverse",height:`${Ae?"381px":"217px"}`,maxHeight:"100vh"}),leftSide:(0,n.css)({display:"flex",flexDirection:"column",borderRight:`${ke?"none":`1px solid ${Ie.colors.border.weak}`}`,width:`${Ee?"100%":"60%"}`,overflow:"auto",scrollbarWidth:"thin",order:ke?1:0}),rightSide:(0,n.css)({width:`${$e?"40%":"100%"}; !important`,borderRight:ke?`1px solid ${Ie.colors.border.weak}`:"none",display:"flex",flexDirection:"column"}),timeRangeFilter:(0,n.css)({padding:Ie.spacing(1)}),spacing:(0,n.css)({marginTop:"16px"}),scrollContent:(0,n.css)({overflowY:"auto",scrollbarWidth:"thin"})}),be=Ie=>({header:(0,n.css)({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Ie.colors.border.weak}`,padding:"7px 9px 7px 9px"}),expandButton:(0,n.css)({backgroundColor:"transparent",border:"none",display:"flex",width:"100%","&:focus-visible":(0,f.getFocusStyles)(Ie)}),body:(0,n.css)({borderBottom:`1px solid ${Ie.colors.border.weak}`}),form:(0,n.css)({padding:"7px 9px 7px 9px"})}),ze=(Ie,ke)=>({container:(0,n.css)({paddingTop:"9px",paddingLeft:"11px",paddingRight:ke?"11px":"20%"}),title:(0,n.css)({marginBottom:"11px"}),recent:(0,n.css)({flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"flex-end",paddingTop:Ie.spacing(1)})}),Ne=Ie=>({container:(0,n.css)({padding:"12px",margin:"12px","a, span":{fontSize:"13px"}})})},47087(ne,A,e){"use strict";e.d(A,{e:()=>i});var t=e(74848),n=e(22803),a=e(96540),c=e(63142);const r=o=>({text:(0,n.css)({fontSize:o.typography.size.md,fontWeight:o.typography.fontWeightMedium,color:o.colors.text.primary,margin:0,display:"flex"})}),i=(0,a.memo)(({children:o})=>{const l=(0,c.of)(r);return(0,t.jsx)("h3",{className:l.text,children:o})});i.displayName="TimePickerTitle"},83692(ne,A,e){"use strict";e.d(A,{f:()=>o});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(91867),i=e(62348);const o=(0,a.memo)(function({hideText:h,value:d,timeZone:s="browser",placeholder:g="No time range selected",className:v}){const x=(0,c.of)(l);return h?null:(0,t.jsx)("span",{className:v,children:(0,i.X)(d)?(0,t.jsx)(r._8,{value:d,timeZone:s}):(0,t.jsx)("span",{className:x.placeholder,children:g})})}),l=f=>({placeholder:(0,n.css)({color:f.colors.text.disabled,opacity:1})})},44398(ne,A,e){"use strict";e.d(A,{l:()=>v});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(47087),o=e(24726),l=e(35484);const f=b=>({container:(0,n.css)({display:"flex",alignItems:"center",flexDirection:"row-reverse",justifyContent:"space-between",position:"relative"}),radio:(0,n.css)({opacity:0,width:"0 !important","&:focus-visible + label":(0,l.getFocusStyles)(b)}),label:(0,n.css)({cursor:"pointer",flex:1,padding:b.spacing(1),borderRadius:b.shape.radius.default,"&:hover":{background:b.colors.action.hover,cursor:"pointer"}}),labelSelected:(0,n.css)({background:b.colors.action.selected,"&::before":{backgroundImage:b.colors.gradients.brandVertical,borderRadius:b.shape.radius.default,content:'" "',display:"block",height:"100%",position:"absolute",width:b.spacing(.5),left:0,top:0}})}),h=(0,a.memo)(({value:b,onSelect:u,selected:D=!1,name:P})=>{const C=(0,r.of)(f),S=(0,o.A)();return(0,t.jsxs)("li",{className:C.container,children:[(0,t.jsx)("input",{className:C.radio,checked:D,name:P,type:"checkbox","data-role":"item",tabIndex:-1,id:S,onChange:()=>u(b)}),(0,t.jsx)("label",{className:(0,n.cx)(C.label,D&&C.labelSelected),htmlFor:S,children:b.display})]})});h.displayName="TimeRangeOption";const d=(b,u)=>(b%u+u)%u,s=["ArrowUp","ArrowDown","Home","End","Enter","Tab"],g=({localRef:b,options:u})=>{const[D,P]=(0,a.useState)(0);return(0,a.useEffect)(()=>{const S=b.current?.querySelectorAll('[data-role="item"]')||[],R=Array.from(S).findIndex(j=>j.checked),L=R>=0?R:0;S.forEach((j,N)=>{j.tabIndex=N===L?0:-1}),P(L)},[b,u]),[S=>{const R=b?.current?.querySelectorAll('[data-role="item"]'),L=R?.length??0;s.indexOf(S.key)>-1&&(S.preventDefault(),S.key!=="Tab"&&S.stopPropagation());let j=null;switch(S.key){case"ArrowUp":j=d(D-1,L);break;case"ArrowDown":j=d(D+1,L);break;case"Home":j=0;break;case"End":j=L-1;break;case"Enter":R?.[D]?.click();break;default:break}j!==null&&(P(j),R?.[j]?.focus(),R?.forEach((N,V)=>{N.tabIndex=V===j?0:-1}))}]},v=b=>{const u=(0,r.of)(y),{title:D,options:P,placeholderEmpty:C}=b;return typeof C<"u"&&P.length<=0?(0,t.jsx)(t.Fragment,{children:C}):D?(0,t.jsx)("section",{"aria-label":D,children:(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("div",{className:u.title,children:(0,t.jsx)(i.e,{children:D})}),(0,t.jsx)(x,{...b})]})}):(0,t.jsx)(x,{...b})},x=({options:b,value:u,onChange:D,title:P})=>{const C=(0,r.of)(E),S=(0,a.useRef)(null),[R]=g({localRef:S,options:b});return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("ul",{role:"presentation",onKeyDown:R,ref:S,"aria-roledescription":(0,c.t)("time-picker.time-range.aria-role","Time range selection"),className:C.list,children:b.map((L,j)=>(0,t.jsx)(h,{value:L,selected:p(L,u),onSelect:D,name:P??(0,c.t)("time-picker.time-range.default-title","Time ranges")},m(L,j)))})})};function m(b,u){return`${b.from}-${b.to}-${u}`}function p(b,u){return!u||!b?!1:u.from===b.from&&u.to===b.to}const y=()=>({title:(0,n.css)({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px 5px 9px"})}),E=b=>({list:(0,n.css)({padding:b.spacing(.5)})})},59310(ne,A,e){"use strict";e.d(A,{U:()=>b});var t=e(74848),n=e(2543),a=e(96540),c=e(62717),r=e(92745),i=e(18857),o=e(22803),l=e(63142);const f=R=>{const{children:L,label:j}=R,N=(0,l.of)(h);return j?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:N.header,children:(0,t.jsx)("span",{className:N.label,children:j})}),L]}):(0,t.jsx)("div",{children:L})},h=R=>({header:(0,o.css)({padding:"7px 10px",width:"100%",borderTop:`1px solid ${R.colors.border.weak}`,textTransform:"capitalize"}),label:(0,o.css)({fontSize:R.typography.size.sm,color:R.colors.text.secondary,fontWeight:R.typography.fontWeightMedium})});var d=e(44229),s=e(51898),g=e(30703),v=e(34788),x=e(27228);const m="tz-utc-offset",p=R=>{const{children:L,innerProps:j,innerRef:N,data:V,isSelected:w,isFocused:M}=R,O=(0,l.of)(E),U=Date.now(),K=(0,o.cx)(O.container,M&&O.containerFocused);if(!(0,n.isString)(V.value))return null;const z=(0,c.QZ)(V.value,U);return(0,t.jsx)("div",{className:K,...j,ref:N,"data-testid":s.Tp.components.Select.option,children:(0,t.jsxs)("div",{className:(0,o.cx)(O.leftColumn,O.row),children:[(0,t.jsxs)("div",{className:(0,o.cx)(O.leftColumn,O.wideRow),children:[(0,t.jsx)(x.U,{title:L}),(0,t.jsx)("div",{className:O.spacer}),(0,t.jsx)(v.E,{info:z})]}),(0,t.jsxs)("div",{className:O.rightColumn,children:[(0,t.jsx)(d.X,{timeZone:z?.ianaName||V.value,timestamp:U,className:m}),w&&(0,t.jsx)("span",{children:(0,t.jsx)(g.I,{name:"check"})})]})]})})},y=R=>{const{children:L,innerProps:j,innerRef:N,data:V,isSelected:w,isFocused:M}=R,O=(0,l.of)(E),U=Date.now(),K=(0,o.cx)(O.container,M&&O.containerFocused);if(!(0,n.isString)(V.value))return null;const z=(0,c.QZ)(V.value,U);return(0,t.jsx)("div",{className:K,...j,ref:N,"data-testid":s.Tp.components.Select.option,children:(0,t.jsxs)("div",{className:O.body,children:[(0,t.jsxs)("div",{className:O.row,children:[(0,t.jsx)("div",{className:O.leftColumn,children:(0,t.jsx)(x.U,{title:L})}),(0,t.jsx)("div",{className:O.rightColumn,children:w&&(0,t.jsx)("span",{children:(0,t.jsx)(g.I,{name:"check"})})})]}),(0,t.jsxs)("div",{className:O.row,children:[(0,t.jsx)("div",{className:O.leftColumn,children:(0,t.jsx)(v.E,{info:z})}),(0,t.jsx)("div",{className:O.rightColumn,children:(0,t.jsx)(d.X,{timestamp:U,timeZone:z?.ianaName||V.value,className:m})})]})]})})},E=R=>({container:(0,o.css)({display:"flex",alignItems:"center",flexDirection:"row",flexShrink:0,whiteSpace:"nowrap",cursor:"pointer",padding:"6px 8px 4px","&:hover":{background:R.colors.action.hover}}),containerFocused:(0,o.css)({background:R.colors.action.hover}),body:(0,o.css)({display:"flex",fontWeight:R.typography.fontWeightMedium,flexDirection:"column",flexGrow:1}),row:(0,o.css)({display:"flex",flexDirection:"row"}),leftColumn:(0,o.css)({flexGrow:1,textOverflow:"ellipsis"}),rightColumn:(0,o.css)({justifyContent:"flex-end",alignItems:"center"}),wideRow:(0,o.css)({display:"flex",flexDirection:"row",alignItems:"baseline"}),spacer:(0,o.css)({marginLeft:"6px"})}),b=R=>{const{onChange:L,width:j,autoFocus:N=!1,onBlur:V,value:w,includeInternal:M=!1,disabled:O=!1,inputId:U,menuShouldPortal:K=!0,openMenuOnFocus:z=!0}=R,G=u(M),F=D(G,w),W=C(),H=j&&j<=45?y:p,Y=(0,a.useCallback)(te=>{if(!te||!(0,n.isString)(te.value))return L(w);L(te.value)},[L,w]);return(0,t.jsx)(i.l6,{inputId:U,value:F,placeholder:(0,r.t)("time-picker.zone.select-search-input","Type to search (country, city, abbreviation)"),autoFocus:N,menuShouldPortal:K,openMenuOnFocus:z,width:j,filterOption:W,options:G,onChange:Y,onBlur:V,components:{Option:H,Group:f},disabled:O,"aria-label":(0,r.t)("time-picker.zone.select-aria-label","Time zone picker")})},u=R=>{const L=Date.now();return(0,a.useMemo)(()=>(0,c.U3)(R).map(N=>{const V=N.zones.reduce((w,M)=>{const O=(0,c.QZ)(M,L);if(!O)return w;const U=O.name.replace(/_/g," ");return w.push({label:U,value:O.zone,searchIndex:S(U,O,L)}),w},[]);return{label:N.name,options:V}}),[R,L])},D=(R,L)=>(0,a.useMemo)(()=>{if(L===void 0)return;const j=(0,n.toLower)(L);return R.find(V=>V.label?j.startsWith((0,n.toLower)(V.label)):P(j))?.options.find(V=>(0,n.isEmpty)(j)?V.value===c.g$.default:(0,n.toLower)(V.value)===j)},[R,L]),P=R=>{switch(R){case c.g$.default:case c.g$.localBrowserTime:case c.g$.utc:return!0;default:return!1}},C=()=>(0,a.useCallback)((R,L)=>!L||!R.data||!R.data.searchIndex?!0:R.data.searchIndex.indexOf((0,n.toLower)(L))>-1,[]),S=(R,L,j)=>{const N=[(0,n.toLower)(L.zone),(0,n.toLower)(L.abbreviation),(0,n.toLower)((0,d.t)(j,L.zone))];R!==L.zone&&N.push((0,n.toLower)(R));for(const V of L.countries)N.push((0,n.toLower)(V.name)),N.push((0,n.toLower)(V.code));return N.join("|")}},34788(ne,A,e){"use strict";e.d(A,{E:()=>r});var t=e(74848),n=e(22803),a=e(96540),c=e(63142);const r=({info:l})=>{const f=(0,c.of)(o),h=i(l);return l?(0,t.jsx)("div",{className:f.description,children:h}):null},i=l=>(0,a.useMemo)(()=>{const f=[];if(!l)return"";if(l.name==="Europe/Simferopol")return"Ukraine, EEST";if(l.countries.length>0){const h=l.countries[0];f.push(h.name)}return l.abbreviation&&f.push(l.abbreviation),f.join(", ")},[l]),o=l=>({description:(0,n.css)({fontWeight:"normal",fontSize:l.typography.size.sm,color:l.colors.text.secondary,whiteSpace:"normal",textOverflow:"ellipsis"})})},44229(ne,A,e){"use strict";e.d(A,{X:()=>o,t:()=>l});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(80011),i=e(63142);const o=h=>{const{timestamp:d,timeZone:s,className:g}=h,v=(0,i.of)(f);return(0,a.isString)(s)?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("span",{className:(0,n.cx)(v.offset,g),children:l(d,s)})}):null},l=(h,d)=>`UTC${(0,r.LE)(h,{timeZone:d,format:"Z"})}`,f=h=>{const d=(0,n.css)({fontWeight:"normal",fontSize:h.typography.size.sm,color:h.colors.text.secondary,whiteSpace:"normal"});return{offset:(0,n.css)(d,{color:h.colors.text.primary,background:h.colors.background.secondary,padding:"2px 5px",borderRadius:h.shape.radius.default,marginLeft:"4px"})}}},27228(ne,A,e){"use strict";e.d(A,{U:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({title:i})=>{const o=(0,a.of)(r);return i?(0,t.jsx)("span",{className:o.title,children:i}):null},r=i=>({title:(0,n.css)({fontWeight:i.typography.fontWeightRegular,textOverflow:"ellipsis"})})},5857(ne,A,e){"use strict";e.d(A,{l6:()=>l,rE:()=>i,rL:()=>o});var t=e(74848),n=e(96540),a=e(51898),c=e(92745),r=e(43243);function i(f){return["saturday","sunday","monday"].includes(f)}function o(f){if(f&&i(f))return f;const h=window?.grafanaBootData?.user?.weekStart;return h&&i(h)?h:"monday"}const l=f=>{const{onChange:h,width:d,autoFocus:s=!1,onBlur:g,value:v,disabled:x=!1,inputId:m}=f,p=(0,n.useMemo)(()=>[{value:"",label:(0,c.t)("grafana-ui.week-start-picker.weekStarts-label-default","Default")},{value:"saturday",label:(0,c.t)("grafana-ui.week-start-picker.weekStarts-label-saturday","Saturday")},{value:"sunday",label:(0,c.t)("grafana-ui.week-start-picker.weekStarts-label-sunday","Sunday")},{value:"monday",label:(0,c.t)("grafana-ui.week-start-picker.weekStarts-label-monday","Monday")}],[]),y=(0,n.useCallback)(b=>{b&&b.value!==void 0&&h(i(b.value)?b.value:void 0)},[h]),E=(0,n.useMemo)(()=>p.find(b=>b.value===v)?.value??"",[v,p]);return(0,t.jsx)(r.G,{id:m,value:E,placeholder:a.Tp.components.WeekStartPicker.placeholder,autoFocus:s,width:d,options:p,onChange:y,onBlur:g,disabled:x})}},67511(ne,A,e){"use strict";e.d(A,{d:()=>a});var t=e(27629);const a=(0,t.$)("localeFormatPreference")?"YYYY-MM-DD HH:mm:ss":void 0},8431(ne,A,e){"use strict";e.d(A,{L:()=>a,O:()=>n});var t=e(92745);const n=()=>[{from:"now-5m",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-5-mins","Last 5 minutes")},{from:"now-15m",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-15-mins","Last 15 minutes")},{from:"now-30m",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-30-mins","Last 30 minutes")},{from:"now-1h",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-1-hour","Last 1 hour")},{from:"now-3h",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-3-hours","Last 3 hours")},{from:"now-6h",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-6-hours","Last 6 hours")},{from:"now-12h",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-12-hours","Last 12 hours")},{from:"now-24h",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-24-hours","Last 24 hours")},{from:"now-2d",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-2-days","Last 2 days")},{from:"now-7d",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-7-days","Last 7 days")},{from:"now-30d",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-30-days","Last 30 days")},{from:"now-90d",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-90-days","Last 90 days")},{from:"now-6M",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-6-months","Last 6 months")},{from:"now-1y",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-1-year","Last 1 year")},{from:"now-2y",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-2-years","Last 2 years")},{from:"now-5y",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.last-5-years","Last 5 years")},{from:"now-1d/d",to:"now-1d/d",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.yesterday","Yesterday")},{from:"now-2d/d",to:"now-2d/d",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.day-before-yesterday","Day before yesterday")},{from:"now-7d/d",to:"now-7d/d",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-day-last-week","This day last week")},{from:"now-1w/w",to:"now-1w/w",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.previous-week","Previous week")},{from:"now-1M/M",to:"now-1M/M",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.previous-month","Previous month")},{from:"now-1Q/fQ",to:"now-1Q/fQ",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.previous-fiscal-quarter","Previous fiscal quarter")},{from:"now-1y/y",to:"now-1y/y",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.previous-year","Previous year")},{from:"now-1y/fy",to:"now-1y/fy",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.previous-fiscal-year","Previous fiscal year")},{from:"now/d",to:"now/d",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.today","Today")},{from:"now/d",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.today-so-far","Today so far")},{from:"now/w",to:"now/w",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-week","This week")},{from:"now/w",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-week-so-far","This week so far")},{from:"now/M",to:"now/M",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-month","This month")},{from:"now/M",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-month-so-far","This month so far")},{from:"now/y",to:"now/y",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-year","This year")},{from:"now/y",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-year-so-far","This year so far")},{from:"now/fQ",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-fiscal-quarter-so-far","This fiscal quarter so far")},{from:"now/fQ",to:"now/fQ",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-fiscal-quarter","This fiscal quarter")},{from:"now/fy",to:"now",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-fiscal-year-so-far","This fiscal year so far")},{from:"now/fy",to:"now/fy",display:(0,t.t)("grafana-ui.date-time-pickers.quick-options.this-fiscal-year","This fiscal year")}],a=()=>[{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-january","January"),value:0},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-february","February"),value:1},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-march","March"),value:2},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-april","April"),value:3},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-may","May"),value:4},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-june","June"),value:5},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-july","July"),value:6},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-august","August"),value:7},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-september","September"),value:8},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-october","October"),value:9},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-november","November"),value:10},{label:(0,t.t)("grafana-ui.date-time-pickers.month-options.label-december","December"),value:11}]},62348(ne,A,e){"use strict";e.d(A,{X:()=>i,f:()=>r});var t=e(33239),n=e(25229),a=e(44922),c=e(67511);function r(o,l,f){return(0,n.Ar)(o)?o.isValid():t.isMathString(o)?t.isValid(o):(0,a.b)(o,{roundUp:l,timeZone:f,format:c.d}).isValid()}function i(o){return t.isValid(o.from)&&t.isValid(o.to)}},41e3(ne,A,e){"use strict";e.d(A,{Q:()=>n});var t=e(62717);function n(a,c){const r=(0,t.HD)(c);if(!r)return a;const i=r.utcOffset(a.getTime()),o=a.getTimezoneOffset(),l=i-o;return new Date(a.getTime()-l*1e3*60)}},3271(ne,A,e){"use strict";e.d(A,{c:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({direction:i="horizontal",spacing:o=2})=>{const l=(0,a.of)(r,o);return i==="vertical"?(0,t.jsx)("div",{className:l.verticalDivider}):(0,t.jsx)("hr",{className:l.horizontalDivider})};c.displayName="Divider";const r=(i,o)=>({horizontalDivider:(0,n.css)({borderTop:`1px solid ${i.colors.border.weak}`,margin:i.spacing(o,0),width:"100%"}),verticalDivider:(0,n.css)({borderRight:`1px solid ${i.colors.border.weak}`,margin:i.spacing(0,o),height:"100%"})})},45897(ne,A,e){"use strict";e.d(A,{l:()=>n});var t=e(22803);const n=(a,c)=>{const r=c||"middle",i=a.colors.emphasize(a.colors.background.secondary,.15),o=a.colors.primary.border,l=a.spacing(2),f=4,h=200;let d="50%",s="50%";switch(r){case"start":{d="0%",s="0%";break}case"end":{d="100%",s="100%";break}}const g=(0,t.css)({position:"relative","&:before":{content:'""',position:"absolute",[a.transitions.handleMotion("no-preference","reduce")]:{transition:a.transitions.create("border-color")},zIndex:1},"&:after":{background:i,content:'""',position:"absolute",[a.transitions.handleMotion("no-preference","reduce")]:{transition:a.transitions.create("background")},transform:"translate(-50%, -50%)",borderRadius:a.shape.radius.pill,zIndex:1},"&:hover":{"&:before":{borderColor:o},"&:after":{background:o}}}),v={borderRight:"1px solid transparent",height:"100%",left:d,transform:"translateX(-50%)"},x={borderTop:"1px solid transparent",top:s,transform:"translateY(-50%)"};return{dragHandleVertical:(0,t.cx)(g,(0,t.css)({cursor:"col-resize",width:l,"&:before":v,"&:after":{left:d,top:"50%",height:h,width:f}})),dragHandleHorizontal:(0,t.cx)(g,(0,t.css)({height:l,cursor:"row-resize","&:before":x,"&:after":{left:"50%",top:s,height:f,width:h}})),dragHandleBaseVertical:(0,t.cx)(g,(0,t.css)({cursor:"col-resize",width:l,"&:before":v})),dragHandleBaseHorizontal:(0,t.cx)(g,(0,t.css)({cursor:"row-resize",height:l,"&:before":x}))}}},8207(ne,A,e){"use strict";e.d(A,{_:()=>p});var t=e(74848),n=e(22803),a=e(18828),c=e(43107),r=e(93225),i=e(8772),o=e(96540),l=e(51898),f=e(92745),h=e(63142),d=e(45897),s=e(76319),g=e(41654),v=e(92807),x=e(66404);const m={sm:{width:"25vw",minWidth:384},md:{width:"50vw",minWidth:568},lg:{width:"75vw",minWidth:744}};function p({children:P,onClose:C,closeOnMaskClick:S=!0,scrollableContent:R=!0,title:L,subtitle:j,width:N,size:V="md",tabs:w}){const[M,O,U]=y(),K=(0,h.of)(u),z=(0,h.of)(D,V),G=(0,h.of)(d.l),F=o.useRef(null),{dialogProps:W,titleProps:H}=(0,a.s)({},F),{overlayProps:Y}=(0,r.e)({isDismissable:!1,isOpen:!0,onClose:C},F);b();const te=(0,t.jsx)("div",{className:K.content,children:P}),Z=M??N??m[V].width,se=m[V].minWidth;return(0,t.jsx)(i.A,{open:!0,onClose:C,placement:"right",getContainer:".main-view",className:K.drawerContent,rootClassName:K.drawer,classNames:{wrapper:z},styles:{wrapper:{width:Z,minWidth:se}},width:"",motion:{motionAppear:!0,motionName:K.drawerMotion},maskClassName:K.mask,maskClosable:S,maskMotion:{motionAppear:!0,motionName:K.maskMotion},children:(0,t.jsx)(c.n1,{restoreFocus:!0,contain:!0,autoFocus:!0,children:(0,t.jsxs)("div",{"aria-label":typeof L=="string"?l.Tp.components.Drawer.General.title(L):l.Tp.components.Drawer.General.title("no title"),className:K.container,...Y,...W,ref:F,children:[(0,t.jsx)("div",{className:(0,n.cx)(G.dragHandleVertical,K.resizer),onMouseDown:O,onTouchStart:U}),(0,t.jsxs)("div",{className:(0,n.cx)(K.header,!!w&&K.headerWithTabs),children:[(0,t.jsx)("div",{className:K.actions,children:(0,t.jsx)(s.K,{name:"times",variant:"secondary",onClick:C,"data-testid":l.Tp.components.Drawer.General.close,tooltip:(0,f.t)("grafana-ui.drawer.close","Close")})}),typeof L=="string"?(0,t.jsxs)(g.B,{direction:"column",children:[(0,t.jsx)(x.E,{element:"h3",truncate:!0,...H,children:L}),j&&(0,t.jsx)("div",{className:K.subtitle,"data-testid":l.Tp.components.Drawer.General.subtitle,children:j})]}):L,w&&(0,t.jsx)("div",{className:K.tabsWrapper,children:w})]}),R?(0,t.jsx)(v.P,{showScrollIndicators:!0,children:te}):te]})})})}function y(){const[P,C]=(0,o.useState)(void 0),S=(0,o.useCallback)(w=>{C(E(w.clientX))},[]),R=(0,o.useCallback)(w=>{const M=w.touches[0];C(E(M.clientX))},[]),L=(0,o.useCallback)(w=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",L)},[S]),j=(0,o.useCallback)(w=>{document.removeEventListener("touchmove",R),document.removeEventListener("touchend",j)},[R]);function N(w){w.stopPropagation(),w.preventDefault(),document.addEventListener("mousemove",S),document.addEventListener("mouseup",L)}function V(w){w.stopPropagation(),w.preventDefault(),document.addEventListener("touchmove",R),document.addEventListener("touchend",j)}return[P,N,V]}function E(P){let C=document.body.offsetWidth-(P-document.body.offsetLeft);return`${Math.min(C/document.body.clientWidth*100,98).toFixed(2)}vw`}function b(){(0,o.useEffect)(()=>{if(document.body)return document.body.classList.add("body-drawer-open"),()=>{document.body.classList.remove("body-drawer-open")}},[])}const u=P=>({container:(0,n.css)({display:"flex",flexDirection:"column",height:"100%",flex:"1 1 0",minHeight:"100%",position:"relative"}),drawer:(0,n.css)({top:0,".rc-drawer-content-wrapper":{boxShadow:P.shadows.z3}}),drawerContent:(0,n.css)({backgroundColor:`${P.colors.background.primary} !important`,display:"flex",overflow:"unset !important",flexDirection:"column"}),drawerMotion:(0,n.css)({"&-appear":{[P.transitions.handleMotion("no-preference")]:{transform:"translateX(100%)",transition:"none !important"},[P.transitions.handleMotion("reduce")]:{opacity:0},"&-active":{[P.transitions.handleMotion("no-preference")]:{transform:"translateX(0)",transition:`${P.transitions.create("transform")} !important`},[P.transitions.handleMotion("reduce")]:{transition:"opacity 0.2s ease-in-out",opacity:1}}}}),mask:(0,n.css)({backgroundColor:"transparent !important",position:"fixed !important","&:before":{backgroundColor:`${P.components.overlay.background} !important`,bottom:0,content:'""',left:0,position:"fixed",right:0,top:0}}),maskMotion:(0,n.css)({"&-appear":{opacity:0,"&-active":{opacity:1,[P.transitions.handleMotion("no-preference","reduce")]:{transition:P.transitions.create("opacity")}}}}),header:(0,n.css)({label:"drawer-header",flexGrow:0,padding:P.spacing(2,2,3),borderBottom:`1px solid ${P.colors.border.weak}`}),headerWithTabs:(0,n.css)({borderBottom:"none"}),actions:(0,n.css)({position:"absolute",right:P.spacing(1),top:P.spacing(1)}),subtitle:(0,n.css)({label:"drawer-subtitle",color:P.colors.text.secondary}),content:(0,n.css)({padding:P.spacing(P.components.drawer?.padding??2),height:"100%",flexGrow:1,minHeight:0}),tabsWrapper:(0,n.css)({label:"drawer-tabs",paddingLeft:P.spacing(2),margin:P.spacing(1,-1,-3,-3)}),resizer:(0,n.css)({top:0,left:P.spacing(-1),bottom:0,position:"absolute",zIndex:P.zIndex.modal})});function D(P,C){return(0,n.css)({label:`drawer-content-wrapper-${C}`,overflow:"unset !important",[P.breakpoints.down("md")]:{width:`calc(100% - ${P.spacing(2)}) !important`,minWidth:"0 !important"}})}},15356(ne,A,e){"use strict";e.d(A,{f:()=>f});var t=e(74848),n=e(96540),a=e(87063),c=e(94535),r=e(92807),i=e(7895),o=e(88559);const l=h=>{const{className:d,options:s,value:g,onChange:v,narrow:x,variant:m,root:p,...y}=h,[E,b]=(0,n.useState)(!1),u=()=>(0,t.jsx)(a.W,{tabIndex:-1,onClose:()=>b(!1),children:(0,t.jsx)(r.P,{maxHeight:"100vh",children:s.map(D=>(0,t.jsx)(c.D,{label:D.label??String(D.value),onClick:()=>v(D),active:D.value===g?.value,ariaChecked:D.value===g?.value,ariaLabel:D.ariaLabel||D.label,disabled:D.isDisabled,component:D.component,role:"menuitemradio"},`${D.value}`))})});return(0,t.jsx)(o.m,{root:p,overlay:u,placement:"bottom-end",children:(0,t.jsx)(i.I,{className:d,isOpen:E,narrow:x,variant:m,...y,children:g?.label||(g?.value!=null?String(g?.value):null)})})};l.displayName="ButtonSelect";const f=(0,n.memo)(l)},88559(ne,A,e){"use strict";e.d(A,{m:()=>g});var t=e(74848),n=e(22803),a=e(83505),c=e(46885),r=e(34743),i=e(96540),o=e(66588),l=e(63142),f=e(76373),h=e(44019),d=e(71495),s=e(15245);const g=i.memo(({children:x,overlay:m,placement:p,offset:y,root:E,onVisibleChange:b})=>{const[u,D]=(0,i.useState)(!1),P=(0,i.useRef)(null),C=(0,d.O)(p),S=(0,i.useCallback)(F=>{D(F),b?.(F)},[b]),R=[(0,r.cY)({mainAxis:y?.[0]??8,crossAxis:y?.[1]??0}),...(0,f.getPositioningMiddleware)(C)],{context:L,refs:j,floatingStyles:N}=(0,a.we)({open:u,placement:C,onOpenChange:S,middleware:R,whileElementsMounted:c.ll}),V=(0,a.kp)(L),w=(0,a.s9)(L),{getReferenceProps:M,getFloatingProps:O}=(0,a.bv)([w,V]),U=150,K=(0,l.of)(v,U),z=()=>{S(!1)},G=F=>{F.key==="Tab"&&S(!1)};return(0,t.jsxs)(t.Fragment,{children:[i.cloneElement(x,{ref:j.setReference,...M()}),u&&(0,t.jsx)(s.ZL,{root:E,children:(0,t.jsx)(a.s3,{context:L,children:(0,t.jsx)("div",{ref:j.setFloating,style:N,onClick:z,onKeyDown:G,children:(0,t.jsx)(o.A,{nodeRef:P,appear:!0,in:!0,timeout:{appear:U,exit:0,enter:0},classNames:K,children:(0,t.jsx)("div",{ref:P,children:(0,h.renderOrCallToRender)(m,{...O()})})})})})})]})});g.displayName="Dropdown";const v=(x,m)=>({appear:(0,n.css)({opacity:"0",position:"relative",transformOrigin:"top",[x.transitions.handleMotion("no-preference")]:{transform:"scaleY(0.5)"}}),appearActive:(0,n.css)({opacity:"1",[x.transitions.handleMotion("no-preference")]:{transform:"scaleY(1)",transition:`transform ${m}ms cubic-bezier(0.2, 0, 0.2, 1), opacity ${m}ms cubic-bezier(0.2, 0, 0.2, 1)`}})})},56887(ne,A,e){"use strict";e.d(A,{_:()=>n,y:()=>a});var t=e(96540);const n=(0,t.createContext)(void 0);function a(c){if(!c)return{};const r=(0,t.useContext)(n);if(!r)return{};const i=r.selected.some(f=>f.id===c),o=(0,t.useCallback)((f,h={})=>{r.enabled&&(f.stopPropagation(),f.shiftKey&&(f.preventDefault(),window.getSelection()?.empty()),r.onSelect({id:c},{...h,multi:h.multi??f.shiftKey}))},[r,c]),l=(0,t.useCallback)(()=>{r.enabled&&r.onClear()},[r]);return{isSelected:i,onSelect:o,onClear:l,isSelectable:r.enabled}}},74451(ne,A,e){"use strict";e.d(A,{Z:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({children:i})=>{const o=(0,a.of)(r);return(0,t.jsx)("div",{className:o.container,children:i})},r=i=>({container:(0,n.css)({borderLeft:`3px solid ${i.colors.info.main}`,backgroundColor:`${i.colors.background.secondary}`,padding:i.spacing(2),minWidth:"350px",borderRadius:i.shape.radius.default,marginBottom:i.spacing(4)})})},50201(ne,A,e){"use strict";e.d(A,{p:()=>u});var t=e(74848),n=e(22803),a=e(55494),c=e(63142),r=e(31286),i=e(41654),o=e(66404),l=e(36348);const f=({width:C="auto",height:S})=>{const R=(0,c.of)(h);return(0,t.jsx)(a.default,{src:l,className:R.svg,height:S,width:C})};f.displayName="GrotCTA";const h=C=>({svg:(0,n.css)({"#grot-cta-cactus-1, #grot-cta-cactus-2":{fill:C.isDark?"#58558c":"#c9c5f4"}})});var d=e(96540),s=e(22687);const g=-20,v=5,x=-5,m=5,p=({width:C="auto",height:S})=>{const R=(0,d.useRef)(null),L=(0,c.of)(y);return(0,d.useEffect)(()=>{const j=N=>{if(window.matchMedia("(prefers-reduced-motion: reduce").matches)return;const V=R.current?.querySelector("#grot-not-found-arm"),w=R.current?.querySelector("#grot-not-found-magnifier"),{clientX:M,clientY:O}=N,{innerWidth:U,innerHeight:K}=window,z=O/K,G=M/U,F=E(z,g,v),W=E(G,x,m);window.requestAnimationFrame(()=>{V?.setAttribute("style",`transform: rotate(${F}deg) translateX(${W}%)`),w?.setAttribute("style",`transform: rotate(${F}deg) translateX(${W}%)`)})};return window.addEventListener("mousemove",j),()=>{window.removeEventListener("mousemove",j)}},[]),(0,t.jsx)(a.default,{innerRef:R,src:s,className:L.svg,height:S,width:C})};p.displayName="GrotNotFound";const y=C=>({svg:(0,n.css)({"#grot-not-found-arm, #grot-not-found-magnifier":{transformOrigin:"center"}})}),E=(C,S,R)=>C*(R-S)+S;var b=e(9886);const u=({button:C,children:S,image:R,message:L,hideImage:j=!1,variant:N,role:V})=>{const w=(0,c.of)(P),M=R??D(N);return(0,t.jsx)(r.a,{paddingY:4,display:"flex",direction:"column",alignItems:"center",role:V,children:(0,t.jsxs)("div",{className:w.container,children:[!j&&M,(0,t.jsxs)(i.B,{direction:"column",alignItems:"center",children:[(0,t.jsx)(o.E,{variant:"h4",textAlignment:"center",children:L}),S&&(0,t.jsx)(o.E,{color:"secondary",textAlignment:"center",children:S})]}),C]})})};function D(C){switch(C){case"call-to-action":return(0,t.jsx)(f,{width:300});case"not-found":return(0,t.jsx)(p,{width:300});case"completed":return(0,t.jsx)(a.default,{src:b,width:300});default:throw new Error(`Unknown variant: ${C}`)}}const P=C=>({container:(0,n.css)({display:"flex",flexDirection:"column",alignItems:"center",gap:C.spacing(4),maxWidth:"600px"})})},36303(ne,A,e){"use strict";e.d(A,{Xc:()=>f,Xw:()=>l,tH:()=>o});var t=e(74848),n=e(96540),a=e(32631),c=e(92745),r=e(34999),i=e(56297);class o extends n.PureComponent{constructor(){super(...arguments),this.state={error:null,errorInfo:null}}componentDidCatch(d,s){this.props.errorLogger?this.props.errorLogger(d):a.P?.api?.pushError(d,{context:{type:"boundary",source:this.props.boundaryName??"unknown"}}),this.setState({error:d,errorInfo:s}),this.props.onError&&this.props.onError(d)}componentDidUpdate(d){const{dependencies:s,onRecover:g}=this.props;if(this.state.error&&s&&d.dependencies){for(let v=0;v{const m=h??(0,c.t)("grafana-ui.error-boundary.title","An unexpected error happened");return(0,t.jsx)(o,{dependencies:g,errorLogger:v,boundaryName:x,children:({error:p,errorInfo:y})=>y?s==="alertbox"?(0,t.jsx)(r.F,{title:m,children:(0,t.jsxs)("details",{style:{whiteSpace:"pre-wrap"},children:[p&&p.toString(),(0,t.jsx)("br",{}),y.componentStack]})}):(0,t.jsx)(i.D,{title:m,error:p,errorInfo:y}):d})});l.displayName="ErrorBoundaryAlert";function f(h,d={}){const s=g=>(0,t.jsx)(l,{...d,children:(0,t.jsx)(h,{...g})});return s.displayName="WithErrorBoundary",s}},991(ne,A,e){"use strict";e.d(A,{y:()=>r});var t=e(74848),n=e(1906),a=e(92745),c=e(99887);const r=({featureState:o,tooltip:l})=>{const f=i(o);return(0,t.jsx)(c.E,{text:f.text,color:f.color,icon:f.icon,tooltip:l})};function i(o){switch(o){case n.Ay.alpha:return{text:"Alpha",icon:"exclamation-triangle",color:"orange"};case n.Ay.beta:return{text:"Beta",icon:"rocket",color:"blue"};case n.Ay.experimental:return{text:(0,a.t)("grafana-ui.feature-badge.experimental","Experimental"),icon:"exclamation-triangle",color:"orange"};case n.Ay.preview:return{text:(0,a.t)("grafana-ui.feature-badge.preview","Preview"),icon:"rocket",color:"blue"};case n.Ay.privatePreview:return{text:(0,a.t)("grafana-ui.feature-badge.private-preview","Private preview"),icon:"rocket",color:"blue"};case n.Ay.new:return{text:(0,a.t)("grafana-ui.feature-badge.new","New!"),icon:"rocket",color:"blue"}}}},40279(ne,A,e){"use strict";e.d(A,{gH:()=>g,wI:()=>m});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(96540),i=e(10824),o=e(55386),l=e(92745),f=e(63142),h=e(34999),d=e(30703),s=e(48431);function g({options:u,children:D,readAs:P,onLoad:C,fileListRenderer:S,onFileRemove:R,id:L}){const[j,N]=(0,r.useState)([]),[V,w]=(0,r.useState)([]),M=(0,o.j_)("decbytes")(u?.maxSize?u?.maxSize:0),O=(0,r.useCallback)((ae,J)=>{N(k=>k.map(_=>(_.id===ae.id&&J(_),_)))},[]),U=(0,r.useCallback)((ae,J,k)=>{let _=ae.map(E);if(u?.multiple===!1?N(_):N(Q=>[...Q,..._]),te(J),u?.onDrop)u.onDrop(ae,J,k);else for(const Q of _){const q=new FileReader,oe=()=>{P?q[P](Q.file):q.readAsText(Q.file)};O(Q,re=>{re.abortUpload=()=>{q.abort()},re.retryUpload=()=>{O(Q,ee=>{ee.error=null,ee.progress=void 0}),oe()}}),q.onabort=()=>{O(Q,re=>{re.error=new DOMException("Aborted")})},q.onprogress=re=>{O(Q,ee=>{ee.progress=re.loaded})},q.onload=()=>{C?.(q.result)},q.onerror=()=>{O(Q,re=>{re.error=q.error})},oe()}},[C,u,P,O]),K=ae=>{const J=j.filter(k=>ae.id!==k.id);N(J),R?.(ae)},{getRootProps:z,getInputProps:G,isDragActive:F}=(0,i.VB)({...u,useFsAccessApi:!1,onDrop:U,accept:x(u?.accept)}),W=(0,f.$j)(),H=b(W,F),Y=j.map(ae=>S?S(ae,K):(0,t.jsx)(s.I,{file:ae,removeFile:K},ae.id)),te=ae=>{let J=[];ae.map(k=>{k.errors.map(_=>{J.findIndex(Q=>Q.code===_.code&&Q.message===_.message)===-1&&J.push(_)})}),w(J)},Z=ae=>{const J=(0,o.cN)(M);return(0,t.jsx)("div",{className:H.errorAlert,children:(0,t.jsx)(h.F,{title:(0,l.t)("grafana-ui.file-dropzone.error-title","Upload failed"),severity:"error",onRemove:se,children:ae.map(k=>{switch(k.code){case i.O4.FileTooLarge:return(0,t.jsx)("div",{children:(0,t.jsxs)(l.x6,{i18nKey:"grafana-ui.file-dropzone.file-too-large",children:["File is larger than ",{size:J}]})},k.message+k.code);default:return(0,t.jsx)("div",{children:k.message},k.message+k.code)}})})})},se=()=>{w([])};return(0,t.jsxs)("div",{className:H.container,children:[(0,t.jsxs)("div",{"data-testid":"dropzone",...z({className:H.dropzone}),children:[(0,t.jsx)("input",{...G(),id:L}),D??(0,t.jsx)(m,{primaryText:p(j,u)})]}),V.length>0&&Z(V),(0,t.jsxs)("small",{className:(0,n.cx)(H.small,H.acceptContainer),children:[u?.maxSize&&`Max file size: ${(0,o.cN)(M)}`,u?.maxSize&&u?.accept&&(0,t.jsx)("span",{className:H.acceptSeparator,children:"|"}),u?.accept&&y(u.accept)]}),Y]})}function v(u){return["txt","json","csv","xls","yml"].some(D=>u.match(D))?"text/plain":"application/octet-stream"}function x(u){return(0,a.isString)(u)?{[v(u)]:[u]}:Array.isArray(u)?u.reduce((D,P)=>{const C=v(P);return D[C]=D[C]?[...D[C],P]:[P],D},{}):u}function m({primaryText:u="Drop file here or click to upload",secondaryText:D=""}){const P=(0,f.$j)(),C=b(P);return(0,t.jsxs)("div",{className:(0,n.cx)(C.defaultDropZone),"data-testid":"file-drop-zone-default-children",children:[(0,t.jsx)(d.I,{className:(0,n.cx)(C.icon),name:"upload",size:"xl"}),(0,t.jsx)("h6",{className:(0,n.cx)(C.primaryText),children:u}),(0,t.jsx)("small",{className:C.small,children:D})]})}function p(u,D){return D?.multiple===void 0||D?.multiple?"Upload file":u.length?"Replace file":"Upload file"}function y(u){return(0,a.isString)(u)?`Accepted file type: ${u}`:Array.isArray(u)?`Accepted file types: ${u.join(", ")}`:`Accepted file types: ${Object.values(u).flat().join(", ")}`}function E(u){return{id:(0,a.uniqueId)("file"),file:u,error:null}}function b(u,D){return{container:(0,n.css)({display:"flex",flexDirection:"column",width:"100%",padding:u.spacing(2),borderRadius:u.shape.radius.default,border:`1px dashed ${u.colors.border.strong}`,backgroundColor:D?u.colors.background.secondary:u.colors.background.primary,cursor:"pointer",alignItems:"center",justifyContent:"center"}),dropzone:(0,n.css)({height:"100%",width:"100%",display:"flex",flexDirection:"column"}),defaultDropZone:(0,n.css)({textAlign:"center"}),icon:(0,n.css)({marginBottom:u.spacing(1)}),primaryText:(0,n.css)({marginBottom:u.spacing(1)}),acceptContainer:(0,n.css)({textAlign:"center",margin:0}),acceptSeparator:(0,n.css)({margin:`0 ${u.spacing(1)}`}),small:(0,n.css)({color:u.colors.text.secondary}),errorAlert:(0,n.css)({paddingTop:"10px"})}}},48431(ne,A,e){"use strict";e.d(A,{I:()=>d});var t=e(74848),n=e(22803),a=e(55386),c=e(92745),r=e(63142),i=e(28473),o=e(45861),l=e(30703),f=e(76319);const h="Remove file";function d({file:g,removeFile:v}){const x=(0,r.of)(s),{file:m,progress:p,error:y,abortUpload:E,retryUpload:b}=g,u=()=>y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:x.error,children:y.message}),b&&(0,t.jsx)(f.K,{name:"sync",tooltip:(0,c.t)("grafana-ui.file-dropzone.item-retry","Retry"),tooltipPlacement:"top",onClick:b}),v&&(0,t.jsx)(f.K,{className:b?x.marginLeft:"",name:"trash-alt",onClick:()=>v(g),tooltip:h})]}):p&&m.size>p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("progress",{className:x.progressBar,max:m.size,value:p}),(0,t.jsxs)("span",{className:x.paddingLeft,children:[Math.round(p/m.size*100),"%"]}),E&&(0,t.jsx)(o.$n,{variant:"secondary",type:"button",fill:"text",onClick:E,children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.file-dropzone.cancel-upload",children:"Cancel upload"})})]}):v&&(0,t.jsx)(f.K,{name:"trash-alt",onClick:()=>v(g),tooltip:h,tooltipPlacement:"top"}),D=(0,a.j_)("decbytes")(m.size);return(0,t.jsxs)("div",{className:x.fileListContainer,children:[(0,t.jsxs)("span",{className:x.fileNameWrapper,children:[(0,t.jsx)(l.I,{name:"file-blank",size:"lg","aria-hidden":!0}),(0,t.jsx)("span",{className:x.padding,children:(0,i.i)(m.name)}),(0,t.jsx)("span",{children:(0,a.cN)(D)})]}),(0,t.jsx)("div",{className:x.fileNameWrapper,children:u()})]})}function s(g){return{fileListContainer:(0,n.css)({width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:g.spacing(2),border:`1px dashed ${g.colors.border.medium}`,backgroundColor:`${g.colors.background.secondary}`,marginTop:g.spacing(1)}),fileNameWrapper:(0,n.css)({display:"flex",flexDirection:"row",alignItems:"center"}),padding:(0,n.css)({padding:g.spacing(0,1)}),paddingLeft:(0,n.css)({paddingLeft:g.spacing(2)}),marginLeft:(0,n.css)({marginLeft:g.spacing(1)}),error:(0,n.css)({paddingRight:g.spacing(2),color:g.colors.error.text}),progressBar:(0,n.css)({borderRadius:g.shape.radius.default,height:"4px","::-webkit-progress-bar":{backgroundColor:g.colors.border.weak,borderRadius:g.shape.radius.default},"::-webkit-progress-value":{backgroundColor:g.colors.primary.main,borderRadius:g.shape.radius.default}})}}},57688(ne,A,e){"use strict";e.d(A,{e:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(24726),r=e(51898),i=e(92745),o=e(63142),l=e(35484),f=e(28473),h=e(45861),d=e(30703);const s=({onFileUpload:v,className:x,children:m="Upload file",accept:p="*",size:y="md",showFileName:E})=>{const b=(0,o.of)(g(y)),[u,D]=(0,a.useState)(""),P=(0,c.A)(),C=(0,a.useCallback)(S=>{const R=S.currentTarget?.files?.[0];R&&D(R.name??""),v(S)},[v]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"file",id:P,className:b.fileUpload,onChange:C,multiple:!1,accept:p,"data-testid":r.Tp.components.FileUpload.inputField}),(0,t.jsxs)("label",{htmlFor:P,className:(0,n.cx)(b.labelWrapper,x),children:[(0,t.jsx)(d.I,{name:"upload",className:b.icon}),m]}),E&&u&&(0,t.jsx)("span",{"aria-label":(0,i.t)("grafana-ui.file-upload.file-name","File name"),className:b.fileName,"data-testid":r.Tp.components.FileUpload.fileNameSpan,children:(0,f.i)(u)})]})},g=v=>x=>{const m=(0,h.hs)({theme:x,variant:"primary",size:v,iconOnly:!1}),p=(0,l.getFocusStyles)(x);return{fileUpload:(0,n.css)({height:"0.1px",opacity:"0",overflow:"hidden",position:"absolute",width:"0.1px",zIndex:-1,"&:focus + label":p,"&:focus-visible + label":p}),labelWrapper:m.button,icon:m.icon,fileName:(0,n.css)({marginLeft:x.spacing(.5)})}}},12737(ne,A,e){"use strict";e.d(A,{Z:()=>f});var t=e(74848),n=e(96540),a=e(8934),c=e(92745);function r(...h){const d=n.useRef(null);return n.useEffect(()=>{h.forEach(s=>{s&&(typeof s=="function"?s(d.current):s.current=d.current)})},[h]),d}var i=e(45861),o=e(30703),l=e(63527);const f=(0,n.forwardRef)(({value:h,width:d,onChange:s,escapeRegex:g=!0,...v},x)=>{const m=(0,n.useRef)(null),p=r(x,m),y=h!==""?(0,t.jsx)(i.$n,{icon:"times",fill:"text",size:"sm",onClick:E=>{m.current?.focus(),s(""),E.stopPropagation()},children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.filter-input.clear",children:"Clear"})}):null;return(0,t.jsx)(l.p,{prefix:(0,t.jsx)(o.I,{name:"search"}),suffix:y,width:d,type:"text",value:g?(0,a.xb)(h??""):h,onChange:E=>s(g?(0,a.jD)(E.currentTarget.value):E.currentTarget.value),...v,ref:p})});f.displayName="FilterInput"},34343(ne,A,e){"use strict";e.d(A,{m:()=>i});var t=e(74848),n=e(22803),a=e(63142),c=e(45861),r=e(30703);const i=({label:l,selected:f,onClick:h,icon:d="check"})=>{const s=(0,a.of)(o),g=(0,a.of)(c.my);return(0,t.jsxs)("button",{type:"button",className:(0,n.cx)(g,s.wrapper,f&&s.selected),onClick:h,children:[(0,t.jsx)("span",{children:l}),f&&(0,t.jsx)(r.I,{name:d,className:s.icon,"data-testid":"filter-pill-icon"})]})},o=l=>({wrapper:(0,n.css)({background:l.colors.background.secondary,borderRadius:l.shape.radius.pill,padding:l.spacing(0,2),fontSize:l.typography.bodySmall.fontSize,fontWeight:l.typography.fontWeightMedium,lineHeight:l.typography.bodySmall.lineHeight,color:l.colors.text.secondary,display:"flex",alignItems:"center",height:"32px",position:"relative",border:`1px solid ${l.colors.background.secondary}`,whiteSpace:"nowrap","&:hover":{background:l.colors.action.hover,color:l.colors.text.primary}}),selected:(0,n.css)({color:l.colors.text.primary,background:l.colors.action.selected,"&:hover":{background:l.colors.action.focus}}),icon:(0,n.css)({marginLeft:l.spacing(.5)})})},94959(ne,A,e){"use strict";e.d(A,{z:()=>r});var t=e(74848),n=e(22803),a=e(96540),c=e(51115);const r=({label:o,tooltip:l,labelWidth:f=6,inputWidth:h=12,inputEl:d,className:s,interactive:g,...v})=>{const x=i(),m=(0,a.useId)();return(0,t.jsxs)("div",{className:(0,n.cx)(x.formField,s),children:[(0,t.jsx)(c.I,{htmlFor:m,width:f,tooltip:l,interactive:g,children:o}),d||(0,t.jsx)("input",{id:m,type:"text",className:`gf-form-input ${h?`width-${h}`:""}`,...v,disabled:v.disabled})]})};r.displayName="FormField";const i=()=>({formField:(0,n.css)({display:"flex",flexDirection:"row",alignItems:"flex-start",textAlign:"left",position:"relative"})})},51115(ne,A,e){"use strict";e.d(A,{I:()=>o});var t=e(74848),n=e(46942),a=e.n(n),c=e(30703),r=e(45967);const o=({children:l,isFocused:f,isInvalid:h,className:d,htmlFor:s,tooltip:g,width:v,interactive:x,...m})=>{const p=a()(d,`gf-form-label width-${v||"10"}`,{"gf-form-label--is-focused":f,"gf-form-label--is-invalid":h});return(0,t.jsxs)("label",{className:p,...m,htmlFor:s,children:[l,g&&(0,t.jsx)(r.m,{placement:"top",content:g,theme:"info",interactive:x,children:(0,t.jsx)(c.I,{name:"info-circle",size:"sm",style:{marginLeft:"10px"}})})]})}},21539(ne,A,e){"use strict";e.d(A,{i:()=>a});var t=e(74848);function n(c){return c<20?.9:c<26?.8:.6}const a=({value:c,className:r,style:i,...o})=>{const l=(c.prefix??"").length>0,f=(c.suffix??"").length>0;let h;if(i&&typeof i.fontSize=="number"&&!Number.isNaN(i.fontSize)){const d=i.fontSize,s=n(d);h={fontSize:d*s}}return(0,t.jsx)("div",{className:r,style:i,...o,children:(0,t.jsxs)("div",{children:[l&&(0,t.jsx)("span",{children:c.prefix}),(0,t.jsx)("span",{children:c.text}),f&&(0,t.jsx)("span",{style:h,children:c.suffix})]})})};a.displayName="FormattedDisplayValue"},32635(ne,A,e){"use strict";e.d(A,{S:()=>o});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(35484),i=e(72636);const o=a.forwardRef(({label:f,description:h,value:d,htmlValue:s,onChange:g,disabled:v,className:x,indeterminate:m,invalid:p,...y},E)=>{const b=(0,a.useCallback)(D=>{g&&g(D)},[g]),u=(0,c.of)(l,p);return(0,t.jsxs)("label",{className:(0,n.cx)(u.wrapper,x),children:[(0,t.jsxs)("div",{className:u.checkboxWrapper,children:[(0,t.jsx)("input",{type:"checkbox",className:(0,n.cx)(u.input,m&&u.inputIndeterminate),checked:d,disabled:v,onChange:b,value:s,...y,ref:D=>{D&&m&&(D.indeterminate=!0),E&&(typeof E=="function"?E(D):E.current=D)}}),(0,t.jsx)("span",{className:u.checkmark})]}),f&&(0,t.jsx)("span",{className:u.label,children:f}),h&&(0,t.jsx)("span",{className:u.description,children:h})]})}),l=(f,h=!1)=>{const d=(0,i.f)(f),s=2,g=1,v=x=>h?f.colors.error.border:x;return{wrapper:(0,n.css)({display:"inline-grid",alignItems:"center",columnGap:f.spacing(g),gridAutoRows:"max-content",position:"relative",verticalAlign:"middle"}),input:(0,n.css)({position:"absolute",zIndex:1,top:0,left:0,width:"100% !important",height:"100%",opacity:0,"&:focus + span, &:focus-visible + span":(0,r.getFocusStyles)(f),"&:focus:not(:focus-visible) + span":(0,r.getMouseFocusStyles)(f),"&:checked + span":{background:f.colors.primary.main,border:`1px solid ${v(f.colors.primary.main)}`,"&:hover":{background:f.colors.primary.shade},"&:after":{content:'""',position:"absolute",zIndex:2,left:f.spacing(.5),top:0,width:f.spacing(.75),height:f.spacing(1.5),border:`solid ${f.colors.primary.contrastText}`,borderWidth:"0 3px 3px 0",transform:"rotate(45deg)"}},"&:disabled + span":{backgroundColor:f.colors.action.disabledBackground,cursor:"not-allowed",border:`1px solid ${v(f.colors.action.disabledBackground)}`,"&:hover":{backgroundColor:f.colors.action.disabledBackground},"&:after":{borderColor:f.colors.action.disabledText}}}),inputIndeterminate:(0,n.css)({"&:indeterminate + span":{border:`1px solid ${v(f.colors.primary.main)}`,background:f.colors.primary.main,"&:hover":{background:f.colors.primary.shade},"&:after":{content:'""',position:"absolute",zIndex:2,left:"2px",right:"2px",top:"calc(50% - 1.5px)",height:"3px",border:`1.5px solid ${f.colors.primary.contrastText}`,backgroundColor:f.colors.primary.contrastText,width:"auto",transform:"none"}},"&:disabled[aria-checked='mixed'] + span":{backgroundColor:f.colors.action.disabledBackground,border:`1px solid ${v(f.colors.error.transparent)}`,"&:after":{borderColor:f.colors.action.disabledText}}}),checkboxWrapper:(0,n.css)({display:"flex",alignItems:"center",gridColumnStart:1,gridRowStart:1}),checkmark:(0,n.css)({position:"relative",zIndex:2,display:"inline-block",width:f.spacing(s),height:f.spacing(s),borderRadius:f.shape.radius.sm,background:f.components.input.background,border:`1px solid ${v(f.components.input.borderColor)}`,"&:hover":{cursor:"pointer",borderColor:v(f.components.input.borderHover)}}),label:(0,n.cx)(d.label,(0,n.css)({gridColumnStart:2,gridRowStart:1,position:"relative",zIndex:2,cursor:"pointer",maxWidth:"fit-content",lineHeight:f.typography.bodySmall.lineHeight,marginBottom:0})),description:(0,n.cx)(d.description,(0,n.css)({gridColumnStart:2,gridRowStart:2,lineHeight:f.typography.bodySmall.lineHeight,marginTop:0,zIndex:1}))}};o.displayName="Checkbox"},37386(ne,A,e){"use strict";e.d(A,{D:()=>l});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(44019),i=e(12594),o=e(72636);const l=a.forwardRef(({label:d,description:s,horizontal:g,invalid:v,loading:x,disabled:m,required:p,error:y,children:E,className:b,validationMessageHorizontalOverflow:u,htmlFor:D,noMargin:P,...C},S)=>{const R=(0,c.of)(h,P),L=D??(0,r.getChildId)(E),j=typeof d=="string"?(0,t.jsx)(o.J,{htmlFor:L,description:s,children:`${d}${p?" *":""}`}):d,N=f({invalid:v,disabled:m,loading:x});return(0,t.jsxs)("div",{className:(0,n.cx)(R.field,g&&R.fieldHorizontal,b),...C,children:[j,(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{ref:S,children:a.cloneElement(E,N)}),v&&y&&!g&&(0,t.jsx)("div",{className:(0,n.cx)(R.fieldValidationWrapper,{[R.validationMessageHorizontalOverflow]:!!u}),children:(0,t.jsx)(i.P,{children:y})})]}),v&&y&&g&&(0,t.jsx)("div",{className:(0,n.cx)(R.fieldValidationWrapper,R.fieldValidationWrapperHorizontal,{[R.validationMessageHorizontalOverflow]:!!u}),children:(0,t.jsx)(i.P,{children:y})})]})});l.displayName="Field";function f(d){for(const s in d)d[s]===void 0&&delete d[s];return d}const h=(d,s)=>({field:(0,n.css)({display:"flex",flexDirection:"column",marginBottom:d.spacing(s?0:2)}),fieldHorizontal:(0,n.css)({flexDirection:"row",justifyContent:"space-between",flexWrap:"wrap"}),fieldValidationWrapper:(0,n.css)({marginTop:d.spacing(.5)}),fieldValidationWrapperHorizontal:(0,n.css)({flex:"1 1 100%"}),validationMessageHorizontalOverflow:(0,n.css)({width:0,overflowX:"visible","& > *":{whiteSpace:"nowrap"}})})},16780(ne,A,e){"use strict";e.d(A,{n:()=>r});var t=e(74848),n=e(22803),a=e(63142),c=e(53487);const r=({label:o,children:l,className:f,...h})=>{const d=(0,a.of)(i);return(0,t.jsxs)("fieldset",{className:(0,n.cx)(d.wrapper,f),...h,children:[o&&(0,t.jsx)(c.s,{children:o}),l]})},i=o=>({wrapper:(0,n.css)({marginBottom:o.spacing(4),"&:last-child":{marginBottom:0}})})},12594(ne,A,e){"use strict";e.d(A,{P:()=>r});var t=e(74848),n=e(22803),a=e(63142),c=e(30703);const r=({children:o,horizontal:l,className:f})=>{const h=(0,a.of)(i),d=(0,n.cx)(l?h.horizontal:h.vertical,f);return(0,t.jsxs)("div",{role:"alert",className:d,children:[(0,t.jsx)(c.I,{className:h.fieldValidationMessageIcon,name:"exclamation-triangle"}),o]})},i=o=>{const l=` font-size: ${o.typography.size.sm}; font-weight: ${o.typography.fontWeightMedium}; padding: ${o.spacing(.5,1)}; color: ${o.colors.error.contrastText}; background: ${o.colors.error.main}; border-radius: ${o.shape.radius.default}; position: relative; display: inline-block; align-self: flex-start; a { color: ${o.colors.error.contrastText}; text-decoration: underline; } a:hover { text-decoration: none; } `;return{vertical:(0,n.css)(l,{margin:o.spacing(.5,0,0,0),"&:before":{content:'""',position:"absolute",left:"9px",top:"-5px",width:0,height:0,borderWidth:"0 4px 5px 4px",borderColor:`transparent transparent ${o.colors.error.main} transparent`,borderStyle:"solid"}}),horizontal:(0,n.css)(l,{marginLeft:"10px","&:before":{content:'""',position:"absolute",left:"-5px",top:"9px",width:0,height:0,borderWidth:"4px 5px 4px 0",borderColor:"transparent #e02f44 transparent transparent",borderStyle:"solid"}}),fieldValidationMessageIcon:(0,n.css)({marginRight:o.spacing()})}}},50426(ne,A,e){"use strict";e.d(A,{l:()=>r});var t=e(74848),n=e(22803),a=e(96540),c=e(49785);function r({defaultValues:i,onSubmit:o,validateOnMount:l=!1,validateFieldsOnMount:f,children:h,validateOn:d="onSubmit",maxWidth:s=600,...g}){const{handleSubmit:v,trigger:x,formState:m,...p}=(0,c.mN)({mode:d,defaultValues:i});return(0,a.useEffect)(()=>{l&&x(f)},[x,f,l]),(0,t.jsx)("form",{className:(0,n.css)({maxWidth:s!=="none"?s+"px":s,width:"100%"}),onSubmit:v(o),...g,children:h({errors:m.errors,formState:m,trigger:x,...p})})}},18027(ne,A,e){"use strict";e.d(A,{I:()=>l});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(44019),i=e(12594),o=e(79233);const l=({children:h,label:d,tooltip:s,labelWidth:g="auto",invalid:v,loading:x,disabled:m,required:p,className:y,htmlFor:E,grow:b,shrink:u,error:D,transparent:P,interactive:C,validationMessageHorizontalOverflow:S,...R})=>{const L=(0,c.$j)(),j=f(L,b,u),N=E??(0,r.getChildId)(h),V=typeof d=="string"?(0,t.jsx)(o.c,{interactive:C,width:g,tooltip:s,htmlFor:N,transparent:P,children:`${d}${p?" *":""}`}):d;return(0,t.jsxs)("div",{className:(0,n.cx)(j.container,y),...R,children:[V,(0,t.jsxs)("div",{className:j.childContainer,children:[(0,a.cloneElement)(h,{invalid:v,disabled:m,loading:x}),v&&D&&(0,t.jsx)("div",{className:(0,n.cx)(j.fieldValidationWrapper,{[j.validationMessageHorizontalOverflow]:!!S}),children:(0,t.jsx)(i.P,{children:D})})]})]})};l.displayName="InlineField";const f=(h,d,s)=>({container:(0,n.css)({display:"flex",flexDirection:"row",alignItems:"flex-start",textAlign:"left",position:"relative",flex:`${d?1:0} ${s?1:0} auto`,margin:`0 ${h.spacing(.5)} ${h.spacing(.5)} 0`}),childContainer:(0,n.css)({flex:`${d?1:0} ${s?1:0} auto`}),fieldValidationWrapper:(0,n.css)({marginTop:h.spacing(.5)}),validationMessageHorizontalOverflow:(0,n.css)({width:0,overflowX:"visible","& > *":{whiteSpace:"nowrap"}})})},97095(ne,A,e){"use strict";e.d(A,{C:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({children:i,className:o,...l})=>{const f=(0,a.of)(r);return(0,t.jsx)("div",{className:(0,n.cx)(f.container,o),...l,children:i})},r=i=>({container:(0,n.css)({label:"InlineFieldRow",display:"flex",flexDirection:"row",flexWrap:"wrap",alignContent:"flex-start",rowGap:i.spacing(.5)})})},79233(ne,A,e){"use strict";e.d(A,{c:()=>i});var t=e(74848),n=e(22803),a=e(63142),c=e(30703),r=e(45967);const i=({children:l,className:f,tooltip:h,width:d,transparent:s,interactive:g,as:v="label",...x})=>{const m=(0,a.of)(o,s,d);return(0,t.jsxs)(v,{className:(0,n.cx)(m.label,f),...x,children:[l,h&&(0,t.jsx)(r.m,{interactive:g,placement:"top",content:h,theme:"info",children:(0,t.jsx)(c.I,{tabIndex:0,name:"info-circle",size:"sm",className:m.icon})})]})},o=(l,f=!1,h)=>({label:(0,n.css)({display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,padding:l.spacing(0,1),fontWeight:l.typography.fontWeightMedium,fontSize:l.typography.size.sm,backgroundColor:f?"transparent":l.colors.background.secondary,height:l.spacing(l.components.height.md),lineHeight:l.spacing(l.components.height.md),marginRight:l.spacing(.5),borderRadius:l.shape.radius.default,border:"none",width:h?h!=="auto"?`${8*h}px`:h:"100%",color:l.colors.text.primary}),icon:(0,n.css)({color:l.colors.text.secondary,marginLeft:"10px",":hover":{color:l.colors.text.primary}})})},83871(ne,A,e){"use strict";e.d(A,{e:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({children:i,className:o,grow:l,...f})=>{const h=(0,a.of)(r,l);return(0,t.jsx)("div",{className:(0,n.cx)(h.container,o),...f,children:i})};c.displayName="InlineSegmentGroup";const r=(i,o)=>({container:(0,n.css)({display:"flex",flexDirection:"row",alignItems:"flex-start",textAlign:"left",position:"relative",flex:`${o?1:0} 0 auto`,marginBottom:i.spacing(.5)})})},72636(ne,A,e){"use strict";e.d(A,{J:()=>r,f:()=>i});var t=e(74848),n=e(22803),a=e(63142),c=e(30703);const r=({children:o,description:l,className:f,category:h,...d})=>{const s=(0,a.of)(i),g=h?.map((v,x)=>(0,t.jsxs)("span",{className:s.categories,children:[(0,t.jsx)("span",{children:v}),(0,t.jsx)(c.I,{name:"angle-right",className:s.chevron})]},`${v}/${x}`));return(0,t.jsx)("div",{className:(0,n.cx)(s.label,f),children:(0,t.jsxs)("label",{...d,children:[(0,t.jsxs)("div",{className:s.labelContent,children:[g,o]}),l&&(0,t.jsx)("span",{className:s.description,children:l})]})})},i=o=>({label:(0,n.css)({label:"Label",fontSize:o.typography.size.sm,fontWeight:o.typography.fontWeightMedium,lineHeight:1.25,marginBottom:o.spacing(.5),color:o.colors.text.primary,maxWidth:"480px"}),labelContent:(0,n.css)({display:"flex",alignItems:"center"}),description:(0,n.css)({label:"Label-description",color:o.colors.text.secondary,fontSize:o.typography.size.sm,fontWeight:o.typography.fontWeightRegular,marginTop:o.spacing(.25),display:"block"}),categories:(0,n.css)({label:"Label-categories",display:"inline-flex",alignItems:"center"}),chevron:(0,n.css)({margin:o.spacing(0,.25)})})},32581(ne,A,e){"use strict";e.d(A,{O:()=>i,p:()=>o});var t=e(74848),n=e(46942),a=e.n(n),c=e(96540),r=e(75745),i=(l=>(l.Invalid="invalid",l.Valid="valid",l))(i||{});class o extends c.PureComponent{constructor(){super(...arguments),this.state={error:null},this.validatorAsync=f=>h=>{const d=(0,r.tf)(h.target.value,f);this.setState(s=>({...s,error:d?d[0]:null}))},this.populateEventPropsWithStatus=(f,h)=>{const d={...f};return h&&Object.keys(r.Pw).forEach(s=>{((0,r.K)(s,h)||f[s])&&(d[s]=async g=>{g.persist(),(0,r.K)(s,h)&&await this.validatorAsync(h[s]).apply(this,[g]),f[s]&&f[s].apply(null,[g,this.status])})}),d}}static{this.defaultProps={className:""}}get status(){return this.state.error?"invalid":"valid"}get isInvalid(){return this.status==="invalid"}render(){const{validationEvents:f,className:h,hideErrorMessage:d,inputRef:s,...g}=this.props,{error:v}=this.state,x=a()("gf-form-input",{invalid:this.isInvalid},h),m=this.populateEventPropsWithStatus(g,f);return(0,t.jsxs)("div",{style:{flexGrow:1},children:[(0,t.jsx)("input",{...m,ref:s,className:x}),v&&!d&&(0,t.jsx)("span",{children:v})]})}}},53487(ne,A,e){"use strict";e.d(A,{s:()=>r});var t=e(74848),n=e(22803),a=e(63142);const c=i=>({legend:(0,n.css)({fontSize:i.typography.h3.fontSize,fontWeight:i.typography.fontWeightRegular,margin:i.spacing(0,0,2,0)})}),r=({children:i,className:o,...l})=>{const f=(0,a.of)(c);return(0,t.jsx)("legend",{className:(0,n.cx)(f.legend,o),...l,children:i})}},77824(ne,A,e){"use strict";e.d(A,{z:()=>x});var t=e(74848),n=e(22803),a=e(2543),c=e(96540),r=e(30360),i=e(63142),o=e(30703),l=e(51898),f=e(35484),h=e(45967),d=e(3343);const s=2,g=c.forwardRef(({children:p,active:y=!1,disabled:E=!1,size:b="md",onChange:u,onClick:D,id:P,name:C=void 0,description:S,fullWidth:R,"aria-label":L},j)=>{const N=(0,i.of)(v,b,R),V=(0,t.jsx)("input",{type:"radio",className:N.radio,onChange:u,onClick:D,disabled:E,id:P,checked:y,name:C,"aria-label":L,ref:j});return S?(0,t.jsxs)("div",{className:N.radioOption,"data-testid":l.Tp.components.RadioButton.container,children:[(0,t.jsx)(h.m,{content:S,placement:"bottom",children:V}),(0,t.jsx)("label",{className:N.radioLabel,htmlFor:P,title:S||L,children:p})]}):(0,t.jsxs)("div",{className:N.radioOption,"data-testid":l.Tp.components.RadioButton.container,children:[V,(0,t.jsx)("label",{className:N.radioLabel,htmlFor:P,title:S||L,children:p})]})});g.displayName="RadioButton";const v=(p,y,E)=>{const{fontSize:b,height:u,padding:D}=(0,d.SM)(y,p),P=p.colors.text.secondary,C=p.colors.text.primary,S=u*p.spacing.gridSize-4-2;return{radioOption:(0,n.css)({display:"flex",justifyContent:"space-between",position:"relative",flex:E?"1 0 0":"none",textAlign:"center"}),radio:(0,n.css)({position:"absolute",opacity:0,zIndex:2,width:"100% !important",height:"100%",cursor:"pointer","&:checked + label":{color:p.colors.text.primary,fontWeight:p.typography.fontWeightMedium,background:p.colors.action.selected,zIndex:1},"&:focus + label, &:focus-visible + label":(0,f.getFocusStyles)(p),"&:focus:not(:focus-visible) + label":(0,f.getMouseFocusStyles)(p),"&:disabled + label":{color:p.colors.text.disabled,cursor:"not-allowed"}}),radioLabel:(0,n.css)({display:"flex",alignItems:"center",justifyContent:"center",fontSize:b,height:`${S}px`,lineHeight:`${S}px`,color:P,padding:p.spacing(0,D),borderRadius:(0,f.getInternalRadius)(p,s),background:p.colors.background.primary,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",flexGrow:1,"&:hover":{color:C}})}};function x({options:p,value:y,onChange:E,onClick:b,disabled:u,disabledOptions:D,size:P="md",id:C,className:S,fullWidth:R=!1,autoFocus:L=!1,"aria-label":j,invalid:N=!1}){const V=(0,c.useCallback)(z=>()=>{E&&E(z.value)},[E]),w=(0,c.useCallback)(z=>()=>{b&&b(z.value)},[b]),M=C??(0,a.uniqueId)("radiogroup-"),O=(0,c.useRef)(M),U=(0,i.of)(m),K=(0,c.useRef)(null);return(0,c.useEffect)(()=>{L&&K.current&&K.current.focus()},[L]),(0,t.jsx)("div",{role:"radiogroup","aria-label":j,className:(0,n.cx)(U.radioGroup,R&&U.fullWidth,N&&U.invalid,S),children:p.map((z,G)=>{const F=D&&z.value&&D.includes(z.value),W=z.icon?(0,r.Uo)(z.icon):void 0,H=!!(z.imgUrl||z.label||z.component);return(0,t.jsxs)(g,{size:P,disabled:F||u,active:y===z.value,"aria-label":z.ariaLabel,onChange:V(z),onClick:w(z),id:`option-${z.value}-${M}`,name:O.current,description:z.description,fullWidth:R,ref:y===z.value?K:void 0,children:[W&&(0,t.jsx)(o.I,{name:W,className:(0,n.cx)(H&&U.icon)}),z.imgUrl&&(0,t.jsx)("img",{src:z.imgUrl,alt:z.label,className:U.img}),z.label," ",z.component?(0,t.jsx)(z.component,{}):null]},`o.label-${G}`)})})}x.displayName="RadioButtonGroup";const m=p=>({radioGroup:(0,n.css)({backgroundColor:p.colors.background.primary,display:"inline-flex",flexDirection:"row",flexWrap:"nowrap",border:`1px solid ${p.components.input.borderColor}`,borderRadius:p.shape.radius.default,padding:s,"&:hover":{borderColor:p.components.input.borderHover}}),fullWidth:(0,n.css)({display:"flex",flexGrow:1}),icon:(0,n.css)({marginRight:"6px"}),img:(0,n.css)({width:p.spacing(2),height:p.spacing(2),marginRight:p.spacing(1)}),invalid:(0,n.css)({border:`1px solid ${p.colors.error.border}`})})},45450(ne,A,e){"use strict";e.d(A,{J:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({id:i,name:o,label:l,checked:f,value:h,disabled:d,description:s,onChange:g,...v})=>{const x=(0,a.of)(r);return(0,t.jsxs)("label",{title:s,className:x.label,children:[(0,t.jsx)("input",{...v,id:i,name:o,type:"radio",checked:f,value:h,disabled:d,className:x.input,onChange:()=>g&&g(i)}),(0,t.jsxs)("div",{children:[l,s&&(0,t.jsx)("div",{className:x.description,children:s})]})]})},r=i=>({input:(0,n.css)({position:"relative",appearance:"none",outline:"none",backgroundColor:i.colors.background.canvas,width:`${i.spacing(2)} !important`,height:i.spacing(2),border:`1px solid ${i.colors.border.medium}`,borderRadius:i.shape.radius.circle,cursor:"pointer",margin:"3px 0",":checked":{backgroundColor:i.v1.palette.white,border:`5px solid ${i.colors.primary.main}`},":disabled":{backgroundColor:`${i.colors.action.disabledBackground} !important`,borderColor:i.colors.border.weak},":disabled:checked":{border:`1px solid ${i.colors.border.weak}`},":disabled:checked::after":{content:'""',width:"6px",height:"6px",backgroundColor:i.colors.text.disabled,borderRadius:i.shape.radius.circle,display:"inline-block",position:"absolute",top:"4px",left:"4px"},":focus":{outline:"none !important",boxShadow:`0 0 0 1px ${i.colors.background.canvas}, 0 0 0 3px ${i.colors.primary.main}`}}),label:(0,n.css)({fontSize:i.typography.fontSize,lineHeight:"22px",display:"grid",gridTemplateColumns:`${i.spacing(2)} auto`,gap:i.spacing(1),cursor:"pointer"}),description:(0,n.css)({fontSize:i.typography.size.sm,color:i.colors.text.secondary})})},16203(ne,A,e){"use strict";e.d(A,{a:()=>o});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(63142),i=e(45450);function o({name:f,id:h,options:d,value:s,onChange:g,className:v,disabled:x,disabledOptions:m=[]}){const p=(0,r.of)(l),y=h??(0,a.uniqueId)("radiogroup-list-");return(0,t.jsx)("div",{id:h,className:(0,n.cx)(p.container,v),role:"radiogroup",children:d.map((E,b)=>{const u=`${y}-${b}`,D=s&&s===E.value,P=x||m.some(S=>S===E.value),C=()=>g&&E.value&&g(E.value);return(0,t.jsx)(i.J,{id:u,name:f,label:E.label,description:E.description,checked:D,value:E.value,disabled:P,onChange:C},b)})})}const l=f=>({container:(0,n.css)({display:"grid",gap:f.spacing(1)})})},58684(ne,A,e){"use strict";e.d(A,{_:()=>g});var t=e(74848),n=e(34796),a=e.n(n),c=e(96540),r=e(55386),i=e(64394),o=e(33553),l=e(48588),f=e(739),h=e(53568),d=e(45861),s=e(443);class g extends c.PureComponent{constructor(){super(...arguments),this.canvasElement=null,this.renderVisualization=()=>{const{width:x,value:m,height:p,onClick:y,text:E,theme:b,orientation:u}=this.props,D=(0,s.BU)(x,p,m.title,u),P=u===f.wV.Vertical?`${D.gaugeHeight}px`:"100%",C=(0,t.jsx)("div",{style:{height:`${D.gaugeHeight}px`,width:P},ref:S=>this.canvasElement=S});return(0,t.jsxs)(t.Fragment,{children:[y?(0,t.jsx)("button",{className:(0,d.my)(b),type:"button",onClick:y,children:C}):C,D.showLabel&&(0,t.jsx)("div",{style:{textAlign:"center",fontSize:E?.titleSize??D.titleFontSize,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",position:"relative",width:P,top:"-4px",cursor:"default"},children:m.title})]})}}static{this.defaultProps={showThresholdMarkers:!0,showThresholdLabels:!1,field:{min:0,max:100,thresholds:s.JJ}}}componentDidMount(){this.draw()}componentDidUpdate(){this.draw()}draw(){const{field:x,showThresholdLabels:m,showThresholdMarkers:p,width:y,height:E,theme:b,value:u,orientation:D}=this.props,P=(0,s.BU)(y,E,u.title),C=D===f.wV.Vertical?P.gaugeHeight:y,S=Math.min(C,P.gaugeHeight),R=b.colors.background.secondary,L=m?1.5:1,j=Math.min(S/5.5,40)/L,N=j/5,V=(0,r.cN)(u),M=Math.min(C,S*1.3)*.9-((j+(p?N:0)+(m?10:0))*2+10),O=this.props.text?.valueSize??(0,h.Vr)(V,M,S,1,j*1.7),U=Math.max(O/2.5,12);let K=x.min??l.tw,z=x.max??l.d1,G=u.numeric;x.thresholds?.mode===o.O.Percentage&&(K=0,z=100,u.percent===void 0?G=(G-K)/(z-K)*100:G=u.percent*100);const F=x.decimals===void 0?2:x.decimals;p&&(K=+K.toFixed(F),z=+z.toFixed(F));let W=[];x.color?.mode===i.Y.Thresholds?W=(0,s.Xx)(F,x,b):W=[{value:x.min??l.tw,color:u.color??i.F}];const H={series:{gauges:{gauge:{min:K,max:z,neutralValue:x.custom?.neutral,background:{color:R},border:{color:null},shadow:{show:!1},width:j},frame:{show:!1},label:{show:!1},layout:{margin:0,thresholdWidth:0,vMargin:0},cell:{border:{width:0}},threshold:{values:W,label:{show:m,margin:N+1,font:{size:U}},show:p&&W.length>1,width:N},value:{color:u.color,formatter:()=>V,font:{size:O,family:b.typography.fontFamily}},show:!0}}},Y={data:[[0,G]],label:u.title};try{this.canvasElement&&a().plot(this.canvasElement,[Y],H)}catch(te){console.error("Gauge rendering error",te,H,u)}}render(){return(0,t.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",overflow:"hidden"},className:this.props.className,children:this.renderVisualization()})}}},443(ne,A,e){"use strict";e.d(A,{BU:()=>i,JJ:()=>r,Xx:()=>o});var t=e(36394),n=e(33553),a=e(48588),c=e(739);const r={mode:n.O.Absolute,steps:[{value:-1/0,color:"green"},{value:80,color:"red"}]};function i(l,f,h,d){const s=h!=null,g=d===c.wV.Vertical?f:l,v=Math.min(g*.15/1.5,20),x=v*1.5,m=s?f-x:f,p=Math.min(m,l);return{showLabel:s,gaugeHeight:p,titleFontSize:v}}function o(l,f,h){const d=f.thresholds??r,s=d.mode===n.O.Percentage,g=d.steps;let v=f.min??a.tw,x=f.max??a.d1;s&&(v=0,x=100);const m=(0,t.yQ)(v,g),p=(0,t.yQ)(x,g),y=[{value:+v.toFixed(l),color:h.visualization.getColorByName(m.color)}];let E=!0;for(let b=0;bo});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(34999),i=e(30703);const o=a.memo(a.forwardRef(({title:f,className:h,children:d,branded:s,url:g,urlTitle:v,onDismiss:x,severity:m="info",...p},y)=>{const E=(0,c.of)(l);return(0,t.jsxs)(r.F,{severity:m,className:h,...p,ref:y,title:f,children:[(0,t.jsx)("div",{children:d}),g&&(0,t.jsxs)("a",{href:g,className:(0,n.cx)("external-link",E.docsLink),target:"_blank",rel:"noreferrer",children:[(0,t.jsx)(i.I,{name:"book"})," ",v||"Read more"]})]})}));o.displayName="InfoBox";const l=f=>({docsLink:(0,n.css)({display:"inline-block",marginTop:f.spacing(2)})})},53371(ne,A,e){"use strict";e.d(A,{r:()=>d});var t=e(74848),n=e(22803),a=e(83505),c=e(46885),r=e(34743),i=e(96540),o=e(63142),l=e(76373),f=e(30703),h=e(15245);function d({referenceElement:v,children:x,suffixIcon:m,placement:p}){const y=(0,o.of)(s),E=(0,o.$j)(),b=[(0,r.cY)(8),...(0,l.getPositioningMiddleware)(p)],{context:u,refs:D,floatingStyles:P}=(0,a.we)({open:!0,placement:p,middleware:b,whileElementsMounted:c.ll,strategy:"fixed"});(0,i.useLayoutEffect)(()=>{D.setReference(v)},[v,D]);const{styles:C}=(0,a.DL)(u,{initial:({side:S})=>({opacity:0,transform:g(S,E)}),duration:E.transitions.duration.shortest});return(0,t.jsx)(h.ZL,{children:(0,t.jsx)("div",{style:{display:"inline-block",...P},ref:D.setFloating,"aria-live":"polite",children:(0,t.jsxs)("span",{className:(0,n.cx)(y.root),style:C,children:[x&&(0,t.jsx)("span",{children:x}),m&&(0,t.jsx)(f.I,{name:m})]})})})}const s=v=>({root:(0,n.css)({...v.typography.bodySmall,willChange:"transform",background:v.components.tooltip.background,color:v.components.tooltip.text,padding:v.spacing(.5,1.5),borderRadius:v.shape.radius.pill,display:"inline-flex",gap:v.spacing(.5),alignItems:"center"})}),g=(v,x)=>{switch(v){case"top":return`translateY(${x.spacing(1)})`;case"bottom":return`translateY(-${x.spacing(1)})`;case"left":return`translateX(${x.spacing(1)})`;case"right":return`translateX(-${x.spacing(1)})`}}},33033(ne,A,e){"use strict";e.d(A,{D:()=>i});var t=e(74848),n=e(96540),a=e(53568),c=e(74660),r=e(63527);const i=n.forwardRef((f,h)=>{const{defaultValue:d="",minWidth:s=10,maxWidth:g,onCommitChange:v,onChange:x,onKeyDown:m,onBlur:p,value:y,placeholder:E,...b}=f,[u,D]=l(y,x),P=u??d,C=(0,n.useMemo)(()=>{const S=P||E||"",R=typeof S=="string"?S:S.toString();return o(R,s,g)},[E,P,s,g]);return(0,t.jsx)(c.W.Provider,{value:!0,children:(0,t.jsx)(r.p,{"data-testid":"autosize-input",...b,placeholder:E,ref:h,value:P.toString(),onChange:S=>{x&&x(S),D(S.currentTarget.value)},width:C,onBlur:S=>{p?p(S):v&&v(S)},onKeyDown:S=>{m?m(S):S.key==="Enter"&&v&&v(S)}})})});function o(f,h,d){if(!f)return h;const g=(0,a.kD)(f.toString(),14).width/8+3;return h&&gd?d:g}i.displayName="AutoSizeInput";function l(f,h){const d=f!==void 0&&h!==void 0,s=(0,n.useRef)(d),g=(0,n.useRef)(!1);d!==s.current&&!g.current&&(console.warn("An AutoSizeInput is changing from an uncontrolled to a controlled input. If you want to control the input, the empty value should be an empty string."),g.current=!0);const[v,x]=n.useState(f);(0,n.useEffect)(()=>{s.current||x(f)},[f]);const m=(0,n.useCallback)(y=>{s.current||x(y)},[]);return[s.current?f:v,m]}},26987(ne,A,e){"use strict";e.d(A,{e:()=>n});var t=e(49785);const n=t.xI},27594(ne,A,e){"use strict";e.d(A,{j:()=>E});var t=e(74848),n=e(22803),a=e(2543),c=e(96540),r=e(32885),i=e(28105),o=e(63142),l=e(30703),f=e(34213),h=e(45967),d=e(92745),s=e(76319);const g=(0,n.css)({display:"flex",alignItems:"center",height:"100%"});function v({row:P,__rowID:C}){return(0,t.jsx)("div",{className:g,children:(0,t.jsx)(s.K,{tooltip:(0,d.t)("grafana-ui.interactive-table.expand-row-tooltip","Toggle row expanded"),"aria-controls":C,name:P.isExpanded?"angle-down":"angle-right","aria-expanded":P.isExpanded,...P.getToggleRowExpandedProps(),size:"lg"})})}function x({isAllRowsExpanded:P,toggleAllRowsExpanded:C}){return(0,t.jsx)("div",{className:g,children:(0,t.jsx)(s.K,{"aria-label":P?(0,d.t)("grafana-ui.interactive-table.aria-label-collapse-all","Collapse all rows"):(0,d.t)("grafana-ui.interactive-table.aria-label-expand-all","Expand all rows"),name:P?"table-collapse-all":"table-expand-all",onClick:()=>C(),size:"lg",tooltip:P?(0,d.t)("grafana-ui.interactive-table.tooltip-collapse-all","Collapse all rows"):(0,d.t)("grafana-ui.interactive-table.tooltip-expand-all","Expand all rows"),variant:"secondary"})})}const m="__expander";function p(P,C=!1){return[{id:m,Cell:v,...C&&{Header:x},disableSortBy:!0,width:0},...P.map(S=>({id:S.id,accessor:S.id,Header:S.header||(()=>null),sortType:S.sortType||"alphanumeric",disableSortBy:!S.sortType,width:S.disableGrow?0:void 0,visible:S.visible,...S.cell&&{Cell:S.cell}}))]}const y=P=>{const C=P.colors.emphasize(P.colors.background.primary,.03);return{container:(0,n.css)({display:"flex",gap:P.spacing(2),flexDirection:"column",width:"100%",overflowX:"auto"}),cell:(0,n.css)({padding:P.spacing(1),minWidth:P.spacing(3)}),table:(0,n.css)({borderRadius:P.shape.radius.default,width:"100%"}),disableGrow:(0,n.css)({width:0}),header:(0,n.css)({borderBottom:`1px solid ${P.colors.border.weak}`,minWidth:P.spacing(3),"&, & > button":{position:"relative",whiteSpace:"nowrap",padding:P.spacing(1)},"& > button":{"&:after":{content:'"\\00a0"'},width:"100%",height:"100%",background:"none",border:"none",paddingRight:P.spacing(2.5),textAlign:"left",fontWeight:P.typography.fontWeightMedium}}),row:(0,n.css)({label:"row",borderBottom:`1px solid ${P.colors.border.weak}`,"&:hover":{backgroundColor:C},"&:last-child":{borderBottom:0}}),expandedRow:(0,n.css)({label:"expanded-row-content",borderBottom:"none"}),expandedContentCell:(0,n.css)({borderBottom:`1px solid ${P.colors.border.weak}`,position:"relative",padding:P.spacing(2,2,2,5),"&:before":{content:'""',position:"absolute",width:"1px",top:0,left:"16px",bottom:P.spacing(2),background:P.colors.border.medium}}),expandedContentRow:(0,n.css)({label:"expanded-row-content"}),sortableHeader:(0,n.css)({"&&":{padding:0}})}};function E({className:P,columns:C,data:S,getRowId:R,headerTooltips:L,pageSize:j=0,renderExpandedRow:N,showExpandAll:V=!1,fetchData:w,initialSortBy:M=[]}){const O=(0,o.of)(y),U=(0,c.useMemo)(()=>p(C,V),[C,V]),K=b(),z=(0,c.useCallback)(J=>`${K}-${J.id}`.replace(/\s/g,""),[K]),G=[r.useSortBy,r.useExpanded],F=S.length>j,W=j>0;W&&G.push(r.usePagination);const H=(0,r.useTable)({columns:U,data:S,autoResetExpanded:!1,autoResetSortBy:!1,disableMultiSort:!0,manualSortBy:!!w,getRowId:R,initialState:{hiddenColumns:[!N&&m,...U.filter(J=>!(!J.visible||J.visible(S))).map(J=>J.id).filter(i.zz)].filter(i.zz),sortBy:M}},...G),{getTableProps:Y,getTableBodyProps:te,headerGroups:Z,prepareRow:se}=H,{sortBy:ae}=H.state;return(0,c.useEffect)(()=>{w&&w({sortBy:ae})},[ae,w]),(0,c.useEffect)(()=>{W&&H.setPageSize(j)},[W,j,H.setPageSize,H]),(0,t.jsxs)("div",{className:O.container,children:[(0,t.jsxs)("table",{...Y(),className:(0,n.cx)(O.table,P),children:[(0,t.jsx)("thead",{children:Z.map(J=>{const{key:k,..._}=J.getHeaderGroupProps();return(0,t.jsx)("tr",{..._,children:J.headers.map(Q=>{const{key:q,...oe}=Q.getHeaderProps(),re=L?.[Q.id];return(0,t.jsx)("th",{className:(0,n.cx)(O.header,{[O.disableGrow]:Q.width===0,[O.sortableHeader]:Q.canSort}),...oe,...Q.isSorted&&{"aria-sort":Q.isSortedDesc?"descending":"ascending"},children:(0,t.jsx)(D,{column:Q,headerTooltip:re})},q)})},k)})}),(0,t.jsx)("tbody",{...te(),children:(W?H.page:H.rows).map(J=>{se(J);const{key:k,..._}=J.getRowProps(),Q=z(J),q=J.isExpanded;return(0,t.jsxs)(c.Fragment,{children:[(0,t.jsx)("tr",{..._,className:(0,n.cx)(O.row,q&&O.expandedRow),children:J.cells.map(oe=>{const{key:re,...ee}=oe.getCellProps();return(0,t.jsx)("td",{className:O.cell,...ee,children:oe.render("Cell",{__rowID:Q})},re)})}),q&&N&&(0,t.jsx)("tr",{..._,id:Q,className:O.expandedContentRow,children:(0,t.jsx)("td",{className:O.expandedContentCell,colSpan:J.cells.length,children:N(J.original)})})]},k)})})]}),W&&F&&(0,t.jsx)("span",{children:(0,t.jsx)(f.d,{currentPage:H.state.pageIndex+1,numberOfPages:H.pageOptions.length,onNavigate:J=>H.gotoPage(J-1)})})]})}const b=()=>(0,c.useMemo)(()=>(0,a.uniqueId)("InteractiveTable"),[]),u=P=>({sortIcon:(0,n.css)({position:"absolute",top:P.spacing(1)}),headerTooltipIcon:(0,n.css)({marginLeft:P.spacing(.5)})});function D({column:{canSort:P,render:C,isSorted:S,isSortedDesc:R,getSortByToggleProps:L},headerTooltip:j}){const N=(0,o.of)(u),{onClick:V}=L(),w=(0,t.jsxs)(t.Fragment,{children:[C("Header"),j&&(0,t.jsx)(h.m,{theme:"info-alt",content:j.content,placement:"top-end",children:(0,t.jsx)(l.I,{className:N.headerTooltipIcon,name:j.iconName||"info-circle","data-testid":"header-tooltip-icon"})}),S&&(0,t.jsx)("span",{"aria-hidden":"true",className:N.sortIcon,children:(0,t.jsx)(l.I,{name:R?"angle-down":"angle-up"})})]});return P?(0,t.jsx)("button",{type:"button",onClick:V,children:w}):w}},50275(ne,A,e){"use strict";e.d(A,{B:()=>c});var t=e(74848),n=e(96540),a=e(22658);class c extends n.PureComponent{constructor(){super(...arguments),this.wrapperRef=(0,n.createRef)(),this.renderJson=()=>{const{json:i,config:o,open:l,onDidRender:f}=this.props,h=this.wrapperRef.current,d=new a.O(i,l,o);h.hasChildNodes()?h.replaceChild(d.render(),h.lastChild):h.appendChild(d.render()),f&&f(d.json)}}static{this.defaultProps={open:3,config:{animateOpen:!0}}}componentDidMount(){this.renderJson()}componentDidUpdate(){this.renderJson()}render(){const{className:i}=this.props;return(0,t.jsx)("div",{className:i,ref:this.wrapperRef})}}},22658(ne,A,e){"use strict";e.d(A,{O:()=>p});var t=e(2543);function n(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function a(y){return!!y&&typeof y==="object"}function c(y){if(y===void 0)return"";if(y===null||typeof y=="object"&&!y.constructor)return"Object";const b=/function ([^(]*)/.exec(y.constructor.toString());return b&&b.length>1?b[1]:""}function r(y){return y===null?"null":typeof y}function i(y,E){const b=r(y);return b==="null"||b==="undefined"?b:(b==="string"&&(E='"'+n(E)+'"'),b==="function"?y.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{\u2026}":E)}let o="";function l(y){return a(y)?(o=c(y),Array.isArray(y)&&(o+="["+y.length+"]")):o=i(y,y.toString()),o}function f(y){return`json-formatter-${y}`}function h(y,E,b){const u=document.createElement(y);return E&&u.classList.add(f(E)),b!==void 0&&(b instanceof Node?u.appendChild(b):u.appendChild(document.createTextNode(String(b)))),u}const d=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,s=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,g=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,v=10,x=typeof window<"u"&&window.requestAnimationFrame||(y=>(y(),0)),m={animateOpen:!0,animateClose:!0};class p{constructor(E,b=1,u=m,D){this.json=E,this.open=b,this.config=u,this.key=D,this._isOpen=null,this.element=null,this.skipChildren=!1}get isOpen(){return this._isOpen!==null?this._isOpen:this.open>0}set isOpen(E){this._isOpen=E}get isDate(){return this.type==="string"&&(d.test(this.json)||g.test(this.json)||s.test(this.json))}get isUrl(){return this.type==="string"&&this.json.indexOf("http")===0}get isArray(){return Array.isArray(this.json)}get isObject(){return a(this.json)}get isEmptyObject(){return!this.keys.length&&!this.isArray}get isEmpty(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray}get hasKey(){return typeof this.key<"u"}get constructorName(){return c(this.json)}get type(){return r(this.json)}get keys(){return this.isObject?Object.keys(this.json).map(E=>E||'""'):[]}toggleOpen(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(f("open")))}openAtDepth(E=1){E<0||(this.open=E,this.isOpen=E!==0,this.element&&(this.removeChildren(!1),E===0?this.element.classList.remove(f("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(f("open")))))}isNumberArray(){return this.json.length>0&&this.json.length<4&&((0,t.isNumber)(this.json[0])||(0,t.isNumber)(this.json[1]))}renderArray(){const E=h("span");return E.appendChild(h("span","bracket","[")),this.isNumberArray()?(this.json.forEach((b,u)=>{u>0&&E.appendChild(h("span","array-comma",",")),E.appendChild(h("span","number",b))}),this.skipChildren=!0):E.appendChild(h("span","number",this.json.length)),E.appendChild(h("span","bracket","]")),E}render(E=!1){this.element=h("div","row");const b=h("a","toggler-link"),u=h("span","toggler");if(this.isObject&&b.appendChild(u),this.hasKey&&b.appendChild(h("span","key",`${this.key}:`)),this.isObject){const P=h("span","value"),C=h("span"),S=h("span","constructor-name",this.constructorName);if(C.appendChild(S),this.isArray){const R=this.renderArray();C.appendChild(R)}P.appendChild(C),b.appendChild(P)}else{const P=this.isUrl?h("a"):h("span");P.classList.add(f(this.type)),this.isDate&&P.classList.add(f("date")),this.isUrl&&(P.classList.add(f("url")),P.setAttribute("href",this.json));const C=i(this.json,this.json);P.appendChild(document.createTextNode(C)),b.appendChild(P)}const D=h("div","children");return this.isObject&&D.classList.add(f("object")),this.isArray&&D.classList.add(f("array")),this.isEmpty&&D.classList.add(f("empty")),this.config&&this.config.theme&&this.element.classList.add(f(this.config.theme)),this.isOpen&&this.element.classList.add(f("open")),E||this.element.appendChild(b),this.skipChildren?b.removeChild(u):this.element.appendChild(D),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&b.addEventListener("click",this.toggleOpen.bind(this)),this.element}appendChildren(E=!1){const b=this.element&&this.element.querySelector(`div.${f("children")}`);if(!(!b||this.isEmpty))if(E){let u=0;const D=()=>{const P=this.keys[u],C=new p(this.json[P],this.open-1,this.config,P);b.appendChild(C.render()),u+=1,uv?D():x(D))};x(D)}else this.keys.forEach(u=>{const D=new p(this.json[u],this.open-1,this.config,u);b.appendChild(D.render())})}removeChildren(E=!1){const b=this.element&&this.element.querySelector(`div.${f("children")}`);if(E){let u=0;const D=()=>{b&&b.children.length&&(b.removeChild(b.children[0]),u+=1,u>v?D():x(D))};x(D)}else b&&(b.innerHTML="")}}},13943(ne,A,e){"use strict";e.d(A,{x:()=>i});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(43990);const i=(0,a.forwardRef)((l,f)=>{const{alignItems:h,children:d,gap:s,rowGap:g,columnGap:v,columns:x,minColumnWidth:m,...p}=l,y=(0,c.of)(o,s,g,v,x,m,h);return(0,t.jsx)("div",{ref:f,...p,className:y.grid,children:d})});i.displayName="Grid";const o=(l,f,h,d,s,g,v)=>({grid:(0,n.css)([{display:"grid"},(0,r.Y)(l,f,x=>({gap:l.spacing(x)})),(0,r.Y)(l,h,x=>({rowGap:l.spacing(x)})),(0,r.Y)(l,d,x=>({columnGap:l.spacing(x)})),g&&(0,r.Y)(l,g,x=>({gridTemplateColumns:`repeat(auto-fill, minmax(${l.spacing(x)}, 1fr))`})),s&&(0,r.Y)(l,s,x=>({gridTemplateColumns:`repeat(${x}, 1fr)`})),(0,r.Y)(l,v,x=>({alignItems:x}))])})},32881(ne,A,e){"use strict";e.d(A,{Gy:()=>o,gW:()=>l,mc:()=>f});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=(g=>(g[g.Horizontal=0]="Horizontal",g[g.Vertical=1]="Vertical",g))(r||{});const i=({children:g,orientation:v=0,spacing:x="sm",justify:m="flex-start",align:p="normal",wrap:y=!1,width:E="100%",height:b="100%",...u})=>{const D=(0,c.of)(h,v,x,m,p,y);return(0,t.jsx)("div",{className:D.layout,style:{width:E,height:b},...u,children:a.Children.toArray(g).filter(Boolean).map((P,C)=>(0,t.jsx)("div",{className:D.childWrapper,children:P},C))})},o=({children:g,spacing:v,justify:x,align:m="center",wrap:p,width:y,height:E})=>(0,t.jsx)(i,{spacing:v,justify:x,orientation:0,align:m,width:y,height:E,wrap:p,children:g}),l=({children:g,spacing:v,justify:x,align:m,width:p,height:y})=>(0,t.jsx)(i,{spacing:v,justify:x,orientation:1,align:m,width:p,height:y,children:g}),f=({children:g,padding:v,margin:x,grow:m,shrink:p})=>{const y=(0,c.of)(s,v,x);return(0,t.jsx)("div",{className:(0,n.cx)(y.wrapper,m!==void 0&&(0,n.css)({flexGrow:m}),p!==void 0&&(0,n.css)({flexShrink:p})),children:g})},h=(g,v,x,m,p,y)=>{const E=x!=="none"?g.spacing(d[x]):0,b=v===0&&!y||v===1?0:`-${E}`,u=v===1?"vertical-group":"horizontal-group";return{layout:(0,n.css)({label:u,display:"flex",flexDirection:v===1?"column":"row",flexWrap:y?"wrap":"nowrap",justifyContent:m,alignItems:p,height:"100%",maxWidth:"100%",marginBottom:b}),childWrapper:(0,n.css)({label:"layoutChildrenWrapper",marginBottom:v===0&&!y?0:E,marginRight:v===0?E:0,display:"flex",alignItems:p,"&:last-child":{marginBottom:v===1?0:void 0,marginRight:v===0?0:void 0}})}},d={none:0,xs:.5,sm:1,md:2,lg:3},s=(g,v,x)=>{const m=v&&v!=="none"&&g.spacing(d[v])||0,p=x&&x!=="none"&&g.spacing(d[x])||0;return{wrapper:(0,n.css)({label:"container",margin:p,padding:m})}}},35137(ne,A,e){"use strict";e.d(A,{$:()=>a});var t=e(74848),n=e(31286);const a=({v:c=0,h:r=0,layout:i})=>(0,t.jsx)(n.a,{paddingRight:r,paddingBottom:c,display:i==="inline"?"inline-block":"block"})},20941(ne,A,e){"use strict";e.d(A,{N:()=>i});var t=e(74848),n=e(96540),a=e(35557),c=e(63704),r=e(92138);const i=(0,n.forwardRef)(({href:o,children:l,...f},h)=>{const d=r.I.stripBaseFromUrl(c.sQ.sanitizeUrl(o??""));return(0,t.jsx)(a.Link,{ref:h,to:d,...f,children:l})});i.displayName="Link"},89640(ne,A,e){"use strict";e.d(A,{Y:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(63704),r=e(92138),i=e(63142),o=e(30703),l=e(66969),f=e(20941);const h={h1:"xl",h2:"xl",h3:"lg",h4:"lg",h5:"md",h6:"md",body:"md",bodySmall:"xs"},d=(0,a.forwardRef)(({href:g,color:v="link",external:x=!1,inline:m=!0,variant:p="body",weight:y,icon:E,children:b,...u},D)=>{const P=c.sQ.sanitizeUrl(g??""),C=(0,i.$j)(),S=s(C,m,p,y,v),R=E||"external-link-alt";if(x)return(0,t.jsxs)("a",{href:P,ref:D,...u,target:"_blank",rel:"noreferrer",className:S,children:[b,(0,t.jsx)(o.I,{size:h[p]||"md",name:R})]});const L=r.I.stripBaseFromUrl(P);return(0,t.jsxs)(f.N,{ref:D,href:L,...u,className:S,children:[b,E&&(0,t.jsx)(o.I,{name:E,size:h[p]||"md"})]})});d.displayName="TextLink";const s=(g,v,x,m,p)=>(0,n.css)([x&&{...g.typography[x]},m&&{fontWeight:(0,l.iV)(m,g)},p&&{color:g.colors.text[p]},{alignItems:"center",gap:"0.25em",display:"inline-flex",textDecoration:"none","&:hover":{textDecoration:"underline",color:g.colors.text.link}},v&&{textDecoration:"underline","&:hover":{textDecoration:"none"}}])},46559(ne,A,e){"use strict";e.d(A,{p:()=>i});var t=e(74848),n=e(22803),a=e(96540),c=e(65240);const r=(0,c.N)((o=!1)=>({list:(0,n.css)({listStyleType:"none",margin:0,padding:0}),item:(0,n.css)({display:o&&"inline-block"||"block"})}));class i extends a.PureComponent{constructor(l){super(l)}render(){const{items:l,renderItem:f,getItemKey:h,className:d,inline:s}=this.props,g=r(s);return(0,t.jsx)("ul",{className:(0,n.cx)(g.list,d),children:l.map((v,x)=>(0,t.jsx)("li",{className:g.item,children:f(v,x)},h?h(v):x))})}}},12569(ne,A,e){"use strict";e.d(A,{c:()=>c});var t=e(74848),n=e(96540),a=e(46559);class c extends n.PureComponent{render(){return(0,t.jsx)(a.p,{inline:!0,...this.props})}}},5585(ne,A,e){"use strict";e.d(A,{B:()=>c});var t=e(74848),n=e(96540),a=e(46559);class c extends n.PureComponent{render(){return(0,t.jsx)(a.p,{...this.props})}}},47327(ne,A,e){"use strict";e.d(A,{G:()=>h});var t=e(74848),n=e(22803),a=e(63142);const c=28,r=2.4,i=500,o=4e3,l=300,f=100/c*100;function h({width:s,delay:g=l,ariaLabel:v="Loading bar"}){const x=Math.min(Math.max(Math.round(s*r),i),o),m=(0,a.of)(d,g,x),p={overflow:"hidden"};return(0,t.jsx)("div",{style:p,children:(0,t.jsx)("div",{"aria-label":v,role:"status",className:m.bar})})}const d=(s,g,v)=>{const x=(0,n.keyframes)({"0%":{transform:"translateX(-100%)"},"85%, 100%":{transform:`translateX(${f}%)`}});return{bar:(0,n.css)({width:c+"%",height:1,background:`linear-gradient(90deg, transparent 0%, ${s.colors.primary.main} 80.75%, transparent 100%)`,transform:"translateX(-100%)",willChange:"transform",[s.transitions.handleMotion("no-preference")]:{animationName:x,animationDelay:`${g}ms`,animationTimingFunction:"linear",animationIterationCount:"infinite",animationDuration:`${v}ms`},[s.transitions.handleMotion("reduce")]:{animationName:x,animationDelay:`${g}ms`,animationTimingFunction:"linear",animationIterationCount:"infinite",animationDuration:`${4*v}ms`}})}}},48457(ne,A,e){"use strict";e.d(A,{O:()=>i});var t=e(74848),n=e(96540),a=e(92745),c=e(18857),r=e(56755);const i=({value:o,onChange:l,context:f,item:h,id:d})=>{const s=h.settings??{},g=(0,r.sE)(f.data,s?.filter),v=(0,r.m3)(g,o,void 0,void 0,s.baseNameMode),x=(0,n.useCallback)(p=>{if(!(p&&!(0,r.v3)(p.value,g)))return l(p?.value)},[g,l]),m=v.find(p=>p.value===o);return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(c.l6,{inputId:d,value:m,placeholder:s.placeholderText??(0,a.t)("grafana-ui.matchers-ui.field-name-picker.placeholder","Select field"),options:v,onChange:x,noOptionsMessage:s.noFieldsMessage,width:s.width,isClearable:s.isClearable!==!1})})}},62693(ne,A,e){"use strict";e.d(A,{A:()=>g,zA:()=>h});var t=e(74848),n=e(96540),a=e(36638),c=e(57866),r=e(95004),i=e(92745),o=e(97958),l=e(18857);const f=(0,n.memo)(v=>{const{data:x,options:m,onChange:p,id:y}=v,E=d(x),b=s(E,m),u=(0,n.useCallback)(P=>p(P.value),[p]),D=b.find(P=>P.value===m);return(0,t.jsx)(l.l6,{inputId:y,value:D,options:b,onChange:u})});f.displayName="FieldTypeMatcherEditor";const h=()=>[{value:r.PU.number,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-number","Number"),icon:(0,o.lV)(r.PU.number)},{value:r.PU.string,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-string","String"),icon:(0,o.lV)(r.PU.string)},{value:r.PU.time,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-time","Time"),icon:(0,o.lV)(r.PU.time)},{value:r.PU.boolean,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-boolean","Boolean"),icon:(0,o.lV)(r.PU.boolean)},{value:r.PU.trace,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-traces","Traces"),icon:(0,o.lV)(r.PU.trace)},{value:r.PU.enum,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-enum","Enum"),icon:(0,o.lV)(r.PU.enum)},{value:r.PU.other,label:(0,i.t)("grafana-ui.matchers-ui.get-all-field-type-icon-options.label-other","Other"),icon:(0,o.lV)(r.PU.other)}],d=v=>(0,n.useMemo)(()=>{const x=new Map;for(const m of h())x.set(m.value,0);for(const m of v)for(const p of m.fields){const y=p.type||r.PU.other;let E=x.get(y);E||(E=0),x.set(y,E+1)}return x},[v]),s=(v,x)=>(0,n.useMemo)(()=>{let m=!1;const p=[];for(const y of h()){const E=v.get(y.value),b=x===y.value;(E||b)&&p.push({...y,label:`${y.label} (${v.get(y.value)})`}),b&&(m=!0)}return x&&!m&&p.push({value:x,label:`${x} (No matches)`}),p},[v,x]),g=()=>({id:c.Ct.byType,component:f,matcher:a.sJ.get(c.Ct.byType),name:(0,i.t)("grafana-ui.matchers-ui.name-fields-with-type","Fields with type"),description:(0,i.t)("grafana-ui.matchers-ui.description-fields-with-type","Set properties for fields of a specific type (number, string, boolean)"),optionsToLabel:v=>v})},18105(ne,A,e){"use strict";e.d(A,{N:()=>s,RH:()=>m});var t=e(74848),n=e(22803),a=e(96540),c=e(36638),r=e(57866),i=e(46644),o=e(92745),l=e(739),f=e(63142),h=e(63527),d=e(18857);const s=[{label:"==",value:l.zT.EQ},{label:"!=",value:l.zT.NEQ},{label:">",value:l.zT.GT},{label:">=",value:l.zT.GTE},{label:"<",value:l.zT.LT},{label:"<=",value:l.zT.LTE}];function g(p){return p===i.gy.allIsNull||p===i.gy.allIsZero}const v=({options:p,onChange:y})=>{const E=(0,f.of)(x),b=(0,a.useMemo)(()=>i.AS.selectOptions([p?.reducer]),[p?.reducer]),u=(0,a.useCallback)(R=>y({...p,reducer:R.value}),[p,y]),D=(0,a.useCallback)(R=>y({...p,op:R.value}),[p,y]),P=(0,a.useCallback)(R=>{const L=R.currentTarget.valueAsNumber;return y({...p,value:L})},[p,y]),C=p??{},S=g(C.reducer);return(0,t.jsxs)("div",{className:E.spot,children:[(0,t.jsx)(d.l6,{value:b.current,options:b.options,onChange:u,placeholder:(0,o.t)("grafana-ui.field-value-matcher.select-field-placeholder","Select field reducer")}),C.reducer&&!S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.l6,{value:s.find(R=>R.value===C.op),options:s,onChange:D,"aria-label":(0,o.t)("grafana-ui.field-value-matcher.operator-label","Comparison operator"),width:19}),(0,t.jsx)(h.p,{type:"number",value:C.value,onChange:P})]})]})},x=p=>({spot:(0,n.css)({display:"flex",flexDirection:"row",alignItems:"center",alignContent:"flex-end",gap:"4px"})}),m=()=>({id:r.Ct.byValue,component:v,matcher:c.sJ.get(r.Ct.byValue),name:(0,o.t)("grafana-ui.matchers-ui.name-fields-with-value","Fields with values"),description:(0,o.t)("grafana-ui.matchers-ui.description-fields-with-value","Set properties for fields with reducer condition"),optionsToLabel:p=>`${p?.reducer} ${p?.op} ${p?.value}`})},88531(ne,A,e){"use strict";e.d(A,{XL:()=>h,gK:()=>s,h:()=>y,pd:()=>x});var t=e(74848),n=e(96540),a=e(16515),c=e(47184),r=e(36638),i=e(57866),o=e(92745),l=e(18857);const f=(E,b,u)=>{if(!u)return;let D=E.find(P=>!b.some(C=>P===C));if(D)return D};function h({value:E,data:b,onChange:u,placeholder:D,id:P}){const C=(0,n.useMemo)(()=>g(b),[b]),[S,R]=(0,n.useState)({refIds:[],value:void 0}),L=(0,n.useMemo)(()=>C.find(N=>N.value===E)??f(C,S.refIds,S.value),[E,C,S]),j=(0,n.useCallback)(N=>{u(N?.value)},[u]);return(C!==S.refIds||L?.value!==S.value)&&R({refIds:C,value:L?.value}),(0,t.jsx)(l.l6,{inputId:P,options:C,onChange:j,isClearable:!0,placeholder:D??"Select query refId",value:L})}const d=(E,b,u)=>{if(!u||!u.length)return;const D=E.filter(P=>b.some(C=>P===C));if(D.length)return D};function s({value:E,data:b,onChange:u,placeholder:D,id:P}){const C=(0,n.useMemo)(()=>g(b),[b]),[S,R]=(0,n.useState)({refIds:[],value:void 0}),L=(0,n.useMemo)(()=>{let N=new Set;if(E)if(E.startsWith("/^"))try{N=new Set(p(E))}catch{N.add(E)}else E.includes("|")?N=new Set(E.split("|")):N.add(E);const V=C.filter(O=>N.has(O.value||""));if(V.length)return V;const w=[...N].map(c.z),M=d(w,S.refIds,S.value)??[];return M.length>0?M:w.length>0?w:void 0},[E,C,S]),j=(0,n.useCallback)(N=>{u(N.map(V=>V.value))},[u]);return(C!==S.refIds||L?.length!==S.value?.length)&&R({refIds:C,value:L}),(0,t.jsx)(l.KF,{inputId:P,options:C,onChange:j,isClearable:!0,placeholder:D??"Select query refId",value:L})}function g(E){const b=new Map;for(const D of E){const P=D.refId??"",C=b.get(P)??[];C.length===0&&b.set(P,C),C.push(D)}const u=[];for(const[D,P]of b.entries())u.push({value:D,label:D?(0,o.t)("grafana-ui.matchers-ui.get-list-of-query-ref-ids.label","Query: {{refId}}",{refId:D}):(0,o.t)("grafana-ui.matchers-ui.get-list-of-query-ref-ids.label-missing-ref-id","Query: (missing refId)"),description:v(P)});return u}function v(E){return(0,o.t)("grafana-ui.matchers-ui.get-list-of-query-ref-ids.description","Frames ({{framesCount}}): {{framesNames}}",{framesCount:E.length,framesNames:`${E.slice(0,Math.min(3,E.length)).map(b=>(0,a.Ri)(b)).join(", ")} ${E.length>3?"...":""}`})}const x=()=>({id:i.Ct.byFrameRefID,component:E=>(0,t.jsx)(h,{value:E.options,data:E.data,onChange:E.onChange}),matcher:r.sJ.get(i.Ct.byFrameRefID),name:(0,o.t)("grafana-ui.matchers-ui.name-fields-by-query","Fields returned by query"),description:(0,o.t)("grafana-ui.matchers-ui.description-fields-by-query","Set properties for fields from a specific query"),optionsToLabel:E=>E});function m(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const p=E=>E.slice(5,-3).split(/(?b.replace(/\\(.)/g,"$1")),y=E=>`/^(?:${E.map(b=>m(b)).join("|")})$/`},63152(ne,A,e){"use strict";e.d(A,{g:()=>E});var t=e(42954),n=e(74848),a=e(96540),c=e(57866),r=e(36638),i=e(92745),o=e(63527);const l=(0,a.memo)(b=>{const{options:u,onChange:D}=b,P=(0,a.useCallback)(C=>D(C.target.value),[D]);return(0,n.jsx)(o.p,{placeholder:(0,i.t)("grafana-ui.field-name-by-regex-matcher.input-placeholder","Enter regular expression"),defaultValue:u,onBlur:P})});l.displayName="FieldNameByRegexMatcherEditor";const f=()=>({id:c.Ct.byRegexp,component:l,matcher:r.sJ.get(c.Ct.byRegexp),name:(0,i.t)("grafana-ui.matchers-ui.name-field-name-by-regex-matcher","Fields with name matching regex"),description:(0,i.t)("grafana-ui.matchers-ui.description-field-name-by-regex-matcher","Set properties for fields with names matching a regex"),optionsToLabel:b=>b});var h=e(18857),d=e(56755);const s=(0,a.memo)(b=>{const{data:u,options:D,onChange:P,id:C}=b,S=(0,d.sE)(u),R=(0,d.m3)(S,D),L=(0,a.useCallback)(N=>{if((0,d.v3)(N.value,S))return P(N.value)},[S,P]),j=R.find(N=>N.value===D);return(0,n.jsx)(h.l6,{value:j,options:R,onChange:L,inputId:C})});s.displayName="FieldNameMatcherEditor";const g=()=>({id:c.Ct.byName,component:s,matcher:r.sJ.get(c.Ct.byName),name:(0,i.t)("grafana-ui.matchers-ui.name-fields-with-name","Fields with name"),description:(0,i.t)("grafana-ui.matchers-ui.description-fields-with-name","Set properties for a specific field"),optionsToLabel:b=>b}),v=(0,a.memo)(b=>{const{data:u,options:D,onChange:P}=b,{readOnly:C,prefix:S}=D,R=(0,d.sE)(u),L=(0,d.m3)(R,void 0),j=(0,a.useCallback)(N=>{if(Array.isArray(N))return P({...D,names:N.reduce((V,w)=>((0,d.v3)(w.value,R)&&V.push(w.value),V),[])})},[R,P,D]);if(C){const N=(D.names??[]).join(", ");return(0,n.jsx)(o.p,{value:N,readOnly:!0,disabled:!0,prefix:S})}return(0,n.jsx)(h.KF,{value:D.names,options:L,onChange:j})});v.displayName="FieldNameMatcherEditor";const x=()=>({id:c.Ct.byNames,component:v,matcher:r.sJ.get(c.Ct.byNames),name:(0,i.t)("grafana-ui.matchers-ui.name-fields-with-name","Fields with name"),description:(0,i.t)("grafana-ui.matchers-ui.description-fields-with-name","Set properties for a specific field"),optionsToLabel:b=>(b.names??[]).join(", "),excludeFromPicker:!0});var m=e(62693),p=e(18105),y=e(88531);const E=new t.O(()=>[g(),f(),(0,m.A)(),(0,y.pd)(),x(),(0,p.RH)()])},56755(ne,A,e){"use strict";e.d(A,{BP:()=>i,m3:()=>l,sE:()=>o,v3:()=>r});var t=e(96540),n=e(16515),a=e(38809),c=e(97958);function r(f,h){return f?h.display.has(f)||h.raw.has(f):!1}function i(f,h){const d={display:new Set,raw:new Set,fields:new Map};for(const s of f)for(const g of s.fields){if(h&&!h(g))continue;const v=(0,n.Ct)(g,s,f);d.display.add(v),d.fields.set(v,g),g.name&&v!==g.name&&(d.raw.add(g.name),d.fields.set(g.name,g))}return d}function o(f,h){return(0,t.useMemo)(()=>i(f,h),[f,h])}function l(f,h,d,s,g){return(0,t.useMemo)(()=>{let v=!1;const x=[];if(d&&x.push(d),g===a.X4.OnlyBaseNames)for(const m of f.raw)!v&&m===h&&(v=!0),x.push({value:m,label:`${m} (base field name)`});else{for(const m of f.display){!v&&m===h&&(v=!0);const p=f.fields.get(m);(!s||s===p?.type)&&x.push({value:m,label:m,icon:p?(0,c.SS)(p):void 0})}if(g!==a.X4.ExcludeBaseNames)for(const m of f.raw)f.display.has(m)||(!v&&m===h&&(v=!0),x.push({value:m,label:`${m} (base field name)`}))}return h&&!v&&x.push({value:h,label:`${h} (not found)`}),x},[f,h,d,s,g])}},87063(ne,A,e){"use strict";e.d(A,{W:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(31286),i=e(25460),o=e(30930),l=e(94535),f=e(92132);const h=a.forwardRef(({header:v,children:x,ariaLabel:m,onOpen:p,onClose:y,onKeyDown:E,...b},u)=>{const D=(0,c.of)(g),P=s(),C=(0,a.useRef)(null);(0,a.useImperativeHandle)(u,()=>C.current);const[S]=(0,f.t)({isMenuOpen:!0,localRef:C,onOpen:p,onClose:y,onKeyDown:E});return(0,t.jsxs)(r.a,{...b,"aria-label":m,backgroundColor:"elevated",borderRadius:P.borderRadius,boxShadow:"z3",display:"inline-block",onKeyDown:S,padding:P.padding,ref:C,role:"menu",tabIndex:-1,children:[v&&(0,t.jsx)("div",{className:(0,n.cx)(D.header,!!x&&a.Children.toArray(x).length>0&&D.headerBorder),children:v}),x]})});h.displayName="Menu";const d=Object.assign(h,{Item:l.D,Divider:i.N,Group:o.r}),s=()=>(0,c.of)(v=>{const{components:{menu:x}}=v;return{padding:x.padding,borderRadius:x.borderRadius}}),g=v=>({header:(0,n.css)({padding:v.spacing(.5,.5,1,.5)}),headerBorder:(0,n.css)({borderBottom:`1px solid ${v.colors.border.weak}`,marginBottom:v.spacing(.5)})})},25460(ne,A,e){"use strict";e.d(A,{N:()=>c});var t=e(74848),n=e(22803),a=e(63142);function c(){const i=(0,a.of)(r);return(0,t.jsx)("div",{className:i.divider})}const r=i=>({divider:(0,n.css)({height:1,backgroundColor:i.colors.border.weak,margin:i.spacing(.5,0)})})},30930(ne,A,e){"use strict";e.d(A,{r:()=>i});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(63142);const i=({label:l,ariaLabel:f,children:h})=>{const d=(0,r.of)(o),s=`group-label-${(0,a.uniqueId)()}`;return(0,t.jsxs)("div",{role:"group","aria-labelledby":!f&&l?s:void 0,"aria-label":f,children:[l&&(0,t.jsx)("label",{id:s,className:d.groupLabel,"aria-hidden":!0,children:l}),h]})};i.displayName="MenuGroup";const o=l=>({groupLabel:(0,n.css)({color:l.colors.text.secondary,fontSize:l.typography.size.sm,padding:l.spacing(.5,1)})})},94535(ne,A,e){"use strict";e.d(A,{D:()=>v});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(35484),o=e(30703),l=e(41654),f=e(51898),h=e(92132);const d=m=>{if(!m)return!1;const p=m.parentElement.getBoundingClientRect(),y=m.getBoundingClientRect();return y.width!==0&&p.right+y.width+10>window.innerWidth},s=(0,a.memo)(({items:m,isOpen:p,close:y,customStyle:E})=>{const b=(0,r.of)(g),u=(0,a.useRef)(null),[D]=(0,h.t)({localRef:u,isMenuOpen:p,close:y}),[P,C]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{p&&u.current&&C(d(u.current))},[p]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:b.iconWrapper,"aria-hidden":!0,"data-testid":f.Tp.components.Menu.SubMenu.icon,children:(0,t.jsx)(o.I,{name:"angle-right",className:b.icon})}),p&&(0,t.jsx)("div",{ref:u,className:(0,n.cx)(b.subMenu,{[b.pushLeft]:P}),"data-testid":f.Tp.components.Menu.SubMenu.container,style:E,children:(0,t.jsx)("div",{tabIndex:-1,className:b.itemsWrapper,role:"menu",onKeyDown:D,children:m})})]})});s.displayName="SubMenu";const g=m=>({iconWrapper:(0,n.css)({display:"flex",flex:1,justifyContent:"end"}),icon:(0,n.css)({opacity:.7,marginLeft:m.spacing(1),color:m.colors.text.secondary}),itemsWrapper:(0,n.css)({background:m.colors.background.elevated,padding:m.spacing(.5),boxShadow:m.shadows.z3,display:"inline-block",borderRadius:m.shape.radius.default}),pushLeft:(0,n.css)({right:"100%",left:"unset"}),subMenu:(0,n.css)({position:"absolute",top:0,left:"100%",zIndex:m.zIndex.dropdown})}),v=a.memo(a.forwardRef((m,p)=>{const{url:y,icon:E,label:b,description:u,ariaLabel:D,ariaChecked:P,target:C,onClick:S,className:R,active:L,disabled:j,destructive:N,childItems:V,role:w,tabIndex:M=-1,customSubMenuContainerStyles:O,shortcut:U,testId:K}=m,z=(0,r.of)(x),[G,F]=(0,a.useState)(L),[W,H]=(0,a.useState)(!1),Y=(0,a.useCallback)(()=>{j||(H(!0),F(!0))},[j]),te=(0,a.useCallback)(()=>{j||(H(!1),F(!1))},[j]),Z=V&&V.length>0,se=Z?"div":y===void 0?"button":"a",ae=(0,n.cx)({[z.item]:!0,[z.active]:G,[z.disabled]:j,[z.destructive]:N&&!j},R),J={[se==="button"?"disabled":"aria-disabled"]:j,...se==="a"&&j&&{href:void 0,onClick:void 0},...j&&{tabIndex:-1,"data-disabled":j}},k=(0,a.useRef)(null);(0,a.useImperativeHandle)(p,()=>k.current);const _=oe=>{switch(oe.key){case"ArrowRight":oe.preventDefault(),oe.stopPropagation(),Z&&(H(!0),F(!0));break;default:break}},Q=()=>{H(!1),F(!1),k?.current?.focus()},q=!!(U&&U.length>0);return(0,t.jsxs)(se,{target:C,className:ae,rel:C==="_blank"?"noopener noreferrer":void 0,href:y,onClick:oe=>{Z&&!W&&(oe.preventDefault(),oe.stopPropagation()),S?.(oe)},onMouseEnter:Y,onMouseLeave:te,onKeyDown:_,role:y?w:w||"menuitem","data-role":"menuitem",ref:k,"data-testid":K,"aria-label":D,"aria-checked":P,tabIndex:M,...J,children:[(0,t.jsxs)(l.B,{direction:"row",justifyContent:"flex-start",alignItems:"center",children:[E&&(0,t.jsx)(o.I,{name:E,className:z.icon,"aria-hidden":!0}),(0,t.jsx)("span",{className:z.ellipsis,children:b}),(0,t.jsxs)("div",{className:(0,n.cx)(z.rightWrapper,{[z.withShortcut]:q}),children:[q&&(0,t.jsxs)("div",{className:z.shortcut,children:[(0,t.jsx)(o.I,{name:"keyboard",title:(0,c.t)("grafana-ui.menu-item.keyboard-shortcut-label","Keyboard shortcut")}),U]}),Z&&(0,t.jsx)(s,{items:V,isOpen:W,close:Q,customStyle:O})]})]}),u&&(0,t.jsx)("div",{className:(0,n.cx)(z.description,z.ellipsis,{[z.descriptionWithIcon]:E!==void 0}),children:u}),m.component?(0,t.jsx)(m.component,{}):null]})}));v.displayName="MenuItem";const x=m=>{const p=m.components.menu.padding*m.spacing.gridSize;return{item:(0,n.css)({background:"none",cursor:"pointer",whiteSpace:"nowrap",color:m.colors.text.primary,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"center",padding:m.spacing(.5,1.5),minHeight:m.spacing(4),borderRadius:(0,i.getInternalRadius)(m,p,{parentBorderWidth:0}),margin:0,border:"none",width:"100%",position:"relative","&:hover, &:focus-visible":{background:m.colors.action.hover,color:m.colors.text.primary,textDecoration:"none"},"&:focus-visible":(0,i.getFocusStyles)(m)}),active:(0,n.css)({background:m.colors.action.hover}),destructive:(0,n.css)({color:m.colors.error.text,svg:{color:m.colors.error.text},"&:hover, &:focus, &:focus-visible":{background:m.colors.error.main,color:m.colors.error.contrastText,svg:{color:m.colors.error.contrastText}}}),disabled:(0,n.css)({color:m.colors.action.disabledText,label:"menu-item-disabled","&:hover, &:focus, &:focus-visible":{cursor:"not-allowed",background:"none",color:m.colors.action.disabledText}}),icon:(0,n.css)({opacity:.7,color:m.colors.text.secondary}),rightWrapper:(0,n.css)({display:"flex",alignItems:"center",marginLeft:"auto"}),withShortcut:(0,n.css)({minWidth:m.spacing(10.5)}),shortcut:(0,n.css)({display:"flex",alignItems:"center",gap:m.spacing(1),marginLeft:m.spacing(2),color:m.colors.text.secondary}),description:(0,n.css)({...m.typography.bodySmall,color:m.colors.text.secondary,textAlign:"start"}),descriptionWithIcon:(0,n.css)({marginLeft:m.spacing(3)}),ellipsis:(0,n.css)({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})}}},92132(ne,A,e){"use strict";e.d(A,{t:()=>r});var t=e(96540),n=e(94701);const a=(i,o)=>(i%o+o)%o,c=-1,r=({localRef:i,isMenuOpen:o,close:l,onOpen:f,onClose:h,onKeyDown:d})=>{const[s,g]=(0,t.useState)(c);return(0,t.useEffect)(()=>{o&&g(0)},[o]),(0,t.useEffect)(()=>{const x=i?.current?.querySelectorAll('[data-role="menuitem"]:not([data-disabled])');x?.[s]?.focus(),x?.forEach((m,p)=>{m.tabIndex=p===s?0:-1})},[i,s]),(0,n.A)(()=>{f?.(g)}),[x=>{const m=i?.current?.querySelectorAll('[data-role="menuitem"]:not([data-disabled])'),p=m?.length??0;switch(x.key){case"ArrowUp":x.preventDefault(),x.stopPropagation(),g(a(s-1,p));break;case"ArrowDown":x.preventDefault(),x.stopPropagation(),g(a(s+1,p));break;case"ArrowLeft":x.preventDefault(),x.stopPropagation(),g(c),l?.();break;case"Home":x.preventDefault(),x.stopPropagation(),g(0);break;case"End":x.preventDefault(),x.stopPropagation(),g(p-1);break;case"Enter":x.preventDefault(),x.stopPropagation(),m?.[s]?.click();break;case"Escape":h?.();break;case"Tab":x.preventDefault(),h?.();break;default:break}d?.(x)}]}},22787(ne,A,e){"use strict";e.d(A,{a:()=>v});var t=e(74848),n=e(22803),a=e(18828),c=e(43107),r=e(93225),i=e(59875),o=e(96540),l=e(92745),f=e(63142),h=e(76319),d=e(41654),s=e(53428),g=e(35621);function v(p){const{title:y,ariaLabel:E,children:b,isOpen:u=!1,closeOnEscape:D=!0,closeOnBackdropClick:P=!0,className:C,contentClassName:S,onDismiss:R,onClickBackdrop:L,trapFocus:j=!0}=p,N=(0,f.of)(g.o),V=(0,o.useRef)(null),{overlayProps:w,underlayProps:M}=(0,r.e)({isKeyboardDismissDisabled:!D,isOpen:u,onClose:R},V),{dialogProps:O,titleProps:U}=(0,a.s)({"aria-label":E},V);if(!u)return null;const K=(0,n.cx)(N.modalHeader,typeof y!="string"&&N.modalHeaderWithTabs);return(0,t.jsxs)(i.Sf,{children:[(0,t.jsx)("div",{role:"presentation",className:N.modalBackdrop,onClick:L||(P?R:void 0),...M}),(0,t.jsx)(c.n1,{contain:j,autoFocus:!0,restoreFocus:!0,children:(0,t.jsxs)("div",{className:(0,n.cx)(N.modal,C),ref:V,...w,...O,children:[(0,t.jsxs)("div",{className:K,children:[typeof y=="string"&&(0,t.jsx)(m,{...p,title:y,id:U.id}),typeof y!="string"&&y,(0,t.jsx)("div",{className:N.modalHeaderClose,children:(0,t.jsx)(h.K,{name:"times",size:"xl",onClick:R,"aria-label":(0,l.t)("grafana-ui.modal.close-tooltip","Close")})})]}),(0,t.jsx)("div",{className:(0,n.cx)(N.modalContent,S),children:b})]})})]})}function x({leftItems:p,children:y}){const E=(0,f.of)(g.o);return p?(0,t.jsx)("div",{className:E.modalButtonRow,children:(0,t.jsxs)(d.B,{justifyContent:"space-between",children:[(0,t.jsx)(d.B,{justifyContent:"flex-start",gap:2,children:p}),(0,t.jsx)(d.B,{justifyContent:"flex-end",gap:2,children:y})]})}):(0,t.jsx)("div",{className:E.modalButtonRow,children:(0,t.jsx)(d.B,{justifyContent:"flex-end",gap:2,wrap:"wrap",children:y})})}v.ButtonRow=x;function m({icon:p,iconTooltip:y,title:E,id:b}){return(0,t.jsx)(s.r,{icon:p,iconTooltip:y,title:E,id:b})}},53428(ne,A,e){"use strict";e.d(A,{r:()=>c});var t=e(74848),n=e(63142),a=e(35621);const c=({icon:r,iconTooltip:i,title:o,children:l,id:f})=>{const h=(0,n.of)(a.o);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{className:h.modalHeaderTitle,id:f,children:o}),l]})}},52792(ne,A,e){"use strict";e.d(A,{J:()=>r});var t=e(74848),n=e(60208),a=e(54314),c=e(53428);const r=({icon:i,title:o,tabs:l,activeTab:f,onChangeTab:h})=>(0,t.jsx)(c.r,{icon:i,title:o,children:(0,t.jsx)(a.U,{hideBorder:!0,children:l.map((d,s)=>(0,t.jsx)(n.o,{label:d.label,icon:d.icon,suffix:d.tabSuffix,active:d.value===f,onChangeTab:()=>h(d)},`${d.value}-${s}`))})})},8515(ne,A,e){"use strict";e.d(A,{$s:()=>i,EO:()=>r,YO:()=>c,wE:()=>a});var t=e(74848),n=e(96540);const a=n.createContext({component:null,props:{},showModal:()=>{},hideModal:()=>{}});class c extends n.Component{constructor(l){super(l),this.showModal=(f,h)=>{this.setState({component:f,props:h})},this.hideModal=()=>{this.setState({component:null,props:{}})},this.state={component:l.component||null,props:l.props||{},showModal:this.showModal,hideModal:this.hideModal}}render(){return(0,t.jsx)(a.Provider,{value:this.state,children:this.props.children})}}const r=()=>(0,t.jsx)(a.Consumer,{children:({component:o,props:l})=>o?(0,t.jsx)(o,{...l}):null}),i=a.Consumer},35621(ne,A,e){"use strict";e.d(A,{o:()=>n});var t=e(22803);const n=a=>({modal:(0,t.css)({position:"fixed",zIndex:a.zIndex.modal,background:a.colors.background.primary,boxShadow:a.shadows.z3,borderRadius:a.shape.radius.lg,border:`1px solid ${a.colors.border.weak}`,backgroundClip:"padding-box",outline:"none",width:"750px",maxWidth:"100%",left:0,right:0,marginLeft:"auto",marginRight:"auto",top:"10%",maxHeight:"80%",display:"flex",flexDirection:"column","@media (max-height: 750px)":{maxHeight:"100%",top:"50%",transform:"translateY(-50%)"}}),modalBackdrop:(0,t.css)({position:"fixed",zIndex:a.zIndex.modalBackdrop,top:0,right:0,bottom:0,left:0,backgroundColor:a.components.overlay.background}),modalHeader:(0,t.css)({label:"modalHeader",display:"flex",alignItems:"center",minHeight:"42px",margin:a.spacing(1,2,0,2),[a.breakpoints.down("sm")]:{margin:a.spacing(0,1,0,1)}}),modalHeaderWithTabs:(0,t.css)({borderBottom:`1px solid ${a.colors.border.weak}`}),modalHeaderTitle:(0,t.css)({fontSize:a.typography.size.lg,margin:a.spacing(0,4,0,1),display:"flex",alignItems:"center",position:"relative",top:"2px"}),modalHeaderIcon:(0,t.css)({marginRight:a.spacing(2),fontSize:"inherit","&:before":{verticalAlign:"baseline"}}),modalHeaderClose:(0,t.css)({height:"100%",display:"flex",alignItems:"center",color:a.colors.text.secondary,flexGrow:1,justifyContent:"flex-end"}),modalContent:(0,t.css)({overflow:"auto",padding:a.spacing(3,3,0,3),marginBottom:a.spacing(3),scrollbarWidth:"thin",width:"100%",[a.breakpoints.down("sm")]:{padding:a.spacing(1,2,0,2),marginBottom:a.spacing(2)}}),modalButtonRow:(0,t.css)({background:a.colors.background.primary,position:"sticky",bottom:0,paddingTop:a.spacing(2),paddingBottom:a.spacing(.5),zIndex:1})})},13477(ne,A,e){"use strict";e.d(A,{O:()=>n});var t=e(78193);function n(a){const c="${"+a.value+"}",r=a.value===a.label?a.origin:`${a.label} / ${a.origin}`;return{label:c,kind:t.q.Property,detail:r,documentation:a.documentation}}},84600(ne,A,e){"use strict";e.d(A,{d:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(51898),r=e(92745),i=e(63142),o=e(35484),l=e(30703),f=e(76319),h=e(20941),d=e(36219);const s=(0,a.memo)(({title:v,section:x,parent:m,pageIcon:p,onGoBack:y,children:E,titleHref:b,parentHref:u,leftItems:D,isFullscreen:P,className:C,"aria-label":S,buttonOverflowAlignment:R="right",forceShowLeftItems:L=!1})=>{const j=(0,i.of)(g),N=(0,n.cx)("page-toolbar",j.toolbar,{"page-toolbar--fullscreen":P,[j.noPageIcon]:!p},C),V=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:j.truncateText,children:v}),x&&(0,t.jsxs)("span",{className:j.pre,children:[" / ",x]})]}),w=(0,r.t)("grafana-ui.page-toolbar.go-back","Go back (Esc)"),M=(0,r.t)("grafana-ui.page-toolbar.search-parent-folder","Search dashboard in the {{parent}} folder",{parent:m}),O=(0,r.t)("grafana-ui.page-toolbar.search-dashboard-name","Search dashboard by name"),U=(0,r.t)("grafana-ui.page-toolbar.search-links","Search links");return(0,t.jsxs)("nav",{className:N,"aria-label":S,children:[(0,t.jsxs)("div",{className:j.leftWrapper,children:[p&&!y&&(0,t.jsx)("div",{className:j.pageIcon,children:(0,t.jsx)(l.I,{name:p,size:"lg","aria-hidden":!0})}),y&&(0,t.jsx)("div",{className:j.pageIcon,children:(0,t.jsx)(f.K,{name:"arrow-left",tooltip:w,tooltipPlacement:"bottom",size:"xxl","data-testid":c.Tp.components.BackButton.backArrow,onClick:y})}),(0,t.jsxs)("nav",{"aria-label":U,className:j.navElement,children:[m&&u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.N,{"aria-label":M,className:(0,n.cx)(j.titleText,j.parentLink,j.titleLink,j.truncateText),href:u,children:[m," ",(0,t.jsx)("span",{className:j.parentIcon})]}),b&&(0,t.jsx)("span",{className:(0,n.cx)(j.titleText,j.titleDivider),"aria-hidden":!0,children:"/"})]}),(v||!!D?.length)&&(0,t.jsxs)("div",{className:j.titleWrapper,children:[v&&(0,t.jsx)("h1",{className:j.h1Styles,children:b?(0,t.jsx)(h.N,{"aria-label":O,className:(0,n.cx)(j.titleText,j.titleLink),href:b,children:V}):(0,t.jsx)("div",{className:j.titleText,children:V})}),D?.map((K,z)=>(0,t.jsx)("div",{className:(0,n.cx)(j.leftActionItem,{[j.forceShowLeftActionItems]:L}),children:K},z))]})]})]}),(0,t.jsx)(d.U,{alignment:R,children:a.Children.toArray(E).filter(Boolean)})]})});s.displayName="PageToolbar";const g=v=>{const{spacing:x,typography:m}=v,p=(0,o.getFocusStyles)(v);return{pre:(0,n.css)({whiteSpace:"pre"}),toolbar:(0,n.css)({alignItems:"center",background:v.colors.background.canvas,display:"flex",gap:v.spacing(2),justifyContent:"space-between",padding:v.spacing(1.5,2),[v.breakpoints.down("md")]:{paddingLeft:"53px"}}),noPageIcon:(0,n.css)({[v.breakpoints.down("md")]:{paddingLeft:v.spacing(2)}}),leftWrapper:(0,n.css)({display:"flex",flexWrap:"nowrap",maxWidth:"70%"}),pageIcon:(0,n.css)({display:"none",[v.breakpoints.up("sm")]:{display:"flex",paddingRight:v.spacing(1),alignItems:"center"}}),truncateText:(0,n.css)({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),titleWrapper:(0,n.css)({display:"flex",margin:0,minWidth:0}),navElement:(0,n.css)({display:"flex",alignItems:"center",minWidth:0}),h1Styles:(0,n.css)({margin:x(0,1,0,0),lineHeight:"inherit",flexGrow:1,minWidth:0}),parentIcon:(0,n.css)({marginLeft:v.spacing(.5)}),titleText:(0,n.css)({display:"flex",fontSize:m.size.lg,margin:0,borderRadius:v.shape.radius.default}),titleLink:(0,n.css)({"&:focus-visible":p}),titleDivider:(0,n.css)({padding:x(0,.5,0,.5),display:"none",[v.breakpoints.up("md")]:{display:"unset"}}),parentLink:(0,n.css)({display:"none",[v.breakpoints.up("md")]:{display:"unset",flex:1}}),leftActionItem:(0,n.css)({display:"none",alignItems:"center",paddingRight:x(.5),[v.breakpoints.up("md")]:{display:"flex"}}),forceShowLeftActionItems:(0,n.css)({display:"flex"})}}},34213(ne,A,e){"use strict";e.d(A,{d:()=>l});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(45861),o=e(30703);const l=({currentPage:h,numberOfPages:d,onNavigate:s,hideWhenSinglePage:g,showSmallVersion:v,className:x})=>{const m=(0,r.of)(f),p=v?1:8,y=(0,a.useMemo)(()=>{const u=[...new Array(d).keys()],D=d>p,P=(C,S)=>(0,t.jsx)("li",{className:m.item,children:(0,t.jsx)(i.$n,{size:"sm",variant:S,onClick:()=>s(C),children:C})},C);return u.reduce((C,S)=>{const R=S+1,L=R===h?"primary":"secondary",j=p,N=d-p+1,V=N-j,w=R===1||R===d,M=V>-1&&h>=j&&h<=N,O=v?1:3,U=v?0:2;return D?w||h=0&&h>N&&R>N||V<0&&h>=j&&R>N||M&&R>=h-U&&R<=h+U?C.push(P(R,L)):(R===j&&hN||M&&(R===h-O||R===h+O))&&C.push((0,t.jsx)("li",{className:m.item,children:(0,t.jsx)(o.I,{className:m.ellipsis,name:"ellipsis-v","data-testid":"pagination-ellipsis-icon"})},R)):C.push(P(R,L)),C},[])},[h,d,s,p,v,m.ellipsis,m.item]);if(g&&d<=1)return null;const E=(0,c.t)("grafana-ui.pagination.previous-page","previous page"),b=(0,c.t)("grafana-ui.pagination.next-page","next page");return(0,t.jsx)("div",{className:(0,n.cx)(m.container,x),role:"navigation",children:(0,t.jsxs)("ol",{children:[(0,t.jsx)("li",{className:m.item,children:(0,t.jsx)(i.$n,{"aria-label":E,size:"sm",variant:"secondary",onClick:()=>s(h-1),disabled:h===1,children:(0,t.jsx)(o.I,{name:"angle-left"})})}),y,(0,t.jsx)("li",{className:m.item,children:(0,t.jsx)(i.$n,{"aria-label":b,size:"sm",variant:"secondary",onClick:()=>s(h+1),disabled:h===d,children:(0,t.jsx)(o.I,{name:"angle-right"})})})]})})},f=()=>({container:(0,n.css)({float:"right"}),item:(0,n.css)({display:"inline-block",paddingLeft:"10px",marginBottom:"5px"}),ellipsis:(0,n.css)({transform:"rotate(90deg)"})})},39884(ne,A,e){"use strict";e.d(A,{I:()=>l});var t=e(74848),n=e(22803),a=e(51898),c=e(92745),r=e(63142),i=e(30703),o=e(45967);const l=({onCancel:d,loading:s})=>{const g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=(0,r.of)(h);return s?(0,t.jsx)(o.m,{content:(0,c.t)("grafana-ui.panel-chrome.tooltip-cancel-loading","Cancel query"),children:(0,t.jsx)(i.I,{className:(0,n.cx)(v.spin,{[v.clickable]:!!d}),name:g?"hourglass":"sync",size:"sm",onClick:d,"data-testid":a.Tp.components.LoadingIndicator.icon})}):null},f=(0,n.keyframes)({"0%":{transform:"rotate(0deg) scaleX(-1)"},"100%":{transform:"rotate(359deg) scaleX(-1)"}}),h=d=>({clickable:(0,n.css)({cursor:"pointer"}),spin:(0,n.css)({[d.transitions.handleMotion("no-preference")]:{animation:`${f} 3s linear infinite`}})})},64400(ne,A,e){"use strict";e.d(A,{XF:()=>c,d2:()=>r,e4:()=>a});var t=e(96540),n=e(19379);const a=(0,t.createContext)({eventsScope:"global",eventBus:new n.o}),c=a.Provider,r=()=>(0,t.useContext)(a)},67522(ne,A,e){"use strict";e.d(A,{NR:()=>F});var t=e(39884),n=e(74848),a=e(22803),c=e(96540),r=e(42941),i=e(49185),o=e(28105),l=e(51898),f=e(92745),h=e(63142),d=e(35484);function s({children:W,delay:H}){const[Y,te]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{window.setTimeout(()=>{te(!0)},H)},[W,H]),(0,n.jsx)(n.Fragment,{children:Y?W:null})}var g=e(27629),v=e(36324),x=e(56887),m=e(30703),p=e(47327),y=e(66404),E=e(45967),b=e(88559),u=e(7895);function D({menu:W,title:H,placement:Y="bottom",offset:te,dragClassCancel:Z,menuButtonClass:se,onOpenMenu:ae}){const J=H?l.Tp.components.Panels.Panel.menu(H):"panel-menu-button",k=(0,c.useCallback)(_=>{_&&ae&&ae()},[ae]);return(0,n.jsx)(b.m,{overlay:W,placement:Y,offset:te,onVisibleChange:k,children:(0,n.jsx)(u.I,{"aria-label":(0,f.t)("grafana-ui.panel-menu.label","Menu for panel {{ title }}",{title:H??"Untitled"}),title:(0,f.t)("grafana-ui.panel-menu.title","Menu"),icon:"ellipsis-v",iconSize:"md",narrow:!0,"data-testid":J,className:(0,a.cx)(se,Z)})})}function P({menu:W,title:H,dragClass:Y,children:te,offset:Z=-32,onOpenMenu:se}){const ae=(0,h.of)(C),J=(0,c.useRef)(null),k=l.Tp.components.Panels.Panel.HoverWidget,_=(0,c.useCallback)(q=>{J.current?.setPointerCapture(q.pointerId)},[]),Q=(0,c.useCallback)(q=>{J.current?.releasePointerCapture(q.pointerId)},[]);return te===void 0||c.Children.count(te)===0?null:(0,n.jsxs)("div",{className:(0,a.cx)(ae.container,"show-on-hover"),style:{top:Z},"data-testid":k.container,children:[Y&&(0,n.jsx)("div",{className:(0,a.cx)(ae.square,ae.draggable,Y),onPointerDown:_,onPointerUp:Q,ref:J,"data-testid":k.dragIcon,children:(0,n.jsx)(m.I,{name:"expand-arrows",className:ae.draggableIcon})}),te,W&&(0,n.jsx)(D,{menu:W,title:H,placement:"bottom",menuButtonClass:ae.menuButton,onOpenMenu:se})]})}function C(W){return{container:(0,a.css)({label:"hover-container-widget",[W.transitions.handleMotion("no-preference","reduce")]:{transition:"all .1s linear"},display:"flex",position:"absolute",zIndex:1,right:0,boxSizing:"content-box",alignItems:"center",background:W.colors.background.secondary,color:W.colors.text.primary,border:`1px solid ${W.colors.border.weak}`,borderRadius:W.shape.radius.default,height:W.spacing(4),boxShadow:W.shadows.z1}),square:(0,a.css)({display:"flex",justifyContent:"center",alignItems:"center",width:W.spacing(4),height:"100%"}),draggable:(0,a.css)({cursor:"move",[W.breakpoints.down("md")]:{display:"none"}}),menuButton:(0,a.css)({background:"inherit",border:"none","&:hover":{background:W.colors.secondary.main}}),draggableIcon:(0,a.css)({transform:"rotate(45deg)",color:W.colors.text.secondary,"&:hover":{color:W.colors.text.primary}})}}var S=e(45861);const R=(0,c.forwardRef)(({className:W,children:H,href:Y,onClick:te,target:Z,title:se,...ae},J)=>{const k=(0,h.of)(L);return Y?(0,n.jsx)("a",{ref:J,href:Y,onClick:te,target:Z,title:se,className:(0,a.cx)(k.linkItem,W),...ae,children:H}):te?(0,n.jsx)(S.$n,{ref:J,className:(0,a.cx)(k.buttonItem,W),variant:"secondary",fill:"text",onClick:te,children:H}):(0,n.jsx)("span",{ref:J,className:(0,a.cx)(k.item,W),...ae,children:H})});R.displayName="TitleItem";const L=W=>{const H=(0,a.css)({color:`${W.colors.text.secondary}`,label:"panel-header-item",border:"none",borderRadius:`${W.shape.radius.default}`,padding:`${W.spacing(0,1)}`,height:`${W.spacing(W.components.panel.headerHeight)}`,display:"flex",alignItems:"center",justifyContent:"center","&:focus, &:focus-visible":{...(0,d.getFocusStyles)(W),zIndex:1},"&: focus:not(:focus-visible)":(0,d.getMouseFocusStyles)(W),"&:hover ":{boxShadow:`${W.shadows.z1}`,background:`${W.colors.background.secondary}`,color:`${W.colors.text.primary}`}});return{item:H,linkItem:(0,a.cx)(H,(0,a.css)({cursor:"pointer"})),buttonItem:(0,a.cx)(H,(0,a.css)({cursor:"pointer"}))}};function j({description:W,className:H}){const Y=(0,h.of)(N),te=()=>{const Z=typeof W=="function"?W():W;return(0,n.jsx)("div",{className:"panel-info-content markdown-html",children:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:Z}})})};return W!==""?(0,n.jsx)(E.m,{interactive:!0,content:te,children:(0,n.jsx)(R,{className:(0,a.cx)(H,Y.description),children:(0,n.jsx)(m.I,{name:"info-circle",size:"md"})})}):null}const N=W=>({description:(0,a.css)({code:{whiteSpace:"normal",wordWrap:"break-word"},"pre > code":{display:"block"}})});function V({message:W,onClick:H,ariaLabel:Y="status"}){const te=(0,h.of)(w);return(0,n.jsx)(u.I,{className:te.buttonStyles,onClick:H,variant:"destructive",icon:"exclamation-triangle",iconSize:"md",tooltip:W||"","aria-label":Y,"data-testid":l.Tp.components.Panels.Panel.status("error")})}const w=W=>{const{headerHeight:H,padding:Y}=W.components.panel;return{buttonStyles:(0,a.css)({label:"panel-header-state-button",display:"flex",alignItems:"center",justifyContent:"center",padding:W.spacing(Y),width:W.spacing(H),height:W.spacing(H),borderRadius:W.shape.radius.default})}},M=({children:W})=>{const H=(0,h.of)(G);return(0,g.$)("preventPanelChromeOverflow")?(0,n.jsx)("div",{className:H.container,children:W}):W};function O({width:W,height:H,children:Y,padding:te="md",title:Z="",description:se="",displayMode:ae="default",titleItems:J,menu:k,dragClass:_,dragClassCancel:Q,hoverHeader:q=!1,hoverHeaderOffset:oe,loadingState:re,statusMessage:ee,statusMessageOnClick:B,leftItems:ie,actions:de,selectionId:fe,onCancelQuery:ce,onOpenMenu:ve,collapsible:Se=!1,collapsed:je,onToggleCollapse:Ve,onFocus:he,onMouseMove:Ue,onMouseEnter:pe,onDragStart:be,showMenuAlways:ze=!1}){const Ne=(0,h.$j)(),Ie=(0,h.of)(G),ke=(0,c.useId)(),Ee=(0,c.useId)().replace(/:/g,"_"),{isSelected:Ae,onSelect:$e,isSelectable:Fe}=(0,x.y)(fe),We=(0,v.C)(),Ge=!q,[me,De]=(0,r.A)(!0),[xe,Me]=(0,c.useState)(!1),Be=c.useCallback(()=>Me(!0),[]),Oe=c.useCallback(()=>Me(!1),[]);je===void 0&&(je=!me);const Re=ze?"always-show":"show-on-hover",we=ae==="transparent",Ce=K(Ne,Ge),{contentStyle:_e,innerWidth:Je,innerHeight:et}=z(te,Ne,Ce,je,H,W),qe={height:Ce,cursor:_?"move":"auto"},nt={width:W,height:je?void 0:H},[ot,{width:Ze}]=(0,i.A)();ie&&(de=ie);const at=typeof Z=="string"?l.Tp.components.Panels.Panel.title(Z):"Panel",it=c.useCallback(vt=>{We.check(vt)||Q&&vt.target instanceof Element&&vt.target.closest(`.${Q}`)||setTimeout(()=>$e?.(vt))},[Q,$e,We]),ct=c.useCallback(vt=>{vt.stopPropagation(),We.set(vt),be?.(vt)},[We,be]),xt=c.useCallback(vt=>{vt.target instanceof Element&&vt.target.closest("button,a,canvas,svg")||$e?.(vt)},[$e]),dt=(0,n.jsxs)(n.Fragment,{children:[!Se&&Z&&(0,n.jsx)("div",{className:Ie.title,children:(0,n.jsx)(y.E,{element:"h2",variant:"h6",truncate:!0,title:typeof Z=="string"?Z:void 0,id:Ee,children:Z})}),Se&&(0,n.jsx)("div",{className:Ie.title,children:(0,n.jsx)(y.E,{element:"h2",variant:"h6",children:(0,n.jsxs)("button",{type:"button",className:Ie.clearButtonStyles,onClick:()=>{De(),Ve&&Ve(!je)},"aria-expanded":!je,"aria-controls":je?void 0:ke,children:[(0,n.jsx)(m.I,{name:je?"angle-right":"angle-down","aria-hidden":!!Z,"aria-label":Z?void 0:(0,f.t)("grafana-ui.panel-chrome.aria-label-toggle-collapse","toggle collapse panel")}),(0,n.jsx)(y.E,{variant:"h6",truncate:!0,id:Ee,children:Z})]})})}),(0,n.jsxs)("div",{className:(0,a.cx)(Ie.titleItems,Q),"data-testid":"title-items-container",children:[(0,n.jsx)(j,{description:se,className:Q}),J]}),re===o.Gu.Streaming&&(0,n.jsx)(E.m,{content:ce?(0,f.t)("grafana-ui.panel-chrome.tooltip-stop-streaming","Stop streaming"):(0,f.t)("grafana-ui.panel-chrome.tooltip-streaming","Streaming"),children:(0,n.jsx)(R,{className:Q,"data-testid":"panel-streaming",onClick:ce,children:(0,n.jsx)(m.I,{name:"circle-mono",size:"md",className:Ie.streaming})})}),re===o.Gu.Loading&&ce&&(0,n.jsx)(s,{delay:2e3,children:(0,n.jsx)(E.m,{content:(0,f.t)("grafana-ui.panel-chrome.tooltip-cancel","Cancel query"),children:(0,n.jsx)(R,{className:(0,a.cx)(Q,Ie.pointer),"data-testid":"panel-cancel-query",onClick:ce,children:(0,n.jsx)(m.I,{name:"sync-slash",size:"md"})})})}),(0,n.jsx)("div",{className:Ie.rightAligned,children:de&&(0,n.jsx)("div",{className:Ie.rightActions,children:U(de,vt=>vt)})})]});return(0,n.jsx)(M,{children:(0,n.jsxs)("section",{className:(0,a.cx)(Ie.panel,we&&Ie.panelTransparent,Ae&&"dashboard-selected-element",!Ae&&Fe&&xe&&"dashboard-selectable-element"),style:nt,"aria-labelledby":Z?Ee:void 0,"data-testid":at,tabIndex:0,onFocus:he,onMouseMove:Ue,onMouseEnter:pe,ref:ot,children:[(0,n.jsx)("div",{className:Ie.loadingBarContainer,children:re===o.Gu.Loading?(0,n.jsx)(p.G,{width:Ze,ariaLabel:(0,f.t)("grafana-ui.panel-chrome.ariaLabel-panel-loading","Panel loading bar")}):null}),q&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P,{menu:k,title:typeof Z=="string"?Z:void 0,offset:oe,dragClass:_,onOpenMenu:ve,children:dt}),ee&&(0,n.jsx)("div",{className:Ie.errorContainerFloating,children:(0,n.jsx)(V,{message:ee,onClick:B,ariaLabel:(0,f.t)("grafana-ui.panel-chrome.ariaLabel-panel-status","Panel status")})})]}),Ge&&(0,n.jsxs)("div",{className:(0,a.cx)(Ie.headerContainer,_),style:qe,"data-testid":l.Tp.components.Panels.Panel.headerContainer,onPointerDown:ct,onMouseEnter:Fe?Be:void 0,onMouseLeave:Fe?Oe:void 0,onPointerUp:it,children:[ee&&(0,n.jsx)("div",{className:Q,children:(0,n.jsx)(V,{message:ee,onClick:B,ariaLabel:(0,f.t)("grafana-ui.panel-chrome.ariaLabel-panel-status","Panel status")})}),dt,k&&(0,n.jsx)(D,{menu:k,title:typeof Z=="string"?Z:void 0,placement:"bottom-end",menuButtonClass:(0,a.cx)(Ie.menuItem,Q,Re),onOpenMenu:ve})]}),!je&&(0,n.jsx)("div",{id:ke,"data-testid":l.Tp.components.Panels.Panel.content,className:(0,a.cx)(Ie.content,H===void 0&&Ie.containNone),style:_e,onPointerDown:xt,children:typeof Y=="function"?Y(Je,et):Y})]})})}const U=(W,H)=>{const Y=c.Children.toArray(W).filter(Boolean);return Y.length>0?H(Y):null},K=(W,H)=>H?W.spacing.gridSize*W.components.panel.headerHeight:0,z=(W,H,Y,te,Z,se)=>{const ae=(W==="md"?H.components.panel.padding:0)*H.spacing.gridSize,J=ae*2,k=2;let _=0;se&&(_=se-J-k);let Q=0;return Z&&(Q=Z-Y-J-k),te&&(Q=Y),{contentStyle:{padding:ae},innerWidth:_,innerHeight:Q}},G=W=>{const{background:H,borderColor:Y,padding:te}=W.components.panel;return{container:(0,a.css)({height:"100%",position:"relative"}),panel:(0,a.css)({label:"panel-container",backgroundColor:H,border:`1px solid ${Y}`,position:(0,g.$)("preventPanelChromeOverflow")?"unset":"relative",borderRadius:W.shape.radius.default,height:"100%",display:"flex",flexDirection:"column",overflow:(0,g.$)("preventPanelChromeOverflow")?"hidden":"initial",".always-show":{background:"none","&:focus-visible, &:hover":{background:W.colors.secondary.shade}},".show-on-hover":{opacity:"0",visibility:"hidden"},"&:focus-visible, &:hover":{".show-on-hover":{opacity:"1",visibility:"visible"}},"&:focus-visible":(0,d.getFocusStyles)(W),"&:focus-within:not(:focus)":{".show-on-hover":{visibility:"visible",opacity:"1"}}}),panelTransparent:(0,a.css)({label:"panel-transparent-container",backgroundColor:"transparent",border:"1px solid transparent",boxSizing:"border-box","&:hover":{border:`1px solid ${Y}`}}),loadingBarContainer:(0,a.css)({label:"panel-loading-bar-container",position:"absolute",top:0,width:"100%",zIndex:1}),containNone:(0,a.css)({contain:"none"}),content:(0,a.css)({label:"panel-content",flexGrow:1,contain:"size layout"}),headerContainer:(0,a.css)({label:"panel-header",display:"flex",alignItems:"center"}),pointer:(0,a.css)({cursor:"pointer"}),streaming:(0,a.css)({label:"panel-streaming",marginRight:0,color:W.colors.success.text,"&:hover":{color:W.colors.success.text}}),title:(0,a.css)({label:"panel-title",display:"flex",padding:W.spacing(0,te),minWidth:0,"& > h2":{minWidth:0}}),items:(0,a.css)({display:"flex"}),item:(0,a.css)({display:"flex",justifyContent:"center",alignItems:"center"}),hiddenMenu:(0,a.css)({visibility:"hidden"}),menuItem:(0,a.css)({label:"panel-menu",border:"none",background:W.colors.secondary.main,"&:hover":{background:W.colors.secondary.shade}}),errorContainerFloating:(0,a.css)({label:"error-container",position:"absolute",left:0,top:0,zIndex:1}),rightActions:(0,a.css)({display:"flex",padding:W.spacing(0,te),gap:W.spacing(1)}),rightAligned:(0,a.css)({label:"right-aligned-container",marginLeft:"auto",display:"flex",alignItems:"center"}),titleItems:(0,a.css)({display:"flex",height:"100%"}),clearButtonStyles:(0,a.css)({alignItems:"center",display:"flex",gap:W.spacing(.5),background:"transparent",border:"none",padding:0,maxWidth:"100%"})}},F=O;F.LoadingIndicator=t.I,F.TitleItem=R},49256(ne,A,e){"use strict";e.d(A,{B:()=>t});var t=(n=>(n.ToggleSelection="select",n.AppendToSelection="append",n))(t||{})},3023(ne,A,e){"use strict";e.d(A,{_:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({children:i,className:o,...l})=>{const f=(0,a.of)(r);return(0,t.jsx)("div",{className:(0,n.cx)(f,o),...l,children:i})},r=i=>(0,n.css)({backgroundColor:i.components.panel.background,border:`1px solid ${i.components.panel.borderColor}`,borderRadius:i.shape.radius.default})},63509(ne,A,e){"use strict";e.d(A,{B:()=>r});var t=e(74848),n=e(11594),a=e(99887);const c={[n.kv.grafana]:"grafana",[n.kv.commercial]:"shield",[n.kv.community]:"shield",DEFAULT:"shield-exclamation"},r=({status:o,color:l,signatureType:f,signatureOrg:h,...d})=>{const s=i(o,f,h);return(0,t.jsx)(a.E,{text:s.text,color:s.color,icon:s.icon,tooltip:s.tooltip,...d})};r.displayName="PluginSignatureBadge";function i(o,l,f){o||(o=n.Ac.invalid);const h=c[l||""]||c.DEFAULT;switch(o){case n.Ac.internal:return{text:"Core",color:"blue",tooltip:"Core plugin that is bundled with Grafana"};case n.Ac.valid:return{text:l||"Signed",icon:l?h:"lock",color:"green",tooltip:"Signed and verified plugin"};case n.Ac.invalid:return{text:"Invalid signature",icon:"exclamation-triangle",color:"red",tooltip:"Invalid plugin signature"};case n.Ac.modified:return{text:"Modified signature",icon:"exclamation-triangle",color:"red",tooltip:"Valid signature but content has been modified"};case n.Ac.missing:return{text:"Missing signature",icon:"exclamation-triangle",color:"red",tooltip:"Missing plugin signature"};default:return{text:"Unsigned",icon:"exclamation-triangle",color:"red",tooltip:"Unsigned external plugin"}}}},92505(ne,A,e){"use strict";e.d(A,{X:()=>D});var t=e(74848),n=e(22803),a=e(46942),c=e.n(a),r=e(2543),i=e.n(r),o=e(96540),l=e(75226),f=e(29317),h=e(51898),d=e(16123),s=e(54024),g=e(52513),v=e(21266),x=e(59490),m=e(91272),p=e(93427),y=e(63142),E=e(35484),b=e(35458);class u extends o.PureComponent{constructor(S){super(S),this.lastExecutedValue=null,this.mounted=!1,this.editor=null,this.onChange=(V,w)=>{const M=V.document!==this.state.value.document,O=this.state.value;this.props.onRichValueChange&&this.props.onRichValueChange(V),this.setState({value:V},()=>{if(M){const U=l.default.serialize(O)!==l.default.serialize(V);U&&w&&this.runOnChangeAndRunQuery(),U&&!w&&this.runOnChangeDebounced()}})},this.runOnChange=()=>{const{onChange:V}=this.props,w=l.default.serialize(this.state.value);V&&V(this.cleanText(w))},this.runOnRunQuery=()=>{const{onRunQuery:V}=this.props;V&&(V(),this.lastExecutedValue=this.state.value)},this.runOnChangeAndRunQuery=()=>{this.runOnChange(),this.runOnRunQuery()},this.handleBlur=(V,w,M)=>{const{onBlur:O}=this.props;if(O)O();else{const U=this.lastExecutedValue?l.default.serialize(this.lastExecutedValue):"",K=l.default.serialize(w.value);U!==K&&this.runOnChangeAndRunQuery()}return M()},this.runOnChangeDebounced=(0,r.debounce)(this.runOnChange,500);const{onTypeahead:R,cleanText:L,portalOrigin:j,onWillApplySuggestion:N}=S;this.plugins=[(0,p.Pz)({onTypeahead:R,cleanText:L,portalOrigin:j,onWillApplySuggestion:N}),(0,x.U)({handler:this.runOnChangeAndRunQuery}),(0,v.O)(),(0,d.v)(),(0,m.l)(),(0,g.T)(),(0,s.s)(),...S.additionalPlugins||[]].filter(V=>V),this.state={suggestions:[],typeaheadContext:null,typeaheadPrefix:"",typeaheadText:"",value:(0,b.mO)(S.query||"",S.syntax)}}static{this.defaultProps={onBlur:()=>{}}}componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}componentDidUpdate(S,R){const{query:L,syntax:j,syntaxLoaded:N}=this.props;if(!S.syntaxLoaded&&N&&this.editor){const w=this.editor.insertText(" ").deleteBackward(1);this.onChange(w.value,!0)}const{value:V}=this.state;L!==S.query&&L!==l.default.serialize(V)&&this.setState({value:(0,b.mO)(L||"",j)})}cleanText(S){return S.replace(/[\r]/g,"")}render(){const{disabled:S,theme:R}=this.props,L=c()("slate-query-field__wrapper",{"slate-query-field__wrapper--disabled":S}),j=P(R);return(0,t.jsx)("div",{className:(0,n.cx)(L,j.wrapper),children:(0,t.jsx)("div",{className:"slate-query-field","data-testid":h.Tp.components.QueryField.container,children:(0,t.jsx)(f.Editor,{ref:N=>this.editor=N,schema:b.yx,autoCorrect:!1,readOnly:this.props.disabled,onBlur:this.handleBlur,onClick:this.props.onClick,onChange:N=>{this.onChange(N.value,!1)},placeholder:this.props.placeholder,plugins:this.plugins,spellCheck:!1,value:this.state.value})})})}}const D=(0,y.cV)(u),P=C=>{const S=(0,E.getFocusStyles)(C);return{wrapper:(0,n.css)({"&:focus-within":S})}}},90811(ne,A,e){"use strict";e.d(A,{cC:()=>s,cb:()=>d});var t=e(74848),n=e(22803),a=e(58521),c=e(96540),r=e(74529),i=e(51898),o=e(92745),l=e(93256),f=e(15356),h=e(7895);const d=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"];class s extends c.PureComponent{constructor(m){super(m),this.onChangeSelect=p=>{const{onIntervalChanged:y}=this.props;y&&p.value!=null&&y(p.value)}}static{this.offOption={label:"Off",value:"",ariaLabel:"Turn off auto refresh"}}static{this.liveOption={label:"Live",value:"LIVE",ariaLabel:"Turn on live streaming"}}static{this.autoOption={label:"Auto",value:"auto",ariaLabel:"Select refresh from the query range"}}static{this.isLive=m=>m===s.liveOption.value}getVariant(){return this.props.isLive||this.props.primary?"primary":this.props.isOnCanvas?"canvas":"default"}render(){const{onRefresh:m,intervals:p,tooltip:y,value:E,text:b,isLoading:u,noIntervalPicker:D,width:P,showAutoInterval:C}=this.props,S=E||"",R=this.getVariant(),L=v({intervals:p,showAutoInterval:C}),j=L.find(({value:F})=>F===S),N=g(s.offOption.value);let V=j||N;V.label===N.label&&(V={value:""});const w=V.ariaLabel,M=(0,o.t)("refresh-picker.aria-label.duration-selected","Choose refresh time interval with current interval {{durationAriaLabel}} selected",{durationAriaLabel:w}),O=(0,o.t)("refresh-picker.aria-label.choose-interval","Auto refresh turned off. Choose refresh time interval"),U=V.value===""?O:M,K=(0,o.t)("refresh-picker.tooltip.interval-selected","Set auto refresh interval"),z=(0,o.t)("refresh-picker.tooltip.turned-off","Auto refresh off"),G=V.value===""?z:K;return(0,t.jsxs)(l.e,{className:"refresh-picker",children:[(0,t.jsx)(h.I,{"aria-label":b,tooltip:y,onClick:m,variant:R,icon:u?"spinner":"sync",style:P?{width:P}:void 0,"data-testid":i.Tp.components.RefreshPicker.runButtonV2,children:b}),!D&&(0,t.jsx)(f.f,{className:(0,n.css)({borderTopLeftRadius:"unset",borderBottomLeftRadius:"unset"}),value:V,options:L,onChange:this.onChangeSelect,variant:R,"data-testid":i.Tp.components.RefreshPicker.intervalButtonV2,"aria-label":U,tooltip:G})]})}}function g(x){switch(x){case s.liveOption.value:return{label:(0,o.t)("refresh-picker.live-option.label","Live"),value:x,ariaLabel:(0,o.t)("refresh-picker.live-option.aria-label","Turn on live streaming")};case s.offOption.value:return{label:(0,o.t)("refresh-picker.off-option.label","Off"),value:x,ariaLabel:(0,o.t)("refresh-picker.off-option.aria-label","Turn off auto refresh")};case s.autoOption.value:return{label:(0,o.t)("refresh-picker.auto-option.label",s.autoOption.label),value:x,ariaLabel:(0,o.t)("refresh-picker.auto-option.aria-label",s.autoOption.ariaLabel)}}return{label:x,value:x}}function v({intervals:x=d,showAutoInterval:m=!1}={}){const p=x.map(y=>{const E=(0,r.E9)(y),b=(0,a.a)(E);return{label:y,value:y,ariaLabel:b}});return m&&p.unshift(g(s.autoOption.value)),p.unshift(g(s.offOption.value)),p}},70663(ne,A,e){"use strict";e.d(A,{I:()=>a});var t=e(96540),n=e(63704);function a({component:c,content:r,...i}){return t.createElement(c||"span",{dangerouslySetInnerHTML:{__html:n.sQ.sanitize(r)},...i})}},23659(ne,A,e){"use strict";e.d(A,{L:()=>o});var t=e(74848),n=e(2543),a=e.n(n),c=e(92745),r=e(45861),i=e(94959);const o=({label:l="Password",labelWidth:f,inputWidth:h=12,onReset:d,isConfigured:s,tooltip:g,placeholder:v="Password",interactive:x,...m})=>(0,t.jsx)(i.z,{label:l,tooltip:g,interactive:x,labelWidth:f,inputEl:s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"text",className:`gf-form-input width-${h}`,disabled:!0,value:"configured",...(0,n.omit)(m,"value")}),(0,t.jsx)(r.$n,{onClick:d,variant:"secondary",type:"button",children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.secret-form-field.reset",children:"Reset"})})]}):(0,t.jsx)("input",{type:"password",className:`gf-form-input width-${h}`,placeholder:v,...m})});o.displayName="SecretFormField"},48767(ne,A,e){"use strict";e.d(A,{L4:()=>o});var t=e(74848),n=e(45861),a=e(63527),c=e(41654);const r="configured",i="Reset",o=({isConfigured:l,onReset:f,...h})=>(0,t.jsxs)(c.B,{children:[!l&&(0,t.jsx)(a.p,{...h,type:"password"}),l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.p,{...h,type:"text",disabled:!0,value:r}),(0,t.jsx)(n.$n,{onClick:f,variant:"secondary",children:i})]})]})},40601(ne,A,e){"use strict";e.d(A,{lp:()=>d});var t=e(74848),n=e(22803),a=e(63142),c=e(45861),r=e(31286),i=e(41654),o=e(87105);const l="configured",f="Reset",h=s=>({configuredStyle:(0,n.css)({minHeight:s.spacing(s.components.height.md),paddingTop:s.spacing(.5),resize:"none"})}),d=({isConfigured:s,onReset:g,...v})=>{const x=(0,a.of)(h);return(0,t.jsxs)(i.B,{children:[(0,t.jsxs)(r.a,{children:[!s&&(0,t.jsx)(o.f,{...v}),s&&(0,t.jsx)(o.f,{...v,rows:1,disabled:!0,value:l,className:(0,n.cx)(x.configuredStyle)})]}),s&&(0,t.jsx)(c.$n,{onClick:g,variant:"secondary",children:f})]})}},61875(ne,A,e){"use strict";e.d(A,{Y:()=>h});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(63142),i=e(79233),o=e(89467),l=e(37864),f=e(3431);function h({options:d,value:s,onChange:g,Component:v,className:x,allowCustomValue:m,allowEmptyValue:p,placeholder:y,disabled:E,inputMinWidth:b,inputPlaceholder:u,onExpandedChange:D,autofocus:P=!1,...C}){const[S,R,L,j]=(0,f.Q)(P,D),N=b?Math.max(b,R):R,V=(0,r.of)(l.m);if(!L){const w=(0,a.isObject)(s)?s.label:s,M=w!=null?String(w):void 0;return(0,t.jsx)(S,{disabled:E,Component:v||(0,t.jsx)(i.c,{className:(0,n.cx)(V.segment,{[V.queryPlaceholder]:y!==void 0&&!s,[V.disabled]:E},x),children:M||y})})}return(0,t.jsx)(o.a,{...C,value:s&&!(0,a.isObject)(s)?{value:s}:s,placeholder:u,options:d,width:N,onClickOutside:()=>j(!1),allowCustomValue:m,allowEmptyValue:p,onChange:w=>{j(!1),g(w)}})}},76671(ne,A,e){"use strict";e.d(A,{s:()=>s});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(41053),i=e(92745),o=e(63142),l=e(79233),f=e(89467),h=e(37864),d=e(3431);function s({value:v,onChange:x,loadOptions:m,reloadOptionsOnChange:p=!1,Component:y,className:E,allowCustomValue:b,allowEmptyValue:u,disabled:D,placeholder:P,inputMinWidth:C,inputPlaceholder:S,autofocus:R=!1,onExpandedChange:L,noOptionMessageHandler:j=g,...N}){const[V,w]=(0,r.A)(m,[m]),[M,O,U,K]=(0,d.Q)(R,L),z=C?Math.max(C,O):O,G=(0,o.of)(h.m);if(!U){const F=(0,a.isObject)(v)?v.label:v,W=F!=null?String(F):void 0;return(0,t.jsx)(M,{onClick:p?void 0:w,disabled:D,Component:y||(0,t.jsx)(l.c,{className:(0,n.cx)(G.segment,{[G.queryPlaceholder]:P!==void 0&&!v,[G.disabled]:D},E),children:W||P})})}return(0,t.jsx)(f.a,{...N,value:v&&!(0,a.isObject)(v)?{value:v}:v,placeholder:S,options:V.value??[],loadOptions:p?w:void 0,width:z,noOptionsMessage:j(V),allowCustomValue:b,allowEmptyValue:u,onClickOutside:()=>{K(!1)},onChange:F=>{K(!1),x(F)}})}function g(v){return v.loading?(0,i.t)("grafana-ui.segment-async.loading","Loading options..."):v.error?(0,i.t)("grafana-ui.segment-async.error","Failed to load options"):(0,i.t)("grafana-ui.segment-async.no-options","No options found")}},52042(ne,A,e){"use strict";e.d(A,{L:()=>i});var t=e(74848),n=e(22803),a=e(63142),c=e(97095),r=e(79233);const i=({label:l,htmlFor:f,children:h,fill:d})=>{const s=(0,a.of)(o);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(c.C,{children:[(0,t.jsx)(r.c,{htmlFor:f,width:12,className:s.label,children:l}),h,d&&(0,t.jsx)("div",{className:s.fill,children:(0,t.jsx)(r.c,{children:""})})]})})},o=l=>({label:(0,n.css)({color:l.colors.primary.text}),fill:(0,n.css)({flexGrow:1,marginBottom:l.spacing(.5)})})},89467(ne,A,e){"use strict";e.d(A,{a:()=>r});var t=e(74848),n=e(96540),a=e(63142),c=e(18857);function r({value:i,placeholder:o="",options:l=[],onChange:f,onClickOutside:h,loadOptions:d=void 0,width:s,noOptionsMessage:g="",allowCustomValue:v=!1,allowEmptyValue:x=!1,...m}){const p=(0,n.useRef)(null),y=(0,a.$j)();let E=s>0?s/y.spacing.gridSize:void 0,b,u={};return d?(b=c.DW,u={loadOptions:d,defaultOptions:!0}):b=c.l6,(0,t.jsx)("div",{...m,ref:p,children:(0,t.jsx)(b,{width:E,noOptionsMessage:g,placeholder:o,autoFocus:!0,isOpen:!0,onChange:f,options:l,value:i,closeMenuOnSelect:!1,onCloseMenu:()=>{if(p&&p.current){const D=p.current.querySelector('input[id^="react-select-"]');D&&(D.value||x)?f({value:D.value,label:D.value}):h()}},allowCustomValue:v,...u})})}},37864(ne,A,e){"use strict";e.d(A,{m:()=>n});var t=e(22803);const n=a=>({segment:(0,t.css)({cursor:"pointer",width:"auto"}),queryPlaceholder:(0,t.css)({color:a.colors.text.disabled}),disabled:(0,t.css)({cursor:"not-allowed",opacity:.65,boxShadow:"none"})})},3431(ne,A,e){"use strict";e.d(A,{Q:()=>r});var t=e(74848),n=e(96540),a=e(63142),c=e(45861);const r=(i,o)=>{const l=(0,n.useRef)(null),f=(0,a.of)(c.my),[h,d]=(0,n.useState)(i),[s,g]=(0,n.useState)(0),v=m=>{d(m),o&&o(m)};return[({Component:m,onClick:p,disabled:y})=>(0,t.jsx)("button",{type:"button",className:f,ref:l,disabled:y,onClick:()=>{v(!0),l&&l.current&&g(l.current.clientWidth*1.25),p?.()},children:m}),s,h,v]}},82143(ne,A,e){"use strict";e.d(A,{u:()=>v});var t,n=e(2543),a=e.n(n),c=e(96540),r=e(13752),i=e(96083),o=e(62467),l=e(11150),f=e(63720),h=e(59099),d=e(8934),s=e(90811);function g(x){return{label:x,value:t(x)}}class v extends c.PureComponent{constructor(m){super(m),this.propsSubject=new r.B,this.subscription=null}componentDidMount(){this.subscription=this.propsSubject.pipe((0,f.n)(m=>s.cC.isLive(m.interval)?(0,o.of)({}):m.loading?l.t:(0,i.Y)((0,d.dc)(m.interval))),(0,h.M)(()=>this.props.func())).subscribe(),this.propsSubject.next(this.props)}componentDidUpdate(m){s.cC.isLive(m.interval)&&s.cC.isLive(this.props.interval)||(0,n.isEqual)(m,this.props)||this.propsSubject.next(this.props)}componentWillUnmount(){this.subscription&&this.subscription.unsubscribe(),this.propsSubject.unsubscribe()}render(){return null}}},59795(ne,A,e){"use strict";e.d(A,{I1:()=>E,_$:()=>x,gl:()=>s});var t=e(2543),n=e.n(t),a=e(36394),c=e(60519),r=e(35987),i=e(46644),o=e(64394),l=e(33553),f=e(38919),h=e(739);const d=["reduceOptions","orientation"];function s(D,P,C){let S=D.options;if(D.fieldConfig=D.fieldConfig||{defaults:{},overrides:[]},(P==="singlestat"||P==="grafana-singlestat-panel")&&C.angular)return v(D,C);if(P==="graph")return g(D,C);for(const R of d)C.hasOwnProperty(R)&&(S[R]=(0,t.cloneDeep)(C[R]));return S}function g(D,P){const C=P.angular,S={orientation:f.wV.Auto,reduceOptions:{values:!1,calcs:[]},legend:{displayMode:h.lm.List,showLegend:!0,placement:"bottom",calcs:[]}};if(C.xaxis?.mode==="series"){D.fieldConfig={...D.fieldConfig,defaults:{...D.fieldConfig.defaults,color:{mode:"palette-classic"}}},C.xaxis.values&&(S.reduceOptions.calcs=u(C.xaxis.values));const R=C.legend;if(R){if(R.show?S.legend.displayMode=R.alignAsTable?h.lm.Table:h.lm.List:S.legend.showLegend=!1,R.rightSide&&(S.legend.placement="right"),R.values){const L=(0,t.pickBy)(R,t.identity);S.legend.calcs=b(L)}R.sideWidth&&(S.legend.width=R.sideWidth)}}return S}function v(D,P){const C=P.angular,S=i.AS.getIfExists(C.valueName),R={reduceOptions:{calcs:[S?S.id:i.gy.mean]},orientation:f.wV.Horizontal},L={};if(C.format&&(L.unit=C.format),C.tableColumn&&(R.reduceOptions.fields=`/^${C.tableColumn}$/`),C.nullPointMode&&(L.nullValueMode=C.nullPointMode),C.nullText&&(L.noValue=C.nullText),(C.decimals||C.decimals===0)&&(L.decimals=C.decimals),C.thresholds&&C.colors){const N=C.thresholds.split(",").map(w=>Number(w.trim())),V=[];for(const w of C.colors){const M=V.length-1;M>=0?V.push({value:N[M],color:w}):V.push({value:-1/0,color:w})}L.thresholds={mode:l.O.Absolute,steps:V}}const j=(0,r.bh)(C,L.thresholds);return j&&j.length&&(L.mappings=j),C.gauge&&C.gauge.show&&(L.min=C.gauge.minValue,L.max=C.gauge.maxValue),D.fieldConfig.defaults=L,R}function x(D){if(!D.options)return{reduceOptions:{calcs:[i.gy.mean]},orientation:f.wV.Horizontal};const P=parseFloat(D.pluginVersion||"6.1");let C=D.options;P<6.2&&(C=p(C)),P<6.3&&(C=m(C));const{fieldOptions:S}=C;if(P<6.6&&S){if(S&&S.override){const{override:j,...N}=C.fieldOptions;C={...C,fieldOptions:{...N,overrides:[]}}}let R=S?.defaults?.thresholds;R?delete S.defaults.thresholds:(R=S?.thresholds,delete S.thresholds),R&&(S.defaults.thresholds={mode:l.O.Absolute,steps:R});const{defaults:L}=S;L.color&&typeof L.color=="string"&&(L.color={mode:o.Y.Fixed,fixedColor:L.color}),(0,c.BF)(L)}if(P<7&&(D.fieldConfig=D.fieldConfig||{defaults:{},overrides:[]},D.fieldConfig={defaults:S&&S.defaults?{...D.fieldConfig.defaults,...S.defaults}:D.fieldConfig.defaults,overrides:S&&S.overrides?[...D.fieldConfig.overrides,...S.overrides]:D.fieldConfig.overrides},S&&(C.reduceOptions={values:S.values,limit:S.limit,calcs:S.calcs}),delete C.fieldOptions),P<7.1){const R=D.fieldConfig.defaults.title;R!=null&&(D.fieldConfig.defaults.displayName=R,delete D.fieldConfig.defaults.title)}if(P<8){const R=D.fieldConfig?.defaults;let L=R?.unit;L==="percent"?((0,t.isNumber)(R.min)||(R.min=0),(0,t.isNumber)(R.max)||(R.max=100)):L==="percentunit"&&((0,t.isNumber)(R.min)||(R.min=0),(0,t.isNumber)(R.max)||(R.max=1))}return C}function m(D){const{fieldOptions:P}=D;if(!P)return D;const{mappings:C,...S}=D.fieldOptions;let R;return D.thresholds&&(R={mode:l.O.Absolute,steps:y(D.thresholds)}),{...D,fieldOptions:{...S,defaults:{...P.defaults,mappings:C,thresholds:R}}}}function p(D){const{valueOptions:P}=D;if(!P)return D;const C={},S={};if(C.mappings=D.valueMappings,C.thresholds=D.thresholds,C.defaults=S,S.unit=P.unit,S.decimals=P.decimals,P.stat){const L=i.AS.get(P.stat);L&&(C.calcs=[L.id])}S.min=D.minValue,S.max=D.maxValue;const R={...D,fieldOptions:C};return(0,t.omit)(R,"valueMappings","thresholds","valueOptions","minValue","maxValue")}function y(D){if(!D||!D.length)return;const P=D.map(C=>({value:C.value===null?-1/0:C.value,color:C.color}));return(0,a.RU)(P),P[0].value=-1/0,P}function E(D){return(0,r.bh)(D)}function b(D){const P=[];for(const C in D){const S=i.AS.getIfExists(C);S&&P.push(S.id)}return P}function u(D){const P=[];return D?.forEach(C=>{Object.values(i.gy).includes(C)?P.push(C):C==="current"?P.push(i.gy.lastNotNull):C==="total"?P.push(i.gy.sum):C==="avg"&&P.push(i.gy.mean)}),D?P:[i.gy.sum]}},21103(ne,A,e){"use strict";e.d(A,{F:()=>g});var t=e(74848),n=e(22803),a=e(17437),c=e(69156),r=e(96540),i=e(92745),o=e(63142),l=e(5994);const f=v=>{const{value:x,children:m,visible:p,placement:y,tipFormatter:E,...b}=v,u=(0,r.useRef)(null),D=(0,r.useRef)(null),P=(0,o.of)(h);function C(){D.current!==null&&cancelAnimationFrame(D.current)}function S(){D.current=requestAnimationFrame(()=>{u.current?.forceAlign()})}return(0,r.useEffect)(()=>(p?S():C(),C),[x,p]),(0,t.jsx)(l.A,{overlayClassName:P.tooltip,placement:y,overlay:E??x,overlayInnerStyle:{minHeight:"auto"},ref:u,visible:p,...b,children:m})},h=v=>({tooltip:(0,n.css)({position:"absolute",display:"block",visibility:"visible",fontSize:v.typography.bodySmall.fontSize,opacity:.9,padding:3,zIndex:v.zIndex.tooltip})}),d=f;var s=e(91302);const g=({min:v,max:x,onChange:m,onAfterChange:p,orientation:y="horizontal",reverse:E,step:b,formatTooltipResult:u,value:D,tooltipAlwaysVisible:P=!0})=>{const C=(0,r.useCallback)(V=>{m?.(typeof V=="number"?[V,V]:V)},[m]),S=(0,r.useCallback)(V=>{p?.(typeof V=="number"?[V,V]:V)},[p]),R=y==="horizontal",L=(0,o.of)(s.$,R),j=(0,i.t)("grafana-ui.range-slider.drag-handle-aria-label","Use arrow keys to change the value"),N=(V,w)=>(0,t.jsx)(d,{value:w.value,visible:P||w.dragging,tipFormatter:u?()=>u(w.value):void 0,placement:R?"top":"right",children:V});return(0,t.jsxs)("div",{className:(0,n.cx)(L.container,L.slider),children:[(0,t.jsx)(a.Global,{styles:L.tooltip}),(0,t.jsx)(c.A,{min:v,max:x,step:b,defaultValue:D,range:!0,onChange:C,onChangeComplete:S,vertical:!R,reverse:E,handleRender:N,ariaLabelForHandle:j})]})};g.displayName="RangeSlider"},91302(ne,A,e){"use strict";e.d(A,{$:()=>a});var t=e(22803),n=e(17437);const a=(c,r,i=!1)=>{const{spacing:o}=c,l=c.colors.border.strong,f=c.colors.primary.main,h=c.colors.primary.main,s=`box-shadow: 0px 0px 0px 6px ${c.colors.primary.transparent}`;return{container:(0,t.css)({width:"100%",margin:r?"inherit":o(1,3,1,1),paddingBottom:r&&i?c.spacing(1):"inherit",height:r?"auto":"100%"}),slider:(0,t.css)` .rc-slider { display: flex; flex-grow: 1; margin-left: 7px; // half the size of the handle to align handle to the left on 0 value } .rc-slider-mark { top: ${c.spacing(1.75)}; } .rc-slider-mark-text { color: ${c.colors.text.disabled}; font-size: ${c.typography.bodySmall.fontSize}; } .rc-slider-mark-text-active { color: ${c.colors.text.primary}; } .rc-slider-handle { border: none; background-color: ${h}; box-shadow: ${c.shadows.z1}; cursor: pointer; opacity: 1; } .rc-slider-handle:hover, .rc-slider-handle:active, .rc-slider-handle-click-focused:focus { ${s}; } // The triple class names is needed because that's the specificity used in the source css :( .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging, .rc-slider-handle:focus-visible { box-shadow: 0 0 0 5px ${c.colors.text.primary}; } .rc-slider-dot, .rc-slider-dot-active { background-color: ${c.colors.text.primary}; border-color: ${c.colors.text.primary}; } .rc-slider-track { background-color: ${f}; } .rc-slider-rail { background-color: ${l}; cursor: pointer; } `,tooltip:(0,n.css)` body { .rc-slider-tooltip { cursor: grab; user-select: none; z-index: ${c.zIndex.tooltip}; } .rc-slider-tooltip-inner { color: ${c.colors.text.primary}; background-color: transparent !important; border-radius: 0; box-shadow: none; } .rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow { display: none; } .rc-slider-tooltip-placement-top { padding: 0; } } `,sliderInput:(0,t.css)({display:"flex",flexDirection:"row",alignItems:"center",width:"100%"}),sliderInputVertical:(0,t.css)({flexDirection:"column",height:"100%",".rc-slider":{margin:0,order:2}}),sliderInputField:(0,t.css)({marginLeft:c.spacing(3),input:{textAlign:"center"}}),sliderInputFieldVertical:(0,t.css)({margin:`0 0 ${c.spacing(3)} 0`,order:1})}}},53431(ne,A,e){"use strict";e.d(A,{O:()=>y});var t=e(74848),n=e(2543),a=e(96540),c=e(34455),r=e(76732),i=e(95004),o=e(76637),l=e(739),f=e(92790),h=e(47276),d=e(36192),s=e(8721),g=e(41119),v=e(63409);function x(E,b){const u=E.y.values.length,D={...E.y.config,...b},P=E.x??{name:"",values:[...Array(u).keys()],type:i.PU.number,config:{}};let C={refId:"sparkline",fields:[P,{...E.y,config:D}],length:u};return(0,s.g2)(P.values)||(C=(0,g.ES)(C,0)),(0,v.M)({frame:C,refFieldPseudoMin:E.timeRange?.from.valueOf(),refFieldPseudoMax:E.timeRange?.to.valueOf()})}function m(E,b){let{min:u,max:D}=b.fields[1].state?.range;u=Math.max(u,E.config.min??-1/0),D=Math.min(D,E.config.max??1/0);const P=+b.fields[1].config?.noValue;return Number.isNaN(P)||(u=Math.min(u,P),D=Math.max(D,P)),u===D&&(u===0?D=100:u<0?(D=0,u*=2):(u=0,D*=2)),[u,D]}const p={drawStyle:l.GR.Line,showPoints:l.yL.Auto,axisPlacement:l.vM.Hidden,pointSize:2};class y extends a.PureComponent{constructor(b){super(b);const u=x(b.sparkline,b.config);this.state={data:(0,d.bq)(u,(0,d.ro)(u)),alignedDataFrame:u,configBuilder:this.prepareConfig(u)}}static getDerivedStateFromProps(b,u){const D=x(b.sparkline,b.config),P=(0,c.C)(D);return P?{...u,data:(0,d.bq)(P,(0,d.ro)(P)),alignedDataFrame:P}:{...u}}componentDidUpdate(b,u){const{alignedDataFrame:D}=this.state;if(!D)return;let P=!1;if(b.sparkline!==this.props.sparkline){const C=!(0,r.bW)(this.state.alignedDataFrame,u.alignedDataFrame),S=!(0,n.isEqual)(D.fields[1].state?.range,u.alignedDataFrame.fields[1].state?.range);P=C||S}else P=!(0,n.isEqual)(b.config,this.props.config);P&&this.setState({configBuilder:this.prepareConfig(D)})}getYRange(b){return m(b,this.state.alignedDataFrame)}prepareConfig(b){const{theme:u}=this.props,D=new h.e;D.setCursor({show:!1,x:!1,y:!1});const P=b.fields[0];D.addScale({scaleKey:"x",orientation:l.Lt.Horizontal,direction:l.ON.Right,isTime:!1,range:()=>{const{sparkline:C}=this.props;if(C.x){if(C.timeRange&&C.x.type===i.PU.time)return[C.timeRange.from.valueOf(),C.timeRange.to.valueOf()];const S=C.x.values;return[S[0],S[S.length-1]]}return[0,C.y.values.length-1]}}),D.addAxis({scaleKey:"x",theme:u,placement:l.vM.Hidden});for(let C=0;Cthis.getYRange(S)}),D.addAxis({scaleKey:j,theme:u,placement:l.vM.Hidden});const N=(0,o.Qi)(S),V=N.getCalculator(S,u)(0,0),w=L.drawStyle===l.GR.Points?l.yL.Always:L.showPoints;D.addSeries({pxAlign:!1,scaleKey:j,theme:u,colorMode:N,thresholds:R.thresholds,drawStyle:L.drawStyle,lineColor:L.lineColor??V,lineWidth:L.lineWidth,lineInterpolation:L.lineInterpolation,showPoints:w,pointSize:L.pointSize,fillOpacity:L.fillOpacity,fillColor:L.fillColor,lineStyle:L.lineStyle,gradientMode:L.gradientMode,spanNulls:L.spanNulls})}return D}render(){const{data:b,configBuilder:u}=this.state,{width:D,height:P}=this.props;return(0,t.jsx)(f.Z,{data:b,config:u,width:D,height:P})}}},93008(ne,A,e){"use strict";e.d(A,{h:()=>d});var t=e(22803),n=e(2543),a=e.n(n),c=e(96540),r=e(63142),i=e(45897);const o=.3,l=new Set(["ArrowUp","ArrowDown"]),f=new Set(["ArrowLeft","ArrowRight"]),h={row:{dim:"width",axis:"clientX",min:"minWidth",max:"maxWidth"},column:{dim:"height",axis:"clientY",min:"minHeight",max:"maxHeight"}};function d(m){const{direction:p,initialSize:y=m.usePixels?300:.5,dragPosition:E="middle",onResizing:b,onSizeChanged:u,usePixels:D}=m,P=x(m.handleSize),C=(0,c.useRef)(null),S=(0,c.useRef)(null),R=(0,c.useRef)(null),L=(0,c.useRef)(null),j=(0,c.useRef)(null),N=(0,c.useRef)(null),V=(0,c.useRef)(void 0),w=(0,c.useRef)(void 0),M=h[p].dim,O=h[p].axis,U=h[p].min,K=h[p].max,z=(0,c.useRef)(null),G=(0,c.useCallback)(ie=>{!S.current||!R.current||(N.current=S.current.getBoundingClientRect()[M],j.current=L.current.getBoundingClientRect()[M],z.current=ie[O],C.current.setPointerCapture(ie.pointerId),D?V.current=g(R.current,D):V.current=g(S.current),w.current=void 0)},[M,O,D]),F=(0,c.useCallback)(ie=>{if(!j.current||!N.current||!R.current)return;const de=N.current,fe=j.current-de-P,ce=V.current;if(D){const ve=(0,n.clamp)(fe-ie,ce[U],ce[K]);R.current.style.flexBasis=`${ve}px`,C.current.ariaValueNow=`${ve}`,b?.(ve,de+ie,ve)}else{const ve=(0,n.clamp)(N.current+ie,ce[U],ce[K]),Se=ve/(j.current-P);S.current.style.flexGrow=`${Se}`,R.current.style.flexGrow=`${1-Se}`,C.current.ariaValueNow=s(ve,ce[U],ce[K]),b?.(Se,ve,fe-ie)}},[b,P,D,U,K]),W=(0,c.useCallback)(ie=>{z.current!==null&&F(ie[O]-z.current)},[F,O]),H=(0,c.useCallback)(ie=>{ie.preventDefault(),ie.stopPropagation(),z.current=null,C.current.releasePointerCapture(ie.pointerId);const de=S.current.getBoundingClientRect()[M],fe=j.current-de-P;u?.(parseFloat(S.current.style.flexGrow),de,fe)},[u,P,M]),Y=(0,c.useRef)(new Set),te=(0,c.useRef)(null),Z=(0,c.useCallback)(ie=>{if(Y.current.size===0){te.current=null;return}else if(N.current===null)return;const ce=(ie-(te.current??ie))*o;let ve=0;p==="row"?(Y.current.has("ArrowLeft")&&(ve-=ce),Y.current.has("ArrowRight")&&(ve+=ce)):(Y.current.has("ArrowUp")&&(ve-=ce),Y.current.has("ArrowDown")&&(ve+=ce)),N.current=S.current.getBoundingClientRect()[M],j.current=L.current.getBoundingClientRect()[M],F(ve),te.current=ie,window.requestAnimationFrame(Z)},[p,M,F]),se=(0,c.useCallback)(ie=>{if(!S.current||!R.current||!C.current||!L.current||!(p==="column"&&l.has(ie.key)||p==="row"&&f.has(ie.key))||Y.current.has(ie.key))return;if(w.current=void 0,ie.preventDefault(),ie.stopPropagation(),N.current=S.current.getBoundingClientRect()[M],j.current=L.current.getBoundingClientRect()[M],D?V.current=g(R.current):V.current=g(S.current),!Y.current.has(ie.key)){const fe=Y.current.size===0;Y.current.add(ie.key),fe&&window.requestAnimationFrame(Z)}},[p,Z,,M,D]),ae=(0,c.useCallback)(ie=>{if(!(p==="row"&&!f.has(ie.key)||p==="column"&&!l.has(ie.key))&&(Y.current.delete(ie.key),N.current!==null)){const de=j.current-N.current-P;u?.(parseFloat(S.current.style.flexGrow),N.current,de)}},[p,u,P]),J=(0,c.useCallback)(()=>{!S.current||!R.current||(D?R.current.style.flexBasis=`${y}px`:(S.current.style.flexGrow="0.5",R.current.style.flexGrow="0.5",N.current=S.current.getBoundingClientRect()[M],C.current.ariaValueNow="50"))},[M,D,y]),k=(0,c.useCallback)(()=>{if(Y.current.size>0&&(Y.current.clear(),z.current=null,typeof N.current=="number")){const ie=j.current-N.current-P;u?.(parseFloat(S.current.style.flexGrow),N.current,ie)}},[u,P]),_=(0,r.of)(v,p),Q=(0,r.of)(i.l,E),q=p==="column"?Q.dragHandleHorizontal:Q.dragHandleVertical,oe=(0,c.useId)(),re={flexGrow:(0,n.clamp)(y,0,1),[U]:"min-content"},ee={flexGrow:(0,n.clamp)(1-y,0,1),[U]:"min-content"};D&&(re.flexGrow=1,ee.flexGrow="unset",ee.flexBasis=`${y}px`);const B=`start-panel-${oe}`;return{containerProps:{ref:L,className:_.container},primaryProps:{ref:S,className:_.panel,style:re,id:B},secondaryProps:{ref:R,className:_.panel,style:ee},splitterProps:{onPointerUp:H,onPointerDown:G,onPointerMove:W,onKeyDown:se,onKeyUp:ae,onDoubleClick:J,onBlur:k,ref:C,style:{[M]:`${P}px`},role:"separator","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":y*100,"aria-controls":B,"aria-label":"Pane resize widget",tabIndex:0,className:q}}}function s(m,p,y){return`${(0,n.clamp)((m-p)/(y-p)*100,0,100)}`}function g(m,p){const y=document.body.style.overflow,E=m.style.width,b=m.style.height,u=m.style.flexGrow,D=m.style.flexBasis;document.body.style.overflow="hidden",m.style.flexGrow="0",m.style.flexBasis="0";const{width:P,height:C}=m.getBoundingClientRect();m.style.flexGrow="100";const{width:S,height:R}=m.getBoundingClientRect();return document.body.style.overflow=y,m.style.width=E,m.style.height=b,m.style.flexGrow=u,m.style.flexBasis=D,{minWidth:P,maxWidth:S,minHeight:C,maxHeight:R}}function v(m,p){return{container:(0,t.css)({display:"flex",flexDirection:p==="row"?"row":"column",width:"100%",flexGrow:1,overflow:"hidden"}),panel:(0,t.css)({display:"flex",position:"relative",flexBasis:0})}}function x(m="md"){return{xs:4,sm:8,md:16,lg:32}[m]}},34107(ne,A,e){"use strict";e.d(A,{S:()=>o});var t=e(74848),n=e(2543),a=e.n(n),c=e(96540),r=e(46644),i=e(18857);class o extends c.PureComponent{constructor(){super(...arguments),this.checkInput=()=>{const{stats:f,allowMultiple:h,defaultStat:d,onChange:s}=this.props,g=r.AS.list(f);if(g.length!==f.length){const v=g.map(m=>m.id),x=(0,n.difference)(f,v);console.warn("Unknown stats",x,f),s(g.map(m=>m.id))}!h&&f.length>1&&(console.warn("Removing extra stat",f),s([f[0]])),d&&f.length<1&&s([d])},this.onSelectionChange=f=>{const{onChange:h}=this.props;Array.isArray(f)?h(f.map(d=>d.value)):h(f&&f.value?[f.value]:[])}}static{this.defaultProps={allowMultiple:!1}}componentDidMount(){this.checkInput()}componentDidUpdate(f){this.checkInput()}render(){const{stats:f,allowMultiple:h,defaultStat:d,placeholder:s,className:g,menuPlacement:v,width:x,inputId:m,filterOptions:p}=this.props,y=r.AS.selectOptions(f,p);return(0,t.jsx)(i.l6,{value:y.current,className:g,isClearable:!d,isMulti:h,width:x,isSearchable:!0,options:y.options,placeholder:s,onChange:this.onSelectionChange,menuPlacement:v,inputId:m})}}},21285(ne,A,e){"use strict";e.d(A,{K:()=>d,d:()=>h});var t=e(74848),n=e(22803),a=e(2543),c=e.n(a),r=e(96540),i=e(37615),o=e(63142),l=e(35484),f=e(30703);const h=(0,r.forwardRef)(({value:g,checked:v,onChange:x,id:m,label:p,disabled:y,invalid:E=!1,...b},u)=>{v&&(0,i.l)("Switch","checked prop","value");const D=(0,o.of)(s),P=(0,r.useRef)(m||(0,a.uniqueId)("switch-"));return(0,t.jsxs)("div",{className:(0,n.cx)(D.switch,E&&D.invalid),children:[(0,t.jsx)("input",{type:"checkbox",role:"switch",disabled:y,checked:g,onChange:C=>{!y&&x?.(C)},id:P.current,...b,ref:u}),(0,t.jsx)("label",{htmlFor:P.current,"aria-label":p,children:(0,t.jsx)(f.I,{name:"check",size:"xs"})})]})});h.displayName="Switch";const d=(0,r.forwardRef)(({transparent:g,className:v,showLabel:x,label:m,value:p,id:y,invalid:E,...b},u)=>{const D=(0,o.of)(s,g);return(0,t.jsxs)("div",{className:(0,n.cx)(D.inlineContainer,v,b.disabled&&D.disabled,E&&D.invalid),children:[x&&(0,t.jsx)("label",{htmlFor:y,className:(0,n.cx)(D.inlineLabel,p&&D.inlineLabelEnabled,"inline-switch-label"),children:m}),(0,t.jsx)(h,{...b,id:y,label:m,ref:u,value:p})]})});d.displayName="Switch";const s=(g,v)=>({switch:(0,n.css)({width:g.spacing(4),height:g.spacing(2),position:"relative",lineHeight:1,input:{height:"100%",width:"100% !important",opacity:0,zIndex:-1e3,position:"absolute","&:checked + label":{background:g.colors.primary.main,borderColor:g.colors.primary.main,"&:hover":{background:g.colors.primary.shade},svg:{transform:`translate3d(${g.spacing(2.25)}, -50%, 0)`,background:g.colors.primary.contrastText,color:g.colors.primary.main}},"&:disabled + label":{background:g.colors.action.disabledBackground,borderColor:g.colors.border.weak,cursor:"not-allowed",svg:{background:g.colors.text.disabled}},"&:disabled:checked + label":{background:g.colors.primary.transparent,svg:{color:g.colors.primary.contrastText}},"&:focus + label, &:focus-visible + label":(0,l.getFocusStyles)(g),"&:focus:not(:focus-visible) + label":(0,l.getMouseFocusStyles)(g)},label:{width:"100%",height:"100%",cursor:"pointer",borderRadius:g.shape.radius.pill,background:g.components.input.background,border:`1px solid ${g.components.input.borderColor}`,[g.transitions.handleMotion("no-preference")]:{transition:"all 0.3s ease"},"&:hover":{borderColor:g.components.input.borderHover},svg:{position:"absolute",display:"block",color:"transparent",width:g.spacing(1.5),height:g.spacing(1.5),borderRadius:g.shape.radius.circle,background:g.colors.text.secondary,boxShadow:g.shadows.z1,left:0,top:"50%",transform:`translate3d(${g.spacing(.25)}, -50%, 0)`,[g.transitions.handleMotion("no-preference")]:{transition:"transform 0.2s cubic-bezier(0.19, 1, 0.22, 1)"},"@media (forced-colors: active)":{border:`1px solid ${g.colors.primary.contrastText}`}}}}),inlineContainer:(0,n.css)({padding:g.spacing(0,1),height:g.spacing(g.components.height.md),display:"inline-flex",alignItems:"center",background:v?"transparent":g.components.input.background,border:`1px solid ${v?"transparent":g.components.input.borderColor}`,borderRadius:g.shape.radius.default,"&:hover":{border:`1px solid ${v?"transparent":g.components.input.borderHover}`,".inline-switch-label":{color:g.colors.text.primary}}}),disabled:(0,n.css)({backgroundColor:v?"transparent":"rgba(204, 204, 220, 0.04)",color:"rgba(204, 204, 220, 0.6)",border:`1px solid ${v?"transparent":"rgba(204, 204, 220, 0.04)"}`}),inlineLabel:(0,n.css)({cursor:"pointer",paddingRight:g.spacing(1),color:g.colors.text.secondary,whiteSpace:"nowrap"}),inlineLabelEnabled:(0,n.css)({color:g.colors.text.primary}),invalid:(0,n.css)({"input + label, input:checked + label, input:hover + label":{border:`1px solid ${g.colors.error.border}`}})})},64467(ne,A,e){"use strict";e.d(A,{q:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(76319),r=e(60208),i=e(13941),o=e(54314),l=e(63142),f=e(31286),h=e(92807);function d({tabs:g,defaultTab:v,closeIconTooltip:x,onClose:m,testId:p}){const[y,E]=(0,a.useState)(g.some(D=>D.value===v)?v:g[0].value),b=(0,l.of)(s),u=D=>{E(D.value)};return(0,t.jsxs)("div",{className:b.container,"data-testid":p,children:[(0,t.jsxs)(o.U,{className:b.tabs,children:[g.map(D=>(0,t.jsx)(r.o,{label:D.label,active:D.value===y,onChangeTab:()=>u(D),icon:D.icon},D.value)),(0,t.jsx)(f.a,{grow:1,display:"flex",justifyContent:"flex-end",paddingRight:1,children:(0,t.jsx)(c.K,{size:"lg",onClick:m,name:"times",tooltip:x??"Close"})})]}),(0,t.jsx)(h.P,{children:(0,t.jsx)(i.J,{className:b.tabContent,children:g.find(D=>D.value===y)?.content})})]})}const s=g=>({container:(0,n.css)({height:"100%",display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0}),tabContent:(0,n.css)({padding:g.spacing(2),backgroundColor:g.colors.background.primary,flex:1}),tabs:(0,n.css)({paddingTop:g.spacing(.5),borderColor:g.colors.border.weak,ul:{marginLeft:g.spacing(2)}})})},93948(ne,A,e){"use strict";e.d(A,{a:()=>g,t:()=>s});var t=e(74848),n=e(41119),a=e(79118),c=e(55386),r=e(95004),i=e(739),o=e(63142),l=e(53568),f=e(21539),h=e(53431),d=e(74198);const s={type:i.ob.Sparkline,drawStyle:i.GR.Line,lineInterpolation:i.dx.Smooth,lineWidth:1,fillOpacity:17,gradientMode:i.on.Hue,pointSize:2,barAlignment:i.Nj.Center,showPoints:i.yL.Never,hideValue:!1},g=m=>{const{field:p,innerWidth:y,tableStyles:E,cell:b,cellProps:u,timeRange:D}=m,P=v(b.value),C=(0,o.$j)();if(!P)return(0,t.jsx)("div",{...u,className:E.cellContainer,children:p.config.noValue||"no data"});P.x&&!P.x.config.interval&&P.x.values.length>1&&(P.x.config.interval=P.x.values[1]-P.x.values[0]),P.y.values=P.y.values.map(w=>Number.isFinite(w)?w:null);const S=(0,a.AP)(P.y);P.y.config.min=S.min,P.y.config.max=S.max,P.y.state={range:S},P.timeRange=D;const R=x(p),L={color:p.config.color,custom:{...s,...R}},j=p.config.custom?.cellOptions?.hideValue;let N=0,V=null;if(!j){const w=(0,n.LI)(b.value)?b.value.value:null,M=p.display(w),O=(0,d.zi)(p,M,b.row.index);N=(0,l.kD)((0,c.cN)(O),16).width+C.spacing.gridSize,V=(0,t.jsx)(f.i,{style:{width:`${N-C.spacing.gridSize}px`,textAlign:"right",marginRight:C.spacing(1)},value:M})}return(0,t.jsxs)("div",{...u,className:E.cellContainer,children:[V,(0,t.jsx)("div",{children:(0,t.jsx)(h.O,{width:y-N,height:E.cellHeightInner,sparkline:P,config:L,theme:E.theme})})]})};function v(m){if(Array.isArray(m))return{y:{name:"test",type:r.PU.number,values:m,config:{}}};if((0,n.ci)(m)){const p=m.fields.find(E=>E.type===r.PU.time),y=m.fields.find(E=>E.type===r.PU.number);if(p&&y)return{x:p,y}}}function x(m){let p=(0,d.bk)(m);if(p.type===i.ob.Auto&&(p={...p,type:i.ob.Sparkline}),p.type===i.ob.Sparkline)return p;throw new Error(`Expected options type ${i.ob.Sparkline} but got ${p.type}`)}},28533(ne,A,e){"use strict";e.d(A,{n:()=>n});var t=e(74848);const n=({cell:a,tableStyles:c,onCellFilterAdded:r,timeRange:i,userProps:o,frame:l,rowStyled:f,rowExpanded:h,textWrapped:d,height:s,getActions:g,replaceVariables:v,setInspectCell:x})=>{const m=a.getCellProps(),p=a.column.field;if(!p?.display)return null;if(m.style){m.style.wordBreak="break-word",m.style.minWidth=m.style.width;const b=a.column.justifyContent;b==="flex-end"&&!p.config.unit?(m.style.textAlign="right",m.style.direction="rtl",m.style.unicodeBidi="plaintext"):m.style.justifyContent=b}let y=(typeof a.column.width=="number"?a.column.width:24)-c.cellPadding*2;const E=g?g(l,p,a.row.index,v):[];return(0,t.jsx)(t.Fragment,{children:a.render("Cell",{field:p,tableStyles:c,onCellFilterAdded:r,cellProps:m,innerWidth:y,timeRange:i,userProps:o,frame:l,rowStyled:f,rowExpanded:h,textWrapped:d,height:s,actions:E,setInspectCell:x})})}},58738(ne,A,e){"use strict";e.d(A,{e:()=>d,h:()=>s});var t=e(74848),n=e(22803),a=e(83505),c=e(96540),r=e(51898),i=e(63142),o=e(76373),l=e(15245),f=e(39064),h=e(61048);const d=({links:v,actions:x,value:m,coords:p,onTooltipClose:y})=>{const E=(0,i.$j)(),b=(0,i.of)(g),u="right-start",D=(0,o.getPositioningMiddleware)(u),P=(0,c.useMemo)(()=>{const{clientX:w,clientY:M}=p;return{getBoundingClientRect(){return{width:0,height:0,x:w,y:M,top:M,left:w,right:w,bottom:M}}}},[p]),C=w=>{R.setFloating(w),R.setReference(P)},{context:S,refs:R,floatingStyles:L}=(0,a.we)({open:!0,placement:u,onOpenChange:y,middleware:D}),j=(0,a.s9)(S),{getFloatingProps:N,getReferenceProps:V}=(0,a.bv)([j]);return v.length===0&&!x?.length?null:(0,t.jsxs)(t.Fragment,{children:[m,(0,t.jsx)(l.ZL,{zIndex:E.zIndex.tooltip,children:(0,t.jsx)("div",{ref:C,...V(),...N(),style:L,className:b.tooltipWrapper,"data-testid":r.Tp.components.DataLinksActionsTooltip.tooltipWrapper,children:(0,t.jsx)(h.i,{children:(0,t.jsx)(f.S,{dataLinks:v,actions:x})})})})]})},s=(v,x,m)=>(0,t.jsx)("a",{href:v.href,onClick:v.onClick,target:v.target,title:v.title,"data-testid":r.Tp.components.DataLinksContextMenu.singleLink,className:m,children:x}),g=v=>({tooltipWrapper:(0,n.css)({whiteSpace:"pre",borderRadius:v.shape.radius.default,background:v.colors.background.primary,border:`1px solid ${v.colors.border.weak}`,boxShadow:v.shadows.z3,userSelect:"text",fontSize:v.typography.bodySmall.fontSize})})},64780(ne,A,e){"use strict";e.d(A,{B:()=>s,s:()=>g});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(47931),o=e(8207),l=e(41654),f=e(50992),h=e(60208),d=e(54314),s=(x=>(x.code="code",x.text="text",x))(s||{});function g({value:x,onDismiss:m,mode:p}){const[y,E]=(0,a.useState)(p),b=x.trim(),u=(0,r.of)(v),D=[{label:"Plain text",value:"text"},{label:"Code editor",value:"code"}],P=()=>{E(y==="text"?"code":"text")},C=(0,t.jsx)(d.U,{children:D.map((S,R)=>(0,t.jsx)(h.o,{label:S.label,active:S.value===y,onChangeTab:P},`${S.value}-${R}`))});return(0,t.jsx)(o._,{onClose:m,title:(0,c.t)("grafana-ui.table.inspect-drawer-title","Inspect value"),tabs:C,children:(0,t.jsxs)(l.B,{direction:"column",gap:2,children:[(0,t.jsx)(i.b,{icon:"copy",getText:()=>b,style:{marginLeft:"auto",width:"200px"},children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.table.copy",children:"Copy to Clipboard"})}),y==="code"?(0,t.jsx)(f.B,{width:"100%",height:500,language:"json",showLineNumbers:!0,showMiniMap:(b?b.length:0)>100,value:b,readOnly:!0,wordWrap:!0}):(0,t.jsx)("pre",{className:u.textContainer,children:b})]})})}const v=x=>({textContainer:(0,n.css)({color:x.colors.text.secondary,minHeight:42})})},74533(ne,A,e){"use strict";e.d(A,{u:()=>l,d:()=>h});var t=e(74848),n=e(96540),a=e(46644),c=e(51898),r=e(22803);const i=d=>{const s=(0,r.css)({width:"100%",listStyle:"none"}),g=(0,r.css)({width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between"});return d.value&&!Array.isArray(d.value)?(0,t.jsx)("span",{children:d.value}):d.value&&Array.isArray(d.value)&&d.value.length>0?(0,t.jsx)("ul",{className:s,children:d.value.map((v,x)=>{const m=Object.keys(v)[0];return(0,t.jsxs)("li",{className:g,children:[(0,t.jsx)("span",{children:m}),(0,t.jsx)("span",{children:v[m]})]},x)})}):o},o=()=>(0,t.jsx)("span",{children:"\xA0"});function l(d){const{totalColumnsWidth:s,footerGroups:g,isPaginationVisible:v,tableStyles:x}=d,m=c.Tp.components.Panels.Visualization.Table;return(0,t.jsx)("div",{style:{position:v?"relative":"absolute",width:s?`${s}px`:"100%",bottom:"0px"},children:g.map(p=>{const{key:y,...E}=p.getFooterGroupProps();return(0,n.createElement)("div",{className:x.tfoot,...E,key:y,"data-testid":m.footer},p.headers.map(b=>f(b,x)))})})}function f(d,s){const{key:g,...v}=d.getHeaderProps();return v?(v.style=v.style??{},v.style.position="absolute",v.style.justifyContent=d.justifyContent,(0,t.jsx)("div",{className:s.headerCell,...v,children:d.render("Footer")},g)):null}function h(d,s,g){if(s===void 0)return o;if(g){if(s[d]===void 0)return o;const v=a.AS.get(a.gy.count).name;return i({value:[{[v]:String(s[d])}]})}return i({value:s[d]})}},24343(ne,A,e){"use strict";e.d(A,{X:()=>be});var t=e(74848),n=e(96540),a=e(32885),c=e(46644),r=e(95004),i=e(17503),o=e(36638),l=e(51898),f=e(92745),h=e(739),d=e(63142),s=e(52718),g=e(34213),v=e(64780);function x(ze,Ne){(0,n.useEffect)(()=>{if(ze.current&&Ne.current){const Ie=ze.current.querySelector(".track-vertical"),ke=Ne.current.firstChild;ke&&Ie&&(Ie.remove(),ke instanceof HTMLElement&&(ke.querySelector(":scope > .track-vertical")?.remove(),ke.append(Ie)))}})}function m(ze,Ne,Ie,ke){const Ee=JSON.stringify(Object.keys(ze.expanded));(0,n.useEffect)(()=>{let Ae=0;ke||(Number.isFinite(ze.lastExpandedOrCollapsedIndex)&&(Ae=ze.lastExpandedOrCollapsedIndex),Ae=ze.pageIndex===0?Ae-1:Ae-ze.pageIndex-ze.pageIndex*ze.pageSize),Ne.current?.resetAfterIndex(Math.max(Ae,0))},[ze.lastExpandedOrCollapsedIndex,ze.pageSize,ze.pageIndex,Ne,Ie,Ee,ke])}var p=e(16515);function y({onColumnResize:ze,onSortByChange:Ne,data:Ie}){return(0,n.useCallback)((ke,Ee)=>{switch(Ee.type){case"columnDoneResizing":if(ze){const $e=ke.columnResizing?.headerIdWidths?.[0]?.[0],Fe=parseInt($e,10),We=Math.round(ke.columnResizing.columnWidths?.[$e]),Ge=Ie.fields?.[Fe];if(!Ge)return ke;const me=(0,p.Ct)(Ge,Ie);ze(me,We)}case"toggleSortBy":if(Ne){const Ae=[];for(const $e of ke.sortBy){const Fe=Ie.fields[parseInt($e.id,10)];Fe&&Ae.push({displayName:(0,p.Ct)(Fe,Ie),desc:$e.desc})}Ne(Ae)}case"toggleRowExpanded":if(Ee.id)return{...ke,lastExpandedOrCollapsedIndex:parseInt(Ee.id,10)}}return ke},[Ie,ze,Ne])}function E(ze,Ne){const Ie={};if(ze){Ie.sortBy=[];for(const ke of ze)for(const Ee of Ne)Ee.Header===ke.displayName&&Ie.sortBy.push({id:Ee.id,desc:ke.desc})}return Ie}var b=e(74198),u=e(74533),D=e(97958),P=e(30703),C=e(22803),S=e(2381),R=e(97222),L=e(55386),j=e(15356),N=e(12737),V=e(32635),w=e(72636),M=e(41654);const O=28,U=O*5,K={Contains:{label:"Contains",value:"Contains",description:"Contains"},"=":{label:"=",value:"=",description:"Equals"},"!=":{label:"!=",value:"!=",description:"Not equals"},">":{label:">",value:">",description:"Greater"},">=":{label:">=",value:">=",description:"Greater or Equal"},"<":{label:"<",value:"<",description:"Less"},"<=":{label:"<=",value:"<=",description:"Less or Equal"},Expression:{label:"Expression",value:"Expression",description:'Bool Expression (Char $ represents the column value in the expression, e.g. "$ >= 10 && $ <= 12")'}},z=Object.values(K),G=K.Contains,F=K.Expression,W=ze=>{if(ze=ze.trim().replace(/\\/g,""),/^(\d{4}-\d{2}-\d{2}|\d{4}\/\d{2}\/\d{2})/.test(ze)){const ke=new Date(ze);if(!isNaN(ke.getTime())){const Ee=(0,L.j_)("dateTimeAsIso");return(0,L.cN)(Ee(ke.getTime()))}}const Ne=parseFloat(ze);if(!isNaN(Ne))return Ne;const Ie=ze.toLowerCase();return Ie==="true"||Ie==="false"?Ie==="true":ze},H=({options:ze,values:Ne,caseSensitive:Ie,showOperators:ke,onChange:Ee,searchFilter:Ae,setSearchFilter:$e,operator:Fe,setOperator:We})=>{const Ge=(0,n.useMemo)(()=>new RegExp(Ae,Ie?void 0:"i"),[Ae,Ie]),me=(0,n.useMemo)(()=>ze.filter(qe=>{if(!ke||!Ae||Fe.value===G.value)return qe.label===void 0?!1:Ge.test(qe.label);if(Fe.value===F.value){if(qe.value===void 0)return!1;try{const nt=Ae.replace(/\\/g,""),ot=new Function("$",`'use strict'; return ${nt};`),Ze=W(qe.value);return ot(Ze)}catch{}return!1}else{if(qe.value===void 0)return!1;const nt=W(qe.value),ot=W(Ae);switch(Fe.value){case"=":return nt===ot;case"!=":return nt!==ot;case">":return nt>ot;case">=":return nt>=ot;case"<":return ntme.filter(qe=>Ne.includes(qe)),[me,Ne]),xe=(0,n.useMemo)(()=>me.length===De.length,[me,De]),Me=(0,n.useMemo)(()=>De.length>0&&me.length>De.length,[me,De]),Be=(0,n.useMemo)(()=>De.length?`${De.length} selected`:"Select all",[De]),Oe=(0,n.useMemo)(()=>me.length!==De.length?"Add all displayed values to the filter":"Remove all displayed values from the filter",[me,De]),Re=(0,d.of)(te),Ce=(0,d.$j)().spacing.gridSize,_e=(0,n.useMemo)(()=>Math.min(me.length*O,U)+Ce,[Ce,me.length]),Je=(0,n.useCallback)(qe=>nt=>{const ot=nt.currentTarget.checked?Ne.concat(qe):Ne.filter(Ze=>Ze.value!==qe.value);Ee(ot)},[Ee,Ne]),et=(0,n.useCallback)(()=>{if(me.length===De.length){const qe=Ne.filter(nt=>!me.includes(nt));Ee(qe)}else{const qe=[...new Set([...Ne,...me])];Ee(qe)}},[Ee,Ne,me,De]);return(0,t.jsxs)(M.B,{direction:"column",gap:.25,children:[!ke&&(0,t.jsx)(N.Z,{placeholder:(0,f.t)("grafana-ui.table.filter-placeholder","Filter values"),onChange:$e,value:Ae}),ke&&(0,t.jsxs)(M.B,{direction:"row",gap:0,children:[(0,t.jsx)(j.f,{variant:"canvas",options:z,onChange:We,value:Fe,tooltip:Fe.description}),(0,t.jsx)(N.Z,{placeholder:(0,f.t)("grafana-ui.table.filter-placeholder","Filter values"),onChange:$e,value:Ae})]}),me.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.Y1,{height:_e,itemCount:me.length,itemSize:O,itemData:{items:me,values:De,onCheckedChanged:Je,className:Re.filterListRow},width:"100%",className:Re.filterList,children:Y}),(0,t.jsxs)(M.B,{direction:"column",gap:.25,children:[(0,t.jsx)("div",{className:(0,C.cx)(Re.selectDivider)}),(0,t.jsx)("div",{className:(0,C.cx)(Re.filterListRow),children:(0,t.jsx)(V.S,{value:xe,indeterminate:Me,label:Be,description:Oe,onChange:et})})]})]}):(0,t.jsx)(w.J,{className:Re.noValuesLabel,children:(0,t.jsx)(f.x6,{i18nKey:"grafana-ui.table.no-values-label",children:"No values"})})]})};function Y({index:ze,style:Ne,data:{onCheckedChanged:Ie,items:ke,values:Ee,className:Ae}}){const $e=ke[ze],{value:Fe,label:We}=$e,Ge=Ee.find(me=>me.value===Fe)!==void 0;return(0,t.jsx)("div",{className:Ae,style:Ne,title:We,children:(0,t.jsx)(V.S,{value:Ge,label:We,onChange:Ie($e)})})}const te=ze=>({filterList:(0,C.css)({label:"filterList"}),filterListRow:(0,C.css)({label:"filterListRow",cursor:"pointer",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:ze.spacing(.5),":hover":{backgroundColor:ze.colors.action.hover}}),selectDivider:(0,C.css)({label:"selectDivider",width:"100%",borderTop:`1px solid ${ze.colors.border.medium}`,padding:ze.spacing(.5,2)}),noValuesLabel:(0,C.css)({paddingTop:ze.spacing(1)})});var Z=e(45861),se=e(8135),ae=e(76319);const J=({column:{preFilteredRows:ze,filterValue:Ne,setFilter:Ie},onClose:ke,field:Ee,searchFilter:Ae,setSearchFilter:$e,operator:Fe,setOperator:We})=>{const Ge=(0,d.$j)(),me=(0,n.useMemo)(()=>(0,b.MY)(ze,Ee),[ze,Ee]),De=(0,n.useMemo)(()=>(0,b.Yz)(me),[me]),xe=(0,n.useMemo)(()=>(0,b.Sj)(De,Ne),[De,Ne]),[Me,Be]=(0,n.useState)(xe),[Oe,Re]=(0,n.useState)(!1),we=(0,n.useCallback)(qe=>ke(),[ke]),Ce=(0,n.useCallback)(qe=>{const nt=Me.length?Me:void 0;Ie(nt),ke()},[Ie,Me,ke]),_e=(0,n.useCallback)(qe=>{Ie(void 0),ke()},[Ie,ke]),Je=(0,n.useMemo)(()=>Ne!==void 0,[Ne]),et=(0,d.of)(k);return(0,t.jsx)(se.N,{onClick:we,useCapture:!0,children:(0,t.jsx)("div",{className:(0,C.cx)(et.filterContainer),onClick:_,children:(0,t.jsxs)(M.B,{direction:"column",gap:3,children:[(0,t.jsxs)(M.B,{direction:"column",gap:.5,children:[(0,t.jsxs)(M.B,{justifyContent:"space-between",alignItems:"center",children:[(0,t.jsx)(w.J,{className:et.label,children:(0,t.jsx)(f.x6,{i18nKey:"grafana-ui.table.filter-popup-heading",children:"Filter by values:"})}),(0,t.jsx)(ae.K,{name:"text-fields",tooltip:(0,f.t)("grafana-ui.table.filter-popup-match-case","Match case"),style:{color:Oe?Ge.colors.text.link:Ge.colors.text.disabled},onClick:()=>{Re(qe=>!qe)}})]}),(0,t.jsx)("div",{className:(0,C.cx)(et.listDivider)}),(0,t.jsx)(H,{onChange:Be,values:Me,options:De,caseSensitive:Oe,showOperators:!0,searchFilter:Ae,setSearchFilter:$e,operator:Fe,setOperator:We})]}),(0,t.jsxs)(M.B,{gap:3,children:[(0,t.jsxs)(M.B,{children:[(0,t.jsx)(Z.$n,{size:"sm",onClick:Ce,children:(0,t.jsx)(f.x6,{i18nKey:"grafana-ui.table.filter-popup-apply",children:"Ok"})}),(0,t.jsx)(Z.$n,{size:"sm",variant:"secondary",onClick:we,children:(0,t.jsx)(f.x6,{i18nKey:"grafana-ui.table.filter-popup-cancel",children:"Cancel"})})]}),Je&&(0,t.jsx)(M.B,{children:(0,t.jsx)(Z.$n,{fill:"text",size:"sm",onClick:_e,children:(0,t.jsx)(f.x6,{i18nKey:"grafana-ui.table.filter-popup-clear",children:"Clear filter"})})})]})]})})})},k=ze=>({filterContainer:(0,C.css)({label:"filterContainer",width:"100%",minWidth:"250px",height:"100%",maxHeight:"400px",backgroundColor:ze.colors.background.primary,border:`1px solid ${ze.colors.border.weak}`,padding:ze.spacing(2),boxShadow:ze.shadows.z3,borderRadius:ze.shape.radius.default}),listDivider:(0,C.css)({label:"listDivider",width:"100%",borderTop:`1px solid ${ze.colors.border.medium}`,padding:ze.spacing(.5,2)}),label:(0,C.css)({marginBottom:0})}),_=ze=>{ze.stopPropagation()},Q=({column:ze,field:Ne,tableStyles:Ie})=>{const ke=(0,n.useRef)(null),[Ee,Ae]=(0,n.useState)(!1),$e=(0,d.of)(q),Fe=(0,n.useMemo)(()=>!!ze.filterValue,[ze.filterValue]),We=(0,n.useCallback)(()=>Ae(!0),[Ae]),Ge=(0,n.useCallback)(()=>Ae(!1),[Ae]),[me,De]=(0,n.useState)(""),[xe,Me]=(0,n.useState)(G);return!Ne||!Ne.config.custom?.filterable?null:(0,t.jsxs)("button",{className:(0,C.cx)(Ie.headerFilter,Fe?$e.filterIconEnabled:$e.filterIconDisabled),ref:ke,type:"button",onClick:We,children:[(0,t.jsx)(P.I,{name:"filter"}),Ee&&ke.current&&(0,t.jsx)(S.A,{content:(0,t.jsx)(J,{column:ze,tableStyles:Ie,field:Ne,onClose:Ge,searchFilter:me,setSearchFilter:De,operator:xe,setOperator:Me}),placement:"bottom-start",referenceElement:ke.current,show:!0})]})},q=ze=>({filterIconEnabled:(0,C.css)({label:"filterIconEnabled",color:ze.colors.primary.text}),filterIconDisabled:(0,C.css)({label:"filterIconDisabled",color:ze.colors.text.disabled})}),oe=ze=>{const{headerGroups:Ne,showTypeIcons:Ie,tableStyles:ke}=ze,Ee=l.Tp.components.Panels.Visualization.Table;return(0,t.jsx)("div",{role:"rowgroup",className:ke.headerRow,children:Ne.map(Ae=>{const{key:$e,...Fe}=Ae.getHeaderGroupProps();return(0,n.createElement)("div",{className:ke.thead,...Fe,key:$e,"aria-label":Ee.header,role:"row"},Ae.headers.map((We,Ge)=>re(We,ke,Ie)))})})};function re(ze,Ne,Ie){const{key:ke,...Ee}=ze.getHeaderProps(),Ae=ze.field??null,$e=Ae?.config.custom;ze.canResize&&(Ee.style.userSelect=ze.isResizing?"none":"auto"),Ee.style.position="absolute",Ee.style.justifyContent=ze.justifyContent,Ee.style.left=ze.totalLeft;let Fe=ze.render("Header"),We=ze.canSort&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{...ze.getSortByToggleProps(),className:Ne.headerCellLabel,children:[Ie&&(0,t.jsx)(P.I,{name:(0,D.SS)(Ae),title:Ae?.type,size:"sm",className:Ne.typeIcon}),(0,t.jsx)("div",{children:Fe}),ze.isSorted&&(ze.isSortedDesc?(0,t.jsx)(P.I,{size:"lg",name:"arrow-down",className:Ne.sortIcon}):(0,t.jsx)(P.I,{name:"arrow-up",size:"lg",className:Ne.sortIcon}))]}),ze.canFilter&&(0,t.jsx)(Q,{column:ze,tableStyles:Ne,field:Ae})]});return We&&$e?.headerComponent?We=(0,t.jsx)($e.headerComponent,{field:Ae,defaultContent:We}):$e?.headerComponent&&(Fe=(0,t.jsx)($e.headerComponent,{field:Ae,defaultContent:Fe})),(0,t.jsxs)("div",{className:Ne.headerCell,...Ee,role:"columnheader",children:[ze.canSort&&We,!ze.canSort&&Fe,!ze.canSort&&ze.canFilter&&(0,t.jsx)(Q,{column:ze,tableStyles:Ne,field:Ae}),ze.canResize&&(0,t.jsx)("div",{...ze.getResizerProps(),className:Ne.resizeHandle})]},ke)}var ee=e(64423),B=e(56978),ie=e(57852),de=e(64400),fe=e(28533);function ce({tableStyles:ze,nestedData:Ne,rowIndex:Ie,width:ke,cellHeight:Ee}){const Ae=Ne.values,$e=[],Fe=(0,d.$j)(),We=(0,d.of)(ve);let Ge=ze.rowHeight+Fe.spacing.gridSize;return Ae[Ie].forEach((me,De)=>{const xe=!!me.meta?.custom?.noHeader,Me=ze.rowHeight*(me.length+(xe?0:1)),Be={height:Me,paddingLeft:b.jV,position:"absolute",top:Ge,backgroundColor:Fe.colors.background.primary,color:Fe.colors.text.primary};Ge+=Me+Fe.spacing.gridSize,$e.push((0,t.jsx)("div",{style:Be,children:(0,t.jsx)(be,{data:me,width:ke-b.jV,height:ze.rowHeight*(me.length+1),noHeader:xe,cellHeight:Ee})},`subTable_${Ie}_${De}`))}),(0,t.jsx)("div",{className:We.subTables,children:$e})}const ve=ze=>({subTables:(0,C.css)({"&:before":{content:'""',position:"absolute",width:"1px",top:ze.spacing(5),left:ze.spacing(1),bottom:ze.spacing(2),background:ze.colors.border.medium}})});function Se(ze,Ne,Ie){return ze.values[Ne].reduce((Ae,$e)=>{if($e.length){const Fe=!!$e.meta?.custom?.noHeader;return Ae+Ie.rowHeight*($e.length+(Fe?0:1))+8}return Ae},Ie.rowHeight)??Ie.rowHeight}const je=ze=>{const{data:Ne,rows:Ie,headerHeight:ke,footerPaginationEnabled:Ee,rowHeight:Ae,itemCount:$e,pageIndex:Fe,tableState:We,prepareRow:Ge,onCellFilterAdded:me,width:De,cellHeight:xe=h.qM.Sm,timeRange:Me,tableStyles:Be,nestedDataField:Oe,listHeight:Re,listRef:we,enableSharedCrosshair:Ce=!1,initialRowIndex:_e=void 0,headerGroups:Je,longestField:et,textWrapField:qe,getActions:nt,replaceVariables:ot,setInspectCell:Ze}=ze,[at,it]=(0,n.useState)(_e);_e===void 0&&at!==void 0&&it(void 0);const ct=(0,d.$j)(),xt=(0,de.d2)();let dt=null;window.OffscreenCanvas!==void 0&&(dt=new OffscreenCanvas(256,1024).getContext("2d")),dt!=null&&(dt.font=`${ct.typography.fontSize}px ${ct.typography.body.fontFamily}`);const vt=(0,n.useMemo)(()=>{const mt=Ne.fields.find(Ct=>Ct.type===r.PU.time);return mt?(0,b.HY)(mt):0},[Ne]),wt=(0,n.useCallback)((mt,Ct)=>{if(!xt||!Ce)return;const Ye=Ct.fields.find(Dt=>Dt.type===r.PU.time);Ye&&xt.eventBus.publish(new ie.b_({point:{time:Ye.values[mt]}}))},[Ce,xt]),$t=(0,n.useCallback)(()=>{!xt||!Ce||xt.eventBus.publish(new ie.ql)},[Ce,xt]),_t=(0,n.useCallback)(mt=>{if(mt.payload.point?.time&&mt.payload.rowIndex!==void 0){const Ct=Ne.fields.find(Gt=>Gt.type===r.PU.time),Ye=Ct.values[mt.payload.rowIndex],Dt=mt.payload.point.time;if((0,b.Iy)(Dt,Ye,vt)){it(mt.payload.rowIndex);return}const Lt=Ct.values.findIndex(Gt=>(0,b.Iy)(Dt,Gt,vt));if(Lt!==-1){it(Lt);return}it(void 0)}},[Ne.fields,vt]);(0,n.useEffect)(()=>{if(!xt||!Ce||!(0,i.S1)(Ne)||Ee)return;const mt=new ee.yU;return mt.add(xt.eventBus.getStream(ie.b_).pipe((0,B.B)(250)).subscribe({next:Ct=>{xt.eventBus!==Ct.origin&&_t(Ct)}})),mt.add(xt.eventBus.getStream(ie.ql).pipe((0,B.B)(250)).subscribe({next:Ct=>{xt.eventBus!==Ct.origin&&it(void 0)}})),()=>{mt.unsubscribe()}},[Ne,Ce,Ee,_t,xt]);let tn;if(at!==void 0){const mt=Ie.findIndex(Ct=>Ct.index===at);mt!==-1&&(tn=ke+(mt-1)*Ae)}const gt=(0,n.useCallback)(mt=>We.pageIndex*We.pageSize+mt,[We.pageIndex,We.pageSize]);let Wt,Xt;for(const mt of Ne.fields){const Ct=mt.config.custom;Ct!==void 0&&Ct.cellOptions!==void 0&&Ct.cellOptions.type===h.ob.ColorBackground&&Ct.cellOptions.applyToRow&&(Wt=Dt=>{const Lt=mt.display(mt.values.get(Dt));return(0,b.HW)(Be.theme,Ct.cellOptions,Lt)}),qe!==void 0?Xt=qe:et!==void 0&&(Xt=et)}const dn=(0,n.useCallback)(({index:mt,style:Ct,rowHighlightIndex:Ye})=>{const Dt=gt(mt),Lt=Ie[Dt];let Gt={};Ge(Lt);const qt=We.expanded[Lt.id]?(0,C.css)({"&:hover":{background:"inherit"}}):{},on=Oe&&We.expanded[Lt.id];if(Ye!==void 0&&Lt.index===Ye&&(Ct={...Ct,backgroundColor:ct.components.table.rowSelected},Gt={"aria-selected":"true"}),Wt){const{bgColor:oa,textColor:la}=Wt(Lt.index);Ct.background=oa,Ct.color=la,Ct.borderLeft=`2px solid ${oa}`}if(Xt){const la=Ne.fields.filter(Gn=>!Gn.config.custom?.hidden).findIndex(Gn=>Gn.name===Xt.name),ca=ct.typography.body.lineHeight*ct.typography.fontSize,Zn=(0,b.M2)(Xt.values[Lt.index],Je[0].headers[la],dt,ca,Be.rowHeight,Be.cellPadding);Ct.height=Zn.height}const{key:Pn,...Sn}=Lt.getRowProps({style:Ct,...Gt});return(0,t.jsxs)("div",{...Sn,className:(0,C.cx)(Be.row,qt),onMouseEnter:()=>wt(Lt.index,Ne),onMouseLeave:$t,children:[on&&(0,t.jsx)(ce,{nestedData:Oe,tableStyles:Be,rowIndex:Lt.index,width:De,cellHeight:xe}),Lt.cells.map((oa,la)=>(0,t.jsx)(fe.n,{tableStyles:Be,cell:oa,onCellFilterAdded:me,columnIndex:la,columnCount:Lt.cells.length,timeRange:Me,frame:Ne,rowStyled:Wt!==void 0,rowExpanded:on,textWrapped:Xt!==void 0,height:Number(Ct.height)-1,getActions:nt,replaceVariables:ot,setInspectCell:Ze},la))]},Pn)},[gt,Ie,Ge,We.expanded,Oe,Wt,Xt,Be,$t,De,xe,ct.components.table.rowSelected,ct.typography.body.lineHeight,ct.typography.fontSize,Ne,Je,dt,wt,me,Me,nt,ot,Ze]),rt=mt=>{const Ct=gt(mt),Ye=Ie[Ct];if(We.expanded[Ye.id]&&Oe)return Se(Oe,Ye.index,Be);if(Xt){const Lt=Ne.fields.filter(qt=>!qt.config.custom?.hidden).findIndex(qt=>qt.name===Xt.name),Gt=ct.typography.fontSize*ct.typography.body.lineHeight;return(0,b.M2)(Xt.values[Ye.index],Je[0].headers[Lt],dt,Gt,Be.rowHeight,Be.cellPadding).height}return Be.rowHeight},pt=mt=>{const{scrollTop:Ct}=mt.currentTarget;we.current!==null&&we.current.scrollTo(Ct)};return(0,n.useEffect)(()=>{we.current&&we.current.resetAfterIndex(0)},[Ie,we]),(0,t.jsx)(s.A,{onScroll:pt,hideHorizontalTrack:!0,scrollTop:tn,children:(0,t.jsx)(R._m,{height:Re,itemCount:$e,itemSize:rt,width:"100%",ref:we,style:{overflow:void 0},children:({index:mt,style:Ct})=>dn({index:mt,style:Ct,rowHighlightIndex:at})},`${Ae}${Fe}`)})};var Ve=e(59692);const he=150,Ue=36,pe="No data",be=(0,n.memo)(ze=>{const{ariaLabel:Ne,data:Ie,height:ke,onCellFilterAdded:Ee,onColumnResize:Ae,width:$e,columnMinWidth:Fe=he,noHeader:We,resizable:Ge=!0,initialSortBy:me,footerOptions:De,showTypeIcons:xe,footerValues:Me,enablePagination:Be,cellHeight:Oe=h.qM.Sm,timeRange:Re,enableSharedCrosshair:we=!1,initialRowIndex:Ce=void 0,fieldConfig:_e,getActions:Je,replaceVariables:et}=ze,qe=(0,n.useRef)(null),nt=(0,n.useRef)(null),ot=(0,n.useRef)(null),Ze=(0,d.$j)(),at=(0,Ve.k)(Ze,Oe),it=We?0:at.rowHeight,[ct,xt]=(0,n.useState)(Me),dt=_e?.defaults?.noValue??pe,[vt,wt]=(0,n.useState)(null),$t=(0,n.useMemo)(()=>{const _n=Ue;let La=0;if(!ct)return 0;for(const ga of ct)Array.isArray(ga)&&ga.length>La&&(La=ga.length);return La>1?_n*La:_n},[ct]),_t=(0,n.useMemo)(()=>Ie.fields.length?Array(Ie.length).fill(0):[],[Ie]),tn=!!(De?.countRows&&De.reducer&&De.reducer.length&&De.reducer[0]===c.gy.count),gt=Ie.fields.find(_n=>_n.type===r.PU.nestedFrames),Wt=gt!==void 0,Xt=(0,n.useMemo)(()=>(0,b.GH)(Ie,$e,Fe,Wt,ct,tn),[Ie,$e,Fe,Wt,ct,tn]),dn=(0,n.useRef)(),rt=y({onColumnResize:Ae,onSortByChange:_n=>{dn.current(!1),ze.onSortByChange&&ze.onSortByChange(_n)},data:Ie}),pt=!!Ie.meta?.uniqueRowIdFields?.length,mt=(0,n.useMemo)(()=>{const _n={columns:Xt,data:_t,disableResizing:!Ge,stateReducer:rt,autoResetPage:!1,initialState:E(me,Xt),autoResetFilters:!1,sortTypes:{number:b.Ok,"alphanumeric-insensitive":b.IM}};return pt&&(_n.getRowId=(La,ga)=>(0,i.t9)(Ie,ga),_n.autoResetExpanded=!1),_n},[me,Xt,_t,Ge,rt,pt,Ie]),{getTableProps:Ct,headerGroups:Ye,footerGroups:Dt,rows:Lt,prepareRow:Gt,totalColumnsWidth:qt,page:on,state:Pn,gotoPage:Sn,setPageSize:oa,pageOptions:la,toggleAllRowsExpanded:ca}=(0,a.useTable)(mt,a.useFilters,a.useSortBy,a.useAbsoluteLayout,a.useResizeColumns,a.useExpanded,a.usePagination),Zn=Pn;dn.current=ca,(0,n.useEffect)(()=>{De||xt(Me)},[Me,De]),(0,n.useEffect)(()=>{if(!De)return;if(!De.show){xt(void 0);return}if(tn){const La=[];La[0]=Lt.length.toString()??Ie.length.toString(),xt(La);return}const _n=(0,b.Ux)(Ye[0].headers,(0,b.XX)(Lt),De,Ze);xt(_n)},[De,Ze,Pn.filters,Ie]);let Gn=ke-(it+$t);Be&&(Gn-=at.cellHeight);const sa=Math.round(Gn/at.rowHeight)-1;(0,n.useEffect)(()=>{sa<=0||oa(sa)},[sa,oa]),(0,n.useEffect)(()=>{Ie.length/sa{Sn(_n-1)},[Sn]),da=Be?on.length:Lt.length;let os=null;if(Be){const _n=Pn.pageIndex*Pn.pageSize+1;let La=_n+Pn.pageSize-1;const ga=$e<550;La>Ie.length&&(La=Ie.length);const Fa=Lt.length,Sa=La{_e.overrides.forEach(La=>{if((0,o.NS)(La.matcher)(_n,Ie,[Ie]))for(const Fa of La.properties)Fa.id==="custom.cellOptions"&&Fa.value.wrapText&&(Ha=_n)})}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{...Ct(),className:at.table,"aria-label":Ne,role:"table",ref:nt,style:{width:$e,height:ke},children:[(0,t.jsx)(s.E,{hideVerticalTrack:!0,children:(0,t.jsxs)("div",{className:at.tableContentWrapper(qt),children:[!We&&(0,t.jsx)(oe,{headerGroups:Ye,showTypeIcons:xe,tableStyles:at}),da>0?(0,t.jsx)("div",{"data-testid":l.Tp.components.Panels.Visualization.Table.body,ref:ot,children:(0,t.jsx)(je,{headerGroups:Ye,data:Ie,rows:Lt,width:$e,cellHeight:Oe,headerHeight:it,rowHeight:at.rowHeight,itemCount:da,pageIndex:Pn.pageIndex,listHeight:Gn,listRef:qe,tableState:Pn,prepareRow:Gt,timeRange:Re,onCellFilterAdded:Ee,nestedDataField:gt,tableStyles:at,footerPaginationEnabled:!!Be,enableSharedCrosshair:we,initialRowIndex:Ce,longestField:qn,textWrapField:Ha,getActions:Je,replaceVariables:et,setInspectCell:wt})}):(0,t.jsx)("div",{style:{height:ke-it,width:$e},className:at.noData,children:dt}),ct&&(0,t.jsx)(u.u,{isPaginationVisible:!!Be,footerValues:ct,footerGroups:Dt,totalColumnsWidth:qt,tableStyles:at})]})}),os]}),vt!==null&&(0,t.jsx)(v.s,{mode:vt.mode,value:vt.value,onDismiss:()=>{wt(null)}})]})});be.displayName="Table"},59692(ne,A,e){"use strict";e.d(A,{k:()=>n});var t=e(22803);function n(c,r){const i=c.colors.border.weak,o=c.colors.primary.border,l=6,f=a(c,r,l),h=f+2,d=28,s=(g,v,x,m,p,y,E,b,u)=>(0,t.css)({label:m?"cellContainerOverflow":"cellContainerNoOverflow",padding:`${l}px`,width:"100%",height:u?"auto !important":`${h-1}px`,wordBreak:E?"break-all":"inherit",display:"flex",...p?{overflow:"hidden",textOverflow:"ellipsis",userSelect:"text",whiteSpace:"nowrap"}:{},alignItems:"center",borderRight:`1px solid ${i}`,color:b?"inherit":g??void 0,background:b?void 0:v??void 0,backgroundClip:"padding-box","&:last-child:not(:only-child)":{borderRight:"none"},"&:hover":{overflow:m&&!E?"visible":void 0,width:y||!m?"auto":"auto !important",height:(y||m)&&!E?"auto !important":`${h-1}px`,minHeight:`${h-1}px`,wordBreak:y?"break-word":void 0,whiteSpace:y&&m?"normal":"nowrap",boxShadow:m?`0 0 2px ${c.colors.primary.main}`:void 0,background:b?"inherit":x??c.colors.background.primary,zIndex:1,".cellActions":{background:c.components.tooltip.background,color:c.components.tooltip.text,visibility:"visible",opacity:1,width:"auto",borderRadius:c.shape.radius.default}},a:{color:"inherit"},".cellActions":{display:"flex",position:m?void 0:"absolute",top:m?void 0:"1px",right:m?void 0:0,margin:m?c.spacing(0,0,0,1):"auto",visibility:"hidden",opacity:0,width:0,alignItems:"center",height:"100%",padding:c.spacing(.5,0,.5,.5),background:c.components.tooltip.background,color:c.components.tooltip.text},".cellActionsLeft":{right:"auto !important",left:0}});return{theme:c,cellHeight:f,buildCellContainerStyle:s,cellPadding:l,cellHeightInner:f-l*2,rowHeight:h,table:(0,t.css)({height:"100%",width:"100%",overflow:"auto",display:"flex",flexDirection:"column"}),thead:(0,t.css)({label:"thead",height:`${d}px`,overflowY:"auto",overflowX:"hidden",position:"relative"}),tfoot:(0,t.css)({label:"tfoot",height:`${d}px`,borderTop:`1px solid ${i}`,overflowY:"auto",overflowX:"hidden",position:"relative"}),headerRow:(0,t.css)({label:"row",borderBottom:`1px solid ${i}`}),headerCell:(0,t.css)({height:"100%",padding:`0 ${l}px`,overflow:"hidden",whiteSpace:"nowrap",display:"flex",alignItems:"center",fontWeight:c.typography.fontWeightMedium,"&:last-child":{borderRight:"none"}}),headerCellLabel:(0,t.css)({border:"none",padding:0,background:"inherit",cursor:"pointer",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:c.typography.fontWeightMedium,display:"flex",alignItems:"center",marginRight:c.spacing(.5),"&:hover":{textDecoration:"underline",color:c.colors.text.link}}),cellContainerText:s(void 0,void 0,void 0,!0,!0),cellContainerTextNoOverflow:s(void 0,void 0,void 0,!1,!0),cellContainer:s(void 0,void 0,void 0,!0,!1),cellContainerNoOverflow:s(void 0,void 0,void 0,!1,!1),cellText:(0,t.css)({overflow:"hidden",textOverflow:"ellipsis",userSelect:"text",whiteSpace:"nowrap",cursor:"text"}),sortIcon:(0,t.css)({marginLeft:c.spacing(.5)}),cellLink:(0,t.css)({cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",userSelect:"text",whiteSpace:"nowrap",color:`${c.colors.text.link} !important`,fontWeight:c.typography.fontWeightMedium,paddingRight:c.spacing(1.5),"&:hover":{textDecoration:"underline",color:c.colors.text.link}}),cellLinkEmpty:(0,t.css)({overflow:"hidden",textOverflow:"ellipsis",userSelect:"text",whiteSpace:"nowrap",fontWeight:c.typography.fontWeightMedium,paddingRight:c.spacing(1.5)}),cellLinkForColoredCell:(0,t.css)({cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",userSelect:"text",whiteSpace:"nowrap",fontWeight:c.typography.fontWeightMedium,textDecoration:"underline"}),imageCellLink:(0,t.css)({cursor:"pointer",overflow:"hidden",height:"100%"}),headerFilter:(0,t.css)({background:"transparent",border:"none",label:"headerFilter",padding:0}),paginationWrapper:(0,t.css)({display:"flex",height:`${f}px`,justifyContent:"center",alignItems:"center",width:"100%",li:{marginBottom:0}}),paginationSummary:(0,t.css)({color:c.colors.text.secondary,fontSize:c.typography.bodySmall.fontSize,display:"flex",justifyContent:"flex-end",padding:c.spacing(0,1,0,2)}),tableContentWrapper:g=>{const v=g!==void 0?`${g}px`:"100%";return(0,t.css)({label:"tableContentWrapper",width:v,display:"flex",flexDirection:"column"})},row:(0,t.css)({label:"row",borderBottom:`1px solid ${i}`,"&:hover":{backgroundColor:c.components.table.rowHoverBackground},"&:last-child":{borderBottom:0}}),imageCell:(0,t.css)({height:"100%"}),resizeHandle:(0,t.css)({label:"resizeHandle",cursor:"col-resize !important",display:"inline-block",background:o,opacity:0,[c.transitions.handleMotion("no-preference","reduce")]:{transition:"opacity 0.2s ease-in-out"},width:"8px",height:"100%",position:"absolute",right:"-4px",borderRadius:c.shape.radius.default,top:0,touchAction:"none","&:hover":{opacity:1}}),typeIcon:(0,t.css)({marginRight:c.spacing(1),color:c.colors.text.secondary}),noData:(0,t.css)({alignItems:"center",display:"flex",height:"100%",justifyContent:"center",width:"100%"}),expanderCell:(0,t.css)({display:"flex",flexDirection:"column",justifyContent:"center",height:`${h}px`,cursor:"pointer"})}}function a(c,r,i){const o=c.typography.fontSize,l=c.typography.body.lineHeight;switch(r){case"md":return 42;case"lg":return 48;case"sm":default:return i*2+o*l}}},36100(ne,A,e){"use strict";e.d(A,{Zi:()=>n,mc:()=>t});const t="=",n="!="},74198(ne,A,e){"use strict";e.d(A,{jV:()=>Q,HY:()=>Ee,MY:()=>B,XX:()=>Ue,zi:()=>Ie,HW:()=>Ae,bk:()=>be,GH:()=>oe,tJ:()=>We,Sj:()=>ce,Ux:()=>Ve,j1:()=>q,O4:()=>Fe,M2:()=>$e,Iy:()=>ke,o7:()=>ze,IM:()=>ve,Ok:()=>Se,nR:()=>me,Yz:()=>de});var t=e(2543),n=e(47078),a=e.n(n),c=e(84140),r=e(95004),i=e(16515),o=e(41119),l=e(17503),f=e(55386),h=e(46644),d=e(11576),s=e(739),g=e(8255),v=e(74848),x=e(22803),m=e(63142),p=e(31210);const y=De=>{const{cellProps:xe,tableStyles:Me,actions:Be}=De,Oe=(0,m.of)(E);return(0,v.jsx)("div",{...xe,className:(0,x.cx)(Me.cellContainerText,Oe.buttonsGap),children:Be&&Be.map((Re,we)=>(0,v.jsx)(p.r,{action:Re,variant:"secondary"},we))})},E=De=>({buttonsGap:(0,x.css)({gap:6})});var b=e(96540),u=e(33553),D=e(79118),P=e(38919),C=e(98005),S=e(58738);const R={mode:u.O.Absolute,steps:[{color:"blue",value:-1/0},{color:"green",value:20}]},L=De=>{const{field:xe,innerWidth:Me,tableStyles:Be,cell:Oe,cellProps:Re,row:we}=De,Ce=xe.display(Oe.value),_e=be(xe);let Je=(0,D.xg)(xe,!1);Je.thresholds||(Je={...Je,thresholds:R});let et=s.eX.Gradient,qe;_e.type===s.ob.Gauge&&(et=_e.mode??s.eX.Gradient,qe=_e.valueDisplayMode!==void 0?_e.valueDisplayMode:s.$l.Text);const nt=()=>(0,t.isFunction)(xe.getLinks)?xe.getLinks({valueRowIndex:we.index}):[],ot=Ie(xe,Ce,Oe.row.index),Ze=()=>(0,v.jsx)(C.xE,{width:Me,height:Be.cellHeightInner,field:Je,display:xe.display,text:{valueSize:14},value:Ce,orientation:P.wV.Horizontal,theme:Be.theme,alignmentFactors:ot,itemSpacing:1,lcdCellWidth:8,displayMode:et,valueDisplayMode:qe}),[at,it]=(0,b.useState)(),{shouldShowLink:ct,hasMultipleLinksOrActions:xt}=We(nt()),dt=xt&&at!==void 0,vt=nt();return(0,v.jsx)("div",{...Re,className:Be.cellContainer,style:{...Re.style,cursor:xt?"context-menu":"auto"},onClick:({clientX:wt,clientY:$t})=>{it({clientX:wt,clientY:$t})},children:ct?(0,S.h)(vt[0],Ze()):dt?(0,v.jsx)(S.e,{links:vt,value:Ze(),coords:at,onTooltipClose:()=>it(void 0)}):Ze()})};var j=e(86059);const N=De=>{const{field:xe,row:Me,cellProps:Be,tableStyles:Oe}=De,Re=(0,j.k)(xe,Me);return(0,v.jsx)("div",{...Be,className:Oe.cellContainerText,children:Re?.map((we,Ce)=>!we.href&&we.onClick==null?(0,v.jsx)("span",{className:Oe.cellLinkEmpty,children:we.title},Ce):(0,v.jsx)("span",{className:Oe.cellLink,onClick:we.onClick,children:(0,v.jsx)("a",{href:we.href,target:we.target,children:we.title})},Ce))})};var V=e(92745),w=e(76319),M=e(41654),O=e(36100);function U({field:De,cell:xe,previewMode:Me,showFilters:Be,onCellFilterAdded:Oe,setInspectCell:Re}){const we=q(De)==="flex-end",Ce=!!De.config.custom?.inspect,_e={size:"sm",tooltipPlacement:"top"},Je=(0,b.useCallback)(qe=>{Oe&&Oe({key:De.name,operator:O.mc,value:xe.value})},[xe,De,Oe]),et=(0,b.useCallback)(qe=>{Oe&&Oe({key:De.name,operator:O.Zi,value:xe.value})},[xe,De,Oe]);return(0,v.jsx)("div",{className:`cellActions${we?" cellActionsLeft":""}`,children:(0,v.jsxs)(M.B,{gap:.5,children:[Ce&&(0,v.jsx)(w.K,{name:"eye",tooltip:(0,V.t)("grafana-ui.table.cell-inspect","Inspect value"),onClick:()=>{Re&&Re({value:xe.value,mode:Me})},..._e}),Be&&(0,v.jsx)(w.K,{name:"search-plus",onClick:Je,tooltip:(0,V.t)("grafana-ui.table.cell-filter-on","Filter for value"),..._e}),Be&&(0,v.jsx)(w.K,{name:"search-minus",onClick:et,tooltip:(0,V.t)("grafana-ui.table.cell-filter-out","Filter out value"),..._e})]})})}var K=e(64780);const z=De=>{const{field:xe,cell:Me,tableStyles:Be,row:Oe,cellProps:Re,frame:we,rowStyled:Ce,rowExpanded:_e,textWrapped:Je,height:et}=De,qe=!!xe.config.custom?.inspect,nt=xe.display(Me.value),ot=De.onCellFilterAdded&&xe.config.filterable,Ze=ot&&Me.value!==void 0||qe,at=be(xe);let it;const ct=140;if(at.type===s.ob.Custom){const rt=at.cellComponent;it=(0,v.jsx)(rt,{field:xe,value:Me.value,rowIndex:Oe.index,frame:we})}else b.isValidElement(Me.value)?it=Me.value:it=(0,f.cN)(nt);const xt=typeof it=="string",dt=nt.text.length<=ct&&/\s/.test(nt.text),vt=F(Be,at,nt,qe,xt,dt,Je,Ce,_e);if(xt){let rt=Re.style?.justifyContent;rt==="flex-end"?Re.style={...Re.style,textAlign:"right"}:rt==="center"&&(Re.style={...Re.style,textAlign:"center"})}et&&(Re.style={...Re.style,height:et}),Je&&(Re.style={...Re.style,textWrap:"wrap"});const{key:wt,...$t}=Re,_t=(0,j.k)(xe,Oe)||[],[tn,gt]=(0,b.useState)(),{shouldShowLink:Wt,hasMultipleLinksOrActions:Xt}=We(_t),dn=Xt&&tn!==void 0;return(0,v.jsxs)("div",{...$t,className:vt,style:{...Re.style,cursor:Xt?"context-menu":"auto"},onClick:me(gt),children:[Wt?(0,S.h)(_t[0],it,G(Be,at)):dn?(0,v.jsx)(S.e,{links:_t,value:it,coords:tn,onTooltipClose:()=>gt(void 0)}):xt?`${it}`:(0,v.jsx)("div",{className:Be.cellText,children:it}),Ze&&(0,v.jsx)(U,{...De,previewMode:K.B.text,showFilters:ot})]},wt)},G=(De,xe)=>xe.type===s.ob.Auto?De.cellLink:De.cellLinkForColoredCell;function F(De,xe,Me,Be=!1,Oe=!1,Re=!1,we=!1,Ce=!1,_e=!1){let Je,et,qe;const nt=Ae(De.theme,xe,Me);return Je=nt.textColor,et=nt.bgColor,qe=nt.bgHoverColor,De.buildCellContainerStyle(Je,et,qe,!Be,Oe,Re,we,Ce,_e)}var W=e(64136),H=e(27430);function Y(De){const{cell:xe,tableStyles:Me,cellProps:Be}=De;let Oe="";return xe.value instanceof H.A?Oe=new W.A().writeGeometry(xe.value,{featureProjection:"EPSG:3857",dataProjection:"EPSG:4326"}):xe.value!=null&&(Oe=`${xe.value}`),(0,v.jsx)("div",{...Be,className:Me.cellContainer,children:(0,v.jsx)("div",{className:Me.cellText,style:{fontFamily:"monospace"},children:Oe})})}const te=10,Z=De=>{const{field:xe,cell:Me,tableStyles:Be,row:Oe,cellProps:Re}=De,we=be(xe),{title:Ce,alt:_e}=we.type===s.ob.Image?we:{title:void 0,alt:void 0},Je=xe.display(Me.value),et=(0,j.k)(xe,Oe)||[],[qe,nt]=(0,b.useState)(),{shouldShowLink:ot,hasMultipleLinksOrActions:Ze}=We(et),at=Ze&&qe!==void 0,it=(0,v.jsx)("img",{style:{height:Be.cellHeight-te,width:"auto"},src:Je.text,className:Be.imageCell,alt:_e,title:Ce});return(0,v.jsx)("div",{...Re,className:Be.cellContainer,style:{...Re.style,cursor:Ze?"context-menu":"auto"},onClick:me(nt),children:ot?(0,S.h)(et[0],it):at?(0,v.jsx)(S.e,{links:et,value:it,coords:qe,onTooltipClose:()=>nt(void 0)}):it})};function se(De){const{cell:xe,tableStyles:Me,cellProps:Be,field:Oe,row:Re}=De,we=!!Oe.config.custom?.inspect,Ce=(0,x.css)({cursor:"pointer",fontFamily:"monospace"});let _e=xe.value,Je=_e;if((0,t.isString)(_e))try{_e=JSON.parse(_e)}catch{}else try{Je=JSON.stringify(_e,null," ")}catch{Je=void 0}const et=(0,j.k)(Oe,Re)||[],[qe,nt]=(0,b.useState)(),{shouldShowLink:ot,hasMultipleLinksOrActions:Ze}=We(et),at=Ze&&qe!==void 0;return(0,v.jsxs)("div",{...Be,className:we?Me.cellContainerNoOverflow:Me.cellContainer,children:[(0,v.jsx)("div",{className:(0,x.cx)(Me.cellText,Ce),onClick:me(nt),children:ot?(0,S.h)(et[0],Je):at?(0,v.jsx)(S.e,{links:et,value:Je,coords:qe,onTooltipClose:()=>nt(void 0)}):(0,v.jsx)("div",{className:Me.cellText,children:Je})}),we&&(0,v.jsx)(U,{...De,previewMode:K.B.code})]})}var ae=e(93948),J=e(74533),k=e(30703);function _({row:De,tableStyles:xe}){return(0,v.jsx)("div",{className:xe.expanderCell,...De.getToggleRowExpandedProps(),children:(0,v.jsx)(k.I,{"aria-label":De.isExpanded?(0,V.t)("grafana-ui.row-expander.collapse","Collapse row"):(0,V.t)("grafana-ui.row-expander.expand","Expand row"),name:De.isExpanded?"angle-down":"angle-right",size:"lg"})})}const Q=50;function q(De){if(!De)return"flex-start";if(De.config.custom)switch(De.config.custom.align){case"right":return"flex-end";case"left":return"flex-start";case"center":return"center"}return De.type===r.PU.number?"flex-end":"flex-start"}function oe(De,xe,Me,Be,Oe,Re){const we=[];let Ce=0;Be&&(we.push({Header:()=>null,id:"expander",Cell:_,width:Q,minWidth:Q,filter:(Je,et,qe)=>[],justifyContent:"left",field:De.fields[0],sortType:"basic"}),xe-=Q);for(const[Je,et]of De.fields.entries()){const qe=et.config.custom||{};if(qe.hidden||qe.hideFrom?.viz||et.type===r.PU.nestedFrames)continue;qe.width?xe-=qe.width:Ce++;const nt=Ze=>{switch(Ze){case r.PU.number:case r.PU.frame:return"number";case r.PU.time:return"basic";default:return"alphanumeric-insensitive"}},ot=re(qe.cellOptions?.type,et);we.push({Cell:ot,id:Je.toString(),field:et,Header:qe.hideHeader?"":(0,i.Ct)(et,De),accessor:(Ze,at)=>et.values[at],sortType:nt(et.type),width:qe.width,minWidth:qe.minWidth??Me,filter:a()(ee(et)),justifyContent:q(et),Footer:(0,J.d)(Je,Oe,Re)})}let _e=xe/Ce;for(let Je=Ce;Je>0;Je--)for(const et of we)!et.width&&et.minWidth>_e&&(et.width=et.minWidth,xe-=et.width,Ce-=1,_e=xe/Ce);for(const Je of we)Je.width||(Je.width=_e),Je.minWidth=50;return we}function re(De,xe){switch(De){case s.ob.Custom:case s.ob.ColorText:case s.ob.ColorBackground:return z;case s.ob.Image:return Z;case s.ob.Gauge:return L;case s.ob.Sparkline:return ae.a;case s.ob.JSONView:return se;case s.ob.DataLinks:return N;case s.ob.Actions:return y;case s.ob.Pill:return z}if(xe.type===r.PU.geo)return Y;if(xe.type===r.PU.frame){const Me=xe.values[0];return(0,o.ci)(Me)&&(0,l.aH)(Me)?ae.a:se}return xe.type===r.PU.other?se:z}function ee(De){return function(xe,Me,Be){return xe.length===0||!Be||!De?xe:xe.filter(Oe=>{if(!Oe.values.hasOwnProperty(Me))return!1;const Re=ie(Oe,De);return Be.find(we=>we.value===Re)!==void 0})}}function B(De,xe){if(!xe||De.length===0)return{};const Me={};for(let Be=0;Bexe.concat({value:De[Me],label:Me}),[]).sort(fe)}function fe(De,xe){return De.label===void 0&&xe.label===void 0?0:De.label===void 0&&xe.label!==void 0?-1:De.label!==void 0&&xe.label===void 0?1:De.labelxe.label?1:0}function ce(De,xe){return xe?De.filter(Me=>xe.some(Be=>Be.value===Me.value)):[]}function ve(De,xe,Me){return String(De.values[Me]).localeCompare(String(xe.values[Me]),void 0,{sensitivity:"base"})}function Se(De,xe,Me){const Be=je(De.values[Me]),Oe=je(xe.values[Me]);return Be===Oe?0:Be>Oe?1:-1}function je(De){return(0,o.LI)(De)?De.value??Number.NEGATIVE_INFINITY:De==null||De===""||isNaN(De)?Number.NEGATIVE_INFINITY:typeof De=="number"?De:Number(De)}function Ve(De,xe,Me,Be){return Ne(De),De.map((Oe,Re)=>{if(Oe?.field?.type!==r.PU.number)return Re===0&&Me.reducer&&Me.reducer.length>0?h.AS.get(Me.reducer[0]).name:void 0;let we=(0,t.clone)(Oe.field);return we.values=xe[Oe.id],we.state=void 0,Oe.field=we,Me.fields&&Me.fields.length>0?Me.fields.find(_e=>_e===Oe?.field?.name)?he(Oe.field,Me.reducer,Be):void 0:he(Oe.field,Me.reducer||[],Be)})}function he(De,xe,Me){const Be=xe[0];if(Be===void 0)return"";const Oe=De.display??(0,d.J)({field:De,theme:Me}),Re=(0,h.Nw)({field:De,reducers:xe})[Be];return h.AS.get(Be).preservesUnits?(0,f.cN)(Oe(Re)):(0,f.cN)({text:Re})}function Ue(De){const xe=[];for(const Me in De)for(const[Be,Oe]of Object.entries(De[Me].values))xe[Be]===void 0&&(xe[Be]=[]),xe[Be].push(Oe);return xe}const pe={type:s.ob.Auto};function be(De){return De.config.custom?.displayMode?ze(De.config.custom?.displayMode):De.config.custom?.cellOptions?De.config.custom.cellOptions:pe}function ze(De){switch(De){case"basic":case"gradient-gauge":case"lcd-gauge":let xe=s.eX.Basic;return De==="gradient-gauge"?xe=s.eX.Gradient:De==="lcd-gauge"&&(xe=s.eX.Lcd),{type:s.ob.Gauge,mode:xe};case"color-background":case"color-background-solid":let Me=s.Wq.Basic;return De==="color-background"&&(Me=s.Wq.Gradient),{type:s.ob.ColorBackground,mode:Me};default:return{type:De}}}function Ne(De){const xe=De.findIndex((Me,Be)=>Me?.id!==String(Be));xe===-1||De[xe]?.id==="expander"||(De.splice(xe,0,{id:String(xe)}),Ne(De))}function Ie(De,xe,Me){let Be=De.state?.alignmentFactors;if(Be)return(0,f.cN)(Be).length<(0,f.cN)(xe).length&&(Be={...xe},De.state.alignmentFactors=Be),Be;{Be={...xe};const Oe=Math.min(De.values.length,Me+1e3);for(let Re=Me+1;Re(0,f.cN)(we).length&&(Be.text=xe.text)}return De.state?De.state.alignmentFactors=Be:De.state={alignmentFactors:Be},Be}}function ke(De,xe,Me){return Math.abs(Math.floor(De)-xe)xe&&(xe=Oe),Oewe){let xt=Math.floor(qe[ct].width/we)-1;Ze+=xt}let at=qe.length+Ze,it=38;return at>5?it=at*Be*Ce:it=at*Be+_e,it+=Je,{width:we,height:it}}return{width:we,height:Oe}}function Fe(De,xe){let Me;if(De.defaults.custom?.cellOptions?.wrapText){const Oe=xe.fields.filter(Re=>Re.type===r.PU.string);if(Oe.length>=1&&Oe[0].values.length>0){const Re=Oe[0].values.length;let we=0;if(Re<=30)for(const Ce of Oe){const _e=Ce.values.find(Je=>Je!=null)?.length??0;_e>we&&(we=_e,Me=Ce)}else for(const Ce of Oe){const _e=(0,t.sampleSize)(Ce.values,3),Je=(_e[0]?.length+_e[1]?.length+_e[2]?.length)/3;Je>we&&(we=Je,Me=Ce)}}}return Me}const We=(De,xe)=>{const Me=De.length>1||!!xe?.length;return{shouldShowLink:De.length===1&&!xe?.length,hasMultipleLinksOrActions:Me}},Ge=De=>De.target===De.currentTarget,me=De=>xe=>{if(Ge(xe)){const{clientX:Me,clientY:Be}=xe;De({clientX:Me,clientY:Be})}}},72489(ne,A,e){"use strict";e.d(A,{p:()=>r});var t=e(74848),n=e(22803),a=e(55386),c=e(63142);const r=({value:o,variant:l="secondary"})=>{const f=(0,c.of)(i,l);return(0,t.jsx)("span",{className:f.counter,children:(0,a.Hg)(o,0).text})},i=(o,l)=>({counter:(0,n.css)({label:"counter",marginLeft:o.spacing(1),borderRadius:o.spacing(3),backgroundColor:l==="primary"?o.colors.primary.main:o.colors.secondary.main,padding:o.spacing(.25,1),color:o.colors.text.secondary,fontWeight:o.typography.fontWeightMedium,fontSize:o.typography.size.sm})})},60208(ne,A,e){"use strict";e.d(A,{o:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(51898),r=e(63142),i=e(35484),o=e(45861),l=e(30703),f=e(45967),h=e(72489);const d=a.forwardRef(({label:g,active:v,icon:x,onChangeTab:m,counter:p,suffix:y,className:E,href:b,truncate:u,tooltip:D,disabled:P,...C},S)=>{const R=(0,r.of)(s),L=(0,r.of)(o.my),j=()=>(0,t.jsxs)(t.Fragment,{children:[x&&(0,t.jsx)(l.I,{name:x,"data-testid":`tab-icon-${x}`}),g,typeof p=="number"&&(0,t.jsx)(h.p,{value:p}),y&&(0,t.jsx)(y,{className:R.suffix})]}),V={className:(0,n.cx)(L,R.link,v?R.activeStyle:R.notActive,u&&R.linkTruncate,P&&R.disabled),"data-testid":c.Tp.components.Tab.title(g),...C,onClick:P?void 0:m,role:"tab","aria-selected":v,"aria-disabled":P,tabIndex:P?-1:void 0,title:D?void 0:C.title};let w=null;return b?w=(0,t.jsx)("div",{className:(0,n.cx)(R.item,u&&R.itemTruncate,E),children:(0,t.jsx)("a",{...V,href:P?void 0:b,ref:S,children:j()})}):w=(0,t.jsx)("div",{className:(0,n.cx)(R.item,u&&R.itemTruncate,E),children:(0,t.jsx)("button",{...V,type:"button",ref:S,children:j()})}),D?(0,t.jsx)(f.m,{content:D,children:w}):w});d.displayName="Tab";const s=g=>({item:(0,n.css)({listStyle:"none",position:"relative",display:"flex",whiteSpace:"nowrap",padding:g.spacing(0,.5)}),itemTruncate:(0,n.css)({maxWidth:g.spacing(40)}),link:(0,n.css)({color:g.colors.text.secondary,padding:g.spacing(1,1.5,1),borderRadius:g.shape.radius.default,display:"block",height:"100%",svg:{marginRight:g.spacing(1)},"&:focus-visible":(0,i.getFocusStyles)(g),"&::before":{display:"block",content:'" "',position:"absolute",left:0,right:0,height:"2px",borderRadius:g.shape.radius.default,bottom:0}}),linkTruncate:(0,n.css)({textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-word",overflow:"hidden"}),notActive:(0,n.css)({"a:hover, &:hover, &:focus":{color:g.colors.text.primary,"&::before":{backgroundColor:g.colors.action.hover}}}),activeStyle:(0,n.css)({label:"activeTabStyle",color:g.colors.text.primary,overflow:"hidden","&::before":{backgroundImage:g.colors.gradients.brandHorizontal}}),suffix:(0,n.css)({marginLeft:g.spacing(1)}),disabled:(0,n.css)({color:g.colors.text.disabled,cursor:"not-allowed","&:hover, &:focus":{color:g.colors.text.disabled,"&::before":{backgroundColor:"transparent"}}})})},13941(ne,A,e){"use strict";e.d(A,{J:()=>c});var t=e(74848),n=e(22803),a=e(63142);const c=({children:i,className:o,...l})=>{const f=(0,a.of)(r);return(0,t.jsx)("div",{...l,className:(0,n.cx)(f.tabContent,o),children:i})},r=i=>({tabContent:(0,n.css)({background:i.colors.background.primary})})},54314(ne,A,e){"use strict";e.d(A,{U:()=>r});var t=e(74848),n=e(22803),a=e(96540),c=e(63142);const r=(0,a.forwardRef)(({children:o,className:l,hideBorder:f=!1},h)=>{const d=(0,c.of)(i);return(0,t.jsx)("div",{className:(0,n.cx)(d.tabsWrapper,f&&d.noBorder,l),ref:h,children:(0,t.jsx)("div",{className:d.tabs,role:"tablist",children:o})})}),i=o=>({tabsWrapper:(0,n.css)({borderBottom:`1px solid ${o.colors.border.weak}`,overflowX:"auto"}),noBorder:(0,n.css)({borderBottom:0}),tabs:(0,n.css)({position:"relative",display:"flex",alignItems:"center"})});r.displayName="TabsBar"},94018(ne,A,e){"use strict";e.d(A,{v:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(70255),r=e(63142),i=e(21348),o=e(48542),l=e(30703);const f=(0,a.forwardRef)(({name:v,onClick:x,icon:m,className:p,colorIndex:y,...E},b)=>{const u=(0,r.$j)(),D=g(u,v,y),P=S=>{S.preventDefault(),S.stopPropagation(),x?.(v,S)},C=(0,n.cx)(D.wrapper,p,{[D.hover]:x!==void 0});return x?(0,t.jsxs)("button",{...E,className:C,onClick:P,ref:b,children:[m&&(0,t.jsx)(l.I,{name:m}),v]}):(0,t.jsxs)("span",{...E,className:C,ref:b,children:[m&&(0,t.jsx)(l.I,{name:m}),v]})});f.displayName="Tag";const h=({rootProps:v})=>{const x=(0,r.of)(s);return(0,t.jsx)(c.A,{width:60,height:22,containerClassName:x.container,...v})},d=(0,i.j)(f,h),s=()=>({container:(0,n.css)({lineHeight:1})}),g=(v,x,m)=>{let p;return m===void 0?p=(0,o.MC)(x):p=(0,o.yC)(m),{wrapper:(0,n.css)({appearance:"none",borderStyle:"none",fontWeight:v.typography.fontWeightMedium,fontSize:v.typography.size.sm,lineHeight:v.typography.bodySmall.lineHeight,verticalAlign:"baseline",backgroundColor:p.color,color:v.v1.palette.gray98,whiteSpace:"pre",textShadow:"none",padding:"3px 6px",borderRadius:v.shape.radius.sm}),hover:(0,n.css)({"&:hover":{opacity:.85,cursor:"pointer"}})}}},37658(ne,A,e){"use strict";e.d(A,{L:()=>h});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(21348),o=e(94018);const l=(0,a.memo)((0,a.forwardRef)(({displayMax:g,tags:v,icon:x,onClick:m,className:p,getAriaLabel:y,getColorIndex:E},b)=>{const u=(0,r.$j)(),D=s(u,!!(g&&g>0)),P=v.length,C=g?v.slice(0,g):v;return(0,t.jsxs)("ul",{className:(0,n.cx)(D.wrapper,p),"aria-label":(0,c.t)("grafana-ui.tags.list-label","Tags"),ref:b,children:[C.map((S,R)=>(0,t.jsx)("li",{className:D.li,children:(0,t.jsx)(o.v,{name:S,icon:x,onClick:m,"aria-label":y?.(S,R),"data-tag-id":R,colorIndex:E?.(S,R)})},S)),g&&g>0&&P-g>0&&(0,t.jsx)("li",{className:D.li,children:(0,t.jsxs)("span",{className:D.moreTagsLabel,children:["+ ",P-g]})})]})}));l.displayName="TagList";const f=({rootProps:g})=>{const v=(0,r.of)(d);return(0,t.jsxs)("div",{className:v.container,...g,children:[(0,t.jsx)(o.v.Skeleton,{}),(0,t.jsx)(o.v.Skeleton,{})]})},h=(0,i.j)(l,f),d=g=>({container:(0,n.css)({display:"flex",gap:g.spacing(1)})}),s=(g,v)=>({wrapper:(0,n.css)({position:"relative",alignItems:v?"center":"unset",display:"flex",flex:"1 1 auto",flexWrap:"wrap",flexShrink:v?0:1,justifyContent:"flex-end",gap:"6px"}),moreTagsLabel:(0,n.css)({color:g.colors.text.secondary,fontSize:g.typography.size.sm}),li:(0,n.css)({listStyle:"none"})})},10928(ne,A,e){"use strict";e.d(A,{u:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(45861),o=e(63527),l=e(48542),f=e(76319);const h=({name:v,disabled:x,onRemove:m,autoColors:p=!0})=>{const y=(0,r.of)(d),E=(0,a.useMemo)(()=>{if(p){const{color:b,borderColor:u}=(0,l.MC)(v);return{backgroundColor:b,borderColor:u}}},[v,p]);return(0,t.jsxs)("li",{className:(0,n.cx)(y.itemStyle,!E&&y.defaultTagColor),style:E,children:[(0,t.jsx)("span",{className:y.nameStyle,children:v}),(0,t.jsx)(f.K,{name:"times",size:"lg",disabled:x,tooltip:(0,c.t)("grafana-ui.tags-input.remove","Remove tag: {{name}}",{name:v}),onClick:()=>m(v),className:y.buttonStyles})]})},d=v=>{const x=v.spacing.gridSize*3;return{itemStyle:(0,n.css)({display:"flex",gap:"3px",alignItems:"center",height:`${x}px`,lineHeight:`${x-2}px`,borderWidth:"1px",borderStyle:"solid",borderRadius:v.shape.radius.default,padding:`0 ${v.spacing(.5)}`,whiteSpace:"nowrap",textShadow:"none",fontWeight:500,fontSize:v.typography.size.sm,color:"#fff"}),defaultTagColor:(0,n.css)({backgroundColor:v.colors.background.secondary,borderColor:v.components.input.borderColor,color:v.colors.text.primary}),nameStyle:(0,n.css)({maxWidth:"25ch",textOverflow:"ellipsis",overflow:"hidden"}),buttonStyles:(0,n.css)({margin:0,"&:hover::before":{display:"none"}})}},s=(0,a.forwardRef)(({placeholder:v,tags:x=[],onChange:m,width:p,className:y,disabled:E,addOnBlur:b,invalid:u,id:D,autoColors:P=!0},C)=>{const S=v??(0,c.t)("grafana-ui.tags-input.placeholder-new-tag","New tag (enter key to add)"),[R,L]=(0,a.useState)(""),j=(0,r.of)(g),N=(0,r.$j)(),V=(0,a.useCallback)(K=>{L(K.target.value)},[]),w=K=>{m(x.filter(z=>z!==K))},M=K=>{K?.preventDefault(),x.includes(R)||m(x.concat(R)),L("")},O=()=>{b&&R&&M()},U=K=>{K.key==="Enter"&&R!==""&&M(K)};return(0,t.jsxs)("div",{className:(0,n.cx)(j.wrapper,y,p?(0,n.css)({width:N.spacing(p)}):""),children:[(0,t.jsx)(o.p,{ref:C,id:D,disabled:E,placeholder:S,onChange:V,value:R,onKeyDown:U,onBlur:O,invalid:u,suffix:(0,t.jsx)(i.$n,{fill:"text",className:j.addButtonStyle,onClick:M,size:"md",disabled:R.length<=0,children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.tags-input.add",children:"Add"})})}),x?.length>0&&(0,t.jsx)("ul",{className:j.tags,children:x.map(K=>(0,t.jsx)(h,{name:K,onRemove:w,disabled:E,autoColors:P},K))})]})});s.displayName="TagsInput";const g=v=>({wrapper:(0,n.css)({minHeight:v.spacing(4),display:"flex",flexDirection:"column",gap:v.spacing(1),flexWrap:"wrap"}),tags:(0,n.css)({display:"flex",justifyContent:"flex-start",flexWrap:"wrap",gap:v.spacing(.5)}),addButtonStyle:(0,n.css)({margin:`0 -${v.spacing(1)}`})})},87105(ne,A,e){"use strict";e.d(A,{f:()=>i});var t=e(74848),n=e(22803),a=e(96540),c=e(63142),r=e(3343);const i=(0,a.forwardRef)(({invalid:l,className:f,...h},d)=>{const s=(0,c.of)(o,l);return(0,t.jsx)("textarea",{...h,className:(0,n.cx)(s.textarea,f),ref:d})}),o=(l,f=!1)=>({textarea:(0,n.cx)((0,r.Xb)(l),(0,r.gm)(l),(0,n.css)({display:"block",borderRadius:l.shape.radius.default,padding:`${l.spacing.gridSize/4}px ${l.spacing.gridSize}px`,width:"100%",borderColor:f?l.colors.error.border:l.components.input.borderColor}))});i.displayName="TextArea"},59243(ne,A,e){"use strict";e.d(A,{G:()=>s});var t=e(74848),n=e(22803),a=e(83505),c=e(46885),r=e(34743),i=e(96540),o=e(92745),l=e(63142),f=e(76373),h=e(71495),d=e(76319);const s=(0,i.memo)(({children:v,theme:x="info",placement:m="auto",content:p,title:y,closeButton:E=!0,onClose:b,footer:u,fitContent:D=!1,onOpen:P,show:C})=>{const S=(0,i.useRef)(null),R=(0,l.$j)(),L=(0,l.of)(g),j=L[x],[N,V]=(0,i.useState)(C),w=C??N,M=(0,h.O)(m),O=[(0,r.cY)(8),...(0,f.getPositioningMiddleware)(M),(0,r.UE)({element:S})],{context:U,refs:K,floatingStyles:z}=(0,a.we)({open:w,placement:M,onOpenChange:Y=>{C===void 0&&V(Y),Y?P?.():b?.()},middleware:O,whileElementsMounted:c.ll,strategy:"fixed"}),G=(0,a.kp)(U),F=(0,a.s9)(U),{getReferenceProps:W,getFloatingProps:H}=(0,a.bv)([F,G]);return(0,t.jsxs)(t.Fragment,{children:[(0,i.cloneElement)(v,{ref:K.setReference,tabIndex:0,"aria-expanded":w,...W()}),w&&(0,t.jsx)(a.s3,{context:U,modal:!1,closeOnFocusOut:!1,children:(0,t.jsxs)("div",{"data-testid":"toggletip-content",className:(0,n.cx)(j.container,{[L.fitContent]:D}),ref:K.setFloating,style:z,...H(),children:[(0,t.jsx)(a.ie,{strokeWidth:.3,stroke:R.colors.border.weak,className:j.arrow,ref:S,context:U}),!!y&&(0,t.jsx)("div",{className:j.header,children:y}),E&&(0,t.jsx)("div",{className:j.headerClose,children:(0,t.jsx)(d.K,{"aria-label":(0,o.t)("grafana-ui.toggletip.close","Close"),name:"times","data-testid":"toggletip-header-close",onClick:()=>{V(!1),b?.()}})}),(0,t.jsxs)("div",{className:j.body,children:[(typeof p=="string"||(0,i.isValidElement)(p))&&p,typeof p=="function"&&p({})]}),!!u&&(0,t.jsx)("div",{className:j.footer,children:u})]})})]})});s.displayName="Toggletip";const g=v=>{const x=(0,h.f)(v,v.colors.background.primary,v.colors.border.weak,v.components.tooltip.text,{topBottom:2,rightLeft:2}),m=(0,h.f)(v,v.colors.error.main,v.colors.error.main,v.colors.error.contrastText,{topBottom:2,rightLeft:2});return{info:x,error:m,fitContent:(0,n.css)({maxWidth:"fit-content"})}}},7895(ne,A,e){"use strict";e.d(A,{I:()=>d});var t=e(74848),n=e(22803),a=e(96540),c=e(30360),r=e(51898),i=e(63142),o=e(35484),l=e(45861),f=e(30703),h=e(45967);const d=(0,a.forwardRef)(({tooltip:x,icon:m,iconSize:p,className:y,children:E,imgSrc:b,imgAlt:u,fullWidth:D,isOpen:P,narrow:C,variant:S="default",iconOnly:R,"aria-label":L,isHighlighted:j,...N},V)=>{const w=(0,i.of)(v),M=(0,n.cx)({[w.button]:!0,[w.buttonFullWidth]:D,[w.narrow]:C},w[S],y),O=(0,n.cx)({[w.content]:!0,[w.contentWithIcon]:!!m,[w.contentWithRightIcon]:P!==void 0}),U=(0,t.jsxs)("button",{ref:V,className:M,"aria-label":s(L,x),"aria-expanded":P,type:"button",...N,children:[g(m,p),b&&(0,t.jsx)("img",{className:w.img,src:b,alt:u??""}),E&&!R&&(0,t.jsx)("div",{className:O,children:E}),P===!1&&(0,t.jsx)(f.I,{name:"angle-down"}),P===!0&&(0,t.jsx)(f.I,{name:"angle-up"}),j&&(0,t.jsx)("div",{className:w.highlight})]});return x?(0,t.jsx)(h.m,{ref:V,content:x,placement:"bottom",children:U}):U});d.displayName="ToolbarButton";function s(x,m){return x||(m?r.Tp.components.PageToolbar.item(m):void 0)}function g(x,m){return x?(0,c.n6)(x)?(0,t.jsx)(f.I,{name:x,size:`${m||"lg"}`}):x:null}const v=x=>{const m=(0,l.U_)(x,"primary","solid"),p=(0,l.U_)(x,"destructive","solid"),y=(0,n.css)({color:x.colors.text.primary,background:x.colors.secondary.main,"&:hover, &:focus":{color:x.colors.text.primary,background:x.colors.secondary.shade,border:`1px solid ${x.colors.border.medium}`},"&:active":{...(0,l.vy)(x.colors.secondary,"solid")}});return{button:(0,n.css)({label:"toolbar-button",position:"relative",display:"flex",alignItems:"center",height:x.spacing(x.components.height.md),padding:x.spacing(0,1),borderRadius:x.shape.radius.default,lineHeight:`${x.components.height.md*x.spacing.gridSize-2}px`,fontWeight:x.typography.fontWeightMedium,border:`1px solid ${x.colors.secondary.border}`,whiteSpace:"nowrap",[x.transitions.handleMotion("no-preference","reduce")]:{transition:x.transitions.create(["background-color","border-color","color"],{duration:x.transitions.duration.short})},[x.breakpoints.down("md")]:{width:"auto !important"},"&:focus, &:focus-visible":{...(0,o.getFocusStyles)(x),zIndex:1},"&:focus:not(:focus-visible)":(0,o.getMouseFocusStyles)(x),"&[disabled], &:disabled":{cursor:"not-allowed",opacity:x.colors.action.disabledOpacity,background:x.colors.action.disabledBackground,boxShadow:"none","&:hover":{color:x.colors.text.disabled,background:x.colors.action.disabledBackground,boxShadow:"none"}}}),default:(0,n.css)({color:x.colors.text.secondary,background:"transparent",border:"1px solid transparent","&:hover, &:focus":{color:x.colors.text.primary,background:x.colors.action.hover},"&:active":{...(0,l.vy)(x.colors.secondary,"solid")}}),canvas:y,active:(0,n.cx)(y,(0,n.css)({"&::before":{display:"block",content:'" "',position:"absolute",left:0,right:0,height:"2px",bottom:0,borderRadius:x.shape.radius.default,backgroundImage:x.colors.gradients.brandHorizontal}})),primary:(0,n.css)(m),destructive:(0,n.css)(p),narrow:(0,n.css)({padding:x.spacing(0,.5)}),img:(0,n.css)({width:"16px",height:"16px",marginRight:x.spacing(1)}),buttonFullWidth:(0,n.css)({flexGrow:1}),content:(0,n.css)({display:"flex",flexGrow:1}),contentWithIcon:(0,n.css)({display:"none",paddingLeft:x.spacing(1),[`@media ${(0,o.mediaUp)(x.v1.breakpoints.md)}`]:{display:"block"}}),contentWithRightIcon:(0,n.css)({paddingRight:x.spacing(.5)}),highlight:(0,n.css)({backgroundColor:x.colors.success.main,borderRadius:x.shape.radius.circle,width:"6px",height:"6px",position:"absolute",top:"-3px",right:"-3px",zIndex:1})}}},36219(ne,A,e){"use strict";e.d(A,{U:()=>d});var t=e(74848),n=e(22803),a=e(18828),c=e(43107),r=e(93225),i=e(96540),o=e(92745),l=e(63142),f=e(15245),h=e(7895);const d=(0,i.forwardRef)(({alignment:g="left",className:v,children:x,...m},p)=>{const y=i.Children.toArray(x).filter(w=>w!=null),[E,b]=(0,i.useState)(Array(y.length).fill(!1)),u=(0,i.useRef)(null),[D,P]=(0,i.useState)(!1),C=(0,i.useRef)(null),S=(0,i.createRef)(),{overlayProps:R}=(0,r.e)({onClose:()=>P(!1),isDismissable:!0,isOpen:D,shouldCloseOnInteractOutside:w=>{const M=(0,f.gF)();return!C.current?.contains(w)&&!M.contains(w)}},S),{dialogProps:L}=(0,a.s)({},S),j=(0,l.$j)(),N=g==="left"?E.indexOf(!1)-1:E.length,V=s(j,N,g);return(0,i.useLayoutEffect)(()=>{const w=new IntersectionObserver(M=>{M.forEach(O=>{if(O.target instanceof HTMLElement&&O.target.parentNode){const U=Array.prototype.indexOf.call(O.target.parentNode.children,O.target);b(K=>{const z=[...K];return z[U]=O.isIntersecting,z})}})},{threshold:1,root:u.current});return u.current&&Array.from(u.current.children).forEach(M=>{M instanceof HTMLElement&&M!==C.current&&w.observe(M)}),()=>w.disconnect()},[x]),(0,t.jsxs)("div",{ref:u,className:(0,n.cx)(V.container,v),...m,children:[y.map((w,M)=>(0,t.jsx)("div",{style:{order:M,visibility:E[M]?"visible":"hidden"},className:V.childWrapper,children:w},M)),E.includes(!1)&&(0,t.jsxs)("div",{ref:C,className:V.overflowButton,children:[(0,t.jsx)(h.I,{variant:D?"active":"default",tooltip:(0,o.t)("grafana-ui.toolbar-button-row.show-more","Show more items"),onClick:()=>P(!D),icon:"ellipsis-v",iconOnly:!0,narrow:!0}),D&&(0,t.jsx)(c.n1,{contain:!0,autoFocus:!0,children:(0,t.jsx)("div",{className:V.overflowItems,ref:S,...R,...L,children:y.map((w,M)=>!E[M]&&w)})})]})]})});d.displayName="ToolbarButtonRow";const s=(g,v,x)=>({overflowButton:(0,n.css)({order:v}),overflowItems:(0,n.css)({alignItems:"center",backgroundColor:g.colors.background.primary,borderRadius:g.shape.radius.default,boxShadow:g.shadows.z2,display:"flex",flexWrap:"wrap",gap:g.spacing(1),marginTop:g.spacing(1),maxWidth:"80vw",padding:g.spacing(.5,1),position:"absolute",right:0,top:"100%",width:"max-content",zIndex:g.zIndex.dropdown}),container:(0,n.css)({alignItems:"center",display:"flex",gap:g.spacing(1),justifyContent:x==="left"?"flex-start":"flex-end",minWidth:0,position:"relative"}),childWrapper:(0,n.css)({alignItems:"center",display:"flex",gap:g.spacing(1)})})},2381(ne,A,e){"use strict";e.d(A,{A:()=>h});var t=e(74848),n=e(83505),a=e(46885),c=e(34743),r=e(96540),i=e(63142),o=e(76373),l=e(71495),f=e(15245);function h({content:d,show:s,placement:g,className:v,wrapperClassName:x,referenceElement:m,renderArrow:p,hidePopper:y,style:E,...b}){const u=(0,i.$j)(),D=(0,r.useRef)(null),P=(0,l.O)(g),C=[(0,c.cY)(8),...(0,o.getPositioningMiddleware)(P)];p&&C.push((0,c.UE)({element:D}));const{context:S,refs:R,floatingStyles:L}=(0,n.we)({open:s,placement:P,middleware:C,whileElementsMounted:a.ll,strategy:"fixed"});(0,r.useLayoutEffect)(()=>{R.setReference(m)},[m,R]);const{styles:j}=(0,n.DL)(S,{initial:()=>({opacity:0}),duration:u.transitions.duration.enteringScreen});return s?(0,t.jsx)(f.ZL,{children:(0,t.jsx)("div",{ref:R.setFloating,style:{...L,...j,...E},className:x,...b,children:(0,t.jsxs)("div",{className:v,children:[p&&(0,t.jsx)(n.ie,{fill:u.colors.border.weak,ref:D,context:S}),typeof d=="string"&&d,r.isValidElement(d)&&r.cloneElement(d),typeof d=="function"&&d({hidePopper:y})]})})}):void 0}},43533(ne,A,e){"use strict";e.d(A,{I:()=>n});var t=e(96540);class n extends t.Component{constructor(){super(...arguments),this.hideTimeout=null,this.state={show:!1},this.showPopper=()=>{this.hideTimeout&&clearTimeout(this.hideTimeout),this.setState({show:!0})},this.hidePopper=()=>{this.hideTimeout=setTimeout(()=>{this.setState({show:!1})},this.props.hideAfter)}}render(){const{children:c,content:r,placement:i="auto"}=this.props,{show:o}=this.state;return c(this.showPopper,this.hidePopper,{show:o,placement:i,content:r})}}},20662(ne,A,e){"use strict";e.d(A,{z:()=>c});var t=e(74848),n=e(96540);function a(r,i){const o=[];return r.forEach(l=>{o.push(l.start,l.end+1)}),o[0]!==0&&o.unshift(0),o[o.length-1]!==i&&o.push(i),o}const c=r=>{let{highlightParts:i,text:o,highlightClassName:l}=r;if(!i?.length)return null;let f=[],h=a(i,o.length),d=i[0].start===0;for(let s=1;so});var t=e(74848),n=e(96540),a=e(55386),c=e(92745),r=e(64913);function i(l){return`Custom unit: ${l}`}class o extends n.PureComponent{constructor(){super(...arguments),this.onChange=f=>{this.props.onChange(f.value)}}render(){const{value:f,width:h,id:d}=this.props;let s;const v=(0,a.Ke)().map(x=>{const m=x.submenu.map(p=>{const y={label:p.text,value:p.value};return p.value===f&&(s=y),y});return{label:x.text,value:x.text,items:m}});return f&&!s&&(s={value:f,label:f}),(0,t.jsx)(r.v,{id:d,width:h,initialValue:s&&s.label,allowCustomValue:!0,changeOnSelect:!1,formatCreateLabel:i,options:v,placeholder:(0,c.t)("grafana-ui.unit-picker.placeholder","Choose"),isClearable:!0,onSelect:this.props.onChange})}}},71555(ne,A,e){"use strict";e.d(A,{e:()=>r});var t=e(74848),n=e(22803),a=e(63142),c=e(43990);const r=({src:o,alt:l,width:f,height:h})=>{const d=(0,a.of)(i,f,h);return(0,t.jsx)("img",{className:d.image,src:o,alt:l})},i=(o,l=3,f=3)=>({image:(0,n.css)([(0,c.Y)(o,l,h=>({width:o.spacing(h)})),(0,c.Y)(o,f,h=>({height:o.spacing(h)})),{borderRadius:o.shape.radius.circle}])})},59695(ne,A,e){"use strict";e.d(A,{i:()=>o});var t=e(74848),n=e(96540),a=e(51898),c=e(63142),r=e(45861),i=e(18857);function o({"aria-label":l,label:f,icon:h,options:d,onChange:s,variant:g,minWidth:v=16,size:x="sm",isFullWidth:m=!0,menuPlacement:p,fill:y,buttonCss:E}){const[b,u]=(0,n.useState)(!1),D=(0,c.$j)();return(0,t.jsxs)(t.Fragment,{children:[!b&&(0,t.jsx)(r.$n,{size:x||"sm",className:E,icon:h||"plus",onClick:()=>u(!0),variant:g,fill:y,fullWidth:m,"data-testid":a.Tp.components.ValuePicker.button(l??f),children:f}),b&&(0,t.jsx)("span",{style:{minWidth:D.spacing(v),flexGrow:m?1:void 0},children:(0,t.jsx)(i.l6,{placeholder:f,options:d,"aria-label":a.Tp.components.ValuePicker.select(l??f),isOpen:!0,onCloseMenu:()=>u(!1),autoFocus:!0,onChange:P=>{u(!1),s(P)},menuPlacement:p})})]})}},54735(ne,A,e){"use strict";e.d(A,{KU:()=>o});var t=e(74848),n=e(22803),a=e(49185),c=e(63142),r=e(35484),i=e(92807);const o=({width:h,height:d,legend:s,children:g})=>{const v=(0,c.$j)(),x=(0,c.of)(l),m={display:"flex",width:`${h}px`,height:`${d}px`},[p,y]=(0,a.A)();if(!s)return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{style:m,className:x.viz,children:g(h,d)})});let{placement:E,maxHeight:b="35%",maxWidth:u="60%"}=s.props;document.body.clientWidth({viz:(0,n.css)({flexGrow:2,borderRadius:h.shape.radius.default,"&:focus-visible":(0,r.getFocusStyles)(h)})}),f=({children:h})=>(0,t.jsx)(t.Fragment,{children:h});o.Legend=f},71479(ne,A,e){"use strict";e.d(A,{p:()=>i});var t=e(74848),n=e(22803),a=e(96540),c=e(76637),r=e(63142);const i=a.memo(a.forwardRef(({color:l,className:f,gradient:h,lineStyle:d,noMargin:s,...g},v)=>{const x=(0,r.$j)(),m=(0,r.of)(o);let p;if(h){const E=c.uf.get(h).getColors?.(x);E?.length?p=`linear-gradient(90deg, ${E.join(", ")})`:p=x.visualization.getColorByName("")}else p=l;let y;return d?.fill==="dot"&&!h?y={backgroundImage:`radial-gradient(circle at 2px 2px, ${l} 2px, transparent 0)`,backgroundSize:"4px 4px",backgroundRepeat:"space"}:d?.fill==="dash"&&!h?y={backgroundImage:`linear-gradient(to right, ${l} 100%, transparent 0%)`,backgroundSize:"6px 4px",backgroundRepeat:"space"}:y={background:p,borderRadius:x.shape.radius.pill},(0,t.jsx)("div",{"data-testid":"series-icon",ref:v,className:(0,n.cx)(f,m.forcedColors,m.container,s?null:m.margin),style:y,...g})})),o=l=>({margin:(0,n.css)({marginRight:"8px"}),container:(0,n.css)({display:"inline-block",width:"14px",height:"4px"}),forcedColors:(0,n.css)({"@media (forced-colors: active)":{forcedColorAdjust:"none"}})});i.displayName="SeriesIcon"},4268(ne,A,e){"use strict";e.d(A,{t:()=>L});var t=e(74848),n=e(96540),a=e(57852),c=e(739),r=e(64400),i=e(49256),o=e(22803),l=e(63142),f=e(12569),h=e(5585),d=e(89123);const s=({items:j,itemRenderer:N,onLabelMouseOver:V,onLabelMouseOut:w,onLabelClick:M,placement:O,className:U,readonly:K})=>{const z=(0,l.of)(g);N||(N=F=>(0,t.jsx)(d.M,{item:F,onLabelClick:M,onLabelMouseOver:V,onLabelMouseOut:w,readonly:K}));const G=F=>`${F.getItemKey?F.getItemKey():F.label}`;switch(O){case"right":{const F=(W,H)=>(0,t.jsx)("span",{className:z.itemRight,children:N(W,H)});return(0,t.jsx)("div",{className:(0,o.cx)(z.rightWrapper,U),children:(0,t.jsx)(h.B,{items:j,renderItem:F,getItemKey:G})})}case"bottom":default:{const F=j.filter(Y=>Y.yAxis===1),W=j.filter(Y=>Y.yAxis!==1),H=(Y,te)=>(0,t.jsx)("span",{className:z.itemBottom,children:N(Y,te)});return(0,t.jsxs)("div",{className:(0,o.cx)(z.bottomWrapper,U),children:[F.length>0&&(0,t.jsx)("div",{className:z.section,children:(0,t.jsx)(f.c,{items:F,renderItem:H,getItemKey:G})}),W.length>0&&(0,t.jsx)("div",{className:(0,o.cx)(z.section,z.sectionRight),children:(0,t.jsx)(f.c,{items:W,renderItem:H,getItemKey:G})})]})}}};s.displayName="VizLegendList";const g=j=>{const N=(0,o.css)({paddingRight:"10px",display:"flex",fontSize:j.typography.bodySmall.fontSize,whiteSpace:"nowrap"});return{itemBottom:N,itemRight:(0,o.cx)(N,(0,o.css)({marginBottom:j.spacing(.5)})),rightWrapper:(0,o.css)({padding:j.spacing(.5)}),bottomWrapper:(0,o.css)({display:"flex",flexWrap:"wrap",justifyContent:"space-between",width:"100%",padding:j.spacing(.5),gap:"15px 25px"}),section:(0,o.css)({display:"flex"}),sectionRight:(0,o.css)({justifyContent:"flex-end",flexGrow:1,flexBasis:"50%"})}};var v=e(30703),x=e(55386),m=e(92745),p=e(35484),y=e(87);const E=({item:j,onLabelClick:N,onLabelMouseOver:V,onLabelMouseOut:w,className:M,readonly:O})=>{const U=(0,l.of)(b),K=(0,n.useCallback)(F=>{V&&V(j,F)},[j,V]),z=(0,n.useCallback)(F=>{w&&w(j,F)},[j,w]),G=(0,n.useCallback)(F=>{N&&N(j,F)},[j,N]);return(0,t.jsxs)("tr",{className:(0,o.cx)(U.row,M),children:[(0,t.jsx)("td",{children:(0,t.jsxs)("span",{className:U.itemWrapper,children:[(0,t.jsx)(y.R,{color:j.color,seriesName:j.fieldName??j.label,readonly:O,lineStyle:j.lineStyle}),(0,t.jsxs)("button",{disabled:O,type:"button",title:j.label,onBlur:z,onFocus:K,onMouseOver:K,onMouseOut:z,onClick:O?void 0:G,className:(0,o.cx)(U.label,j.disabled&&U.labelDisabled),children:[j.label," ",j.yAxis===2&&(0,t.jsx)("span",{className:U.yAxisLabel,children:(0,t.jsx)(m.x6,{i18nKey:"grafana-ui.viz-legend.right-axis-indicator",children:"(right y-axis)"})})]})]})}),j.getDisplayValues&&j.getDisplayValues().map((F,W)=>(0,t.jsx)("td",{className:U.value,children:(0,x.cN)(F)},`${F.title}-${W}`))]})};E.displayName="LegendTableItem";const b=j=>{const N=(0,p.hoverColor)(j.colors.background.primary,j);return{row:(0,o.css)({label:"LegendRow",fontSize:j.v1.typography.size.sm,borderBottom:`1px solid ${j.colors.border.weak}`,td:{padding:j.spacing(.25,1),whiteSpace:"nowrap"},"&:hover":{background:N}}),label:(0,o.css)({label:"LegendLabel",whiteSpace:"nowrap",background:"none",border:"none",fontSize:"inherit",padding:0,maxWidth:"600px",textOverflow:"ellipsis",overflow:"hidden",userSelect:"text"}),labelDisabled:(0,o.css)({label:"LegendLabelDisabled",color:j.colors.text.disabled}),itemWrapper:(0,o.css)({display:"flex",whiteSpace:"nowrap",alignItems:"center"}),value:(0,o.css)({textAlign:"right"}),yAxisLabel:(0,o.css)({color:j.colors.text.secondary})}},u="Name",D=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}).compare,P=({items:j,sortBy:N,sortDesc:V,itemRenderer:w,className:M,onToggleSort:O,onLabelClick:U,onLabelMouseOver:K,onLabelMouseOut:z,readonly:G,isSortable:F})=>{const W=(0,l.of)(C),H={};F&&(H[u]="");for(const Y of j)if(Y.getDisplayValues)for(const te of Y.getDisplayValues())H[te.title??"?"]=te.description??"";if(N!=null){let Y=new Map;j.forEach(Z=>{if(N!==u&&Z.getDisplayValues){const se=Z.getDisplayValues().find(J=>J.title===N),ae=se==null||Number.isNaN(se.numeric)?-1/0:se.numeric;Y.set(Z,ae)}});let te=V?-1:1;N===u?j.sort((Z,se)=>te*D(Z.label,se.label)):j.sort((Z,se)=>{const ae=Y.get(Z)??0,J=Y.get(se)??0;return te*(ae-J)})}return w||(w=(Y,te)=>(0,t.jsx)(E,{item:Y,onLabelClick:U,onLabelMouseOver:K,onLabelMouseOut:z,readonly:G},`${Y.label}-${te}`)),(0,t.jsxs)("table",{className:(0,o.cx)(W.table,M),children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[!F&&(0,t.jsx)("th",{}),Object.keys(H).map(Y=>(0,t.jsxs)("th",{title:H[Y],className:(0,o.cx)(W.header,O&&W.headerSortable,F&&W.nameHeader,{[W.withIcon]:N===Y}),onClick:()=>{O&&O(Y)},children:[Y,N===Y&&(0,t.jsx)(v.I,{size:"xs",name:V?"angle-down":"angle-up"})]},Y))]})}),(0,t.jsx)("tbody",{children:j.map(w)})]})},C=j=>({table:(0,o.css)({width:"100%","th:first-child":{width:"100%",borderBottom:`1px solid ${j.colors.border.weak}`}}),header:(0,o.css)({color:j.colors.primary.text,fontWeight:j.typography.fontWeightMedium,borderBottom:`1px solid ${j.colors.border.weak}`,padding:j.spacing(.25,1,.25,1),fontSize:j.typography.bodySmall.fontSize,textAlign:"right",whiteSpace:"nowrap"}),nameHeader:(0,o.css)({textAlign:"left",paddingLeft:"30px"}),withIcon:(0,o.css)({paddingRight:"4px"}),headerSortable:(0,o.css)({cursor:"pointer"})});var S=e(22940);function R(j){return j.ctrlKey||j.metaKey||j.shiftKey?i.B.AppendToSelection:i.B.ToggleSelection}function L({items:j,thresholdItems:N,mappingItems:V,displayMode:w,sortBy:M,seriesVisibilityChangeBehavior:O=S.K.Isolate,sortDesc:U,onLabelClick:K,onToggleSort:z,placement:G,className:F,itemRenderer:W,readonly:H,isSortable:Y}){const{eventBus:te,onToggleSeriesVisibility:Z,onToggleLegendSort:se}=(0,r.d2)(),ae=(0,n.useCallback)((Q,q)=>{te?.publish({type:a.b_.type,payload:{raw:q,x:0,y:0,dataId:Q.label}})},[te]),J=(0,n.useCallback)((Q,q)=>{te?.publish({type:a.ql.type,payload:{raw:q,x:0,y:0,dataId:Q.label}})},[te]),k=(0,n.useCallback)((Q,q)=>{K&&K(Q,q),Z&&Z(Q.fieldName??Q.label,O===S.K.Hide?i.B.AppendToSelection:R(q))},[Z,K,O]),_=(0,n.useCallback)(Q=>(0,t.jsx)(s,{className:F,placement:G,onLabelMouseOver:ae,onLabelMouseOut:J,onLabelClick:k,itemRenderer:W,readonly:H,items:Q}),[F,G,ae,J,k,W,H]);switch(w){case c.lm.Table:return(0,t.jsx)(P,{className:F,items:j,placement:G,sortBy:M,sortDesc:U,onLabelClick:k,onToggleSort:z||se,onLabelMouseOver:ae,onLabelMouseOut:J,itemRenderer:W,readonly:H,isSortable:Y});case c.lm.List:const Q=N&&N.length>1,q=V&&V.length>0;return(0,t.jsxs)(t.Fragment,{children:[!Q&&(!q||j.length>1)&&_(j),Q&&_(N),q&&_(V)]});default:return null}}L.displayName="VizLegend"},89123(ne,A,e){"use strict";e.d(A,{M:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(51898),r=e(63142),i=e(87),o=e(2543),l=e(55386),f=e(12569);const h=({stats:v})=>{const x=(0,r.of)(d);return v.length===0?null:(0,t.jsx)(f.c,{className:x.list,items:v,renderItem:m=>(0,t.jsxs)("div",{className:x.item,title:m.description,children:[m.title&&`${(0,o.capitalize)(m.title)}:`," ",(0,l.cN)(m)]})})},d=()=>({list:(0,n.css)({flexGrow:1,textAlign:"right"}),item:(0,n.css)({marginLeft:"8px"})});h.displayName="VizLegendStatsList";const s=({item:v,onLabelClick:x,onLabelMouseOver:m,onLabelMouseOut:p,className:y,readonly:E})=>{const b=(0,r.of)(g),u=(0,a.useCallback)(C=>{m&&m(v,C)},[v,m]),D=(0,a.useCallback)(C=>{p&&p(v,C)},[v,p]),P=(0,a.useCallback)(C=>{x&&x(v,C)},[v,x]);return(0,t.jsxs)("div",{className:(0,n.cx)(b.itemWrapper,v.disabled&&b.itemDisabled,y),"data-testid":c.Tp.components.VizLegend.seriesName(v.label),children:[(0,t.jsx)(i.R,{seriesName:v.fieldName??v.label,color:v.color,gradient:v.gradient,readonly:E,lineStyle:v.lineStyle}),(0,t.jsx)("button",{disabled:E,type:"button",onBlur:D,onFocus:u,onMouseOver:u,onMouseOut:D,onClick:P,className:b.label,children:v.label}),v.getDisplayValues&&(0,t.jsx)(h,{stats:v.getDisplayValues()})]})};s.displayName="VizLegendListItem";const g=v=>({label:(0,n.css)({label:"LegendLabel",whiteSpace:"nowrap",background:"none",border:"none",fontSize:"inherit",padding:0,userSelect:"text"}),itemDisabled:(0,n.css)({label:"LegendLabelDisabled",color:v.colors.text.disabled}),itemWrapper:(0,n.css)({label:"LegendItemWrapper",display:"flex",whiteSpace:"nowrap",alignItems:"center",flexGrow:1}),value:(0,n.css)({textAlign:"right"}),yAxisLabel:(0,n.css)({color:v.v1.palette.gray2})})},87(ne,A,e){"use strict";e.d(A,{R:()=>i});var t=e(74848),n=e(96540),a=e(35427),c=e(64400),r=e(71479);const i=(0,n.memo)(({seriesName:o,color:l,gradient:f,readonly:h,lineStyle:d})=>{const{onSeriesColorChange:s}=(0,c.d2)(),g=(0,n.useCallback)(v=>s(o,v),[o,s]);return o&&s&&l&&!h?(0,t.jsx)(a.Dp,{color:l,onChange:g,enableNamedColors:!0,children:({ref:v,showColorPicker:x,hideColorPicker:m})=>(0,t.jsx)(r.p,{color:l,className:"pointer",ref:v,onClick:x,onMouseLeave:m,lineStyle:d})}):(0,t.jsx)(r.p,{color:l,gradient:f,lineStyle:d})});i.displayName="VizLegendSeriesIcon"},22940(ne,A,e){"use strict";e.d(A,{K:()=>t});var t=(n=>(n[n.Isolate=0]="Isolate",n[n.Hide=1]="Hide",n))(t||{})},33352(ne,A,e){"use strict";e.d(A,{S:()=>o});var t=e(74848),n=e(2543),a=e(96540),c=e(38919);const r=(f,h,d,s)=>{const g=i(f,h,s),v=i(h,f,s),x=Math.max(g,v);let m=Math.floor(f/x),p=Math.ceil(s/m);m=Math.ceil(s/p);const y=m-(m*p-s),E=f/y-d+d/y;return{width:f/m-d+d/m,height:h/p-d+d/p,widthOnLastRow:E,xCount:m,yCount:p}};function i(f,h,d){const s=Math.ceil(Math.sqrt(d*f/h));return Math.floor(s*h/f)*ss?c.wV.Vertical:c.wV.Horizontal:h}renderGrid(){const{renderValue:h,height:d,width:s,itemSpacing:g,getAlignmentFactors:v,orientation:x}=this.props,{values:m}=this.state,p=r(s,d,g,m.length),y=v?v(m,p.width,p.height):{};let E=0,b=0,u=[];for(let D=0;D(0,t.jsx)("div",{style:l(u,j,b.length),children:h({value:L,width:C,height:P,alignmentFactors:R,orientation:S,count:b.length})},j))})}}function l(f,h,d){return h===d-1?{...f,marginRight:0,marginBottom:0}:f}},63428(ne,A,e){"use strict";e.d(A,{g:()=>o,o:()=>l});var t=e(74848),n=e(22803),a=e(92745),c=e(63142),r=e(71479);const i=f=>({icon:(0,n.css)({marginRight:f.spacing(1),verticalAlign:"middle"}),seriesTable:(0,n.css)({display:"table"}),seriesTableRow:(0,n.css)({display:"table-row",fontSize:f.typography.bodySmall.fontSize}),seriesTableCell:(0,n.css)({display:"table-cell"}),label:(0,n.css)({wordBreak:"break-all"}),value:(0,n.css)({paddingLeft:f.spacing(2),textAlign:"right"}),activeSeries:(0,n.css)({fontWeight:f.typography.fontWeightBold,color:f.colors.text.maxContrast}),timestamp:(0,n.css)({fontWeight:f.typography.fontWeightBold,fontSize:f.typography.bodySmall.fontSize})}),o=({color:f,label:h,value:d,isActive:s})=>{const g=(0,c.of)(i);return(0,t.jsxs)("div",{"data-testid":"SeriesTableRow",className:(0,n.cx)(g.seriesTableRow,s&&g.activeSeries),children:[f&&(0,t.jsx)("div",{className:g.seriesTableCell,children:(0,t.jsx)(r.p,{color:f,className:g.icon})}),h&&(0,t.jsx)("div",{className:(0,n.cx)(g.seriesTableCell,g.label),children:h}),d&&(0,t.jsx)("div",{className:(0,n.cx)(g.seriesTableCell,g.value),children:d})]})},l=({timestamp:f,series:h})=>{const d=(0,c.of)(i);return(0,t.jsxs)(t.Fragment,{children:[f&&(0,t.jsx)("div",{className:d.timestamp,"aria-label":(0,a.t)("grafana-ui.viz-tooltip.timestamp","Timestamp"),children:f}),h.map((s,g)=>(0,t.jsx)(o,{isActive:s.isActive,label:s.label,color:s.color,value:s.value},`${s.label}-${g}`))]})}},71076(ne,A,e){"use strict";e.d(A,{o:()=>l});var t=e(74848),n=e(22803),a=e(96540),c=e(52908),r=e(63142),i=e(35484),o=e(55302);const l=({position:{x:h,y:d},offset:{x:s,y:g},children:v,allowPointerEvents:x=!1,className:m,...p})=>{const y=(0,a.useRef)(null),[E,b]=(0,a.useState)({width:0,height:0}),{width:u,height:D}=(0,c.A)(),[P,C]=(0,a.useState)({x:h+s,y:d+g}),S=(0,a.useMemo)(()=>new ResizeObserver(L=>{for(let j of L){const N=Math.floor(j.contentRect.width+16),V=Math.floor(j.contentRect.height+16);(E.width!==N||E.height!==V)&&b({width:Math.min(N,u),height:Math.min(V,D)})}}),[E,u,D]);(0,a.useLayoutEffect)(()=>(y.current&&S.observe(y.current),()=>{S.disconnect()}),[S]),(0,a.useLayoutEffect)(()=>{if(y&&y.current){const{x:L,y:j}=(0,o.Ju)(h,d,E.width,E.height,s,g,u,D);C({x:L,y:j})}},[u,D,h,s,d,g,E]);const R=(0,r.of)(f);return(0,t.jsx)("div",{ref:y,style:{position:"fixed",left:0,pointerEvents:x?"auto":"none",top:0,transform:`translate(${P.x}px, ${P.y}px)`,transition:"transform ease-out 0.1s"},"aria-live":"polite","aria-atomic":"true",...p,className:(0,n.cx)(R.wrapper,m),children:v})};l.displayName="VizTooltipContainer";const f=h=>({wrapper:(0,n.css)((0,i.getTooltipContainerStyles)(h))})},39064(ne,A,e){"use strict";e.d(A,{S:()=>x});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(63142),i=e(31210),o=e(45861),l=e(5753),f=e(30703),h=e(41654);const d="add-annotation-button";function s(p,y,E){return(u,D)=>{if(u.length===0)return;const P=u.find(C=>C.oneClick===!0);return P!=null?(0,t.jsx)("div",{className:D.footerSection,children:(0,t.jsx)(h.B,{direction:"column",justifyContent:"flex-start",gap:.5,children:(0,t.jsxs)("span",{className:D.oneClickWrapper,children:[(0,t.jsx)(f.I,{name:"info-circle",size:"lg",className:D.infoIcon}),p(P.title)]})})}):(0,t.jsx)("div",{className:D.footerSection,children:(0,t.jsx)(h.B,{direction:"column",justifyContent:"flex-start",gap:E,children:u.map((C,S)=>y(C,S,D))})})}}const g=s(p=>(0,t.jsxs)(c.x6,{i18nKey:"grafana-ui.viz-tooltip.footer-click-to-navigate",children:["Click to open ",{linkTitle:p}]}),(p,y,E)=>(0,t.jsx)(l.R,{link:p,buttonProps:{className:E.dataLinkButton,fill:"text"}},y),.5),v=s(p=>(0,t.jsxs)(c.x6,{i18nKey:"grafana-ui.viz-tooltip.footer-click-to-action",children:["Click to ",{actionTitle:p}]}),(p,y)=>(0,t.jsx)(i.r,{action:p,variant:"secondary"},y)),x=({dataLinks:p,actions:y=[],annotate:E,adHocFilters:b=[]})=>{const u=(0,r.of)(m),D=(0,a.useMemo)(()=>p.some(C=>C.oneClick===!0),[p]),P=(0,a.useMemo)(()=>y.some(C=>C.oneClick===!0),[y]);return(0,t.jsxs)("div",{className:u.wrapper,children:[!P&&g(p,u),!D&&v(y,u),!D&&!P&&b.length>0&&(0,t.jsx)("div",{className:u.footerSection,children:b.map((C,S)=>(0,t.jsx)(o.$n,{icon:"filter",variant:"secondary",size:"sm",onClick:C.onClick,children:(0,t.jsxs)(c.x6,{i18nKey:"grafana-ui.viz-tooltip.footer-filter-for-value",children:["Filter for '",{value:C.value},"'"]})},S))}),!D&&!P&&E!=null&&(0,t.jsx)("div",{className:u.footerSection,children:(0,t.jsx)(o.$n,{icon:"comment-alt",variant:"secondary",size:"sm",id:d,onClick:E,children:(0,t.jsx)(c.x6,{i18nKey:"grafana-ui.viz-tooltip.footer-add-annotation",children:"Add annotation"})})})]})},m=p=>({wrapper:(0,n.css)({display:"flex",flexDirection:"column",flex:1,padding:p.spacing(0)}),footerSection:(0,n.css)({borderTop:`1px solid ${p.colors.border.medium}`,padding:p.spacing(1)}),dataLinkButton:(0,n.css)({cursor:"pointer","&:hover":{textDecoration:"underline",background:"none"},padding:0,height:"auto","& span":{whiteSpace:"normal",textAlign:"left"}}),oneClickWrapper:(0,n.css)({display:"flex",alignItems:"center"}),infoIcon:(0,n.css)({color:p.colors.primary.main,paddingRight:p.spacing(.5)})})},61048(ne,A,e){"use strict";e.d(A,{i:()=>i});var t=e(74848),n=e(22803),a=e(34164),c=e(51898),r=e(63142);const i=({children:l,className:f})=>{const h=(0,r.of)(o);return(0,t.jsx)("div",{className:(0,a.A)(h,f),"data-testid":c.Tp.components.Panels.Visualization.Tooltip.Wrapper,children:l})},o=l=>(0,n.css)({display:"flex",flexDirection:"column",fontSize:l.typography.bodySmall.fontSize})},55978(ne,A,e){"use strict";e.d(A,{Ev:()=>a,fX:()=>t,lJ:()=>n});var t=(c=>(c.series="series",c.value="value",c.hexagon="hexagon",c.pie_1_4="pie_1_4",c.pie_2_4="pie_2_4",c.pie_3_4="pie_3_4",c.marker_sm="marker_sm",c.marker_md="marker_md",c.marker_lg="marker_lg",c))(t||{}),n=(c=>(c.hidden="hidden",c.first="first",c.leading="leading",c.trailing="trailing",c))(n||{});const a="series"},55302(ne,A,e){"use strict";e.d(A,{Ju:()=>o,L$:()=>l,cp:()=>s});var t=e(76637),n=e(55386),a=e(64394),c=e(95004),r=e(739),i=e(55978);const o=(v=0,x=0,m=0,p=0,y=0,E=0,b=0,u=0)=>{let D=v,P=x;const C=Math.max(v+y+m-(b-y),0),S=Math.abs(Math.min(v-y-m-y,0)),R=C>0,L=S>0,j=Math.max(x+E+p-(u-E),0),N=Math.abs(Math.min(x-E-p-E,0)),V=j>0,w=N>0;return R&&L?D=C>S?y:b-y-m:R?D=v-y-m:D=v+y,V&&w?P=j>N?E:u-E-p:V?P=x-E-p:P=x+E,{x:D,y:P}},l=(v,x)=>{switch(v){case i.fX.series:return x.series;case i.fX.value:return x.value;case i.fX.hexagon:return x.hexagon;case i.fX.pie_1_4:return x.pie_1_4;case i.fX.pie_2_4:return x.pie_2_4;case i.fX.pie_3_4:return x.pie_3_4;case i.fX.marker_sm:return x.marker_sm;case i.fX.marker_md:return x.marker_md;case i.fX.marker_lg:return x.marker_lg;default:return x.value}},f=(v,x)=>v.numeric-x.numeric,h=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),d=(v,x)=>h.compare(`${v.value}`,`${x.value}`),s=(v,x,m,p,y,E,b=P=>!0,u=!1,D)=>{let P=[],C=!0;for(let S=0;S{if(!S.config.custom?.hideFrom?.tooltip){const{colorIndicator:R,colorPlacement:L}=g(S),j=S.display(S.values[m[0]]);P.push({label:S.state?.displayName??S.name,value:(0,n.cN)(j),color:a.F,colorIndicator:R,colorPlacement:L,lineStyle:S.config.custom?.lineStyle,isHiddenFromViz:!0})}}),E!==r.xB.None&&P.length>1){const S=C?f:d,R=E===r.xB.Descending?-1:1;P.sort((L,j)=>R*S(L,j))}return P},g=v=>{const x=(0,t.Qi)(v);let m=i.fX.series,p=i.lJ.first;return x.isByValue&&(m=i.fX.value,p=i.lJ.trailing),{colorIndicator:m,colorPlacement:p}}},92790(ne,A,e){"use strict";e.d(A,{Z:()=>l});var t=e(74848),n=e(96540),a=e(36613),c=e(36192);function r(f,h){return h.width===f.width&&h.height===f.height}function i(f,h){return h.data===f.data}function o(f,h){return h.config===f.config}class l extends n.Component{constructor(h){super(h),this.plotContainer=(0,n.createRef)(),this.plotCanvasBBox=(0,n.createRef)(),this.plotInstance=null}reinitPlot(){let{width:h,height:d,plotRef:s}=this.props;if(this.plotInstance?.destroy(),h===0&&d===0)return;this.props.config.addHook("setSize",x=>{x.over});const g={width:Math.floor(this.props.width),height:Math.floor(this.props.height),...this.props.config.getConfig()};(0,c.uY)("UPlot",!1,"Reinitializing plot",g);const v=new a.A(g,this.props.data,this.plotContainer.current);s&&s(v),this.plotInstance=v}componentDidMount(){this.reinitPlot()}componentWillUnmount(){this.plotInstance?.destroy()}componentDidUpdate(h){r(h,this.props)?o(h,this.props)?i(h,this.props)||this.plotInstance?.setData(this.props.data):this.reinitPlot():this.plotInstance?.setSize({width:Math.floor(this.props.width),height:Math.floor(this.props.height)})}render(){return(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("div",{ref:this.plotContainer,"data-testid":"uplot-main-div"}),this.props.children]})}}},61897(ne,A,e){"use strict";e.d(A,{$:()=>d,t:()=>h});var t=e(74848),n=e(96540),a=e(76637),c=e(16515),r=e(739),i=e(63142),o=e(54735),l=e(4268),f=e(36192);function h(s,g){return s.getSeries().some(v=>{const x=v.props.dataFrameFieldIndex;if(!x)return!1;const m=g[x.frameIndex]?.fields[x.fieldIndex];return!(!m||m.config.custom?.hideFrom?.legend)})}const d=(0,n.memo)(({data:s,config:g,placement:v,calcs:x,displayMode:m,...p})=>{const y=(0,i.$j)(),E=g.getSeries().map(b=>{const u=b.props,D=u.dataFrameFieldIndex,P=g.getAxisPlacement(b.props.scaleKey);if(!D)return;const C=s[D.frameIndex]?.fields[D.fieldIndex];if(!C||C.config.custom?.hideFrom?.legend)return;const S=(0,c.Ct)(C,s[D.frameIndex],s),L=(0,a.lz)(C,y).color;return{disabled:!(u.show??!0),fieldIndex:D,color:L,label:S,yAxis:P===r.vM.Left||P===r.vM.Bottom?1:2,getDisplayValues:()=>(0,f.UO)(x,C,y),getItemKey:()=>`${S}-${D.frameIndex}-${D.fieldIndex}`,lineStyle:u.lineStyle}}).filter(b=>b!==void 0);return(0,t.jsx)(o.KU.Legend,{placement:v,...p,children:(0,t.jsx)(l.t,{placement:v,items:E,displayMode:m,sortBy:p.sortBy,sortDesc:p.sortDesc,isSortable:!0})})});d.displayName="PlotLegend"},99555(ne,A,e){"use strict";e.d(A,{P:()=>a,t:()=>c});var t=e(92745),n=e(739);const a=()=>({drawStyle:[{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.draw-style.label-lines","Lines"),value:n.GR.Line},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.draw-style.label-bars","Bars"),value:n.GR.Bars},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.draw-style.label-points","Points"),value:n.GR.Points}],lineInterpolation:[{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.line-interpolation.description-linear","Linear"),value:n.dx.Linear,icon:"gf-interpolation-linear"},{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.line-interpolation.description-smooth","Smooth"),value:n.dx.Smooth,icon:"gf-interpolation-smooth"},{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.line-interpolation.description-step-before","Step before"),value:n.dx.StepBefore,icon:"gf-interpolation-step-before"},{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.line-interpolation.description-step-after","Step after"),value:n.dx.StepAfter,icon:"gf-interpolation-step-after"}],barAlignment:[{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.bar-alignment.description-before","Before"),value:n.Nj.Before,icon:"gf-bar-alignment-before"},{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.bar-alignment.description-center","Center"),value:n.Nj.Center,icon:"gf-bar-alignment-center"},{description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.bar-alignment.description-after","After"),value:n.Nj.After,icon:"gf-bar-alignment-after"}],showPoints:[{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.show-points.label-auto","Auto"),value:n.yL.Auto,description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.show-points.description-auto","Show points when the density is low")},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.show-points.label-always","Always"),value:n.yL.Always},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.show-points.label-never","Never"),value:n.yL.Never}],axisPlacement:[{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.axis-placement.label-auto","Auto"),value:n.vM.Auto,description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.axis-placement.description-auto","First field on the left, everything else on the right")},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.axis-placement.label-left","Left"),value:n.vM.Left},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.axis-placement.label-right","Right"),value:n.vM.Right},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.axis-placement.label-hidden","Hidden"),value:n.vM.Hidden}],fillGradient:[{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.label-none","None"),value:n.on.None},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.label-opacity","Opacity"),value:n.on.Opacity,description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.description-opacity","Enable fill opacity gradient")},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.label-hue","Hue"),value:n.on.Hue,description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.description-hue","Small color hue gradient")},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.label-scheme","Scheme"),value:n.on.Scheme,description:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.fill-gradient.description-scheme","Use color scheme to define gradient")}],stacking:[{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.stacking.label-off","Off"),value:n.gs.None},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.stacking.label-normal","Normal"),value:n.gs.Normal},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.stacking.label-100","100%"),value:n.gs.Percent}],thresholdsDisplayModes:[{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.thresholds-display-mode.label-off","Off"),value:n.Ly.Off},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.thresholds-display-mode.label-lines","As lines"),value:n.Ly.Line},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.thresholds-display-mode.label-dashed-lines","As lines (dashed)"),value:n.Ly.Dashed},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.thresholds-display-mode.label-filled-regions","As filled regions"),value:n.Ly.Area},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.thresholds-display-mode.label-filled-regions-and-lines","As filled regions and lines"),value:n.Ly.LineAndArea},{label:(0,t.t)("grafana-ui.u-plot.config.get-graph-field-options.thresholds-display-mode.label-filled-regions-and-dashed-lines","As filled regions and lines (dashed)"),value:n.Ly.DashedAndArea}]}),c=a()},23414(ne,A,e){"use strict";e.d(A,{Zj:()=>p,pi:()=>f,zH:()=>m});var t=e(79243),n=e(55386),a=e(5421),c=e(80011),r=e(739),i=e(53568),o=e(62748),l=e(42073);const f=12,h=150,d=30,s=15,g=40,v=18,x=8;class m extends o.R{merge(P){this.props.size=(0,l.Y)("max",this.props.size,P.size),this.props.label||(this.props.label=P.label),this.props.placement===r.vM.Auto&&(this.props.placement=P.placement)}getConfig(){let{scaleKey:P,label:C,show:S=!0,placement:R=r.vM.Auto,grid:L={show:!0},ticks:j,space:N,filter:V,gap:w=5,formatValue:M,splits:O,values:U,incrs:K,isTime:z,timeZone:G,theme:F,tickLabelRotation:W,size:H,color:Y,border:te,decimals:Z,distr:se=r.L4.Linear}=this.props;const ae=`${f}px ${F.typography.fontFamily}`,J=F.isDark?"rgba(240, 250, 255, 0.09)":"rgba(0, 10, 23, 0.09)";(0,n.j9)(P)&&(O=[0,1]),Z===0&&se===r.L4.Linear&&(V=(_,Q)=>Q.map(q=>Number.isInteger(q)?q:null));let k={scale:P,show:S,stroke:Y??F.colors.text.primary,side:u(R),font:ae,size:H??((_,Q,q)=>b(_,Q,q)),rotate:W,gap:w,labelGap:0,grid:{show:L.show,stroke:J,width:1/devicePixelRatio},ticks:Object.assign({show:!0,stroke:te?.show?Y??F.colors.text.primary:J,width:1/devicePixelRatio,size:4},j),splits:O,values:U,space:N??((_,Q,q,oe,re)=>E(_,Q,q,oe,re,M)),filter:V,incrs:K};return te?.show&&(k.border={stroke:Y??F.colors.text.primary,width:1/devicePixelRatio,...te}),C!=null&&C.length>0&&(k.label=C,k.labelSize=f+x,k.labelFont=ae,k.labelGap=x),U?k.values=U:M?k.values=(_,Q,q,oe,re)=>{let ee=(0,t.E)((0,t.h)(re,6));return Q.map(B=>B==null?null:M(B,ee>0?ee:void 0))}:z&&(k.values=y),k.timeZone=G,k}}const p={second:1e3,minute:60*1e3,hour:3600*1e3,day:1440*60*1e3,month:672*60*60*1e3,year:365*24*60*60*1e3};function y(D,P,C,S,R){const L=D.axes[C],j="timeZone"in L&&typeof L.timeZone=="string"?L.timeZone:void 0,N=D.scales.x,V=(N?.max??0)-(N?.min??0),w=Math.round(p.year/p.day)*p.day,M=Math.round(R/p.day)*p.day;let O=a.WC.interval.year;return RU==null?"":(0,c.LE)(U,{format:O,timeZone:j}))}function E(D,P,C,S,R,L){const j=D.axes[P],N=D.scales[j.scale];if(j.side!==2||!N)return R<=h?s:d;const V=R/g,w=(S-C)/V,M=Math.max(Math.abs(C),Math.abs(S));let O="";if(N.time)O=y(D,[M],P,g,w)[0];else if(L!=null)O=L(M);else return g;return(0,i.kD)(O,f).width+v}function b(D,P,C){const S=D.axes[C];let R=S.ticks.size;if(S.side===2)R+=S.gap+f;else if(P?.length){let L=P.reduce((N,V)=>Math.max(N,(0,i.kD)(V,f).width),0);const j=Math.min(D.width*.4,L);R+=S.gap+S.labelGap+j}return Math.ceil(R)}function u(D){switch(D){case r.vM.Top:return 0;case r.vM.Right:return 1;case r.vM.Bottom:return 2;case r.vM.Left:}return 3}},47276(ne,A,e){"use strict";e.d(A,{e:()=>b});var t=e(2543),n=e(36613),a=e(22592),c=e(62717),r=e(739),i=e(36192),o=e(23414),l=e(42073),f=e(64394),h=e(6773),d=e(62748),s=e(66650);class g extends d.R{getConfig(){const{facets:D,drawStyle:P,pathBuilder:C,pointsBuilder:S,pointsFilter:R,lineInterpolation:L,lineWidth:j,lineStyle:N,barAlignment:V,barWidthFactor:w,barMaxWidth:M,showPoints:O,pointSize:U,scaleKey:K,pxAlign:z,spanNulls:G,show:F=!0}=this.props;let W={},H=this.getLineColor();W.stroke=H,W.width=j,N&&N.fill!=="solid"&&(N.fill==="dot"&&(W.cap="round"),W.dash=N.dash??[10,10]),C!=null?W.paths=C:P===r.GR.Points?W.paths=()=>null:P!=null&&(W.paths=(Z,se,ae,J)=>x(P,L,V,w,M)(Z,se,ae,J));const Y=typeof H=="string"?H:(Z,se)=>Z.series[se]._stroke,te={points:{stroke:Y,fill:Y,size:!U||U"",pxAlign:z,show:F,fill:this.getFill(),...W,...te}}getLineColor(){const{lineColor:D,gradientMode:P,colorMode:C,thresholds:S,theme:R,hardMin:L,hardMax:j,softMin:N,softMax:V,dynamicSeriesColor:w}=this.props;return P===r.on.None&&w?(M,O)=>w(O)??D??f.F:P===r.on.Scheme&&C?.id!==f.Y.Fixed?(0,s.pl)(1,R,C,S,L,j,N,V):P===r.on.Hue?(0,s.B5)(D??f.F,1,R):D??f.F}getFill(){const{lineColor:D,fillColor:P,gradientMode:C,fillOpacity:S,colorMode:R,thresholds:L,theme:j,hardMin:N,hardMax:V,softMin:w,softMax:M,dynamicSeriesColor:O}=this.props;if(P)return P;const U=C??r.on.None,K=(S??0)/100;if(U===r.on.None&&O&&K>0)return(z,G)=>{let F=z.series[G]._stroke;return h.MV.alpha(F??"",K)};switch(U){case r.on.Opacity:return(0,s.WO)(P??D,K);case r.on.Hue:return(0,s.B5)(P??D,K,j);case r.on.Scheme:if(R?.id!==f.Y.Fixed)return(0,s.pl)(K,j,R,L,N,V,w,M);default:if(K>0)return h.MV.alpha(D??"",K)}}}let v;function x(u,D,P=r.Nj.Center,C=.6,S=200){const R=n.A.paths;if(v||(v={linear:R.linear(),smooth:R.spline(),stepBefore:R.stepped({align:-1}),stepAfter:R.stepped({align:1})}),u===r.GR.Bars){let L=`bars|${P}|${C}|${S}`;return v[L]||(v[L]=R.bars({size:[C,S],align:P})),v[L]}else if(u===r.GR.Line){if(D===r.dx.StepBefore)return v.stepBefore;if(D===r.dx.StepAfter)return v.stepAfter;if(D===r.dx.Smooth)return v.smooth}return v.linear}var m=e(84140),p=e(33553);function y(u){const D=u.config.mode===r.Ly.Dashed||u.config.mode===r.Ly.DashedAndArea?[10,10]:[];function P(O,U,K,z){let G=O.ctx,F=0;for(let W=0;W=W&&W>0?Y=(0,m.A)(z.visualization.getColorByName(K[W-1].color)):Y=(0,m.A)(z.visualization.getColorByName(H.color)),Y.getAlpha()===1&&Y.setAlpha(.7);const te=O.scales.x.ori===r.Lt.Horizontal,Z=O.valToPos(H.value,U,!0);let se=Math.round(te?O.bbox.left:Z),ae=Math.round(te?Z:O.bbox.top),J=Math.round(te?O.bbox.left+O.bbox.width:Z),k=Math.round(te?Z:O.bbox.top+O.bbox.height);G.beginPath(),G.moveTo(se,ae),G.lineTo(J,k),G.strokeStyle=Y.toString(),G.stroke()}}function C(O,U,K,z){let G=O.ctx,F=(0,s.Z8)(O,U,K.map(W=>{let H=(0,m.A)(z.visualization.getColorByName(W.color));return H.getAlpha()===1&&H.setAlpha(.15),[W.value,H.toString()]}),!0);G.fillStyle=F,G.fillRect(O.bbox.left,O.bbox.top,O.bbox.width,O.bbox.height)}const{scaleKey:S,thresholds:R,theme:L,config:j,hardMin:N,hardMax:V,softMin:w,softMax:M}=u;return O=>{const U=O.ctx,{min:K,max:z}=O.scales.x,{min:G,max:F}=O.scales[S];if(K==null||z==null||G==null||F==null)return;let{steps:W,mode:H}=R;if(H===p.O.Percentage){let[Y,te]=(0,s.EJ)(O,S,N,V,w,M),Z=te-Y;W=W.map(se=>({...se,value:Y+Z*(se.value/100)}))}switch(U.save(),j.mode){case r.Ly.Line:case r.Ly.Dashed:P(O,S,W,L);break;case r.Ly.Area:C(O,S,W,L);break;case r.Ly.LineAndArea:case r.Ly.DashedAndArea:C(O,S,W,L),P(O,S,W,L)}U.restore()}}const E={drag:{setScale:!1},points:{size:(u,D)=>u.series[D].points.size*2,width:(u,D,P)=>P/4},focus:{prox:30}};class b{constructor(D=a.lE){this.uid=Math.random().toString(36).slice(2),this.series=[],this.axes={},this.scales=[],this.bands=[],this.stackingGroups=[],this.hasLeftAxis=!1,this.hooks={},this.tz=void 0,this.mode=1,this.frames=void 0,this.thresholds={},this.padding=void 0,this.prepData=void 0,this.scaleKeys=["",""],this.tzDate=P=>{let C=new Date(P);return this.tz?n.A.tzDate(C,this.tz):C},this.tz=(0,c.QZ)(D,Date.now())?.ianaName}addHook(D,P){(0,i.uY)("UPlotConfigBuilder",!1,"addHook",D),this.hooks[D]||(this.hooks[D]=[]),this.hooks[D].push(P)}addThresholds(D){this.thresholds[D.scaleKey]||(this.thresholds[D.scaleKey]=D,this.addHook("drawClear",y(D)))}addAxis(D){D.placement=D.placement??r.vM.Auto,D.grid=D.grid??{};let P=D.scaleKey;if(P==="x"&&(P+=D.timeZone??""),this.axes[P]){this.axes[P].merge(D);return}D.placement===r.vM.Auto&&(D.placement=this.hasLeftAxis?r.vM.Right:r.vM.Left),D.placement===r.vM.Left&&(this.hasLeftAxis=!0),D.placement===r.vM.Hidden&&(D.grid.show=!1,D.size=0),this.axes[P]=new o.zH(D)}getAxisPlacement(D){return this.axes[D]?.props.placement??r.vM.Left}setCursor(D){this.cursor=(0,t.merge)({},this.cursor,D)}setMode(D){this.mode=D}setSelect(D){this.select=D}addSeries(D){this.series.push(new g(D))}getSeries(){return this.series}addScale(D){const P=this.scales.find(C=>C.props.scaleKey===D.scaleKey);if(P){P.merge(D);return}this.scales.push(new l.G(D))}addBand(D){this.bands.push(D)}setStackingGroups(D){this.stackingGroups=D}getStackingGroups(){return this.stackingGroups}setPrepData(D){this.prepData=P=>(this.frames=P,D(P,this.getStackingGroups()))}setPadding(D){this.padding=D}getConfig(){if(this.cachedConfig)return this.cachedConfig;const D={...i.NN,mode:this.mode,series:[this.mode===2?null:{value:()=>""}]};D.axes=this.ensureNonOverlappingAxes(Object.values(this.axes)).map(C=>C.getConfig()),D.series=[...D.series,...this.series.map(C=>C.getConfig())],D.scales=this.scales.reduce((C,S)=>({...C,...S.getConfig()}),{}),D.hooks=this.hooks,D.select=this.select;const P=(C="")=>(S,R)=>{let L=S.series[R].points._stroke;if(typeof L!="string"){let j=this.frames[0].fields[R];L=j.display(j.values[S.cursor.idxs[R]]).color}return L+C};return D.cursor=(0,t.merge)({},E,{points:{stroke:P("80"),fill:P()}},this.cursor),D.tzDate=this.tzDate,Array.isArray(this.padding)&&(D.padding=this.padding),this.stackingGroups.forEach(C=>{(0,i.Tz)(C).forEach(S=>{this.addBand(S)})}),this.bands.length&&(D.bands=this.bands),this.cachedConfig=D,D}ensureNonOverlappingAxes(D){const P=D.find(R=>R.props.scaleKey==="x"),C=D.filter(R=>R.props.grid?.show===void 0),S=C.findIndex(R=>R.props.placement===r.vM.Left||R.props.placement===r.vM.Right||R.props.placement===r.vM.Bottom&&R!==P);for(let R=0;Ri,Y:()=>o});var t=e(36613),n=e(74261),a=e(55386),c=e(739),r=e(62748);class i extends r.R{merge(f){this.props.min=o("min",this.props.min,f.min),this.props.max=o("max",this.props.max,f.max)}getConfig(){let{isTime:f,auto:h,scaleKey:d,min:s,max:g,softMin:v,softMax:x,range:m,direction:p,orientation:y,centeredZero:E,decimals:b,stackingMode:u,padMinBy:D=.1,padMaxBy:P=.1}=this.props;u===c.gs.Percent&&(s==null&&v==null&&(v=0),g==null&&x==null&&(x=1));const C=this.props.distribution,S=f?{}:{distr:C===c.L4.Symlog?4:C===c.L4.Log?3:C===c.L4.Ordinal?2:1,log:C===c.L4.Log||C===c.L4.Symlog?this.props.log??2:void 0,asinh:C===c.L4.Symlog?this.props.linearThreshold??1:void 0};if(C===c.L4.Log){let O=this.props.log,U=O===2?Math.log2:Math.log10;s!=null&&(s<=0?s=null:s=O**Math.floor(U(s))),g!=null&&(g<=0?g=null:g=O**Math.ceil(U(g))),v!=null&&(v<=0?v=null:v=O**Math.floor(U(v))),x!=null&&(x<=0?x=null:x=O**Math.ceil(U(x)))}let R=v==null?3:1,L=x==null?3:1;const j={min:{pad:D,hard:s??-1/0,soft:v||0,mode:R},max:{pad:P,hard:g??1/0,soft:x||0,mode:L}};let N=v==null&&s!=null,V=x==null&&g!=null,w=N&&V;const M=(O,U,K,z)=>{const G=O.scales[z];let F=[U,K];if(!w&&U==null&&K==null)return F;let W=G.log??10;if(G.distr===1||G.distr===2||G.distr===4){if(E){let H=Math.abs(U),Y=Math.abs(K),te=Math.max(H,Y);te===0&&(te=80),U=-te,K=te}G.distr===4?F=t.A.rangeAsinh(U,K,W,!0):F=t.A.rangeNum(N?s:U,V?g:K,j)}else G.distr===3&&(F=t.A.rangeLog(s??U,g??K,W,!0));if(b===0)if(G.distr===1||G.distr===2)F[0]=(0,n.rs)(F[0],1),F[1]=(0,n.Uh)(F[1],1);else if(G.distr===3){let H=G.log===2?Math.log2:Math.log10;if(F[0]<=1)F[0]=1;else{let te=Math.floor(H(F[0]));F[0]=W**te}let Y=Math.ceil(H(F[1]));F[1]=W**Y,F[0]===F[1]&&(F[1]*=W)}else G.distr===4&&(F[0]=(0,n.rs)(F[0],1),F[1]=(0,n.Uh)(F[1],1));return(G.distr===1||G.distr===4)&&(N&&(F[0]=s),V&&(F[1]=g)),F[0]>=F[1]&&(F[0]=G.distr===3?1:0,F[1]=100),F};return h??=!f&&!w,(0,a.j9)(d)&&(h=!1,m=[0,1]),{[d]:{time:f,auto:h,range:m??M,dir:p,ori:y,...S}}}}function o(l,f,h){const d=f!=null,s=h!=null;return d?s?l==="min"?fh?f:h:f:h}},66650(ne,A,e){"use strict";e.d(A,{B5:()=>f,EJ:()=>g,WO:()=>l,Z8:()=>d,pl:()=>x});var t=e(84140),n=e(6773),a=e(64394),c=e(33553),r=e(739),i=e(53568);function o(m,p,y){let E=0,b=0,u=0,D=0;return m===3?(b=p.top,D=p.top+p.height):m===2?(E=p.left+p.width,u=p.left):m===1?(b=p.top+p.height,D=p.top):m===0&&(E=p.left,u=p.left+p.width),y.createLinearGradient(E,b,u,D)}function l(m,p){return(y,E)=>{const b=(0,i.Yc)(),u=o(y.scales.x.ori===r.Lt.Horizontal?3:2,y.bbox,b);return u.addColorStop(0,n.MV.alpha(m,p)),u.addColorStop(1,n.MV.alpha(m,0)),u}}function f(m,p,y){return(E,b)=>{const u=(0,i.Yc)(),D=o(E.scales.x.ori===r.Lt.Horizontal?3:2,E.bbox,u),P=(0,t.A)(m).spin(-25).darken(5),C=(0,t.A)(m).saturate(20).spin(20).brighten(10);return y.isDark?(D.addColorStop(0,C.lighten(10).setAlpha(p).toString()),D.addColorStop(1,P.darken(10).setAlpha(p).toString())):(D.addColorStop(0,C.lighten(10).setAlpha(p).toString()),D.addColorStop(1,P.setAlpha(p).toString())),D}}var h=(m=>(m[m.Right=0]="Right",m[m.Up=1]="Up",m[m.Left=2]="Left",m[m.Down=3]="Down",m))(h||{});function d(m,p,y,E=!1){let b=m.scales[p],u=null,D=null;for(let K=0;K=b.max)break}if(u===D)return y[u][1];let P=y[u][0],C=y[D][0];P===-1/0&&(P=b.min),C===1/0&&(C=b.max);let S=Math.round(m.valToPos(P,p,!0)),R=Math.round(m.valToPos(C,p,!0)),L=S-R;if(L===0)return y[D][1];let j,N,V,w;m.scales.x.ori===r.Lt.Horizontal?(j=V=0,N=S,w=R):(N=w=0,j=S,V=R);let O=(0,i.Yc)().createLinearGradient(j,N,V,w),U;for(let K=u;K<=D;K++){let z=y[K],G=K===u?S:K===D?R:Math.round(m.valToPos(z[0],p,!0)),F=(S-G)/L;E&&K>u&&O.addColorStop(F,U),O.addColorStop(F,U=z[1])}return O}function s(m,p){let y=m.scales[p],E=1/0,b=-1/0;return m.series.forEach((u,D)=>{if(u.show&&u.scale===p)if(u.min==null){let P=m.data[D];for(let C=0;C{let R=C.series[S].scale,L="";if(y.id===a.Y.Thresholds)if(E.mode===c.O.Absolute){const j=E.steps.map(N=>[N.value,v(N.color)?"#0000":n.MV.alpha(p.visualization.getColorByName(N.color),m)]);L=d(C,R,j,!0)}else{const[j,N]=g(C,R,b,u,D,P),V=N-j,w=E.steps.map(M=>[j+V*(M.value/100),n.MV.alpha(p.visualization.getColorByName(M.color),m)]);L=d(C,R,w,!0)}else if(y.getColors){const j=y.getColors(p),[N,V]=g(C,R,b,u,D,P),w=V-N,M=j.map((O,U)=>[N+w*(U/(j.length-1)),n.MV.alpha(p.visualization.getColorByName(O),m)]);L=d(C,R,M,!1)}return L}}},7515(ne,A,e){"use strict";e.d(A,{a:()=>i});var t=e(74848),n=e(96540),a=e(1604),c=e(73858),r=e(16477);function i({id:o,events:l,renderEventMarker:f,mapEventToXYCoords:h,config:d}){const s=(0,n.useRef)(),[g,v]=(0,n.useState)(0),x=(0,a.A)();(0,n.useLayoutEffect)(()=>{d.addHook("init",p=>{s.current=p}),d.addHook("draw",()=>{x()&&v(p=>p+1)})},[d,v]);const m=(0,n.useMemo)(()=>{const p=[];if(!s.current||l.length===0)return p;for(let y=0;yn});var t=e(74848);const n=({x:a,y:c,children:r})=>(0,t.jsx)("div",{style:{position:"absolute",top:`${c}px`,left:`${a}px`},children:r})},16477(ne,A,e){"use strict";e.d(A,{_:()=>c});var t=e(74848),n=e(22803),a=e(96540);const c=({children:r,left:i,top:o})=>{const l=(0,a.useMemo)(()=>(0,n.css)({position:"absolute",overflow:"visible",left:`${i}px`,top:`${o}px`}),[i,o]);return(0,t.jsx)("div",{className:l,children:r})}},70332(ne,A,e){"use strict";e.d(A,{M:()=>a});var t=e(739),n=e(62748);function a(r,i){const l=`${r.min!==void 0?r.min:"na"}-${r.max!==void 0?r.max:"na"}`,f=`${r.custom?.axisSoftMin!==void 0?r.custom.axisSoftMin:"na"}-${r.custom?.axisSoftMax!==void 0?r.custom.axisSoftMax:"na"}`,h=`${r.custom?.axisPlacement!==void 0?r.custom?.axisPlacement:t.vM.Auto}`,d=r.unit??n.s,s=r.custom?.scaleDistribution?c(r.custom.scaleDistribution):t.L4.Linear,g=r.custom?.axisLabel?r.custom.axisLabel:"na";return`${d}/${l}/${f}/${h}/${s}/${g}/${i}`}function c(r){return r.type===t.L4.Log?`${r.type}${r.log}`:r.type}},84522(ne,A,e){"use strict";e.d(A,{J:()=>r});var t=e(74848),n=e(22803),a=e(76319),c=e(63142);const r=({onClick:o,"aria-label":l,style:f})=>{const h=(0,c.of)(i);return(0,t.jsx)(a.K,{"aria-label":l??"Close",className:h,name:"times",onClick:o,style:f})},i=o=>(0,n.css)({position:"absolute",margin:"0px",right:5,top:6})},18667(ne,A,e){"use strict";e.d(A,{K:()=>l});var t=e(2543),n=e.n(t),a=e(96540),c=e(64423),r=e(99165),i=e(57852),o=e(32899);const l=({config:f,eventBus:h,frame:d})=>{const s=(0,a.useRef)(d);return s.current=d,(0,a.useLayoutEffect)(()=>{let g=null;const v={point:{time:null},data:s.current};f.addHook("init",D=>{g=D});let x=null;f.addHook("setSeries",(D,P)=>{x=P}),f.addHook("setLegend",()=>{if(!(g.cursor.event==null)){let P=g.cursor.idxs.find(C=>C!=null);if(P==null)u();else{let C=P,S=x,R=g.data[0]??g.data[1][0];v.point.time=R[C],v.rowIndex=C??void 0,v.columnIndex=S??void 0,v.data=s.current;let L=g.cursor.top;v.point.panelRelY=L===0?.001:L>0?L/g.rect.height:1,b()}}});function m(D){const P=D.payload?.point?.time;if(P){const C=g.valToPos(P,"x");g.setCursor({left:C,top:g.rect.height/2})}}const p=new c.yU,y=new i.b_(v).setTags(["uplot"]),E=new i.ql().setTags(["uplot"]);let b=(0,t.throttle)(()=>{h.publish(y)},100),u=(0,t.throttle)(()=>{h.publish(E)},100);return p.add(h.getStream(i.b_).subscribe({next:D=>{h===D.origin||D.tags?.has("uplot")||m(D)}})),p.add(h.getStream(o.kb).subscribe({next:D=>m(D)})),p.add(h.getStream(i.ql).pipe((0,r.c)(50)).subscribe({next:D=>{h===D.origin||D.tags?.has("uplot")||g.cursor._lock||g.setCursor({left:-10,top:-10})}})),()=>{p.unsubscribe()}},[f]),null}},93630(ne,A,e){"use strict";e.d(A,{Z:()=>l});var t=e(2543),n=e.n(t),a=e(96540);const c=.1,r=2,i=new Set(["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Shift"," "]),o=f=>{let h=f.root,d=new Set,s=null,g=null;if(!h)return;h.tabIndex=0;const v=(u,D)=>{const{cursor:P}=f;if(P.left===void 0||P.top===void 0)return;const{width:C,height:S}=f.over.style,[R,L]=[Math.floor(parseFloat(C)),Math.floor(parseFloat(S))];f.setCursor({left:(0,t.clamp)(P.left+u,0,R),top:(0,t.clamp)(P.top+D,0,L)})},x=u=>{if(d.size===0||!f){g=null;return}const C=(u-(g??u))*c;let S=0,R=0;d.has("ArrowUp")&&(R-=C),d.has("ArrowDown")&&(R+=C),d.has("ArrowLeft")&&(S-=C),d.has("ArrowRight")&&(S+=C),d.has("Shift")&&(S*=r,R*=r),v(S,R);const{cursor:L}=f;if(d.has(" ")&&L){const j=Number(f.over.style.height.slice(0,-2));f.setSelect({left:L.left{if(u.key==="Tab"){f.setCursor({left:-5,top:-5});return}if(!i.has(u.key))return;if(u.preventDefault(),u.stopPropagation(),!d.has(u.key)){const P=d.size===0;d.add(u.key),s=u.key===" "&&s===null?f.cursor.left:s,P&&window.requestAnimationFrame(x)}},p=u=>{i.has(u.key)&&(d.delete(u.key),u.key===" "&&(u.preventDefault(),u.stopPropagation(),f.setSelect(f.select),s=null))},y=()=>{if(!h?.matches(":focus-visible"))return;const u=parseFloat(f.over.style.width),D=parseFloat(f.over.style.height);f.setCursor({left:u/2,top:D/2})},E=()=>{g=null,s=null,d.clear(),f.setSelect({left:0,top:0,width:0,height:0},!1)};h.addEventListener("keydown",m),h.addEventListener("keyup",p),h.addEventListener("focus",y),h.addEventListener("blur",E);const b=()=>{h?.removeEventListener("keydown",m),h?.removeEventListener("keyup",p),h?.removeEventListener("focus",y),h?.removeEventListener("blur",E),h=null};(f.hooks.destroy??=[]).push(b)},l=({config:f})=>((0,a.useLayoutEffect)(()=>f.addHook("init",o),[f]),null)},69234(ne,A,e){"use strict";e.d(A,{b3:()=>d,xl:()=>E});var t=e(74848),n=e(22803),a=e(96540),c=e(40961),r=e(21275),i=e(63142),o=e(15245),l=e(84522);const f=void 0,h=10;var d=(u=>(u[u.xOne=0]="xOne",u[u.xAll=1]="xAll",u[u.xyOne=2]="xyOne",u))(d||{});function s(u,D){return{...u,...D,style:{...u.style,...D.style}}}function g(){return{style:{transform:"",pointerEvents:"none"},isHovering:!1,isPinned:!1,contents:null,plot:null,dismiss:()=>{}}}const v=5,x=u=>u!=null&&!u.ctrlKey&&!u.metaKey,m=()=>[],p=()=>[],y=/Android|iPhone|iPad/i.test(navigator.userAgent),E=({config:u,hoverMode:D,render:P,clientZoom:C=!1,queryZoom:S,onSelectRange:R,maxWidth:L,syncMode:j=r.yV.Off,syncScope:N="global",getDataLinks:V=m,getAdHocFilters:w=p})=>{const M=(0,a.useRef)(null),O=(0,a.useRef)(null);O.current==null&&(O.current=(0,o.gF)());const[{plot:U,isHovering:K,isPinned:z,contents:G,style:F,dismiss:W},H]=(0,a.useReducer)(s,null,g),Y=(0,a.useRef)(),te=(0,i.of)(b,L),Z=(0,a.useRef)(P);Z.current=P;const se=(0,a.useRef)(V);se.current=V;const ae=(0,a.useRef)(w);return ae.current=w,(0,a.useLayoutEffect)(()=>{Y.current?.observer.disconnect(),Y.current={width:0,height:0,observer:new ResizeObserver(me=>{let De=Y.current;for(const xe of me)xe.borderBoxSize?.length>0?(De.width=xe.borderBoxSize[0].inlineSize,De.height=xe.borderBoxSize[0].blockSize):(De.width=xe.contentRect.width,De.height=xe.contentRect.height)})};let J=!1,k=!1,_=U,Q=K,q=!1,oe=z,re=F,ee=!1;const B=j===r.yV.Tooltip;j!==r.yV.Off&&u.scales[0].props.isTime&&u.setCursor({sync:{key:N,scales:["x",null]}});const ie=()=>{je?Q=ee&&q&&B:Q=Se!=null||D===1&&q};let de=0,fe=0,ce=null,ve=[],Se=null,je=!1,Ve=[],he=[],Ue=[],pe=!1,be=!1;const ze=(me=!1)=>{pe||(Q?queueMicrotask(Ie):setTimeout(Ie,100),pe=!0),me&&(be=!0)},Ne=me=>{me.target.closest('[role="dialog"], #grafana-portal-container')==null&&ke()},Ie=()=>{pe=!1,be&&(re={pointerEvents:oe?"all":"none"},_.cursor._lock=oe,oe?(document.addEventListener("mousedown",Ne,!0),document.addEventListener("keydown",Ne,!0)):(document.removeEventListener("mousedown",Ne,!0),document.removeEventListener("keydown",Ne,!0)),be=!1);let me={style:re,isPinned:oe,isHovering:Q,contents:Q||ce!=null?Z.current(_,ve,Se,oe,ke,ce,je,oe?Ve:Se!=null?Ue[Se]:[],oe?he:[]):null,dismiss:ke};H(me),ce=null},ke=()=>{let me=oe;oe=!1,Q=!1,_.setCursor({left:-10,top:-10}),Ve=[],he=[],ze(me)};u.addHook("init",me=>{H({plot:_=me}),C&&me.over.addEventListener("mousedown",De=>{if(x(De)&&De.button===0&&De.shiftKey){k=!0,me.cursor.drag.x=!1,me.cursor.drag.y=!0;let xe=Me=>{me.cursor.drag.x=!0,me.cursor.drag.y=!1,document.removeEventListener("mouseup",xe,!0)};document.addEventListener("mouseup",xe,!0)}},!0),me.over.addEventListener("click",De=>{if(De.target===me.over){if(De.ctrlKey||De.metaKey){let xe;me.scales.x.ori===0?xe=me.posToVal(me.cursor.left,"x"):xe=me.posToVal(me.select.top+me.select.height,"x"),ce={from:xe,to:xe},ze(!1)}else if(Q&&!oe&&Se!=null){Ve=se.current(Se,ve[Se]),he=ae.current(Se,ve[Se]);const xe=Ve.find(Me=>Me.oneClick===!0);xe!=null?window.open(xe.href,xe.target??"_self"):setTimeout(()=>{oe=!0,ze(!0)},0)}}})}),u.addHook("setSelect",me=>{const De=me.scales.x.ori===0;if(!je&&(C||S!=null))if(x(me.cursor.event)){if(R!=null){let xe=[];const Me=!!me.cursor.drag.y,Be=!!me.cursor.drag.x;let Oe=null,Re=[];Be&&(Oe={from:De?me.posToVal(me.select.left,"x"):me.posToVal(me.select.top+me.select.height,"x"),to:De?me.posToVal(me.select.left+me.select.width,"x"):me.posToVal(me.select.top,"x")}),Me&&u.scales.forEach(we=>{const Ce=we.props.scaleKey;if(Ce!=="x"){let _e={from:De?me.posToVal(me.select.top+me.select.height,Ce):me.posToVal(me.select.left+me.select.width,Ce),to:De?me.posToVal(me.select.top,Ce):me.posToVal(me.select.left,Ce)};Re.push(_e)}}),Be?Me?xe=Re.map(we=>({x:Oe,y:we})):xe=[{x:Oe}]:Me&&(xe=Re.map(we=>({y:we}))),R(xe)}else if(C&&k){if(me.select.height>=v){for(let xe in me.scales)if(xe!=="x"){const Me=De?me.posToVal(me.select.top,xe):me.posToVal(me.select.left+me.select.width,xe),Be=De?me.posToVal(me.select.top+me.select.height,xe):me.posToVal(me.select.left,xe);me.setScale(xe,{min:Be,max:Me})}J=!0}k=!1}else if(S!=null&&me.select.width>=v){const xe=De?me.posToVal(me.select.left,"x"):me.posToVal(me.select.top+me.select.height,"x"),Me=De?me.posToVal(me.select.left+me.select.width,"x"):me.posToVal(me.select.top,"x");S({from:xe,to:Me}),J=!1}}else ce={from:De?me.posToVal(me.select.left,"x"):me.posToVal(me.select.top+me.select.height,"x"),to:De?me.posToVal(me.select.left+me.select.width,"x"):me.posToVal(me.select.top,"x")},ze(!0);me.setSelect({left:0,width:0,top:0,height:0},!1)}),(C||S!=null)&&u.setCursor({bind:{dblclick:me=>()=>{if(!x(me.cursor.event))return null;if(C&&J){for(let De in me.scales)De!=="x"&&me.setScale(De,{min:null,max:null});J=!1}else if(S!=null){let De=me.scales.x;const xe=De.min,Me=De.max,Be=(Me-xe)/2;S({from:xe-Be,to:Me+Be})}return null}}}),u.addHook("setData",me=>{J=!1,k=!1,oe&&ke()}),u.addHook("setSeries",(me,De)=>{Se=De,je=me.cursor.event==null,ie(),ze()}),u.addHook("setLegend",me=>{ve=_?.cursor.idxs.slice(),q=ve.some((xe,Me)=>Me>0&&xe!=null),Ue.length===0&&(Ue=ve.map((xe,Me)=>{if(Me>0){const Oe=V(Me,ve[Me]).find(Re=>Re.oneClick===!0);if(Oe)return[Oe]}return[]})),je=me.cursor.event==null;let De=Q;ie(),(Q||Q!==De)&&ze()});const Ee=16;let Ae=0,$e=0;const Fe=()=>{Q&&!oe&&ke(),Ae=window.innerWidth-Ee,$e=window.innerHeight-Ee},We=()=>{ee=_.rect.bottom<=$e&&_.rect.top>=0&&_.rect.left>=0&&_.rect.right<=Ae};Fe(),u.addHook("ready",We),u.addHook("setCursor",me=>{if(je=me.cursor.event==null,!Q)return;let{left:De=-10,top:xe=-10}=me.cursor;if(De>=0||xe>=0){let Me=me.rect.left+De,Be=me.rect.top+xe,Oe="",{width:Re,height:we}=Y.current;Re+=h,we+=h,fe!==0?Be+we<$e||Be-we<0?fe=0:fe!==-we&&(fe=-we):Be+we>$e&&Be-we>=0&&(fe=-we),de!==0?Me+ReAe&&Me-Re>=0&&(de=-Re);const Ce=Me+(de===0?h:-h),_e=Be+(fe===0?h:-h);Oe=`translateX(${Ce}px) ${de===0?"":"translateX(-100%)"} translateY(${_e}px) ${fe===0?"":"translateY(-100%)"}`,M.current!=null?M.current.style.transform=Oe:(re.transform=Oe,ze())}});const Ge=me=>{We(),Q&&me.target instanceof Node&&me.target.contains(_.root)&&ke()};return window.addEventListener("resize",Fe),window.addEventListener("scroll",Ge,!0),()=>{Y.current?.observer.disconnect(),window.removeEventListener("resize",Fe),window.removeEventListener("scroll",Ge,!0),document.removeEventListener("mousedown",Ne,!0),document.removeEventListener("keydown",Ne,!0)}},[u]),(0,a.useLayoutEffect)(()=>{const J=Y.current;if(M.current!=null){J.observer.disconnect(),J.observer.observe(M.current);const{width:k,height:_}=M.current.getBoundingClientRect();J.width=k,J.height=_;let Q=U.cursor.event;if(Q!=null){const q=Q.type!=="mousemove"||y;q&&(Q=new MouseEvent("mousemove",{view:window,bubbles:!0,cancelable:!0,clientX:Q.clientX,clientY:Q.clientY,screenX:Q.screenX,screenY:Q.screenY})),!(q?!1:performance.now()-Q.timeStamp>16)&&U.over.dispatchEvent(Q)}else U.setCursor({left:U.cursor.left,top:U.cursor.top},!0)}else J.width=0,J.height=0},[K]),U&&K?(0,c.createPortal)((0,t.jsxs)("div",{className:(0,n.cx)(te.tooltipWrapper,z&&te.pinned),style:F,"aria-live":"polite","aria-atomic":"true",ref:M,children:[z&&(0,t.jsx)(l.J,{onClick:W}),G]}),O.current):null},b=(u,D)=>({tooltipWrapper:(0,n.css)({top:0,left:0,zIndex:u.zIndex.tooltip,whiteSpace:"pre",borderRadius:u.shape.radius.default,position:"fixed",background:u.colors.background.elevated,border:`1px solid ${u.colors.border.weak}`,boxShadow:u.shadows.z2,userSelect:"text",maxWidth:D??"none"}),pinned:(0,n.css)({boxShadow:u.shadows.z3})})},62748(ne,A,e){"use strict";e.d(A,{R:()=>n,s:()=>t});const t="__fixed";class n{constructor(c){this.props=c}}},36192(ne,A,e){"use strict";e.d(A,{NN:()=>l,Tz:()=>h,UO:()=>m,bq:()=>s,ro:()=>d,sw:()=>g,uY:()=>y});var t=e(11576),n=e(46644),a=e(739),c=e(20720),r=e(60379),i=e(70332);const o=(E,b,u)=>{let D=b%2?u[0]||u[2]:u[1]||u[3];return u[b]||!D?0:8},l={ms:1,focus:{alpha:1},cursor:{focus:{prox:30}},legend:{show:!1},padding:[o,o,o,o],series:[],hooks:{}};var f=(E=>(E[E.Pos=1]="Pos",E[E.Neg=-1]="Neg",E))(f||{});function h(E){let b=[],{series:u,dir:D}=E,P=u.length-1,C=u.slice().reverse();return C.forEach((S,R)=>{if(R!==P){let L=C[R+1];b.push({series:[S,L],dir:-1*D})}}),b}function d(E){let b=new Map;return E.fields.forEach(({config:u,values:D,type:P},C)=>{if(C===0)return;let{custom:S}=u;if(S==null||S.hideFrom?.viz)return;let{stacking:R}=S;if(R==null)return;let{mode:L,group:j}=R;if(L===a.gs.None)return;let N=S.transform,V=v(N,D),w=S.drawStyle,M=w===a.GR.Bars?S.barAlignment:w===a.GR.Line?S.lineInterpolation:null,O=`${V}|${L}|${j}|${(0,i.M)(u,P)}|${w}|${M}`,U=b.get(O);U==null&&(U={series:[],dir:V},b.set(O,U)),U.series.push(C)}),[...b.values()]}function s(E,b,u){let D=Array(E.fields.length),P=b.length,C=E.length,S=P>0?Array(C).fill(0):[],R=P>0?Array(C).fill(!1):[],L=Array.from({length:P},()=>S.slice()),j=Array.from({length:P},()=>R.slice());if(b.forEach((N,V)=>{let w=j[V];N.series.forEach(M=>{let O=E.fields[M];if(O.config.custom?.hideFrom?.viz)return;let U=O.values;for(let K=0;K{let w=N.values;if(V===0){D[V]=w;return}let{custom:M}=N.config;if(!M||M.hideFrom?.viz){D[V]=w;return}if(M.transform===a.NU.Constant){let U=w.findIndex(z=>z!=null),K=w[U];w=Array(w.length).fill(void 0),w[U]=K}else if(w=w.slice(),M.transform===a.NU.NegativeY)for(let U=0;UF.series.indexOf(V)>-1),K=L[U],z=j[U],G=D[V]=Array(C);for(let F=0;F{let M=b.findIndex(O=>O.series.indexOf(w)>-1);return M!==-1?L[M]:V});u({totals:N})}return E.fields.forEach((N,V)=>{if(V===0||N.config.custom?.hideFrom?.viz)return;if(N.config.custom?.stacking?.mode===a.gs.Percent){let M=b.findIndex(z=>z.series.indexOf(V)>-1),O=L[M],U=b[M],K=D[V];for(let z=0;zC&&(C=E.data[R][b],D=R),S==null?S=j:j=D&&E[P]==null;)P--;let C=0,S=0;if(P>=D){const R=Math.max(1,Math.floor((P-D+1)/b));for(let L=D;L<=P;L+=R){const j=E[L];j!=null&&typeof j=="number"&&(j<0||Object.is(j,-0)?C++:j>0&&S++)}if(C>S)return!0}return!1}const m=(E,b,u)=>{if(!E?.length)return[];const D=R=>R==null?"-":R.toFixed(1),P=b.display??D;let C=null;const S=(0,n.Nw)({field:b,reducers:E});return E.map(R=>{const L=n.AS.get(R);let j=P;return L.id===n.gy.diffperc&&(j=(0,t.J)({field:{...b,config:{...b.config,unit:"percent"}},theme:u})),(L.id===n.gy.count||L.id===n.gy.changeCount||L.id===n.gy.distinctCount)&&(C||(C=(0,t.J)({field:{...b,config:{...b.config,unit:"none"}},theme:u})),j=C),{...j(S[R]),title:L.name,description:L.description}})},p=(0,r.h)("uPlot"),y=p.logger;(0,c.h)("graphng",void 0,p)},565(ne,A,e){"use strict";e.r(A),e.d(A,{ALERTING_COLOR:()=>ka.xj,Alert:()=>ba.F,AlertingSettings:()=>Ft,AsyncMultiSelect:()=>ws.Iv,AsyncSelect:()=>ws.DW,AsyncVirtualizedSelect:()=>ws.gZ,AutoSaveField:()=>pt,AutoSizeInput:()=>pl.D,Avatar:()=>Pl.e,AxisPlacement:()=>ia.vM,Badge:()=>qo.E,BarAlignment:()=>ia.Nj,BarGauge:()=>Qn.xE,BarGaugeDisplayMode:()=>ia.eX,BarValueVisibility:()=>ia.yL,BigValue:()=>kn.yV,BigValueColorMode:()=>kn.yp,BigValueGraphMode:()=>kn.$p,BigValueJustifyMode:()=>kn.F8,BigValueTextMode:()=>kn.SV,Box:()=>qi.a,BracesPlugin:()=>Ri,BrowserLabel:()=>Ml.J,Button:()=>pe.$n,ButtonCascader:()=>Ne,ButtonGroup:()=>Yo.e,ButtonSelect:()=>yl.f,CallToActionCard:()=>_s.c,Card:()=>si.Z,CardContainer:()=>ri.Q,Carousel:()=>he.F,Cascader:()=>Ve.v,CertificationKey:()=>an.K,Checkbox:()=>gl.S,ClearPlugin:()=>Kl.v,ClickOutsideWrapper:()=>me.N,ClipboardButton:()=>je.b,ClipboardPlugin:()=>dc.s,CodeEditor:()=>on.B,CodeEditorSuggestionItemKind:()=>Sn.q,CollapsableSection:()=>ys.M,Collapse:()=>Ua.S,ColorPicker:()=>$e.sk,ColorPickerInput:()=>Me,Combobox:()=>ul.G,CompletionItemKind:()=>Na.I,ConfirmButton:()=>ee.Z,ConfirmModal:()=>Gt.u,Container:()=>to.mc,ContextMenu:()=>kr.t,ControlledCollapse:()=>Ua.a,Counter:()=>Ht.p,CustomHeadersSettings:()=>So.P,CustomScrollbar:()=>ve.E,DEFAULT_ANNOTATION_COLOR:()=>ka.Mk,DOMUtil:()=>n,DataLinkButton:()=>Ks.R,DataLinkInput:()=>cr.l,DataLinksContextMenu:()=>jr.e,DataLinksInlineEditor:()=>To.e,DataLinksInlineEditorBase:()=>ks.J,DataSourceHttpSettings:()=>xr.t,DatePicker:()=>it.l,DatePickerWithInput:()=>ct.l,DateTimePicker:()=>xt.K,DeleteButton:()=>B.e,Divider:()=>Za.c,DrawStyle:()=>ia.GR,Drawer:()=>ur._,Dropdown:()=>ao.m,ElementSelectionContext:()=>ma._,EmptySearchResult:()=>Re.Z,EmptyState:()=>we.p,ErrorBoundary:()=>yr.tH,ErrorBoundaryAlert:()=>yr.Xw,ErrorWithStack:()=>Xr.D,EventBusPlugin:()=>di.K,EventsCanvas:()=>Tl.a,EventsWithValidation:()=>Ea.Pw,FIXED_UNIT:()=>ui.s,FadeTransition:()=>In.A,FeatureBadge:()=>za.y,FeatureInfoBox:()=>Zs,Field:()=>_t.D,FieldArray:()=>qr,FieldLinkList:()=>Ts,FieldSet:()=>er.n,FieldValidationMessage:()=>sl.P,FileDropzone:()=>ai.gH,FileDropzoneDefaultChildren:()=>ai.wI,FileListItem:()=>Ka.I,FileUpload:()=>ni.e,FilterInput:()=>ml.Z,FilterPill:()=>Lt.m,Form:()=>_i.l,FormattedValueDisplay:()=>Ro.i,FullWidthButtonContainer:()=>vr,Gauge:()=>Hn._,GlobalStyles:()=>wr.k,Graph:()=>xi,GraphContextMenu:()=>oo,GraphContextMenuHeader:()=>mi,GraphGradientMode:()=>ia.on,GraphNG:()=>Mi,GraphSeriesToggler:()=>Bo,GraphThresholdsStyleMode:()=>ia.Ly,GraphWithLegend:()=>Ei,Grid:()=>Zo.x,HorizontalGroup:()=>to.Gy,Icon:()=>o.I,IconButton:()=>re.K,IndentationPlugin:()=>Wc.T,InfoBox:()=>As.w,InlineField:()=>Mt.I,InlineFieldRow:()=>ol.C,InlineFormLabel:()=>Er.I,InlineLabel:()=>ha.c,InlineSegmentGroup:()=>rl.e,InlineSwitch:()=>dr.K,InlineToast:()=>ke.r,Input:()=>js.p,InputControl:()=>Yi.e,InteractiveTable:()=>vt.j,JSONFormatter:()=>Jr.B,JsonExplorer:()=>Ur.O,KeyboardPlugin:()=>Sl.Z,Label:()=>nl.J,LegacyForms:()=>uc,LegacyInputStatus:()=>c.O,Legend:()=>al.s,LegendDisplayMode:()=>ia.lm,LineInterpolation:()=>ia.dx,Link:()=>Xi.N,LinkButton:()=>pe.z9,List:()=>dt.B,LoadingBar:()=>Ae.G,LoadingPlaceholder:()=>Ee._,Marker:()=>ci.p,Menu:()=>Do.W,MenuGroup:()=>Lr.r,MenuItem:()=>Yr.D,Modal:()=>la.a,ModalHeader:()=>ca.r,ModalRoot:()=>pa.EO,ModalTabContent:()=>Gn,ModalTabsHeader:()=>Zn.J,ModalsContext:()=>pa.wE,ModalsController:()=>pa.$s,ModalsProvider:()=>pa.YO,MultiCombobox:()=>eo.f,MultiSelect:()=>ws.KF,NO_DATA_COLOR:()=>ka.nO,NewlinePlugin:()=>Kc.O,NodeGraphDataFrameFieldNames:()=>mr,OK_COLOR:()=>ka.Xw,PENDING_COLOR:()=>ka.ct,PageToolbar:()=>da.d,Pagination:()=>Ct.d,PanelChrome:()=>rn.NR,PanelChromeLoadingIndicator:()=>vn.I,PanelContainer:()=>Ol._,PanelContextProvider:()=>Dn.XF,PanelContextRoot:()=>Dn.e4,PlotLegend:()=>Nr.$,PluginSignatureBadge:()=>so.B,PointVisibility:()=>ia.yL,Popover:()=>de.A,PopoverController:()=>ie.I,Portal:()=>ce.ZL,PortalContainer:()=>ce.qB,QueryField:()=>qt.X,REGION_FILL_ALPHA:()=>ka.UJ,RadioButtonDot:()=>hl.J,RadioButtonGroup:()=>no.z,RadioButtonList:()=>fl.a,RangeSlider:()=>Qi.F,ReactMonacoEditor:()=>Pn.m,ReactUtils:()=>oe,RefreshPicker:()=>Je.cC,RelativeTimeRangePicker:()=>vl.N,RenderUserContentAsHTML:()=>Bn.I,RunnerPlugin:()=>Fc.U,SCHEMA:()=>Ya.yx,ScaleDirection:()=>ia.ON,ScaleDistribution:()=>ia.L4,ScaleOrientation:()=>ia.Lt,ScrollContainer:()=>E.P,SearchFunctionType:()=>ps.T,SecretInput:()=>ei.L4,SecretTextArea:()=>ti.lp,SecureSocksProxySettings:()=>Bt.Y,Segment:()=>Ln.Y,SegmentAsync:()=>wn.s,SegmentInput:()=>rs,SegmentSection:()=>qs.L,SegmentSelect:()=>Ls.a,Select:()=>ws.l6,SelectContainer:()=>ws.KA,SelectMenuOptions:()=>ll.o5,SelectionShortcutsPlugin:()=>Ii.l,SeriesColorPicker:()=>$e.Dp,SeriesColorPickerPopover:()=>Oe.o,SeriesColorPickerPopoverWithTheme:()=>Oe.t,SeriesIcon:()=>Br.p,SeriesTable:()=>Nt.o,SeriesTableRow:()=>Nt.g,SeriesVisibilityChangeBehavior:()=>Kn.K,SeriesVisibilityChangeMode:()=>hi.B,SetInterval:()=>os.u,SlatePrism:()=>wc.D,SlideOutTransition:()=>jn.n,Slider:()=>ko,Space:()=>tl.$,Sparkline:()=>Rn.O,Spinner:()=>ln.y,Stack:()=>el.B,StackingMode:()=>ia.gs,StatsPicker:()=>_e.S,SuggestionsPlugin:()=>Vc.Pz,Switch:()=>dr.d,TLSAuthSettings:()=>Zt.j,Tab:()=>jt.o,TabContent:()=>un.J,TabbedContainer:()=>Se.q,Table:()=>qn.X,TableCellDisplayMode:()=>ia.ob,TableCellInspector:()=>Ha.s,TableCellInspectorMode:()=>Ha.B,TableInputCSV:()=>Fa,TabsBar:()=>vs.U,Tag:()=>Ye.v,TagList:()=>Dt.L,TagsInput:()=>wt.u,Text:()=>Zi.E,TextArea:()=>La.f,TextLink:()=>Oo.Y,ThemeContext:()=>y.D,TimeOfDayPicker:()=>ot.R,TimePickerTooltip:()=>et.xS,TimeRangeInput:()=>_a.b,TimeRangeLabel:()=>nt.f,TimeRangePicker:()=>et.$6,TimeRangeProvider:()=>qe.A,TimeSeries:()=>St,TimeZonePicker:()=>Ze.U,ToggleAllState:()=>dl.X,Toggletip:()=>fe.G,ToolbarButton:()=>Mo.I,ToolbarButtonRow:()=>Jo.U,Tooltip:()=>D.m,TooltipDisplayMode:()=>ia.$N,TooltipPlugin:()=>$n,TooltipPlugin2:()=>Io.xl,UPLOT_AXIS_FONT_SIZE:()=>Cl.pi,UPlotChart:()=>ii.Z,UPlotConfigBuilder:()=>oi.e,UnitPicker:()=>Ce.p,UserIcon:()=>ro.n,UsersIndicator:()=>xl,ValuePicker:()=>Xo.i,VariablesInputModal:()=>Rl.b,VerticalGroup:()=>to.gW,VerticalTab:()=>nn,VirtualizedSelect:()=>ws.ip,VizLayout:()=>ta.KU,VizLegend:()=>na.t,VizLegendListItem:()=>Un.M,VizRepeater:()=>Vt.S,VizTooltip:()=>ea,VizTooltipContainer:()=>Cn.o,WeekStartPicker:()=>at.l6,WithContextMenu:()=>Co.n,XYCanvas:()=>li._,ZoomPlugin:()=>bn,attachDebugger:()=>Ss.h,buildScaleKey:()=>Ci,calculateFontSize:()=>Vn.Vr,clearButtonStyles:()=>pe.my,colors:()=>ka.Tj,commonOptionsBuilder:()=>t,convertOldAngularValueMapping:()=>Ar.I1,createLogger:()=>ms.h,createPointerDistance:()=>qa.b,defaultIntervals:()=>Je.cb,fieldMatchersUI:()=>Ji.g,floatingUtils:()=>q,fuzzyMatch:()=>Fr.I,getAvailableIcons:()=>Nn.GO,getCanvasContext:()=>Vn.Yc,getCardStyles:()=>si.H,getCellLinks:()=>wo.k,getDragStyles:()=>bl.l,getFieldTypeIcon:()=>Nn.SS,getFieldTypeIconName:()=>Nn.lV,getGraphFieldOptions:()=>Bs.P,getInputStyles:()=>js.n,getPortalContainer:()=>ce.gF,getScrollbarWidth:()=>pr,getSelectStyles:()=>cl.J,getTagColor:()=>Ns.yC,getTagColorIndexFromName:()=>Ns.JF,getTagColorsFromName:()=>Ns.MC,getTextColorForAlphaBackground:()=>ka.mZ,getTextColorForBackground:()=>ka.sg,getTheme:()=>Ws,getWeekStart:()=>at.rL,graphFieldOptions:()=>Bs.t,graphTickFormatter:()=>vi,graphTimeFormat:()=>Ao,hasValidationEvent:()=>Ea.K,isIconSize:()=>Nn.rJ,isWeekStart:()=>at.rE,linkModelToContextMenuItems:()=>cs.J,logOptions:()=>ho,makeFragment:()=>Ya.dF,makeValue:()=>Ya.mO,measureText:()=>Vn.kD,mockTheme:()=>ls,mockThemeContext:()=>R.fq,preparePlotFrame:()=>No,regexValidation:()=>Ea.RP,resetSelectStyles:()=>u.A,sharedInputStyle:()=>ki.Xb,sharedSingleStatMigrationHandler:()=>Ar._$,sharedSingleStatPanelChangedHandler:()=>Ar.gl,sortedColors:()=>ka.Ih,styleMixins:()=>k,stylesFactory:()=>L.N,toIconName:()=>Ta.Uo,useElementSelection:()=>ma.y,useForceUpdate:()=>xs.C,useGraphNGContext:()=>Ut,usePanelContext:()=>Dn.d2,usePointerDistance:()=>qa.C,useSplitter:()=>Dl.h,useStyles:()=>R.IS,useStyles2:()=>R.of,useTheme:()=>R.DP,useTheme2:()=>R.$j,validate:()=>Ea.tf,variableSuggestionToCodeEditorSuggestion:()=>oa.O,withErrorBoundary:()=>yr.Xc,withTheme:()=>R.SL,withTheme2:()=>R.cV});var t={};e.r(t),e.d(t,{ScaleDistributionEditor:()=>Y.W1,StackingEditor:()=>J.m,addAxisConfig:()=>Y.rg,addAxisPlacement:()=>Y.Wq,addAxisWidth:()=>Y.T4,addHideFrom:()=>te.e,addLegendOptions:()=>Z.H,addStackingConfig:()=>J.I,addTextSizeOptions:()=>ae.I,addTooltipOptions:()=>se.D});var n={};e.r(n),e.d(n,{getNextCharacter:()=>Q,getPreviousCousin:()=>_});var a=e(94959),c=e(32581),r=e(74848),i=e(73757),o=e(30703);const l=ht=>{const Pt=ht.selectProps.menuIsOpen;return(0,r.jsx)(i.c.IndicatorsContainer,{...ht,children:(0,r.jsx)(o.I,{name:Pt?"angle-up":"angle-down",style:{marginTop:"7px"}})})},f=l,h=ht=>{const{children:Pt}=ht;return(0,r.jsx)(i.c.NoOptionsMessage,{...ht,children:(0,r.jsx)("div",{className:"gf-form-select-box__desc-option",children:(0,r.jsx)("div",{className:"gf-form-select-box__desc-option__body",children:Pt})})})},d=h;var s=e(46942),g=e.n(s),v=e(96540),x=e(46005),m=e(8539),p=e(66963),y=e(35555),E=e(92807),b=e(89534),u=e(57830),D=e(45967);const P=ht=>{const{children:Pt,isSelected:Tt,data:Rt}=ht;return(0,r.jsx)(i.c.Option,{...ht,children:(0,r.jsxs)("div",{className:"gf-form-select-box__desc-option",children:[Rt.imgUrl&&(0,r.jsx)("img",{className:"gf-form-select-box__desc-option__img",src:Rt.imgUrl,alt:""}),(0,r.jsxs)("div",{className:"gf-form-select-box__desc-option__body",children:[(0,r.jsx)("div",{children:Pt}),Rt.description&&(0,r.jsx)("div",{className:"gf-form-select-box__desc-option__desc",children:Rt.description})]}),Tt&&(0,r.jsx)(o.I,{name:"check","aria-hidden":"true"})]})})},C=null;var S=e(22803),R=e(63142),L=e(65240);const j=(0,L.N)(ht=>({header:(0,S.css)({display:"flex",alignItems:"center",justifyContent:"flex-start",justifyItems:"center",cursor:"pointer",padding:"7px 10px",width:"100%",borderBottom:`1px solid ${ht.colors.background.secondary}`,"&:hover":{color:ht.colors.text.maxContrast}}),label:(0,S.css)({flexGrow:1}),icon:(0,S.css)({paddingRight:"2px"})}));class N extends v.PureComponent{constructor(){super(...arguments),this.state={expanded:!1},this.onToggleChildren=()=>{this.setState(Pt=>({expanded:!Pt.expanded}))}}componentDidMount(){if(this.props.data.expanded)this.setState({expanded:!0});else if(this.props.selectProps&&this.props.selectProps.value){const{value:Pt}=this.props.selectProps.value;Pt&&this.props.options.some(Tt=>Tt.value===Pt)&&this.setState({expanded:!0})}}componentDidUpdate(Pt){Pt.selectProps.inputValue!==""&&this.setState({expanded:!0})}render(){const{children:Pt,label:Tt,theme:Rt}=this.props,{expanded:Kt}=this.state,At=j(Rt);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:At.header,onClick:this.onToggleChildren,role:"presentation",children:[(0,r.jsx)("span",{className:At.label,children:Tt}),(0,r.jsx)(o.I,{className:At.icon,name:Kt?"angle-up":"angle-down"})]}),Kt&&Pt]})}}const V=(0,R.cV)(N),w=ht=>(0,r.jsx)(i.c.MenuList,{...ht,children:(0,r.jsx)(E.P,{showScrollIndicators:!0,overflowX:"hidden",maxHeight:"inherit",children:ht.children})});class M extends v.PureComponent{static{this.contextType=y.D}static{this.defaultProps={className:"",isDisabled:!1,isSearchable:!0,isClearable:!1,isMulti:!1,openMenuOnFocus:!1,autoFocus:!1,isLoading:!1,backspaceRemovesValue:!0,maxMenuHeight:300,tabSelectsValue:!0,allowCustomValue:!1,components:{Option:P,SingleValue:b.K,IndicatorsContainer:f,MenuList:w,Group:V}}}render(){const{defaultValue:Pt,getOptionLabel:Tt,getOptionValue:Rt,onChange:Kt,options:At,placeholder:Yt,width:en,value:pn,className:kt,isDisabled:yn,isLoading:zn,isSearchable:mn,isClearable:Tn,backspaceRemovesValue:ya,isMulti:Wa,autoFocus:Pa,openMenuOnFocus:ts,onBlur:fa,maxMenuHeight:ns,noOptionsMessage:as,isOpen:Ms,components:Da,tooltipContent:Mn,tabSelectsValue:Ca,onCloseMenu:Wn,onOpenMenu:xn,allowCustomValue:Ra,formatCreateLabel:ja,"aria-label":xa}=this.props;let gn="";en&&(gn="width-"+en);let ss=x.Ay;const Ga={};Ra&&(ss=p.A,Ga.formatCreateLabel=ja??(Js=>Js));const gs=g()("gf-form-input","gf-form-input--form-dropdown",gn,kt),or={...M.defaultProps.components,...Da};return(0,r.jsx)(U,{onCloseMenu:Wn,onOpenMenu:xn,tooltipContent:Mn,isOpen:Ms,children:(Js,Ai)=>(0,r.jsx)(ss,{captureMenuScroll:!1,classNamePrefix:"gf-form-select-box",className:gs,components:or,defaultValue:Pt,value:pn,getOptionLabel:Tt,getOptionValue:Rt,menuShouldScrollIntoView:!1,isSearchable:mn,onChange:Kt,options:At,placeholder:Yt||"Choose",styles:(0,u.A)(this.context),isDisabled:yn,isLoading:zn,isClearable:Tn,autoFocus:Pa,onBlur:fa,openMenuOnFocus:ts,maxMenuHeight:ns,noOptionsMessage:as,isMulti:Wa,backspaceRemovesValue:ya,menuIsOpen:Ms,onMenuOpen:Js,onMenuClose:Ai,tabSelectsValue:Ca,"aria-label":xa,...Ga})})}}class O extends v.PureComponent{static{this.contextType=y.D}static{this.defaultProps={className:"",components:{},loadingMessage:()=>"Loading...",isDisabled:!1,isClearable:!1,isMulti:!1,isSearchable:!0,backspaceRemovesValue:!0,autoFocus:!1,openMenuOnFocus:!1,maxMenuHeight:300}}render(){const{defaultValue:Pt,getOptionLabel:Tt,getOptionValue:Rt,onChange:Kt,placeholder:At,width:Yt,value:en,className:pn,loadOptions:kt,defaultOptions:yn,isLoading:zn,loadingMessage:mn,noOptionsMessage:Tn,isDisabled:ya,isSearchable:Wa,isClearable:Pa,backspaceRemovesValue:ts,autoFocus:fa,onBlur:ns,openMenuOnFocus:as,maxMenuHeight:Ms,isMulti:Da,tooltipContent:Mn,onCloseMenu:Ca,onOpenMenu:Wn,isOpen:xn}=this.props;let Ra="";Yt&&(Ra="width-"+Yt);const ja=g()("gf-form-input","gf-form-input--form-dropdown",Ra,pn);return(0,r.jsx)(U,{onCloseMenu:Ca,onOpenMenu:Wn,tooltipContent:Mn,isOpen:xn,children:(xa,gn)=>(0,r.jsx)(m.A,{captureMenuScroll:!1,classNamePrefix:"gf-form-select-box",className:ja,components:{Option:P,SingleValue:b.K,IndicatorsContainer:f,NoOptionsMessage:d},defaultValue:Pt,value:en,getOptionLabel:Tt,getOptionValue:Rt,menuShouldScrollIntoView:!1,onChange:Kt,loadOptions:kt,isLoading:zn,defaultOptions:yn,placeholder:At||"Choose",styles:(0,u.A)(this.context),loadingMessage:mn,noOptionsMessage:Tn,isDisabled:ya,isSearchable:Wa,isClearable:Pa,autoFocus:fa,onBlur:ns,openMenuOnFocus:as,maxMenuHeight:Ms,isMulti:Da,backspaceRemovesValue:ts})})}}class U extends v.PureComponent{constructor(){super(...arguments),this.state={isOpenInternal:!1},this.onOpenMenu=()=>{const{onOpenMenu:Pt}=this.props;Pt&&Pt(),this.setState({isOpenInternal:!0})},this.onCloseMenu=()=>{const{onCloseMenu:Pt}=this.props;Pt&&Pt(),this.setState({isOpenInternal:!1})}}render(){const{children:Pt,isOpen:Tt,tooltipContent:Rt}=this.props,{isOpenInternal:Kt}=this.state;let At;return(Kt||Tt)&&(At=!1),Rt?(0,r.jsx)(D.m,{show:At,content:Rt,placement:"bottom",children:(0,r.jsx)("div",{children:Pt(this.onOpenMenu,this.onCloseMenu)})}):(0,r.jsx)("div",{children:Pt(this.onOpenMenu,this.onCloseMenu)})}}const K=null;var z=e(2543);class G extends v.PureComponent{constructor(){super(...arguments),this.state={id:(0,z.uniqueId)()},this.internalOnChange=Pt=>{Pt.stopPropagation(),this.props.onChange(Pt)}}render(){const{labelClass:Pt="",switchClass:Tt="",label:Rt,checked:Kt,disabled:At,transparent:Yt,className:en,theme:pn,tooltip:kt,tooltipPlacement:yn}=this.props,zn=W(pn),mn=this.state.id,Tn=`gf-form-label ${Pt} ${Yt?"gf-form-label--transparent":""} pointer`,ya=(0,S.cx)(zn.switch,Tt,{[zn.switchTransparent]:Yt});return(0,r.jsx)("div",{className:zn.container,children:(0,r.jsxs)("label",{htmlFor:mn,className:(0,S.cx)("gf-form",zn.labelContainer,en),children:[Rt&&(0,r.jsxs)("div",{className:Tn,children:[Rt,kt&&(0,r.jsx)(D.m,{placement:yn||"auto",content:kt,theme:"info",children:(0,r.jsx)(o.I,{name:"info-circle",size:"sm",style:{marginLeft:"10px"}})})]}),(0,r.jsxs)("div",{className:ya,children:[(0,r.jsx)("input",{disabled:At,id:mn,type:"checkbox",checked:Kt,onChange:this.internalOnChange}),(0,r.jsx)("span",{className:zn.slider})]})]})})}}const F=(0,R.cV)(G),W=ht=>{const Pt=(0,S.css)({background:ht.v1.palette.gray1,borderRadius:ht.shape.radius.pill,height:"16px",width:"32px",display:"block",position:"relative","&::before":{position:"absolute",content:"''",height:"12px",width:"12px",left:"2px",top:"2px",background:ht.components.input.background,[ht.transitions.handleMotion("no-preference")]:{transition:"0.4s"},borderRadius:ht.shape.radius.circle,boxShadow:ht.shadows.z1}});return{container:(0,S.css)({display:"flex",flexShrink:0}),labelContainer:(0,S.css)({display:"flex",cursor:"pointer",marginRight:ht.spacing(.5)}),switch:(0,S.css)({display:"flex",position:"relative",width:"56px",height:ht.spacing(4),background:ht.components.input.background,border:`1px solid ${ht.components.input.borderColor}`,borderRadius:ht.shape.radius.default,alignItems:"center",justifyContent:"center",input:{opacity:0,width:0,height:0},[`input:checked + .${Pt}`]:{background:ht.colors.primary.main},[`input:checked + .${Pt}::before`]:{transform:"translateX(16px)"}}),switchTransparent:(0,S.css)({background:"transparent",border:0,width:"40px"}),slider:Pt}};var H=e(23659),Y=e(44017),te=e(45013),Z=e(41069),se=e(79277),ae=e(14099),J=e(81082),k=e(35484);typeof window<"u"&&"Element"in window&&!Element.prototype.closest&&(Element.prototype.closest=function(ht){const Pt=(this.document||this.ownerDocument).querySelectorAll(ht);let Tt=this,Rt;do{for(Rt=Pt.length;--Rt>=0&&Pt.item(Rt)!==Tt;);Tt=Tt.parentElement}while(Rt<0&&Tt);return Tt});function _(ht,Pt){let Tt=ht.parentElement?.previousSibling,Rt;for(;Tt;){if(Tt instanceof HTMLElement&&(Rt=Tt.querySelector(Pt)),Rt)return Rt;Tt=Tt.previousSibling}}function Q(ht){const Pt=(ht||window).getSelection();if(!Pt||!Pt.anchorNode)return null;const Tt=Pt.getRangeAt(0),Rt=Pt.anchorNode.textContent,Kt=Tt.startOffset;return Rt.slice(Kt,Kt+1)}var q=e(76373),oe=e(44019),re=e(76319),ee=e(7075),B=e(44458),ie=e(43533),de=e(2381),fe=e(59243),ce=e(15245),ve=e(52718),Se=e(64467),je=e(47931),Ve=e(64913),he=e(56873),Ue=e(38092),pe=e(45861),be=e(78121),ze=e(21133);const Ne=ht=>{const{onChange:Pt,className:Tt,loadData:Rt,icon:Kt,buttonProps:At,hideDownIcon:Yt,variant:en,disabled:pn,...kt}=ht,yn=(0,R.of)(Ie),zn=(0,R.of)(ze.T);let mn=ht.children;return Yt||(mn=[ht.children,(0,r.jsx)(o.I,{name:"angle-down",className:yn.icons.right},"down-icon")]),(0,r.jsx)(Ue.A,{onChange:(0,be.k)(Pt),loadData:(0,be.W)(Rt),dropdownClassName:(0,S.cx)(zn.dropdown,yn.popup),...kt,expandIcon:null,children:(0,r.jsx)(pe.$n,{icon:Kt,disabled:pn,variant:en,...At??{},children:mn})})};Ne.displayName="ButtonCascader";const Ie=ht=>({popup:(0,S.css)({label:"popup",zIndex:ht.zIndex.dropdown}),icons:{right:(0,S.css)({margin:"1px 0 0 4px"}),left:(0,S.css)({margin:"-1px 4px 0 0"})}});var ke=e(53371),Ee=e(6975),Ae=e(47327),$e=e(35427),Fe=e(7612),We=e(65229),Ge=e(6773),me=e(8135),De=e(12173),xe=e(32550);const Me=(0,v.forwardRef)(({value:ht="",onChange:Pt,returnColorAs:Tt="rgb",...Rt},Kt)=>{const[At,Yt]=(0,v.useState)(ht),[en,pn]=(0,v.useState)(!1),kt=(0,R.$j)(),yn=(0,R.of)(Be),zn=(0,R.of)(xe.$);(0,We.A)(Tn=>{if(Tn===ht)return;if(!Tn){Pt("");return}const ya=kt.visualization.getColorByName(Tn);Pt(Tt==="rgb"?Ge.MV.asRgbString(ya):Ge.MV.asHexString(ya))},500,[At]);const mn=Tn=>{document.querySelector('[data-testid="color-popover"]')?.contains(Tn.relatedTarget)||pn(!1)};return(0,r.jsx)(me.N,{onClick:()=>pn(!1),children:(0,r.jsxs)("div",{className:yn.wrapper,children:[en&&!Rt.disabled&&(0,r.jsx)(Fe.p9,{"data-testid":"color-popover",color:At,onChange:Yt,className:(0,S.cx)(zn.root,yn.picker)}),(0,r.jsx)(De.A,{...Rt,theme:kt,color:At,onChange:Yt,buttonAriaLabel:"Open color picker",onClick:()=>pn(!0),onBlur:Tn=>mn(Tn),ref:Kt,isClearable:!0})]})})});Me.displayName="ColorPickerInput";const Be=ht=>({wrapper:(0,S.css)({position:"relative"}),picker:(0,S.css)({"&.react-colorful":{position:"absolute",width:"100%",zIndex:11,bottom:"36px"}}),inner:(0,S.css)({position:"absolute"})});var Oe=e(57339),Re=e(74451),we=e(50201),Ce=e(12965),_e=e(34107),Je=e(90811),et=e(91867),qe=e(72296),nt=e(83692),ot=e(11527),Ze=e(59310),at=e(5857),it=e(96396),ct=e(43482),xt=e(27282),dt=e(5585),vt=e(27594),wt=e(10928),$t=e(92745),_t=e(37386);const tn=(0,v.memo)(()=>{const ht=(0,R.of)(gt);return(0,r.jsxs)("div",{className:ht.ellipsis,children:[(0,r.jsx)("span",{className:ht.firstDot,children:"."}),(0,r.jsx)("span",{className:ht.secondDot,children:"."}),(0,r.jsx)("span",{className:ht.thirdDot,children:"."})]})});tn.displayName="EllipsisAnimated";const gt=ht=>({ellipsis:(0,S.css)({display:"inline"}),firstDot:(0,S.css)({[ht.transitions.handleMotion("no-preference","reduce")]:{animation:`${Wt} 2s linear infinite`}}),secondDot:(0,S.css)({[ht.transitions.handleMotion("no-preference","reduce")]:{animation:`${Xt} 2s linear infinite`}}),thirdDot:(0,S.css)({[ht.transitions.handleMotion("no-preference","reduce")]:{animation:`${dn} 2s linear infinite`}})}),Wt=(0,S.keyframes)` 0% { opacity: 1; } 65% { opacity: 1; } 66% { opacity: 0.5; } 100% { opacity: 0; } `,Xt=(0,S.keyframes)` 0% { opacity: 0; } 21% { opacity: 0.5; } 22% { opacity: 1; } 65% { opacity: 1; } 66% { opacity: 0.5; } 100% { opacity: 0; } `,dn=(0,S.keyframes)` 0% { opacity: 0; } 43% { opacity: 0.5; } 44% { opacity: 1; } 65% { opacity: 1; } 66% { opacity: 0.5; } 100% { opacity: 0; } `,rt=2*1e3;function pt(ht){const{invalid:Pt,loading:Tt,onFinishChange:Rt,saveErrorMessage:Kt="Error saving this value",error:At,children:Yt,disabled:en,...pn}=ht,[kt,yn]=v.useState({isLoading:!1,showSuccess:!1,showError:Pt}),zn=(0,v.useRef)(null);v.useEffect(()=>{let Pa;if(kt.showSuccess){const ts=kt.showError?0:rt;Pa=setTimeout(()=>{yn({...kt,showSuccess:!1})},ts)}return()=>{window.clearTimeout(Pa)}},[kt]);const mn=(0,v.useCallback)(Pa=>{Pt||(yn({...kt,isLoading:!0,showSuccess:!1}),Rt(Pa).then(()=>{yn({isLoading:!1,showSuccess:!0,showError:!1})}).catch(()=>{yn({...kt,isLoading:!1,showError:!0})}))},[Pt,kt,Rt]),Tn=(0,v.useMemo)(()=>(0,z.debounce)(mn,600,{leading:!1}),[mn]),ya=Pt||kt.showError||void 0,Wa=(0,R.of)(mt);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_t.D,{...pn,loading:Tt||void 0,invalid:ya,disabled:en,error:At||kt.showError&&Kt,ref:zn,className:Wa.widthFitContent,children:v.cloneElement(Yt(Pa=>{Tn(Pa)}))}),kt.isLoading&&(0,r.jsx)(ke.r,{referenceElement:zn.current,placement:"right",children:(0,r.jsxs)($t.x6,{i18nKey:"grafana-ui.auto-save-field.saving",children:["Saving ",(0,r.jsx)(tn,{})]})}),kt.showSuccess&&(0,r.jsx)(ke.r,{suffixIcon:"check",referenceElement:zn.current,placement:"right",children:(0,r.jsx)($t.x6,{i18nKey:"grafana-ui.auto-save-field.saved",children:"Saved!"})})]})}pt.displayName="AutoSaveField";const mt=()=>({widthFitContent:(0,S.css)({width:"fit-content"})});var Ct=e(34213),Ye=e(94018),Dt=e(37658),Lt=e(34343),Gt=e(71599),qt=e(92505),on=e(50992),Pn=e(65232),Sn=e(78193),oa=e(13477),la=e(22787),ca=e(53428),Zn=e(52792);const Gn=({children:ht})=>{const Pt=(0,R.of)(sa);return(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:Pt.header,children:(0,r.jsx)("div",{className:Pt.content,children:ht})})})},sa=ht=>({header:(0,S.css)({display:"flex",margin:ht.spacing(0,0,3,0)}),content:(0,S.css)({flexGrow:1})});var pa=e(8515),da=e(84600),os=e(82143),qn=e(24343),Ha=e(64780),_n=e(68125),La=e(87105);class ga extends v.PureComponent{constructor(Pt){super(Pt),this.readCSV=(0,z.debounce)(()=>{const{config:Kt}=this.props,{text:At}=this.state;this.setState({data:(0,_n.Jh)(At,{config:Kt})})},150),this.onTextChange=Kt=>{this.setState({text:Kt.target.value})};const{text:Tt,config:Rt}=Pt;this.state={text:Tt,data:(0,_n.Jh)(Tt,{config:Rt})}}componentDidUpdate(Pt,Tt){const{text:Rt}=this.state;(Rt!==Tt.text||this.props.config!==Pt.config)&&this.readCSV(),this.props.text!==Pt.text&&this.props.text!==Rt&&this.setState({text:this.props.text}),this.state.data!==Tt.data&&this.props.onSeriesParsed(this.state.data,this.state.text)}render(){const{width:Pt,height:Tt,theme:Rt}=this.props,{data:Kt}=this.state,At=Sa(Rt);return(0,r.jsxs)("div",{className:At.tableInputCsv,children:[(0,r.jsx)(La.f,{style:{width:Pt,height:Tt},placeholder:(0,$t.t)("grafana-ui.table.csv-placeholder","Enter CSV here..."),value:this.state.text,onChange:this.onTextChange,className:At.textarea}),Kt&&(0,r.jsx)("footer",{className:At.footer,children:Kt.map((Yt,en)=>{const pn=Yt.length,kt=Yt.fields.length;return(0,r.jsxs)("span",{children:[(0,r.jsxs)($t.x6,{i18nKey:"grafana-ui.table.csv-counts",children:["Rows:",{rows:pn},", Columns:",{columns:kt}]}),"\xA0",(0,r.jsx)(o.I,{name:"check-circle"})]},en)})})]})}}const Fa=(0,R.cV)(ga);Fa.displayName="TableInputCSV";const Sa=(0,L.N)(ht=>({tableInputCsv:(0,S.css)({position:"relative"}),textarea:(0,S.css)({height:"100%",width:"100%"}),footer:(0,S.css)({position:"absolute",bottom:"15px",right:"15px",border:`1px solid ${ht.colors.success.border}`,background:ht.colors.success.main,color:ht.colors.success.contrastText,padding:`1px ${ht.spacing(.5)}`,fontSize:"80%"})}));var vs=e(54314),jt=e(60208),zt=e(51898),Ht=e(72489);const nn=(0,v.forwardRef)(({label:ht,active:Pt,icon:Tt,counter:Rt,className:Kt,suffix:At,onChangeTab:Yt,href:en,...pn},kt)=>{const yn=(0,R.of)(sn),zn=()=>(0,r.jsxs)(r.Fragment,{children:[Tt&&(0,r.jsx)(o.I,{name:Tt}),ht,typeof Rt=="number"&&(0,r.jsx)(Ht.p,{value:Rt}),At&&(0,r.jsx)(At,{className:yn.suffix})]}),mn=(0,S.cx)(yn.link,Pt&&yn.activeStyle);return(0,r.jsx)("a",{href:en,className:mn,...pn,onClick:Yt,"aria-label":pn["aria-label"]||zt.Tp.components.Tab.title(ht),role:"tab","aria-selected":Pt,ref:kt,children:zn()})});nn.displayName="Tab";const sn=ht=>({link:(0,S.css)({padding:"6px 12px",display:"block",height:"100%",cursor:"pointer",position:"relative",color:ht.colors.text.primary,svg:{marginRight:ht.spacing(1)},"&:hover, &:focus":{textDecoration:"underline"}}),activeStyle:(0,S.css)({label:"activeTabStyle",color:ht.colors.text.maxContrast,overflow:"hidden","&::before":{display:"block",content:'" "',position:"absolute",left:0,width:"4px",bottom:"2px",top:"2px",borderRadius:ht.shape.radius.default,backgroundImage:"linear-gradient(0deg, #f05a28 30%, #fbca0a 99%)"}}),suffix:(0,S.css)({marginLeft:ht.spacing(1)})});var un=e(13941),Bn=e(70663),kn=e(97611),Rn=e(53431),Hn=e(58684),Qn=e(98005),Cn=e(71076);const ea=({content:ht,position:Pt,offset:Tt})=>{const Rt=(0,R.of)(lt);return Pt?(0,r.jsx)(ce.ZL,{className:Rt.portal,children:(0,r.jsx)(Cn.o,{position:Pt,offset:Tt||{x:0,y:0},children:ht})}):null};ea.displayName="VizTooltip";const lt=()=>({portal:(0,S.css)({position:"absolute",top:0,left:0,pointerEvents:"none",width:"100%",height:"100%"})});var Nt=e(63428),Vt=e(33352),rn=e(67522),vn=e(39884),Dn=e(64400),ta=e(54735),Kn=e(22940),na=e(4268),Un=e(89123),ba=e(34999),Ua=e(89599),ys=e(74475),Ks=e(5753);function Ts({links:ht}){const Pt=(0,R.of)(Ir);if(ht.length===1)return(0,r.jsx)(Ks.R,{link:ht[0]});const Tt=ht.filter(Kt=>Kt.target==="_blank"),Rt=ht.filter(Kt=>Kt.target==="_self");return(0,r.jsxs)(r.Fragment,{children:[Rt.map((Kt,At)=>(0,r.jsx)(Ks.R,{link:Kt},At)),(0,r.jsxs)("div",{className:Pt.wrapper,children:[(0,r.jsx)("p",{className:Pt.externalLinksHeading,children:(0,r.jsx)($t.x6,{i18nKey:"grafana-ui.field-link-list.external-links-heading",children:"External links"})}),Tt.map((Kt,At)=>(0,r.jsxs)("a",{href:Kt.href,target:Kt.target,className:Pt.externalLink,children:[(0,r.jsx)(o.I,{name:"external-link-alt"}),Kt.title]},At))]})]})}const Ir=ht=>({wrapper:(0,S.css)({flexBasis:"150px",width:"100px",marginTop:ht.spacing(1)}),externalLinksHeading:(0,S.css)({color:ht.colors.text.secondary,fontWeight:ht.typography.fontWeightRegular,fontSize:ht.typography.size.sm,margin:0}),externalLink:(0,S.css)({color:ht.colors.text.link,fontWeight:ht.typography.fontWeightRegular,display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","&:hover":{textDecoration:"underline"},div:{marginRight:ht.spacing(1)}})}),vr=({className:ht,children:Pt})=>{const Tt=(0,R.of)(bo);return(0,r.jsx)("div",{className:(0,S.cx)(Tt,ht),children:Pt})},bo=()=>(0,S.css)({display:"flex",button:{flexGrow:1,justifyContent:"center"},"> *":{flexGrow:1},label:{flexGrow:1,textAlign:"center"}});var Ar=e(59795),_s=e(43951),kr=e(97375),Do=e(87063),Lr=e(30930),Yr=e(94535),Co=e(41479),To=e(96822),ks=e(73628),cr=e(81917),jr=e(6399),Br=e(71479),As=e(79331),za=e(991);const Zs=(0,v.memo)((0,v.forwardRef)(({title:ht,featureState:Pt,...Tt},Rt)=>{const Kt=(0,R.of)(Fs),At=Pt?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Kt.badge,children:(0,r.jsx)(za.y,{featureState:Pt})}),(0,r.jsx)("h3",{children:ht})]}):(0,r.jsx)("h3",{children:ht});return(0,r.jsx)(As.w,{branded:!0,title:At,urlTitle:"Read documentation",ref:Rt,...Tt})}));Zs.displayName="FeatureInfoBox";const Fs=ht=>({badge:(0,S.css)({marginBottom:ht.spacing(1)})});var Jr=e(50275),Ur=e(22658),yr=e(36303),Xr=e(56297),xr=e(96004),So=e(55803),dr=e(21285),Mt=e(18027);function Ft({options:ht,onOptionsChange:Pt}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"page-heading",children:(0,r.jsx)($t.x6,{i18nKey:"grafana-ui.data-source-settings.alerting-settings-heading",children:"Alerting"})}),(0,r.jsx)("div",{className:"gf-form-group",children:(0,r.jsx)("div",{className:"gf-form-inline",children:(0,r.jsx)("div",{className:"gf-form",children:(0,r.jsx)(Mt.I,{labelWidth:29,label:(0,$t.t)("grafana-ui.data-source-settings.alerting-settings-label","Manage alert rules in Alerting UI"),disabled:ht.readOnly,tooltip:(0,$t.t)("grafana-ui.data-source-settings.alerting-settings-tooltip","Manage alert rules for this data source. To manage other alerting resources, add an Alertmanager data source."),children:(0,r.jsx)(dr.K,{value:ht.jsonData.manageAlerts!==!1,onChange:Tt=>Pt({...ht,jsonData:{...ht.jsonData,manageAlerts:Tt.currentTarget.checked}})})})})})})]})}var Bt=e(3936),Zt=e(37235),an=e(45558),ln=e(68079),In=e(19052),jn=e(4819),Ln=e(61875),wn=e(76671),ua=e(29647),Vn=e(53568),ha=e(79233),Ma=e(37864),wa=e(3431);const Qa=14;function rs({value:ht,onChange:Pt,Component:Tt,className:Rt,placeholder:Kt,inputPlaceholder:At,disabled:Yt,autofocus:en=!1,onExpandedChange:pn,...kt}){const yn=(0,v.useRef)(null),[zn,mn]=(0,v.useState)(ht),[Tn,ya]=(0,v.useState)((0,Vn.kD)((ht||"").toString(),Qa).width),[Wa,,Pa,ts]=(0,wa.Q)(en,pn),fa=(0,R.of)(Ma.m);if((0,ua.A)(yn,()=>{ts(!1),Pt(zn)}),!Pa)return(0,r.jsx)(Wa,{disabled:Yt,Component:Tt||(0,r.jsx)(ha.c,{className:(0,S.cx)(fa.segment,{[fa.queryPlaceholder]:Kt!==void 0&&!zn,[fa.disabled]:Yt},Rt),children:ht||Kt})});const ns=(0,S.css)({width:`${Math.max(Tn+20,32)}px`});return(0,r.jsx)("input",{...kt,ref:yn,autoFocus:!0,className:(0,S.cx)("gf-form gf-form-input",ns),value:zn,placeholder:At,onChange:as=>{const{width:Ms}=(0,Vn.kD)(as.target.value,Qa);ya(Ms),mn(as.target.value)},onBlur:()=>{ts(!1),Pt(zn)},onKeyDown:as=>{[13,27].includes(as.keyCode)&&(ts(!1),Pt(zn))}})}var Ls=e(89467),qs=e(52042),ur=e(8207),hr=e(17437),bs=e(69156),js=e(63527),Zr=e(91302);const ko=({min:ht,max:Pt,onChange:Tt,onAfterChange:Rt,orientation:Kt="horizontal",reverse:At,step:Yt,value:en,ariaLabelForHandle:pn,marks:kt,included:yn,inputId:zn,showInput:mn=!0})=>{const Tn=Kt==="horizontal",ya=(0,R.of)(Zr.$,Tn,!!kt),Wa=bs.A,[Pa,ts]=(0,v.useState)(en??ht),fa=pn??(0,$t.t)("grafana-ui.slider.drag-handle-aria-label","Use arrow keys to change the value"),ns=(0,v.useCallback)(Wn=>{const xn=typeof Wn=="number"?Wn:Wn[0];ts(xn),Tt?.(xn)},[ts,Tt]),as=(0,v.useCallback)(Wn=>{let xn=+Wn.target.value;Number.isNaN(xn)&&(xn=0),ts(xn),Tt&&Tt(xn),Rt&&Rt(xn)},[Tt,Rt]),Ms=(0,v.useCallback)(Wn=>{const xn=+Wn.target.value;xn>Pt?ts(Pt):xn{const xn=typeof Wn=="number"?Wn:Wn[0];Rt?.(xn)},[Rt]),Mn=Tn?[]:[ya.sliderInputVertical],Ca=Tn?[]:[ya.sliderInputFieldVertical];return(0,r.jsxs)("div",{className:(0,S.cx)(ya.container,ya.slider),children:[(0,r.jsx)(hr.Global,{styles:ya.tooltip}),(0,r.jsxs)("div",{className:(0,S.cx)(ya.sliderInput,...Mn),children:[(0,r.jsx)(Wa,{min:ht,max:Pt,step:Yt,defaultValue:en,value:Pa,onChange:ns,onChangeComplete:Da,vertical:!Tn,reverse:At,ariaLabelForHandle:fa,marks:kt,included:yn}),mn&&(0,r.jsx)(js.p,{type:"text",width:7.5,className:(0,S.cx)(ya.sliderInputField,...Ca),value:Pa,onChange:as,onBlur:Ms,min:ht,max:Pt,id:zn})]})]})};ko.displayName="Slider";var Qi=e(21103),_i=e(50426),ki=e(3343),Yi=e(26987),Yo=e(93256),Mo=e(7895),Jo=e(36219),Xo=e(59695),Ji=e(63152),Xi=e(20941),Oo=e(89640),Zi=e(66404),qi=e(31286),el=e(41654),Zo=e(13943),tl=e(35137),nl=e(72636),al=e(53487),er=e(16780),sl=e(12594),rl=e(83871),ol=e(97095),il=e(49785);const qr=({name:ht,control:Pt,children:Tt,...Rt})=>{const{fields:Kt,append:At,prepend:Yt,remove:en,swap:pn,move:kt,insert:yn}=(0,il.jz)({control:Pt,name:ht,...Rt});return Tt({fields:Kt,append:At,prepend:Yt,remove:en,swap:pn,move:kt,insert:yn})};var ws=e(18857),ll=e(72508),cl=e(69665),dl=e(29362),ul=e(43243),eo=e(70683),to=e(32881),qo=e(99887),no=e(77824),hl=e(45450),fl=e(16203),pl=e(33033),ml=e(12737),ei=e(48767),ti=e(40601),gl=e(32635),ni=e(57688),ai=e(40279),Ka=e(48431),_a=e(56265),vl=e(90929),si=e(8073),ri=e(43856),Ro=e(21539),yl=e(15356),ao=e(88559),so=e(63509),ro=e(35942);const xl=({users:ht,onClick:Pt,limit:Tt=4})=>{const Rt=(0,R.of)(El);if(!ht.length)return null;Tt=Tt>0?Tt:4;const Kt=ht.length>Tt,At=ht.length-Tt,Yt=At>99;return(0,r.jsxs)("div",{className:Rt.container,"aria-label":(0,$t.t)("grafana-ui.users-indicator.container-label","Users indicator container"),children:[Kt&&(0,r.jsx)(ro.n,{onClick:Pt,userView:{user:{name:"Extra users"},lastActiveAt:""},showTooltip:!1,children:Yt?"...":`+${At}`}),ht.slice(0,Kt?Tt:Tt+1).reverse().map(en=>(0,r.jsx)(ro.n,{userView:en},en.user.name))]})},El=ht=>({container:(0,S.css)({display:"flex",justifyContent:"center",flexDirection:"row-reverse",marginLeft:ht.spacing(1),"& > button":{marginLeft:ht.spacing(-1)}}),dots:(0,S.css)({marginBottom:"3px"})});var Pl=e(71555),Er=e(51115),Za=e(3271),bl=e(45897),Dl=e(93008),Bs=e(99555),oi=e(47276),Cl=e(23414),ii=e(92790),Nr=e(61897),li=e(16477),ci=e(73858),Tl=e(7515),Io=e(69234),di=e(18667),Sl=e(93630),ui=e(62748),hi=e(49256),Ml=e(88977),Ol=e(3023),Rl=e(81538),Il=e(34796),fi=e.n(Il),Vs=e(26332),ia=e(739),pi=e(80011);const oo=({getContextMenuSource:ht,timeZone:Pt,itemsGroup:Tt,dimensions:Rt,contextDimensions:Kt,...At})=>{const Yt=ht(),en=Tt?Tt.map(yn=>({...yn,items:yn.items?.filter(zn=>zn.label)})):[],pn=()=>{if(!Yt)return null;let yn;if(Rt?.yAxis&&Kt?.yAxis?.[1]){const mn=(0,Vs.WK)(Rt.yAxis,Kt.yAxis[0],Kt.yAxis[1]),Tn=Yt.series.valueField.display;yn=Tn(mn)}const zn=(0,pi.LE)(Yt.datapoint[0],{defaultWithMS:Yt.series.hasMsResolution,timeZone:Pt});return(0,r.jsx)(mi,{timestamp:zn,seriesColor:Yt.series.color,displayName:Yt.series.alias||Yt.series.label,displayValue:yn})},kt=()=>en?.map((yn,zn)=>(0,r.jsx)(Lr.r,{label:yn.label,children:(yn.items||[]).map(mn=>(0,r.jsx)(Yr.D,{url:mn.url,label:mn.label,target:mn.target,icon:mn.icon,active:mn.active,onClick:mn.onClick},`${mn.label}`))},`${yn.label}${zn}`));return(0,r.jsx)(kr.t,{...At,renderMenuItems:kt,renderHeader:pn})},mi=({timestamp:ht,seriesColor:Pt,displayName:Tt,displayValue:Rt})=>{const Kt=(0,R.of)(io);return(0,r.jsxs)("div",{className:Kt.wrapper,children:[(0,r.jsx)("strong",{children:ht}),(0,r.jsxs)(to.Gy,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(Br.p,{color:Pt}),(0,r.jsx)("span",{className:Kt.displayName,children:Tt})]}),Rt&&(0,r.jsx)(Ro.i,{value:Rt})]})]})};function io(ht){return{wrapper:(0,S.css)({padding:ht.spacing(.5,1),fontSize:ht.typography.size.sm,zIndex:ht.zIndex.tooltip}),displayName:(0,S.css)({whiteSpace:"nowrap",paddingLeft:ht.spacing(.5)})}}var is=e(55386),tr=e(16515),nr=e(5421);const Al=(ht,Pt)=>{let Tt=0,Rt=ht.values.length-1,Kt;for(;;){if(Tt>Rt)return Math.max(Rt,0);Kt=Math.floor((Tt+Rt)/2);const At=ht.values[Kt];if(At===Pt)return Kt;At&&At{let Kt,At,Yt,en,pn;const kt=[];let yn,zn;for(Kt=0;Kt=0&&(enyn)&&(yn=en,zn=mn.display?(0,is.cN)(mn.display(pn)):pn);const Tn=At.display(At.values[Yt]);kt.push({value:(0,is.cN)(Tn),datapointIndex:Yt,seriesIndex:Kt,color:Tn.color,label:(0,tr.Ct)(At),time:mn.display?(0,is.cN)(mn.display(pn)):pn})}return{results:kt,time:zn}},vi=(ht,Pt)=>(0,pi.LE)(ht,{format:Pt?.options?.timeformat,timeZone:Pt?.options?.timezone}),Ao=(ht,Pt,Tt)=>{if(Pt&&Tt&&ht){const Rt=Tt-Pt,Kt=Rt/ht/1e3,At=86400010,Yt=31536e6;return Kt<=10?nr.WC.interval.millisecond:Kt<=45?nr.WC.interval.second:Rt<=At?nr.WC.interval.minute:Kt<=8e4?nr.WC.interval.hour:Rt<=Yt?nr.WC.interval.day:Kt<=31536e3?nr.WC.interval.month:nr.WC.interval.year}return nr.WC.interval.minute},yi=({dimensions:ht,activeDimensions:Pt,pos:Tt,timeZone:Rt})=>{let Kt=null;if(Pt.xAxis===null)return null;Pt.yAxis&&(Kt=Pt.yAxis[0]);const At=Pt.xAxis[1]?(0,Vs.WK)(ht.xAxis,Pt.xAxis[0],Pt.xAxis[1]):Tt.x,Yt=gi(ht.yAxis.columns,ht.xAxis.columns,At,Rt),en=Yt.time,pn=Yt.results.map((kt,yn)=>({color:kt.color,label:kt.label,value:kt.value,isActive:Kt===yn}));return(0,r.jsx)(Nt.o,{series:pn,timestamp:en})};yi.displayName="MultiModeGraphTooltip";const Lo=({dimensions:ht,activeDimensions:Pt,timeZone:Tt})=>{if(Pt.yAxis===null||Pt.yAxis[1]===void 0||Pt.xAxis===null||Pt.xAxis[1]===void 0)return null;const Rt=(0,Vs.WK)(ht.xAxis,Pt.xAxis[0],Pt.xAxis[1]),Kt=(0,Vs.P4)(ht.xAxis,Pt.xAxis[0]),At=Kt.display?(0,is.cN)(Kt.display(Rt)):Rt,Yt=(0,Vs.P4)(ht.yAxis,Pt.yAxis[0]),en=(0,Vs.WK)(ht.yAxis,Pt.yAxis[0],Pt.yAxis[1]),pn=Yt.display,kt=pn(en);return(0,r.jsx)(Nt.o,{series:[{color:kt.color,label:(0,tr.Ct)(Yt),value:(0,is.cN)(kt)}],timestamp:At})};Lo.displayName="SingleModeGraphTooltip";const jo=({mode:ht=ia.$N.Single,dimensions:Pt,activeDimensions:Tt,pos:Rt,timeZone:Kt})=>!Tt||!Tt.xAxis?null:ht==="single"?(0,r.jsx)(Lo,{dimensions:Pt,activeDimensions:Tt,timeZone:Kt}):(0,r.jsx)(yi,{dimensions:Pt,activeDimensions:Tt,pos:Rt,timeZone:Kt});jo.displayName="GraphTooltip";class xi extends v.PureComponent{constructor(){super(...arguments),this.state={isTooltipVisible:!1,isContextVisible:!1},this.element=null,this.$element=null,this.onPlotSelected=(Pt,Tt)=>{const{onHorizontalRegionSelected:Rt}=this.props;Rt&&Rt(Tt.xaxis.from,Tt.xaxis.to)},this.onPlotHover=(Pt,Tt,Rt)=>{this.setState({isTooltipVisible:!0,activeItem:Rt,pos:Tt})},this.onPlotClick=(Pt,Tt,Rt)=>{this.setState({isContextVisible:!0,isTooltipVisible:!1,contextItem:Rt,contextPos:Tt})},this.renderTooltip=()=>{const{children:Pt,series:Tt,timeZone:Rt}=this.props,{pos:Kt,activeItem:At,isTooltipVisible:Yt}=this.state;let en;if(!Yt||!Kt||Tt.length===0||(v.Children.forEach(Pt,Pa=>{if(en)return;(Pa&&Pa.type&&(Pa.type.displayName||Pa.type.name))===ea.displayName&&(en=Pa)}),!en))return null;const pn=en.props,kt=pn.mode||"single";if(!At&&kt==="single")return null;const yn=pn.tooltipComponent||jo,zn=At?At.series.seriesIndex:0,mn=At?At.dataIndex:void 0,Tn={xAxis:[zn,mn],yAxis:At?[At.series.seriesIndex,At.dataIndex]:null},ya={dimensions:{xAxis:(0,Vs.r4)("xAxis",Tt.map(Pa=>Pa.timeField)),yAxis:(0,Vs.r4)("yAxis",Tt.map(Pa=>Pa.valueField))},activeDimensions:Tn,pos:Kt,mode:pn.mode||ia.$N.Single,timeZone:Rt},Wa=v.createElement(yn,{...ya});return v.cloneElement(en,{content:Wa,position:{x:Kt.pageX,y:Kt.pageY},offset:{x:10,y:10}})},this.renderContextMenu=()=>{const{series:Pt}=this.props,{contextPos:Tt,contextItem:Rt,isContextVisible:Kt}=this.state;if(!Kt||!Tt||!Rt||Pt.length===0)return null;const At=Rt?Rt.series.seriesIndex:0,Yt=Rt?Rt.dataIndex:void 0,en={xAxis:[At,Yt],yAxis:Rt?[Rt.series.seriesIndex,Rt.dataIndex]:null},pn={xAxis:(0,Vs.r4)("xAxis",Pt.map(mn=>mn.timeField)),yAxis:(0,Vs.r4)("yAxis",Pt.map(mn=>mn.valueField))},kt=()=>this.setState({isContextVisible:!1}),yn=()=>({datapoint:Rt.datapoint,dataIndex:Rt.dataIndex,series:Rt.series,seriesIndex:Rt.series.seriesIndex,pageX:Tt.pageX,pageY:Tt.pageY}),zn={x:Tt.pageX,y:Tt.pageY,onClose:kt,getContextMenuSource:yn,timeZone:this.props.timeZone,dimensions:pn,contextDimensions:en};return(0,r.jsx)(oo,{...zn})},this.getBarWidth=()=>{const{series:Pt}=this.props;return Math.min(...Pt.map(Tt=>Tt.timeStep))}}static{this.defaultProps={showLines:!0,showPoints:!1,showBars:!1,isStacked:!1,lineWidth:1}}componentDidUpdate(Pt,Tt){Pt!==this.props&&this.draw()}componentDidMount(){this.draw(),this.element&&(this.$element=fi()(this.element),this.$element.bind("plotselected",this.onPlotSelected),this.$element.bind("plothover",this.onPlotHover),this.$element.bind("plotclick",this.onPlotClick))}componentWillUnmount(){this.$element&&this.$element.unbind("plotselected",this.onPlotSelected)}getYAxes(Pt){return Pt.length===0?[{show:!0,min:-1,max:1}]:(0,z.uniqBy)(Pt.map(Tt=>{const Rt=Tt.yAxis?Tt.yAxis.index:1,Kt=Tt.yAxis&&Tt.yAxis.min&&!isNaN(Tt.yAxis.min)?Tt.yAxis.min:null,At=Tt.yAxis&&Tt.yAxis.tickDecimals&&!isNaN(Tt.yAxis.tickDecimals)?Tt.yAxis.tickDecimals:null;return{show:!0,index:Rt,position:Rt===1?"left":"right",min:Kt,tickDecimals:At}}),Tt=>Tt.index)}draw(){if(this.element===null)return;const{width:Pt,series:Tt,timeRange:Rt,showLines:Kt,showBars:At,showPoints:Yt,isStacked:en,lineWidth:pn,timeZone:kt,onHorizontalRegionSelected:yn}=this.props;if(!Pt)return;const zn=Pt/100,mn=Rt.from.valueOf(),Tn=Rt.to.valueOf(),ya=this.getYAxes(Tt),Wa={legend:{show:!1},series:{stack:en,lines:{show:Kt,lineWidth:pn,zero:!1},points:{show:Yt,fill:1,fillColor:!1,radius:2},bars:{show:At,fill:1,barWidth:At?this.getBarWidth()/1.5:1,zero:!1,lineWidth:pn},shadowSize:0},xaxis:{timezone:kt,show:!0,mode:"time",min:mn,max:Tn,label:"Datetime",ticks:zn,timeformat:Ao(zn,mn,Tn),tickFormatter:vi},yaxes:ya,grid:{minBorderMargin:0,markings:[],backgroundColor:null,borderWidth:0,hoverable:!0,clickable:!0,color:"#a1a1a1",margin:{left:0,right:0},labelMarginX:0,mouseActiveRadius:30},selection:{mode:yn?"x":null,color:"#666"},crosshair:{mode:"x"}};try{fi().plot(this.element,Tt.filter(Pa=>Pa.isVisible),Wa)}catch(Pa){throw console.error("Graph rendering error",Pa,Wa,Tt),new Error("Error rendering panel")}}render(){const{ariaLabel:Pt,height:Tt,width:Rt,series:Kt}=this.props,At=Kt.length===0,Yt=this.renderTooltip(),en=this.renderContextMenu();return(0,r.jsxs)("div",{className:"graph-panel","aria-label":Pt,children:[(0,r.jsx)("div",{className:"graph-panel__chart",ref:pn=>this.element=pn,style:{height:Tt,width:Rt},onMouseLeave:()=>{this.setState({isTooltipVisible:!1})}}),At&&(0,r.jsx)("div",{className:"datapoints-warning",children:"No data"}),Yt,en]})}}const cc=null,Ll=(ht,Pt=!1,Tt=!1)=>{const Rt=ht.reduce((At,Yt)=>At+(Yt[1]||0),0)===0,Kt=!ht.reduce((At,Yt)=>At&&Yt[1]!==null,!0);return Pt&&Kt||Tt&&Rt},Ei=ht=>{const{series:Pt,timeRange:Tt,width:Rt,height:Kt,showBars:At,showLines:Yt,showPoints:en,sortLegendBy:pn,sortLegendDesc:kt,legendDisplayMode:yn,legendVisibility:zn,placement:mn,onSeriesToggle:Tn,onToggleSort:ya,hideEmpty:Wa,hideZero:Pa,isStacked:ts,lineWidth:fa,onHorizontalRegionSelected:ns,timeZone:as,children:Ms,ariaLabel:Da}=ht,{graphContainer:Mn,wrapper:Ca,legendContainer:Wn}=(0,R.of)(jl,ht.placement),xn=Pt.reduce((Ra,ja)=>Ll(ja.data,Wa,Pa)?Ra:Ra.concat([{label:ja.label,color:ja.color||"",disabled:!ja.isVisible,yAxis:ja.yAxis.index,getDisplayValues:()=>ja.info||[]}]),[]);return(0,r.jsxs)("div",{className:Ca,"aria-label":Da,children:[(0,r.jsx)("div",{className:Mn,children:(0,r.jsx)(xi,{series:Pt,timeRange:Tt,timeZone:as,showLines:Yt,showPoints:en,showBars:At,width:Rt,height:Kt,isStacked:ts,lineWidth:fa,onHorizontalRegionSelected:ns,children:Ms})}),zn&&(0,r.jsx)("div",{className:Wn,children:(0,r.jsx)(ve.E,{hideHorizontalTrack:!0,children:(0,r.jsx)(na.t,{items:xn,displayMode:yn,placement:mn,sortBy:pn,sortDesc:kt,onLabelClick:(Ra,ja)=>{Tn&&Tn(Ra.label,ja)},onToggleSort:ya})})})]})},jl=(ht,Pt)=>({wrapper:(0,S.css)({display:"flex",flexDirection:Pt==="bottom"?"column":"row"}),graphContainer:(0,S.css)({minHeight:"65%",flexGrow:1}),legendContainer:(0,S.css)({padding:"10px 0",maxHeight:Pt==="bottom"?"35%":"none"})});class Bo extends v.Component{constructor(Pt){super(Pt),this.onSeriesToggle=this.onSeriesToggle.bind(this),this.state={hiddenSeries:[],toggledSeries:Pt.series}}componentDidUpdate(Pt){const{series:Tt}=this.props;(0,z.isEqual)(Pt.series,Tt)||this.setState({hiddenSeries:[],toggledSeries:Tt})}onSeriesToggle(Pt,Tt){const{series:Rt,onHiddenSeriesChanged:Kt}=this.props,{hiddenSeries:At}=this.state;if(Tt.ctrlKey||Tt.metaKey||Tt.shiftKey){const kt=At.indexOf(Pt)>-1?At.filter(zn=>zn!==Pt):At.concat([Pt]),yn=Rt.map(zn=>({...zn,isVisible:kt.indexOf(zn.label)===-1}));this.setState({hiddenSeries:kt,toggledSeries:yn},()=>Kt?Kt(kt):void 0);return}const Yt=Rt.map(kt=>kt.label),en=At.length+1===Yt.length?[]:(0,z.difference)(Yt,[Pt]),pn=Rt.map(kt=>({...kt,isVisible:en.indexOf(kt.label)===-1}));this.setState({hiddenSeries:en,toggledSeries:pn},()=>Kt?Kt(en):void 0)}render(){const{children:Pt}=this.props,{toggledSeries:Tt}=this.state;return Pt({onSeriesToggle:this.onSeriesToggle,toggledSeries:Tt})}}var ar=e(64423),Uo=e(99165),fr=e(36638),Pr=e(57866),Us=e(95004),Pi=e(57852),bi=e(32899),sr=e(36192),br=e(8721);const Wr={threshold:(ht,Pt,Tt)=>ht+Tt,midpoint:(ht,Pt,Tt)=>(ht+Pt)/2,plusone:(ht,Pt,Tt)=>ht+1};function lo(ht){if(ht.frame.length===0)return ht.frame;let Pt=!0,{frame:Tt,refFieldName:Rt,refFieldPseudoMax:Kt,refFieldPseudoMin:At,insertMode:Yt}=ht;Yt||(Yt=Wr.threshold);const en=Nl(Tt,Rt);if(en==null)return Tt;en.state={...en.state,nullThresholdApplied:!0};const pn=Tt.fields.map(yn=>yn.config.custom?.insertNulls||en.config.interval||null),kt=new Set(pn);if(kt.delete(null),kt.size===0)return Tt;if(kt.size===1){const yn=kt.values().next().value;if(!yn||yn<=0)return Tt;const zn=en.values,mn=Tt.fields.map(ya=>ya.values),Tn=Bl(zn,mn,yn,At,Kt,Yt,Pt);return Tn===mn?Tt:{...Tt,length:Tn[0].length,fields:Tt.fields.map((ya,Wa)=>({...ya,values:Tn[Wa]}))}}return Tt}function Bl(ht,Pt,Tt,Rt=null,Kt=null,At,Yt){const en=ht.length,pn=[];if(Rt!=null&&RtTt&&(pn.push(At(kt,Tn,Tt)),kt+=Tt,!!Yt););pn.push(Tn),kt=Tn}if(Kt!=null&&Kt>kt)for(;kt+TtPt!=null?Tt.name===Pt:Tt.type===Us.PU.time)}function Di(ht,Pt){const Tt=Nl(ht,Pt);let Rt=Tt?.values;for(let Kt=0;KtRt?.state?.nullThresholdApplied?en:lo({frame:en,refFieldName:Rt.name,refFieldPseudoMin:Tt?.from.valueOf(),refFieldPseudoMax:Tt?.to.valueOf()}));let Kt=0;ht.forEach(en=>{en.fields.forEach(pn=>{co(pn)&&(pn.config.custom={...pn.config.custom,spanNulls:-1},Kt++)})});let At=1/0;Kt>1&&ht.forEach(en=>{if(!en.fields.some(co))return;const pn=Rt.values;for(let kt=0;kt0&&(At=Math.min(At,pn[kt]-pn[kt-1]))});let Yt=(0,br.Fd)({frames:ht,joinBy:Pt.x,keep:Pt.y,keepOriginIndices:!0});return Yt?(Yt=Di(Yt,Rt.name),At!==1/0&&(Yt.fields.forEach((en,pn)=>{let kt=en.values;if(pn===0){let yn=kt[kt.length-1];kt.push(yn+At,yn+2*At)}else co(en)?kt.push(null,null):kt.push(void 0,void 0)}),Yt.length+=2),Yt):null}function Ci(ht,Pt){const Rt=`${ht.min!==void 0?ht.min:"na"}-${ht.max!==void 0?ht.max:"na"}`,Kt=`${ht.custom?.axisSoftMin!==void 0?ht.custom.axisSoftMin:"na"}-${ht.custom?.axisSoftMax!==void 0?ht.custom.axisSoftMax:"na"}`,At=`${ht.custom?.axisPlacement!==void 0?ht.custom?.axisPlacement:ia.vM.Auto}`,Yt=ht.unit??ui.s,en=ht.custom?.scaleDistribution?Ti(ht.custom.scaleDistribution):ia.L4.Linear,pn=ht.custom?.axisLabel?ht.custom.axisLabel:"na";return`${Yt}/${Rt}/${Kt}/${At}/${en}/${pn}/${Pt}`}function Ti(ht){return ht.type===ia.L4.Log?`${ht.type}${ht.log}`:ht.type}function Si(ht,Pt,Tt=[]){for(const Rt of Tt)if(typeof Rt=="function"){if(!Rt(ht,Pt))return!1}else if(Pt[Rt]!==ht[Rt])return!1;return!0}class Mi extends v.Component{constructor(Pt){super(Pt),this.panelContext={},this.subscription=new ar.yU,this.getTimeRange=()=>this.props.timeRange;let Tt=this.prepState(Pt);Tt.alignedData=Tt.config.prepData([Tt.alignedFrame]),this.state=Tt,this.plotInstance=v.createRef()}static{this.contextType=Dn.e4}prepState(Pt,Tt=!0){let Rt=null;const{frames:Kt,fields:At,preparePlotFrame:Yt}=Pt,pn=(Yt||No)(Kt,At||{x:fr.sJ.get(Pr.Ct.firstTimeField).get({}),y:fr.sJ.get(Pr.Ct.byTypes).get(new Set([Us.PU.number,Us.PU.enum]))},Pt.timeRange);if((0,sr.uY)("GraphNG",!1,"data aligned",pn),pn){let kt=this.state?.config;Tt&&(kt=Pt.prepConfig(pn,this.props.frames,this.getTimeRange),(0,sr.uY)("GraphNG",!1,"config prepared",kt)),Rt={alignedFrame:pn,config:kt},(0,sr.uY)("GraphNG",!1,"data prepared",Rt.alignedData)}return Rt}handleCursorUpdate(Pt){const Tt=Pt.payload?.point?.time,Rt=this.plotInstance.current;if(Rt&&Tt){const Kt=Rt.valToPos(Tt,"x");let At;if(Kt&&(At=(0,sr.sw)(Rt,Rt.posToIdx(Kt))),!At||!Kt)return;Rt.setCursor({left:Kt,top:At})}}componentDidMount(){this.panelContext=this.context;const{eventBus:Pt}=this.panelContext;this.subscription.add(Pt.getStream(Pi.b_).pipe((0,Uo.c)(50)).subscribe({next:Tt=>{Pt!==Tt.origin&&this.handleCursorUpdate(Tt)}})),this.subscription.add(Pt.getStream(bi.kb).pipe((0,Uo.c)(50)).subscribe({next:Tt=>this.handleCursorUpdate(Tt)})),this.subscription.add(Pt.getStream(Pi.ql).pipe((0,Uo.c)(50)).subscribe({next:()=>{const Tt=this.plotInstance?.current;Tt&&!Tt.cursor._lock&&Tt.setCursor({left:-10,top:-10})}}))}componentDidUpdate(Pt){const{frames:Tt,structureRev:Rt,timeZone:Kt,propsToDiff:At}=this.props,Yt=!Si(Pt,this.props,At);if(Tt!==Pt.frames||Yt||Kt!==Pt.timeZone){let en=this.prepState(this.props,!1);en&&((this.state.config===void 0||Kt!==Pt.timeZone||Rt!==Pt.structureRev||!Rt||Yt)&&(en.config=this.props.prepConfig(en.alignedFrame,this.props.frames,this.getTimeRange),(0,sr.uY)("GraphNG",!1,"config recreated",en.config)),en.alignedData=en.config.prepData([en.alignedFrame]),this.setState(en))}}componentWillUnmount(){this.subscription.unsubscribe()}render(){const{width:Pt,height:Tt,children:Rt,renderLegend:Kt}=this.props,{config:At,alignedFrame:Yt,alignedData:en}=this.state;return At?(0,r.jsx)(ta.KU,{width:Pt,height:Tt,legend:Kt(At),children:(pn,kt)=>(0,r.jsx)(ii.Z,{config:At,data:en,width:pn,height:kt,plotRef:yn=>this.plotInstance.current=yn,children:Rt?Rt(At,Yt):null})}):null}}var Dr=e(36613),Wo=e(11576),Kr=e(76637),uo=e(64394),Ko=e(84229),Fo=e(66650);const Oi=new Set(["bytes","bits","kbytes","mbytes","gbytes","tbytes","pbytes","binBps","binbps","KiBs","Kibits","MiBs","Mibits","GiBs","Gibits","TiBs","Tibits","PiBs","Pibits"]),Cr=Array(53);for(let ht=0;htht==null?"-":ht.toFixed(Pt),Ke={drawStyle:ia.GR.Line,showPoints:ia.yL.Auto,axisPlacement:ia.vM.Auto},Te=({frame:ht,theme:Pt,timeZones:Tt,getTimeRange:Rt,sync:Kt,allFrames:At,renderers:Yt,tweakScale:en=kt=>kt,tweakAxis:pn=kt=>kt})=>{const kt="__global_",yn=new oi.e(Tt[0]);let zn;yn.setPrepData(Da=>(zn=Da[0],(0,sr.bq)(Da[0],yn.getStackingGroups())));const mn=ht.fields[0];if(!mn)return yn;const Tn="x";let ya="";const Wa=mn.config.custom?.axisPlacement!==ia.vM.Hidden?ia.vM.Bottom:ia.vM.Hidden,Pa=mn.config.custom?.axisPlacement!==ia.vM.Hidden;if(mn.type===Us.PU.time){yn.addScale({scaleKey:Tn,orientation:ia.Lt.Horizontal,direction:ia.ON.Right,isTime:!0,range:()=>{const Mn=Rt();return[Mn.from.valueOf(),Mn.to.valueOf()]}});const Da=Tt.length>1?(Mn,Ca)=>Ca.map((Wn,xn)=>xn<2?null:Wn):void 0;for(let Mn=0;Mn1&&yn.addHook("drawAxes",Mn=>{Mn.ctx.save(),Mn.ctx.fillStyle=Pt.colors.text.primary,Mn.ctx.textAlign="left",Mn.ctx.textBaseline="bottom";let Ca=0;Mn.axes.forEach(Wn=>{if(Wn.side===2){let xn=Wn._pos+Wn._size;Mn.ctx.fillText(Tt[Ca],Mn.bbox.left,xn*Dr.A.pxRatio),Ca++}}),Mn.ctx.restore()})}else yn.addScale({scaleKey:Tn,orientation:ia.Lt.Horizontal,direction:ia.ON.Right,range:(Da,Mn,Ca)=>[mn.config.min??Mn,mn.config.max??Ca]}),yn.addAxis({scaleKey:Tn,placement:Wa,show:Pa,label:mn.config.custom?.axisLabel,theme:Pt,grid:{show:mn.config.custom?.axisGridShow},formatValue:(Da,Mn)=>(0,is.cN)(mn.display(Da,Mn))});let ts=Yt?.flatMap(Da=>Object.values(Da.fieldMap).filter(Mn=>Da.indicesOnly.indexOf(Mn)===-1))??[],fa;for(let Da=1;Da(ir=ir<0?-1:0,$s=$s>0?1:0,[ir,$s]):Mn.type===Us.PU.enum?(ds,ir,$s)=>[-1,Mn.config.type.enum.text.length]:void 0,decimals:Mn.config.decimals},Mn)),ya||(ya=Ra),Wn.axisPlacement!==ia.vM.Hidden){let ds;Wn.axisColorMode===ia.Y$.Series&&(ja.isByValue&&Mn.config.custom?.gradientMode===ia.on.Scheme&&ja.id===uo.Y.Thresholds?ds=(0,Fo.pl)(1,Pt,ja,Mn.config.thresholds):ds=gn);const ir={border:{show:Wn.axisBorderShow||!1,width:1/devicePixelRatio,stroke:ds||Pt.colors.text.primary},ticks:{show:Wn.axisBorderShow||!1,stroke:ds||Pt.colors.text.primary},color:ds||Pt.colors.text.primary};let $s,En,Os;if(Oi.has(Ca.unit))$s=Cr;else if(Mn.type===Us.PU.enum){let Es=Mn.config.type.enum.text;Os=Es.map((zs,Gs)=>Gs),En=Es}yn.addAxis(pn({scaleKey:Ra,label:Wn.axisLabel,size:Wn.axisWidth,placement:Wn.axisPlacement??ia.vM.Auto,formatValue:(Es,zs)=>(0,is.cN)(xn(Es,zs)),theme:Pt,grid:{show:Wn.axisGridShow},decimals:Mn.config.decimals,distr:Wn.scaleDistribution?.type,splits:Os,values:En,incrs:$s,...ir},Mn))}const ss=Wn.drawStyle===ia.GR.Points?ia.yL.Always:Wn.showPoints;let Ga=()=>null;Wn.spanNulls!==!0&&(Ga=(ds,ir,$s,En)=>{let Os=[],Es=ds.series[ir];if(!$s&&En&&En.length){const[zs,Gs]=Es.idxs,Li=ds.data[0],Va=ds.data[ir],Fl=Math.round(ds.valToPos(Li[zs],"x",!0)),Ba=Math.round(ds.valToPos(Li[Gs],"x",!0));En[0][0]===Fl&&Os.push(zs);for(let Sr=0;Sr=0)or=()=>null,Js=()=>{};else if(Wn.transform===ia.NU.Constant){const En=Dr.A.paths.linear();or=(Os,Es)=>{const zs=Os._data,Gs=Rt();let Li=[Gs.from.valueOf(),Gs.to.valueOf()],Va=zs[Es].find(Sr=>Sr!=null),Fl=[Va,Va],Ba=zs.slice();return Ba[0]=Li,Ba[Es]=Fl,En({...Os,_data:Ba},Es,0,1)}}if(Wn.fillBelowTo){const En=ht.fields.find(Gs=>Wn.fillBelowTo===Gs.name||Wn.fillBelowTo===Gs.config?.displayNameFromDS||Wn.fillBelowTo===(0,tr.Ct)(Gs,ht,At)),Os=En?(0,tr.Ct)(En,ht,At):Wn.fillBelowTo,Es=fa.get($s),zs=fa.get(Os);(0,z.isNumber)(zs)&&(0,z.isNumber)(Es)?(yn.addBand({series:[Es,zs],fill:void 0}),gs||(gs=35)):gs=0}}let Ai;ja.id===uo.Y.Thresholds&&(Ai=ds=>(0,Kr.lz)(zn.fields[ds],Pt).color),yn.addSeries({pathBuilder:or,pointsBuilder:Js,scaleKey:Ra,showPoints:ss,pointsFilter:Ga,colorMode:ja,fillOpacity:gs,theme:Pt,dynamicSeriesColor:Ai,drawStyle:Wn.drawStyle,lineColor:Wn.lineColor??gn,lineWidth:Wn.lineWidth,lineInterpolation:Wn.lineInterpolation,lineStyle:Wn.lineStyle,barAlignment:Wn.barAlignment,barWidthFactor:Wn.barWidthFactor,barMaxWidth:Wn.barMaxWidth,pointSize:Wn.pointSize,spanNulls:Wn.spanNulls||!1,show:!Wn.hideFrom?.viz,gradientMode:Wn.gradientMode,thresholds:Ca.thresholds,hardMin:Mn.config.min,hardMax:Mn.config.max,softMin:Wn.axisSoftMin,softMax:Wn.axisSoftMax,dataFrameFieldIndex:Mn.state?.origin}),Wn.thresholdsStyle&&Ca.thresholds&&(Wn.thresholdsStyle.mode??ia.Ly.Off)!==ia.Ly.Off&&yn.addThresholds({config:Wn.thresholdsStyle,thresholds:Ca.thresholds,scaleKey:Ra,theme:Pt,hardMin:Mn.config.min,hardMax:Mn.config.max,softMin:Wn.axisSoftMin,softMax:Wn.axisSoftMax})}let ns=(0,sr.ro)(ht);yn.setStackingGroups(ns),Yt?.forEach(Da=>{fa||(fa=He(ht,At));let Mn={};for(let Ca in Da.fieldMap){let Wn=Da.fieldMap[Ca];Mn[Ca]=fa.get(Wn)}Da.init(yn,Mn)}),yn.scaleKeys=[Tn,ya];const as=15;let Ms={dataIdx:(Da,Mn,Ca,Wn)=>{let xn=Da.data[Mn];if(xn[Ca]==null){let Ra=null,ja=null,xa;for(xa=Ca;Ra==null&&xa-- >0;)xn[xa]!=null&&(Ra=xa);for(xa=Ca;ja==null&&xa++{const At=Rt.state?.origin;if(At){const Yt=Pt[At.frameIndex]?.fields[At.fieldIndex];Yt&&Tt.set((0,tr.Ct)(Yt,Pt[At.frameIndex],Pt),Kt)}}),Tt}const st=["legend","options","theme"];class Et extends v.Component{constructor(){super(...arguments),this.prepConfig=(Pt,Tt,Rt)=>{const{sync:Kt}=this.context,{theme:At,timeZone:Yt,renderers:en,tweakAxis:pn,tweakScale:kt}=this.props;return Te({frame:Pt,theme:At,timeZones:Array.isArray(Yt)?Yt:[Yt],getTimeRange:Rt,sync:Kt,allFrames:Tt,renderers:en,tweakScale:kt,tweakAxis:pn})},this.renderLegend=Pt=>{const{legend:Tt,frames:Rt}=this.props;return!Pt||Tt&&!Tt.showLegend||!(0,Nr.t)(Pt,Rt)?null:(0,r.jsx)(Nr.$,{data:Rt,config:Pt,...Tt})}}static{this.contextType=Dn.e4}render(){return(0,r.jsx)(Mi,{...this.props,prepConfig:this.prepConfig,propsToDiff:st,renderLegend:this.renderLegend})}}const St=(0,R.cV)(Et);St.displayName="TimeSeries";const Ot=(0,v.createContext)({}),Ut=()=>{const{data:ht,dimFields:Pt,mapSeriesIndexToDataFrameFieldIndex:Tt}=(0,v.useContext)(Ot),Rt=(0,v.useCallback)(()=>{const Kt=Pt.x;let At=null;for(let Yt=0;Ytht!=null&&!ht.ctrlKey&&!ht.metaKey,bn=({onZoom:ht,config:Pt,withZoomY:Tt=!1})=>((0,v.useLayoutEffect)(()=>{let Rt=!1,Kt=!1;Tt&&Pt.addHook("init",At=>{At.over.addEventListener("mousedown",Yt=>{if(fn(Yt)&&Yt.button===0&&Yt.shiftKey){Kt=!0,At.cursor.drag.x=!1,At.cursor.drag.y=!0;let en=pn=>{At.cursor.drag.x=!0,At.cursor.drag.y=!1,document.removeEventListener("mouseup",en,!0)};document.addEventListener("mouseup",en,!0)}},!0)}),Pt.addHook("setSelect",At=>{const Yt=At.scales.x.ori===0;if(fn(At.cursor.event)){if(Tt&&Kt){if(At.select.height>=Qt){for(let en in At.scales)if(en!=="x"){const pn=Yt?At.posToVal(At.select.top,en):At.posToVal(At.select.left+At.select.width,en),kt=Yt?At.posToVal(At.select.top+At.select.height,en):At.posToVal(At.select.left,en);At.setScale(en,{min:kt,max:pn})}Rt=!0}Kt=!1}else if(At.select.width>=Qt){const en=Yt?At.posToVal(At.select.left,"x"):At.posToVal(At.select.top+At.select.height,"x"),pn=Yt?At.posToVal(At.select.left+At.select.width,"x"):At.posToVal(At.select.top,"x");ht({from:en,to:pn}),Rt=!1}}At.setSelect({left:0,width:0,top:0,height:0},!1)}),Pt.setCursor({bind:{dblclick:At=>()=>{if(!fn(At.cursor.event))return null;if(Tt&&Rt){for(let Yt in At.scales)Yt!=="x"&&At.setScale(Yt,{min:null,max:null});Rt=!1}else{let Yt=At.scales.x;const en=Yt.min,pn=Yt.max,kt=(pn-en)/2;ht({from:en-kt,to:pn+kt})}return null}}})},[Pt,ht,Tt]),null);var Fn=e(1604),aa=e(46635);const ra=10,$n=({mode:ht=ia.$N.Single,sortOrder:Pt=ia.xB.None,sync:Tt,timeZone:Rt,config:Kt,renderTooltip:At,...Yt})=>{const en=(0,v.useRef)(),pn=(0,R.$j)(),[kt,yn]=(0,v.useState)(null),[zn,mn]=(0,v.useState)(null),[Tn,ya]=(0,v.useState)([]),[Wa,Pa]=(0,v.useState)(null),[ts,fa]=(0,v.useState)(!1),ns=(0,Fn.A)();let as=null;const Ms=(0,R.of)(Oa);if((0,v.useLayoutEffect)(()=>{let xn;const Ra=()=>{ns()&&(fa(!0),en.current?.root.classList.add("plot-active"))},ja=()=>{ns()&&(Pa(null),fa(!1),en.current?.root.classList.remove("plot-active"))};return Kt.addHook("syncRect",(xa,gn)=>xn=gn),Kt.addHook("init",xa=>{en.current=xa,xa.over.addEventListener("mouseenter",Ra),xa.over.addEventListener("mouseleave",ja),as=xa.root.closest("[tabindex]"),as&&(as.addEventListener("focus",Ra),as.addEventListener("blur",ja)),Tt&&Tt()===Ko.y.Crosshair&&xa.root.classList.add("shared-crosshair")}),Kt.addHook("setLegend",xa=>{ns()&&(mn(xa.legend.idx),ya(xa.legend.idxs.slice()))}),Kt.addHook("setCursor",xa=>{if(!xn||!ns())return;const{x:gn,y:ss}=va(xa,xn);Pa(gn!==void 0&&ss!==void 0?{x:gn,y:ss}:null)}),Kt.addHook("setSeries",(xa,gn)=>{ns()&&yn(gn)}),()=>{Pa(null),en.current&&(en.current.over.removeEventListener("mouseleave",ja),en.current.over.removeEventListener("mouseenter",Ra),as&&(as.removeEventListener("focus",Ra),as.removeEventListener("blur",ja)))}},[Kt,Pa,fa,mn,ya]),zn===null||!ts&&Tt&&Tt()===Ko.y.Crosshair)return null;let Da=Yt.data.fields[0];if(!Da)return null;const Mn=Da.display||(0,Wo.J)({field:Da,timeZone:Rt,theme:pn});let Ca=null,Wn=Mn(Da.values[zn]).text;if(At)Ca=At(Yt.data,kt,zn);else{if(ht===ia.$N.Single&&kt!==null){const xn=Yt.data.fields[kt];if(!xn)return null;const Ra=Tn?.[kt]??zn;Wn=Mn(Da.values[Ra]).text;const xa=(xn.display||(0,Wo.J)({field:xn,timeZone:Rt,theme:pn}))(xn.values[Ra]);Ca=(0,r.jsx)(Nt.o,{series:[{color:xa.color||uo.F,label:(0,tr.Ct)(xn,Yt.data,Yt.frames),value:xa?(0,is.cN)(xa):null}],timestamp:Wn})}if(ht===ia.$N.Multi){let xn=[];const Ra=Yt.data,ja=Ra.fields,xa=[];for(let gn=0;gn{const or=gn.indexOf(Ga),Js=gn.indexOf(gs);return ss(xa[or],xa[Js])})}Ca=(0,r.jsx)(Nt.o,{series:xn,timestamp:Wn})}}return(0,r.jsx)(ce.ZL,{className:ts?Ms.tooltipWrapper:void 0,children:Ca&&Wa&&(0,r.jsx)(Cn.o,{position:{x:Wa.x,y:Wa.y},offset:{x:ra,y:ra},children:Ca})})};function Yn({left:ht,top:Pt},Tt){return ht===void 0||Pt===void 0?!1:ht<0||ht>Tt.width||Pt<0||Pt>Tt.height}function va(ht,Pt){let Tt,Rt;const Kt=ht.cursor.left||0,At=ht.cursor.top||0;if(Yn(ht.cursor,Pt)){const Yt=ht.posToIdx(Kt);if(At<0||At>Pt.height){let en=(0,sr.sw)(ht,Yt);en&&(Rt=Pt.top+en,Kt>=0&&Kt<=Pt.width&&(Tt=Pt.left+ht.valToPos(ht.data[0][ht.posToIdx(Kt)],ht.series[0].scale)))}}else Tt=Pt.left+Kt,Rt=Pt.top+At;return{x:Tt,y:Rt}}const Oa=ht=>({tooltipWrapper:(0,S.css)({"z-index":ht.zIndex.portal+1+" !important"})});var ma=e(56887),Na=e(53926),Nn=e(97958),Ta=e(30360),ka=e(8255),Ea=e(75745),Ya=e(35458),cs=e(75254),Ns=e(48542);let rr=null;function pr(){if(rr!==null)return rr;if(typeof document<"u"){const ht=document.createElement("div"),Pt={width:"100px",height:"100px",position:"absolute",top:"-9999px",overflow:"scroll",MsOverflowStyle:"scrollbar"};Object.keys(Pt).map(Tt=>{ht.style[Tt]=Pt[Tt]}),document.body.appendChild(ht),rr=ht.offsetWidth-ht.clientWidth,document.body.removeChild(ht)}else rr=0;return rr||0}var wo=e(86059),qa=e(36324),xs=e(79104),ps=e(59258),ms=e(60379),Ss=e(20720),mr=(ht=>(ht.id="id",ht.title="title",ht.subTitle="subTitle",ht.mainStat="mainStat",ht.secondaryStat="secondaryStat",ht.source="source",ht.target="target",ht.detail="detail__",ht.arc="arc__",ht.color="color",ht))(mr||{}),Fr=e(63267);function ho(ht,Pt,Tt,Rt){if(ht>Pt){const Kt=`[Combobox] Items exceed the recommended amount ${Pt}.`;console.warn(Kt,{itemsCount:""+ht,recommendedAmount:""+Pt,"aria-labelledby":Rt??"",id:Tt??""})}}var fo=e(69884);let es;const Ws=(ht="dark")=>es?es(ht):(0,fo.a)({colors:{mode:ht}}).v1,ls=ht=>(es=ht,()=>{es=null});var wr=e(77345),po=e(24726);const Tr={"[":"]","{":"}","(":")"},Ys="brace_match";function Ri(){return{onKeyDown(ht,Pt,Tt){const{value:Rt}=Pt;switch(ht.key){case"(":case"{":case"[":{const{start:{offset:Kt,key:At},end:{offset:Yt,key:en},focus:{offset:pn}}=Rt.selection,kt=Rt.focusText.text;if(Rt.selection.isExpanded)return ht.preventDefault(),Pt.insertTextByKey(At,Kt,ht.key).insertTextByKey(en,Yt+1,Tr[ht.key]).moveEndBackward(1),!0;if(pn===kt.length||kt[pn]===" "||Object.values(Tr).includes(kt[pn])){ht.preventDefault();const yn=Tr[ht.key],zn={key:`${Ys}-${(0,po.A)()}`,type:`${Ys}-${yn}`,anchor:{key:At,offset:Kt,object:"point"},focus:{key:en,offset:Yt+1,object:"point"},object:"annotation"};return Pt.insertText(ht.key).insertText(yn).addAnnotation(zn).moveBackward(1),!0}break}case")":case"}":case"]":{const Kt=Rt.anchorText.text,At=Rt.selection.anchor.offset,Yt=Kt[At],en=ht.key,pn=`${Ys}-${en}`,kt=Rt.annotations.find(yn=>yn?.type===pn&&yn.anchor.key===Rt.anchorText.key);if(kt&&Yt===en&&!Rt.selection.isExpanded)return ht.preventDefault(),Pt.moveFocusForward(1).removeAnnotation(kt).moveAnchorForward(1),!0;break}case"Backspace":{const Kt=Rt.anchorText.text,At=Rt.selection.anchor.offset,Yt=Kt[At-1],en=Kt[At];if(Tr[Yt]&&Tr[Yt]===en)return ht.preventDefault(),Pt.deleteBackward(1).deleteForward(1).focus(),!0}default:break}return Tt()}}}var Kl=e(16123),dc=e(54024),Wc=e(52513),Kc=e(21266),Fc=e(59490),Ii=e(91272),wc=e(56103),Vc=e(93427);const uc={SecretFormField:H.L,FormField:a.z,Select:M,AsyncSelect:O,IndicatorsContainer:l,NoOptionsMessage:h,Input:c.p,Switch:F}},44017(ne,A,e){"use strict";e.d(A,{T4:()=>x,W1:()=>v,Wq:()=>m,rg:()=>s});var t=e(74848),n=e(38809),a=e(95004),c=e(92745),r=e(739),i=e(37386),o=e(77824),l=e(63527),f=e(41654),h=e(18857),d=e(99555);function s(p,y){m(p);const E=[(0,c.t)("grafana-ui.builder.axis.category-axis","Axis")];p.addTextInput({path:"axisLabel",name:(0,c.t)("grafana-ui.builder.axis.name-label","Label"),category:E,defaultValue:"",settings:{placeholder:(0,c.t)("grafana-ui.builder.axis.placeholder-label","Optional text"),expandTemplateVars:!0},showIf:b=>b.axisPlacement!==r.vM.Hidden,shouldApply:b=>b.type!==a.PU.time&&b.type!==a.PU.string}),x(p),p.addRadio({path:"axisGridShow",name:(0,c.t)("grafana-ui.builder.axis.name-grid-lines","Show grid lines"),category:E,defaultValue:void 0,settings:{options:[{value:void 0,label:(0,c.t)("grafana-ui.builder.axis.grid-line-options.label-auto","Auto")},{value:!0,label:(0,c.t)("grafana-ui.builder.axis.grid-line-options.label-on","On")},{value:!1,label:(0,c.t)("grafana-ui.builder.axis.grid-line-options.label-off","Off")}]},showIf:b=>b.axisPlacement!==r.vM.Hidden}).addRadio({path:"axisColorMode",name:(0,c.t)("grafana-ui.builder.axis.color-label","Color"),category:E,defaultValue:r.Y$.Text,settings:{options:[{value:r.Y$.Text,label:(0,c.t)("grafana-ui.builder.axis.color-options.label-text","Text")},{value:r.Y$.Series,label:(0,c.t)("grafana-ui.builder.axis.color-options.label-series","Series")}]},showIf:b=>b.axisPlacement!==r.vM.Hidden}).addBooleanSwitch({path:"axisBorderShow",name:(0,c.t)("grafana-ui.builder.axis.name-show-border","Show border"),category:E,defaultValue:!1,showIf:b=>b.axisPlacement!==r.vM.Hidden}),p.addCustomEditor({id:"scaleDistribution",path:"scaleDistribution",name:(0,c.t)("grafana-ui.builder.axis.name-scale","Scale"),category:E,editor:v,override:v,defaultValue:{type:r.L4.Linear},shouldApply:b=>b.type===a.PU.number,process:n.hS}).addBooleanSwitch({path:"axisCenteredZero",name:(0,c.t)("grafana-ui.builder.axis.name-centered-zero","Centered zero"),category:E,defaultValue:!1,showIf:b=>b.scaleDistribution?.type!==r.L4.Log}).addNumberInput({path:"axisSoftMin",name:(0,c.t)("grafana-ui.builder.axis.name-soft-min","Soft min"),defaultValue:y.axisSoftMin,category:E,settings:{placeholder:(0,c.t)("grafana-ui.builder.axis.placeholder-soft-min","See: Standard options > Min")}}).addNumberInput({path:"axisSoftMax",name:(0,c.t)("grafana-ui.builder.axis.name-soft-max","Soft max"),defaultValue:y.axisSoftMax,category:E,settings:{placeholder:(0,c.t)("grafana-ui.builder.axis.placeholder-soft-max","See: Standard options > Max")}})}const g=[{label:"2",value:2},{label:"10",value:10}],v=({value:p,onChange:y})=>{const E=p?.type??r.L4.Linear,b=p?.log??2,u=[{label:(0,c.t)("grafana-ui.builder.axis.scale-distribution-editor.distribution-options.label-linear","Linear"),value:r.L4.Linear},{label:(0,c.t)("grafana-ui.builder.axis.scale-distribution-editor.distribution-options.label-log","Logarithmic"),value:r.L4.Log},{label:(0,c.t)("grafana-ui.builder.axis.scale-distribution-editor.distribution-options.label-symlog","Symlog"),value:r.L4.Symlog}];return(0,t.jsxs)(f.B,{direction:"column",gap:2,children:[(0,t.jsx)(o.z,{value:E,options:u,onChange:D=>{y({...p,type:D,log:D===r.L4.Linear?void 0:b})}}),(E===r.L4.Log||E===r.L4.Symlog)&&(0,t.jsx)(i.D,{label:(0,c.t)("grafana-ui.axis-builder.log-base","Log base"),children:(0,t.jsx)(h.l6,{options:g,value:b,onChange:D=>{y({...p,log:D.value})}})}),E===r.L4.Symlog&&(0,t.jsx)(i.D,{label:(0,c.t)("grafana-ui.axis-builder.linear-threshold","Linear threshold"),style:{marginBottom:0},children:(0,t.jsx)(l.p,{placeholder:"1",value:p?.linearThreshold,onChange:D=>{y({...p,linearThreshold:Number(D.currentTarget.value)})}})})]})};function x(p){p.addNumberInput({path:"axisWidth",name:(0,c.t)("grafana-ui.builder.axis.name-width","Width"),category:[(0,c.t)("grafana-ui.builder.axis.category-axis","Axis")],settings:{placeholder:(0,c.t)("grafana-ui.builder.axis.placeholder-width","Auto")},showIf:y=>y.axisPlacement!==r.vM.Hidden})}function m(p,y=E=>!0){const E=(0,d.P)();p.addRadio({path:"axisPlacement",name:(0,c.t)("grafana-ui.builder.axis.name-placement","Placement"),category:[(0,c.t)("grafana-ui.builder.axis.category-axis","Axis")],defaultValue:E.axisPlacement[0].value,settings:{options:E.axisPlacement.filter(b=>y(b.value))}})}},45013(ne,A,e){"use strict";e.d(A,{e:()=>l});var t=e(74848),n=e(2543),a=e.n(n),c=e(96540),r=e(34343),i=e(41654);const o=({value:f,onChange:h})=>{const d=(0,c.useCallback)(s=>{h({...f,[s]:!f[s]})},[f,h]);return(0,t.jsx)(i.B,{gap:.5,children:Object.keys(f).map(s=>{const g=s;return(0,t.jsx)(r.m,{icon:f[g]?"eye-slash":"eye",onClick:()=>d(g),label:(0,n.startCase)(g),selected:f[g]},g)})})};function l(f){f.addCustomEditor({id:"hideFrom",name:"Hide in area",category:["Series"],path:"hideFrom",defaultValue:{tooltip:!1,viz:!1,legend:!1},editor:o,override:o,shouldApply:()=>!0,hideFromDefaults:!0,process:h=>h})}},41069(ne,A,e){"use strict";e.d(A,{H:()=>c});var t=e(53543),n=e(92745),a=e(739);function c(r,i=!0,o=!0){const l=[(0,n.t)("grafana-ui.builder.legend.category","Legend")];r.addBooleanSwitch({path:"legend.showLegend",name:(0,n.t)("grafana-ui.builder.legend.name-visibility","Visibility"),category:l,description:"",defaultValue:o}).addRadio({path:"legend.displayMode",name:(0,n.t)("grafana-ui.builder.legend.name-mode","Mode"),category:l,description:"",defaultValue:a.lm.List,settings:{options:[{value:a.lm.List,label:(0,n.t)("grafana-ui.builder.legend.mode-options.label-list","List")},{value:a.lm.Table,label:(0,n.t)("grafana-ui.builder.legend.mode-options.label-table","Table")}]},showIf:f=>f.legend.showLegend}).addRadio({path:"legend.placement",name:(0,n.t)("grafana-ui.builder.legend.name-placement","Placement"),category:l,description:"",defaultValue:"bottom",settings:{options:[{value:"bottom",label:(0,n.t)("grafana-ui.builder.legend.placement-options.label-bottom","Bottom")},{value:"right",label:(0,n.t)("grafana-ui.builder.legend.placement-options.label-right","Right")}]},showIf:f=>f.legend.showLegend}).addNumberInput({path:"legend.width",name:(0,n.t)("grafana-ui.builder.legend.name-width","Width"),category:l,settings:{placeholder:"Auto"},showIf:f=>f.legend.showLegend&&f.legend.placement==="right"}),i&&r.addCustomEditor({id:"legend.calcs",path:"legend.calcs",name:(0,n.t)("grafana-ui.builder.legend.name-values","Values"),category:l,description:(0,n.t)("grafana-ui.builder.legend.description-values","Select values or calculations to show in legend"),editor:t.D.get("stats-picker").editor,defaultValue:[],settings:{allowMultiple:!0},showIf:f=>f.legend.showLegend!==!1})}},81082(ne,A,e){"use strict";e.d(A,{I:()=>s,m:()=>d});var t=e(74848),n=e(38809),a=e(95004),c=e(92745),r=e(739),i=e(77824),o=e(76319),l=e(63527),f=e(41654),h=e(99555);const d=({value:g,context:v,onChange:x,item:m})=>(0,t.jsxs)(f.B,{children:[(0,t.jsx)(i.z,{value:g?.mode||r.gs.None,options:m.settings?.options??[],onChange:p=>{x({...g,mode:p})}}),v.isOverride&&g?.mode&&g?.mode!==r.gs.None&&(0,t.jsx)(l.p,{type:"text",placeholder:(0,c.t)("grafana-ui.stacking-builder.group","Group"),suffix:(0,t.jsx)(o.K,{name:"question-circle",tooltip:(0,c.t)("grafana-ui.stacking-builder.group-tooltip","Name of the stacking group"),tooltipPlacement:"top"}),defaultValue:g?.group,onChange:p=>{x({...g,group:p.currentTarget.value.trim()})}})]});function s(g,v,x=["Graph styles"]){const m=(0,h.P)();g.addCustomEditor({id:"stacking",path:"stacking",name:(0,c.t)("grafana-ui.builder.stacking.name-stack-series","Stack series"),category:x,defaultValue:v,editor:d,override:d,settings:{options:m.stacking},process:n.hS,shouldApply:p=>p.type===a.PU.number})}},14099(ne,A,e){"use strict";e.d(A,{I:()=>n});var t=e(92745);function n(a,c){const r=[(0,t.t)("grafana-ui.builder.text.category-text-size","Text size")];c.withTitle&&a.addNumberInput({path:"text.titleSize",category:r,name:(0,t.t)("grafana-ui.builder.text.name-title","Title"),settings:{placeholder:(0,t.t)("grafana-ui.builder.text.placeholder-title","Auto"),integer:!1,min:1,max:200},defaultValue:void 0}),c.withValue!==!1&&a.addNumberInput({path:"text.valueSize",category:r,name:(0,t.t)("grafana-ui.builder.text.name-value","Value"),settings:{placeholder:(0,t.t)("grafana-ui.builder.text.placeholder-value","Auto"),integer:!1,min:1,max:200},defaultValue:void 0}),c.withPercentChange&&a.addNumberInput({path:"text.percentSize",category:r,name:(0,t.t)("grafana-ui.builder.text.name-percent-change","Percent change"),settings:{placeholder:(0,t.t)("grafana-ui.builder.text.placeholder-percent-change","Auto"),integer:!1,min:1,max:200},defaultValue:void 0})}},79277(ne,A,e){"use strict";e.d(A,{D:()=>c,U:()=>a});var t=e(92745),n=e(739);const a={tooltip:{mode:n.$N.Single,sort:n.xB.None,hideZeros:!1}};function c(r,i=!1,o=!1,l){const f=[(0,t.t)("grafana-ui.builder.tooltip.category","Tooltip")],h=i?[{value:n.$N.Single,label:(0,t.t)("grafana-ui.builder.tooltip.modeOptions.label-single","Single")},{value:n.$N.None,label:(0,t.t)("grafana-ui.builder.tooltip.modeOptions.label-hidden","Hidden")}]:[{value:n.$N.Single,label:(0,t.t)("grafana-ui.builder.tooltip.modeOptions.label-single","Single")},{value:n.$N.Multi,label:(0,t.t)("grafana-ui.builder.tooltip.modeOptions.label-all","All")},{value:n.$N.None,label:(0,t.t)("grafana-ui.builder.tooltip.modeOptions.label-hidden","Hidden")}],d=[{value:n.xB.None,label:(0,t.t)("grafana-ui.builder.tooltip.sortOptions.label-none","None")},{value:n.xB.Ascending,label:(0,t.t)("grafana-ui.builder.tooltip.sortOptions.label-ascending","Ascending")},{value:n.xB.Descending,label:(0,t.t)("grafana-ui.builder.tooltip.sortOptions.label-descending","Descending")}];r.addRadio({path:"tooltip.mode",name:(0,t.t)("grafana-ui.builder.tooltip.name-tooltip-mode","Tooltip mode"),category:f,defaultValue:l?.tooltip?.mode??n.$N.Single,settings:{options:h}}).addRadio({path:"tooltip.sort",name:(0,t.t)("grafana-ui.builder.tooltip.name-values-sort-order","Values sort order"),category:f,defaultValue:l?.tooltip?.sort??n.xB.None,showIf:s=>s.tooltip?.mode===n.$N.Multi,settings:{options:d}}).addBooleanSwitch({path:"tooltip.hideZeros",name:(0,t.t)("grafana-ui.builder.tooltip.name-hide-zeros","Hide zeros"),category:f,defaultValue:!1,showIf:s=>l?.tooltip?.hideZeros!==void 0&&s.tooltip?.mode===n.$N.Multi}),o&&r.addNumberInput({path:"tooltip.hoverProximity",name:(0,t.t)("grafana-ui.builder.tooltip.name-hover-proximity","Hover proximity"),description:(0,t.t)("grafana-ui.builder.tooltip.description-hover-proximity","How close the cursor must be to a point to trigger the tooltip, in pixels"),category:f,settings:{integer:!0},showIf:s=>s.tooltip?.mode!==n.$N.None}),r.addNumberInput({path:"tooltip.maxWidth",name:(0,t.t)("grafana-ui.builder.tooltip.name-max-width","Max width"),category:f,settings:{integer:!0},showIf:s=>s.tooltip?.mode!==n.$N.None}).addNumberInput({path:"tooltip.maxHeight",name:(0,t.t)("grafana-ui.builder.tooltip.name-max-height","Max height"),category:f,defaultValue:void 0,settings:{integer:!0},showIf:(s,g,v)=>s.tooltip?.mode===n.$N.Multi||v?.some(x=>x.meta?.custom?.resultType==="exemplar")})}},16123(ne,A,e){"use strict";e.d(A,{v:()=>t});function t(){return{onKeyDown(n,a,c){const r=a.value;if(r.selection.isExpanded)return c();if(n.key==="k"&&n.ctrlKey){n.preventDefault();const i=r.anchorText.text,o=r.selection.anchor.offset,f=i.length-o;return a.deleteForward(f),!0}return c()}}}},54024(ne,A,e){"use strict";e.d(A,{s:()=>a});const t=(c,r,i)=>{if(!c.length)return;const o=c.slice(0,-1).join("").length+c.length-1;return c.join(` `).slice(r,o+i)},n=c=>c?.replace(/[\uFEFF]/g,"");function a(){const c={onCopy(r,i,o){r.preventDefault();const{document:l,selection:f}=i.value,{start:{offset:h},end:{offset:d}}=f,s=l.getLeafBlocksAtRange(f).toArray().map(v=>v.text),g=n(t(s,h,d));return g&&r.clipboardData&&r.clipboardData.setData("Text",g),!0},onPaste(r,i,o){if(r.preventDefault(),r.clipboardData){const f=n(r.clipboardData.getData("Text"))?.split(` `);if(f&&f.length){i.insertText(f[0]);for(const h of f.slice(1))i.splitBlock().insertText(h)}}return!0}};return{...c,onCut(r,i,o){return c.onCopy(r,i,o),i.deleteAtRange(i.value.selection),!0}}}},52513(ne,A,e){"use strict";e.d(A,{T:()=>h});var t=e(57746),n=e(82611),a=e(75226);const c=(0,t.Sn)("mod+["),r=(0,t.Sn)("shift+tab"),i=(0,t.Sn)("mod+]"),o=" ",l=(d,s,g)=>{const{startBlock:v,endBlock:x,selection:{start:{offset:m,key:p},end:{offset:y,key:E}}}=s.value;if(a.default.serialize(s.value)==="")return;d.preventDefault();const b=v.getFirstText();b&&m===0&&p===b.key&&y===b.text.length&&E===b.key||!v.equals(x)?f(s,"right"):s.insertText(o)},f=(d,s)=>{const g=d.value.selection,v=d.value.document.getLeafBlocksAtRange(g).toArray();if(s==="left")for(const x of v){const m=x.text.length-x.text.trimLeft().length,p=x.getFirstText().key,y={anchor:{key:p,offset:m,path:[]},focus:{key:p,offset:m,path:[]}};d.deleteBackwardAtRange(n.Range.create(y),Math.min(o.length,m))}else{const{startText:x}=d.value,m=x.text.slice(0,g.start.offset),p=/^\s*$/.test(m);for(const y of v)d.insertTextByKey(y.getFirstText().key,0,o);p&&d.moveStartBackward(o.length)}};function h(){return{onKeyDown(d,s,g){if(c(d)||r(d))d.preventDefault(),f(s,"left");else if(i(d))d.preventDefault(),f(s,"right");else if(d.key==="Tab")l(d,s,g);else return g();return!0}}}},21266(ne,A,e){"use strict";e.d(A,{O:()=>n});function t(a){let c=a.length-a.trimLeft().length;if(c){let r=a[0];for(;--c;)r+=a[0];return r}return""}function n(){return{onKeyDown(a,c,r){const i=c.value;if(i.selection.isExpanded)return r();if(a.key==="Enter"){a.preventDefault();const{startBlock:o}=i,l=o.text,f=t(l);return c.splitBlock().insertText(f).focus()}return r()}}}},59490(ne,A,e){"use strict";e.d(A,{U:()=>t});function t({handler:n}){return{onKeyDown(a,c,r){return n&&a.key==="Enter"&&(a.shiftKey||a.ctrlKey)?(a.preventDefault(),n(a),c):r()}}}},91272(ne,A,e){"use strict";e.d(A,{l:()=>a});var t=e(57746);const n=(0,t.Sn)("mod+l");function a(){return{onKeyDown(c,r,i){if(n(c)){c.preventDefault();const{focusBlock:o,document:l}=r.value;r.moveAnchorToStartOfBlock(),l.getNextBlock(o.key)?r.moveFocusToStartOfNextBlock():r.moveFocusToEndOfText()}else return i();return!0}}}},65937(ne,A,e){"use strict";e.d(A,{A:()=>n});const n="prism-token"},56103(ne,A,e){"use strict";e.d(A,{D:()=>s,R:()=>m});var t=e(28848),n=e.n(t),a=e(82611),c=e(65937),r=e(74848),i=e(49568);function o(p){return p.object==="block"&&p.type==="code_block"}function l(p){return"javascript"}function f(p,y,E){const{decoration:b}=p;if(b.type!==c.A)return E();const u=b.data.get("className");return(0,r.jsx)("span",{className:u,children:p.children})}class h extends(0,i.Record)({onlyIn:o,getSyntax:l,renderDecoration:f}){constructor(y){super(y)}}const d=h;function s(p={},y=n().languages){const E=new d(p);return{decorateNode:(b,u,D)=>{if(!E.onlyIn(b))return D();const P=a.Block.create(b),C=E.getSyntax(P),S=y[C];if(!S)return[];const L=P.getTexts().map(w=>w&&w.getText()).join(` `),j=n().tokenize(L,S),N=m(j),V=u.value.data.set("tokens",N);return u.setData(V),g(E,j,P)},renderDecoration:(b,u,D)=>E.renderDecoration({children:b.children,decoration:b.decoration},u,D)}}function g(p,y,E){const b=E.getTexts(),u=[];let D=0,P=0;return b.forEach(C=>{P=D+C.getText().length;let S=0;function R(L,j){if(typeof L=="string"){if(j){const N=v({text:C,textStart:D,textEnd:P,start:S,end:S+L.length,className:`prism-token token ${j}`,block:E});N&&u.push(N)}S+=L.length}else if(j=`${j} ${L.type}`,L.alias&&(j+=" "+L.alias),typeof L.content=="string"){const N=v({text:C,textStart:D,textEnd:P,start:S,end:S+L.content.length,className:`prism-token token ${j}`,block:E});N&&u.push(N),S+=L.content.length}else for(let N=0;N=E||u<=y?null:(b=Math.max(b,y),u=Math.min(u,E),b-=y,u-=y,P.createDecoration({object:"decoration",anchor:{key:p.key,offset:b,object:"point"},focus:{key:p.key,offset:u,object:"point"},type:c.A,data:{className:D}}))}function x(p){return typeof p=="string"?[{content:p,types:[],aliases:[]}]:Array.isArray(p)?p.flatMap(y=>x(y)):p instanceof n().Token?x(p.content).flatMap(y=>{let E=[];return typeof p.alias=="string"?E=[p.alias]:E=p.alias??[],{content:y.content,types:[p.type,...y.types],aliases:[...E,...y.aliases]}}):[]}function m(p){const y=x(p);if(!y.length)return[];const E=y[0];E.prev=null,E.next=y.length>=2?y[1]:null,E.offsets={start:0,end:E.content.length};for(let u=1;u=2?y[y.length-2]:null,b.next=null,b.offsets={start:y.length>=2?y[y.length-2].offsets.end:0,end:y.length>=2?y[y.length-2].offsets.end+b.content.length:b.content.length},y}},93427(ne,A,e){"use strict";e.d(A,{Pz:()=>O});var t=e(74848),n=e(2543),a=e(22803),c=e(96540),r=e(40961),i=e(97222),o=e(35555),l=e(53926),f=e(49579);const h=z=>z.reduce((G,{items:F,label:W})=>(G.push({label:W,kind:l.I.GroupTitle}),F.reduce((H,Y)=>(H.push(Y),H),G)),[]),d=z=>z.reduce((G,F)=>G.length{const W=(0,f.A)(F,{font:z.typography.fontFamilyMonospace,fontSize:z.typography.bodySmall.fontSize,fontWeight:"normal"}),H=v(W.width,z),Y=g(W.height,z),te=x(Y,G);return{listWidth:H,listHeight:te,itemHeight:Y}},g=(z,G)=>{const F=G.spacing.gridSize*2;return z+F},v=(z,G)=>{const F=G.spacing.gridSize*3;return Math.min(Math.max(z+F,200),800)},x=(z,G)=>{const F=Math.min(G.length,10),W=100,H=F*z;return Math.max(H,W)};var m=e(67458),p=e(63142);const y=(z,G,F)=>({typeaheadItem:(0,a.css)({label:"type-ahead-item",zIndex:11,padding:z.spacing(1,1,1,2),border:z.colors.border.medium,overflowY:"scroll",overflowX:"hidden",outline:"none",background:z.colors.background.secondary,color:z.colors.text.secondary,boxShadow:`0 0 20px ${z.v1.colors.dropdownShadow}`,visibility:F===!0?"visible":"hidden",width:"250px",minHeight:`${G+parseInt(z.spacing(.25),10)}px`,position:"relative",wordBreak:"break-word"})}),E=({item:z,height:G})=>{const F=z&&!!z.documentation,W=z?z.label:"",H=(0,m.G)(z?.documentation),Y=(0,p.$j)(),te=y(Y,G,F);return(0,t.jsxs)("div",{className:(0,a.cx)([te.typeaheadItem]),children:[(0,t.jsx)("b",{children:W}),(0,t.jsx)("hr",{}),(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:H}})]})};var b=e(23257),u=e.n(b),D=e(20662);const P=z=>({typeaheadItem:(0,a.css)({border:"none",background:"none",textAlign:"left",label:"type-ahead-item",height:"auto",fontFamily:z.typography.fontFamilyMonospace,padding:z.spacing(1,1,1,2),fontSize:z.typography.bodySmall.fontSize,textOverflow:"ellipsis",overflow:"hidden",zIndex:11,display:"block",whiteSpace:"nowrap",cursor:"pointer",[z.transitions.handleMotion("no-preference","reduce")]:{transition:"color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border-color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), padding 0.15s cubic-bezier(0.645, 0.045, 0.355, 1)"}}),typeaheadItemSelected:(0,a.css)({label:"type-ahead-item-selected",backgroundColor:z.colors.background.secondary}),typeaheadItemMatch:(0,a.css)({label:"type-ahead-item-match",color:z.v1.palette.yellow,borderBottom:`1px solid ${z.v1.palette.yellow}`,padding:"inherit",background:"inherit"}),typeaheadItemGroupTitle:(0,a.css)({label:"type-ahead-item-group-title",color:z.colors.text.secondary,fontSize:z.typography.bodySmall.fontSize,lineHeight:z.typography.body.lineHeight,padding:z.spacing(1)})}),C=z=>{const G=(0,p.of)(P),{isSelected:F,item:W,prefix:H,style:Y,onMouseEnter:te,onMouseLeave:Z,onClickItem:se}=z,ae=F?(0,a.cx)([G.typeaheadItem,G.typeaheadItemSelected]):(0,a.cx)([G.typeaheadItem]),J=(0,a.cx)([G.typeaheadItemMatch]),k=(0,a.cx)([G.typeaheadItemGroupTitle]),_=W.label||"";return W.kind===l.I.GroupTitle?(0,t.jsx)("li",{className:k,style:Y,children:(0,t.jsx)("span",{children:_})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{role:"menuitem",className:ae,style:Y,onMouseDown:se,onMouseEnter:te,onMouseLeave:Z,type:"button",children:W.highlightParts!==void 0?(0,t.jsx)(D.z,{text:_,highlightClassName:J,highlightParts:W.highlightParts}):(0,t.jsx)(u(),{textToHighlight:_,searchWords:[H??""],autoEscape:!0,highlightClassName:J})})})},S=(z,G)=>z-G*Math.floor(z/G);class R extends c.PureComponent{constructor(){super(...arguments),this.listRef=(0,c.createRef)(),this.state={hoveredItem:null,typeaheadIndex:null,allItems:[],listWidth:-1,listHeight:-1,itemHeight:-1},this.componentDidMount=()=>{this.props.menuRef&&this.props.menuRef(this),document.addEventListener("selectionchange",this.handleSelectionChange);const G=h(this.props.groupedItems),F=d(G),{listWidth:W,listHeight:H,itemHeight:Y}=s(this.context,G,F);this.setState({listWidth:W,listHeight:H,itemHeight:Y,allItems:G})},this.componentWillUnmount=()=>{document.removeEventListener("selectionchange",this.handleSelectionChange)},this.handleSelectionChange=()=>{this.forceUpdate()},this.componentDidUpdate=(G,F)=>{if(this.state.typeaheadIndex!==null&&F.typeaheadIndex!==this.state.typeaheadIndex&&this.listRef&&this.listRef.current){if(this.state.typeaheadIndex===1){this.listRef.current.scrollToItem(0);return}this.listRef.current.scrollToItem(this.state.typeaheadIndex)}if((0,n.isEqual)(G.groupedItems,this.props.groupedItems)===!1){const W=h(this.props.groupedItems),H=d(W),{listWidth:Y,listHeight:te,itemHeight:Z}=s(this.context,W,H);this.setState({listWidth:Y,listHeight:te,itemHeight:Z,allItems:W,typeaheadIndex:null})}},this.onMouseEnter=G=>{this.setState({hoveredItem:G})},this.onMouseLeave=()=>{this.setState({hoveredItem:null})},this.moveMenuIndex=G=>{const F=this.state.allItems.length;if(F){const W=this.state.typeaheadIndex||0;let H=S(W+G,F);this.state.allItems[H].kind===l.I.GroupTitle&&(H=S(H+G,F)),this.setState({typeaheadIndex:H});return}},this.insertSuggestion=()=>{this.props.onSelectSuggestion&&this.state.typeaheadIndex!==null&&this.props.onSelectSuggestion(this.state.allItems[this.state.typeaheadIndex])}}static{this.contextType=o.D}get menuPosition(){if(!window.getSelection)return"";const G=window.getSelection(),F=G&&G.anchorNode;if(F&&F.parentElement){const W=F.parentElement.getBoundingClientRect(),H=window.scrollX,Y=window.scrollY;return`position: absolute; display: flex; top: ${W.top+Y+W.height+6}px; left: ${W.left+H-2}px`}return""}render(){const{prefix:G,isOpen:F=!1,origin:W}=this.props,{allItems:H,listWidth:Y,listHeight:te,itemHeight:Z,hoveredItem:se,typeaheadIndex:ae}=this.state,J=j(this.context),k=se||ae,_=H[se||ae||0];return(0,t.jsxs)(L,{origin:W,isOpen:F,style:this.menuPosition,children:[(0,t.jsx)("ul",{role:"menu",className:J.typeahead,"data-testid":"typeahead",children:(0,t.jsx)(i.Y1,{ref:this.listRef,itemCount:H.length,itemSize:Z,itemKey:Q=>{const q=H&&H[Q];return q?`${Q}-${q.label}`:`${Q}`},width:Y,height:te,children:({index:Q,style:q})=>{const oe=H&&H[Q];return oe?(0,t.jsx)(C,{onClickItem:()=>this.props.onSelectSuggestion?this.props.onSelectSuggestion(oe):{},isSelected:ae===null?!1:H[ae]===oe,item:oe,prefix:G,style:q,onMouseEnter:()=>this.onMouseEnter(Q),onMouseLeave:this.onMouseLeave}):null}})}),k&&(0,t.jsx)(E,{height:te,item:_})]})}}class L extends c.PureComponent{constructor(G){super(G);const{index:F=0,origin:W="query",style:H}=G;this.node=document.createElement("div"),this.node.setAttribute("style",H),this.node.classList.add(`slate-typeahead-${W}-${F}`),document.body.appendChild(this.node)}componentWillUnmount(){document.body.removeChild(this.node)}render(){return this.props.isOpen?(this.node.setAttribute("style",this.props.style),this.node.classList.add("slate-typeahead--open"),r.createPortal(this.props.children,this.node)):(this.node.classList.remove("slate-typeahead--open"),null)}}const j=z=>({typeahead:(0,a.css)({position:"relative",zIndex:z.zIndex.typeahead,borderRadius:z.shape.radius.default,border:`1px solid ${z.components.panel.borderColor}`,maxHeight:"66vh",overflowY:"scroll",overflowX:"hidden",outline:"none",listStyle:"none",background:z.components.panel.background,color:z.colors.text.primary,boxShadow:z.shadows.z2,strong:{color:z.v1.palette.yellow}})});var N=e(59258),V=e(35458),w=e(65937);const M=250;function O({onTypeahead:z,cleanText:G,onWillApplySuggestion:F,portalOrigin:W}){let H,Y={groupedItems:[],typeaheadPrefix:"",typeaheadContext:"",typeaheadText:""};const te=(0,n.debounce)(U,M),Z=se=>{Y={...Y,...se}};return{onBlur:(se,ae,J)=>(Y={...Y,groupedItems:[]},J()),onClick:(se,ae,J)=>(Y={...Y,groupedItems:[]},J()),onKeyDown:(se,ae,J)=>{const _=Y.groupedItems.length;switch(se.key){case"Escape":{if(_)return se.preventDefault(),Y={...Y,groupedItems:[]},ae.insertText("");break}case"ArrowDown":case"ArrowUp":if(_){se.preventDefault(),H.moveMenuIndex(se.key==="ArrowDown"?1:-1);return}break;case"Enter":{if(!(se.shiftKey||se.ctrlKey)&&_)return se.preventDefault(),H.insertSuggestion();break}case"Tab":{if(_)return se.preventDefault(),H.insertSuggestion();break}default:{se.key.length===1&&te(ae,Z,z,G);break}}return J()},commands:{selectSuggestion:(se,ae)=>{const J=Y.groupedItems;if(!J||!J.length)return se;const k=se.applyTypeahead(ae);return te(se,Z,z,G),k},applyTypeahead:(se,ae)=>{let J=ae.insertText||ae.label;const k=ae.kind==="function",_=ae.move||0,Q=_>0?_:0,q=_<0?-_:0,{typeaheadPrefix:oe,typeaheadText:re,typeaheadContext:ee}=Y;F&&(J=F(J,{groupedItems:Y.groupedItems,typeaheadContext:ee,typeaheadPrefix:oe,typeaheadText:re}));const{forward:B,backward:ie}=K(J,oe,re,k,ae.deleteBackwards,G);if(J.match(/\n/)){const de=(0,V.dF)(J);return se.deleteBackward(ie).deleteForward(B).insertFragment(de).focus(),se}return Y={...Y,groupedItems:[]},se.snapshotSelection().deleteBackward(ie).deleteForward(B).insertText(J).moveForward(Q).moveBackward(q).focus(),se}},renderEditor(se,ae,J){if(ae.value.selection.isExpanded)return J();const k=J();return(0,t.jsxs)(t.Fragment,{children:[k,(0,t.jsx)(R,{menuRef:_=>H=_,origin:W,prefix:Y.typeaheadPrefix,isOpen:!!Y.groupedItems.length,groupedItems:Y.groupedItems,onSelectSuggestion:ae.selectSuggestion})]})}}}const U=async(z,G,F,W)=>{if(!F)return;const{value:H}=z,{selection:Y}=H,te=H.document.getClosestBlock(H.focusBlock.key),Z=H.selection.start.offset-1,se=te&&te.getDecorations(z),ae=se?se.filter(ie=>ie.start.offset<=Z&&ie.end.offset>Z&&ie.type===w.A).toArray():[],J=se&&se.filter(ie=>ie.end.offset<=Z&&ie.type===w.A&&ie.data.get("className").includes("label-key")).last(),k=J&&H.focusText.text.slice(J.start.offset,J.end.offset),_=ae.map(ie=>ie.data.get("className")).join(" ").split(" ").filter(ie=>ie.length);let Q=H.focusText.text,q=Q.slice(0,Y.focus.offset);ae.length&&(Q=H.focusText.text.slice(ae[0].start.offset,ae[0].end.offset),q=H.focusText.text.slice(ae[0].start.offset,Y.focus.offset));const oe=q.match(/(?:!?=~?"?|")(.*)/);oe?q=oe[1]:W&&(q=W(q));const{suggestions:re,context:ee}=await F({prefix:q,text:Q,value:H,wrapperClasses:_,labelKey:k||void 0,editor:z}),B=re.map(ie=>{if(!ie.items)return ie;const de=ie.searchFunctionType||(ie.prefixMatch?N.T.Prefix:N.T.Word),fe=N.H[de];let ce={...ie};return q&&(ie.skipFilter||(ce.items=ce.items.filter(ve=>(ve.filterText||ve.label).length>=q.length),ce.items=fe(ce.items,q)),ce.items=ce.items.filter(ve=>!(ve.insertText===q||(ve.filterText??ve.label)===q))),ie.skipSort||(ce.items=(0,n.sortBy)(ce.items,ve=>ve.sortText===void 0?ve.sortValue!==void 0?ve.sortValue:ve.label:ve.sortText||ve.label)),ce}).filter(ie=>ie.items&&ie.items.length);G({groupedItems:B,typeaheadPrefix:q,typeaheadContext:ee,typeaheadText:Q}),z.blur().focus()};function K(z,G,F,W,H,Y){const te=H||G.length,Z=Y?Y(F):F,se=F.indexOf(G),ae=se>-1?Z.length-se-G.length:Z.length-G.length;return{forward:!!(G&&ae>0||z===F)&&!W?ae+se:0,backward:te}}},77345(ne,A,e){"use strict";e.d(A,{k:()=>M});var t=e(74848),n=e(17437),a=e(63142);function c(O){return(0,n.css)({".sr-only":{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0}})}function r(O){return(0,n.css)({".alert-state-paused, .alert-state-pending":{color:O.colors.text.secondary,fontWeight:O.typography.fontWeightMedium},".alert-state-ok":{color:O.colors.success.text,fontWeight:O.typography.fontWeightMedium},".alert-state-warning":{color:O.colors.warning.text,fontWeight:O.typography.fontWeightMedium},".alert-state-critical":{color:O.colors.error.text,fontWeight:O.typography.fontWeightMedium}})}function i(O){return(0,n.css)({".card-section":{marginBottom:O.spacing(4)},".card-list":{display:"flex",flexDirection:"row",flexWrap:"wrap",listStyleType:"none"},".card-item":{display:"block",height:"100%",background:O.colors.background.secondary,boxShadow:"none",padding:O.spacing(2),borderRadius:O.shape.radius.default,"&:hover":{background:O.colors.emphasize(O.colors.background.secondary,.03)},".label-tag":{marginLeft:O.spacing(1),fontSize:"11px",padding:"2px 6px"}},".card-item-body":{display:"flex",overflow:"hidden"},".card-item-details":{overflow:"hidden"},".card-item-header":{marginBottom:O.spacing(2)},".card-item-type":{color:O.colors.text.secondary,textTransform:"uppercase",fontSize:O.typography.size.sm,fontWeight:O.typography.fontWeightMedium},".card-item-badge":{margin:"6px 0"},".card-item-notice":{fontSize:O.typography.size.sm},".card-item-name":{color:O.colors.text.primary,overflow:"hidden",textOverflow:"ellipsis",width:"100%"},".card-item-label":{marginLeft:O.spacing(1)},".card-item-sub-name":{color:O.colors.text.secondary,overflow:"hidden",textOverflow:"ellipsis",width:"100%"},".card-item-sub-name--header":{color:O.colors.text.secondary,textTransform:"uppercase",marginBottom:O.spacing(2),fontSize:O.typography.size.sm,fontWeight:"bold"},".card-list-layout-grid":{".card-item-type":{display:"inline-block"},".card-item-notice":{fontSize:O.typography.size.sm,display:"inline-block",marginLeft:O.spacing(2)},".card-item-header-action":{float:"right"},".card-item-wrapper":{width:"100%",padding:O.spacing(0,2,2,0)},".card-item-wrapper--clickable":{cursor:"pointer"},".card-item-figure":{margin:O.spacing(0,2,2,0),height:"80px",img:{width:"80px"}},".card-item-name":{fontSize:O.typography.h3.fontSize},[O.breakpoints.up("md")]:{".card-item-wrapper":{width:"50%"}},[O.breakpoints.up("lg")]:{".card-item-wrapper":{width:"33.333333%"}},"&.card-list-layout-grid--max-2-col":{[O.breakpoints.up("lg")]:{".card-item-wrapper":{width:"50%"}}}},".card-list-layout-list":{".card-item-wrapper":{padding:0,width:"100%",marginBottom:O.spacing(1)},".card-item-wrapper--clickable":{cursor:"pointer"},".card-item":{borderRadius:O.shape.radius.default},".card-item-header":{float:"right",textAlign:"right"},".card-item-figure":{margin:O.spacing(0,2,0,0),img:{width:"48px"}},".card-item-name":{fontSize:O.typography.h4.fontSize},".card-item-sub-name":{fontSize:O.typography.size.sm},".layout-selector":{marginRight:0}}})}function o(O){return(0,n.css)({"code, pre, kbd, samp":{...O.typography.code,fontSize:O.typography.bodySmall.fontSize,backgroundColor:O.colors.background.primary,color:O.colors.text.primary,border:`1px solid ${O.colors.border.medium}`,borderRadius:O.shape.radius.default},code:{whiteSpace:"nowrap",padding:"2px 5px",margin:"0 2px"},pre:{display:"block",margin:O.spacing(0,0,2),lineHeight:O.typography.body.lineHeight,wordBreak:"break-all",wordWrap:"break-word",whiteSpace:"pre-wrap",overflow:"auto",padding:"10px",code:{padding:0,color:"inherit",whiteSpace:"pre-wrap",backgroundColor:"transparent",border:0}}})}function l(O){return(0,n.css)({".react-resizable-handle":{visibility:"hidden"},".react-grid-item, #grafana-portal-container":{touchAction:"initial !important","&:hover":{".react-resizable-handle":{visibility:"visible"}}},".dragging-active":{"*":{cursor:"move",userSelect:"none"}},[O.breakpoints.down("md")]:{".react-grid-layout":{height:"unset !important"},".react-grid-item":{display:"block !important",transitionProperty:"none !important",position:"unset !important",transform:"translate(0px, 0px) !important",marginBottom:O.spacing(2)},".panel-repeater-grid-item":{height:"auto !important"}},".react-grid-item.react-grid-placeholder":{boxShadow:`0 0 4px ${O.colors.primary.border} !important`,background:`${O.colors.primary.transparent} !important`,zIndex:"-1 !important",opacity:"unset !important"},".react-grid-item > .react-resizable-handle::after":{borderRight:`2px solid ${O.isDark?O.v1.palette.gray1:O.v1.palette.gray3} !important`,borderBottom:`2px solid ${O.isDark?O.v1.palette.gray1:O.v1.palette.gray3} !important`},".react-grid-item.resizing.panel, .react-grid-item.panel.dropdown-menu-open, .react-grid-item.react-draggable-dragging.panel":{zIndex:O.zIndex.dropdown},".react-grid-item.cssTransforms":{transitionProperty:"none !important"},[O.transitions.handleMotion("no-preference")]:{".react-grid-layout--enable-move-animations":{".react-grid-item.cssTransforms":{transitionProperty:"transform !important"}}},".dashboard-selected-element":{outline:`1px dashed ${O.colors.primary.border}`,outlineOffset:"0px",borderRadius:O.shape.radius.default},".dashboard-selectable-element":{"&:hover":{outline:`1px dashed ${O.colors.border.strong}`,outlineOffset:"0px",borderRadius:O.shape.radius.default,backgroundColor:O.colors.emphasize(O.colors.background.canvas,.08)}},".dashboard-canvas-add-button":{display:"flex",opacity:.5,[O.transitions.handleMotion("no-preference","reduce")]:{transition:O.transitions.create("opacity")},filter:"grayscale(100%)","&:hover,:focus-within":{opacity:1,filter:"unset"}},".dashboard-visible-hidden-element":{position:"relative"},".dashboard-drop-target":{"&:is(:hover),&:not(:hover)":{outline:`2px solid ${O.colors.primary.border}`,outlineOffset:"0px",borderRadius:O.shape.radius.default}},".dashboard-draggable-transparent-selection":{"*::selection":{all:"inherit"}},".react-draggable-dragging":{opacity:.8}})}function f(O){return(0,n.css)({".delta-html":{background:O.colors.background.secondary,paddingTop:"5px",paddingBottom:"5px",userSelect:"none"},".diff-line":{color:O.colors.text.primary,fontFamily:O.typography.fontFamilyMonospace,fontSize:O.typography.size.sm,lineHeight:2,marginBottom:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",position:"relative","&:after":{left:"-40px"}},".diff-line-number":{color:O.colors.text.secondary,display:"inline-block",fontSize:O.typography.size.xs,lineHeight:2.3,textAlign:"right",width:"30px"},".diff-line-number-hide":{visibility:"hidden"},".diff-line-icon":{color:O.colors.text.primary,fontSize:O.typography.size.xs,float:"right",position:"relative",top:"2px",right:"10px"},".diff-json-new, .diff-json-old, .diff-json-deleted, .diff-json-added":{color:O.v1.palette.gray5,".diff-line-number":{color:O.colors.text.primary}},".diff-json-new":{backgroundColor:O.isDark?"#457740":"#664e33"},".diff-json-old":{backgroundColor:O.isDark?"#a04338":"#5a372a"},".diff-json-added":{backgroundColor:O.colors.primary.shade},".diff-json-deleted":{backgroundColor:O.colors.error.shade},".diff-value":{userSelect:"all"},".diff-circle":{marginRight:"0.5em","*":{marginBottom:"1px"}},".diff-circle-changed":{color:"#f59433"},".diff-circle-added":{color:"#29d761"},".diff-circle-deleted":{color:"#fd474a"},".diff-item-added, .diff-item-deleted":{listStyle:"none"},".diff-group":{background:O.colors.background.secondary,fontSize:"16px",fontStyle:"normal",padding:"10px 15px",margin:O.spacing(2,0),".diff-group":{padding:"0 5px"}},".diff-group-name":{display:"inline-block",width:"100%",fontSize:"16px",paddingLeft:"1.75em",margin:"0 0 14px 0"},".diff-summary-key":{paddingLeft:"0.25em"},".diff-list":{paddingLeft:"40px",".diff-list":{paddingLeft:0}},".diff-item":{color:O.v1.palette.gray2,lineHeight:2.5,"> div":{display:"inline"}},".diff-item-changeset":{listStyle:"none"},".diff-label":{backgroundColor:O.colors.action.hover,borderRadius:O.shape.radius.default,color:O.colors.text.primary,display:"inline",fontSize:`${O.typography.fontSize}px`,margin:"0 5px",padding:"3px 8px"},".diff-linenum":{float:"right"},".diff-arrow":{color:O.colors.text.primary},".diff-block":{width:"100%",display:"inline-block"},".diff-block-title":{fontSize:"16px",display:"inline-block"},".diff-title":{fontSize:"16px"},".diff-change-container":{margin:"0 0",paddingLeft:"3em",paddingRight:0},".diff-change-group":{width:"100%",color:O.colors.text.primary,marginBottom:"14px"},".diff-change-item":{display:"inline-block"},".diff-change-title":{fontSize:"16px"},".bullet-position-container":{position:"relative",left:"-6px"},".diff-list-circle":{marginBottom:"3px"}})}var h=e(27629),d=e(35484);function s(O){return(0,n.css)({"*, *::before, *::after":{boxSizing:"inherit"},"[tabindex='-1']:focus":{outline:"none !important"},html:{MsOverflowStyle:"scrollbar",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",boxSizing:"border-box",height:"100%",fontSize:`${O.typography.htmlFontSize}px`,fontFamily:O.typography.fontFamily,lineHeight:O.typography.body.lineHeight,fontKerning:"normal"},":root":{colorScheme:O.colors.mode},body:{height:"100%",width:"100%",position:"unset",color:O.colors.text.primary,backgroundColor:O.colors.background.canvas,paddingRight:"0 !important","@media print":{overflow:"visible"},"@page":{margin:0,size:"auto",padding:0},overflowY:"auto !important",fontVariantLigatures:"no-contextual",...O.typography.body,fontVariantNumeric:(0,h.$)("tabularNumbers")?"tabular-nums":"initial"},"h1, .h1":g(O.typography.h1),"h2, .h2":g(O.typography.h2),"h3, .h3":g(O.typography.h3),"h4, .h4":g(O.typography.h4),"h5, .h5":g(O.typography.h5),"h6, .h6":g(O.typography.h6),p:{margin:O.spacing(0,0,2)},textarea:{overflow:"auto",resize:"vertical"},button:{letterSpacing:O.typography.body.letterSpacing,"&:focus-visible":(0,d.getFocusStyles)(O),"&:focus":{outline:"none"}},label:{display:"inline-block"},figure:{margin:O.spacing(0,0,2)},img:{verticalAlign:"middle"},fieldset:{minWidth:0,padding:0,margin:0,border:0},legend:{display:"block",width:"100%",padding:0,marginBottom:O.spacing(1),fontSize:O.spacing(3),lineHeight:"inherit",border:0},"small, .small":{fontSize:O.typography.bodySmall.fontSize,fontWeight:"normal"},"b, strong":{fontWeight:O.typography.fontWeightMedium},em:{fontStyle:"italic",color:O.colors.text.primary},cite:{fontStyle:"normal"},blockquote:{padding:O.spacing(0,0,0,2),margin:O.spacing(0,0,2),borderLeft:`5px solid ${O.v1.palette.gray3}`,p:{marginBottom:0,fontSize:O.typography.fontSize*1.25,fontWeight:300,lineHeight:1.25},small:{display:"block",lineHeight:O.typography.body.lineHeight,color:O.v1.palette.gray2,"&:before":{content:"'\\2014 \\00A0'"}}},"q:before, q:after, blockquote:before, blockquote:after":{content:"''"},address:{display:"block",marginBottom:O.spacing(2),fontStyle:"normal",lineHeight:O.typography.body.lineHeight},"a.external-link":{color:O.colors.text.link,textDecoration:"normal","&:hover":{color:O.colors.text.link,textDecoration:"underline"}},".link":{color:O.colors.text.primary,cursor:"pointer"},".link:hover":{color:O.colors.text.maxContrast},".pointer":{cursor:"pointer"},"audio, canvas, progress, video":{display:"inline-block",verticalAlign:"baseline"},"audio:not([controls])":{display:"none",height:0},"abbr[title]":{borderBottom:"1px dotted",cursor:"help"},dfn:{fontStyle:"italic"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},hr:{marginTop:O.spacing(2),marginBottom:O.spacing(2),border:0,borderTop:`1px solid ${O.colors.border.medium}`},"mark, .mark":{background:O.colors.warning.main},"ul, ol, dl":{marginTop:0,marginBottom:0,padding:0},"ul ul, ul ol, ol ol, ol ul":{marginBottom:0},li:{lineHeight:O.typography.body.lineHeight},dd:{marginBottom:O.spacing(1),marginLeft:0},"dt, dd":{lineHeight:O.typography.body.lineHeight},dt:{fontWeight:O.typography.fontWeightMedium},"button, input, optgroup, select, textarea":{borderRadius:0,color:"inherit",font:"inherit",lineHeight:"inherit",margin:0},optgroup:{fontWeight:"bold"},'button, html input[type="button"], input[type="submit"]':{WebkitAppearance:"button",cursor:"pointer"},'input[type="search"]':{WebkitAppearance:"none"},'input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration':{WebkitAppearance:"none"},table:{backgroundColor:"transparent",borderCollapse:"collapse",borderSpacing:0},caption:{paddingTop:O.spacing(.5),paddingBottom:O.spacing(.5),color:O.colors.text.secondary,textAlign:"left",captionSide:"bottom"},th:{fontWeight:O.typography.fontWeightMedium,textAlign:"left"},"td, th":{padding:0},".muted":{color:O.colors.text.secondary},"a.muted:hover, a.muted:focus":{color:O.colors.text.primary},".text-warning":{color:O.colors.warning.text,"&:hover, &:focus":{color:O.colors.emphasize(O.colors.warning.text,.15)}},".text-error":{color:O.colors.error.text,"&:hover, &:focus":{color:O.colors.emphasize(O.colors.error.text,.15)}},".text-success":{color:"$success-text-color","&:hover, &:focus":{color:O.colors.emphasize(O.colors.success.text,.15)}},a:{cursor:"pointer",color:O.colors.text.primary,textDecoration:"none","&:focus":{outline:"none"},"&:focus-visible":(0,d.getFocusStyles)(O),"&:[disabled]":{cursor:"default",pointerEvents:"none !important"}},"[role='button']":{cursor:"pointer"},"[hidden]":{display:"none !important"},"a, area, button, [role='button'], input, label, select, summary, textarea":{touchAction:"manipulation"},".text-link":{textDecoration:"underline"},".text-left":{textAlign:"left"},".text-right":{textAlign:"right"},".text-center":{textAlign:"center"},".highlight-search-match":{background:O.components.textHighlight.background,color:O.components.textHighlight.text,padding:0},".template-variable":{color:O.colors.primary.text},".modal-header-title":{fontSize:O.typography.size.lg,float:"left",paddingTop:O.spacing(1),margin:O.spacing(0,2)}})}function g(O){return{margin:0,fontSize:O.fontSize,lineHeight:O.lineHeight,fontWeight:O.fontWeight,letterSpacing:O.letterSpacing,fontFamily:O.fontFamily,marginBottom:"0.45em"}}function v(O){return(0,n.css)({"iframe.intercom-borderless-frame":{colorScheme:O.colors.mode}})}function x(O){return(0,n.css)({".filter-table *":{boxSizing:"border-box"},".filter-table":{width:"100%",borderCollapse:"separate",tbody:{"tr:nth-of-type(odd)":{background:O.colors.emphasize(O.colors.background.primary,.02)}},th:{width:"auto",padding:O.spacing(.5,1),textAlign:"left",lineHeight:"30px",height:"30px",whiteSpace:"nowrap"},td:{padding:O.spacing(.5,1),lineHeight:"30px",height:"30px",whiteSpace:"nowrap"},".link-td":{padding:0,lineHeight:"30px",height:"30px",whiteSpace:"nowrap",a:{display:"block",padding:O.spacing(0,1),height:"30px"}},".ellipsis":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},".expanded":{borderColor:O.components.panel.background},".expanded > td":{paddingBottom:0},".filter-table__avatar":{width:"25px",height:"25px",borderRadius:O.shape.radius.circle},"&--hover":{"tbody tr:hover":{background:O.colors.emphasize(O.colors.background.primary,.05)}}}})}function m(O){const U=typeof window<"u"&&window.__grafana_public_path__,K=U?`${U}fonts/`:"public/fonts/";return(0,n.css)([{"@font-face":{fontFamily:"Roboto Mono",fontStyle:"normal",fontWeight:400,fontDisplay:"swap",src:`url('${K}roboto/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2') format('woff2')`,unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"}},{"@font-face":{fontFamily:"Roboto Mono",fontStyle:"normal",fontWeight:500,fontDisplay:"swap",src:`url('${K}roboto/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2') format('woff2')`,unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"}},{"@font-face":{fontFamily:"Inter",fontStyle:"normal",fontWeight:400,fontDisplay:"swap",src:`url('${K}inter/Inter-Regular.woff2') format('woff2')`}},{"@font-face":{fontFamily:"Inter",fontStyle:"normal",fontWeight:500,fontDisplay:"swap",src:`url('${K}inter/Inter-Medium.woff2') format('woff2')`}},{"@font-face":{fontFamily:"Inter",fontStyle:"italic",fontWeight:400,fontDisplay:"swap",src:`url('${K}inter/Inter-Italic.woff2') format('woff2')`}},{"@font-face":{fontFamily:"Inter",fontStyle:"italic",fontWeight:500,fontDisplay:"swap",src:`url('${K}inter/Inter-MediumItalic.woff2') format('woff2')`}}])}function p(O){return(0,n.css)({"input, button, select, textarea":{fontFamily:O.typography.body.fontFamily,fontSize:O.typography.body.fontSize,fontWeight:O.typography.body.fontWeight,lineHeight:O.typography.body.lineHeight},"input, select":{backgroundColor:O.components.input.background,color:O.components.input.text,border:"none",boxShadow:"none"},"input, textarea":{"&::placeholder":{color:O.colors.text.disabled}},'input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button':{WebkitAppearance:"none",margin:0},'input[type="number"]':{MozAppearance:"textfield"},'select, input[type="file"]':{height:O.components.height.md,lineHeight:O.components.height.md},select:{width:"220px",border:`1px solid ${O.components.input.borderColor}`,backgroundColor:O.components.input.background},"select[multiple], select[size], textarea":{height:"auto"},'select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus':{outline:"5px auto -webkit-focus-ring-color",outlineOffset:"-2px"},"input[type='file'], input[type='image'], input[type='submit'], input[type='reset'], input[type='button'], input[type='radio'], input[type='checkbox']":{width:"auto"},"input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly]":{cursor:"not-allowed",backgroundColor:O.colors.action.disabledBackground},'input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly]':{cursor:"not-allowed",backgroundColor:"transparent"},"input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill, textarea:-webkit-autofill, textarea:-webkit-autofill:hover, textarea:-webkit-autofill:focus, select:-webkit-autofill, select:-webkit-autofill:hover, select:-webkit-autofill:focus":{WebkitBoxShadow:`0 0 0px 1000px ${O.components.input.background} inset !important`,WebkitTextFillColor:O.components.input.text,boxShadow:`0 0 0px 1000px ${O.components.input.background} inset`,border:`1px solid ${O.components.input.background}`},".gf-form":{display:"flex",flexDirection:"row",alignItems:"flex-start",textAlign:"left",position:"relative",marginBottom:O.spacing(.5),"&--offset-1":{marginLeft:O.spacing(2)},"&--grow":{flexGrow:1},"&--flex-end":{justifyContent:"flex-end"},"&--align-center":{alignContent:"center"},"&--alt":{flexDirection:"column",alignItems:"flex-start",".gf-form-label":{padding:"4px 0"}}},".gf-form--has-input-icon":{position:"relative",marginRight:O.spacing(.5),".gf-form-input-icon":{position:"absolute",top:"8px",fontSize:O.typography.size.lg,left:"10px",color:O.colors.text.disabled},"> input":{paddingLeft:"35px","&:focus + .gf-form-input-icon":{color:O.colors.text.secondary}},".Select--multi .Select-multi-value-wrapper, .Select-placeholder":{paddingLeft:"30px"}},".gf-form-disabled":{color:O.colors.text.secondary,".gf-form-select-wrapper::after":{color:O.colors.text.secondary},"a, .gf-form-input":{color:O.colors.text.secondary}},".gf-form-group":{marginBottom:O.spacing(5)},".gf-form-inline":{display:"flex",flexDirection:"row",flexWrap:"wrap",alignContent:"flex-start","&--nowrap":{flexWrap:"nowrap"},"&--xs-view-flex-column":{flexDirection:"row",flexWrap:"nowrap",[O.breakpoints.down("sm")]:{flexDirection:"column"}},".select-container":{marginRight:O.spacing(.5)},".gf-form-spacing":{marginRight:O.spacing(.5)}},".gf-form-button-row":{paddingTop:O.spacing(3),"a, button":{marginRight:O.spacing(2)}},".gf-form-label":{display:"flex",alignItems:"center",padding:O.spacing(0,1),flexShrink:0,fontWeight:O.typography.fontWeightMedium,fontSize:O.typography.size.sm,backgroundColor:O.colors.background.secondary,height:"32px",lineHeight:"32px",marginRight:O.spacing(.5),borderRadius:O.shape.radius.default,justifyContent:"space-between",border:"none","&--grow":{flexGrow:1},"&--transparent":{backgroundColor:"transparent",border:0,textAlign:"right",paddingLeft:0},"&--variable":{color:O.colors.primary.text,background:O.components.panel.background,border:`1px solid ${O.components.panel.borderColor}`},"&--btn":{border:"none",borderRadius:O.shape.radius.default,"&:hover":{background:O.colors.background.secondary,color:O.colors.text.primary}},"&:disabled":{color:O.colors.text.secondary}},".gf-form-label + .gf-form-label":{marginRight:O.spacing(.5)},".gf-form-pre":{display:"block !important",flexGrow:1,margin:0,marginRight:O.spacing(.5),border:"1px solid transparent",borderLeft:"none",borderRadius:O.shape.radius.default},".gf-form-textarea":{maxWidth:"650px"},".gf-form-input":{display:"block",width:"100%",height:"32px",padding:O.spacing(0,1),fontSize:O.typography.size.md,lineHeight:"18px",color:O.components.input.text,backgroundColor:O.components.input.background,backgroundImage:"none",backgroundClip:"padding-box",border:`1px solid ${O.components.input.borderColor}`,borderRadius:O.shape.radius.default,marginRight:O.spacing(.5),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","&textarea":{overflow:"auto",whiteSpace:"pre-wrap",padding:`6px ${O.spacing(1)}`,minHeight:"32px",height:"auto"},"&::-ms-expand":{backgroundColor:"transparent",border:0,display:"none"},"&:focus":{borderColor:O.colors.primary.border,outline:"none"},"&::placeholder":{color:O.colors.text.disabled,opacity:1},"&:disabled, &[readonly]":{backgroundColor:O.colors.action.disabledBackground,opacity:1},"&:disabled":{cursor:"not-allowed"},"&.gf-size-auto":{width:"auto"},"&--dropdown":{paddingRight:O.spacing(3),position:"relative",display:"flex",alignItems:"center","&::after":{position:"absolute",top:"36%",right:"11px",fontSize:"11px",backgroundColor:"transparent",color:O.colors.text.primary,font:`normal normal normal ${O.typography.size.sm}/1 FontAwesome`,content:'"\f0d7"',pointerEvents:"none"}},"&--has-help-icon":{paddingRight:O.spacing(4)}},".gf-form-select-wrapper":{position:"relative",backgroundColor:O.components.input.background,marginRight:O.spacing(.5),".gf-form-select-icon":{position:"absolute",zIndex:1,top:"50%",marginTop:"-7px","+ .gf-form-input":{position:"relative",zIndex:2,paddingLeft:O.spacing(4),backgroundColor:"transparent",option:{color:O.v1.palette.black}}},".gf-form-input":{marginRight:0,lineHeight:"32px"},"select.gf-form-input":{textIndent:"0.01px",textOverflow:"''",paddingRight:O.spacing(4),appearance:"none","&:-moz-focusring":{outline:"none",color:"transparent",textShadow:`0 0 0 ${O.colors.text.primary}`},"&.ng-empty":{color:O.colors.text.secondary}},"&::after":{position:"absolute",top:"36%",right:"11px",backgroundColor:"transparent",color:O.colors.text.primary,font:`normal normal normal ${O.typography.size.sm}/1 FontAwesome`,content:'"\f0d7"',pointerEvents:"none",fontSize:"11px"},"&--has-help-icon":{"&::after":{right:O.spacing(4)}}},".gf-form--v-stretch":{alignItems:"stretch"},".gf-form-btn":{padding:O.spacing(0,1),marginRight:O.spacing(.5),lineHeight:"18px",fontSize:O.typography.size.sm,flexShrink:0,flexGrow:0},".gf-form-help-icon":{flexGrow:0,color:O.colors.text.secondary,"&:hover":{color:O.colors.text.primary}},".cta-form":{position:"relative",padding:O.spacing(3),backgroundColor:O.colors.background.secondary,marginBottom:O.spacing(3),borderTop:`3px solid ${O.colors.success.main}`},".input-small":{width:"90px"}})}function y(O){return(0,n.css)([])}function E(O){return(0,n.css)({".json-formatter-row":{fontFamily:"monospace","&, a, a:hover":{color:O.colors.text.primary,textDecoration:"none"},".json-formatter-row":{marginLeft:O.spacing(2)},".json-formatter-children":{"&.json-formatter-empty":{opacity:.5,marginLeft:O.spacing(2),"&::after":{display:"none"},"&.json-formatter-object::after":{content:"'No properties'"},"&.json-formatter-array::after":{content:"'[]'"}}},".json-formatter-string":{color:O.isDark?"#23d662":"green",whiteSpace:"pre-wrap",wordWrap:"break-word",wordBreak:"break-all"},".json-formatter-number":{color:O.isDark?O.colors.primary.text:O.colors.primary.main},".json-formatter-boolean":{color:O.isDark?O.colors.primary.text:O.colors.error.main},".json-formatter-null":{color:O.isDark?"#eec97d":"#855a00"},".json-formatter-undefined":{color:O.isDark?"rgb(239, 143, 190)":"rgb(202, 11, 105)"},".json-formatter-function":{color:O.isDark?"#fd48cb":"#ff20ed"},".json-formatter-url":{textDecoration:"underline",color:O.isDark?"#027bff":O.colors.primary.main,cursor:"pointer"},".json-formatter-bracket":{color:O.isDark?"#9494ff":O.colors.primary.main},".json-formatter-key":{color:O.isDark?"#23a0db":"#00008b",cursor:"pointer",paddingRight:O.spacing(.25),marginRight:O.spacing(.5)},".json-formatter-constructor-name":{cursor:"pointer"},".json-formatter-array-comma":{marginRight:O.spacing(.5)},".json-formatter-toggler":{lineHeight:"16px",fontSize:O.typography.size.xs,verticalAlign:"middle",opacity:.6,cursor:"pointer",paddingRight:O.spacing(.25),"&::after":{display:"inline-block",[O.transitions.handleMotion("no-preference")]:{transition:"transform 100ms ease-in"},content:"'\u25BA'"}},"> a > .json-formatter-preview-text":{opacity:0,[O.transitions.handleMotion("no-preference","reduce")]:{transition:"opacity 0.15s ease-in"},fontStyle:"italic"},"&:hover > a > .json-formatter-preview-text":{opacity:.6},"&.json-formatter-open":{"> .json-formatter-toggler-link .json-formatter-toggler::after":{transform:"rotate(90deg)"},"> .json-formatter-children::after":{display:"inline-block"},"> a > .json-formatter-preview-text":{display:"none"},"&.json-formatter-empty::after":{display:"block"}}}})}function b(O){return(0,n.css)({".gf-form-select-box__control":{width:"100%",marginRight:O.spacing(.5),backgroundColor:O.components.input.background,border:`1px solid ${O.components.input.borderColor}`,borderRadius:O.shape.radius.default,color:O.components.input.text,cursor:"default",height:O.spacing(4),outline:"none",overflow:"hidden",position:"relative"},".gf-form-select-box__control--is-focused":{backgroundColor:O.components.input.background,borderColor:O.colors.primary.border,outline:"none",boxShadow:`inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px ${O.colors.primary.border}`},".gf-form-select-box__control--is-disabled":{backgroundColor:O.colors.action.disabledBackground},".gf-form-select-box__control--menu-right":{".gf-form-select-box__menu":{right:0,left:"unset"}},".gf-form-select-box__input":{input:{lineHeight:"inherit"}},".gf-form-select-box__menu":{background:O.colors.background.primary,boxShadow:O.shadows.z3,position:"absolute",zIndex:O.zIndex.dropdown,minWidth:"100%","&-notice--no-options":{backgroundColor:O.components.input.background,padding:"10px"}},".gf-form-select-box__menu-list":{overflowY:"auto",maxHeight:"300px",maxWidth:"600px"},".tag-filter .gf-form-select-box__menu":{width:"100%"},".gf-form-select-box__multi-value":{display:"inline",margin:"0 6px 0 0",cursor:"pointer"},".gf-form-select-box__multi-value__remove":{textAlign:"center",display:"inline-block",marginLeft:"2px",position:"relative"},".gf-form-select-box__multi-value__label":{display:"inline",verticalAlign:"middle"},".gf-form-select-box__option":{borderLeft:"2px solid transparent",whiteSpace:"nowrap",backgroundColor:O.components.input.background,"&.gf-form-select-box__option--is-focused":{color:O.colors.text.primary,background:O.colors.action.hover,borderImage:O.colors.gradients.brandVertical,borderImageSlice:1,borderStyle:"solid",borderTop:0,borderRight:0,borderBottom:0,borderLeftWidth:"2px"},"&.gf-form-select-box__option--is-selected":{".fa":{color:O.colors.text.primary}}},".gf-form-select-box__placeholder":{color:O.colors.text.disabled},".gf-form-select-box__control--is-focused .gf-form-select-box__placeholder":{display:"none"},".gf-form-select-box__value-container":{display:"inline-block",padding:"6px 20px 6px 10px",verticalAlign:"middle","> div":{display:"inline-block",verticalAlign:"middle"}},".gf-form-select-box__indicators":{position:"absolute",height:"100%",right:"8px",top:"1px",display:"inline-block",textAlign:"right"},".gf-form-input--form-dropdown":{padding:0,border:0,overflow:"visible",position:"relative"},".gf-form--has-input-icon":{".gf-form-select-box__value-container":{paddingLeft:"30px"}},".gf-form-select-box__desc-option":{display:"flex",alignItems:"center",justifyContent:"flex-start",justifyItems:"center",cursor:"pointer",padding:"7px 10px",width:"100%"},".gf-form-select-box__desc-option__body":{display:"flex",flexDirection:"column",flexGrow:1,paddingRight:"10px",fontWeight:O.typography.fontWeightMedium},".gf-form-select-box__desc-option__desc":{fontWeight:"normal",fontSize:O.typography.bodySmall.fontSize,color:O.colors.text.secondary},".gf-form-select-box__desc-option__img":{width:"16px",marginRight:"10px"},".gf-form-select-box__option-group__header":{display:"flex",alignItems:"center",justifyContent:"flex-start",justifyItems:"center",cursor:"pointer",padding:"7px 10px",width:"100%",borderBottom:`1px solid ${O.v1.palette.dark9}`,textTransform:"capitalize",".fa":{paddingRight:"2px"}},".gf-form-select-box-button-select":{height:"auto"},".select-button":{display:"flex",alignItems:"center"}})}function u(O){return(0,n.css)({".markdown-html":{img:{maxWidth:"100%"},"ul, ol":{paddingLeft:O.spacing(3),marginBottom:O.spacing(2)},table:{marginBottom:O.spacing(2),"td, th":{padding:O.spacing(.5,1)},th:{fontWeight:O.typography.fontWeightMedium,background:O.colors.background.secondary}},"table, th, td":{border:`1px solid ${O.colors.border.medium}`,borderCollapse:"collapse"},a:{color:O.colors.text.link,textDecoration:"none","&:hover":{color:O.colors.text.link,textDecoration:"underline"}},"p:last-child":{marginBottom:0},"table:last-child, ul:last-child, ol:last-child":{marginBottom:0}}})}function D(O){const U=O.breakpoints.values.xxl+O.spacing.gridSize*2+O.components.sidemenu.width;return(0,n.css)({".grafana-app":{display:"flex",flexDirection:"column",height:"100vh"},".main-view":{display:"flex",flexDirection:"column",flexGrow:1,position:"relative",minWidth:0},".page-scrollbar-content":{display:"flex",minHeight:"100%",flexDirection:"column",width:"100%",height:"100%"},".page-container":{flexGrow:1,flexBasis:"100%",paddingLeft:O.spacing(2),paddingRight:O.spacing(2),[O.breakpoints.up("sm")]:{margin:O.spacing(0,1)},[O.breakpoints.up("md")]:{margin:O.spacing(0,2)},[`@media (min-width: ${U}px)`]:{maxWidth:`${O.breakpoints.values.xxl}px`,marginLeft:"auto",marginRight:"auto",width:"100%"}},".page-full":{marginLeft:O.spacing(2),paddingLeft:O.spacing(2),paddingRight:O.spacing(2)},".page-body":{padding:O.spacing(1),background:O.components.panel.background,border:`1px solid ${O.components.panel.borderColor}`,marginBottom:"32px",[O.breakpoints.up("md")]:{padding:O.spacing(2)},[O.breakpoints.up("lg")]:{padding:O.spacing(3)}},".page-heading":{fontSize:O.typography.h4.fontSize,marginTop:0,marginBottom:O.spacing(2)},".page-action-bar":{marginBottom:O.spacing(2),display:"flex",alignItems:"flex-start",gap:O.spacing(2)},".page-action-bar--narrow":{marginBottom:0},".page-action-bar__spacer":{width:O.spacing(2),flexGrow:1},".page-sub-heading":{marginBottom:O.spacing(2)},".page-sub-heading-icon":{marginLeft:O.spacing(1),marginTop:O.spacing(.5)},".page-hidden":{display:"none"}})}function P(O){return(0,n.css)({".query-editor-row":{marginBottom:"2px","&--disabled":{".query-keyword":{color:O.colors.text.secondary}}},".query-keyword":{fontWeight:O.typography.fontWeightMedium,color:`${O.colors.primary.text} !important`},".query-part":{backgroundColor:O.colors.background.secondary,"&:hover":{background:O.colors.emphasize(O.colors.background.secondary,.03)}},".query-segment-operator":{color:`${O.v1.palette.orange} !important`},".tight-form-func":{background:O.colors.background.secondary},'input[type="text"].tight-form-func-param':{fontSize:O.typography.bodySmall.fontSize,background:"transparent",border:"none",margin:0,padding:0},".tight-form-func-controls":{textAlign:"center",".fa-arrow-left":{float:"left",position:"relative",top:2},".fa-arrow-right":{float:"right",position:"relative",top:2},".fa-remove":{marginLeft:"10px"}}})}var C=e(21348);const S=O=>(0,n.css)({".react-loading-skeleton":C.Q});function R(O){return(0,n.css)({".slate-query-field":{fontSize:O.typography.fontSize,fontFamily:O.typography.fontFamilyMonospace,height:"auto",wordBreak:"break-word",overflow:"auto"},".slate-query-field__wrapper":{position:"relative",display:"inline-block",padding:"6px 8px",minHeight:"32px",width:"100%",color:O.colors.text.primary,backgroundColor:O.components.input.background,backgroundImage:"none",border:`1px solid ${O.components.input.borderColor}`,borderRadius:O.shape.radius.default,[O.transitions.handleMotion("no-preference")]:{transition:"all 0.3s"},lineHeight:"18px"},".slate-query-field__wrapper--disabled":{backgroundColor:"inherit",cursor:"not-allowed"},".slate-typeahead":{".typeahead":{position:"relative",zIndex:O.zIndex.typeahead,borderRadius:O.shape.radius.default,border:`1px solid ${O.components.panel.borderColor}`,maxHeight:"66vh",overflowY:"scroll",overflowX:"hidden",outline:"none",listStyle:"none",background:O.components.panel.background,color:O.colors.text.primary,boxShadow:O.shadows.z2},".typeahead-group__title":{color:O.colors.text.secondary,fontSize:O.typography.size.sm,lineHeight:O.typography.body.lineHeight,padding:O.spacing(1)},".typeahead-item":{height:"auto",fontFamily:O.typography.fontFamilyMonospace,padding:O.spacing(1,1,1,2),fontSize:O.typography.size.sm,textOverflow:"ellipsis",overflow:"hidden",zIndex:1,display:"block",whiteSpace:"nowrap",cursor:"pointer",[O.transitions.handleMotion("no-preference")]:{transition:"color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border-color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), padding 0.15s cubic-bezier(0.645, 0.045, 0.355, 1)"}},".typeahead-item__selected":{backgroundColor:O.isDark?O.v1.palette.dark9:O.v1.palette.gray6,".typeahead-item-hint":{fontSize:O.typography.size.xs,color:O.colors.text.primary,whiteSpace:"normal"}},".typeahead-match":{color:O.v1.palette.yellow,borderBottom:`1px solid ${O.v1.palette.yellow}`,padding:"inherit",background:"inherit"}},".slate-query-field, .prism-syntax-highlight":{".token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata":{color:O.colors.text.secondary},".token.variable, .token.entity":{color:O.colors.text.primary},".token.property, .token.tag, .token.constant, .token.symbol, .token.deleted":{color:O.colors.error.text},".token.attr-value, .token.selector, .token.string, .token.char, .token.builtin, .token.inserted":{color:O.colors.success.text},".token.boolean, .token.number, .token.operator, .token.url":{color:"#fe85fc"},".token.function, .token.attr-name, .token.function-name, .token.atrule, .token.keyword, .token.class-name":{color:O.colors.primary.text},".token.punctuation, .token.regex, .token.important":{color:O.v1.palette.orange},".token.important":{fontWeight:"normal"},".token.bold":{fontWeight:"bold"},".token.italic":{fontStyle:"italic"},".token.entity":{cursor:"help"},".namespace":{opacity:.7}}})}function L(O){return(0,n.css)({".uplot":{fontFamily:"inherit"},".u-select":{background:"rgba(120, 120, 130, 0.2)"},".u-hz .u-cursor-x, .u-vt .u-cursor-y":{borderRight:"1px dashed rgba(120, 120, 130, 0.5)"},".u-hz .u-cursor-y, .u-vt .u-cursor-x":{borderBottom:"1px dashed rgba(120, 120, 130, 0.5)"},".shared-crosshair:not(.plot-active) .u-cursor-pt":{display:"none !important"}})}function j(O,U,K="#fff",z="0px 1px 0 rgba(0, 0, 0, 0.1)"){return{backgroundColor:O,backgroundImage:`linear-gradient(to bottom, ${O}, ${U})`,backgroundRepeat:"repeat-x",color:K,textShadow:z,borderColor:O,"&:hover, &:focus, &:active, &.active, &.disabled, &[disabled]":{color:K,backgroundImage:"none",backgroundColor:O}}}function N(O,U,K,z){return{padding:`${O} ${U}`,fontSize:K,borderRadius:z}}function V(O,U){let K={};for(let z=1;z<=U;z++){const G=`${O.spacing(2*z)} !important`;K[`.width-${z}`]={width:G},K[`.max-width-${z}`]={maxWidth:G,flexGrow:1},K[`.min-width-${z}`]={minWidth:G},K[`.offset-width-${z}`]={marginLeft:G}}return K}function w(O){return(0,n.css)({".highlight-word":{color:O.v1.palette.orange},".hide":{display:"none"},".show":{display:"block"},".invisible":{visibility:"hidden !important"},".absolute":{position:"absolute"},".flex-grow-1":{flexGrow:1},".flex-shrink-1":{flexShrink:1},".flex-shrink-0":{flexShrink:0},".center-vh":{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",justifyItems:"center"},".btn":{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:O.typography.fontWeightMedium,lineHeight:O.typography.body.lineHeight,textAlign:"center",verticalAlign:"middle",cursor:"pointer",border:"none",height:`${O.spacing.gridSize*O.components.height.md}px`,...N(O.spacing(0),O.spacing(2),`${O.typography.fontSize}px`,O.shape.radius.default),"&, &:active, &.active":{"&:focus, &.focus":{outline:"none"}},"&:focus, &:hover":{textDecoration:"none"},"&.focus":{textDecoration:"none"},"&:active, &.active":{backgroundImage:"none",outline:0},"&.disabled, &[disabled], &:disabled":{cursor:"not-allowed",opacity:.65,boxShadow:"none",pointerEvents:"none"}},".btn-small":{...N(O.spacing(.5),O.spacing(1),O.typography.size.sm,O.shape.radius.default),height:`${O.spacing.gridSize*O.components.height.sm}px`},".btn-mini":{...N(O.spacing(.5),O.spacing(1),O.typography.size.sm,O.shape.radius.default),height:`${O.spacing.gridSize*O.components.height.sm}px`},".btn-success, .btn-primary":{...j(O.colors.primary.main,O.colors.primary.shade)},".btn-danger":{...j(O.colors.error.main,O.colors.error.shade)},".btn-secondary":{...j(O.colors.secondary.main,O.colors.secondary.shade,O.colors.text.primary)},".btn-inverse":{...j(O.isDark?O.v1.palette.dark6:O.v1.palette.gray5,O.isDark?O.v1.palette.dark5:O.v1.palette.gray4,O.colors.text.primary),"&":{boxShadow:"none"}},".typeahead":{zIndex:O.zIndex.typeahead},...V(O,30),".row":{display:"flex",flexWrap:"wrap",marginLeft:`calc(${O.spacing(4)} / -2)`,marginRight:`calc(${O.spacing(4)} / -2)`},".container":{marginLeft:"auto",marginRight:"auto",paddingLeft:`calc(${O.spacing(4)} / 2)`,paddingRight:`calc(${O.spacing(4)} / 2)`,[O.breakpoints.up("sm")]:{maxWidth:O.breakpoints.values.sm},[O.breakpoints.up("md")]:{maxWidth:O.breakpoints.values.md},[O.breakpoints.up("lg")]:{maxWidth:O.breakpoints.values.lg},[O.breakpoints.up("xl")]:{maxWidth:O.breakpoints.values.xl}}})}function M(){const O=(0,a.$j)();return(0,t.jsx)(n.Global,{styles:[c(O),r(O),o(O),f(O),l(O),s(O),v(O),x(O),m(O),p(O),E(O),i(O),u(O),D(O),P(O),S(O),R(O),L(O),w(O),b(O),y({})]})}},53926(ne,A,e){"use strict";e.d(A,{I:()=>t});var t=(n=>(n.GroupTitle="GroupTitle",n))(t||{})},14226(ne,A,e){"use strict";e.d(A,{Q:()=>t});const t=(n,a)=>{n.key==="Tab"||n.altKey||n.ctrlKey||n.metaKey||(n.stopPropagation(),n.key==="Escape"&&a())}},8255(ne,A,e){"use strict";e.d(A,{Ih:()=>p,Mk:()=>r,Tj:()=>d,UJ:()=>h,Xw:()=>i,ct:()=>f,mZ:()=>m,nO:()=>l,sg:()=>x,xj:()=>o});var t=e(2543),n=e.n(t),a=e(84140);const c=4,r="rgba(0, 211, 255, 1)",i="rgba(11, 237, 50, 1)",o="rgba(237, 46, 24, 1)",l="rgba(150, 150, 150, 1)",f="rgba(247, 149, 32, 1)",h=.09,d=["#7EB26D","#EAB839","#6ED0E0","#EF843C","#E24D42","#1F78C1","#BA43A9","#705DA0","#508642","#CCA300","#447EBC","#C15C17","#890F02","#0A437C","#6D1F62","#584477","#B7DBAB","#F4D598","#70DBED","#F9BA8F","#F29191","#82B5D8","#E5A8E2","#AEA2E0","#629E51","#E5AC0E","#64B0C8","#E0752D","#BF1B00","#0A50A1","#962D82","#614D93","#9AC48A","#F2C96D","#65C5DB","#F9934E","#EA6460","#5195CE","#D683CE","#806EB7","#3F6833","#967302","#2F575E","#99440A","#58140C","#052B51","#511749","#3F2B5B","#E0F9D7","#FCEACA","#CFFAFF","#F9E2D2","#FCE2DE","#BADFF4","#F9D9F9","#DEDAF7"];function s(y){const E=(0,t.map)(y,g),b=(0,t.sortBy)(E,["h"]),u=(0,t.chunk)(b,c),D=(0,t.map)(u,C=>(0,t.sortBy)(C,"l")),P=(0,t.flattenDeep)((0,t.zip)(...D));return(0,t.map)(P,v)}function g(y){return(0,a.A)(y).toHsl()}function v(y){return(0,a.A)(y).toHexString()}function x(y){return(0,a.A)(y).getBrightness()>180?"rgb(32, 34, 38)":"rgb(247, 248, 250)"}function m(y,E){const b=(0,a.A)(y),u=b.getBrightness();return b.getAlpha()<.3?E?"rgb(247, 248, 250)":"rgb(32, 34, 38)":u>180?"rgb(32, 34, 38)":"rgb(247, 248, 250)"}let p=s(d)},75254(ne,A,e){"use strict";e.d(A,{J:()=>t});const t=n=>n().map(a=>({label:a.title,ariaLabel:a.title,url:a.href,target:a.target,icon:`${a.target==="_blank"?"external-link-alt":"link"}`,onClick:a.onClick}))},20720(ne,A,e){"use strict";e.d(A,{h:()=>t});function t(n,a,c){}},27629(ne,A,e){"use strict";e.d(A,{$:()=>t});function t(n,a=!1){return window.grafanaBootData?.settings.featureToggles[n]??a}},28473(ne,A,e){"use strict";e.d(A,{i:()=>t});function t(n){const c=n.lastIndexOf("."),r=n.substring(c),i=n.substring(0,c);return i.length<16?n:`${i.substring(0,16)}...${r}`}},63267(ne,A,e){"use strict";e.d(A,{I:()=>a});var t=e(2543),n=e.n(t);function a(c,r){let i=0,o=c.indexOf(r);r=r.replace(/\s/g,"");const l=[];if(o!==-1)return{distance:0,found:!0,ranges:[{start:o,end:o+r.length-1}]};for(const f of r){const h=c.indexOf(f,o);if(h===-1)return{distance:1/0,ranges:[],found:!1};if(o!==-1&&(i+=h-o),o=h+1,l.length===0)l.push({start:h,end:h});else{const d=(0,t.last)(l);h===d.end+1?d.end++:l.push({start:h,end:h})}}return{distance:i,ranges:l,found:!0}}},60379(ne,A,e){"use strict";e.d(A,{h:()=>c});var t=e(2543),n=e.n(t);const a=(0,t.throttle)((...r)=>{console.log(...r)},500),c=r=>{let i=!1;return typeof window<"u"&&(i=window.localStorage.getItem("grafana.debug")==="true"),{logger:(o,l=!1,...f)=>{},enable:()=>i=!0,disable:()=>i=!1,isEnabled:()=>i}}},53568(ne,A,e){"use strict";e.d(A,{Vr:()=>o,Yc:()=>r,kD:()=>i});let t;const n=new Map,a=500;let c="";function r(){return t||(t=document.createElement("canvas").getContext("2d")),t}function i(l,f,h=400){const d=`${h} ${f}px 'Inter'`,s=l+d,g=n.get(s);if(g)return g;const v=r();c!==d&&(v.font=c=d);const x=v.measureText(l);return n.size===a&&n.clear(),n.set(s,x),x}function o(l,f,h,d,s,g){const v=i(l,14,g),x=f/(v.width+2)*14,m=h/d,p=Math.min(m,x);return Math.min(p,s??p)}},44019(ne,A,e){"use strict";e.r(A),e.d(A,{getChildId:()=>n,renderOrCallToRender:()=>a});var t=e(96540);function n(c){let r;const i=t.Children.only(c);return"id"in i?.props?r=i.props.id:"inputId"in i.props&&(r=i?.props.inputId),typeof r=="string"?r:void 0}function a(c,r){if(t.isValidElement(c)||typeof c=="string"||typeof c=="number")return c;if(typeof c=="function"&&r)return c(r);throw new Error(`${c} is not a React element nor a function that returns React element`)}},59258(ne,A,e){"use strict";e.d(A,{H:()=>i,T:()=>n});var t=e(63267),n=(o=>(o.Word="Word",o.Prefix="Prefix",o.Fuzzy="Fuzzy",o))(n||{});const i={Word:(o,l)=>o.filter(f=>(f.filterText||f.label).includes(l)),Prefix:(o,l)=>o.filter(f=>(f.filterText||f.label).startsWith(l)),Fuzzy:(o,l)=>(l=l.toLowerCase(),o.filter(f=>{const{distance:h,ranges:d,found:s}=(0,t.I)(f.label.toLowerCase(),l);return s?(f.sortValue=h,f.highlightParts=d,!0):!1}))}},21348(ne,A,e){"use strict";e.d(A,{Q:()=>c,j:()=>r});var t=e(74848),n=e(22803);const c={animationName:(0,n.keyframes)({"0%":{opacity:0},"100%":{opacity:1}}),animationDelay:"100ms",animationTimingFunction:"ease-in",animationDuration:"100ms",animationFillMode:"backwards"},r=(i,o)=>Object.assign(i,{Skeleton:f=>(0,t.jsx)(o,{...f,rootProps:{style:c}})})},35458(ne,A,e){"use strict";e.d(A,{dF:()=>a,mO:()=>c,yx:()=>n});var t=e(82611);const n={document:{nodes:[{match:[{type:"paragraph"},{type:"code_block"},{type:"code_line"}]}]},inlines:{}},a=(r,i)=>{const o=r.split(` `).map(f=>t.Block.create({type:"code_line",nodes:[t.Text.create(f)]})),l=t.Block.create({data:{syntax:i},type:"code_block",nodes:o});return t.Document.create({nodes:[l]})},c=(r,i)=>{const o=a(r,i);return t.Value.create({document:o})}},86059(ne,A,e){"use strict";e.d(A,{k:()=>t});const t=(n,a)=>{let c;if(n.getLinks&&(c=n.getLinks({valueRowIndex:a.index})),!!c){for(let r=0;r{o.ctrlKey||o.metaKey||o.shiftKey||(o.preventDefault(),i(o,{field:n,rowIndex:a.index}))}}return c.filter(r=>r.href||r.onClick!=null)}}},48542(ne,A,e){"use strict";e.d(A,{JF:()=>a,MC:()=>c,yC:()=>r});const t=["#D32D20","#1E72B8","#B240A2","#705DA0","#466803","#497A3C","#3D71AA","#B15415","#890F02","#6E6E6E","#0A437C","#6D1F62","#584477","#4C7A3F","#2F4F4F","#BF1B00","#7662B1","#8A2EB8","#517A00","#000000","#3F6833","#2F575E","#99440A","#AE561A","#0E4AB4","#58140C","#052B51","#511749","#3F2B5B"],n=["#FF7368","#459EE7","#E069CF","#9683C6","#6C8E29","#76AC68","#6AA4E2","#E7823D","#AF3528","#9B9B9B","#3069A2","#934588","#7E6A9D","#88C477","#557575","#E54126","#A694DD","#B054DE","#8FC426","#262626","#658E59","#557D84","#BF6A30","#FF9B53","#3470DA","#7E3A32","#2B5177","#773D6F","#655181"];function a(l=""){const f=i(l.toLowerCase());return Math.abs(f%t.length)}function c(l=""){const f=a(l);return r(f)}function r(l){return{color:t[l],borderColor:n[l]}}function i(l){let f=5381;for(let h=0;hn});var t=e(96540);function n(){const[a,c]=(0,t.useState)(0);return(0,t.useCallback)(()=>c(r=>r+1),[])}},36324(ne,A,e){"use strict";e.d(A,{C:()=>a,b:()=>n});var t=e(96540);function n(i=10){let o={x:0,y:0};return{set:h=>{o=c(h)},check:(h,d=i)=>r(o,c(h),d)}}function a(i=10){const o=t.useRef({x:0,y:0}),l=(0,t.useCallback)(h=>{o.current=c(h)},[]),f=(0,t.useCallback)((h,d=i)=>r(o.current,c(h),d),[i]);return(0,t.useMemo)(()=>({set:l,check:f}),[l,f])}function c(i){return{x:i.clientX,y:i.clientY}}function r(i,o,l){return Math.hypot(i.x-o.x,i.y-o.y)>l}},75745(ne,A,e){"use strict";e.d(A,{K:()=>a,Pw:()=>t,RP:()=>c,tf:()=>n});var t=(r=>(r.onBlur="onBlur",r.onFocus="onFocus",r.onChange="onChange",r))(t||{});const n=(r,i)=>{const o=i.reduce((l,f)=>f.rule(r)?l:l.concat(f.errorMessage),[]);return o.length>0?o:null},a=(r,i)=>i&&i[r],c=(r,i)=>({rule:o=>!!o.match(r),errorMessage:i||"Value is not valid"})},62779(ne,A,e){"use strict";e.d(A,{Si:()=>N,yn:()=>R,VQ:()=>L,IH:()=>O,u$:()=>S,iy:()=>w,Fv:()=>j,HP:()=>V});var t=e(10378),n=e(96540),a=e(32899),c=e(92745),r=e(43173),i=e(75234),o=e(64762),l=e(15203),f=e(77197),h=e(75735),d=e(27044),s=e(44220),g=e(99090),v=e(42361),x=e(52763),m=e(65488);const p=m.qR.enhanceEndpoints({}),{useGetDisplayMappingQuery:y,useLazyGetDisplayMappingQuery:E}=p;var b=e(90297);const u={kind:"Folder",apiVersion:"folder.grafana.app/v1beta1",metadata:{name:"general",uid:"DvhY6m059FraHn96xsOKsb8GRtHy2ftVDUPkqZTzP4kX",resourceVersion:"-62135596800000",creationTimestamp:void 0,annotations:{"grafana.app/updatedTimestamp":"0001-01-01T00:00:00Z"}},spec:{title:"Dashboards",description:""},status:{}},D={kind:"Folder",apiVersion:"folder.grafana.app/v1beta1",metadata:{name:"sharedwithme",uid:"DlDSzXw31VwXu6LHMw0JMoFvfVtYzyf3NEPzsOXHtxQX",resourceVersion:"-62135596800000",creationTimestamp:void 0,annotations:{"grafana.app/updatedTimestamp":"0001-01-01T00:00:00Z"}},spec:{title:"Shared with me",description:"Dashboards and folders shared with me"},status:{}};var P=e(2924);function C(G,F){const W=f.A.slugifyForUrl(F);return`${r.$.appSubUrl}/dashboards/f/${G}/${W}`}function S(G){const F=!!r.$.featureToggles.foldersAppPlatformAPI,W=G&&[g.TF,r.$.sharedWithMeFolderUID].includes(G),H=G?{name:G}:t.hT,Y=(0,l.kH)(G||t.hT);let te=(0,P.kH)(F&&!W?H:t.hT);const Z=(0,P.Xq)(F?H:t.hT),[se,ae]=E(),J=(0,n.useMemo)(()=>{const _=K(te);return!W&&!!_.length},[W,te]);if((0,n.useEffect)(()=>{const _=K(te);J&&_.length&&se({key:_},!0)},[J,te,se]),!F)return Y;W&&(te={...te,status:t.RE.fulfilled,fulfilledTimeStamp:Date.now(),isUninitialized:!1,error:void 0,isError:!1,isSuccess:!0,isLoading:!1,isFetching:!1,data:g.TF===G?u:D,currentData:g.TF===G?u:D});let k;if(te.data&&Z.data&&Y.data&&(!J||ae.data)){const _=te.data.metadata.annotations?.[h.Qu],Q=te.data.metadata.annotations?.[h.hc],q=z(te.data);k={canAdmin:Y.data.canAdmin,canDelete:Y.data.canDelete,canEdit:Y.data.canEdit,canSave:Y.data.canSave,accessControl:Y.data.accessControl,createdBy:Q&&ae.data?.display[ae.data?.keys.indexOf(Q)]?.displayName||"Anonymous",updatedBy:_&&ae.data?.display[ae.data?.keys.indexOf(_)]?.displayName||"Anonymous",...q},Z.data.items?.length&&(k.parents=Z.data.items.filter(oe=>oe.name!==te.data.metadata.name).map(oe=>({title:oe.title,uid:oe.name,url:C(oe.name,oe.title)})))}return{...te,...U(te,Z,Y,ae,J),refetch:async()=>Promise.all([te.refetch(),Z.refetch(),Y.refetch()]),data:k}}function R(){const[G]=(0,P.Ko)(),[F]=(0,l.Ko)(),W=M(),H=(0,o._2)();return r.$.featureToggles.foldersAppPlatformAPI&&!1?async function(Z){const se=await G({name:Z.uid});return se.error||(W({childrenOf:Z.parentUid}),H.success((0,c.t)("folders.api.folder-deleted-success","Folder deleted"))),se}:F}function L(){const[G]=(0,l.h5)(),[F]=(0,P.Ko)(),W=(0,x.wA)(),H=M();return r.$.featureToggles.foldersAppPlatformAPI&&!1?async function({folderUIDs:Z}){const se=(0,c.t)("folders.api.folder-deleted-success","Folder deleted");for(const ae of Z)await(0,b.x)(W,ae)||(await F({name:ae})).error||(0,i.J7)().publish({type:a.r1.alertSuccess.name,payload:[se]});return H({parentsOf:Z}),{data:void 0}}:G}function j(){const G=(0,l.tk)(),[F,W]=(0,P.af)(),H=(0,x.wA)(),Y=M();if(!r.$.featureToggles.foldersAppPlatformAPI)return G;async function te({folderUIDs:Z,destinationUID:se}){const ae=(0,c.t)("folders.api.folder-move-error-provisioned","Cannot move provisioned folder. To move it, move it in the repository and synchronise to apply the changes."),J=(0,c.t)("folders.api.folder-moved-success","Folder moved");for(const k of Z)await(0,b.x)(H,k,{warning:ae})||(await F({name:k,patch:{metadata:{annotations:{[h.ew]:se}}}})).error||(0,i.J7)().publish({type:a.r1.alertSuccess.name,payload:[J]});return Y({childrenOf:se,parentsOf:Z}),{data:void 0}}return[te,W]}function N(){const[G,F]=(0,P.P8)(),W=(0,l.Vc)(),H=M();return r.$.featureToggles.foldersAppPlatformAPI?[async te=>{const Z={folder:{spec:{title:te.title},metadata:{generateName:"f",annotations:{...te.parentUid&&{[h.ew]:te.parentUid}}},status:{}}},se=await G(Z);return H({childrenOf:te.parentUid}),v.v.clear(),{...se,data:se.data?z(se.data):void 0}},F]:W}function V(){const[G,F]=(0,P.n4)(),W=(0,l.iB)(),H=M();return r.$.featureToggles.foldersAppPlatformAPI?[async te=>{const Z={name:te.uid,folder:{spec:{title:te.title},metadata:{name:te.uid},status:{}}},se=await G(Z);return H({childrenOf:te.parentUid}),{...se,data:se.data?z(se.data):void 0}},F]:W}function w(){const[G,F]=(0,P.af)(),W=(0,l.aF)(),H=M(),Y=(0,o._2)();if(!r.$.featureToggles.foldersAppPlatformAPI)return W;async function te({folderUID:Z,destinationUID:se}){const ae=await G({name:Z,patch:{metadata:{annotations:{[h.ew]:se}}}});return ae.error||(H({parentsOf:[Z],childrenOf:se}),Y.success((0,c.t)("folders.api.folder-moved-success","Folder moved"))),ae}return[te,F]}function M(){const G=(0,x.wA)();return F=>{F.parentsOf&&G((0,s.Zw)(F.parentsOf)),(F.childrenOf||"childrenOf"in F)&&G((0,s.bw)({parentUID:F.childrenOf,pageSize:d.md}))}}function O({folder:G,dashboard:F}){const W=Object.keys(G).filter(ae=>G[ae]),H=Object.keys(F).filter(ae=>F[ae]),Y=!1,te={folderUIDs:W,dashboardUIDs:H},Z=(0,l.G2)(Y?t.hT:te),se=(0,P.G2)(Y?te:t.hT);return Y?se:Z}function U(G,F,W,H,Y){const te=Y?[G,F,W,H]:[G,F,W];return{isLoading:te.some(Z=>Z.isLoading),isFetching:te.some(Z=>Z.isFetching),isSuccess:te.every(Z=>Z.isSuccess),isError:te.some(Z=>Z.isError),error:te.find(Z=>Z.error)}}function K(G){return G.data?[G.data.metadata.annotations?.[h.Qu],G.data.metadata.annotations?.[h.hc]].filter(F=>F!==void 0):[]}const z=G=>{const{annotations:F,name:W="",creationTimestamp:H,generation:Y,labels:te}=G.metadata,{title:Z=""}=G.spec;return{id:parseInt(te?.[h.Y5]||"0",10)||0,uid:W,title:Z,url:W===g.TF?"":C(W,Z),created:H||"0001-01-01T00:00:00Z",updated:F?.[h.xU]||"0001-01-01T00:00:00Z",managedBy:F?.[h.LH],parentUid:F?.[h.ew],version:Y||1,hasAcl:!1}}},2924(ne,A,e){"use strict";e.d(A,{G2:()=>h,Ko:()=>i,P8:()=>o,Xq:()=>r,Zt:()=>a,af:()=>l,kH:()=>c,n4:()=>f});var t=e(19705),n=e(90297);const a=t.qR.enhanceEndpoints({endpoints:{getFolder:{providesTags:(d,s,g)=>d?[{type:"Folder",id:g.name}]:[]},listFolder:{providesTags:d=>d?[{type:"Folder",id:"LIST"},...d.items.map(s=>({type:"Folder",id:s.metadata?.name})).filter(Boolean)]:[{type:"Folder",id:"LIST"}]},deleteFolder:{invalidatesTags:(d,s)=>s?[]:[{type:"Folder",id:"LIST"}]}}}).injectEndpoints({endpoints:d=>({getAffectedItems:d.query({keepUnusedDataFor:0,queryFn:async({folderUIDs:s,dashboardUIDs:g},v)=>{const x={folders:s.length,dashboards:g.length,library_elements:0,alertrules:0},m=s.map(async p=>v.dispatch(t.qR.endpoints.getFolderCounts.initiate({name:p})));try{return{data:(await Promise.all(m)).reduce((E,b)=>{const{data:u,error:D}=b;if(D)throw D;const P=(0,n.a)(u?.counts??[]);return E.folders+=P.folders,E.dashboards+=P.dashboards,E.alertrules+=P.alertrules,E.library_elements+=P.library_elements,E},x)}}catch(p){return{error:p}}}})})}),{useGetFolderQuery:c,useGetFolderParentsQuery:r,useDeleteFolderMutation:i,useCreateFolderMutation:o,useUpdateFolderMutation:l,useReplaceFolderMutation:f,useGetAffectedItemsQuery:h}=a},90297(ne,A,e){"use strict";e.d(A,{a:()=>f,x:()=>o});var t=e(32899),n=e(92745),a=e(43173),c=e(45229),r=e(68528),i=e(2924);async function o(h,d,s){if(a.$.featureToggles.provisioning){const g=await h(i.Zt.endpoints.getFolder.initiate({name:d}));return g.data&&(0,r.x)(g.data)?(c.A.publish({type:t.r1.alertWarning.name,payload:[s?.warning||(0,n.t)("folders.api.folder-delete-error-provisioned","Cannot delete provisioned folder. To remove it, delete it from the repository and synchronise to apply the changes.")]}),!0):!1}else return!1}const l={folder:0,dashboard:0,libraryPanel:0,alertRule:0},f=h=>h.reduce((d,{resource:s,count:g})=>(d[s]||(d[s]=g),d),l)},38032(ne,A,e){"use strict";e.d(A,{$U:()=>t.$U,Pi:()=>t.Pi,oJ:()=>t.oJ,qR:()=>t.qR});var t=e(28845),n=e(92745),a=e(6890),c=e(64762);const r=t.qR.enhanceEndpoints({endpoints:{addStar:{onQueryStarted:async(i,{queryFulfilled:o,dispatch:l})=>{try{await o,l((0,a.dx)((0,c.tZ)((0,n.t)("dashboard.toolbar.star-added","Added to starred"))))}catch(f){f instanceof Error&&l((0,a.dx)((0,c.gi)((0,n.t)("dashboard.toolbar.star-add-error","Failed to add to starred"),f)))}}},removeStar:{onQueryStarted:async(i,{queryFulfilled:o,dispatch:l})=>{try{await o,l((0,a.dx)((0,c.tZ)((0,n.t)("dashboard.toolbar.star-removed","Removed from starred"))))}catch(f){f instanceof Error&&l((0,a.dx)((0,c.gi)((0,n.t)("dashboard.toolbar.star-remove-error","Failed to remove from starred"),f)))}}}}})},83793(ne,A,e){"use strict";e.d(A,{PP:()=>g,tj:()=>t.tj,bS:()=>t.bS,ZL:()=>t.ZL,L:()=>t.L,Qo:()=>t.Qo,So:()=>t.So,KA:()=>t.KA,F9:()=>t.F9,Bm:()=>t.Bm,Kw:()=>t.Kw,$j:()=>t.$j,qC:()=>t.qC,$9:()=>t.$9,Sw:()=>t.Sw,Cx:()=>t.Cx,nS:()=>t.nS,c2:()=>t.c2,v$:()=>t.v$,L3:()=>t.L3,Ih:()=>t.Ih,XM:()=>t.XM,hD:()=>t.hD});var t=e(71313),n=e(92745),a=e(68143),c=e(87186),r=e(8535),i=e(6890),o=e(64762),l=e(27044),f=e(44220),h=e(85618),d=e(54115);function s(v){return async function(m,{updateCachedData:p,cacheDataLoaded:y,cacheEntryRemoved:E}){if(!m?.watch)return;const b=new d.ws({group:"provisioning.grafana.app",version:"v0alpha1",resource:v});let u=null;try{const P=(await y).data.metadata?.resourceVersion;u=b.watch({resourceVersion:P}).subscribe(C=>{p(S=>{S.items||(S.items=[]);const R=S.items.findIndex(L=>L.metadata?.name===C.object.metadata.name);C.type==="ADDED"&&R===-1?S.items.push(C.object):C.type==="DELETED"&&R!==-1?S.items.splice(R,1):R!==-1&&(S.items[R]=C.object)})})}catch(D){console.error("Error in onCacheEntryAdded:",D)}await E,u?.unsubscribe()}}const g=t.qR.enhanceEndpoints({endpoints:{listJob:{query:({watch:v,...x})=>({url:"/jobs",params:x}),onCacheEntryAdded:s("jobs")},listRepository:{query:({watch:v,...x})=>({url:"/repositories",params:x}),onCacheEntryAdded:s("repositories")},deleteRepository:{onQueryStarted:async(v,{queryFulfilled:x,dispatch:m})=>{try{await x,m((0,i.dx)((0,o.tZ)((0,n.t)("provisioning.delete-repository-button.success-repository-deleted","Repository settings queued for deletion"))))}catch(p){p instanceof Error&&m((0,i.dx)((0,o.gi)((0,n.t)("provisioning.delete-repository-button.error-repository-delete","Failed to delete repository"),p)))}setTimeout(()=>{m((0,f.bw)({parentUID:void 0,pageSize:l.md}))},1e3)}},deletecollectionRepository:{onQueryStarted:async(v,{queryFulfilled:x,dispatch:m})=>{try{await x,m((0,i.dx)((0,o.tZ)((0,n.t)("provisioning.home-page.success-all-repositories-deleted","All configured repositories deleted"))))}catch(p){p instanceof Error&&m((0,i.dx)((0,o.gi)((0,n.t)("provisioning.home-page.error-delete-all-repositories","Failed to delete all repositories"),p)))}setTimeout(()=>{m((0,f.bw)({parentUID:void 0,pageSize:l.md}))},1e3)}},createRepositoryTest:{onQueryStarted:async(v,{queryFulfilled:x,dispatch:m})=>{try{await x}catch(p){if(typeof p=="object"&&p&&"error"in p&&(0,a.NF)(p.error)){if(p.error.data.kind==="Status"&&p.error.data.status==="Failure"){const y=p.error.data;m((0,i.dx)((0,o.gi)("Error validating repository",new Error(y.message||"Unknown error"))));return}if(Array.isArray(p.error.data.errors)&&p.error.data.errors.length){p.error.data.errors.filter(E=>!E.field).length>0&&m((0,i.dx)((0,o.gi)("Error validating repository")));return}}(0,h.H4)(p,m,"Error validating repository")}}},createRepositoryJobs:{onQueryStarted:async({jobSpec:v},{queryFulfilled:x,dispatch:m})=>{try{const p=v.action==="pull"||v.action==="migrate";await x,p&&m((0,i.dx)((0,o.tZ)((0,n.t)("provisioning.sync-repository.success-pull-started","Pull started"))))}catch(p){p instanceof Error&&m((0,i.dx)((0,o.gi)((0,n.t)("provisioning.sync-repository.error-pulling-resources","Error pulling resources"),p)))}}},createRepository:{onQueryStarted:async(v,{queryFulfilled:x,dispatch:m})=>{try{await x,m((0,i.dx)((0,o.tZ)((0,n.t)("provisioning.config-form.alert-repository-settings-saved","Repository settings saved"))))}catch(p){p instanceof Error&&m((0,i.dx)((0,o.gi)((0,n.t)("provisioning.config-form.error-save-repository","Failed to save repository settings"),p)))}}},replaceRepository:{onQueryStarted:async(v,{queryFulfilled:x,dispatch:m})=>{try{await x,m((0,i.dx)((0,o.tZ)((0,n.t)("provisioning.config-form.alert-repository-settings-updated","Repository settings updated"))))}catch(p){p instanceof Error&&m((0,i.dx)((0,o.gi)((0,n.t)("provisioning.config-form.error-save-repository","Failed to save repository settings"),p)))}m((0,f.bw)({parentUID:void 0,pageSize:l.md}))}},getRepositoryJobsWithPath:{onQueryStarted:async(v,{queryFulfilled:x,dispatch:m})=>{try{const y=(await x).data;if(y.status?.state==="success"&&(y.spec?.action==="delete"||y.spec?.action==="move")){const E=(0,r.Gu)().browseDashboards,b=y.spec?.action;let u=Object.keys(E.childrenByParentUID);if(b==="delete"){const D=y.spec?.[b]?.resources?.map(P=>P.name).filter(Boolean)||[];u=u.filter(P=>!D.includes(P))}m((0,c.xN)(u))}}catch(p){console.error("Error in getRepositoryJobsWithPath:",p)}}}}})},85618(ne,A,e){"use strict";e.d(A,{Ge:()=>t.Ge,H4:()=>c,PE:()=>r,TP:()=>t.TP});var t=e(59553),n=e(6890),a=e(64762);const c=(i,o,l)=>{const f=(0,t.cQ)(i);o((0,n.dx)((0,a.gi)(l,f)))};function r(i){if(i&&typeof i=="object"){if("data"in i&&i.data&&typeof i.data=="object"&&"message"in i.data)return String(i.data.message);if("message"in i)return String(i.message)}return String(i)}},873(ne,A,e){"use strict";e.d(A,{A:()=>c});var t,n=e(2543),a=e.n(n);class c{constructor(l){if(this.columns=[],this.columnMap={},this.rows=[],this.type="table",l){if(l.columns)for(const f of l.columns)this.addColumn(f);if(l.rows)for(const f of l.rows)this.addRow(f)}}sort(l){l.col===null||l.col===void 0||this.columns.length<=l.col||(this.rows.sort((f,h)=>(f=f[l.col],h=h[l.col],+(f==null)-+(h==null)||+(f>h)||-(f!!p.columns),d={},s=h.slice().reduce((p,y)=>(y.columns.forEach(E=>{const{text:b}=E;d[b]===void 0&&(d[b]=p.length,p.push(E))}),p),[]),g=h.map(p=>p.columns.map(y=>d[y.text])),v=h.reduce((p,y,E)=>{const b=g[E];return y.rows.forEach(u=>{const D=[];b.forEach((P,C)=>{D[P]=u[C]}),p.push(D)}),p},[]),x={},m=v.reduce((p,y,E)=>{if(!x[E]){let b=E+1;for(;br(s,y,D),b);if(u>-1){const D=v[u];for(let P=0;Pn});var t=e(65307);const n=(0,t.VP)("core/cleanUpState")},6890(ne,A,e){"use strict";e.d(A,{Do:()=>t.Do,Vz:()=>n.Vz,YA:()=>n.YA,dx:()=>t.dx});var t=e(12066),n=e(43550)},34517(ne,A,e){"use strict";e.d(A,{x:()=>F});var t=e(74848),n=e(22803),a=e(2543),c=e(96540),r=e(5805),i=e(92745),o=e(63142),l=e(6975),f=e(31286),h=e(66404),d=e(45861),s=e(63722),g=e(83873),v=e(78059),x=e(90382),m=e(41654),p=e(18857),y=e(15840),E=e(76459),b=e.n(E),u=e(68143);const D=({className:J,onSelected:k,inputId:_})=>{const[Q,q]=(0,c.useState)(!1),oe=(0,c.useMemo)(()=>b()(async re=>(q(!0),(0,a.isNil)(re)&&(re=""),(0,u.AI)().get(`/api/serviceaccounts/search?query=${re}&perpage=100`).then(ee=>ee.serviceAccounts.map(B=>({id:B.id,uid:B.uid,value:B,label:B.login,imgUrl:B.avatarUrl,login:B.login}))).finally(()=>{q(!1)})),300,{leading:!0}),[]);return(0,t.jsx)("div",{className:"service-account-picker","data-testid":"serviceAccountPicker",children:(0,t.jsx)(p.DW,{isClearable:!0,className:J,inputId:_,isLoading:Q,defaultOptions:!0,loadOptions:oe,onChange:k,placeholder:(0,i.t)("service-account-picker.select-placeholder","Start typing to search for service accounts"),noOptionsMessage:(0,i.t)("service-account-picker.noOptionsMessage-no-service-accounts-found","No service accounts found"),"aria-label":(0,i.t)("service-account-picker.select-aria-label","Service account picker")})})};class P extends c.Component{constructor(k){super(k),this.search=b()(async _=>(this.setState({isLoading:!0}),(0,a.isNil)(_)&&(_=""),(0,u.AI)().get(`/api/teams/search?perpage=100&page=1&query=${_}`).then(Q=>{const q=Q.teams.map(oe=>({value:oe,label:oe.name,imgUrl:oe.avatarUrl}));return this.setState({isLoading:!1}),q})),300,{leading:!0}),this.state={isLoading:!1}}componentDidMount(){const{teamId:k}=this.props;k&&(0,u.AI)().get(`/api/teams/${k}`).then(_=>{this.setState({value:{value:_,label:_.name,imgUrl:_.avatarUrl}})})}render(){const{onSelected:k,className:_}=this.props,{isLoading:Q,value:q}=this.state;return(0,t.jsx)("div",{className:"user-picker","data-testid":"teamPicker",children:(0,t.jsx)(p.DW,{isLoading:Q,defaultOptions:!0,loadOptions:this.search,value:q,onChange:k,className:_,placeholder:(0,i.t)("team-picker.select-placeholder","Select a team"),noOptionsMessage:(0,i.t)("team-picker.noOptionsMessage-no-teams-found","No teams found"),"aria-label":(0,i.t)("team-picker.select-aria-label","Team picker")})})}}const C=({className:J,onSelected:k,inputId:_})=>{const[Q,q]=(0,c.useState)(!1),oe=(0,c.useMemo)(()=>b()(async re=>(q(!0),(0,a.isNil)(re)&&(re=""),(0,u.AI)().get(`/api/org/users/lookup?query=${re}&limit=100`).then(ee=>ee.map(B=>({id:B.userId,uid:B.uid,value:B,label:B.login,imgUrl:B.avatarUrl,login:B.login}))).finally(()=>{q(!1)})),300,{leading:!0}),[]);return(0,t.jsx)("div",{className:"user-picker","data-testid":"userPicker",children:(0,t.jsx)(p.DW,{isClearable:!0,className:J,inputId:_,isLoading:Q,defaultOptions:!0,loadOptions:oe,onChange:k,placeholder:(0,i.t)("user-picker.select-placeholder","Start typing to search for user"),noOptionsMessage:(0,i.t)("user-picker.noOptionsMessage-no-users-found","No users found"),"aria-label":(0,i.t)("user-picker.select-aria-label","User picker")})})};var S=(J=>(J.None="None",J.Team="Team",J.User="User",J.ServiceAccount="ServiceAccount",J.BuiltInRole="builtInRole",J))(S||{});const R=({title:J=(0,i.t)("access-control.add-permission.title","Add permission for"),permissions:k,assignments:_,onAdd:Q,onCancel:q})=>{const[oe,re]=(0,c.useState)(S.None),[ee,B]=(0,c.useState)(""),[ie,de]=(0,c.useState)(""),[fe,ce]=(0,c.useState)(""),[ve,Se]=(0,c.useState)(""),je=(0,c.useMemo)(()=>{const he=[];return _.users&&he.push({value:S.User,label:(0,i.t)("access-control.add-permission.user-label","User")}),_.serviceAccounts&&he.push({value:S.ServiceAccount,label:(0,i.t)("access-control.add-permission.serviceaccount-label","Service Account")}),_.teams&&he.push({value:S.Team,label:(0,i.t)("access-control.add-permission.team-label","Team")}),_.builtInRoles&&he.push({value:S.BuiltInRole,label:(0,i.t)("access-control.add-permission.role-label","Role")}),he},[_]);(0,c.useEffect)(()=>{k.length>0&&Se(k[0])},[k]);const Ve=()=>oe===S.Team&&ee||oe===S.User&&ie||oe===S.ServiceAccount&&ie||S.BuiltInRole&&x.X.hasOwnProperty(fe);return(0,t.jsxs)("div",{className:"cta-form","aria-label":(0,i.t)("access-control.add-permission.permissions-aria-label","Permissions slider"),children:[(0,t.jsx)(y.J,{onClick:q}),(0,t.jsx)("h5",{children:J}),(0,t.jsx)("form",{name:"addPermission",onSubmit:he=>{he.preventDefault(),Q({userUid:ie,teamUid:ee,builtInRole:fe,permission:ve,target:oe})},children:(0,t.jsxs)(m.B,{gap:1,direction:"row",children:[(0,t.jsx)(p.l6,{"aria-label":(0,i.t)("access-control.add-permission.role-select-aria-label","Role to add new permission to"),value:oe,options:je,onChange:he=>re(he.value),disabled:je.length===0,width:"auto"}),oe===S.User&&(0,t.jsx)(C,{onSelected:he=>de(he?.value?.uid||"")}),oe===S.ServiceAccount&&(0,t.jsx)(D,{onSelected:he=>de(he?.value?.uid||"")}),oe===S.Team&&(0,t.jsx)(P,{onSelected:he=>B(he.value?.uid||"")}),oe===S.BuiltInRole&&(0,t.jsx)(p.l6,{"aria-label":(0,i.t)("access-control.add-permission.built-in-aria-label","Built-in role picker"),options:Object.values(x.X).filter(he=>he!==x.X.None).map(he=>({value:he,label:he})),onChange:he=>ce(he.value||""),width:"auto"}),(0,t.jsx)(p.l6,{"aria-label":(0,i.t)("access-control.add-permission.level-aria-label","Permission level"),width:"auto",value:k.find(he=>he===ve),options:k.map(he=>({label:he,value:he})),onChange:he=>Se(he.value||"")}),(0,t.jsx)(d.$n,{type:"submit",disabled:!Ve(),children:(0,t.jsx)(i.x6,{i18nKey:"access-control.add-permissions.save",children:"Save"})})]})})]})};var L=e(45967),j=e(30703);const N=({item:J,permissionLevels:k,canSet:_,onRemove:Q,onChange:q})=>{const oe=(0,o.of)(U);return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:V(J)}),(0,t.jsx)("td",{children:M(J)}),(0,t.jsx)("td",{children:J.isInherited&&(0,t.jsx)("em",{className:oe.inherited,children:(0,t.jsx)(i.x6,{i18nKey:"access-control.permission-list-item.inherited",children:"Inherited from folder"})})}),(0,t.jsx)("td",{children:(0,t.jsx)(p.l6,{disabled:!_||!J.isManaged,onChange:re=>q(J,re.value),value:k.find(re=>re===J.permission),options:k.map(re=>({value:re,label:re}))})}),(0,t.jsx)("td",{children:J.warning?(0,t.jsx)(L.m,{content:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.a,{marginBottom:1,children:J.warning}),O(J)]}),children:(0,t.jsx)(j.I,{name:"exclamation-triangle",className:oe.warning})}):(0,t.jsx)(L.m,{content:O(J),children:(0,t.jsx)(j.I,{name:"info-circle"})})}),(0,t.jsx)("td",{children:J.isManaged?(0,t.jsx)(d.$n,{size:"sm",icon:"times",variant:"destructive",disabled:!_,onClick:()=>Q(J),"aria-label":(0,i.t)("access-control.permission-list-item.remove-aria-label","Remove permission for {{identifier}}",{identifier:w(J)})}):(0,t.jsx)(L.m,{content:J.isInherited?(0,i.t)("access-control.permission-list-item.tooltip-inherited-permission","Inherited permission"):(0,i.t)("access-control.permission-list-item.tooltip-provisioned-permission","Provisioned permission"),children:(0,t.jsx)(d.$n,{size:"sm",icon:"lock","aria-label":(0,i.t)("access-control.permission-list-item.locked-aria-label","Locked permission indicator")})})})]})},V=J=>J.teamId?(0,t.jsx)("img",{className:"filter-table__avatar",src:J.teamAvatarUrl,alt:`Avatar for team ${J.teamId}`}):J.userId?(0,t.jsx)("img",{className:"filter-table__avatar",src:J.userAvatarUrl,alt:`Avatar for user ${J.userId}`}):(0,t.jsx)(j.I,{size:"xl",name:"shield"}),w=J=>J.userId?J.userLogin:J.teamId?J.team:J.builtInRole,M=J=>J.userId?(0,t.jsxs)("span",{children:[J.userLogin," "]},"name"):J.teamId?(0,t.jsxs)("span",{children:[J.team," "]},"name"):J.builtInRole?(0,t.jsxs)("span",{children:[J.builtInRole," "]},"name"):(0,t.jsx)("span",{},"name"),O=J=>`Actions: ${[...new Set(J.actions)].sort().join(" ")}`,U=J=>({warning:(0,n.css)({color:J.colors.warning.main}),inherited:(0,n.css)({color:J.colors.text.secondary,flexWrap:"nowrap"})}),K=({title:J,items:k,compareKey:_,permissionLevels:Q,canSet:q,onRemove:oe,onChange:re})=>{const ee=(0,c.useMemo)(()=>{const B={};for(let ie of k){const de=ie[_];if(!B[de]){B[de]=ie;continue}if(ie.actions.length>B[de].actions.length){B[de]=ie;continue}ie.actions.length===B[de].actions.length&&B[de].isManaged&&!ie.isManaged&&(B[de]=ie)}return Object.keys(B).map(ie=>B[ie])},[k,_]);return ee.length===0?null:(0,t.jsx)("div",{children:(0,t.jsxs)("table",{className:"filter-table gf-form-group",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{style:{width:"1%"}}),(0,t.jsx)("th",{children:J}),(0,t.jsx)("th",{style:{width:"1%"}}),(0,t.jsx)("th",{style:{width:"40%"},children:(0,t.jsx)(i.x6,{i18nKey:"access-control.permission-list.permission",children:"Permission"})}),(0,t.jsx)("th",{style:{width:"1%"}}),(0,t.jsx)("th",{style:{width:"1%"}})]})}),(0,t.jsx)("tbody",{children:ee.map((B,ie)=>(0,t.jsx)(N,{item:B,onRemove:oe,onChange:re,canSet:q,permissionLevels:Q},`${ie}-${B.userId}`))})]})})},z="",G={permissions:[],assignments:{teams:!1,users:!1,serviceAccounts:!1,builtInRoles:!1}},F=({buttonLabel:J=(0,i.t)("access-control.permissions.add-label","Add a permission"),emptyLabel:k=(0,i.t)("access-control.permissions.no-permissions","There are no permissions"),resource:_,resourceId:Q,canSetPermissions:q,addPermissionTitle:oe,getWarnings:re,epilogue:ee})=>{const B=(0,o.of)(ae),[ie,de]=(0,c.useState)(!1),[fe,ce]=(0,c.useState)(G),[ve,Se]=(0,r.default)(async()=>{let Ae=await H(_,Q);return re&&(Ae=re(Ae)),Ae},[_,Q,re]);(0,c.useEffect)(()=>{W(_).then(Ae=>(ce(Ae),Se()))},[_,Se]);const je=Ae=>{let $e=null;Ae.target===S.User||Ae.target===S.ServiceAccount?$e=Y(_,Q,Ae.userUid,Ae.permission):Ae.target===S.Team?$e=te(_,Q,Ae.teamUid,Ae.permission):Ae.target===S.BuiltInRole&&($e=Z(_,Q,Ae.builtInRole,Ae.permission)),$e!==null&&$e.then(Se)},Ve=Ae=>{let $e=null;Ae.userUid?$e=Y(_,Q,Ae.userUid,z):Ae.teamUid?$e=te(_,Q,Ae.teamUid,z):Ae.builtInRole&&($e=Z(_,Q,Ae.builtInRole,z)),$e!==null&&$e.then(Se)},he=(Ae,$e)=>{console.log("onChange",Ae,$e),Ae.permission!==$e&&(Ae.userUid||Ae.isServiceAccount?je({permission:$e,userUid:Ae.userUid,target:S.User}):Ae.teamUid?je({permission:$e,teamUid:Ae.teamUid,target:S.Team}):Ae.builtInRole&&je({permission:$e,builtInRole:Ae.builtInRole,target:S.BuiltInRole}))},Ue=(0,c.useMemo)(()=>(0,a.sortBy)((ve.value||[]).filter(Ae=>Ae.teamId),["team","isManaged"]),[ve.value]),pe=(0,c.useMemo)(()=>(0,a.sortBy)((ve.value||[]).filter(Ae=>Ae.userId&&!Ae.isServiceAccount),["userLogin","isManaged"]),[ve.value]),be=(0,c.useMemo)(()=>(0,a.sortBy)((ve.value||[]).filter(Ae=>Ae.userId&&Ae.isServiceAccount),["userLogin","isManaged"]),[ve.value]),ze=(0,c.useMemo)(()=>(0,a.sortBy)((ve.value||[]).filter(Ae=>Ae.builtInRole),["builtInRole","isManaged"]),[ve.value]),Ne=(0,i.t)("access-control.permissions.role","Role"),Ie=(0,i.t)("access-control.permissions.user","User"),ke=(0,i.t)("access-control.permissions.serviceaccount","Service Account"),Ee=(0,i.t)("access-control.permissions.team","Team");return ve.loading?(0,t.jsx)(l._,{text:(0,i.t)("access-control.permissions.loading","Loading permissions...")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[q&&_==="folders"&&(0,t.jsxs)(f.a,{paddingBottom:2,children:[(0,t.jsx)(i.x6,{i18nKey:"access-control.permissions.permissions-change-warning",children:"This will change permissions for this folder and all its descendants. In total, this will affect:"}),(0,t.jsx)(v.x,{selectedItems:{folder:{[Q]:!0},dashboard:{},panel:{},$all:!1}})]}),ve.value?.length===0&&(0,t.jsx)(f.a,{children:(0,t.jsx)(h.E,{children:k})}),(0,t.jsx)(K,{title:Ne,items:ze,compareKey:"builtInRole",permissionLevels:fe.permissions,onChange:he,onRemove:Ve,canSet:q}),(0,t.jsx)(K,{title:Ie,items:pe,compareKey:"userLogin",permissionLevels:fe.permissions,onChange:he,onRemove:Ve,canSet:q}),(0,t.jsx)(K,{title:ke,items:be,compareKey:"userLogin",permissionLevels:fe.permissions,onChange:he,onRemove:Ve,canSet:q}),(0,t.jsx)(K,{title:Ee,items:Ue,compareKey:"team",permissionLevels:fe.permissions,onChange:he,onRemove:Ve,canSet:q}),q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.$n,{className:B.addPermissionButton,variant:"primary",onClick:()=>de(!0),icon:"plus",children:J},"add-permission"),(0,t.jsx)(s.a,{in:ie,children:(0,t.jsx)(R,{title:oe,onAdd:je,permissions:fe.permissions,assignments:fe.assignments,onCancel:()=>de(!1)})})]})]}),ee&&ee(ve.value||[])]})},W=async J=>{try{return await(0,g.AI)().get(`/api/access-control/${J}/description`)}catch(k){return console.error("failed to load resource description: ",k),G}},H=(J,k)=>(0,g.AI)().get(`/api/access-control/${J}/${k}`),Y=(J,k,_,Q)=>se(J,k,"users",_,Q),te=(J,k,_,Q)=>se(J,k,"teams",_,Q),Z=(J,k,_,Q)=>se(J,k,"builtInRoles",_,Q),se=(J,k,_,Q,q)=>(0,g.AI)().post(`/api/access-control/${J}/${k}/${_}/${Q}`,{permission:q}),ae=J=>({breakdown:(0,n.css)({...J.typography.bodySmall,color:J.colors.text.secondary,marginBottom:J.spacing(2)}),addPermissionButton:(0,n.css)({marginBottom:J.spacing(2)})})},63722(ne,A,e){"use strict";e.d(A,{a:()=>o});var t=e(74848),n=e(96540),a=e(22669);const c="200px",r=200,i={transition:`max-height ${r}ms ease-in-out`,overflow:"hidden"},o=({children:l,in:f,maxHeight:h=c,style:d=i})=>{const s=(0,n.useRef)(null),g={exited:{maxHeight:0},entering:{maxHeight:h},entered:{maxHeight:"unset",overflow:"visible"},exiting:{maxHeight:0}};return(0,t.jsx)(a.Ay,{in:f,timeout:r,nodeRef:s,children:v=>(0,t.jsx)("div",{style:{...d,...g[v]},ref:s,children:l})})}},43707(ne,A,e){"use strict";e.d(A,{H:()=>a});var t=e(96540),n=e(27963);const a=t.memo(({actions:c,breadcrumbActions:r})=>{const{chrome:i}=(0,n.Il)();return(0,t.useLayoutEffect)(()=>()=>{i.update({actions:void 0,breadcrumbActions:void 0})},[i]),(0,t.useLayoutEffect)(()=>{i.update({actions:c,breadcrumbActions:r})}),null});a.displayName="TopNavUpdate"},92270(ne,A,e){"use strict";e.d(A,{EE:()=>d,T0:()=>h,nf:()=>f,yq:()=>l});var t=e(74848),n=e(22803),a=e(17437),c=e(54092),r=e(33604),i=e(63142),o=e(58449);const l=300,f=100,h=Math.floor(window.innerWidth*(2/3));function d(){const g=s((0,i.$j)()),{dockedComponentId:v,props:x={}}=(0,o.sA)(),{components:m,isLoading:p}=(0,r.f)({extensionPointId:c.SM.ExtensionSidebar});if(p||!v)return null;const y=(0,o.rS)(v);if(!y)return null;const E=m.find(b=>b.meta.pluginId===y.pluginId&&b.meta.title===y.componentTitle);return E?(0,t.jsx)("div",{className:g.sidebarWrapper,children:(0,t.jsxs)("div",{className:g.content,children:[(0,t.jsx)(a.Global,{styles:[(0,a.css)({body:{overflowY:"unset !important"}})]}),(0,t.jsx)(E,{...x})]})}):null}const s=g=>({sidebarWrapper:(0,n.css)({backgroundColor:g.colors.background.primary,borderLeft:`1px solid ${g.colors.border.weak}`,display:"flex",flexDirection:"column",gap:g.spacing(1),padding:g.spacing(1),width:"100%",height:"100%",overflow:"auto"}),content:(0,n.css)({flex:1,minHeight:0})})},58449(ne,A,e){"use strict";e.d(A,{h_:()=>u,kn:()=>y,pF:()=>E,rS:()=>b,sA:()=>p});var t=e(74848),n=e(96540),a=e(78685),c=e(78012),r=e(54092),i=e(27489),o=e(36490),l=e(75234),f=e(46907),h=e(3260),d=e(87745),s=e(92270);const g="grafana.navigation.extensionSidebarDocked",v="grafana.navigation.extensionSidebarWidth",x=["grafana-investigations-app","grafana-assistant-app","grafana-dash-app","grafana-grafanadocsplugin-app","grafana-pathfinder-app"],m=(0,n.createContext)({isOpen:!1,dockedComponentId:void 0,setDockedComponentId:()=>{},availableComponents:new Map,extensionSidebarWidth:s.yq,setExtensionSidebarWidth:()=>{}});function p(){return(0,n.useContext)(m)}const y=({children:D})=>{const[P,C]=(0,n.useState)(void 0),S=c.M.get(g),[R,L]=(0,a.A)(v,s.yq),[j,N]=(0,n.useState)(o.Ny.getLocation().pathname);(0,n.useEffect)(()=>{const G=o.Ny.getLocationObservable().subscribe(F=>{N(F.pathname)});return()=>{G.unsubscribe()}},[]);const{links:V,isLoading:w}=(0,f.U)({extensionPointId:r.SM.ExtensionSidebar,context:{path:j}}),M=(0,n.useMemo)(()=>new Map(Array.from((0,h.UX)(r.SM.ExtensionSidebar).entries()).filter(([G,F])=>x.includes(G)&&V.some(W=>W.pluginId===G&&F.addedComponents.some(H=>H.title===W.title)))),[V]);let O;S&&b(S)&&(O=S);const[U,K]=(0,n.useState)(O);(0,n.useEffect)(()=>{if(!w&&U){const G=b(U);if(G){const F=M.get(G.pluginId);(!F||!F.addedComponents.some(W=>W.title===G.componentTitle))&&K(void 0)}else K(void 0)}},[w,M,U]);const z=(0,n.useCallback)((G,F)=>{C(F),K(G)},[K]);return(0,n.useEffect)(()=>{const G=Z=>{Z.payload.pluginId&&Z.payload.componentTitle&&x.includes(Z.payload.pluginId)&&M.get(Z.payload.pluginId)?.addedComponents.some(se=>se.title===Z.payload.componentTitle)&&z(JSON.stringify({pluginId:Z.payload.pluginId,componentTitle:Z.payload.componentTitle}),Z.payload.props)},F=()=>{K(void 0)},W=Z=>{const se=b(U??"");se?.pluginId===Z.payload.pluginId&&se?.componentTitle===Z.payload.componentTitle?F():G(Z)},H=(0,l.J7)().subscribe(d.Am,G),Y=(0,l.J7)().subscribe(d.KU,F),te=(0,l.J7)().subscribe(d._d,W);return()=>{H.unsubscribe(),Y.unsubscribe(),te.unsubscribe()}},[z,M,U]),(0,n.useEffect)(()=>{if(w)return;const G=b(U??""),F=c.M.get(g),W=b(F??""),H=U!==void 0;(H||W)&&(0,i.rR)("grafana_extension_sidebar_changed",{opened:H,componentTitle:(H?G:W)?.componentTitle,pluginId:(H?G:W)?.pluginId,fromLocalstorage:F===U}),U?c.M.set(g,U):c.M.delete(g)},[U,w]),(0,t.jsx)(m.Provider,{value:{isOpen:U!==void 0,dockedComponentId:U,setDockedComponentId:G=>z(G,void 0),availableComponents:M,extensionSidebarWidth:Math.min(R??s.yq,s.T0),setExtensionSidebarWidth:L,props:P},children:D})};function E(D,P){return JSON.stringify({pluginId:D,componentTitle:P})}function b(D){try{const P=JSON.parse(D);return typeof P=="object"&&P!==null&&"pluginId"in P&&"componentTitle"in P&&typeof P.pluginId=="string"&&typeof P.componentTitle=="string"?P:void 0}catch{return}}function u(D){if(D.has("grafana-pathfinder-app"))return"grafana-pathfinder-app";if(D.has("grafana-grafanadocsplugin-app"))return"grafana-grafanadocsplugin-app"}},89409(ne,A,e){"use strict";e.d(A,{t3:()=>D,iL:()=>P,fn:()=>C});var t=e(74848),n=e(22803),a=e(92745),c=e(63142),r=e(41654),i=e(7895),o=e(76319),l=e(27963),f=e(92948),h=e(96540),d=e(36490),s=e(66404),g=e(15130),v=e(93922),x=e(52763),m=e(18857),p=e(30703);function y({orgs:R,onSelectChange:L}){const j=(0,c.of)(E),{orgId:N}=g.TP.user,V=(0,h.useMemo)(()=>R.map(K=>({label:K.name,description:K.role,value:K})),[R]),w=(0,h.useMemo)(()=>V.find(K=>K.value.orgId===N),[V,N]),[M,O]=(0,h.useState)(()=>w),U=K=>{O(K),L(K)};return(0,t.jsx)(m.l6,{"aria-label":(0,a.t)("navigation.org-switcher.aria-label","Change organization"),width:"auto",value:M,prefix:(0,t.jsx)(p.I,{className:"prefix-icon",name:"building"}),className:j.select,options:V,onChange:U})}const E=R=>({select:(0,n.css)({border:"none",background:"none",color:R.colors.text.secondary,"&:hover":{color:R.colors.text.primary,"& .prefix-icon":(0,n.css)({color:R.colors.text.primary})}})});function b(){const R=(0,x.wA)(),L=(0,x.d4)(N=>N.organization.userOrgs),j=N=>{N.value&&((0,v.bA)(N.value.orgId),d.Ny.push(`/?orgId=${N.value.orgId}`),window.location.reload())};return(0,h.useEffect)(()=>{g.TP.isSignedIn&&!(g.TP.user.authenticatedBy==="apikey"||g.TP.user.authenticatedBy==="render")&&R((0,v.wV)())},[R]),L?.length<=1?(0,t.jsx)(s.E,{truncate:!0,children:f.M.AppTitle}):(0,t.jsx)(y,{orgs:L,onSelectChange:j})}var u=e(31937);const D="dock-menu-button",P="mega-menu-header-toggle";function C({handleMegaMenu:R,handleDockedMenu:L,onClose:j}){const N=(0,c.$j)(),{chrome:V}=(0,l.Il)(),w=V.useState(),M=S(N);return(0,t.jsxs)("div",{className:M.header,children:[(0,t.jsxs)(r.B,{alignItems:"center",minWidth:0,gap:.25,children:[(0,t.jsx)(i.I,{narrow:!0,id:P,onClick:R,tooltip:(0,a.t)("navigation.megamenu.close","Close menu"),children:(0,t.jsx)(f.M.MenuLogo,{className:M.img})}),(0,t.jsx)(b,{})]}),(0,t.jsx)(o.K,{id:D,className:M.dockMenuButton,tooltip:w.megaMenuDocked?(0,a.t)("navigation.megamenu.undock","Undock menu"):(0,a.t)("navigation.megamenu.dock","Dock menu"),name:"web-section-alt",onClick:L,variant:"secondary"}),(0,t.jsx)(o.K,{className:M.mobileCloseButton,tooltip:(0,a.t)("navigation.megamenu.close","Close menu"),name:"times",onClick:j,size:"xl",variant:"secondary"})]})}C.displayName="MegaMenuHeader";const S=R=>({dockMenuButton:(0,n.css)({display:"none",[R.breakpoints.up("xl")]:{display:"inline-flex"}}),header:(0,n.css)({alignItems:"center",borderBottom:`1px solid ${R.colors.border.weak}`,display:"flex",gap:R.spacing(1),justifyContent:"space-between",padding:R.spacing(0,1,0,.75),height:(0,u.vn)(),flexShrink:0}),img:(0,n.css)({alignSelf:"center",height:R.spacing(3),width:R.spacing(3)}),mobileCloseButton:(0,n.css)({[R.breakpoints.up("md")]:{display:"none"}})})},5071(ne,A,e){"use strict";e.d(A,{s:()=>r});var t=e(96540),n=e(47925),a=e(43173),c=e(15130);const r=()=>{const i=(0,n.Pj)(void 0,{skip:!c.TP.user.isSignedIn}),o=(0,t.useMemo)(()=>i.data?.navbar?.bookmarkUrls||[],[i]);return a.$.featureToggles.pinNavItems?o:[]}},30362(ne,A,e){"use strict";e.d(A,{A6:()=>m,J0:()=>v,Vp:()=>g,Wk:()=>y,m0:()=>x,n0:()=>E});var t=e(96540),n=e(92745),a=e(43173),c=e(27489),r=e(95943),i=e(43550),o=e(87745),l=e(45229),f=e(10388),h=e(47981),d=e(89409);const s=()=>{l.A.publish(new o.S8({component:h.N}))},g=b=>{let u=b.children||[];return b.id!=="help"?b:{...b,subTitle:a.$.buildInfo.versionString,children:[...u,...(0,f.Dd)(),...p(),{id:"keyboard-shortcuts",text:(0,n.t)("nav.help/keyboard-shortcuts","Keyboard shortcuts"),icon:"keyboard",onClick:s}]}},v=(b,u,D=!1)=>{const P={...b},C=P.onClick;let S;return P.isNew?S="item":D&&(S="ancestor"),P.onClick=()=>{(0,c.rR)("grafana_navigation_item_clicked",{path:P.url??P.id,menuIsDocked:u,itemIsBookmarked:!!(a.$.featureToggles.pinNavItems&&P?.parentItem?.id==="bookmarks"),bookmarkToggleOn:!!a.$.featureToggles.pinNavItems,isNew:S}),C?.()},P.children&&(P.children=P.children.map(R=>v(R,u,S!==void 0))),P},x=(b,u)=>!!b.children?.some(D=>D===u?!0:x(D,u)),m=(b,u,D)=>{const{id:P,parentItem:C}=u;if(D==="/")return b.find(R=>R.id===i.Id);if(u.id==="profile")return;for(const R of b){const L=!!(R.id&&R.id===P),j=R.text===u.text&&R.url===u.url;if(L||j)return R;if(R.children){const N=m(R.children,u);if(N)return N}}const S=b[0]?.parentItem?.id==="bookmarks";if(C&&!S)return m(b,C)};function p(){const{buildInfo:b,licenseInfo:u}=a.$,D=u.stateInfo?` (${u.stateInfo})`:"",P=[];return P.push({target:"_blank",id:"version",text:`${b.edition}${D}`,url:u.licenseUrl,icon:"external-link-alt"}),b.hasUpdate&&P.push({target:"_blank",id:"updateVersion",text:"New version available!",icon:"download-alt",url:"https://grafana.com/grafana/download?utm_source=grafana_footer"}),P}function y(b,u){for(const D of b){if(D.url===u)return D;if(D.children?.length){const P=y(D.children,u);if(P)return P}}return null}function E(b,u){(0,t.useEffect)(()=>{b?document.getElementById(d.iL)?.focus():document.getElementById(r.Ut)?.focus()},[b]),(0,t.useEffect)(()=>{u?document.getElementById(d.t3)?.focus():document.getElementById(r.Ut)?.focus()},[u])}},5423(ne,A,e){"use strict";e.d(A,{K:()=>c});var t=e(74848),n=e(22803),a=e(63142);function c({className:i,leftActionsSeparator:o}){const l=(0,a.of)(r);return o?(0,t.jsx)("div",{className:(0,n.cx)(i,l.leftActionsSeparator)}):(0,t.jsx)("div",{className:(0,n.cx)(i,l.line)})}const r=i=>({leftActionsSeparator:(0,n.css)({display:"flex",flexGrow:1}),line:(0,n.css)({width:1,backgroundColor:i.colors.border.medium,height:24,flexShrink:0,flexGrow:0,[i.breakpoints.down("sm")]:{display:"none"}})})},31937(ne,A,e){"use strict";e.d(A,{UH:()=>o,k9:()=>f,vn:()=>h});var t=e(96540),n=e(43173),a=e(69896),c=e(27963),r=e(51702),i=e(58449);function o(){const{chrome:d}=(0,c.Il)(),s=d.state.getValue(),g=(0,a.b)(),v=(0,r.i)("xl"),[x,m]=(0,t.useState)(l(s,g?.state.enabled,v));return(0,t.useEffect)(()=>{const p=d.state.subscribe(y=>{const E=l(y,g?.state.enabled,v);E!==x&&m(E)});return()=>p.unsubscribe()},[d,x,g,v]),x}function l(d,s=!1,g){return d.kioskMode||d.chromeless?0:s?2:d.actions?d.megaMenuDocked||!n.$.featureToggles.dashboardScene?2:g&&n.$.featureToggles.unifiedNavbars?1:2:1}function f(){const d=o(),{isOpen:s}=(0,i.sA)();return s?0:d*h()}function h(){return 40}},92948(ne,A,e){"use strict";e.d(A,{M:()=>s});var t=e(74848),n=e(22803),a=e(6773),c=e(63142),r=e(11701),i=e(53459),o=e(42581);const l=({className:g,logo:v})=>(0,t.jsx)("img",{className:g,src:`${v||o}`,alt:"Grafana"}),f=({className:g,children:v})=>{const x=(0,c.$j)(),m=(0,n.css)({"&:before":{content:'""',position:"fixed",left:0,right:0,bottom:0,top:0,background:`url(${x.isDark?r:i})`,backgroundPosition:"top center",backgroundSize:"auto",backgroundRepeat:"no-repeat",opacity:0,[x.transitions.handleMotion("no-preference","reduce")]:{transition:"opacity 3s ease-in-out"},[x.breakpoints.up("md")]:{backgroundPosition:"center",backgroundSize:"cover"}}});return(0,t.jsx)("div",{className:(0,n.cx)(m,g),children:v})},h=({className:g})=>(0,t.jsx)("img",{className:g,src:o,alt:"Grafana"}),d=()=>{const g=(0,c.$j)();return(0,n.css)({background:a.MV.alpha(g.colors.background.primary,.7),backgroundSize:"cover"})};class s{static{this.LoginLogo=l}static{this.LoginBackground=f}static{this.MenuLogo=h}static{this.LoginBoxBackground=d}static{this.AppTitle="Grafana"}static{this.LoginTitle="Welcome to Grafana"}static{this.HideEdition=!1}static{this.GetLoginSubTitle=()=>null}}},18607(ne,A,e){"use strict";e.d(A,{Z:()=>t});function t(n,a,c,r){const i=[];let o=!1,l;function f(h,d=!1){if(o)return;const s=h.url?.split("?")??["",""];let g=s[0];const v=new URLSearchParams(s[1]);if(v.has("editview")&&(g+=`?editview=${v.get("editview")}`),c&&g===c.url){r||i.unshift({text:c.text,href:h.url??""}),o=!0;return}const x=g.length>0&&l===g;if(l=g,!h.hideFromBreadcrumbs&&!(d&&x)){const p=h.children?.findIndex(y=>y.active)??-1;if(p>0){const y=h.children?.[p];y&&i.unshift({text:y.text,href:y.url??""})}i.unshift({text:h.text,href:h.url??""})}h.parentItem&&f(h.parentItem)}return a&&f(a),f(n,!0),i}},15840(ne,A,e){"use strict";e.d(A,{J:()=>i});var t=e(74848),n=e(22803),a=e(92745),c=e(76319),r=e(63142);const i=({onClick:l,"aria-label":f,style:h})=>{const d=(0,r.of)(o);return(0,t.jsx)(c.K,{"aria-label":f??"Close",className:d,name:"times",onClick:l,style:h,tooltip:(0,a.t)("close-button.tooltip","Close")})},o=l=>(0,n.css)({position:"absolute",right:l.spacing(.5),top:l.spacing(1)})},10388(ne,A,e){"use strict";e.d(A,{Dd:()=>l,wi:()=>s});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(43173),i=e(30703),o=e(63142);let l=()=>[{target:"_blank",id:"documentation",text:(0,c.t)("nav.help/documentation","Documentation"),icon:"document-info",url:"https://grafana.com/docs/grafana/latest/?utm_source=grafana_footer"},{target:"_blank",id:"support",text:(0,c.t)("nav.help/support","Support"),icon:"question-circle",url:"https://grafana.com/products/enterprise/?utm_source=grafana_footer"},{target:"_blank",id:"community",text:(0,c.t)("nav.help/community","Community"),icon:"comments-alt",url:"https://community.grafana.com/?utm_source=grafana_footer"}];function f(x){return{hasReleaseNotes:!0,isBeta:x.includes("-beta")}}function h(x){const{buildInfo:m,licenseInfo:p}=r.$,y=[],E=p.stateInfo?` (${p.stateInfo})`:"";if(x||y.push({target:"_blank",id:"license",text:`${m.edition}${E}`,url:p.licenseUrl}),m.hideVersion)return y;const{hasReleaseNotes:b}=f(m.version);return y.push({target:"_blank",id:"version",text:m.versionString,url:b?"https://github.com/grafana/grafana/blob/main/CHANGELOG.md":void 0}),m.hasUpdate&&y.push({target:"_blank",id:"updateVersion",text:"New version available!",icon:"download-alt",url:"https://grafana.com/grafana/download?utm_source=grafana_footer"}),y}function d(x){l=x}const s=(0,a.memo)(({customLinks:x,hideEdition:m})=>{const p=(x||l()).concat(h(m)),y=(0,o.of)(v);return(0,t.jsx)("footer",{className:y.footer,children:(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("ul",{className:y.list,children:p.map((E,b)=>(0,t.jsx)("li",{className:y.listItem,children:(0,t.jsx)(g,{item:E})},b))})})})});s.displayName="Footer";function g({item:x}){const m=x.url?(0,t.jsx)("a",{href:x.url,target:x.target,rel:"noopener noreferrer",id:x.id,children:x.text}):x.text;return(0,t.jsxs)(t.Fragment,{children:[x.icon&&(0,t.jsx)(i.I,{name:x.icon})," ",m]})}const v=x=>({footer:(0,n.css)({...x.typography.bodySmall,color:x.colors.text.primary,display:"block",padding:x.spacing(2,0),position:"relative",width:"98%","a:hover":{color:x.colors.text.maxContrast,textDecoration:"underline"},[x.breakpoints.down("md")]:{display:"none"}}),list:(0,n.css)({listStyle:"none"}),listItem:(0,n.css)({display:"inline-block","&:after":{content:"' | '",padding:x.spacing(0,1)},"&:last-child:after":{content:"''",paddingLeft:0}})})},90666(ne,A,e){"use strict";e.d(A,{T:()=>r});var t=e(74848),n=e(22803),a=e(63142),c=e(43990);function r({children:o,spacing:l,level:f}){const h=(0,a.of)(i,l,f);return(0,t.jsx)("span",{className:(0,n.css)(h.indentor),children:o})}const i=(o,l,f)=>({indentor:(0,n.css)((0,c.Y)(o,l,h=>({paddingLeft:o.spacing(h*f)})))})},94076(ne,A,e){"use strict";e.d(A,{A:()=>n,X:()=>a});var t=e(96540);function n({children:c,onSetScrollRef:r,divId:i}){const o=(0,t.useRef)(null);return(0,t.useEffect)(()=>{r&&r(new a(document.documentElement))},[o,r]),c}class a{constructor(r){this.element=r}get scrollTop(){return this.element.scrollTop}scrollTo(r,i,o=0){if(!(this.element.scrollHeight-this.element.clientHeight-i>=0)&&o<10){requestAnimationFrame(()=>this.scrollTo(r,i,o+1));return}this.element.scrollTo(r,i)}}},21234(ne,A,e){"use strict";e.d(A,{I:()=>r});var t=e(74848),n=e(22803),a=e(8073),c=e(63142);function r({description:o,text:l,url:f}){const h=(0,c.of)(i);return(0,t.jsxs)(a.Z,{noMargin:!0,className:h.card,href:f,children:[(0,t.jsx)(a.Z.Heading,{children:l}),(0,t.jsx)(a.Z.Description,{className:h.description,children:o})]})}const i=o=>({card:(0,n.css)({gridTemplateRows:"1fr 0 2fr"}),description:(0,n.css)({WebkitLineClamp:3,WebkitBoxOrient:"vertical",display:"-webkit-box",overflow:"hidden"})})},82151(ne,A,e){"use strict";e.d(A,{b:()=>h});var t=e(74848),n=e(96540),a=e(92745),c=e(41654),r=e(99887),i=e(75735),o=e(55266),l=e(27321),f=e(45942);const h=(0,n.memo)(function({folder:g}){const v=(0,l.F)(),x=d(g,v),{isReadOnlyRepo:m,repoType:p}=(0,o.T)({folderName:x?void 0:g?.uid,skipQuery:x});return x?null:(0,t.jsxs)(c.B,{direction:"row",alignItems:"stretch",children:[m&&(0,t.jsx)(r.E,{color:"darkgrey",text:(0,a.t)("folder-repo.read-only-badge","Read only"),tooltip:(0,f.Te)({isLocal:p==="local"})}),(0,t.jsx)(r.E,{title:(0,a.t)("folder-repo.provisioned-badge","Provisioned"),color:"purple",icon:"exchange-alt",tooltip:(0,a.t)("folder-repo.provisioned-badge","Provisioned")})]})});function d(s,g){const v=s&&!!("parentUID"in s&&s.parentUID),x=s&&s.managedBy!==i.Sf.Repo;return!s||v||x||g}},62769(ne,A,e){"use strict";e.d(A,{NestedFolderPicker:()=>be});var t=e(74848),n=e(22803),a=e(34743),c=e(83505),r=e(46885),i=e(76459),o=e.n(i),l=e(96540),f=e(92745),h=e(63142),d=e(76373),s=e(41654),g=e(66404),v=e(63527),x=e(30703),m=e(34999),p=e(47327),y=e(62779),E=e(47797),b=e(55860),u=e(93854),D=e(82151),P=e(70255),C=e(97222),S=e(10022),R=e(76319),L=e(90666),j=e(80231),N=e(52763),V=e(31286);function w({folder:Ne}){return(0,t.jsx)(V.a,{marginLeft:1,children:(0,t.jsxs)(g.E,{variant:"bodySmall",color:"secondary",truncate:!0,children:["/",Ne]})})}const M=(0,l.memo)(function({item:Ie}){if(Ie.item.kind!=="folder")return null;if(Ie.item.parentTitle)return(0,t.jsx)(w,{folder:Ie.item.parentTitle});const ke=Ie.item.parentUID||Ie.parentUID;return ke?(0,t.jsx)(O,{uid:ke}):null});function O({uid:Ne}){const Ie=(0,y.u$)(Ne);return Ie.isLoading?(0,t.jsx)(P.A,{width:50}):Ie.data?(0,t.jsx)(w,{folder:Ie.data.title}):null}const U=40,K="md",z=(Ne,Ie)=>`${Ne}-${Ie||"root"}`;function G({items:Ne,focusedItemIndex:Ie,foldersAreOpenable:ke,idPrefix:Ee,selectedFolder:Ae,onFolderExpand:$e,onFolderSelect:Fe,isItemLoaded:We,requestLoadMore:Ge,emptyFolders:me}){const De=(0,l.useRef)(null),xe=(0,h.of)(H),Me=(0,l.useMemo)(()=>({items:Ne,focusedItemIndex:Ie,foldersAreOpenable:ke,selectedFolder:Ae,onFolderExpand:$e,onFolderSelect:Fe,idPrefix:Ee,emptyFolders:me}),[Ne,Ie,ke,Ae,$e,Fe,Ee,me]),Be=(0,l.useCallback)(Re=>We(Re),[We]),Oe=(0,l.useCallback)((Re,we)=>{const{parentUID:Ce}=Ne[Re];Ge(Ce)},[Ge,Ne]);return(0,t.jsx)("div",{className:xe.table,role:"tree",children:Ne.length>0?(0,t.jsx)(S.A,{ref:De,itemCount:Ne.length,isItemLoaded:Be,loadMoreItems:Oe,children:({onItemsRendered:Re,ref:we})=>(0,t.jsx)(C.Y1,{ref:we,height:U*Math.min(6.5,Ne.length),width:"100%",itemData:Me,itemSize:U,itemCount:Ne.length,onItemsRendered:Re,children:W})}):(0,t.jsx)("div",{className:xe.emptyMessage,children:(0,t.jsx)(f.x6,{i18nKey:"browse-dashboards.folder-picker.empty-message",children:"No folders found"})})})}const F=[100,200,130,160,150];function W({index:Ne,style:Ie,data:ke}){const{items:Ee,focusedItemIndex:Ae,foldersAreOpenable:$e,selectedFolder:Fe,onFolderExpand:We,onFolderSelect:Ge,idPrefix:me,emptyFolders:De}=ke,{item:xe,isOpen:Me,level:Be,parentUID:Oe}=Ee[Ne],Re=(0,l.useRef)(null),we=(0,l.useId)(),Ce=(0,N.d4)(j.ku),_e=(0,N.d4)(j.Am),Je=(xe.uid?_e[xe.uid]:Ce)?.items??[];let et=[];xe.uid&&(et=(Oe?_e[Oe]:Ce)?.items??[]);const qe=(0,h.of)(H),nt=(0,l.useCallback)(at=>{at.preventDefault(),at.stopPropagation(),xe.uid&&We(xe.uid,!Me)},[xe.uid,Me,We]),ot=(0,l.useCallback)(()=>{xe.kind==="folder"&&Ge(xe)},[xe,Ge]);if(xe.kind==="ui"&&xe.uiKind==="pagination-placeholder")return(0,t.jsxs)("span",{style:Ie,className:qe.row,children:[(0,t.jsx)(L.T,{level:Be,spacing:2}),(0,t.jsx)(P.A,{width:F[Ne%F.length]})]});if(xe.kind!=="folder"){const at=xe.kind,it=xe.uid;return null}const Ze=Be===0&&xe.parentUID!==void 0;return(0,t.jsx)("div",{ref:Re,style:Ie,className:(0,n.cx)(qe.row,{[qe.rowFocused]:Ne===Ae,[qe.rowSelected]:xe.uid===Fe}),tabIndex:-1,onClick:ot,"aria-expanded":Me,"aria-selected":xe.uid===Fe,"aria-labelledby":we,"aria-level":Be+1,role:"treeitem","aria-owns":Je.length>0?Je.map(at=>z(me,at.uid)).join(" "):void 0,"aria-setsize":Je.length,"aria-posinset":et.findIndex(at=>at.uid===xe.uid)+1,id:z(me,xe.uid),children:(0,t.jsxs)("div",{className:qe.rowBody,children:[(0,t.jsx)(L.T,{level:Be,spacing:2}),$e&&!De.has(xe.uid)?(0,t.jsx)(R.K,{size:K,onMouseDown:nt,onClick:at=>{at.preventDefault(),at.stopPropagation()},tabIndex:-1,"aria-label":Me?`Collapse folder ${xe.title}`:`Expand folder ${xe.title}`,name:Me?"angle-down":"angle-right"}):(0,t.jsx)("span",{className:qe.folderButtonSpacer}),(0,t.jsxs)("label",{className:qe.label,id:we,children:[(0,t.jsx)(g.E,{truncate:!0,children:xe.title}),(0,t.jsx)(D.b,{folder:xe})]}),Ze&&(0,t.jsx)(M,{item:Ee[Ne]})]})})}const H=Ne=>{const Ie=(0,n.css)({height:U,display:"flex",position:"relative",alignItems:"center",flexGrow:1,gap:Ne.spacing(.5),overflow:"hidden",padding:Ne.spacing(0,1)});return{table:(0,n.css)({background:Ne.components.input.background}),emptyMessage:(0,n.css)({padding:Ne.spacing(1),textAlign:"center",width:"100%"}),folderButtonSpacer:(0,n.css)({paddingLeft:Ne.spacing(2.5)}),row:(0,n.css)({display:"flex",position:"relative",alignItems:"center",":not(:first-child)":{borderTop:`solid 1px ${Ne.colors.border.weak}`}}),rowFocused:(0,n.css)({backgroundColor:Ne.colors.background.secondary}),rowSelected:(0,n.css)({"&::before":{display:"block",content:'""',position:"absolute",left:0,bottom:0,top:0,width:4,borderRadius:Ne.shape.radius.default,backgroundImage:Ne.colors.gradients.brandVertical}}),rowBody:Ie,label:(0,n.css)({display:"flex",alignItems:"center",gap:Ne.spacing(1),lineHeight:U+"px",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{textDecoration:"underline",cursor:"pointer"}})}};var Y=e(35484),te=e(35222);function Z({handleClearSelection:Ne,isLoading:Ie,invalid:ke,label:Ee,...Ae},$e){const Fe=(0,h.$j)(),We=ae(Fe,ke),Ge=me=>{(me.key==="Enter"||me.key===" ")&&Ne?.(me)};return Ie?(0,t.jsx)(te.A,{}):(0,t.jsx)("div",{className:We.wrapper,children:(0,t.jsxs)("div",{className:We.inputWrapper,children:[Ee?(0,t.jsx)("div",{className:We.prefix,children:(0,t.jsx)(x.I,{name:"folder"})}):void 0,(0,t.jsxs)("button",{type:"button",className:(0,n.cx)(We.fakeInput,Ee?We.hasPrefix:void 0),...Ae,ref:$e,children:[Ee?(0,t.jsx)(g.E,{truncate:!0,children:Ee}):(0,t.jsx)(g.E,{truncate:!0,color:"secondary",children:(0,t.jsx)(f.x6,{i18nKey:"browse-dashboards.folder-picker.button-label",children:"Select folder"})}),!Ie&&Ne&&(0,t.jsx)(x.I,{role:"button",tabIndex:0,"aria-label":(0,f.t)("browse-dashboards.folder-picker.clear-selection","Clear selection"),className:We.clearIcon,name:"times",onClick:Ne,onKeyDown:Ge})]}),(0,t.jsx)("div",{className:We.suffix,children:(0,t.jsx)(x.I,{name:"angle-down"})})]})})}const se=(0,l.forwardRef)(Z),ae=(Ne,Ie=!1)=>{const ke=(0,v.n)({theme:Ne,invalid:Ie});return{wrapper:ke.wrapper,inputWrapper:ke.inputWrapper,prefix:(0,n.css)([ke.prefix,{pointerEvents:"none",color:Ne.colors.text.primary}]),suffix:(0,n.css)([ke.suffix,{pointerEvents:"none"}]),fakeInput:(0,n.css)([ke.input,{textAlign:"left",letterSpacing:"normal","&:focus":{outline:"unset",boxShadow:"unset"},"&:focus-visible":(0,Y.getFocusStyles)(Ne),alignItems:"center",display:"flex",flexWrap:"nowrap",justifyContent:"space-between",paddingRight:28}]),hasPrefix:(0,n.css)({paddingLeft:28}),clearIcon:(0,n.css)({color:Ne.colors.text.secondary,cursor:"pointer","&:hover":{color:Ne.colors.text.primary},"&:focus:not(:focus-visible)":(0,Y.getMouseFocusStyles)(Ne),"&:focus-visible":(0,Y.getFocusStyles)(Ne)})}};var J=e(43173),k=e(25508),_=e(10378),Q=e(60793);const q=Q.qR.enhanceEndpoints({}),{useGetSearchQuery:oe}=q;var re=e(27044),ee=e(78034),B=e(34624);const ie="general",de=new Intl.Collator;function fe({isBrowsing:Ne,openFolders:Ie,rootFolderUID:ke,rootFolderItem:Ee}){const Ae=(0,N.wA)(),$e=(0,l.useRef)([]),[Fe,We]=(0,l.useState)(new Set),[Ge,me]=(0,l.useState)([]),De=(0,l.useMemo)(()=>(0,k.Mz)(Ge,(...Oe)=>{let Re=!1;const we={};for(const Ce of Oe){Ce.status===_.RE.pending&&(Re=!0);const _e=Ce.originalArgs?.folder;_e&&(we[_e]=Ce)}return{isLoading:Re,responseByParent:we}}),[Ge]),xe=(0,N.d4)(De),Me=(0,l.useCallback)(Oe=>{const Re=Oe??ie;if(xe.responseByParent[Re]?.status===_.RE.pending)return;const _e={folder:Re,type:"folder"},Je=Ae(q.endpoints.getSearch.initiate(_e)),et=q.endpoints.getSearch.select(_e);me(qe=>qe.concat(et)),$e.current=$e.current.concat([Je])},[xe,Ae]);(0,l.useEffect)(()=>()=>{for(const Oe of $e.current)Oe.unsubscribe()},[]);const Be=(0,l.useMemo)(()=>{if(!Ne)return[];function Oe(Ce,_e,Je){let et=_e?.data?.hits?[..._e.data.hits]:[];et.sort((nt,ot)=>de.compare(nt.title,ot.title));const qe=et.flatMap(nt=>{const ot=nt.name,Ze=Ie[ot],at={isOpen:!!Ze,level:Je,item:{kind:"folder",title:nt.title,uid:ot,managedBy:nt.managedBy?.kind,parentUID:nt.folder}},it=Ze&&xe.responseByParent[ot];if(it){it.data&&it.status!==_.RE.pending&&it.data.hits.length===0&&We(xt=>new Set(xt).add(ot));const ct=Oe(ot,it,Je+1);return[at,...ct]}return at});return _e||qe.push(...(0,ee.T)(re.md,Ce,Je)),qe}const Re=ke??ie,we=Oe(Re,xe.responseByParent[Re],1);return we.unshift(Ee||(0,B.K)()),we},[xe,Ne,Ie,ke,Ee]);return{emptyFolders:Fe,items:Be,isLoading:xe.isLoading,requestNextPage:Me}}var ce=e(15203);const ve="pending";function Se(Ne){const Ie=Ne.at(-1),ke=Ie?.originalArgs?.page,Ee=Ie?.status===ve;return Ie?.data?[Ie.data.length(0,k.Mz)(me,(...Re)=>{let we=!1;const Ce=[],_e={};for(const Je of Re){Je.status===ve&&(we=!0);const et=Je.originalArgs?.parentUid;et?(_e[et]||(_e[et]=[]),_e[et].push(Je)):Ce.push(Je)}return{isLoading:we,rootPages:Ce,pagesByParent:_e}}),[me]),Me=(0,N.d4)(xe),Be=(0,l.useCallback)(Re=>{const we=Re?Me.pagesByParent[Re]:Me.rootPages,[Ce,_e,Je]=Se(we??[]);if(Ce||Je)return;const et={parentUid:Re,page:(_e??0)+1,limit:re.md,permission:ke},qe=$e(ce.cU.endpoints.listFolders.initiate(et)),nt=ce.cU.endpoints.listFolders.select({parentUid:qe.arg.parentUid,page:qe.arg.page,limit:qe.arg.limit,permission:qe.arg.permission});De(ot=>ot.concat(nt)),Fe.current=Fe.current.concat([qe])},[Me,$e,ke]);(0,l.useEffect)(()=>()=>{for(const Re of Fe.current)Re.unsubscribe()},[]);const Oe=(0,l.useMemo)(()=>{if(!Ne)return[];function Re(_e,Je,et){const qe=Je.flatMap(ot=>(ot.data??[]).flatMap(at=>{const it=Ie[at.uid],ct={isOpen:!!it,level:et,item:{kind:"folder",title:at.title,uid:at.uid,managedBy:at.managedBy,parentUID:at.parentUid}},xt=it&&Me.pagesByParent[at.uid];if(xt){const dt=Re(at.uid,xt,et+1);return xt[0]&&xt[0].status!==ve&&dt.length===0&&Ge(vt=>new Set(vt).add(at.uid)),[ct,...dt]}return ct})),[nt]=Se(Je);return nt||qe.push(...(0,ee.T)(re.md,_e,et)),qe}const we=Ee?Me.pagesByParent[Ee]:Me.rootPages,Ce=Re(Ee??void 0,we??[],1);return Ce.unshift(Ae||(0,B.K)()),Ce},[Me,Ne,Ie,Ee,Ae]);return{emptyFolders:We,items:Oe,isLoading:Me.isLoading,requestNextPage:Be}}function Ve({isBrowsing:Ne,openFolders:Ie,permission:ke,rootFolderUID:Ee,rootFolderItem:Ae}){const $e=je({isBrowsing:Ne,openFolders:Ie,permission:ke,rootFolderUID:Ee,rootFolderItem:Ae}),Fe=fe({isBrowsing:Ne,openFolders:Ie,rootFolderUID:Ee,rootFolderItem:Ae});return J.$.featureToggles.foldersAppPlatformAPI?Fe:$e}function he({tree:Ne,handleCloseOverlay:Ie,handleFolderSelect:ke,handleFolderExpand:Ee,idPrefix:Ae,search:$e,visible:Fe}){const[We,Ge]=(0,l.useState)(-1);(0,l.useEffect)(()=>{Fe&&Ge(-1)},[Fe]),(0,l.useEffect)(()=>{Ge(0)},[$e]),(0,l.useEffect)(()=>{document.getElementById(z(Ae,Ne[We]?.item.uid))?.scrollIntoView({block:"nearest",inline:"nearest"})},[We,Ae,Ne]);const me=(0,l.useCallback)(De=>{const xe=!$e;switch(De.key){case"ArrowRight":case"ArrowLeft":xe&&(De.preventDefault(),Ee(Ne[We].item.uid,De.key==="ArrowRight"));break;case"ArrowUp":We>0&&(De.preventDefault(),Ge(We-1));break;case"ArrowDown":We(0,u.hI)(Ae,ke.view));return{...ke,items:Ee}}function be({value:Ne,invalid:Ie,showRootFolder:ke=!0,clearable:Ee=!1,excludeUIDs:Ae,rootFolderUID:$e,rootFolderItem:Fe,permission:We="edit",onChange:Ge,id:me}){const De=(0,h.of)(ze),xe=(0,y.u$)(Ne),Me=(0,E.do)(xe.error)===403,[Be,Oe]=(0,l.useState)(""),[Re,we]=(0,l.useState)(null),[Ce,_e]=(0,l.useState)(!1),[Je,et]=(0,l.useState)(!1),[qe,nt]=(0,l.useState)(!1),[ot,Ze]=(0,l.useState)({}),at=(0,l.useId)(),[it]=(0,l.useState)(void 0),ct=(0,l.useRef)(0),xt=!!(qe&&!(Be&&Re)),{emptyFolders:dt,items:vt,isLoading:wt,requestNextPage:$t}=Ve({isBrowsing:xt,openFolders:ot,permission:We,rootFolderUID:$e,rootFolderItem:Fe});(0,l.useEffect)(()=>{if(!Be){we(null);return}const Zn=Date.now();_e(!0),Ue(Be,We).then(Gn=>{if(Zn>ct.current){const sa=Gn.view.map(pa=>(0,u.hI)(pa,Gn.view));we({...Gn,items:sa}),_e(!1),ct.current=Zn}})},[Be,We]);const _t=[(0,a.UU)({crossAxis:!1,boundary:document.getElementById(d.BOUNDARY_ELEMENT_ID)??void 0})],{context:tn,refs:gt,floatingStyles:Wt,elements:Xt}=(0,c.we)({open:qe,placement:"bottom",onOpenChange:Zn=>{Zn&&(Oe(""),et(!0)),nt(Zn)},middleware:_t,whileElementsMounted:r.ll}),dn=(0,c.kp)(tn),rt=(0,c.s9)(tn),{getReferenceProps:pt,getFloatingProps:mt}=(0,c.bv)([rt,dn]),Ct=(0,l.useCallback)(async(Zn,Gn)=>{Ze(sa=>({...sa,[Zn]:Gn})),Gn&&!ot[Zn]&&$t(Zn)},[$t,ot]),Ye=(0,l.useCallback)(Zn=>{Ge&&Ge(Zn.uid,Zn.title),nt(!1)},[Ge]),Dt=(0,l.useCallback)(Zn=>{Zn.preventDefault(),Zn.stopPropagation(),Ge&&Ge(void 0,void 0)},[Ge]),Lt=(0,l.useCallback)(()=>nt(!1),[nt]),Gt=(0,l.useCallback)(Zn=>{Be||$t(Zn)},[Be,$t]),qt=(0,l.useMemo)(()=>{let Zn=[];return xt?Zn=vt:Zn=Re?.items.map(Gn=>({isOpen:!1,level:0,item:{kind:"folder",title:Gn.title,uid:Gn.uid,parentUID:Gn.parentUID,parentTitle:Gn.parentTitle}}))??[],(!ke||Ae?.length)&&(Zn=Zn.filter(Gn=>!(!ke&&Gn.item.uid===(0,B.K)().item.uid||Ae?.includes(Gn.item.uid)))),Zn},[vt,Ae,xt,Re?.items,ke]),on=(0,l.useCallback)(Zn=>{const Gn=qt[Zn];if(!Gn)return!1;const sa=Gn.item;return!(sa.kind==="ui"&&sa.uiKind==="pagination-placeholder")},[qt]),Pn=wt||Ce,{focusedItemIndex:Sn,handleKeyDown:oa}=he({tree:qt,handleCloseOverlay:Lt,handleFolderSelect:Ye,handleFolderExpand:Ct,idPrefix:at,search:Be,visible:qe});let la=xe.data?.title;Ne===""&&(la=(0,f.t)("browse-dashboards.folder-picker.root-title","Dashboards"));const ca=la?(0,t.jsxs)(s.B,{alignItems:"center",children:[(0,t.jsx)(g.E,{truncate:!0,children:la}),(0,t.jsx)(D.b,{folder:xe.data})]}):"";return qe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.p,{ref:gt.setReference,autoFocus:!0,prefix:la?(0,t.jsx)(x.I,{name:"folder"}):(0,t.jsx)(x.I,{name:"search"}),placeholder:la??(0,f.t)("browse-dashboards.folder-picker.search-placeholder","Search folders"),value:Be,invalid:Ie,className:De.search,onChange:Zn=>Oe(Zn.currentTarget.value),"aria-autocomplete":"list","aria-expanded":!0,"aria-haspopup":!0,"aria-controls":at,"aria-owns":at,"aria-activedescendant":z(at,qt[Sn]?.item.uid),role:"combobox",...pt(),onKeyDown:oa}),(0,t.jsx)("fieldset",{ref:gt.setFloating,id:at,className:De.tableWrapper,style:{...Wt,width:Xt.domReference?.clientWidth},...mt(),children:it?(0,t.jsx)(m.F,{className:De.error,severity:"warning",title:(0,f.t)("browse-dashboards.folder-picker.error-title","Error loading folders"),children:it.message||it.toString?.()||(0,f.t)("browse-dashboards.folder-picker.unknown-error","Unknown error")}):(0,t.jsxs)("div",{children:[Pn&&(0,t.jsx)("div",{className:De.loader,children:(0,t.jsx)(p.G,{width:600})}),(0,t.jsx)(G,{items:qt,selectedFolder:Ne,focusedItemIndex:Sn,onFolderExpand:Ct,onFolderSelect:Ye,idPrefix:at,foldersAreOpenable:!(Be&&Re),isItemLoaded:on,requestLoadMore:Gt,emptyFolders:dt})]})})]}):(0,t.jsx)(se,{id:me,label:ca,handleClearSelection:Ee&&Ne!==void 0?Dt:void 0,invalid:Ie,isLoading:xe.isLoading,autoFocus:Je,ref:gt.setReference,"aria-label":la?(0,f.t)("browse-dashboards.folder-picker.accessible-label","Select folder: {{ label }} currently selected",{label:la}):void 0,...pt(),disabled:Me})}const ze=Ne=>({button:(0,n.css)({maxWidth:"100%"}),error:(0,n.css)({marginBottom:0}),tableWrapper:(0,n.css)({boxShadow:Ne.shadows.z3,position:"relative",zIndex:Ne.zIndex.portal}),loader:(0,n.css)({position:"absolute",top:0,left:0,right:0,zIndex:Ne.zIndex.portal+1,overflow:"hidden"}),search:(0,n.css)({input:{cursor:"default"}})})},35222(ne,A,e){"use strict";e.d(A,{A:()=>i});var t=e(74848),n=e(22803),a=e(70255),c=e(63527),r=e(63142);function i(){const l=(0,r.of)(o);return(0,t.jsx)("div",{className:l.wrapper,children:(0,t.jsx)("div",{className:l.inputWrapper,children:(0,t.jsx)("button",{type:"button",className:l.fakeInput,"aria-disabled":!0,children:(0,t.jsx)(a.A,{width:100})})})})}const o=l=>{const f=(0,c.n)({theme:l});return{wrapper:f.wrapper,inputWrapper:f.inputWrapper,fakeInput:(0,n.css)([f.input,{textAlign:"left"}])}}},34624(ne,A,e){"use strict";e.d(A,{K:()=>n,P:()=>a});var t=e(92745);const n=()=>({isOpen:!0,level:0,item:{kind:"folder",title:(0,t.t)("browse-dashboards.folder-picker.root-title","Dashboards"),uid:""}}),a=({title:c,managedBy:r,uid:i})=>({isOpen:!0,level:0,item:{kind:"folder",title:c||"",uid:i||"",managedBy:r}})},19753(ne,A,e){"use strict";e.d(A,{Q:()=>o});var t=e(74848),n=e(2543),a=e.n(n),c=e(96540),r=e(37386),i=e(63527);class o extends c.PureComponent{constructor(){super(...arguments),this.state={text:"",inputCorrected:!1},this.inputRef=c.createRef(),this.updateValue=()=>{const f=this.inputRef.current?.value;let h=!1,d="";const s=this.props.min,g=this.props.max;let v=f!==""?Number(f):void 0;v&&!Number.isNaN(v)&&(s!=null&&vg?(d=g.toString(),h=!0):d=f??"",this.setState({text:d,inputCorrected:h})),h&&this.updateValueDebounced(),!Number.isNaN(v)&&v!==this.props.value&&this.props.onChange(v)},this.updateValueDebounced=(0,n.debounce)(this.updateValue,500),this.onChange=f=>{this.setState({text:f.currentTarget.value}),this.updateValueDebounced()},this.onKeyPress=f=>{f.key==="Enter"&&this.updateValue()}}componentDidMount(){this.setState({text:isNaN(this.props.value)?"":`${this.props.value}`})}componentDidUpdate(f){if(this.props.value!==f.value){const h=isNaN(this.props.value)?"":`${this.props.value}`;h!==this.state.text&&this.setState({text:h})}}renderInput(){return(0,t.jsx)(i.p,{type:"number",id:this.props.id,ref:this.inputRef,min:this.props.min,max:this.props.max,step:this.props.step,autoFocus:this.props.autoFocus,value:this.state.text,onChange:this.onChange,onBlur:this.updateValue,onKeyPress:this.onKeyPress,placeholder:this.props.placeholder,disabled:this.props.fieldDisabled,width:this.props.width,suffix:this.props.suffix})}render(){const{inputCorrected:f}=this.state;if(f){let h="",{min:d,max:s}=this.props;return s==null?d!=null&&(h=`< ${d}`):d!=null?h=`${d} < > ${s}`:h=`> ${s}`,(0,t.jsx)(r.D,{invalid:f,error:`Out of range ${h}`,validationMessageHorizontalOverflow:!0,style:{direction:"rtl"},children:this.renderInput()})}return this.renderInput()}}},38669(ne,A,e){"use strict";e.d(A,{a:()=>l});var t=e(74848),n=e(22803),a=e(92745),c=e(76319),r=e(35427),i=e(63142),o=e(13409);const l=({value:h,settings:d,onChange:s,details:g,id:v})=>{const x=(0,i.$j)(),m=(0,i.of)(f);return(0,t.jsx)(r.sk,{color:h??"",onChange:s,enableNamedColors:d?.enableNamedColors!==!1,children:({ref:p,showColorPicker:y,hideColorPicker:E})=>(0,t.jsxs)("div",{className:m.spot,children:[(0,t.jsx)("div",{className:m.colorPicker,children:(0,t.jsx)(o.q,{ref:p,id:v,onClick:y,onMouseLeave:E,color:h?x.visualization.getColorByName(h):x.components.input.borderColor})}),g&&(0,t.jsxs)(t.Fragment,{children:[h?(0,t.jsx)("span",{className:m.colorText,onClick:y,children:h}):(0,t.jsx)("span",{className:m.placeholderText,onClick:y,children:d?.placeholder??"Select color"}),d?.isClearable&&h&&(0,t.jsx)(c.K,{name:"times",onClick:()=>s(void 0),tooltip:(0,a.t)("options-ui.color.clear-tooltip","Clear settings")})]})]})})},f=h=>({spot:(0,n.css)({cursor:"pointer",color:h.colors.text.primary,background:h.components.input.background,borderRadius:h.shape.radius.default,padding:"3px",height:h.v1.spacing.formInputHeight,border:`1px solid ${h.components.input.borderColor}`,display:"flex",flexDirection:"row",alignItems:"center",alignContent:"flex-end","&:hover":{border:`1px solid ${h.components.input.borderHover}`}}),colorPicker:(0,n.css)({padding:`0 ${h.spacing(1)}`}),colorText:(0,n.css)({flexGrow:2}),placeholderText:(0,n.css)({flexGrow:2,color:h.colors.text.secondary})})},85053(ne,A,e){"use strict";e.d(A,{w:()=>c});var t=e(74848),n=e(96540),a=e(19753);const c=({value:r,onChange:i,item:o,id:l})=>{const{settings:f}=o,h=(0,n.useCallback)(d=>{i(f?.integer&&d!==void 0?Math.floor(d):d)},[i,f?.integer]);return(0,t.jsx)(a.Q,{id:l,value:r,min:f?.min,max:f?.max,step:f?.step,placeholder:f?.placeholder,onChange:h})}},83162(ne,A,e){"use strict";e.d(A,{H:()=>me,u:()=>De});var t=e(74848),n=e(53543),a=e(38809),c=e(95004),r=e(33553),i=e(92745),o=e(21285),l=e(77824),f=e(59310),h=e(48457),d=e(96540),s=e(22803),g=e(2543),v=e(36394),x=e(35555),m=e(8255),p=e(63527),y=e(35427),E=e(76319),b=e(45861),u=e(72636),D=e(65240);class P extends d.PureComponent{constructor(Me){super(Me),this.onAddThreshold=()=>{const{steps:Oe}=this.state;let Re=0;Oe.length>1&&(Re=Oe[Oe.length-1].value+10);let we=m.Tj.filter(Je=>!Oe.some(et=>et.color===Je))[1];we||(we="#CCCCCC");const Ce={value:Re,color:we,key:C++},_e=[...Oe,Ce];(0,v.RU)(_e),this.setState({steps:_e},()=>{this.latestThresholdInputRef.current&&this.latestThresholdInputRef.current.focus(),this.onChange()})},this.onRemoveThreshold=Oe=>{const{steps:Re}=this.state;Re.length&&Oe.key!==Re[0].key&&this.setState({steps:Re.filter(we=>we.key!==Oe.key)},this.onChange)},this.onChangeThresholdValue=(Oe,Re)=>{const we=Oe.target.value.replace(/,/g,"."),Ce=parseFloat(we),_e=isNaN(Ce)?"":Ce,Je=this.state.steps.map(et=>(et.key===Re.key&&(et={...et,value:_e}),et));Je.length&&(Je[0].value=-1/0),(0,v.RU)(Je),this.setState({steps:Je})},this.onChangeThresholdColor=(Oe,Re)=>{const{steps:we}=this.state,Ce=we.map(_e=>(_e.key===Oe.key&&(_e={..._e,color:Re}),_e));this.setState({steps:Ce},this.onChange)},this.onBlur=()=>{const Oe=[...this.state.steps];(0,v.RU)(Oe),this.setState({steps:Oe},this.onChange)},this.onChange=()=>{this.props.onChange(R(this.props.thresholds,this.state.steps))},this.onModeChanged=Oe=>{this.props.onChange({...this.props.thresholds,mode:Oe})};const Be=S(Me.thresholds.steps);Be[0].value=-1/0,this.state={steps:Be},this.latestThresholdInputRef=d.createRef()}renderInput(Me,Be,Oe){const Re=this.props.thresholds.mode===r.O.Percentage,we=Oe+1,Ce=(0,i.t)("dimensions.thresholds-editor.aria-label-threshold","Threshold {{thresholdNumber}}",{thresholdNumber:we});return isFinite(Me.value)?(0,t.jsx)(p.p,{type:"number",step:"0.0001",onChange:_e=>this.onChangeThresholdValue(_e,Me),value:Me.value,"aria-label":Ce,ref:Oe===0?this.latestThresholdInputRef:null,onBlur:this.onBlur,prefix:(0,t.jsxs)("div",{className:Be.inputPrefix,children:[(0,t.jsx)("div",{className:Be.colorPicker,children:(0,t.jsx)(y.sk,{color:Me.color,onChange:_e=>this.onChangeThresholdColor(Me,_e),enableNamedColors:!0})}),Re&&(0,t.jsx)("div",{className:Be.percentIcon,children:"%"})]}),suffix:(0,t.jsx)(E.K,{className:Be.trashIcon,name:"trash-alt",onClick:()=>this.onRemoveThreshold(Me),tooltip:(0,i.t)("dimensions.threshold-editor.tooltip-remove-threshold","Remove threshold {{thresholdNumber}}",{thresholdNumber:we})})},Re.toString()):(0,t.jsx)(p.p,{type:"text",value:(0,i.t)("dimensions.thresholds-editor.value-base","Base"),"aria-label":Ce,disabled:!0,prefix:(0,t.jsx)("div",{className:Be.colorPicker,children:(0,t.jsx)(y.sk,{color:Me.color,onChange:_e=>this.onChangeThresholdColor(Me,_e),enableNamedColors:!0})})})}render(){const{thresholds:Me}=this.props,{steps:Be}=this.state,Oe=[{value:r.O.Absolute,label:(0,i.t)("dimensions.thresholds-editor.modes.label.absolute","Absolute"),description:(0,i.t)("dimensions.thresholds-editor.modes.description.thresholds-based-absolute-values","Pick thresholds based on the absolute values")},{value:r.O.Percentage,label:(0,i.t)("dimensions.thresholds-editor.modes.label.percentage","Percentage"),description:(0,i.t)("dimensions.thresholds-editor.modes.description.threshold-based-percent-between-minmax","Pick threshold based on the percent between min/max")}];return(0,t.jsx)(x.D.Consumer,{children:Re=>{const we=L(Re);return(0,t.jsxs)("div",{className:we.wrapper,children:[(0,t.jsx)(b.$n,{size:"sm",icon:"plus",onClick:()=>this.onAddThreshold(),variant:"secondary",className:we.addButton,fullWidth:!0,children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.thresholds-editor.add-threshold",children:"Add threshold"})}),(0,t.jsx)("div",{className:we.thresholds,children:Be.slice(0).reverse().map((Ce,_e)=>(0,t.jsx)("div",{className:we.item,children:this.renderInput(Ce,we,_e)},`${Ce.key}`))}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.J,{description:(0,i.t)("dimensions.thresholds-editor.description-percentage-means-thresholds-relative","Percentage means thresholds relative to min & max"),children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.thresholds-editor.thresholds-mode",children:"Thresholds mode"})}),(0,t.jsx)(l.z,{options:Oe,onChange:this.onModeChanged,value:Me.mode})]})]})}})}}let C=100;function S(xe){return(!xe||xe.length===0)&&(xe=[{value:-1/0,color:"green"}]),xe.filter((Me,Be)=>(0,g.isNumber)(Me.value)||Be===0).map(Me=>({color:Me.color,value:Me.value===null?-1/0:Me.value,key:C++}))}function R(xe,Me){return{mode:xe.mode??r.O.Absolute,steps:Me.map(Oe=>{const{key:Re,...we}=Oe;return we})}}const L=(0,D.N)(xe=>({wrapper:(0,s.css)({display:"flex",flexDirection:"column"}),thresholds:(0,s.css)({display:"flex",flexDirection:"column",marginBottom:xe.spacing(2)}),item:(0,s.css)({marginBottom:xe.spacing(1),"&:last-child":{marginBottom:0}}),colorPicker:(0,s.css)({padding:xe.spacing(0,1)}),addButton:(0,s.css)({marginBottom:xe.spacing(1)}),percentIcon:(0,s.css)({fontSize:xe.typography.bodySmall.fontSize,color:xe.colors.text.secondary}),inputPrefix:(0,s.css)({display:"flex",alignItems:"center"}),trashIcon:(0,s.css)({color:xe.colors.text.secondary,cursor:"pointer",marginRight:0,"&:hover":{color:xe.colors.text.primary}})})),j=(0,d.memo)(({value:xe,onChange:Me})=>{const Be=xe??{mode:r.O.Percentage,steps:[]};return(0,t.jsx)(P,{thresholds:Be,onChange:Me})});j.displayName="ThresholdsValueEditor";var N=e(18600),V=e(63142),w=e(41654),M=e(30703),O=e(22787),U=e(4896),K=e(71451),z=e(89332),G=e(59695),F=e(18857);function W({mapping:xe,index:Me,onChange:Be,onRemove:Oe,onDuplicate:Re,showIconPicker:we}){const{key:Ce,result:_e,id:Je}=xe,et=(0,V.of)(H),qe=(0,d.useRef)(null),nt=(0,d.useCallback)(tn=>{const gt={...xe,result:{...xe.result}};tn(gt),Be(Me,gt)},[xe,Me,Be]);(0,d.useEffect)(()=>{qe.current&&xe.isNew&&(qe.current.focus(),nt(tn=>{tn.isNew=!1}))},[xe,qe,nt]);const ot=tn=>{nt(gt=>{gt.result.color=tn})},Ze=()=>{nt(tn=>{tn.result.color=void 0})},at=tn=>{nt(gt=>{gt.result.icon=tn})},it=()=>{nt(tn=>{tn.result.icon=void 0})},ct=tn=>{nt(gt=>{gt.key=tn.currentTarget.value})},xt=tn=>{nt(gt=>{gt.result.text=tn.currentTarget.value})},dt=tn=>{nt(gt=>{gt.from=parseFloat(tn.currentTarget.value)})},vt=tn=>{nt(gt=>{gt.to=parseFloat(tn.currentTarget.value)})},wt=tn=>{nt(gt=>{gt.pattern=tn.currentTarget.value})},$t=tn=>{nt(gt=>{gt.specialMatch=tn.value})},_t=[{label:"Null",value:N.W.Null,description:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.description.matches-null-and-undefined-values","Matches null and undefined values")},{label:"NaN",value:N.W.NaN,description:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.description.matches-against-number-na-n-not-a-number","Matches against Number.NaN (not a number)")},{label:"Null + NaN",value:N.W.NullAndNaN,description:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.description.matches-null-undefined-and-na-n","Matches null, undefined and NaN")},{label:"True",value:N.W.True,description:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.description.boolean-true-values","Boolean true values")},{label:"False",value:N.W.False,description:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.description.boolean-false-values","Boolean false values")},{label:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.label.empty","Empty"),value:N.W.Empty,description:(0,i.t)("dimensions.value-mapping-edit-row.special-match-options.description.empty-string","Empty string")}];return(0,t.jsx)(z.sx,{draggableId:Je,index:Me,children:tn=>(0,t.jsxs)("tr",{className:et.dragRow,ref:tn.innerRef,...tn.draggableProps,children:[(0,t.jsx)("td",{children:(0,t.jsx)("div",{className:et.dragHandle,...tn.dragHandleProps,children:(0,t.jsx)(M.I,{name:"draggabledots",size:"lg"})})}),(0,t.jsx)("td",{className:et.typeColumn,children:xe.type}),(0,t.jsxs)("td",{children:[xe.type===N.d.ValueToText&&(0,t.jsx)(p.p,{ref:qe,type:"text",value:Ce??"",onChange:ct,placeholder:(0,i.t)("dimensions.value-mapping-edit-row.placeholder-exact-value-to-match","Exact value to match")}),xe.type===N.d.RangeToText&&(0,t.jsxs)("div",{className:et.rangeInputWrapper,children:[(0,t.jsx)(p.p,{type:"number",value:xe.from??"",placeholder:(0,i.t)("dimensions.value-mapping-edit-row.placeholder-from","From"),onChange:dt}),(0,t.jsx)(p.p,{type:"number",value:xe.to??"",placeholder:(0,i.t)("dimensions.value-mapping-edit-row.placeholder-to","To"),onChange:vt})]}),xe.type===N.d.RegexToText&&(0,t.jsx)(p.p,{type:"text",value:xe.pattern??"",placeholder:(0,i.t)("dimensions.value-mapping-edit-row.placeholder-regular-expression","Regular expression"),onChange:wt}),xe.type===N.d.SpecialValue&&(0,t.jsx)(F.l6,{value:_t.find(gt=>gt.value===xe.specialMatch),options:_t,onChange:$t})]}),(0,t.jsx)("td",{children:(0,t.jsx)(p.p,{type:"text",value:_e.text??"",onChange:xt,placeholder:(0,i.t)("dimensions.value-mapping-edit-row.placeholder-optional-display-text","Optional display text")})}),(0,t.jsxs)("td",{className:et.textAlignCenter,children:[_e.color&&(0,t.jsxs)(w.B,{gap:1,justifyContent:"center",children:[(0,t.jsx)(y.sk,{color:_e.color,onChange:ot,enableNamedColors:!0}),(0,t.jsx)(E.K,{name:"times",onClick:Ze,tooltip:(0,i.t)("dimensions.value-mapping-edit-row.tooltip-remove-color","Remove color"),tooltipPlacement:"top"})]}),!_e.color&&(0,t.jsx)(y.sk,{color:"gray",onChange:ot,enableNamedColors:!0,children:gt=>(0,t.jsx)(b.$n,{variant:"primary",fill:"text",onClick:gt.showColorPicker,ref:gt.ref,size:"sm",children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mapping-edit-row.set-color",children:"Set color"})})})]}),we&&(0,t.jsx)("td",{className:et.textAlignCenter,children:(0,t.jsxs)(w.B,{gap:1,justifyContent:"center",children:[(0,t.jsx)(K.n,{onChange:at,onClear:it,value:_e.icon,size:U.Iy.SMALL,folderName:U.Iu.Icon,mediaType:U.zu.Icon,color:_e.color}),_e.icon&&(0,t.jsx)(E.K,{name:"times",onClick:it,tooltip:(0,i.t)("dimensions.value-mapping-edit-row.tooltip-remove-icon","Remove icon"),tooltipPlacement:"top"})]})}),(0,t.jsx)("td",{className:et.textAlignCenter,children:(0,t.jsxs)(w.B,{gap:1,children:[(0,t.jsx)(E.K,{name:"copy",onClick:()=>Re(Me),"data-testid":"duplicate-value-mapping","aria-label":(0,i.t)("dimensions.value-mapping-edit-row.duplicate-value-mapping-aria-label-duplicate-value-mapping","Duplicate value mapping"),tooltip:(0,i.t)("dimensions.value-mapping-edit-row.duplicate-value-mapping-tooltip-duplicate","Duplicate")}),(0,t.jsx)(E.K,{name:"trash-alt",onClick:()=>Oe(Me),"data-testid":"remove-value-mapping","aria-label":(0,i.t)("dimensions.value-mapping-edit-row.remove-value-mapping-aria-label-delete-value-mapping","Delete value mapping"),tooltip:(0,i.t)("dimensions.value-mapping-edit-row.remove-value-mapping-tooltip-delete","Delete")})]})})]})},Je)}const H=xe=>({dragRow:(0,s.css)({position:"relative"}),dragHandle:(0,s.css)({cursor:"grab","&:focus-visible&:after":{bottom:0,content:'""',left:0,position:"absolute",right:0,top:0,outline:`2px solid ${xe.colors.primary.main}`,outlineOffset:"-2px"}}),rangeInputWrapper:(0,s.css)({display:"flex","> div:first-child":{marginRight:xe.spacing(2)}}),regexInputWrapper:(0,s.css)({display:"flex","> div:first-child":{marginRight:xe.spacing(2)}}),typeColumn:(0,s.css)({textTransform:"capitalize",textAlign:"center",width:"1%"}),textAlignCenter:(0,s.css)({textAlign:"center"})});function Y({value:xe,onChange:Me,onClose:Be,showIconPicker:Oe}){const Re=(0,V.of)(te),[we,Ce]=(0,d.useState)([]);(0,d.useEffect)(()=>{Ce(k(xe))},[xe]);const _e=at=>{if(!xe||!at.destination)return;const it=[...we],ct=it[at.source.index];it.splice(at.source.index,1),it.splice(at.destination.index,0,ct),Ce(it)},Je=(at,it)=>{const ct=[...we];ct.splice(at,1,it),Ce(ct)},et=at=>{const it=[...we];it.splice(at,1),Ce(it)},qe=[{label:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.label.value","Value"),value:N.d.ValueToText,description:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.description.match-a-specific-text-value","Match a specific text value")},{label:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.label.range","Range"),value:N.d.RangeToText,description:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.description.match-a-numerical-range-of-values","Match a numerical range of values")},{label:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.label.regex","Regex"),value:N.d.RegexToText,description:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.description.match-a-regular-expression-with-replacement","Match a regular expression with replacement")},{label:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.label.special","Special"),value:N.d.SpecialValue,description:(0,i.t)("dimensions.value-mappings-editor-modal.mapping-types.description.match-boolean-empty-values","Match on null, NaN, boolean and empty values")}],nt=at=>{Ce([...we,se({type:at.value,result:{},isNew:!0})])},ot=at=>{const it=ae(we[at]),ct=[...we];ct.splice(at,0,{...it});for(let xt=at;xt{Me(J(we)),Be()};return(0,d.useEffect)(()=>{xe?.length||nt({value:N.d.ValueToText})},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:Re.tableWrap,children:(0,t.jsxs)("table",{className:Re.editTable,children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{style:{width:"1%"}}),(0,t.jsx)("th",{style:{width:"40%",textAlign:"left"},colSpan:2,children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor-modal.condition",children:"Condition"})}),(0,t.jsx)("th",{style:{textAlign:"left"},children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor-modal.display-text",children:"Display text"})}),(0,t.jsx)("th",{style:{width:"10%"},children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor-modal.color",children:"Color"})}),Oe&&(0,t.jsx)("th",{style:{width:"10%"},children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor-modal.icon",children:"Icon"})}),(0,t.jsx)("th",{style:{width:"1%"}})]})}),(0,t.jsx)(z.JY,{onDragEnd:_e,children:(0,t.jsx)(z.gL,{droppableId:"sortable-field-mappings",direction:"vertical",children:at=>(0,t.jsxs)("tbody",{ref:at.innerRef,...at.droppableProps,children:[we.map((it,ct)=>(0,t.jsx)(W,{mapping:it,index:ct,onChange:Je,onRemove:et,onDuplicate:ot,showIconPicker:Oe},it.id)),at.placeholder]})})})]})}),(0,t.jsxs)(O.a.ButtonRow,{leftItems:(0,t.jsx)(G.i,{label:(0,i.t)("dimensions.value-mappings-editor-modal.label-add-a-new-mapping","Add a new mapping"),variant:"secondary",size:"md",icon:"plus",menuPlacement:"auto",minWidth:40,options:qe,onChange:nt}),children:[(0,t.jsx)(b.$n,{variant:"secondary",fill:"outline",onClick:Be,children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor-modal.cancel",children:"Cancel"})}),(0,t.jsx)(b.$n,{variant:"primary",onClick:Ze,children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor-modal.update",children:"Update"})})]})]})}const te=xe=>({tableWrap:(0,s.css)({minHeight:"40px"}),editTable:(0,s.css)({width:"100%",marginBottom:xe.spacing(2),"thead th":{textAlign:"center"},"tbody tr:hover":{background:xe.colors.action.hover}," th, td":{padding:xe.spacing(1)}})});function Z(){return(0,g.uniqueId)("mapping-")}function se(xe){return{type:N.d.ValueToText,result:{},id:Z(),...xe}}function ae(xe){return{...se(xe),id:Z()}}function J(xe){const Me=[],Be={type:N.d.ValueToText,options:{}};return xe.forEach((Oe,Re)=>{const we={...Oe.result,index:Re};switch((!we.text||we.text.trim().length===0)&&(we.text=void 0),Oe.type){case N.d.ValueToText:Oe.key!=null&&(Be.options[Oe.key]=we);break;case N.d.RangeToText:(Oe.from!=null||Oe.to!=null)&&Me.push({type:Oe.type,options:{from:Oe.from??null,to:Oe.to??null,result:we}});break;case N.d.RegexToText:Oe.pattern!=null&&Me.push({type:Oe.type,options:{pattern:Oe.pattern,result:we}});break;case N.d.SpecialValue:Me.push({type:Oe.type,options:{match:Oe.specialMatch,result:we}})}}),Object.keys(Be.options).length>0&&Me.unshift(Be),Me}function k(xe){const Me=[];if(xe)for(const Be of xe)switch(Be.type){case N.d.ValueToText:for(const Oe in Be.options)Me.push(se({type:Be.type,result:Be.options[Oe],key:Oe}));break;case N.d.RangeToText:Me.push(se({type:Be.type,result:Be.options.result,from:Be.options.from,to:Be.options.to}));break;case N.d.RegexToText:Me.push(se({type:Be.type,result:Be.options.result,pattern:Be.options.pattern}));break;case N.d.SpecialValue:Me.push(se({type:Be.type,result:Be.options.result,specialMatch:Be.options.match??N.W.Null}))}return Me.sort((Be,Oe)=>(Be.result.index??0)>(Oe.result.index??0)?1:-1),Me}const _=(0,d.memo)(xe=>{const{value:Me,onChange:Be,item:Oe}=xe,Re=(0,V.of)(Q),we=Oe.settings?.icon,[Ce,_e]=(0,d.useState)(!1),Je=(0,d.useCallback)(()=>{_e(!1)},[_e]),et=(0,d.useMemo)(()=>k(Me),[Me]),qe=(0,d.useCallback)((ot,Ze)=>{et[Ze].result.color=ot,Be(J(et))},[et,Be]),nt=(0,d.useCallback)((ot,Ze)=>{et[Ze].result.icon=ot,Be(J(et))},[et,Be]);return(0,t.jsxs)(w.B,{direction:"column",children:[(0,t.jsx)("table",{className:Re.compactTable,children:(0,t.jsx)("tbody",{children:et.map((ot,Ze)=>(0,t.jsxs)("tr",{children:[(0,t.jsxs)("td",{children:[ot.type===N.d.ValueToText&&ot.key,ot.type===N.d.RangeToText&&(0,t.jsxs)("span",{children:["[",ot.from??"-\u221E"," - ",ot.to??"\u221E","]"]}),ot.type===N.d.RegexToText&&ot.pattern,ot.type===N.d.SpecialValue&&ot.specialMatch]}),(0,t.jsx)("td",{children:(0,t.jsx)(M.I,{name:"arrow-right"})}),(0,t.jsx)("td",{children:ot.result.text}),ot.result.color&&(0,t.jsx)("td",{children:(0,t.jsx)(y.sk,{color:ot.result.color,onChange:at=>qe(at,Ze),enableNamedColors:!0})}),we&&ot.result.icon&&(0,t.jsx)("td",{"data-testid":"iconPicker",children:(0,t.jsx)(K.n,{onChange:at=>nt(at,Ze),value:ot.result.icon,size:U.Iy.SMALL,folderName:U.Iu.Icon,mediaType:U.zu.Icon,color:ot.result.color})})]},Ze.toString()))})}),(0,t.jsxs)(b.$n,{variant:"secondary",size:"sm",fullWidth:!0,onClick:()=>_e(!0),children:[et.length>0&&(0,t.jsx)("span",{children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor.edit-value-mappings",children:"Edit value mappings"})}),et.length===0&&(0,t.jsx)("span",{children:(0,t.jsx)(i.x6,{i18nKey:"dimensions.value-mappings-editor.add-value-mappings",children:"Add value mappings"})})]}),(0,t.jsx)(O.a,{isOpen:Ce,title:(0,i.t)("dimensions.value-mappings-editor.title-value-mappings","Value mappings"),onDismiss:Je,className:Re.modal,closeOnBackdropClick:!1,children:(0,t.jsx)(Y,{value:Me,onChange:Be,onClose:Je,showIconPicker:we})})]})});_.displayName="ValueMappingsEditor";const Q=xe=>({modal:(0,s.css)({width:"980px"}),compactTable:(0,s.css)({width:"100%","tbody td":{padding:xe.spacing(.5)}})});var q=e(95506);const oe=({value:xe,onChange:Me,item:Be})=>{const{placeholder:Oe,isClearable:Re}=Be?.settings??{},we=(0,d.useCallback)(Ce=>{Me(Ce?.value?.uid)},[Me]);return(0,t.jsx)(q.b,{isClearable:Re,defaultOptions:!0,onChange:we,placeholder:Oe,value:xe})};var re=e(79609),ee=e(23207);const B=({value:xe,onChange:Me,context:Be})=>(0,t.jsx)(ee.G,{actions:xe,onChange:Me,data:Be.data,getSuggestions:()=>Be.getSuggestions?Be.getSuggestions(re.uP.Values):[]});var ie=e(38669),de=e(76637),fe=e(64394),ce=e(37386);const ve=({value:xe,onChange:Me,item:Be,id:Oe})=>{const Re=(0,V.$j)(),we=(0,V.of)(je),Ce=(0,de.Hs)(xe?.mode),Je=(Be.settings?.byValueSupport?de.uf.list():de.uf.list().filter(Ze=>!Ze.isByValue)).filter(Ze=>!Ze.excludeFromPicker).map(Ze=>{let at=Ze.isByValue?" (by value)":"";return{value:Ze.id,label:`${Ze.name}${at}`,description:Ze.description,isContinuous:Ze.isContinuous,isByValue:Ze.isByValue,component(){return(0,t.jsx)(Se,{mode:Ze,theme:Re})}}}),et=Ze=>{Me({...xe,mode:Ze.value})},qe=Ze=>{Me({...xe,mode:ot,fixedColor:Ze})},nt=Ze=>{Me({...xe,mode:ot,seriesBy:Ze})},ot=xe?.mode??fe.Y.Thresholds;if(ot===fe.Y.Fixed||ot===fe.Y.Shades)return(0,t.jsxs)("div",{className:we.group,children:[(0,t.jsx)(F.l6,{minMenuHeight:200,options:Je,value:ot,onChange:et,className:we.select,inputId:Oe}),(0,t.jsx)(ie.a,{value:xe?.fixedColor,onChange:qe})]});if(Be.settings?.bySeriesSupport&&Ce.isByValue){const Ze=[{label:"Last",value:"last"},{label:"Min",value:"min"},{label:"Max",value:"max"}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{marginBottom:Re.spacing(2)},children:(0,t.jsx)(F.l6,{minMenuHeight:200,options:Je,value:ot,onChange:et,inputId:Oe})}),(0,t.jsx)(ce.D,{label:(0,i.t)("options-ui.field-color.color-by-label","Color series by"),children:(0,t.jsx)(l.z,{value:xe?.seriesBy??"last",options:Ze,onChange:nt})})]})}return(0,t.jsx)(F.l6,{minMenuHeight:200,options:Je,value:ot,onChange:et,inputId:Oe})},Se=({mode:xe,theme:Me})=>{if(!xe.getColors)return null;const Be=xe.getColors(Me).map(Me.visualization.getColorByName),Oe={height:"8px",width:"100%",margin:"2px 0",borderRadius:"3px",opacity:1};if(xe.isContinuous)Oe.background=`linear-gradient(90deg, ${Be.join(",")})`;else{let Re="",we="";for(let Ce=0;Ce({group:(0,s.css)({display:"flex"}),select:(0,s.css)({marginRight:xe.spacing(1),flexGrow:1})});var Ve=e(96822);const he=({value:xe,onChange:Me,context:Be,item:Oe})=>(0,t.jsx)(Ve.e,{links:xe,onChange:Me,data:Be.data,getSuggestions:()=>Be.getSuggestions?Be.getSuggestions(re.uP.Values):[],showOneClick:Oe.settings?.showOneClick});class Ue extends d.PureComponent{constructor(){super(...arguments),this.state={isLoading:!0,options:[]},this.updateOptions=async()=>{const{item:Me}=this.props,{settings:Be}=Me;let Oe=Me.settings?.options||[];Be?.getOptions&&(Oe=await Be.getOptions(this.props.context)),this.state.options!==Oe&&this.setState({isLoading:!1,options:Oe})}}componentDidMount(){this.updateOptions()}componentDidUpdate(Me){const Be=Me.item?.settings,Oe=this.props.item?.settings;if(Be!==Oe)this.updateOptions();else if(Oe?.getOptions){const Re=Me.context?.data,we=this.props.context?.data;Re!==we&&this.updateOptions()}}render(){const{options:Me,isLoading:Be}=this.state,{value:Oe,onChange:Re,item:we,id:Ce}=this.props,{settings:_e}=we;return(0,t.jsx)(F.KF,{inputId:Ce,isLoading:Be,value:Oe,defaultValue:Oe,allowCustomValue:_e?.allowCustomValue,onChange:Je=>{Re(Je.map(et=>et.value).flatMap(et=>et!==void 0?[et]:[]))},options:Me})}}var pe=e(85053);class be extends d.PureComponent{constructor(){super(...arguments),this.state={isLoading:!0,options:[]},this.updateOptions=async()=>{const{item:Me}=this.props,{settings:Be}=Me;let Oe=Me.settings?.options||[];Be?.getOptions&&(Oe=await Be.getOptions(this.props.context)),this.state.options!==Oe&&this.setState({isLoading:!1,options:Oe})}}componentDidMount(){this.updateOptions()}componentDidUpdate(Me){const Be=Me.item?.settings,Oe=this.props.item?.settings;if(Be!==Oe)this.updateOptions();else if(Oe?.getOptions){const Re=Me.context?.data,we=this.props.context?.data;Re!==we&&this.updateOptions()}}render(){const{options:Me,isLoading:Be}=this.state,{value:Oe,onChange:Re,item:we,id:Ce}=this.props,{settings:_e}=we;let Je=Me.find(et=>et.value===Oe);return!Je&&Oe&&(Je={label:`${Oe}`,value:Oe}),(0,t.jsx)(F.l6,{inputId:Ce,isLoading:Be,value:Je,defaultValue:Oe,allowCustomValue:_e?.allowCustomValue,isClearable:_e?.isClearable,onChange:et=>Re(et?.value),options:Me})}}var ze=e(21253),Ne=e(34107);const Ie=({value:xe,onChange:Me,item:Be,id:Oe})=>(0,t.jsx)(Ne.S,{stats:xe,onChange:Me,allowMultiple:!!Be.settings?.allowMultiple,defaultStat:Be.settings?.defaultStat,inputId:Oe});var ke=e(41185),Ee=e(43173);class Ae extends d.PureComponent{constructor(){super(...arguments),this.state={showAdd:!1},this.onRemoveString=Me=>{const{value:Be,onChange:Oe}=this.props,Re=[...Be];Re.splice(Me,1),Oe(Re)},this.onValueChange=(Me,Be)=>{if("key"in Me&&Me.key!=="Enter")return;const{value:Oe,onChange:Re}=this.props,we=Me.currentTarget.value.trim();if(Be<0){we&&(Me.currentTarget.value="",Re([...Oe,we])),this.setState({showAdd:!1});return}if(!we)return this.onRemoveString(Be);const Ce=[...Oe];Ce[Be]=we,Re(Ce)}}render(){const{value:Me,item:Be}=this.props,{showAdd:Oe}=this.state,Re=$e(Ee.$.theme2),we=Be.settings?.placeholder||"Add text";return(0,t.jsxs)("div",{children:[Me.map((Ce,_e)=>(0,t.jsx)(p.p,{className:Re.textInput,defaultValue:Ce||"",onBlur:Je=>this.onValueChange(Je,_e),onKeyDown:Je=>this.onValueChange(Je,_e),suffix:(0,t.jsx)(M.I,{className:Re.trashIcon,name:"trash-alt",onClick:()=>this.onRemoveString(_e)})},`${_e}/${Ce}`)),Oe?(0,t.jsx)(p.p,{autoFocus:!0,className:Re.textInput,placeholder:we,defaultValue:"",onBlur:Ce=>this.onValueChange(Ce,-1),onKeyDown:Ce=>this.onValueChange(Ce,-1),suffix:(0,t.jsx)(M.I,{name:"plus-circle"})}):(0,t.jsx)(b.$n,{icon:"plus",size:"sm",variant:"secondary",onClick:()=>this.setState({showAdd:!0}),children:we})]})}}const $e=(0,D.N)(xe=>({textInput:(0,s.css)({marginBottom:"5px","&:hover":{border:`1px solid ${xe.components.input.borderHover}`}}),trashIcon:(0,s.css)({color:xe.colors.text.secondary,cursor:"pointer","&:hover":{color:xe.colors.text.primary}})}));var Fe=e(12965);function We({value:xe,onChange:Me,item:Be,id:Oe}){const Re=(0,V.of)(Ge);return Be?.settings?.isClearable&&xe!=null?(0,t.jsxs)("div",{className:Re.wrapper,children:[(0,t.jsx)("span",{className:Re.first,children:(0,t.jsx)(Fe.p,{value:xe,onChange:Me,id:Oe})}),(0,t.jsx)(E.K,{name:"times",onClick:()=>Me(void 0),tooltip:(0,i.t)("options-ui.units.clear-tooltip","Clear unit selection")})]}):(0,t.jsx)(Fe.p,{value:xe,onChange:Me,id:Oe})}const Ge=xe=>({wrapper:(0,s.css)({width:"100%",display:"flex",flexDirection:"row",alignItems:"center"}),first:(0,s.css)({marginRight:xe.spacing(1),flexGrow:2})}),me=()=>{const xe={id:"number",name:"Number",description:"Allows numeric values input",editor:pe.w},Me={id:"slider",name:"Slider",description:"Allows numeric values input",editor:ze.G},Be={id:"text",name:"Text",description:"Allows string values input",editor:ke.g},Oe={id:"strings",name:"String array",description:"An array of strings",editor:Ae},Re={id:"boolean",name:"Boolean",description:"Allows boolean values input",editor(vt){return(0,t.jsx)(o.d,{...vt,onChange:wt=>vt.onChange(wt.currentTarget.checked)})}},we={id:"select",name:"Select",description:"Allows option selection",editor:be},Ce={id:"multi-select",name:"Multi select",description:"Allows for multiple option selection",editor:Ue},_e={id:"radio",name:"Radio",description:"Allows option selection",editor(vt){return(0,t.jsx)(l.z,{...vt,options:vt.item.settings?.options})}},Je={id:"unit",name:"Unit",description:"Allows unit input",editor:We},et={id:"color",name:"Color",description:"Allows color selection",editor(vt){return(0,t.jsx)(ie.a,{value:vt.value,onChange:vt.onChange,settings:vt.item.settings,details:!0})}},qe={id:"fieldColor",name:"Field Color",description:"Field color selection",editor:ve},nt={id:"links",name:"Links",description:"Allows defining data links",editor:he},ot={id:"actions",name:"Actions",description:"Allows defining actions",editor:B},Ze={id:"stats-picker",name:"Stats Picker",editor:Ie,description:""},at={id:"timezone",name:(0,i.t)("options-ui.registry.get-all-option-editors.name-time-zone","Time zone"),description:(0,i.t)("options-ui.registry.get-all-option-editors.description-time-zone","Time zone selection"),editor:f.U},it={id:"field-name",name:"Field name",description:"Allows selecting a field name from a data frame",editor:h.O};return[Be,xe,Me,Re,_e,we,Je,nt,ot,Ze,Oe,at,qe,et,Ce,it,{id:"dashboard-uid",name:"Dashboard",description:"Select dashboard",editor:oe},{id:"mappings",name:"Mappings",description:"Allows defining value mappings",editor:_},{id:"thresholds",name:"Thresholds",description:"Allows defining thresholds",editor:j}]},De=()=>{const xe=[(0,i.t)("options-ui.registry.standard-field-configs.category","Standard options")],Me={id:"displayName",path:"displayName",name:(0,i.t)("options-ui.registry.standard-field-configs.name-display-name","Display name"),description:(0,i.t)("options-ui.registry.standard-field-configs.description-display-name","Change the field or series name"),editor:n.D.get("text").editor,override:n.D.get("text").editor,process:a.AM,settings:{placeholder:(0,i.t)("options-ui.registry.standard-field-configs.placeholder-display-name","none"),expandTemplateVars:!0},shouldApply:()=>!0,category:xe},Be={id:"unit",path:"unit",name:(0,i.t)("options-ui.registry.standard-field-configs.name-unit","Unit"),description:"",editor:n.D.get("unit").editor,override:n.D.get("unit").editor,process:a.OU,settings:{placeholder:(0,i.t)("options-ui.registry.standard-field-configs.placeholder-unit","none")},shouldApply:()=>!0,category:xe},Oe={id:"fieldMinMax",path:"fieldMinMax",name:(0,i.t)("options-ui.registry.standard-field-configs.name-field-min-max","Field min/max"),description:(0,i.t)("options-ui.registry.standard-field-configs.description-field-min-max","Calculate min max per field"),editor:n.D.get("boolean").editor,override:n.D.get("boolean").editor,process:a.FM,shouldApply:it=>it.type===c.PU.number,showIf:it=>it.min===void 0||it.max===void 0,category:xe},Re={id:"min",path:"min",name:(0,i.t)("options-ui.registry.standard-field-configs.name-min","Min"),description:(0,i.t)("options-ui.registry.standard-field-configs.description-min","Leave empty to calculate based on all values"),editor:n.D.get("number").editor,override:n.D.get("number").editor,process:a.m0,settings:{placeholder:(0,i.t)("options-ui.registry.standard-field-configs.placeholder-min","auto")},shouldApply:it=>it.type===c.PU.number,category:xe},we={id:"max",path:"max",name:(0,i.t)("options-ui.registry.standard-field-configs.name-max","Max"),description:(0,i.t)("options-ui.registry.standard-field-configs.description-max","Leave empty to calculate based on all values"),editor:n.D.get("number").editor,override:n.D.get("number").editor,process:a.m0,settings:{placeholder:(0,i.t)("options-ui.registry.standard-field-configs.placeholder-max","auto")},shouldApply:it=>it.type===c.PU.number,category:xe},Ce={id:"decimals",path:"decimals",name:(0,i.t)("options-ui.registry.standard-field-configs.name-decimals","Decimals"),editor:n.D.get("number").editor,override:n.D.get("number").editor,process:a.m0,settings:{placeholder:(0,i.t)("options-ui.registry.standard-field-configs.placeholder-decimals","auto"),min:0,max:15,integer:!0},shouldApply:it=>it.type===c.PU.number,category:xe},_e={id:"noValue",path:"noValue",name:(0,i.t)("options-ui.registry.standard-field-configs.name-no-value","No value"),description:(0,i.t)("options-ui.registry.standard-field-configs.description-no-value","What to show when there is no value"),editor:n.D.get("text").editor,override:n.D.get("text").editor,process:a.OU,settings:{placeholder:"-"},shouldApply:()=>!0,category:xe},Je=(0,i.t)("options-ui.registry.standard-field-condigs.category-data-links","Data links and actions"),et={id:"links",path:"links",name:(0,i.t)("options-ui.registry.standard-field-configs.name-data-links","Data links"),editor:n.D.get("links").editor,override:n.D.get("links").editor,process:a.Ch,settings:{showOneClick:!1},shouldApply:()=>!0,category:[Je],getItemsCount:it=>it?it.length:0},qe={id:"actions",path:"actions",name:(0,i.t)("options-ui.registry.standard-field-configs.name-actions","Actions"),editor:n.D.get("actions").editor,override:n.D.get("actions").editor,process:a.cz,settings:{showOneClick:!1},shouldApply:()=>!0,category:[Je],getItemsCount:it=>it?it.length:0,hideFromDefaults:!0},nt={id:"color",path:"color",name:(0,i.t)("options-ui.registry.standard-field-configs.name-color-scheme","Color scheme"),editor:n.D.get("fieldColor").editor,override:n.D.get("fieldColor").editor,process:a.hS,shouldApply:()=>!0,settings:{byValueSupport:!0,preferThresholdsMode:!0},category:xe},ot={id:"mappings",path:"mappings",name:(0,i.t)("options-ui.registry.standard-field-configs.name-value-mappings","Value mappings"),description:(0,i.t)("options-ui.registry.standard-field-configs.description-value-mappings","Modify the display text based on input value"),editor:n.D.get("mappings").editor,override:n.D.get("mappings").editor,process:a.xT,settings:{},defaultValue:[],shouldApply:it=>it.type!==c.PU.time,category:[(0,i.t)("options-ui.registry.standard-field-configs.category-value-mappings","Value mappings")],getItemsCount:it=>it?it.length:0},Ze={id:"thresholds",path:"thresholds",name:(0,i.t)("options-ui.registry.standard-field-configs.name-thresholds","Thresholds"),editor:n.D.get("thresholds").editor,override:n.D.get("thresholds").editor,process:a.N7,settings:{},defaultValue:{mode:r.O.Absolute,steps:[{value:-1/0,color:"green"},{value:80,color:"red"}]},shouldApply:()=>!0,category:[(0,i.t)("options-ui.registry.standard-field-configs.category-thresholds","Thresholds")],getItemsCount:it=>it?it.steps.length:0},at={id:"filterable",path:"filterable",name:(0,i.t)("options-ui.registry.standard-field-configs.name-ad-hoc","Ad-hoc filterable"),hideFromDefaults:!0,editor:n.D.get("boolean").editor,override:n.D.get("boolean").editor,process:a.FM,shouldApply:()=>!0,settings:{},category:xe};return[Be,Re,we,Oe,Ce,Me,nt,_e,et,qe,ot,Ze,at]}},21253(ne,A,e){"use strict";e.d(A,{G:()=>f});var t=e(74848),n=e(22803),a=e(17437),c=e(69156),r=e(96540),i=e(63142),o=e(91302),l=e(19753);const f=({value:s,onChange:g,item:v,id:x})=>{const m=(0,r.useRef)(null),{settings:p}=v,y=p?.min||0,E=p?.max||100,b=p?.step,u=p?.marks||{[y]:y,[E]:E},D=p?.included,P=p?.ariaLabelForHandle,C=75,S=!0,R=(0,i.$j)(),[L,j]=(0,r.useState)(s??y),[N,V]=(0,r.useState)(C);(0,r.useEffect)(()=>{s!=null&&s!==L&&j(s)},[s,L]),(0,r.useEffect)(()=>{const z=getComputedStyle(m.current),G=z.getPropertyValue("font-weight")||"normal",F=z.getPropertyValue("font-size")||"16px",W=z.getPropertyValue("font-family")||"Arial",H="0",Y=4,te=8,Z=Math.max((E+(b||0)).toString().length,(E-(b||0)).toString().length)+Y,se=H.repeat(Z),ae=h(se,`${G} ${F} ${W}`);ae&&V(ae+te*2)},[E,b]);const w=(0,r.useCallback)(z=>{const G=typeof z=="number"?z:z[0];j(G),g&&g(G)},[j,g]),M=(0,r.useCallback)(z=>{let G=z;(Number.isNaN(G)||!G)&&(G=0),j(G),g&&g(G)},[g]),O=(0,o.$)(R,S,!!u),U=d(R,N),K=S?[]:[O.sliderInputVertical];return(0,t.jsxs)("div",{className:(0,n.cx)(O.container,O.slider),children:[(0,t.jsx)(a.Global,{styles:O.slider}),(0,t.jsxs)("div",{className:(0,n.cx)(O.sliderInput,...K),children:[(0,t.jsx)(c.A,{min:y,max:E,step:b,defaultValue:s,value:L,onChange:w,vertical:!S,reverse:!1,ariaLabelForHandle:P,marks:u,included:D}),(0,t.jsx)("span",{className:U.numberInputWrapper,ref:m,children:(0,t.jsx)(l.Q,{id:x,value:L,onChange:M,max:E,min:y,step:b})})]})]})};function h(s,g){const x=document.createElement("canvas").getContext("2d");return x?(x.font=g,x.measureText(s).width):null}const d=(s,g)=>({numberInputWrapper:(0,n.css)({marginLeft:s.spacing(3),maxHeight:"32px",maxWidth:g,minWidth:g,overflow:"visible",width:"100%"})})},41185(ne,A,e){"use strict";e.d(A,{g:()=>r});var t=e(74848),n=e(96540),a=e(63527),c=e(87105);const r=({value:i,onChange:o,item:l,suffix:f,id:h})=>{const d=l.settings?.useTextarea?c.f:a.p,s=(0,n.useCallback)(g=>{let v=i??"";"key"in g?g.key==="Enter"&&!l.settings?.useTextarea&&(v=g.currentTarget.value.trim()):v=g.currentTarget.value.trim(),v!==i&&o(v===""?void 0:v)},[i,l.settings?.useTextarea,o]);return(0,t.jsx)(d,{id:h,placeholder:l.settings?.placeholder,defaultValue:i||"",rows:l.settings?.useTextarea&&l.settings.rows||5,onBlur:s,onKeyDown:s,suffix:f})}},13791(ne,A,e){"use strict";e.d(A,{Y:()=>G});var t=e(74848),n=e(22803),a=e(96540),c=e(75683),r=e(63142),i=e(27963),o=e(94076),l=e(11098);const f=({isLoading:W,children:H,className:Y})=>{let te=Y?(0,t.jsx)("div",{className:Y,children:H}):H;return(0,t.jsx)(t.Fragment,{children:W?(0,t.jsx)(l.A,{}):te})};function h({info:W}){const H=(0,r.of)(d);return(0,t.jsx)("div",{className:H.container,children:W.map((Y,te)=>(0,t.jsxs)(a.Fragment,{children:[(0,t.jsxs)("div",{className:H.infoItem,children:[(0,t.jsx)("div",{className:H.label,children:Y.label}),Y.value]}),te+1({container:(0,n.css)({display:"flex",flexDirection:"row",gap:W.spacing(1.5),overflow:"auto"}),infoItem:(0,n.css)({...W.typography.bodySmall,display:"flex",flexDirection:"column",gap:W.spacing(.5)}),label:(0,n.css)({color:W.colors.text.secondary}),separator:(0,n.css)({borderLeft:`1px solid ${W.colors.border.weak}`})});var s=e(92745),g=e(68143),v=e(66404),x=e(76319),m=e(37386),p=e(63527);const y=({value:W,onEdit:H})=>{const Y=(0,r.of)(E),[te,Z]=(0,a.useState)(W),[se,ae]=(0,a.useState)(!1),[J,k]=(0,a.useState)(!1),[_,Q]=(0,a.useState)();(0,a.useEffect)(()=>{Z(W)},[W]);const q=(0,a.useCallback)(async oe=>{const re=oe.currentTarget.value;if(!re)Q("Please enter a title");else if(re===W)Q(void 0),ae(!1);else{k(!0);try{await H(re),Q(void 0),ae(!1)}catch(ee){(0,g.NF)(ee)?Q(ee.data.message):ee instanceof Error&&Q(ee.message)}k(!1)}},[H,W]);return se?(0,t.jsx)("div",{className:Y.inputContainer,children:(0,t.jsx)(m.D,{className:Y.field,loading:J,invalid:!!_,error:_,children:(0,t.jsx)(p.p,{className:Y.input,defaultValue:te,onKeyDown:oe=>{oe.key==="Enter"&&q(oe)},autoFocus:!0,onBlur:q,onChange:oe=>Z(oe.currentTarget.value),onFocus:()=>ae(!0)})})}):(0,t.jsx)("div",{className:Y.textContainer,children:(0,t.jsxs)("div",{className:Y.textWrapper,children:[(0,t.jsx)(v.E,{element:"h1",truncate:!0,children:te}),(0,t.jsx)(x.K,{name:"pen",size:"lg",tooltip:(0,s.t)("page.editable-title.edit-tooltip","Edit title"),onClick:()=>ae(!0)})]})})};y.displayName="EditableTitle";const E=W=>({textContainer:(0,n.css)({minWidth:0}),field:(0,n.css)({flex:1,left:`calc(-${W.spacing(1)} - 1px)`,position:"relative",marginBottom:0}),input:(0,n.css)({input:{...W.typography.h1}}),inputContainer:(0,n.css)({display:"flex",flex:1}),textWrapper:(0,n.css)({alignItems:"center",display:"flex",gap:W.spacing(1),height:W.spacing(W.components.height.md)})});function b({navItem:W,renderTitle:H,actions:Y,info:te,subTitle:Z,onEditTitle:se}){const ae=(0,r.of)(u),J=Z??W.subTitle,k=se?(0,t.jsx)(y,{value:W.text,onEdit:se}):(0,t.jsxs)("div",{className:ae.title,children:[W.img&&(0,t.jsx)("img",{className:ae.img,src:W.img,alt:`logo for ${W.text}`}),H?H(W.text):(0,t.jsx)("h1",{children:W.text})]});return(0,t.jsxs)("div",{className:ae.pageHeader,children:[(0,t.jsxs)("div",{className:ae.topRow,children:[(0,t.jsxs)("div",{className:ae.titleInfoContainer,children:[k,te&&(0,t.jsx)(h,{info:te})]}),(0,t.jsx)("div",{className:ae.actions,children:Y})]}),J&&(0,t.jsx)("div",{className:ae.subTitle,children:J})]})}const u=W=>({topRow:(0,n.css)({alignItems:"flex-start",display:"flex",flexDirection:"row",flexWrap:"wrap",gap:W.spacing(1,3)}),title:(0,n.css)({display:"flex",flexDirection:"row",maxWidth:"100%",flex:1,h1:{marginBottom:0}}),actions:(0,n.css)({display:"flex",flexDirection:"row",gap:W.spacing(1)}),titleInfoContainer:(0,n.css)({display:"flex",label:"title-info-container",flex:1,flexWrap:"wrap",gap:W.spacing(1,4),justifyContent:"space-between",maxWidth:"100%",minWidth:"200px"}),pageHeader:(0,n.css)({label:"page-header",display:"flex",flexDirection:"column",gap:W.spacing(1),marginBottom:W.spacing(2)}),subTitle:(0,n.css)({position:"relative",color:W.colors.text.secondary}),img:(0,n.css)({width:"32px",height:"32px",marginRight:W.spacing(2)})});var D=e(54314),P=e(30360),C=e(60208);function S({navItem:W}){const H=(0,r.of)(R);return(0,t.jsx)("div",{className:H.tabsWrapper,children:(0,t.jsx)(D.U,{children:W.children.map((Y,te)=>{const Z=Y.icon?(0,P.Uo)(Y.icon):void 0;return!Y.hideFromTabs&&(0,t.jsx)(C.o,{label:Y.text,active:Y.active,icon:Z,counter:Y.tabCounter,href:Y.url,suffix:Y.tabSuffix,onChangeTab:Y.onClick},`${Y.url}-${te}`)})})})}const R=W=>({tabsWrapper:(0,n.css)({paddingBottom:W.spacing(3)})});var L=e(25508),j=e(84057),N=e(8535),V=e(52763);function w(W,H){if(H)return H;if(W&&N.M_)return(0,V.d4)((0,L.Mz)(M,Y=>(0,j.tc)(Y,W??"home")))}function M(W){return W.navIndex}var O=e(43550),U=e(92948),K=e(18607);function z(W,H){const Y=(0,V.d4)(te=>te.navIndex)?.[O.Id];(0,a.useEffect)(()=>{const te=(W?.node!==W?.main?W?.node:W?.main)??{text:"Grafana"},Z=(0,K.Z)(te,H,Y).map(se=>se.text).reverse();Z[Z.length-1]=U.M.AppTitle,document.title=Z.join(" - ")},[Y,W,H])}const G=({navId:W,navModel:H,pageNav:Y,renderTitle:te,onEditTitle:Z,actions:se,subTitle:ae,children:J,className:k,info:_,layout:Q=c.k.Standard,onSetScrollRef:q,...oe})=>{const re=(0,r.of)(F),ee=w(W,H),{chrome:B}=(0,i.Il)();z(ee,Y);const ie=Y??ee?.node;return(0,a.useLayoutEffect)(()=>{ee&&B.update({sectionNav:ee,pageNav:Y,layout:Q})},[ee,Y,B,Q]),(0,t.jsxs)("div",{className:(0,n.cx)(re.wrapper,k),...oe,children:[Q===c.k.Standard&&(0,t.jsx)(o.A,{divId:"page-scrollbar",onSetScrollRef:q,children:(0,t.jsxs)("div",{className:re.pageInner,children:[ie&&(0,t.jsx)(b,{actions:se,onEditTitle:Z,navItem:ie,renderTitle:te,info:_,subTitle:ae}),Y&&Y.children&&(0,t.jsx)(S,{navItem:Y}),(0,t.jsx)("div",{className:re.pageContent,children:J})]})}),Q===c.k.Canvas&&(0,t.jsx)(o.A,{divId:"page-scrollbar",onSetScrollRef:q,children:(0,t.jsx)("div",{className:re.canvasContent,children:J})}),Q===c.k.Custom&&J]})};G.Contents=f;const F=W=>({wrapper:(0,n.css)({label:"page-wrapper",display:"flex",flex:"1 1 0",flexDirection:"column",position:"relative"}),pageContent:(0,n.css)({label:"page-content",flexGrow:1}),primaryBg:(0,n.css)({background:W.colors.background.primary}),pageInner:(0,n.css)({label:"page-inner",padding:W.spacing(2),borderBottom:"none",background:W.colors.background.primary,display:"flex",flexDirection:"column",flexGrow:1,margin:W.spacing(0,0,0,0),[W.breakpoints.up("md")]:{padding:W.spacing(4)}}),canvasContent:(0,n.css)({label:"canvas-content",display:"flex",flexDirection:"column",padding:W.spacing(2),flexBasis:"100%",flexGrow:1})})},11098(ne,A,e){"use strict";e.d(A,{A:()=>r});var t=e(74848),n=e(6975),a=e(31286);const r=({pageName:i=""})=>{const o=`Loading ${i}...`;return(0,t.jsx)(a.a,{display:"flex",alignItems:"center",direction:"column",justifyContent:"center",paddingTop:10,children:(0,t.jsx)(n._,{text:o})})}},1506(ne,A,e){"use strict";e.d(A,{L:()=>l});var t=e(74848),n=e(22803),a=e(51898),c=e(92745),r=e(50201),i=e(89640),o=e(63142);function l({entity:h="Page"}){const d=(0,o.of)(f),s=h.toLowerCase();return(0,t.jsx)("div",{className:d.container,"data-testid":a.Tp.components.EntityNotFound.container,children:(0,t.jsx)(r.p,{message:`${h} not found`,variant:"not-found",children:(0,t.jsxs)(c.x6,{i18nKey:"entity-not-found.description",children:["We're looking but can't seem to find this ",{lowerCaseEntity:s},". Try returning"," ",(0,t.jsx)(i.Y,{href:"/",children:"home"})," or seeking help on the"," ",(0,t.jsx)(i.Y,{href:"https://community.grafana.com",external:!0,children:"community site."})]})})})}function f(h){return{container:(0,n.css)({padding:h.spacing(8,2,2,2)})}}},86678(ne,A,e){"use strict";e.d(A,{H:()=>r});var t=e(74848),n=e(75683),a=e(13791),c=e(1506);function r(){return(0,t.jsx)(a.Y,{navId:"home",layout:n.k.Canvas,pageNav:{text:"Page not found"},children:(0,t.jsx)(c.L,{entity:"Page"})})}},92100(ne,A,e){"use strict";e.d(A,{$:()=>h});var t=e(74848),n=e(22803),a=e(96540),c=e(92745),r=e(30703),i=e(45861),o=e(18857),l=e(63142),f=e(52193);const h=({onChange:s,maxMenuHeight:g})=>{const v=(0,a.useMemo)(f.A4,[]),x=(0,a.useMemo)(()=>v.map(u=>({label:u.name,imgUrl:u.info.logos.small,value:u})).sort((u,D)=>u.label?.localeCompare(D.label)),[v]),[m,p]=(0,a.useState)([]),y=(0,a.useCallback)(u=>{const D=u.filter(P=>P.value).map(P=>P.value);s(D),p(u)},[s]),E=(0,l.of)(d),b={defaultOptions:!0,getOptionLabel:u=>u.label,getOptionValue:u=>u.value,noOptionsMessage:(0,c.t)("panel-type-filter.select-no-options","No panel types found"),placeholder:(0,c.t)("panel-type-filter.select-placeholder","Filter by type"),maxMenuHeight:g,options:x,value:m,onChange:y};return(0,t.jsxs)("div",{className:E.container,children:[m.length>0&&(0,t.jsx)(i.$n,{size:"xs",icon:"trash-alt",fill:"text",className:E.clear,onClick:()=>y([]),children:(0,t.jsx)(c.x6,{i18nKey:"panel-type-filter.clear-button",children:"Clear types"})}),(0,t.jsx)(o.KF,{...b,prefix:(0,t.jsx)(r.I,{name:"filter"}),"aria-label":(0,c.t)("panel-type-filter.select-aria-label","Panel type filter")})]})};function d(s){return{container:(0,n.css)({label:"container",position:"relative",minWidth:"180px",flexGrow:1}),clear:(0,n.css)({label:"clear",fontSize:s.spacing(1.5),position:"absolute",top:s.spacing(-4.5),right:0})}}},68805(ne,A,e){"use strict";e.d(A,{j:()=>i});var t=e(74848),n=e(22803),a=e(96540),c=e(67458),r=e(63142);const i=a.memo(a.forwardRef(({className:f,children:h,markdown:d,styleOverrides:s,onRemove:g,...v},x)=>{const m=(0,r.of)(p=>l(p,s?.borderTop));return(0,t.jsxs)("div",{className:(0,n.cx)(m.wrapper,f),...v,ref:x,children:[d&&o(d),h]})}));function o(f){const h=(0,c.G)(f);return(0,t.jsx)("div",{className:"markdown-html",dangerouslySetInnerHTML:{__html:h}})}i.displayName="OperationRowHelp";const l=(f,h)=>{const d=f.shape.radius.default,s=f.colors.background.secondary;return{wrapper:(0,n.css)({padding:f.spacing(2),border:`2px solid ${s}`,borderTop:h?h+s:"none",borderRadius:`0 0 ${d} ${d}`,position:"relative",top:"-4px"})}}},43260(ne,A,e){"use strict";e.d(A,{A:()=>l,q:()=>o});var t=e(74848),n=e(22803),a=e(51898),c=e(76319),r=e(63142);function i(h){const d=(0,r.of)(f);return(0,t.jsx)("div",{className:(0,n.cx)(d.icon,"active"in h&&h.active&&d.active),children:(0,t.jsx)(c.K,{name:h.icon,tooltip:h.title,className:d.icon,disabled:!!h.disabled,onClick:h.onClick,type:"button","data-testid":h.dataTestId??a.Tp.components.QueryEditorRow.actionButton(h.title),..."active"in h&&{"aria-pressed":h.active}})})}function o(h){return(0,t.jsx)(i,{...h})}const l=h=>(0,t.jsx)(i,{...h}),f=h=>({icon:(0,n.css)({display:"flex",position:"relative",color:h.colors.text.secondary}),active:(0,n.css)({"&:before":{display:"block",content:'" "',position:"absolute",left:-1,right:2,height:3,borderRadius:h.shape.radius.default,bottom:-8,backgroundImage:h.colors.gradients.brandHorizontal}})})},85348(ne,A,e){"use strict";e.d(A,{u:()=>x});var t=e(74848),n=e(22803),a=e(89332),c=e(96540),r=e(22589),i=e(27489),o=e(63142),l=e(44019),f=e(92745),h=e(76319),d=e(41654),s=e(30703);const g=({actionsElement:p,disabled:y,draggable:E,collapsable:b=!0,dragHandleProps:u,headerElement:D,isContentVisible:P,onRowToggle:C,reportDragMousePosition:S,title:R,id:L,expanderMessages:j})=>{const N=(0,o.of)(v);let V=P?(0,f.t)("query-operation.header.collapse-row","Collapse query row"):(0,f.t)("query-operation.header.expand-row","Expand query row");j!==void 0&&P?V=j.close:j!==void 0&&(V=j?.open);const w=(0,f.t)("query-operation.header.drag-and-drop","Drag and drop to reorder");return(0,t.jsxs)("div",{className:N.header,children:[(0,t.jsxs)("div",{className:N.column,children:[b&&(0,t.jsx)(h.K,{name:P?"angle-down":"angle-right",tooltip:V,className:N.collapseIcon,onClick:C,"aria-expanded":P,"aria-controls":L}),R&&(0,t.jsx)("div",{className:N.titleWrapper,onClick:C,children:(0,t.jsx)("div",{className:(0,n.cx)(N.title,y&&N.disabled),children:R})}),D]}),(0,t.jsxs)(d.B,{gap:1,alignItems:"center",children:[p,E&&(0,t.jsx)("div",{onMouseMove:S,...u,children:(0,t.jsx)(s.I,{title:w,name:"draggabledots",size:"lg",className:N.dragIcon})})]})]})},v=p=>({header:(0,n.css)({label:"Header",padding:p.spacing(.5,.5),borderRadius:p.shape.radius.default,background:p.colors.background.secondary,minHeight:p.spacing(4),display:"grid",gridTemplateColumns:"minmax(100px, max-content) min-content",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap","&:focus":{outline:"none"}}),column:(0,n.css)({label:"Column",display:"flex",alignItems:"center",overflow:"hidden"}),dragIcon:(0,n.css)({cursor:"grab",color:p.colors.text.disabled,margin:p.spacing(0,.5),"&:hover":{color:p.colors.text.primary}}),collapseIcon:(0,n.css)({marginLeft:p.spacing(.5),color:p.colors.text.disabled}),titleWrapper:(0,n.css)({display:"flex",alignItems:"center",flexGrow:1,cursor:"pointer",overflow:"hidden",marginRight:p.spacing(.5)}),title:(0,n.css)({fontWeight:p.typography.fontWeightBold,color:p.colors.text.link,marginLeft:p.spacing(.5),overflow:"hidden",textOverflow:"ellipsis"}),disabled:(0,n.css)({color:p.colors.text.disabled})});g.displayName="QueryOperationRowHeader";function x({children:p,actions:y,title:E,headerElement:b,onClose:u,onOpen:D,isOpen:P,disabled:C,draggable:S,collapsable:R,index:L,id:j,expanderMessages:N}){const[V,w]=(0,c.useState)(P!==void 0?P:!0),M=(0,o.of)(m),O=(0,c.useCallback)(()=>{w(!V)},[V,w]);(0,c.useEffect)(()=>{typeof P=="boolean"&&w(P)},[P]);const U=(0,c.useCallback)(F=>{if(F.defaultPrevented){const W=F.currentTarget.getBoundingClientRect(),H=F.clientX-W.left,Y=F.clientY-W.top;(0,i.rR)("query_row_reorder_drag_position",{x:H/W.width,y:Y/W.height,width:W.width,height:W.height})}},[]);(0,r.A)(()=>{V?D&&D():u&&u()},[V]);const K={isOpen:V,onOpen:()=>{w(!0)},onClose:()=>{w(!1)}},z=y&&l.renderOrCallToRender(y,K),G=b&&l.renderOrCallToRender(b,K);return S?(0,t.jsx)(a.sx,{draggableId:j,index:L,children:F=>(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{ref:F.innerRef,className:M.wrapper,...F.draggableProps,children:[(0,t.jsx)("div",{children:(0,t.jsx)(g,{id:j,actionsElement:z,disabled:C,draggable:!0,collapsable:R,dragHandleProps:F.dragHandleProps,headerElement:G,isContentVisible:V,onRowToggle:O,reportDragMousePosition:U,title:E,expanderMessages:N})}),V&&(0,t.jsx)("div",{className:M.content,children:p})]})})}):(0,t.jsxs)("div",{className:M.wrapper,children:[(0,t.jsx)(g,{id:j,actionsElement:z,disabled:C,draggable:!1,collapsable:R,headerElement:G,isContentVisible:V,onRowToggle:O,reportDragMousePosition:U,title:E,expanderMessages:N}),V&&(0,t.jsx)("div",{className:M.content,children:p})]})}const m=p=>({wrapper:(0,n.css)({marginBottom:p.spacing(2)}),content:(0,n.css)({marginTop:p.spacing(.5),marginLeft:p.spacing(3)})});x.displayName="QueryOperationRow"},30868(ne,A,e){"use strict";e.d(A,{y:()=>h});var t=e(74848),n=e(55494),a=e(63704),c=e(24726);const r=2,i=5,o=v=>{const x=v.match(new RegExp('