1import{r as n,j as e}from"./vendor-react-BQobPn2Z.js";import{d as U,u as z,L as b}from"./vendor-router-C23-jnjR.js";import{T as B,N as W}from"./navigation-IXkQMceL.js";import{u as G,D as V,M as F}from"./usePageNotesVisible-BvQIw3Tr.js";import{a4 as Q,u as R,a5 as q,Q as c,a6 as Y,q as _}from"./index-CtLIdj0S.js";import{U as $}from"./user-Bb_Q8AC0.js";const oe=({showPhone:J=!1,transparent:p=!1})=>{const{user:a,isAuthenticated:j,logout:k}=Q(),y=U(),L=z(),s=R(),[g,M]=G(),f=L.pathname==="/home"?"/main":"/home",[i,C]=n.useState(!1),[v,E]=n.useState([]),[w,O]=n.useState(!0),[r,N]=n.useState(!1),[K,P]=n.useState(!1),[u,h]=n.useState(!1);n.useEffect(()=>{s.setIsMobileMenuOpen(r)},[r,s]),n.useEffect(()=>{const t=o=>{const m=o.target;u&&!m.closest(".user-dropdown-container")&&h(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]),n.useEffect(()=>{const t=()=>{P(document.documentElement.classList.contains("dark"))};t();const o=new MutationObserver(t);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>o.disconnect()},[]),n.useEffect(()=>{const t=()=>{const o=window.scrollY>50;o!==i&&C(o)};return window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[i]),n.useEffect(()=>{const t=async()=>{try{const m=new AbortController,H=setTimeout(()=>m.abort(),5e3),x=await W.getPublished();clearTimeout(H),x.success&&x.data&&E(x.data)}catch{}finally{O(!1)}};t();const o=()=>{t()};return window.addEventListener("navigation-updated",o),()=>{window.removeEventListener("navigation-updated",o)}},[]);const l=s.variant!=="default";s.brand&&q[s.brand].accent;const d=l?s.scrollPhase!=="past-hero"&&!s.isMegaMenuOpen:p&&!i&&!s.isMegaMenuOpen,S=()=>{if(l)switch(s.scrollPhase){case"top":return"bg-transparent";case"in-hero":return"";case"past-hero":return"bg-background/95 backdrop-blur-lg shadow-sm border-b border-border/20"}return p&&!i?"bg-transparent":i?"bg-background/80 backdrop-blur-lg shadow-sm border-b border-border/20":"bg-transparent"},D=c("fixed top-0 left-0 w-full z-50 transition-all duration-300",l&&s.scrollPhase!=="top"||i?"py-2":"py-4",S()),I={...s.isNewsPanelOpen?{pointerEvents:"none"}:{},...l&&s.scrollPhase==="in-hero"?{backgroundColor:"rgb(2 6 23)"}:{}},T=d?"text-white/80":"text-muted-foreground",A=l?s.scrollPhase==="past-hero":i;return e.jsxs("header",{className:D,style:I,children:[e.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 relative z-50",children:e.jsxs("div",{className:"flex items-center justify-between h-16",children:[e.jsx("div",{className:"flex-shrink-0 w-24 sm:w-32",style:{pointerEvents:"auto"},children:A?e.jsx("div",{className:"collapsed-logo",children:e.jsx(b,{to:f,"aria-label":"CPG.io",children:e.jsx(Y,{size:40,animated:!1,className:"text-foreground dark:text-primary transition-colors duration-300"})})}):e.jsx("div",{className:"expanded-logo",children:e.jsx(b,{to:f,className:c("font-bold text-xl sm:text-2xl",d?"text-white":"text-foreground"),children:"CPGIO"})})}),!s.isNewsPanelOpen&&e.jsx("div",{className:"hidden lg:flex flex-1 justify-center",style:{pointerEvents:"auto"},children:e.jsx("div",{className:"flex items-center",children:w?e.jsx("div",{className:"flex space-x-4 items-center",children:e.jsxs("div",{className:"animate-pulse flex space-x-4",children:[e.jsx("div",{className:"h-4 w-16 bg-muted rounded"}),e.jsx("div",{className:"h-4 w-20 bg-muted rounded"}),e.jsx("div",{className:"h-4 w-18 bg-muted rounded"}),e.jsx("div",{className:"h-4 w-22 bg-muted rounded"})]})}):e.jsx(V,{navigationData:v,notesVisible:g})})}),!s.isNewsPanelOpen&&e.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-4",style:{pointerEvents:"auto"},children:[e.jsx(B,{useWhiteIcon:d}),j&&e.jsxs("div",{className:"hidden md:block relative user-dropdown-container",children:[e.jsx("button",{onClick:()=>h(!u),className:c("flex items-center justify-center w-8 h-8 rounded-full transition-all",d?"bg-white/20 hover:bg-white/30 text-white":"bg-muted hover:bg-accent text-foreground"),title:`Signed in as ${a==null?void 0:a.email}`,children:e.jsx($,{className:"w-4 h-4"})}),u&&e.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-background border border-border rounded-md shadow-lg py-1 z-50",children:[e.jsx("div",{className:"px-4 py-2 text-sm text-muted-foreground border-b border-border",children:(a==null?void 0:a.name)||(a==null?void 0:a.email)}),e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-foreground",children:"Hide Notes"}),e.jsx(_,{checked:!g,onCheckedChange:t=>M(!t)})]})}),e.jsx("button",{onClick:async()=>{h(!1),await k(),y("/")},className:"w-full text-left px-4 py-2 text-sm text-foreground hover:bg-accent transition-colors",children:"Log out"})]})]}),e.jsxs(b,{to:"/lets-talk",className:c("text-sm sm:text-base px-3 py-1.5 sm:px-4 sm:py-2 rounded-md border-2 font-medium transition-colors",d?"border-white text-white hover:bg-white hover:text-slate-900":"bg-white border-slate-200 text-slate-900 hover:bg-slate-50 dark:bg-white dark:border-slate-300 dark:text-slate-900 dark:hover:bg-slate-100"),children:[e.jsx("span",{className:"hidden sm:inline",children:"Let's Talk"}),e.jsx("span",{className:"sm:hidden",children:"Let's Talk"})]}),e.jsxs("button",{onClick:()=>N(!r),className:c("lg:hidden inline-flex items-center justify-center p-2 rounded-md transition-colors","focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary",T,"hover:bg-accent"),"aria-expanded":r,children:[e.jsx("span",{className:"sr-only",children:r?"Close menu":"Open menu"}),r?e.jsx("svg",{className:"block h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):e.jsx("svg",{className:"block h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})]})]})]})}),r&&!w&&e.jsx(F,{navigationData:v,isOpen:r,onClose:()=>N(!1)})]})};export{oe as H};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.