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