const e={},t=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let t=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};const s=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");o=t(n.map(t=>{if(t=function(e,t){return new URL(e,t).href}(t,r),t in e)return;e[t]=!0;const n=t.endsWith(".css"),o=n?'[rel="stylesheet"]':"";if(!!r)for(let e=s.length-1;e>=0;e--){const r=s[e];if(r.href===t&&(!n||"stylesheet"===r.rel))return}else if(document.querySelector(`link[href="${t}"]${o}`))return;const l=document.createElement("link");return l.rel=n?"stylesheet":"modulepreload",n||(l.as="script"),l.crossOrigin="",l.href=t,c&&l.setAttribute("nonce",c),document.head.appendChild(l),n?new Promise((e,n)=>{l.addEventListener("load",e),l.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${t}`)))}):void 0}))}function s(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(e=>{for(const t of e||[])"rejected"===t.status&&s(t.reason);return t().catch(s)})};export{t as _};
