summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/43.e139da6e48a4308e3cf9.chunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/gui/v2/43.e139da6e48a4308e3cf9.chunk.js')
-rw-r--r--web/gui/v2/43.e139da6e48a4308e3cf9.chunk.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/web/gui/v2/43.e139da6e48a4308e3cf9.chunk.js b/web/gui/v2/43.e139da6e48a4308e3cf9.chunk.js
new file mode 100644
index 000000000..5b1447a28
--- /dev/null
+++ b/web/gui/v2/43.e139da6e48a4308e3cf9.chunk.js
@@ -0,0 +1 @@
+!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]="efd65ba8-7087-4829-818b-5b577253a263",e._sentryDebugIdIdentifier="sentry-dbid-efd65ba8-7087-4829-818b-5b577253a263")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"068845a823c962888381794c354a8f6b6e263031"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[43],{16512:function(e,t,n){n.d(t,{Q0:function(){return o},R4:function(){return m},TT:function(){return i},WL:function(){return d},Y:function(){return c},by:function(){return s},qY:function(){return l},rU:function(){return f},xL:function(){return u}});var a=n(60677),r=n(15557),o=a.default.img.withConfig({displayName:"styled__Illustration",componentId:"sc-1yhntgl-0"})(["margin:0 auto;"]),l=(0,a.default)(r.Text).withConfig({displayName:"styled__StyledText",componentId:"sc-1yhntgl-1"})(["display:block;"]),c=a.default.div.withConfig({displayName:"styled__TextHeader",componentId:"sc-1yhntgl-2"})(["margin-bottom:",";font-weight:700;"],(0,r.getSizeBy)(2)),d=a.default.div.withConfig({displayName:"styled__StaticCheckmarks",componentId:"sc-1yhntgl-3"})(["margin-top:",";margin-bottom:",";"],(0,r.getSizeBy)(2),(0,r.getSizeBy)(5)),i=a.default.div.withConfig({displayName:"styled__CheckmarkLine",componentId:"sc-1yhntgl-4"})(["display:flex;align-items:center;"]),u=(0,a.default)(r.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1yhntgl-5"})(["margin-right:4px;height:18px;> use{fill:",";}"],(0,r.getColor)("primary")),s=(0,a.default)(u).withConfig({displayName:"styled__HelpIcon",componentId:"sc-1yhntgl-6"})(["vertical-align:middle;"]),m=a.default.div.withConfig({displayName:"styled__LearnMoreSection",componentId:"sc-1yhntgl-7"})(["margin-top:",";"],(0,r.getSizeBy)(4)),f=a.default.a.withConfig({displayName:"styled__Link",componentId:"sc-1yhntgl-8"})(["text-decoration:underline;color:",";&:visited{color:",";}"],(0,r.getColor)("success"),(0,r.getColor)("success"))},4193:function(e,t,n){n.r(t),n.d(t,{default:function(){return dt}});var a=n(67294),r=n(89250),o=n(39878),l=n(4474),c=n(74059),d=n(29748),i=n(37518),u=n(5934),s=n(47133),m=n(54227),f=n(79619),h=n(78266),g=function(){return a.createElement(h.Z,{title:"Loading charts...","data-testid":"dashboardLoading"})},p=n(29439),b=n(61152),v=n(87462),E=n(45987),y=n(15557),C=n(87574),x=n(97945),w=["compact"],I=function(e){var t=e.compact,n=(0,E.Z)(e,w),r=(0,b.Z)("addChartModal"),o=(0,p.Z)(r,2)[1],l=(0,x.Mm)().length>0;return a.createElement(y.Flex,(0,v.Z)({column:!0,alignItems:"center",justifyContent:"center",overflow:{vertical:"auto"},flex:!0,basis:0,"data-testid":"dashboardBlankSlate"},n),!t&&a.createElement(y.Flex,{as:"img",src:C.X,height:"35%"}),a.createElement(y.H3,{margin:[6,0,2]},"Empty Dashboard"),l?a.createElement(a.Fragment,null,a.createElement(y.Text,{textAlign:"center"},"Let\u2019s fill your dashboard."),a.createElement(y.Text,{textAlign:"center"},"Go to a node view or node list and add one chart to this Dashboard or just use")):a.createElement(a.Fragment,null,a.createElement(y.Text,{textAlign:"center"},"You don't have any available node to retrieve charts from."),a.createElement(y.Text,{textAlign:"center"},"Please verify your nodes' state and/or connect a new node to Netdata Cloud")),!t&&a.createElement(y.Button,{margin:[8,0,0,0],onClick:o,disabled:!l,label:"Add chart","data-testid":"dashboardBlankSlate-addChart"}))},k=n(93433),O=(n(92222),n(21249),n(57640),n(9924),n(69826),n(41539),n(31672),n(2490),n(59461),n(2707),n(47941),n(16645)),D=n(7693),Z=n(92903),S=n(96929),T=n(40970),_=n(89479),j=n(91128),N=n(97723),M=n(4942),P=(n(15581),n(34514),n(54747),n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070),n(89692)),F=n(16978),L=n(9058),B=n(82351),A=function(){return a.createElement(y.Flex,{column:!0,width:"300px",gap:1},a.createElement(y.TextSmall,{strong:!0,color:"white"},"Not finding a chart?"),a.createElement(y.TextSmall,{color:"white"},"When selecting",a.createElement(y.TextSmall,{strong:!0,color:"white",margin:[0,1]},"All Nodes"),"you search and add charts using their context. The outcome will be a composite chart over All Nodes, like on the Overview tab."),a.createElement(y.TextSmall,{color:"white"},"When you select a",a.createElement(y.TextSmall,{strong:!0,color:"white",margin:[0,1]},"specific Node"),"you search and add charts using their name. The result is a specific chart over the node selected, like on Single Node tab."))},H=function(){return a.createElement(B.Z,{isBasic:!0,plain:!0,content:A,align:"bottom"},a.createElement(y.Icon,{name:"question",color:"textDescription",size:"small"}))};function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){(0,M.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var W=function(e){var t=e.spaceId,n=e.roomId,r=e.value,o=e.onChange,l=e.options,c=e.testid,d=e.selectedNodeIds,i=null===r||void 0===r?void 0:r.value,u=(0,L.e)(),s=(0,_.Cd)(i&&n,i),m=(0,a.useMemo)((function(){u.getNodes({id:"newDashboardChart"}).forEach((function(e){return e.destroy()}));var e=(0,P.ZP)(s),a=e.info,r=e.valueRange,o=e.height,l=e.colors,c=u.makeChart({attributes:R({id:"newDashboardChart",contextScope:[i],host:"/api/v3/spaces/".concat(t,"/rooms/").concat(n),roomId:n,info:a,valueRange:r,height:"".concat(o+207,"px"),enabledNavigation:!1,selectedNodes:d},l&&{colors:l})});return u.getRoot().appendChild(c),c}),[u,i]);return(0,a.useEffect)((function(){return function(){return m.destroy()}}),[]),a.createElement(y.Flex,{gap:6,column:!0},a.createElement(y.Flex,{gap:2,column:!0,"data-testid":c},a.createElement(y.Flex,{gap:2},a.createElement(y.H5,null,"Context in room overview"),a.createElement(H,null)),a.createElement(y.Select,{options:l,value:r,onChange:o,isClearable:!0,form:c})),r&&a.createElement(y.Flex,{height:{min:"320px"},column:!0},a.createElement(F.Z,{chart:m,margin:[2,0,0]})))},z={label:"All Nodes",value:"all-nodes"},J={label:"All Nodes (no reachable nodes)",value:"all-nodes",isDisabled:!0},Y=function(e){var t=e.id,n=e.isLive,a=e.name;return{label:n?a:"".concat(a," (offline)"),value:t,isDisabled:!n}},q=function(e){return{value:e,label:e}},V=function(e){var t=e.id,n=e.onClose,r=(0,c.th)(),o=(0,i.UL)(),l=(0,s.LJ)(t,"name"),d=(0,i.Hm)("name"),u=(0,S.zN)(),m=(0,x.HZ)().length>0,f=(0,S.fD)(),h=(0,x.Ne)(u),g=(0,N.jN)(t),b=m?z:J,v=(0,a.useState)(b.value),E=(0,p.Z)(v,2),C=E[0],w=E[1],I=(0,a.useState)(null),M=(0,p.Z)(I,2),P=M[0],F=M[1],B=(0,a.useMemo)((function(){return[b].concat((0,k.Z)(h.map(Y)))}),[h]),A=(0,a.useMemo)((function(){return B.find((function(e){return e.value===C}))}),[B,C]),H=(0,a.useCallback)((function(e){w((null===e||void 0===e?void 0:e.value)||b.value),F(null)}),[]),U=(0,a.useMemo)((function(){return C===b.value?[]:[C]}),[C]),R=(0,T.Z)(o,U,{spaceId:r});if(R)throw R;var V=(0,_.Cd)(o),K=(0,a.useMemo)((function(){return Object.keys(V).sort((function(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent"})})).map(q)}),[V]);(0,a.useEffect)((function(){K.length&&A&&F((function(e){return e||K[0].value}))}),[P,K,A]);var Q=(0,a.useMemo)((function(){return P&&q(P)}),[P]),X=(0,a.useCallback)((function(e){return F(null===e||void 0===e?void 0:e.value)}),[]),G=V[P],$=(0,L.e)(),ee=(0,a.useCallback)((function(){var e=$.getNode({id:"newDashboardChart"}).getAttributes(),t=e.aggregationMethod,a=e.selectedDimensions,r=e.groupBy,o=e.groupByLabel,l=e.groupingMethod,c=e.chartType,d=e.selectedLabels,i=e.selectedNodes,u=e.selectedInstances,s=e.nodesScope,m=e.contextScope;g(m,{aggregationMethod:t,selectedDimensions:a,groupBy:r,groupByLabel:o,groupingMethod:l,chartType:c,selectedLabels:d,selectedNodes:i,selectedInstances:u,nodesScope:s},(function(){return setTimeout(n)}))}),[C,G]),te=!P,ne=(0,j.Z)();return(0,a.useEffect)((function(){return ne(!0),function(){return ne(!1)}})),a.createElement(O.u6,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:n,overflow:"visible"},a.createElement(D.x,{onClose:n,title:"Add Chart to Dashboard"},a.createElement(y.Button,{label:"Add chart",icon:"plus",onClick:ee,disabled:te,"data-testid":"addChartModal-addChart-button"})),a.createElement(Z.B,null,"Add Charts to ",l),a.createElement(O.TZ,{overflow:"visible"},a.createElement(y.Flex,{gap:6,column:!0},a.createElement(y.Flex,{gap:2,column:!0,"data-testid":"addChartModal-selectNodes"},a.createElement(y.H5,null,"Nodes in ",d),a.createElement(y.Select,{options:B,value:A,onChange:H,isLoading:!f,isClearable:!0,form:"addChartModal-selectNodes"})),Q&&a.createElement(W,{id:t,spaceId:r,roomId:o,value:Q,onChange:X,options:K,testid:"addChartModal-selectChart",selectedNodeIds:U}))))},K=n(91268),Q=["text","TextComponent"],X=function(e){var t=e.text,n=e.TextComponent,r=void 0===n?y.Text:n,o=(0,E.Z)(e,Q),l=(0,a.useRef)(),c=(0,a.useState)(!1),d=(0,p.Z)(c,2),i=d[0],u=d[1];(0,a.useEffect)((function(){if(l.current){var e=l.current.offsetWidth<l.current.scrollWidth;u(e)}}),[]);var s=a.createElement(r,(0,v.Z)({ref:l,truncate:!0},o),t);return i?a.createElement(B.Z,{content:t,align:"bottom",stretch:"align",isBasic:!0},s):s},G=function(e){var t=e.id,n=(0,s.LJ)(t,"name");return a.createElement(X,{TextComponent:y.H0,text:n})},$=function(){var e=(0,b.Z)("addChartModal"),t=(0,p.Z)(e,2)[1];return(0,x.Mm)().length>0?a.createElement(y.Button,{neutral:!0,flavour:"hollow",label:"Add chart",icon:"chart_added",onClick:t,"data-testid":"dashboardHeaderActionBar-addChart-button","data-ga":"action-bar::click-add-chart::cust-dashboard"}):null},ee=function(e){var t=e.id,n=(0,N.Kq)(t);return a.createElement(y.Button,{neutral:!0,flavour:"hollow",label:"Add text",icon:"text_add",onClick:n,"data-testid":"dashboardHeaderActionBar-addText-button","data-ga":"action-bar::click-add-text::cust-dashboard"})},te=n(93017),ne=n(67336),ae=n(14428),re=function(e){var t=e.id,n=(0,te.Z)(),r=(0,p.Z)(n,2)[1],o=(0,ne.O9)(t,{onFail:r}),l=(0,s.LJ)(t,"processing"),c=(0,s.LJ)(t,"isOwner"),d=(0,s.DS)(t);return a.createElement(ae.Z,{permission:c?"dashboard:Update":"dashboard:UpdateSelf",flavour:"hollow",label:"Save",icon:"save",onClick:o,disabled:d,isLoading:l,"data-testid":"dashboardHeaderActionBar-save-button","data-ga":"action-bar::click-save::cust-dashboard"})},oe=function(e){var t=e.id;return a.createElement(y.Flex,{gap:2},a.createElement($,null),a.createElement(ee,{id:t}),a.createElement(re,{id:t}))},le=(0,a.memo)(oe),ce=n(71992),de=n(46667),ie=n(62200),ue=n(59112),se=n(16512),me=function(e){var t=e.close,n=(0,a.useState)(!0),o=(0,p.Z)(n,2),l=o[0],c=o[1],d=(0,s.r0)(),u=(0,s.HI)({id:d,key:"name"}),f=(0,p.Z)(u,2),h=f[0],g=f[1],b=(0,a.useState)(h),v=(0,p.Z)(b,2),E=v[0],x=v[1],w=(0,ne.O9)(d),I=(0,m.UK)(),k=(0,r.s0)(),S=(0,i.A3)(),T=E.length>0,_=l&&T&&E!==h,j=(0,a.useCallback)((function(){g(E),w().then((function(e){var n=e.data.slug,a="".concat(S,"/dashboards/").concat(n);I({id:d,slug:n,path:a}),k(a,{replace:!0}),t()}))}),[t,E,d,S]);return a.createElement(O.u6,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:t,"data-testid":"renameDashboard-modal"},a.createElement(D.x,{onClose:t,title:"Rename Dashboard"},a.createElement(y.Button,{label:"Save Changes",onClick:j,disabled:!_})),a.createElement(Z.B,{"data-testid":"renameDashboard-title"},"Rename dashboard ",h),a.createElement(O.TZ,null,a.createElement(ue.Z,{value:E,label:"Name",onChange:function(e){x(e.target.value)},isValid:l,setIsValid:c,isDirty:T,instantFeedback:"all",onKeyDown:function(e){return e.keyCode===ie.DV&&_&&j()},"data-testid":"renameDashboard-input"}),a.createElement(y.Flex,{column:!0,justifyContent:"between",height:"100%",margin:[8,0,16],"data-testid":"renameDashboard-learnMoreSection"},a.createElement(se.R4,null,a.createElement(se.by,{name:"help"}),a.createElement(y.Text,null,"Learn more about Dashboards")," ",a.createElement(se.rU,{href:"https://learn.netdata.cloud/docs/cloud/visualize/dashboards",target:"_blank",rel:"noopener noreferrer"},"In our documentation")),a.createElement(se.Q0,{src:C.X,alt:"No nodes",title:"No nodes"}))))},fe=function(){var e=(0,r.s0)(),t=(0,c.uk)(),n=(0,i.vf)(),o=(0,s.r0)(),l=(0,s.LJ)(o).name,d=(0,i.Hm)("name"),u=(0,de.Z)(),m=(0,p.Z)(u,4),f=m[0],h=m[2],g=m[3],b=(0,de.Z)(),v=(0,p.Z)(b,4),E=v[0],C=v[2],x=v[3],w=(0,a.useCallback)((function(){e("/spaces/".concat(t,"/rooms/").concat(n,"/dashboards"))}),[t,n]),I=(0,N.CO)(o,{onSuccess:w});return a.createElement(a.Fragment,null,a.createElement(ce.Z,{category:"dashboard",context:"title",testId:"dashboardDropdown"},(function(e){var t=e.close;return a.createElement(a.Fragment,null,a.createElement(ce.h,{icon:"pencilOutline",onClick:function(){t(),C()},"data-testid":"renameDashboard-option","data-ga":"dropdown-item::click-rename-dashboard::cust-dashboard"},"Rename Dashboard"),a.createElement(ce.h,{icon:"trashcan",color:"errorText",onClick:function(){t(),h()},"data-testid":"removeDashboard-option","data-ga":"dropdown-item::click-remove-dashboard::cust-dashboard"},"Delete Dashboard"))})),E&&a.createElement(me,{close:x}),f&&a.createElement(y.ConfirmationDialog,{confirmLabel:"Yes, delete","data-ga":"delete-dashboard-dialog","data-testid":"deleteDashboardDialog",handleConfirm:I,handleDecline:g,message:a.createElement(a.Fragment,null,"You are about to delete ",a.createElement("strong",null,l)," from ",a.createElement("strong",null,d),".",a.createElement("br",null),"Are you sure you want to continue?"),title:"Delete ".concat(l)}))},he=function(e){var t=e.id;return a.createElement(y.Flex,{justifyContent:"between",padding:[3,2.5],"data-testid":"dashboardHeader"},a.createElement(y.Flex,{alignItems:"center"},a.createElement(fe,null),a.createElement(G,{id:t})),a.createElement(le,{id:t}))},ge=(0,a.memo)(he),pe=n(69968),be=n.n(pe),ve=(n(48564),n(79424),n(6811)),Ee=["style","className","onMouseDown","onMouseUp","onTouchEnd","children"],ye=["id","Component"],Ce=(0,pe.WidthProvider)(be()),xe=(0,a.forwardRef)((function(e,t){var n=e.style,r=e.className,o=e.onMouseDown,l=e.onMouseUp,c=e.onTouchEnd,d=e.children,i=(0,E.Z)(e,Ee);return a.createElement("div",(0,v.Z)({style:n,className:r,ref:t,onMouseDown:o,onMouseUp:l,onTouchEnd:c},i),d.map((function(e){return"function"===typeof e?e({onMouseDown:o,onMouseUp:l,onTouchEnd:c}):e})))})),we=function(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,minH:e.minH}},Ie=function(e){var t=e.id,n=e.Component,r=(0,E.Z)(e,ye),o=(0,ve.ZL)(t),l=(0,p.Z)(o,2),c=l[0],d=l[1],i=(0,a.useCallback)((function(e){var t=e.map(we);d(t)}),[]),u=(0,a.useMemo)((function(){return c.map((function(e){var r=e.i;return a.createElement(xe,{key:r},(function(e){return a.createElement(n,(0,v.Z)({key:r,id:t,cardId:r},e))}))}))}),[c]);return a.createElement(y.Flex,{column:!0,gap:2,width:"100%",overflow:"auto"},a.createElement(Ce,(0,v.Z)({},r,{layout:c,onLayoutChange:i,measureBeforeMount:!0,useCSSTransforms:!0,preventCollision:!1,isDroppable:!0}),u))};Ie.defaultProps={rowHeight:30,cols:12};var ke=Ie,Oe=n(45215),De=n(22841),Ze=n(60677),Se=(0,Ze.default)(y.Flex).attrs({height:"100%",background:"mainBackground",round:!0,cursor:"move"}).withConfig({displayName:"container__Card",componentId:"sc-esi601-0"})(["box-shadow:0px 0px 1px rgba(0,0,0,0.04),0px 2px 6px rgba(0,0,0,0.04),0px 10px 20px rgba(0,0,0,0.04);"]),Te=(0,Ze.default)(y.Flex).attrs({column:!0,cursor:"default",height:{max:"100%"},overflow:"hidden",onMouseDown:function(e){return e.stopPropagation()}}).withConfig({displayName:"content__CardContent",componentId:"sc-1x8kdiw-0"})([""]),_e=function(e){var t=e.chart;return a.createElement(Te,{flex:!0,"data-testid":"chartContent"},a.createElement(F.Z,{chart:t}))},je=["id","cardId","onMouseDown","onMouseUp","onTouchEnd"],Ne=["nodeId"];function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach((function(t){(0,M.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fe=(0,a.memo)((function(e){var t=e.id,n=e.cardId,r=e.onMouseDown,o=e.onMouseUp,l=e.onTouchEnd,c=(0,E.Z)(e,je),d=(0,L.e)(),i=(0,De._q)(t,n)||{},u=i.nodeId,s=(0,E.Z)(i,Ne),m=(0,a.useMemo)((function(){var e=d.makeChart({attributes:Pe(Pe({cardId:n,dashboardId:t},s),!!u&&{nodesScope:[u]}),makeTrack:Oe.vL});return(0,Oe.ZO)(d,t).appendChild(e),e}),[t,n]);return(0,a.useLayoutEffect)((function(){m.updateAttributes({onMouseDownDrag:r,onMouseUpDrag:o,onTouchEndDrag:l})}),[r,o,l]),a.createElement(Se,(0,v.Z)({"data-testid":"chart","data-testId":"chartCard-".concat((s.contextScope||[]).join(","))},c),a.createElement(_e,{chart:m}))})),Le=Fe,Be="text",Ae="customDashboard",He=function(e){var t=e.id,n=e.cardId,r=e.onClick,o=(0,De.I_)(t,n,"editing"),l=(0,De.IT)(t,n,"editing");return a.createElement(ce.h,{icon:"pencilSolid",onClick:function(){r(),l(!0)},"data-ga":"".concat(Be,"-reset::").concat(Ae),"data-testid":"textCard-edit",disabled:o},"Edit")},Ue=function(e){var t=e.id,n=e.cardId,r=(0,N.Zj)(t,n);return a.createElement(ce.h,{icon:"trashcan",onClick:r,"data-ga":"".concat(Be,"-reset::").concat(Ae),"data-testid":"textCard-remove"},"Remove")},Re=function(e){var t=e.id,n=e.cardId;return a.createElement(ce.Z,{category:Be,context:Ae,testId:"chartTextDropdown"},(function(e){var r=e.close;return a.createElement(a.Fragment,null,a.createElement(He,{id:t,cardId:n,onClick:r}),a.createElement(Ue,{id:t,cardId:n}))}))},We=function(e){var t=e.id,n=e.cardId;return a.createElement(y.Flex,{alignSelf:"start","data-testid":"textCardHeader"},a.createElement(Re,{id:t,cardId:n}))},ze=(n(66992),n(88674),n(78783),n(33948),(0,n(2145).Z)((function(){return Promise.all([n.e(575),n.e(189)]).then(n.bind(n,8937))}),"Editor")),Je=function(e){return a.createElement(a.Suspense,{fallback:""},a.createElement(ze,e))},Ye=(0,Ze.default)(y.Flex).attrs({as:"form",column:!0,flex:!0,gap:2,onMouseDown:function(e){return e.stopPropagation()}}).withConfig({displayName:"form__CardContent",componentId:"sc-3tcqxu-0"})(["cursor:auto;"]),qe={toolbar:!1,placeholder:{text:"Type your text",hideOnClick:!1}},Ve=function(e){var t=e.id,n=e.cardId,r=(0,De.I_)(t,n,"text"),o=(0,De.IT)(t,n,"editing"),l=(0,De.IT)(t,n,"text"),c=(0,a.useState)(r),d=(0,p.Z)(c,2),i=d[0],u=d[1],s=(0,a.useCallback)((function(){return o(!1)}),[]),m=(0,a.useCallback)((function(){l(i),o(!1)}),[i]);return a.createElement(Ye,{"data-testid":"textCardForm"},a.createElement(y.Flex,{round:!0,border:!0,padding:[2],column:!0},a.createElement(Je,{autoFocus:!0,text:i,options:qe,onChange:u})),a.createElement(y.Flex,{justifyContent:"end",gap:1},a.createElement(y.Button,{type:"button",flavour:"borderless",label:"Cancel",small:!0,width:"initial",onClick:s,"data-testid":"textCardForm-cancel"}),a.createElement(y.Button,{type:"button",label:"Done",small:!0,width:"initial",onClick:m,"data-testid":"textCardForm-done"})))},Ke=function(e){return e.stopPropagation()},Qe={toolbar:!1,disableEditing:!0,placeholder:{text:"Type your text",hideOnClick:!1}},Xe=function(e){var t=e.id,n=e.cardId,r=(0,De.I_)(t,n,"text");return a.createElement(y.Box,{"data-testid":"textCardContent",onMouseDown:Ke},a.createElement(Je,{text:r,options:Qe}))},Ge=(0,Ze.default)(Se).withConfig({displayName:"text__StyledCard",componentId:"sc-1f67m9f-0"})(["cursor:move;"]),$e=["id","cardId"],et={chart:Le,text:(0,a.memo)((function(e){var t=e.id,n=e.cardId,r=(0,De.I_)(t,n,"editing");return a.createElement(Ge,{column:!0,"data-testid":"textCard"},a.createElement(We,{id:t,cardId:n}),r&&a.createElement(Ve,{id:t,cardId:n}),!r&&a.createElement(Xe,{id:t,cardId:n}))}))},tt=function(e){var t=e.id,n=e.cardId,r=(0,E.Z)(e,$e),o=(0,De.I_)(t,n,"type"),l=et[o]||et.chart;return a.createElement(l,(0,v.Z)({id:t,cardId:n},r))},nt=["id"],at=function(e){var t=e.id,n=(0,E.Z)(e,nt);return(0,Oe.ZP)(t),a.createElement(ke,(0,v.Z)({id:t,Component:tt},n))};function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){(0,M.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,a.useContext)(r.Us).navigator,o=(0,r.TH)();(0,a.useEffect)((function(){if(t){var a=n.block((function(t){var n=ot(ot({},t),{},{retry:function(){a(),t.retry()}});e(n)}));return a}}),[n,e,t,o])}((0,a.useCallback)((function(t){"REPLACE"!==t.action?window.confirm(e)&&t.retry():t.retry()}),[e]),t)},ct=function(e){var t=e.id,n=(0,b.Z)("addChartModal"),r=(0,p.Z)(n,4),o=r[0],l=r[3],c=(0,s.LJ)(t),d=c.fullyLoaded,i=c.cardIds;return function(e){var t=(0,s.DS)(e);lt("Are you sure you want to leave this dashboard?\nChanges will be lost.",!t)}(t),a.createElement(K.Z,{padding:[3],margin:[0,0,8,0]},a.createElement(ge,{id:t}),d&&i.length>0&&a.createElement(at,{id:t}),d&&0===i.length&&a.createElement(I,null),o&&a.createElement(V,{id:t,onClose:l}))},dt=(0,a.memo)((function(){(0,d.Z)(),function(){var e=(0,r.UO)().dashboardSlug,t=(0,o.Jh)(),n=(0,o.FP)();(0,a.useEffect)((function(){n!==e&&t(e)}),[n,e]),(0,a.useEffect)((function(){return function(){return t(null)}}),[])}(),(0,l.Pf)();var e=(0,c.th)(),t=(0,c.uk)(),n=(0,i.UL)(),h=(0,i.vf)(),p=(0,s.r0)(),b=(0,s.FV)("slug");(0,m.bV)({title:b,id:p,destination:b,type:"dashboards"});var v=(0,u.L)();return(0,f.Z)(v&&p,{spaceId:e,spaceSlug:t,roomId:n,roomSlug:h})?a.createElement(g,null):a.createElement(ct,{id:p})}))}}]); \ No newline at end of file