import{j as i}from"./icons.0b88355c.js";import{d as c,r as u,b as f,c as b,e as v,z as p,S as y,N as _,G as m,a as g,q as h}from"./registerWidgets.ef15081f.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]="f72bcbb7-8235-4462-bb87-39a2b2ab3a26",e._sentryDebugIdIdentifier="sentry-dbid-f72bcbb7-8235-4462-bb87-39a2b2ab3a26")}catch{}})();const S=c({__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 l,r;const d=g("icon");return f(),b("button",{class:m(["save-button",{changes:(l=e.model)==null?void 0:l.hasChanges()}]),onClick:o[0]||(o[0]=w=>s())},[v(d,{class:"icon",path:p(i),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),y(" "+_(t.value?"Saving ...":(r=e.model)!=null&&r.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(S,[["__scopeId","data-v-0e370bd3"]]);export{k as S};
//# sourceMappingURL=SaveButton.fd7bd133.js.map
