!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ac9c228c-9771-40ee-9b20-f47eec786528",e._sentryDebugIdIdentifier="sentry-dbid-ac9c228c-9771-40ee-9b20-f47eec786528")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"30b1ba65cc8722be7e184f4a401fb43e6b21634d"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6008],{86008:(e,t,r)=>{r.d(t,{A:()=>ce});var n=r(58168),o=r(96540),a=(r(62953),r(8711)),i=r(83199),d=r(86652),c=r(38257),s=r(45463),l=r(62302),u=(r(17333),r(3064),r(41393),r(14905),r(98992),r(54520),r(72577),r(81454),r(8872),r(45467)),g=r(65570),m=r(40961),h=r(43375),p=r(43627),f=r(34604),b=r(44554),I=r(42629),v=r(74979),y=r(13692);const x=e=>(0,p.uU)({...e,wasDragging:!0}),E=e=>{var t;let{id:r,items:a,containerWidth:i,rowHeight:d,gutter:c,Component:s,isSortingContainer:l,onRemove:u,onItemRemove:g,Item:m,gridTracks:h,transforming:f,containerDndProps:I,itemProps:E,dragOverlay:C,rootId:w,...k}=e;const{active:A,attributes:S,isDragging:D,listeners:P,over:R,setNodeRef:_,transition:T,transform:O}=(0,p.gl)({id:C?"dragOverlay-".concat(r):r,disabled:C,data:{rootId:w,isContainer:!0,items:a,containerId:r,dropArea:!0,...I},animateLayoutChanges:x}),B=!!R&&(r===R.id&&"container"!==(null===A||void 0===A||null===(t=A.data.current)||void 0===t?void 0:t.type)||a.includes(R.id)),H=(0,b.Hp)(a),N=H*d+(H-1)*c+"px";return o.createElement(s,(0,n.A)({ref:_,style:C?{width:i,height:N}:{transition:T,transform:v.Ks.Translate.toString(O),opacity:D?.5:void 0,width:i,height:N},hover:B,onRemove:u,attributes:S,listeners:P},k,{itemProps:E,id:r,dragOverlay:C}),a.map(((e,t)=>o.createElement(y.A,(0,n.A)({disabled:l,key:e.id},e,{index:t,containerId:r,Item:m,onRemove:g,draggable:!0,containerWidth:i,rowHeight:d,gridTracks:h,gutter:c,transformed:f?a[t]:null,itemProps:E,containerDragOverlay:C,rootId:w,containerDndProps:I,draggableProps:e})))))},C=e=>{let{containers:t,Container:r,containerWidth:n,isSortingContainer:a,items:i,Item:d,transforming:c,onContainerRemove:s,onRemove:l,rowHeight:u,gridTracks:g,gutter:m,containerDndProps:h,itemProps:p,rootId:f}=e;return t.map((e=>o.createElement(E,{key:e,id:e,items:i[e],onRemove:()=>s(e),containerWidth:n,rowHeight:u,gridTracks:g,gutter:m,Component:r,Item:d,isSortingContainer:a,transforming:c,onItemRemove:l,containerDndProps:h,itemProps:p,rootId:f})))},w={sideEffects(e){let{active:t}=e;t.node.animate([{opacity:0},{opacity:1}],{easing:"ease-in",duration:250})}},k="TRASH_ID",A="PLACEHOLDER_ID",S=e=>{let{id:t}=e;const{setNodeRef:r,isOver:n}=(0,h.zM)({id:t,data:{dropArea:!0,isTrash:!0}});return o.createElement("div",{ref:r,style:{display:"flex",alignItems:"center",justifyContent:"center",position:"fixed",left:"50%",marginLeft:-150,bottom:20,width:300,height:60,borderRadius:5,border:"1px solid",borderColor:n?"red":"#DDD"}},"Drop here to delete")},D=e=>{let{rootId:t,items:r,containers:a,trashable:i=!0,onRemove:d,Item:c,containerWidth:s=800,rowHeight:l=40,gridTracks:v=12,gutter:x=4,allowOverlap:D=!1,compactType:P="vertical",maxRows:R=3e5,Container:_=f.A,onDragEnd:T,containerDndProps:O,itemProps:B,updateOnNewProps:H=!1,rearrangeable:N=!0}=e;const{active:L}=(0,h.fF)(),F=(0,o.useRef)(null),[W,M]=(0,o.useState)((()=>(a||Object.keys(r)).reduce(((e,t)=>(e[t]=(0,b.oE)((0,b.Su)(r[t]),P,v),e)),{})),{}),[j,z]=(0,o.useState)((()=>a||Object.keys(W)));(0,u.A)((()=>{M((a||Object.keys(r)).reduce(((e,t)=>(e[t]=(0,b.oE)((0,b.Su)(r[t]),P,v),e)),{}))}),[v]),(0,u.A)((()=>{H&&((0,g.Ay)(r,W)||(M((a||Object.keys(r)).reduce(((e,t)=>(e[t]=(0,b.oE)((0,b.Su)(r[t]),P,v),e)),{})),z(a)))}),[a,r]);const G=null===L||void 0===L?void 0:L.isContainer,[U,q]=(0,o.useState)(null),[J,Z]=(0,o.useState)(null),$=(0,o.useRef)(null),K=e=>e in W?e:null,Q=()=>{U&&M(U),q(null),Z(null),$.current=null},Y=()=>{const e=Object.keys(W),t=e[e.length-1];return String.fromCharCode(t.charCodeAt(0)+1)},V=e=>{let{active:t}=e;const{isContainer:r}=t.data.current;q(W),r||Z(W)};return(0,o.useLayoutEffect)((()=>{if(L)return V({active:L}),Q}),[]),(0,h.E5)({onDragStart:V,onDragMove:e=>{let{active:t,over:r,collisions:n}=e;const{isResizer:o,isContainer:a,itemId:i,itemContainerId:d}=t.data.current;if(a||!J)return;const{initial:c,translated:u}=t.rect.current;let g=(0,b.Su)(J[d]);const m=!J[d],h=(0,b.GN)(m?J:g,i,m)||(0,b.lc)(t.data.current);if(!h||!h.width)return;const p=null===r||void 0===r?void 0:r.id;if(o){if(!p)return;const e=r.rect.width+(u.right-c.right),t=r.rect.height+(u.bottom-c.bottom);let{width:o,height:a}=(0,I.tr)({gutter:x,maxRows:R,gridTracks:v,rowHeight:l,containerWidth:s},e,t,h);if(h.width===o&&h.height===a)return;if(!n)return;return g=g.map((e=>e.id===h.id?{...h,width:o,height:a}:e)),n=n.filter((e=>e.id!==h.id)),g=(0,b.oE)(g,P,v),$.current={...h,itemContainerId:d},void Z((e=>({...e,[d]:[...g]})))}if(p===k)return void Z(U);if(!N)return;const f=K(d),y=K(p)||r&&K(r.data.current.itemContainerId)||f;if(!y)return;if(y&&y===f||(g=[...J[y],h]),!n)return;const E=n.find((e=>e.id===y));if(!E)return;let{left:C,top:w}=(0,I.zA)({gutter:x,maxRows:R,gridTracks:v,rowHeight:l,containerWidth:s},u.top-E.data.droppableContainer.rect.current.top,u.left-E.data.droppableContainer.rect.current.left,h);if(h.top===w&&h.left===C&&f===y)return;g=(0,b.Pe)(g,h,C,w,!0,!1,P,v,D),g=(0,b.oE)(g,P,v);const A=y!==f;A&&(F.current=t.itemContainerId),$.current={...h,itemContainerId:y},Z((e=>({...e,[y]:g.filter((e=>!!e)),...A&&!!e[d]&&{[d]:(0,b.oE)(e[d].filter((e=>e.id!==h.id)),P,v)}})))},onDragEnd:e=>{let{active:t,over:r}=e;if(!J)return;const{isResizer:n,isItem:o}=t.data.current,a=null===r||void 0===r?void 0:r.id;if(null===a)return void Z(null);if(a===k)return M((e=>({...e,[t.containerId]:(0,b.oE)(e[t.containerId].filter((e=>{let{id:r}=e;return r!==t.itemId})),P,v)}))),void Z(null);if(o||n)return J&&M(J),Z(null),void T(J,$.current,j);t.id in W&&null!==r&&void 0!==r&&r.id&&z((e=>{const n=e.indexOf(t.id),o=e.indexOf(r.id),a=(0,p.be)(e,n,o);return T(J,$.current,a),a}));const i=K(t.id);if(i)if(a!==A)J&&M(J),Z(null),T(J,$.current,j);else{const e=Y();(0,m.unstable_batchedUpdates)((()=>{z((t=>[...t,e])),M((r=>({...r,[i]:r[i].filter((e=>e!==t.itemId)),[e]:[t.id]})))}))}},onDragCancel:Q}),J||W?o.createElement(o.Fragment,null,o.createElement(p.gB,{items:[...j,A],strategy:p._G},o.createElement(C,{rootId:t,containers:j,Container:_,containerWidth:s,isSortingContainer:G,items:J||W,transforming:null!==J,Item:c,onContainerRemove:e=>{z((t=>t.filter((t=>t!==e))))},onRemove:d,rowHeight:l,gridTracks:v,gutter:x,itemProps:B,containerDndProps:O})),(0,m.createPortal)(o.createElement(h.Hd,{adjustScale:!1,dropAnimation:w},L&&L.data.current.rootId===t?L.data.current.isContainer?(X=L.data.current,o.createElement(E,{rootId:t,id:X,items:J||W,containerWidth:s,rowHeight:l,gutter:x,Component:_,Item:c,gridTracks:v,containerDndProps:O,itemProps:B,dragOverlay:!0})):L.data.current.isItem?(e=>{const r=(J||W)[e.itemContainerId];if(!r)return null;const a=r.find((t=>t.id===e.itemId));return a?o.createElement(y.A,(0,n.A)({rootId:t},a,{containerId:e.itemContainerId,Item:c,onRemove:d,draggable:!0,containerWidth:s,rowHeight:l,gridTracks:v,gutter:x,dragOverlay:!0,itemProps:B})):null})(L.data.current):null:null),document.body),i&&L&&(L.isContainer||L.isItem)?o.createElement(S,{id:k}):null):null;var X},P=a.default.div.withConfig({displayName:"gridLayout__Div",componentId:"sc-jna1fu-0"})(["position:relative;"]),R=(0,o.forwardRef)(((e,t)=>{let{id:r,onRemove:a,children:c,attributes:s,listeners:l,itemProps:u={},itemProps:{dashboardId:g},style:m,dragOverlay:h,...p}=e;(0,d.QZ)(g,r);return o.createElement(i.Flex,(0,n.A)({},p,{ref:t,column:!0,flex:!0,round:!0,background:"mainBackground",padding:[3],gap:2}),o.createElement(P,{style:m},c))})),_=e=>{let{id:t,Component:r,containerWidth:a,onActiveSubMenuId:u,onActiveMenuGroupId:g,...m}=e;const[h,p]=(0,d.B1)(t),[f,b]=(0,d.Ix)(t),I=(0,s.A)("(max-width: 767px)"),v=(0,c.A)(),y=(0,o.useRef)(),x=(0,o.useMemo)((()=>(y.current&&y.current.cancel(),y.current=(0,l.A)(),()=>{})),[h,u,g]);return o.createElement(i.Flex,{ref:v,column:!0,overflow:{vertical:"auto"},flex:"1","data-testid":"dashboardGrid",height:"100%",onScroll:x},o.createElement(D,(0,n.A)({rootId:t,key:t,Container:R,onDragEnd:(e,t,r)=>{p(e),b(r)},containers:f,items:h,containerWidth:a-(I?16:26)},m,{Item:r,gridTracks:12,itemProps:{dashboardId:t},containerDndProps:{droppable:!0},updateOnNewProps:!0})))};var T=r(27078),O=r(58388),B=r(28973),H=r(80925);const N=(0,a.default)(i.Flex).attrs((e=>({height:"100%",background:"mainChartBg",round:!0,...e}))).withConfig({displayName:"container__Card",componentId:"sc-esi601-0"})(["",""],(e=>{let{dragging:t,theme:r}=e;return t&&"\n &:before {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: ".concat((0,i.getRgbColor)("primary",.2)({theme:r}),";\n z-index: 10;\n backdrop-filter: blur(3px);\n }\n\n ")}));var L=r(4967),F=r(36196);const W={},M=(0,o.memo)((e=>{let{dashboardId:t,id:r,handleProps:a,listeners:i,attributes:d,style:c,dragging:s,dragOverlay:l,...g}=e;const m=(0,H.e)(),{nodesScope:h,contextScope:p,...f}=(0,O.bE)(t,r)||W,b=(0,O.v_)(t,r),I=(0,o.useMemo)((()=>{const e=(0,T.My)(m,t);let n=e.getNode({id:l?"dragOverlay-".concat(r):r});if(n)return n;const[o]=p;return n=m.makeChart({attributes:{...(0,L.L)(o),id:l?"dragOverlay-".concat(r):r,cardId:r,dashboardId:t,contextScope:p,...f,...!!f.nodeId&&!h&&{nodesScope:[f.nodeId]},toolboxProps:{drag:{...a,...i,...d}}},makeTrack:T.qh}),e.appendChild(n),n}),[t,r]);return(0,u.A)((()=>{I.updateAttributes({height:c.height,width:c.width}),I.trigger("resize")}),[I,c.height,c.width]),(0,u.A)((()=>{I.updateAttributes({toolboxProps:{drag:{...a,...i,...d,dragging:s}}})}),[s]),(0,o.useLayoutEffect)((()=>(0,B.unregister)(I.onAttributesChange(["aggregationMethod","groupBy","groupByLabel","postAggregationMethod","postGroupBy","postGroupByLabel","groupingMethod","groupingTime","chartType","chartLibrary","selectedDimensions","selectedLabels","selectedNodes","selectedInstances","sparkline","selectedLegendDimensions","showingInfo","dimensionsSortBy","instancesSortBy","nodesSortBy","groupBySortBy","labelsSortBy","dimensionsSort","nodesExpanded","groupByExpanded","labelsExpanded","expanded","staticZones","title","description","showPostAggregations"],((e,t,r)=>b((t=>({...t,[r]:e}))))))),[I,b]),(0,u.A)((()=>{I.updateAttributes(f)}),[f]),o.createElement(N,(0,n.A)({"data-testid":"chartCard-".concat((f.contextScope||[]).join(",")),height:c.height,width:"100%"},g,{dragging:s}),o.createElement(F.A,{chart:I,"data-chartid":l?"dragOverlay-".concat(r):r,"data-track":I.track("container"),height:c.height,width:"100%"}))})),j=M;var z=r(46741),G=r(58384),U=r(67544);const q="text",J="customDashboard",Z=e=>{let{dashboardId:t,id:r,onClick:n}=e;const a=(0,O.bE)(t,r,"editing"),i=(0,O.v_)(t,r,"editing");return o.createElement(G.t,{icon:"pencilSolid",onClick:()=>{n(),i(!0)},"data-ga":"".concat(q,"-reset::").concat(J),"data-testid":"textCard-edit",disabled:a},"Edit")},$=e=>{let{dashboardId:t,id:r}=e;const n=(0,U.c6)(t,r);return o.createElement(G.t,{icon:"trashcan",onClick:n,"data-ga":"".concat(q,"-reset::").concat(J),"data-testid":"textCard-remove"},"Remove")},K=e=>{let{dashboardId:t,id:r,children:a,...i}=e;return o.createElement(o.Fragment,null,o.createElement(G.A,(0,n.A)({category:q,context:J,testId:"chartTextDropdown"},i),(e=>{let{close:n}=e;return o.createElement(o.Fragment,null,o.createElement(Z,{dashboardId:t,id:r,onClick:n}),o.createElement($,{dashboardId:t,id:r}))})),a)};r(25440);const Q=(0,a.default)(i.Flex).attrs({as:"form",column:!0,flex:!0,gap:2,height:"100%",padding:[0,0,2],onMouseDown:e=>e.stopPropagation()}).withConfig({displayName:"form__CardContent",componentId:"sc-3tcqxu-0"})(["cursor:auto;"]),Y=(0,a.default)(i.Box).attrs((e=>({as:"textarea",background:"inputBg",height:"100%",round:!0,border:!0,padding:[2],...e}))).withConfig({displayName:"form__Textarea",componentId:"sc-3tcqxu-1"})(["resize:none;font-size:12px;color:",";"],(0,i.getColor)("text")),V=(0,o.memo)((e=>{let{dashboardId:t,id:r}=e;const n=(0,O.bE)(t,r,"text"),a=(0,O.v_)(t,r,"editing"),d=(0,O.v_)(t,r,"text"),[c,s]=(0,o.useState)(n);return o.createElement(Q,{"data-testid":"textCardForm"},o.createElement(Y,{placeholder:"Add some text",value:c.replace(/<\/?[^>]+(>|$)/g,""),onChange:e=>s(e.target.value)}),o.createElement(i.Flex,{position:"absolute",right:"24px",bottom:0,gap:1},o.createElement(i.IconButton,{icon:"check",small:!0,padding:[0],onClick:()=>{d(c),a(!1)},"data-testid":"textCardForm-cancel",neutral:!1,flavour:"default"}),o.createElement(i.IconButton,{icon:"x",small:!0,padding:[0],onClick:()=>a(!1),"data-testid":"textCardForm-done",flavour:"default"})))})),X={h1:i.H2,h2:i.H4,text:i.Text,micro:i.TextNano},ee=e=>{let{dashboardId:t,id:r}=e;const n=(0,O.bE)(t,r,"text")||"",a=(0,O.bE)(t,r,"textType"),d=X[a]||X.text;return o.createElement(i.Box,{"data-testid":"textCardContent"},o.createElement(d,{whiteSpace:"pre-wrap"},n.replace(/<\/?[^>]+(>|$)/g,"")))},te=(0,a.default)(i.Flex).attrs({column:!0}).withConfig({displayName:"text__StyledOptions",componentId:"sc-1f67m9f-0"})([""]),re=e=>{let{dragging:t,...r}=e;const a=(0,z.JT)("dashboard:Update");return o.createElement(i.IconButton,(0,n.A)({position:"absolute",top:0,right:0,padding:[0],width:"12px",height:"12px",icon:"rearrange",title:"Drag & drop","data-testid":"text-drag",disabled:!a,cursor:t?"grabbing":"grab"},r))},ne=["h1","h2","text","micro"],oe=e=>{let{id:t,dashboardId:r}=e;const n=(0,z.JT)("dashboard:Update"),a=(0,O.bE)(r,t,"textType")||"text",d=(0,O.v_)(r,t,"textType");return o.createElement(i.IconButton,{padding:[0],width:"12px",height:"12px",icon:"text_add",title:"Change text component","data-testid":"text-component",disabled:!n,onClick:()=>{const e=ne.findIndex((e=>e===a)),t=ne[e>ne.length-2?0:e+1];d(t)}})},ae=(0,a.default)(N).withConfig({displayName:"text__StyledCard",componentId:"sc-1f67m9f-1"})(["","{opacity:0;}&:hover{border:1px solid ",";}&:hover ","{opacity:1;}"],te,(0,i.getColor)("border"),te),ie={chart:j,text:(0,o.memo)((e=>{let{dashboardId:t,id:r,listeners:a,handleProps:i,dragging:d}=e;const c=(0,O.bE)(t,r,"editing");return o.createElement(ae,{"data-testid":"textCard",alignItems:"start",overflow:"hidden",dragging:d},o.createElement(te,null,o.createElement(K,{dashboardId:t,id:r}),o.createElement(oe,{dashboardId:t,id:r})),c&&o.createElement(V,{dashboardId:t,id:r}),!c&&o.createElement(ee,{dashboardId:t,id:r}),o.createElement(re,(0,n.A)({},a,i,{dragging:d})))})),placeholder:(0,o.memo)((()=>o.createElement(N,{column:!0,"data-testid":"placeholderCard",background:"secondaryHighlight",width:"100%"})))},de=(0,o.forwardRef)(((e,t)=>{let{dashboardId:r,id:a,attributes:i,style:d,resizeHandle:c,...s}=e;const l=(0,O.bE)(r,a,"type")||"placeholder",u=ie[l]||ie.chart;return o.createElement("div",(0,n.A)({ref:t},i,{style:d}),o.createElement(u,(0,n.A)({dashboardId:r,id:a,style:d},s)),c)})),ce=(0,o.memo)((e=>{let{id:t,...r}=e;return(0,T.Ay)(t),o.createElement(_,(0,n.A)({id:t,Component:de},r))}))}}]);