import{dk as m,l as b,a as c,o as g,j as s,E as D,G as R,dT as f,aS as w}from"./app-BgLa5dit.js";import{D as P,E as S}from"./LqVj63BJ.chunk.js";import{D as j}from"./BE59vaMU.chunk.js";import{u as x}from"./kHNgJL0M.chunk.js";import"./KIVqng-q.chunk.js";function q(t){var r;const h=m(),n=b(),a=x(t.dashboardId),u=c.getDashboardTargetInfo(a.data),e=c.isContentPartnerDashboard(u),d=g(e&&f.contentRegions());function l(o){const p=w.omit(a.data,["widgets"]);h(j.updateDashboard(t.dashboardId,{...p,contentRegion:o.contentRegion,name:o.name,description:o.description},()=>n.success("Successfully updated the dashboard"),()=>n.error("Something went wrong when updating the dashboard"),t.closePopup))}const i=!!a.data&&(!e||!!d.data);return s.jsx(D,{title:"Edit dashboard",closePopup:t.closePopup,showLoadingSpinner:!i,children:i&&s.jsx(R,{initialValues:{name:a.data.name,description:a.data.description,contentRegion:a.data.contentRegion},validationSchema:P,onSubmit:l,children:s.jsx(S,{isNew:!1,closePopup:t.closePopup,dashboardWidgets:a.data.widgets,showRegionField:e,contentRegions:(r=d.data)==null?void 0:r.data})})})}export{q as EditDashboardDetailsView};
//# sourceMappingURL=Dxf5AXhb.chunk.js.map
