import{d as U,r as f,c as v,o as F,aa as R,e as a,f as o,m as h,g as r,ag as Y,ac as _,t as C,F as $,l as E,p as g,h as K,a7 as q,j as G,ad as J}from"./NkN6QURX.js";import{N as Q,a as W}from"./CNCm6GeN.js";const X={href:"/",class:"flex min-w-0 items-center gap-3"},Z=["src","alt"],ee={key:1,class:"truncate text-xl font-bold tracking-[0.08em] text-white md:text-2xl lg:text-[28px]"},te={class:"hidden items-center justify-center lg:flex"},ne={class:"flex items-stretch gap-1 xl:gap-2"},ae=["onMouseenter"],oe=["href","onClick"],se={key:1,class:"absolute bottom-3 left-1/2 h-0.5 w-6 -translate-x-1/2 rounded-full bg-white"},le=["onMouseenter"],re=["aria-expanded"],ie={key:0,class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ue={key:1,class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ce={key:0,class:"bg-[var(--theme-primary-color)] px-4 py-4 shadow-lg lg:hidden"},de={class:"flex flex-col gap-1"},ve=["href","onClick"],he=["aria-expanded","onClick"],pe={key:0,class:"bg-white/10"},we=U({__name:"NavLayout11",props:{navData:{},positioning:{default:"fixed"}},setup(A){const n=A,c=f(!1),d=f(null),M=f(!1),k=f(null),D=f(64),H=v(()=>n.positioning==="fixed"||n.positioning==="sticky"),y=()=>{k.value&&(D.value=k.value.offsetHeight)},V=v(()=>M.value||n.positioning!=="fixed"),O=v(()=>n.positioning==="absolute"?"absolute":n.positioning==="static"?"static":n.positioning==="sticky"?"sticky":"fixed"),N=v(()=>{console.log(n.navData);const e=n.navData?.navItems;return Array.isArray(e)?e:[]}),I=v(()=>n.navData?.bindings?.brandName||n.navData?.bindings?.organizationName||""),j=v(()=>n.navData?.logoUrl||""),m=v(()=>n.navData?.activeIndex??0),i=(e,s)=>e?.id??e?.name??s,p=e=>Array.isArray(e?.children)&&e.children.length>0,L=e=>e?.nameDisplay||e?.name||"",w=e=>typeof n.navData?.getCachedLink=="function"?n.navData.getCachedLink(e):e?.href||e?.link||e?.url||"#",x=e=>n.navData?.openDropdown?.(e),B=()=>{c.value=!1,d.value=null},P=()=>{c.value=!c.value,c.value||(d.value=null)},T=e=>{d.value=d.value===e?null:e},z=(e,s)=>{n.navData?.handleParentClick?.(e,s),p(e)||B()},S=e=>{n.navData?.handleChildClick?.(e),B()},b=()=>{M.value=(window.scrollY||window.pageYOffset||0)>10};return F(()=>{b(),y(),window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",y)}),R(()=>{window.removeEventListener("scroll",b),window.removeEventListener("resize",y)}),(e,s)=>(o(),a("div",null,[H.value?(o(),a("div",{key:0,"aria-hidden":"true",class:"lg:hidden",style:Y({height:`${D.value}px`})},null,4)):h("",!0),r("header",{class:g([O.value,"top-0 left-0 right-0 z-50 w-full transition-colors duration-300",V.value?"bg-[var(--theme-primary-color)] shadow-lg":"bg-[var(--theme-primary-color)] shadow-lg lg:bg-transparent lg:shadow-none"])},[r("div",{ref_key:"navBarRef",ref:k,class:"flex w-full py-3 md:py-4 items-center justify-between gap-4 px-4 md:px-8 lg:px-[12%]"},[r("a",X,[j.value?(o(),a("img",{key:0,src:j.value,alt:I.value,class:"h-10 w-auto object-contain md:h-12 lg:h-14",loading:"eager"},null,8,Z)):(o(),a("span",ee,C(I.value),1))]),r("nav",te,[r("div",ne,[(o(!0),a($,null,E(N.value,(t,l)=>(o(),a("div",{key:i(t,l),class:"relative flex",onMouseenter:u=>x(i(t,l)),onMouseleave:s[1]||(s[1]=u=>x(null))},[r("a",{href:w(t),class:g(["relative flex items-center gap-1 whitespace-nowrap px-4 py-5 text-[16px] font-medium text-white/90 transition-colors hover:text-white",{"text-white":l===m.value}]),onClick:u=>z(t,u)},[K(C(L(t))+" ",1),p(t)?(o(),a("svg",{key:0,class:g(["h-4 w-4 transition-transform",{"rotate-180":n.navData?.openIndex===i(t,l)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[2]||(s[2]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2)):h("",!0),l===m.value?(o(),a("span",se)):h("",!0)],10,oe),p(t)&&n.navData?.openIndex===i(t,l)?(o(),a("div",{key:0,class:"absolute left-1/2 top-full z-20 min-w-full -translate-x-1/2",onMouseenter:u=>x(i(t,l)),onMouseleave:s[0]||(s[0]=u=>x(null))},[_(Q,{items:t.children,"get-item-href":w,"menu-class":"mt-1 overflow-hidden rounded-lg bg-white shadow-xl","link-class":"whitespace-nowrap px-6 py-3 text-center text-sm text-slate-700 transition hover:bg-[var(--theme-primary-color)] hover:text-white",onItemClick:S},null,8,["items"])],40,le)):h("",!0)],40,ae))),128))])]),r("button",{type:"button",class:"inline-flex h-10 w-10 items-center justify-center rounded-full border border-white/60 text-white transition hover:bg-white/15 lg:hidden","aria-expanded":c.value,"aria-label":"Toggle navigation menu",onClick:P},[c.value?(o(),a("svg",ue,[...s[4]||(s[4]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)])])):(o(),a("svg",ie,[...s[3]||(s[3]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"},null,-1)])]))],8,re)],512),_(J,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"opacity-0 -translate-y-2","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-2"},{default:q(()=>[c.value?(o(),a("div",ce,[r("div",de,[(o(!0),a($,null,E(N.value,(t,l)=>(o(),a("div",{key:i(t,l),class:"overflow-hidden rounded-lg"},[r("div",{class:g(["flex items-center justify-between",{"bg-white/15":l===m.value}])},[r("a",{href:w(t),class:"flex-1 px-4 py-3 text-sm font-medium text-white transition",onClick:u=>z(t,u)},C(L(t)),9,ve),p(t)?(o(),a("button",{key:0,type:"button",class:"px-4 py-3 text-white/80 transition hover:text-white","aria-expanded":d.value===i(t,l),onClick:G(u=>T(i(t,l)),["prevent"])},[(o(),a("svg",{class:g(["h-4 w-4 transition-transform",{"rotate-180":d.value===i(t,l)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[5]||(s[5]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],8,he)):h("",!0)],2),p(t)&&d.value===i(t,l)?(o(),a("div",pe,[_(W,{items:t.children,"get-item-href":w,"link-class":"px-6 py-3 text-sm text-white/90 transition hover:bg-white/10 hover:text-white",onItemClick:S},null,8,["items"])])):h("",!0)]))),128))])])):h("",!0)]),_:1})],2)]))}});export{we as default};
