import{eM as i,b as s,c as u,h as l,be as d,J as h,Q as m,H as f,l as g,i as p,t as C,X as S}from"./index-6Jqoo2rk.js";import{I as b}from"./iconTsx-Cr8T7ZIv.js";import{T as y}from"./transition-DuxZkCEv.js";import{t as E}from"./appDialogsManager-DnVhdlim.js";const H=({descriptionLangKey:e,hasChanges:n,saveAllSettings:t})=>{const{confirmationPopup:r}=i();return async()=>{if(!n())return;const a={langKey:"Save"};try{return await r({titleLangKey:"UnsavedChanges",descriptionLangKey:e,button:a,buttons:[a,{isCancel:!0,langKey:"Discard"}],rejectWithReason:!0}),t(),!0}catch(c){if(c==="closed")throw new Error}}},o=(e=!1)=>async(n,t)=>{const r=["scale(0)","scale(1)"];e&&r.reverse(),await n.animate({transform:r},{duration:80}).finished,t()},k=e=>s(y,{get onEnter(){return o()},get onExit(){return o(!0)},get children(){return e.children}});function w(e,n){const[t,r]=u(e()),a=n(()=>r(()=>e()));return l(()=>{E(e),a()}),t}function v(e,n,t){return w(e,r=>d(r,n,t))}const T=C('<button class="btn-icon blue">'),L=e=>{const n=v(()=>e.hasChanges,200,!0);return s(k,{get children(){return s(h,{get when(){return n()},get children(){const t=T();return m(t,"click",e.onClick,!0),f(g,t,()=>!0),p(t,s(b,{icon:"check"})),t}})}})};S(["click"]);export{L as S,H as u};
//# sourceMappingURL=saveButton-BN9ptO_C.js.map
