import{s as f}from"./icons.f7e2c66d.js";import{d as i,r as u,a as c,b as p,c as v,e as _,bu as y,bh as b,eA as m,ew as g,t as h}from"./registerWidgets.92d2f644.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="88850e6d-a76a-4aa8-be5f-d6a7f8990deb",a._sentryDebugIdIdentifier="sentry-dbid-88850e6d-a76a-4aa8-be5f-d6a7f8990deb")}catch{}})();const w=i({__name:"SaveButton",props:{model:{}},setup(a){const n=a,t=u(!1);async function s(){t.value=!0;try{await n.model.save()}finally{t.value=!1}}return addEventListener("keydown",e=>{(e.metaKey||e.ctrlKey)&&e.key==="s"&&(e.preventDefault(),s())}),addEventListener("beforeunload",e=>{n.model.hasChanges()&&(e.preventDefault(),e.returnValue="")}),(e,o)=>{var d,r;const l=c("icon");return p(),v("button",{class:g(["save-button",{changes:(d=e.model)==null?void 0:d.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[_(l,{class:"icon",path:y(f),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),b(" "+m(t.value?"Saving ...":(r=e.model)!=null&&r.hasChanges()?"Save":"Saved"),1)],2)}}});const k=h(w,[["__scopeId","data-v-15752ff4"]]);export{k as S};
//# sourceMappingURL=SaveButton.b5e9b367.js.map
