import{s as c}from"./icons.0e440585.js";import{d as i,r as f,a as u,b as p,c as v,e as _,bu as y,bh as m,eA as g,ew as b,t as h}from"./registerWidgets.0d6f36c3.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]="2d1442a4-a28d-403e-9c49-6cda830082c0",a._sentryDebugIdIdentifier="sentry-dbid-2d1442a4-a28d-403e-9c49-6cda830082c0")}catch{}})();const w=i({__name:"SaveButton",props:{model:{}},setup(a){const n=a,t=f(!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=u("icon");return p(),v("button",{class:b(["save-button",{changes:(d=e.model)==null?void 0:d.hasChanges()}]),onClick:o[0]||(o[0]=S=>s())},[_(l,{class:"icon",path:y(c),width:"20",height:"20",fill:"#5A677A"},null,8,["path"]),m(" "+g(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.7a9867ae.js.map
