"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4492,4650],{14414(z,d,t){t.r(d),t.d(d,{default:()=>S});var s=t(74848),u=t(4213),l=t.n(u),E=t(96540),T=t(71468),U=t(54148),I=t(60519),A=t(68125),m=t(80011),B=t(28105),L=t(43173),K=t(27963),R=t(49286),W=t(27081);const h=a=>({dashboard:a.dashboard.getModel()}),v={initDashboard:W.v},S=(0,T.connect)(h,v)(({initDashboard:a,route:e,queryParams:n,dashboard:o})=>{const{keybindings:i}=(0,K.Il)(),[P,r]=(0,E.useState)(null),[D,C]=(0,E.useState)(!1),{slug:f,uid:c,type:M}=(0,U.g)();(0,E.useEffect)(()=>{a({urlSlug:f,urlUid:c,urlType:M,routeName:e.routeName,fixUrl:!1,keybindingSrv:i})},[f,c,M,e.routeName,i,a]);const p=()=>parseInt(n.panelId??"0",10);return(0,E.useEffect)(()=>{if(o){const _=g=>{if(!g||g.state!==B.Gu.Done)return;const F=g.series,j=n.timezone||o?.timezone;let N={defaults:{},overrides:[]};const V=(0,I.we)({data:F,theme:L.$.theme2,fieldConfig:O?.fieldConfig||N,replaceVariables:Q=>Q,timeZone:j}),G=(0,A._O)([V[0]],{}),$=new Blob(["\uFEFF",G],{type:"text/csv;charset=utf-8"}),X=`${O?.getDisplayTitle()}-data-${(0,m.LE)(new Date)}.csv`;(0,u.saveAs)($,X)},O=o.getPanelByUrlId(n.panelId);if(!O){C(!0);return}r(O),O.getQueryRunner().getData({withTransforms:!0,withFieldConfig:!0}).subscribe({next:g=>_(g)})}},[o,n.panelId,n.timezone]),(0,s.jsx)(R.SoloPanel,{dashboard:o,notFound:D,panel:P,panelId:p(),timezone:n.timezone})})},49286(z,d,t){t.r(d),t.d(d,{SoloPanel:()=>x,SoloPanelPage:()=>v,default:()=>y});var s=t(74848),u=t(22803),l=t(96540),E=t(71468),T=t(54148),U=t(70713),I=t(92745),A=t(34999),m=t(63142),B=t(27963),L=t(97976),K=t(27081);const R=a=>({dashboard:a.dashboard.getModel()}),W={initDashboard:K.v},h=(0,E.connect)(R,W),v=({route:a,queryParams:e,dashboard:n,initDashboard:o})=>{const[i,P]=(0,l.useState)(null),[r,D]=(0,l.useState)(!1),{keybindings:C}=(0,B.Il)(),{slug:f,uid:c,type:M}=(0,T.g)();(0,l.useEffect)(()=>{o({urlSlug:f,urlUid:c,urlType:M,routeName:a.routeName,fixUrl:!1,keybindingSrv:C})},[f,c,M,a.routeName,o,C]);const p=(0,l.useCallback)(()=>parseInt(e.panelId??"0",10),[e.panelId]);return(0,l.useEffect)(()=>{if(n){const _=n.getPanelByUrlId(e.panelId);if(!_){D(!0);return}_&&n.exitViewPanel(_),P(_),n.initViewPanel(_)}},[n,e.panelId]),(0,s.jsx)(x,{dashboard:n,notFound:r,panel:i,panelId:p(),timezone:e.timezone})},x=({dashboard:a,notFound:e,panel:n,panelId:o,timezone:i})=>{const P=(0,m.of)(S);return e?(0,s.jsx)(A.F,{severity:"error",title:(0,I.t)("dashboard.solo-panel.title-not-found","Panel with id {{panelId}} not found",{panelId:o})}):!n||!a?(0,s.jsx)("div",{children:(0,s.jsx)(I.x6,{i18nKey:"dashboard.solo-panel.loading-initializing-dashboard",children:"Loading & initializing dashboard"})}):(0,s.jsx)("div",{className:P.container,children:(0,s.jsx)(U.Ay,{children:({width:r,height:D})=>r===0?null:(0,s.jsx)(L.L,{stateKey:n.key,width:r,height:D,dashboard:a,panel:n,isEditing:!1,isViewing:!0,lazy:!1,timezone:i,hideMenu:!0})})})},y=h(v),S=a=>({container:(0,u.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=CSVExportPage.86e6771c34a914f3f2c7.js.map