import{j as c}from"./icons.da9eecb0.js";import{d as i,r as u,b as f,c as v,e as b,z as p,S as y,N as _,G as m,a as g,q as h}from"./registerWidgets.c33434b6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="95ac4de9-9073-46dd-b07c-a0bb9b5bd156",e._sentryDebugIdIdentifier="sentry-dbid-95ac4de9-9073-46dd-b07c-a0bb9b5bd156")}catch{}})();const S=i({__name:"SaveButton",props:{model:null},setup(e){const n=e,t=u(!1);async function s(){t.value=!0;try{await n.model.save()}finally{t.value=!1}}return addEventListener("keydown",a=>{(a.metaKey||a.ctrlKey)&&a.key==="s"&&(a.preventDefault(),s())}),addEventListener("beforeunload",a=>{n.model.hasChanges()&&(a.preventDefault(),a.returnValue="")}),(a,o)=>{var d,l;const r=g("icon");return f(),v("button",{class:m(["save-button",{changes:(d=e.model)==null?void 0:d.hasChanges()}]),onClick:o[0]||(o[0]=w=>s())},[b(r,{class:"icon",path:p(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),y(" "+_(t.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.c0453eb5.js.map
