const E=(function(){const r=typeof document<"u"&&document.createElement("link").relList;return r&&r.supports&&r.supports("modulepreload")?"modulepreload":"preload"})(),y=function(a,r){return new URL(a,r).href},v={},w=function(r,u,d){let f=Promise.resolve();if(u&&u.length>0){let s=function(e){return Promise.all(e.map(o=>Promise.resolve(o).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};const t=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=h?.nonce||h?.getAttribute("nonce");f=s(u.map(e=>{if(e=y(e,d),e in v)return;v[e]=!0;const o=e.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!d)for(let c=t.length-1;c>=0;c--){const i=t[c];if(i.href===e&&(!o||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${l}`))return;const n=document.createElement("link");if(n.rel=o?"stylesheet":E,o||(n.as="script"),n.crossOrigin="",n.href=e,p&&n.setAttribute("nonce",p),document.head.appendChild(n),o)return new Promise((c,i)=>{n.addEventListener("load",c),n.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${e}`)))})}))}function m(s){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=s,window.dispatchEvent(t),!t.defaultPrevented)throw s}return f.then(s=>{for(const t of s||[])t.status==="rejected"&&m(t.reason);return r().catch(m)})};export{w as _};
//# sourceMappingURL=preload-helper-Du-ZIQLl.js.map
