"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8595],{67291:(K,_,e)=>{e.r(_),e.d(_,{TestStuffPage:()=>m,default:()=>L,getDefaultState:()=>g});var t=e(85960),d=e(16162),P=e(53565),u=e(13446),D=e(14345),O=e(26141),M=e(19820),v=e(74042),T=e(46616),i=e(29165),c=e(20989),C=e(67954),p=e(93991),h=e(33088),R=e(63535),I=e(17771);const m=()=>{const[r,o]=(0,t.useState)(g()),{queryOptions:a,queryRunner:s}=r,W=()=>{const n={from:"now-1h",to:"now"};s.run({queries:a.queries,datasource:a.dataSource,timezone:"browser",timeRange:{from:u.parse(n.from),to:u.parse(n.to),raw:n},maxDataPoints:a.maxDataPoints??100,minInterval:a.minInterval})},y=n=>{o({...r,queryOptions:n})},B=(0,t.useMemo)(()=>s.getData({withFieldConfig:!0,withTransforms:!0}),[s]),l=(0,d.Z)(B),f={id:"test-page",text:"Test page",icon:"dashboard",subTitle:"FOR TESTING!",url:"sandbox/test"},E=(0,p.iG)();return t.createElement(c.T,{navModel:{node:f,main:f}},t.createElement(c.T.Contents,null,t.createElement(v.Lh,null,t.createElement(A,{extensionPointId:"grafana/sandbox/testing"})),l&&t.createElement(P.Z,{style:{width:"100%",height:"600px"}},({width:n})=>t.createElement("div",null,t.createElement(h.$,{title:"Hello",pluginId:"timeseries",width:n,height:300,data:l,options:{},fieldConfig:{defaults:{},overrides:[]},timeZone:"browser"}),t.createElement(T.i,{data:l.series[0],width:n,height:300}))),t.createElement("div",{style:{marginTop:"16px",height:"45%"}},t.createElement(R.D,{options:a,queryRunner:s,onRunQueries:W,onOptionsChange:y})),t.createElement("div",{style:{display:"flex",gap:"1em"}},t.createElement(i.zx,{onClick:()=>E.success("Success toast","some more text goes here"),variant:"primary"},"Success"),t.createElement(i.zx,{onClick:()=>E.warning("Warning toast","some more text goes here","bogus-trace-99999"),variant:"secondary"},"Warning"),t.createElement(i.zx,{onClick:()=>E.error("Error toast","some more text goes here","bogus-trace-fdsfdfsfds"),variant:"destructive"},"Error"))))};function g(){const r={fieldConfig:{defaults:{color:{mode:D.S.PaletteClassic}},overrides:[]},replaceVariables:a=>a,theme:C.config.theme2},o={getTransformations:()=>[],getFieldOverrideOptions:()=>r,getDataSupport:()=>({annotations:!1,alertStates:!1})};return{queryRunner:new I.o(o),queryOptions:{queries:[],dataSource:{name:"gdev-testdata"},maxDataPoints:100}}}function A({extensionPointId:r}){const{extensions:o}=(0,O.I4)({extensionPointId:r});return o.length===0?null:t.createElement("div",null,o.map((a,s)=>(0,M.c)(a)?t.createElement(i.Qj,{href:a.path,title:a.description,key:a.id},a.title):null))}const L=m}}]);

//# sourceMappingURL=TestStuffPage.77206570abaa67fe6ac9.js.map