import{j as a}from"./jsx-runtime-C_974cfT.js";import{r as n}from"./index-BDZD4X5K.js";import{f as g,h}from"./chunk-UIGDSWPH-fNK8sKgt.js";import{j as b,c as y}from"./misc-BOyXKFuR.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:"3ea6c863933c57219be78eb06addfb47859d8df2"}}catch{}})();const j=a.jsx("input",{type:"hidden",name:"show-progress-bar",value:"true"});function S(){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),f=s.every(e=>e==="idle"),c=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",f&&(u?"transition-none":"w-full opacity-0 transition-all"),t&&c&&"w-5/12",t&&m&&"w-8/12")})})}export{S as E,j as s};
//# sourceMappingURL=progress-bar-OaAGU-bF.js.map
