import{j as a}from"./jsx-runtime-agliiQSw.js";import{r as n}from"./index-BtyHvDgk.js";import{g,d as h}from"./chunk-UIGDSWPH-1hkfewjj.js";import{j as b,c as y}from"./misc-CJRwnByf.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:"8bd8bc3153d70a1c10ccde8d38796bd67282553d"}}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)],l=s.some(e=>e!=="idle"),t=b.useSpinDelay(l,{delay:600,minDuration:400}),o=n.useRef(null),[u,d]=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&&d(!1);const e=o.current.getAnimations().map(({finished:p})=>p);Promise.allSettled(e).then(()=>{t||d(!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{S as E,j as s};
//# sourceMappingURL=progress-bar-CF3aJM3k.js.map
