"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7849,4492],{24880:(R,d,e)=>{e.r(d),e.d(d,{SoloPanelPage:()=>m,SoloPanelRenderer:()=>p,default:()=>v});var n=e(96540),h=e(42418),g=e(62930),D=e(39419),S=e(7392),y=e(31678),M=e(72255),f=e(86849),I=e(41507),P=e(79284),E=e(30195),c=e(74730);function u(a,t){const[o,l]=(0,n.useState)(),[C,O]=(0,n.useState)();return(0,n.useEffect)(()=>{(0,f.Is)().initSync(a);const T=a.activate(),A=(0,c.vL)(a,t);return A?(i(A),l(A)):(0,c.SN)(t)&&s(a,t).then(L=>{L?l(L):O("Panel not found")}),T},[a,t]),[o,C]}function i(a){let t=a.parent;for(;t&&!t.isActive;)t.activate(),t=t.parent}function s(a,t){return new Promise(o=>{a.subscribeToEvent(E.d,()=>{const l=(0,c.vL)(a,t);l?o(l):r(a.state.body)}),r(a.state.body)})}function r(a){a.forEachChild(t=>{if(t instanceof I.U&&!t.isActive){t.activate();return}if(t instanceof f.tI&&t.state.$behaviors){for(const o of t.state.$behaviors)if(o instanceof P.L&&!t.isActive){t.activate();break}r(t)}})}function m({match:a,queryParams:t}){const o=(0,M.sP)(),{dashboard:l}=o.useState();return(0,n.useEffect)(()=>(o.loadDashboard({uid:a.params.uid,route:y.DashboardRoutes.Embedded}),()=>o.clearState()),[o,a,t]),t.panelId?l?n.createElement(p,{dashboard:l,panelId:t.panelId}):n.createElement(D.A,null):n.createElement(S.L,{entity:"Panel"})}const v=m;function p({dashboard:a,panelId:t}){const[o,l]=u(a,t);return l?n.createElement(h.F,{title:l}):o?n.createElement("div",{className:"panel-solo"},n.createElement(o.Component,{model:o})):n.createElement("span",null,"Loading ",n.createElement(g.y,null))}},55087:(R,d,e)=>{e.r(d),e.d(d,{SoloPanel:()=>E,SoloPanelPage:()=>P,default:()=>c});var n=e(96540),h=e(63329),g=e(70713),D=e(76888),S=e(39569),y=e(79999);const M=u=>({dashboard:u.dashboard.getModel()}),f={initDashboard:y.vR},I=(0,h.connect)(M,f);class P extends n.Component{constructor(){super(...arguments),this.state={panel:null,notFound:!1}}static{this.contextType=D.YE}componentDidMount(){const{match:i,route:s}=this.props;this.props.initDashboard({urlSlug:i.params.slug,urlUid:i.params.uid,urlType:i.params.type,routeName:s.routeName,fixUrl:!1,keybindingSrv:this.context.keybindings})}getPanelId(){return parseInt(this.props.queryParams.panelId??"0",10)}componentDidUpdate(i){const{dashboard:s}=this.props;if(s&&(!i.dashboard||i.dashboard.uid!==s.uid)){const r=s.getPanelByUrlId(this.props.queryParams.panelId);if(!r){this.setState({notFound:!0});return}r&&s.exitViewPanel(r),this.setState({panel:r}),s.initViewPanel(r)}}render(){return n.createElement(E,{dashboard:this.props.dashboard,notFound:this.state.notFound,panel:this.state.panel,panelId:this.getPanelId(),timezone:this.props.queryParams.timezone})}}const E=({dashboard:u,notFound:i,panel:s,panelId:r,timezone:m})=>i?n.createElement("div",{className:"alert alert-error"},"Panel with id ",r," not found"):!s||!u?n.createElement("div",null,"Loading & initializing dashboard"):n.createElement("div",{className:"panel-solo"},n.createElement(g.Ay,null,({width:v,height:p})=>v===0?null:n.createElement(S.L,{stateKey:s.key,width:v,height:p,dashboard:u,panel:s,isEditing:!1,isViewing:!0,lazy:!1,timezone:m,hideMenu:!0}))),c=I(P)}}]);

//# sourceMappingURL=SoloPanelPage.2f96f49bea45de842b14.js.map