import{a as e,n as t}from"./preload-helper-DxX6f4wy.js";import{$ as n,t as r}from"./Fade-Bj1YUcWe.js";import{t as i}from"./Box-BoFhqo9n.js";import{t as a}from"./Button-uK26k-ET.js";import{t as o}from"./CircularProgress-zVZJTwOj.js";import{t as s}from"./Save-BfGGeehg.js";var c=e(t(),1),l=n();function u({show:e,saving:t,onClick:n,label:u=`保存`}){let d=(0,c.useRef)(null),[f,p]=(0,c.useState)(284);return(0,c.useEffect)(()=>{let e=d.current?.closest(`main`);if(!e)return;let t=()=>p(Math.round(e.getBoundingClientRect().left)+24);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,l.jsx)(i,{ref:d,sx:{position:`fixed`,bottom:{xs:16,sm:24},left:f,zIndex:e=>e.zIndex.drawer+1,pointerEvents:e?`auto`:`none`,transition:e=>e.transitions.create(`left`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},children:(0,l.jsx)(r,{in:e,timeout:300,children:(0,l.jsx)(a,{variant:`contained`,startIcon:t?(0,l.jsx)(o,{size:16,color:`inherit`}):(0,l.jsx)(s,{}),onClick:n,disabled:t,sx:{px:{xs:3,sm:4},py:1.2,fontWeight:700,boxShadow:e=>e.palette.mode===`light`?`0 8px 24px ${e.palette.primary.main}40`:`0 8px 24px ${e.palette.common.black}55`},children:t?`保存中...`:u})})})}export{u as t};