import{ej as _,cI as N,cJ as A,fk as q,cL as U,fL as B,fM as E,ex as I,fN as V,e9 as L,fO as O,fP as F,fQ as k,cO as x,fR as T,fS as H,dd as D,f3 as M,fT as z,fU as W,fV as Q}from"./BC4hLSsA.js";async function j(t,a=_()){const{path:d,matched:S}=a.resolve(t);if(!S.length||(a._routePreloaded||(a._routePreloaded=new Set),a._routePreloaded.has(d)))return;const g=a._preloadPromises||(a._preloadPromises=[]);if(g.length>4)return Promise.all(g).then(()=>j(t,a));a._routePreloaded.add(d);const e=S.map(n=>{var o;return(o=n.components)==null?void 0:o.default}).filter(n=>typeof n=="function");for(const n of e){const o=Promise.resolve(n()).catch(()=>{}).finally(()=>g.splice(g.indexOf(o)));g.push(o)}await Promise.all(g)}const $=(...t)=>t.find(a=>a!==void 0);function G(t){const a=t.componentName||"NuxtLink";function d(e){return typeof e=="string"&&e.startsWith("#")}function S(e,n,o){const l=o??t.trailingSlash;if(!e||l!=="append"&&l!=="remove")return e;if(typeof e=="string")return C(e,l);const c="path"in e&&e.path!==void 0?e.path:n(e).path;return{...e,name:void 0,path:C(c,l)}}function g(e){const n=_(),o=D(),l=x(()=>!!e.target&&e.target!=="_self"),c=x(()=>{const v=e.to||e.href||"";return typeof v=="string"&&T(v,{acceptRelative:!0})}),P=O("RouterLink"),p=P&&typeof P!="string"?P.useLink:void 0,m=x(()=>{if(e.external)return!0;const v=e.to||e.href||"";return typeof v=="object"?!1:v===""||c.value}),i=x(()=>{const v=e.to||e.href||"";return m.value?v:S(v,n.resolve,e.trailingSlash)}),f=m.value||p==null?void 0:p({...e,to:i}),y=x(()=>{var R;const v=e.trailingSlash??t.trailingSlash;if(!i.value||c.value||d(i.value))return i.value;if(m.value){const b=typeof i.value=="object"&&"path"in i.value?k(i.value):i.value,r=typeof b=="object"?n.resolve(b).href:b;return C(r,v)}return typeof i.value=="object"?((R=n.resolve(i.value))==null?void 0:R.href)??null:C(H(o.app.baseURL,i.value),v)});return{to:i,hasTarget:l,isAbsoluteUrl:c,isExternal:m,href:y,isActive:(f==null?void 0:f.isActive)??x(()=>i.value===n.currentRoute.value.path),isExactActive:(f==null?void 0:f.isExactActive)??x(()=>i.value===n.currentRoute.value.path),route:(f==null?void 0:f.route)??x(()=>n.resolve(i.value)),async navigate(v){await M(y.value,{replace:e.replace,external:m.value||l.value})}}}return N({name:a,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:g,setup(e,{slots:n}){const o=_(),{to:l,href:c,navigate:P,isExternal:p,hasTarget:m,isAbsoluteUrl:i}=g(e),f=A(!1),y=A(null),v=r=>{var s;y.value=e.custom?(s=r==null?void 0:r.$el)==null?void 0:s.nextElementSibling:r==null?void 0:r.$el};function R(r){var s,u;return!f.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===r:((s=e.prefetchOn)==null?void 0:s[r])??((u=t.prefetchOn)==null?void 0:u[r]))&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!X()}async function b(r=q()){if(f.value)return;f.value=!0;const s=typeof l.value=="string"?l.value:p.value?k(l.value):o.resolve(l.value).fullPath,u=p.value?new URL(s,window.location.href).href:s;await Promise.all([r.hooks.callHook("link:prefetch",u).catch(()=>{}),!p.value&&!m.value&&j(l.value,o).catch(()=>{})])}if(R("visibility")){const r=q();let s,u=null;U(()=>{const h=J();B(()=>{s=E(()=>{var w;(w=y==null?void 0:y.value)!=null&&w.tagName&&(u=h.observe(y.value,async()=>{u==null||u(),u=null,await b(r)}))})})}),I(()=>{s&&V(s),u==null||u(),u=null})}return()=>{var u;if(!p.value&&!m.value&&!d(l.value)){const h={ref:v,to:l.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(R("interaction")&&(h.onPointerenter=b.bind(null,void 0),h.onFocus=b.bind(null,void 0)),f.value&&(h.class=e.prefetchedClass||t.prefetchedClass),h.rel=e.rel||void 0),L(O("RouterLink"),h,n.default)}const r=e.target||null,s=$(e.noRel?"":e.rel,t.externalRelAttribute,i.value||m.value?"noopener noreferrer":"")||null;return e.custom?n.default?n.default({href:c.value,navigate:P,prefetch:b,get route(){if(!c.value)return;const h=new URL(c.value,window.location.href);return{path:h.pathname,fullPath:h.pathname,get query(){return F(h.search)},hash:h.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:c.value}},rel:s,target:r,isExternal:p.value||m.value,isActive:!1,isExactActive:!1}):null:L("a",{ref:y,href:c.value||null,rel:s,target:r},(u=n.default)==null?void 0:u.call(n))}}})}const Z=G(Q);function C(t,a){const d=a==="append"?z:W;return T(t)&&!t.startsWith("http")?t:d(t,!0)}function J(){const t=q();if(t._observer)return t._observer;let a=null;const d=new Map,S=(e,n)=>(a||(a=new IntersectionObserver(o=>{for(const l of o){const c=d.get(l.target);(l.isIntersecting||l.intersectionRatio>0)&&c&&c()}})),d.set(e,n),a.observe(e),()=>{d.delete(e),a==null||a.unobserve(e),d.size===0&&(a==null||a.disconnect(),a=null)});return t._observer={observe:S}}const K=/2g/;function X(){const t=navigator.connection;return!!(t&&(t.saveData||K.test(t.effectiveType)))}export{Z as _};