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