import{a as x,h as d}from"/build/_shared/chunk-FCFTNN44.js";import{A as u,a as P,f as l,m}from"/build/_shared/chunk-IYEHZB2Y.js";import{d as s}from"/build/_shared/chunk-4AMCPB2Y.js";var i=s(P(),1),f=s(x(),1);var o=s(u(),1),E=(0,o.jsx)("input",{type:"hidden",name:"show-progress-bar",value:"true"});function L(){let c=l(),p=m().filter(e=>e.formData?.get("show-progress-bar")==="true"),n=[c.state,...p.map(e=>e.state)],g=n.some(e=>e!=="idle"),t=(0,f.useSpinDelay)(g,{delay:600,minDuration:400}),r=(0,i.useRef)(null),[h,a]=(0,i.useState)(!0),v=n.every(e=>e==="idle"),b=n.some(e=>e==="submitting"),w=n.some(e=>e==="loading");return(0,i.useEffect)(()=>{if(!r.current)return;t&&a(!1);let e=r.current.getAnimations().map(({finished:y})=>y);Promise.allSettled(e).then(()=>{t||a(!0)})},[t]),(0,o.jsx)("div",{role:"progressbar","aria-hidden":t?void 0:!0,"aria-valuetext":t?"Loading":void 0,className:"fixed inset-x-0 left-0 top-0 z-50 h-[0.20rem] animate-pulse",children:(0,o.jsx)("div",{ref:r,className:d("bg-highlight h-full w-0 duration-500 ease-in-out",v&&(h?"transition-none":"w-full opacity-0 transition-all"),t&&b&&"w-5/12",t&&w&&"w-8/12")})})}export{E as a,L as b};
//# sourceMappingURL=/build/_shared/chunk-LIQTNBUG.js.map
