import{j as c}from"./icons.96408396.js";import{d as i,r as f,b as u,c as v,e as p,z as y,S as _,N as m,G as g,a as b,q as h}from"./registerWidgets.5bbfbb1a.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]="7e2cdb74-52f7-4675-956d-169092e090cd",e._sentryDebugIdIdentifier="sentry-dbid-7e2cdb74-52f7-4675-956d-169092e090cd")}catch{}})();const S=i({__name:"SaveButton",props:{model:null},setup(e){const t=e,a=f(!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 d,l;const r=b("icon");return u(),v("button",{class:g(["save-button",{changes:(d=e.model)==null?void 0:d.hasChanges()}]),onClick:o[0]||(o[0]=w=>s())},[p(r,{class:"icon",path:y(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),_(" "+m(a.value?"Saving ...":(l=e.model)!=null&&l.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(S,[["__scopeId","data-v-42786fd0"]]);export{k as S};
//# sourceMappingURL=SaveButton.57139731.js.map
