import{s as f}from"./icons.de44105b.js";import{d as i,r as c,b as u,c as v,e as p,z as y,U as _,N as m,G as g,a as h,q as b}from"./registerWidgets.c1da2b93.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2629dfd2-6efa-44e1-978e-c72333323026",e._sentryDebugIdIdentifier="sentry-dbid-2629dfd2-6efa-44e1-978e-c72333323026")}catch{}})();const w=i({__name:"SaveButton",props:{model:null},setup(e){const t=e,a=c(!1);async function s(){a.value=!0;try{await t.model.save()}finally{a.value=!1}}return addEventListener("keydown",n=>{(n.metaKey||n.ctrlKey)&&n.key==="s"&&(n.preventDefault(),s())}),addEventListener("beforeunload",n=>{t.model.hasChanges()&&(n.preventDefault(),n.returnValue="")}),(n,o)=>{var l,d;const r=h("icon");return u(),v("button",{class:g(["save-button",{changes:(l=e.model)==null?void 0:l.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[p(r,{class:"icon",path:y(f),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),_(" "+m(a.value?"Saving ...":(d=e.model)!=null&&d.hasChanges()?"Save":"Saved"),1)],2)}}});const k=b(w,[["__scopeId","data-v-15752ff4"]]);export{k as S};
//# sourceMappingURL=SaveButton.a23c7b97.js.map
