1import{N as C,a9 as K,U as z,s as S,at as M,w as _,Z as A,bP as E,$ as L,a0 as P,h as I,g as f,T as O,bQ as R,a5 as U,B as $,G as W,a7 as T,a8 as q,j as e,M as G,y as V,A as y,m,J as F,z as v,X as B}from"./vendor-ui-CD0lB9-C.js";import{u as D,f as H,r as i,O as J}from"./vendor-react-D3UwUeXW.js";import{b as Z,u as Q}from"./index-nIlOdFcw.js";import"./vendor-socket-DBwSfdIm.js";const X=[{key:"dashboard",icon:C,path:"/nova",pageKey:"dashboard",badge:!0,label:"Chat"},{key:"kanban",icon:K,path:"/nova/kanban",pageKey:"kanban",label:"Pipeline"},{key:"crm",icon:z,path:"/nova/crm",pageKey:"crm",label:"Contactos"},{key:"analiticas",icon:S,path:"/nova/analiticas",pageKey:"analiticas",label:"Analiticas"}],p=[{group:"Marketing",items:[{key:"campanas",icon:M,path:"/nova/campanas",pageKey:"campanas",label:"Campanas"},{key:"email",icon:_,path:"/nova/email-marketing",pageKey:"email-marketing",label:"Email"},{key:"workflows",icon:A,path:"/nova/workflows",pageKey:"workflows",label:"Workflows"},{key:"secuencias",icon:E,path:"/nova/secuencias",pageKey:"secuencias",label:"Secuencias"},{key:"calendar",icon:L,path:"/nova/calendar",pageKey:"calendar",label:"Calendario"}]},{group:"Comercial",items:[{key:"cotizaciones",icon:P,path:"/nova/cotizaciones",pageKey:"cotizaciones",label:"Cotizaciones"},{key:"pedidos",icon:I,path:"/nova/pedidos",pageKey:"pedidos",label:"Pedidos"},{key:"templatePdf",icon:f,path:"/nova/template-pdf",pageKey:"template-pdf",label:"Plantillas"}]},{group:"Gestion",items:[{key:"tickets",icon:O,path:"/nova/tickets",pageKey:"tickets",label:"Tickets"},{key:"solicitudes",icon:f,path:"/nova/solicitudes",pageKey:"solicitudes",label:"Solicitudes"},{key:"sesiones",icon:R,path:"/nova/sesiones-equipo",pageKey:"sesiones-equipo",label:"Sesiones"}]},{group:"Configuracion",items:[{key:"general",icon:U,path:"/nova/configuracion-general",pageKey:"configuracion-general",label:"General"},{key:"ia",icon:$,path:"/nova/configuracion",pageKey:"configuracion",label:"IA"},{key:"integraciones",icon:W,path:"/nova/integraciones",pageKey:"integraciones",label:"Integraciones"},{key:"usuarios",icon:T,path:"/nova/usuarios",pageKey:"usuarios",label:"Usuarios"},{key:"billing",icon:q,path:"/nova/billing",pageKey:"billing",label:"Facturacion"}]}];function Y(){const s=D(),h=H(),{canView:d}=Z();Q();const[r,u]=i.useState(!1),[k,o]=i.useState(!1),x=i.useRef(null),[l,j]=i.useState(()=>parseInt(localStorage.getItem("crm_total_unread")||"0",10));i.useEffect(()=>{const a=()=>j(parseInt(localStorage.getItem("crm_total_unread")||"0",10));return window.addEventListener("crm_unread_updated",a),()=>window.removeEventListener("crm_unread_updated",a)},[]),i.useEffect(()=>{if(!r)return;const a=n=>{x.current&&!x.current.contains(n.target)&&u(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]);const c=a=>a==="/nova"?h.pathname==="/nova":h.pathname.startsWith(a),g=(()=>{try{return JSON.parse(localStorage.getItem("crm_user")||"{}")}catch{return{}}})(),b=X.filter(a=>d(a.pageKey)),w=p.some(a=>a.items.some(n=>d(n.pageKey))),N=p.some(a=>a.items.some(n=>c(n.path)));return e.jsxs("header",{className:"h-12 bg-white border-b border-neutral-200 flex items-center px-3 md:px-4 gap-1 shrink-0 z-30",children:[e.jsx("button",{onClick:()=>o(!0),className:"p-1.5 rounded-lg text-neutral-500 hover:bg-neutral-100 md:hidden mr-1",children:e.jsx(G,{size:18})}),e.jsx("button",{onClick:()=>s("/nova"),className:"text-sm font-bold text-neutral-900 tracking-tight mr-4 shrink-0",children:"ConversaHub"}),e.jsxs("nav",{className:"hidden md:flex items-center gap-0.5 flex-1 min-w-0",children:[b.map(a=>{const n=c(a.path);return e.jsxs("button",{onClick:()=>s(a.path),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-[13px] font-medium transition-colors ${n?"bg-neutral-100 text-neutral-900":"text-neutral-500 hover:text-neutral-700 hover:bg-neutral-50"}`,children:[e.jsx(a.icon,{size:15,strokeWidth:2}),e.jsx("span",{children:a.label}),a.badge&&l>0&&e.jsx("span",{className:"bg-orange-700 text-white text-[9px] font-bold rounded-full min-w-[16px] h-4 flex items-center justify-center px-1",children:l>99?"99+":l})]},a.key)}),w&&e.jsxs("div",{ref:x,className:"relative",children:[e.jsxs("button",{onClick:()=>u(a=>!a),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-[13px] font-medium transition-colors ${N||r?"bg-neutral-100 text-neutral-900":"text-neutral-500 hover:text-neutral-700 hover:bg-neutral-50"}`,children:[e.jsx("span",{children:"Mas"}),e.jsx(V,{size:13,className:`transition-transform ${r?"rotate-180":""}`})]}),e.jsx(y,{children:r&&e.jsx(m.div,{initial:{opacity:0,y:4}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.15},className:"absolute top-full left-0 mt-1 bg-white border border-neutral-200 rounded-xl shadow-lg w-56 py-2 z-50",children:p.map(a=>{const n=a.items.filter(t=>d(t.pageKey));return n.length?e.jsxs("div",{children:[e.jsx("p",{className:"px-3 pt-2 pb-1 text-[10px] font-semibold text-neutral-400 uppercase tracking-wider",children:a.group}),n.map(t=>e.jsxs("button",{onClick:()=>{s(t.path),u(!1)},className:`w-full flex items-center gap-2 px-3 py-1.5 text-[13px] transition-colors ${c(t.path)?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-600 hover:bg-neutral-50"}`,children:[e.jsx(t.icon,{size:14,strokeWidth:2}),t.label]},t.key))]},a.group):null})})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto shrink-0",children:[e.jsx("button",{className:"p-1.5 rounded-lg text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 transition-colors",children:e.jsx(F,{size:16})}),e.jsxs("button",{onClick:()=>s("/"),className:"hidden md:flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-neutral-400 hover:text-neutral-600 hover:bg-neutral-50 transition-colors",children:[e.jsx(v,{size:12}),"Clasico"]}),e.jsx("div",{className:"w-7 h-7 rounded-full bg-neutral-900 flex items-center justify-center text-white text-[11px] font-bold ml-1",children:(g.display_name||g.email||"?")[0].toUpperCase()})]}),e.jsx(y,{children:k&&e.jsxs(e.Fragment,{children:[e.jsx(m.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:()=>o(!1)}),e.jsxs(m.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed left-0 top-0 bottom-0 w-64 bg-white z-50 md:hidden shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-neutral-200",children:[e.jsx("span",{className:"text-sm font-bold text-neutral-900",children:"ConversaHub"}),e.jsx("button",{onClick:()=>o(!1),className:"p-1 rounded-lg text-neutral-400 hover:bg-neutral-100",children:e.jsx(B,{size:18})})]}),e.jsxs("nav",{className:"p-2 space-y-0.5 overflow-y-auto flex-1",children:[b.map(a=>e.jsxs("button",{onClick:()=>{s(a.path),o(!1)},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${c(a.path)?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-600"}`,children:[e.jsx(a.icon,{size:16,strokeWidth:2}),a.label,a.badge&&l>0&&e.jsx("span",{className:"bg-orange-700 text-white text-[9px] font-bold rounded-full min-w-[16px] h-4 flex items-center justify-center px-1 ml-auto",children:l>99?"99+":l})]},a.key)),p.map(a=>{const n=a.items.filter(t=>d(t.pageKey));return n.length?e.jsxs("div",{className:"pt-2",children:[e.jsx("p",{className:"px-3 py-1 text-[10px] font-semibold text-neutral-400 uppercase tracking-wider",children:a.group}),n.map(t=>e.jsxs("button",{onClick:()=>{s(t.path),o(!1)},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${c(t.path)?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-600"}`,children:[e.jsx(t.icon,{size:16,strokeWidth:2}),t.label]},t.key))]},a.group):null}),e.jsx("div",{className:"pt-3 mt-3 border-t border-neutral-200",children:e.jsxs("button",{onClick:()=>s("/"),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-neutral-400",children:[e.jsx(v,{size:16}),"Volver al clasico"]})})]})]})]})})]})}function se(){return e.jsxs("div",{className:"nova flex flex-col h-screen bg-white overflow-hidden",children:[e.jsx(Y,{}),e.jsx("main",{className:"flex-1 overflow-y-auto min-w-0",children:e.jsx(J,{})})]})}export{se as default};
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.