import{j as a}from"./jsx-runtime-CbGirg_M.js";import{r as n}from"./index-BoRhKTB8.js";import{g,d as h}from"./chunk-UIGDSWPH-C8mvmDRm.js";import{d as b,c as y}from"./misc-D4V-U9nd.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};i.SENTRY_RELEASE={id:"28ce3948dcef68c9e8b5be7c5619a3bd17c18150"}}catch{}})();const S=a.jsx("input",{type:"hidden",name:"show-progress-bar",value:"true"});function j(){const i=g(),r=h().filter(e=>e.formData?.get("show-progress-bar")==="true"),s=[i.state,...r.map(e=>e.state)],d=s.some(e=>e!=="idle"),t=b.useSpinDelay(d,{delay:600,minDuration:400}),o=n.useRef(null),[u,l]=n.useState(!0),c=s.every(e=>e==="idle"),f=s.some(e=>e==="submitting"),m=s.some(e=>e==="loading");return n.useEffect(()=>{if(!o.current)return;t&&l(!1);const e=o.current.getAnimations().map(({finished:p})=>p);Promise.allSettled(e).then(()=>{t||l(!0)})},[t]),a.jsx("div",{role:"progressbar","aria-hidden":t?void 0:!0,"aria-valuetext":t?"Loading":void 0,className:"fixed inset-x-0 top-0 left-0 z-50 h-[0.20rem] animate-pulse",children:a.jsx("div",{ref:o,className:y("bg-highlight h-full w-0 duration-500 ease-in-out",c&&(u?"transition-none":"w-full opacity-0 transition-all"),t&&f&&"w-5/12",t&&m&&"w-8/12")})})}export{j as E,S as s};
//# sourceMappingURL=progress-bar-DOQwgoY5.js.map
