import{i as v,j as c,T as d,p}from"./mui-vendor-CkIVaoQP.js";import{r as i}from"./react-vendor-CmFgShSM.js";import{r as m,G as C}from"./index-Cr86_nOs.js";const y=a=>{var r=parseInt(a,10),u=Math.floor(r/3600),e=Math.floor(r/60)%60,o=r%60;return[u,e,o].map(t=>t<10?"0"+t:t).filter((t,s)=>t!=="00"||s>0).join(":")},M=a=>{const r=Number(a);var u=Math.floor(r/(3600*24)),e=Math.floor(r%(3600*24)/3600),o=Math.floor(r%3600/60),t=u>0?u+" روز ":"",s=e>0?e+" ساعت ":"",n=o>0?o+" دقیقه ":"";return t+s+n};var l={},h=v;Object.defineProperty(l,"__esModule",{value:!0});var f=l.default=void 0,x=h(m()),j=c;f=l.default=(0,x.default)((0,j.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");const E=({seconds:a,isFilePaymentTime:r})=>{r=r||!1;const[u,e]=i.useState(Math.round(a)),o=()=>{e(n=>n-1)};i.useEffect(()=>(e(a),()=>e(0)),[a]),i.useEffect(()=>{if(u<=0)return;const n=setInterval(o,1e3);return()=>clearInterval(n)},[]);const t=u<=0?"پایان یافته!":y(u),s=u<=0?"پایان یافته!":M(u);return c.jsxs(C,{container:!0,alignItems:"center",justifyContent:"center",children:[c.jsx(f,{color:"error",fontSize:"small",className:"timerIcon"}),c.jsxs(d,{variant:"body2",children:[!r&&t,r&&s]})]})};E.propTypes={seconds:p.PropTypes.any,isFilePaymentTime:p.PropTypes.any};export{E as T};
