PageSourceSearch

https://kokusaibujinrenmei.org/assets/AdaptiveNavigation-DZY4F7ms.js

js kokusaibujinrenmei.org collected 2026-09-25 11:49:31 UTC 60,892 bytes, 21 lines download raw bytes

1import{r as c,j as e,d as Yt}from"./react-vendor-B85QsyED.js";import{b as ue,d as Q,e as Ae,s as E,M as Ie,B as Z,f as P,L as I,E as Qt,U as ae,S as Jt,G as Te,g as es,h as me,F as re,i as ie,j as fe,c as T,X as oe,k as ts,l as xe,m as ce,n as et,o as le,V as tt,C as Pe,P as st,p as nt,q as at,D as rt,r as it,t as ot,A as ct,v as ss,H as ns,w as lt,u as J,x as as,a as rs,y as is}from"./index-Df-PK-QF.js";import{P as Ke}from"./PredictiveSearch-CQMtgMhl.js";import{u as De}from"./useAdmin-CMHNa50z.js";import{A as Be,a as qe,b as Ge}from"./avatar-zukinb4Y.js";import{D as dt,a as ut,b as mt,c as ft,d as q,e as G}from"./dropdown-menu-CB7sklK9.js";import{u as os}from"./use-toast-CN3wBKJU.js";import{S as cs}from"./scroll-area-CV6JumJR.js";import{S as ls,a as ds,b as us,c as ms,d as fs}from"./sheet-CN8tX06Z.js";import{B as ve}from"./bell-4Ce_bOqD.js";import{T as je}from"./trash-2-DY1npuFb.js";import{f as xs}from"./formatDistanceToNow-CVMUklei.js";import{C as ye}from"./check-BHI6PJSk.js";import{E as ps}from"./external-link-C2saekZm.js";import{e as hs}from"./es-Z116GH9Y.js";import{u as gs}from"./useUserProfiles-C9XBv-Kf.js";import{A as He,P as be}from"./contentAccess-BY1g-jlp.js";import{C as xt}from"./chevron-down-Bv9iu6P6.js";import{M as We}from"./message-square-Cwk6St1J.js";import{S as Ne}from"./separator-8BzjXshL.js";import{A as vs,a as js,b as bs,c as Ns}from"./accordion-DnlMa-CU.js";import{C as ws}from"./chevron-right-C2mFa1KA.js";import{S as Le}from"./sparkles-y9rInHCC.js";import{S as pt}from"./scroll-text-CbLe1lUo.js";import{c as ys,u as Ce}from"./index-BVuFAtou.js";import{c as L,P as pe}from"./index-A8-gc0Dc.js";import{P as V,d as Ze}from"./index-cTrnW49R.js";import{u as ht}from"./index-C0AOaaLp.js";import{u as Cs}from"./index-BpIqVjMJ.js";import{u as gt}from"./index-DqSziBWp.js";import{c as vt}from"./index-CUU8Y_On.js";import{D as _s}from"./index-kQO3QPKW.js";import{u as Ms}from"./index-e65zZkSg.js";import{u as K}from"./index-qofZSg7P.js";import{R as ks}from"./index-BbP2oaqt.js";import"./maps-DeNBPk8t.js";import"./plainText-1m7oKqF2.js";import"./index-CRiuDa31.js";import"./index-BDP74mfF.js";import"./Combination-kGSvfh8j.js";import"./index-8d_f1DE3.js";import"./index-DAN4P2Tl.js";import"./index-CGI26yd2.js";import"./index--1A-FE_7.js";import"./index-CuiFEsia.js";import"./circle-CWaYQvjq.js";import"./index-BdQq_4o_.js";import"./index-C5O6btP5.js";import"./en-US-mGoZcvJf.js";import"./endOfMonth-CJp_pL8p.js";import"./index-BbYlHeJG.js";import"./index-D1F6uIz-.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ss=ue("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Xe=ue("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Es=ue("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const jt=ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),Rs=()=>{const{user:t}=Q(),s=Ae(),[a,i]=c.useState(0);return c.useEffect(()=>{if(!t){i(0);return}const r=async()=>{const{data:n,error:m}=await E.rpc("get_unread_message_count",{p_user_id:t.id});!m&&n!==null&&i(n)};r();const o=E.channel("messages-badge").on("postgres_changes",{event:"INSERT",schema:"public",table:"messages"},()=>{r()}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"conversation_participants"},()=>{r()}).subscribe();return()=>{E.removeChannel(o)}},[t]),t?e.jsxs("button",{onClick:()=>s("/mensajes"),className:"relative p-2 rounded-md hover:bg-muted transition-colors min-h-[40px] min-w-[40px] flex items-center justify-center","aria-label":`Mensajes${a>0?` (${a} sin leer)`:""}`,children:[e.jsx(Ie,{className:"w-5 h-5"}),a>0&&e.jsx(Z,{variant:"destructive",className:"absolute -top-0.5 -right-0.5 h-4 min-w-[16px] p-0 flex items-center justify-center text-[10px] rounded-full",children:a>99?"99+":a})]}):null},As=(t,s)=>{switch(t){case"event":case"event_registration":case"enrollment":return"/admin?section=events";case"dojo_claim":return"/admin?section=dojo-claims";case"dojo":case"dojo_lead":case"activation_request":case"trial_start":case"subscription_change":return"/admin?section=dojos";case"content_correction":return s?.entity_type==="dojo"?"/admin?section=dojos":s?.entity_type==="video"?"/admin?section=videos":"/admin?section=articles";case"article":case"comment":return"/admin?section=articles";case"product":case"digital_purchase":return"/admin?section=marketplace";case"purchase":return"/admin?section=billing";case"registration":case"member_registration":case"instructor_registration":case"dojo_registration":case"verification":return"/admin?section=certificaciones";case"video_submission":return"/admin?section=videos";case"newsletter_subscription":return"/admin?section=newsletter";case"funnel_lead":return"/admin?section=sales-funnels";case"directory_link":return"/admin?section=marketplace";case"popup":return"/admin?section=popups";default:return"/admin"}},Is=t=>{switch(t){case"event":case"event_registration":case"enrollment":return"Ver eventos";
21case"dojo_claim":return"Ver reclamaciones";case"dojo":case"dojo_lead":case"activation_request":return"Ver dojos";case"trial_start":case"subscription_change":return"Ver suscripciones";case"content_correction":return"Revisar contenido";case"article":case"comment":return"Ver artículos";case"product":case"digital_purchase":return"Ver tienda";case"purchase":return"Ver facturación";case"registration":case"member_registration":case"instructor_registration":case"dojo_registration":case"verification":return"Ver certificaciones";case"video_submission":return"Ver videos";case"newsletter_subscription":return"Ver newsletter";case"funnel_lead":return"Ver embudos";case"directory_link":return"Ver tienda";case"popup":return"Ver popups";default:return"Ver en admin"}},Ts=()=>{const{user:t}=Q(),{isAdmin:s}=De(),[a,i]=c.useState([]),[r,o]=c.useState(0),[n,m]=c.useState([]),[x,f]=c.useState(0),[l,v]=c.useState("user"),[_,b]=c.useState(!1),[w,M]=c.useState(!1),[k,N]=c.useState(!1),[p,d]=c.useState(new Set);c.useEffect(()=>{d(new Set),N(!1)},[l,_]);const y=u=>{d(g=>{const h=new Set(g);return h.has(u)?h.delete(u):h.add(u),h})},C=()=>{const u=l==="admin"?n:a;d(new Set(u.map(g=>g.id)))},R=()=>d(new Set),O=async()=>{if(p.size===0)return;const u=Array.from(p);l==="admin"?(await E.from("admin_notifications").delete().in("id",u),m(g=>g.filter(h=>!p.has(h.id))),f(g=>Math.max(0,g-n.filter(h=>p.has(h.id)&&!h.read).length))):(await E.from("user_notifications").delete().in("id",u),i(g=>g.filter(h=>!p.has(h.id))),o(g=>Math.max(0,g-a.filter(h=>p.has(h.id)&&!h.read).length))),d(new Set),N(!1)},z=async()=>{const u=l==="admin"?n:a;if(u.length===0||!confirm(`¿Eliminar las ${u.length} notificaciones de esta vista?`))return;const g=u.map(h=>h.id);l==="admin"?(await E.from("admin_notifications").delete().in("id",g),m([]),f(0)):(await E.from("user_notifications").delete().in("id",g),i([]),o(0)),d(new Set),N(!1)},S=r+(s?x:0),A=async()=>{if(!t)return;M(!0);const{data:u,error:g}=await E.from("user_notifications").select("*").eq("user_id",t.id).order("created_at",{ascending:!1}).limit(50);!g&&u&&(i(u),o(u.filter(h=>!h.read).length)),M(!1)},j=async()=>{if(!t||!s)return;const{data:u,error:g}=await E.from("admin_notifications").select("*").order("created_at",{ascending:!1}).limit(50);!g&&u&&(m(u),f(u.filter(h=>!h.read).length))};c.useEffect(()=>{if(t){A();const u=E.channel("user-notifications").on("postgres_changes",{event:"*",schema:"public",table:"user_notifications",filter:`user_id=eq.${t.id}`},()=>{A()}).subscribe();return()=>{E.removeChannel(u)}}},[t]),c.useEffect(()=>{if(!t||!s)return;j();const u=E.channel("header-admin-notifications").on("postgres_changes",{event:"*",schema:"public",table:"admin_notifications"},()=>{j()}).subscribe();return()=>{E.removeChannel(u)}},[t,s]);const ee=async u=>{if(l==="admin"){await E.from("admin_notifications").update({read:!0}).eq("id",u),m(g=>g.map(h=>h.id===u?{...h,read:!0}:h)),f(g=>Math.max(0,g-1));return}await E.from("user_notifications").update({read:!0}).eq("id",u),i(g=>g.map(h=>h.id===u?{...h,read:!0}:h)),o(g=>Math.max(0,g-1))},Ht=async()=>{if(l==="admin"){const g=n.filter(h=>!h.read).map(h=>h.id);if(g.length===0)return;await E.from("admin_notifications").update({read:!0}).in("id",g),m(h=>h.map(F=>({...F,read:!0}))),f(0);return}const u=a.filter(g=>!g.read).map(g=>g.id);u.length!==0&&(await E.from("user_notifications").update({read:!0}).in("id",u),i(g=>g.map(h=>({...h,read:!0}))),o(0))},Wt=async u=>{if(l==="admin"){const h=n.find(F=>F.id===u);await E.from("admin_notifications").delete().eq("id",u),m(F=>F.filter(ge=>ge.id!==u)),h&&!h.read&&f(F=>Math.max(0,F-1));return}const g=a.find(h=>h.id===u);await E.from("user_notifications").delete().eq("id",u),i(h=>h.filter(F=>F.id!==u)),g&&!g.read&&o(h=>Math.max(0,h-1))},Zt=u=>{switch(u){case"success":return"border-l-green-500 bg-green-50 dark:bg-green-950/30";case"warning":return"border-l-yellow-500 bg-yellow-50 dark:bg-yellow-950/30";case"action":return"border-l-primary bg-primary/5";case"error":return"border-l-red-500 bg-red-50 dark:bg-red-950/30";default:return"border-l-blue-500 bg-blue-50 dark:bg-blue-950/30"}};if(!t)return null;const he=l==="admin"?n:a,Xt=l==="admin"?x:r;return e.jsxs(ls,{open:_,onOpenChange:b,children:[e.jsx(ds,{asChild:!0,children:e.jsxs(P,{variant:"ghost",size:"icon",className:"relative",children:[e.jsx(ve,{className:"h-5 w-5"}),S>0&&e.jsx(Z,{className:"absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center p-0 text-xs",variant:"destructive",children:S>9?"9+":S})]})}
21),e.jsxs(us,{className:"w-full sm:max-w-md",children:[e.jsxs(ms,{className:"border-b pb-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs(fs,{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-5 w-5"}),"Notificaciones",S>0&&e.jsxs(Z,{variant:"secondary",children:[S," nuevas"]})]})}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 pt-3",children:k?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-muted-foreground mr-auto",children:[p.size," seleccionadas"]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:C,className:"text-xs",children:"Todas"}),e.jsx(P,{variant:"ghost",size:"sm",onClick:R,className:"text-xs",children:"Ninguna"}),e.jsxs(P,{variant:"destructive",size:"sm",onClick:O,disabled:p.size===0,className:"text-xs",children:[e.jsx(je,{className:"h-4 w-4 mr-1"}),"Eliminar (",p.size,")"]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>{N(!1),R()},className:"text-xs",children:"Cancelar"})]}):e.jsxs(e.Fragment,{children:[Xt>0&&e.jsxs(P,{variant:"ghost",size:"sm",onClick:Ht,className:"text-xs",children:[e.jsx(Ss,{className:"h-4 w-4 mr-1"}),"Marcar todas"]}),he.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>N(!0),className:"text-xs",children:"Seleccionar"}),e.jsxs(P,{variant:"ghost",size:"sm",onClick:z,className:"text-xs text-destructive hover:text-destructive",children:[e.jsx(je,{className:"h-4 w-4 mr-1"}),"Eliminar todas"]})]})]})}),s&&e.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[e.jsxs(P,{type:"button",size:"sm",variant:l==="user"?"default":"outline",onClick:()=>v("user"),children:["Mis notificaciones",r>0&&e.jsx(Z,{variant:"secondary",className:"ml-2",children:r>9?"9+":r})]}),e.jsxs(P,{type:"button",size:"sm",variant:l==="admin"?"default":"outline",onClick:()=>v("admin"),children:["Sistema",x>0&&e.jsx(Z,{variant:"secondary",className:"ml-2",children:x>9?"9+":x})]})]})]}),e.jsx(cs,{className:"h-[calc(100vh-120px)] mt-4",children:w?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(u=>e.jsx("div",{className:"h-20 bg-muted animate-pulse rounded-lg"},u))}):he.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(ve,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No tienes notificaciones"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Aquí aparecerán tus actualizaciones"})]}):e.jsx("div",{className:"space-y-3",children:he.map(u=>{const g=u.action_url||As(u.type,u.metadata),h=u.action_text||Is(u.type),F=p.has(u.id);return e.jsxs("div",{onClick:k?()=>y(u.id):void 0,className:`relative p-4 rounded-lg border-l-4 transition-colors ${Zt(u.type)} ${u.read?"opacity-80":"ring-1 ring-primary/20"} ${k?"cursor-pointer":""} ${F?"ring-2 ring-primary":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[k&&e.jsx("input",{type:"checkbox",checked:F,onChange:()=>y(u.id),onClick:ge=>ge.stopPropagation(),className:"mt-1 h-4 w-4 cursor-pointer flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-medium text-sm truncate",children:u.title}),!u.read&&e.jsx("span",{className:"h-2 w-2 rounded-full bg-primary flex-shrink-0"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:u.message}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:xs(new Date(u.created_at),{addSuffix:!0,locale:hs})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[!u.read&&e.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ee(u.id),children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx(P,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:()=>Wt(u.id),children:e.jsx(je,{className:"h-4 w-4"})})]})]}),g&&h&&e.jsxs(I,{to:g,onClick:()=>{ee(u.id),b(!1)},className:"inline-flex items-center gap-1 text-sm text-primary hover:underline mt-2",children:[h,e.jsx(ps,{className:"h-3 w-3"})]})]},u.id)})})})]})]})},we={anonymous:Qt,registered:ae,member:Jt,instructor:Te,federation:es},Ye=({variant:t="dropdown",showLabel:s=!0})=>{const{availableProfiles:a,activeProfile:i,setActiveProfile:r,loading:o}=gs();if(o)return e.jsx("div",{className:"h-8 w-24 bg-muted animate-pulse rounded-md"});if(a.length<=1)return null;const n=be[i],m=we[i],x=[...a].sort((f,l)=>He[f]-He[l]);return t==="inline"?e.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(f=>{const l=be[f],v=we[f],_=f===i;return e.jsxs("button",{onClick:()=>r(f),className:`flex items-center gap-2 px-3 py-2 rounded-lg transition-all ${_?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:[e.jsx(v,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:l.label}),_&&e.jsx(ye,{className:"w-4 h-4"})]},f)})}):e.jsxs(dt,{children:[e.jsx(ut,{asChild:!0,children:e.jsxs(P,{variant:"outline",size:"sm",className:`gap-2 ${n.color}`,children:[e.jsx(m,{className:"w-4 h-4"}),s&&e.jsx("span",{children:n.label}),e.jsx(xt,{className:"w-3 h-3 opacity-50"})]})}),e.jsxs(mt,{align:"end",className:"w-56",children:[e.jsx(ft,{children:"Cambiar perfil de visualización"}),e.jsx(q,{}),x.map(f=>{const l=be[f],v=we[f],_=f===i;return e.jsxs(G,{onClick:()=>
21r(f),className:`cursor-pointer ${_?"bg-muted":""}`,children:[e.jsx(v,{className:`mr-2 h-4 w-4 ${l.color}`}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:l.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]}),_&&e.jsx(ye,{className:"w-4 h-4 text-primary"})]},f)})]})]})},_e=({variant:t="desktop"})=>{const{user:s,signOut:a,loading:i,effectiveUserId:r}=Q(),{sectionConfig:o,closeMobileMenu:n}=me(),{toast:m}=os(),{isAdmin:x}=De(),f=Ae(),[l,v]=c.useState(null);c.useEffect(()=>{(async()=>{if(!r){v(null);return}const{data:d}=await E.from("profiles").select("avatar_url, display_name").eq("user_id",r).single();v(d)})()},[r]);const _=l?.avatar_url||s?.user_metadata?.avatar_url,b=l?.display_name||s?.user_metadata?.display_name,w=async()=>{const{error:p}=await a();p?m({title:"Error",description:"Error al cerrar sesión",variant:"destructive"}):(m({title:"Sesión cerrada",description:"Has cerrado sesión correctamente"}),f("/")),n()},M=p=>p.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);if(i)return e.jsx("div",{className:"h-10 w-24 bg-muted animate-pulse rounded-md"});if(!s){const p=o.guestActions;return t==="mobile"?e.jsx("div",{className:"space-y-3 p-4 border-t border-border",children:p.map(d=>e.jsx(I,{to:d.href,onClick:n,className:"block",children:e.jsx(P,{variant:d.primary?"default":"outline",className:"w-full min-h-[48px] text-base",children:d.name})},d.href))}):e.jsx("div",{className:"flex items-center gap-2",children:p.map(d=>e.jsx(I,{to:d.href,children:e.jsx(P,{variant:d.primary?"default":"ghost",size:"sm",children:d.name})},d.href))})}const k=["/mensajes","/my-purchases","/admin"],N=o.userActions.filter(p=>!k.includes(p.href));return t==="mobile"?e.jsxs("div",{className:"border-t border-border",children:[e.jsx("p",{className:"px-4 pt-4 text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Mi cuenta"}),e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted/30",children:[e.jsxs(Be,{className:"h-12 w-12",children:[e.jsx(qe,{src:_||"",alt:b||s?.email||"Usuario"}),e.jsx(Ge,{className:"text-lg",children:b?M(b):e.jsx(ae,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:b||"Usuario"}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s?.email})]})]}),e.jsx("div",{className:"p-3",children:e.jsx(Ye,{variant:"inline"})}),e.jsxs("div",{className:"p-2 space-y-1",children:[N.map(p=>e.jsxs(I,{to:p.href,onClick:n,className:"flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-muted transition-colors min-h-[48px]",children:[p.icon&&e.jsx(p.icon,{className:"h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:p.name})]},p.href)),e.jsxs(I,{to:"/mensajes",onClick:n,className:"flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-muted transition-colors min-h-[48px]",children:[e.jsx(We,{className:"h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Mensajes"})]}),e.jsxs(I,{to:"/my-purchases",onClick:n,className:"flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-muted transition-colors min-h-[48px]",children:[e.jsx(re,{className:"h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Mis Compras"})]}),x&&e.jsxs(I,{to:"/admin",onClick:n,className:"flex items-center gap-3 px-4 py-3 rounded-lg hover:bg-muted transition-colors min-h-[48px]",children:[e.jsx(ie,{className:"h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Administración"})]})]}),e.jsx("div",{className:"p-2 border-t border-border",children:e.jsxs("button",{onClick:w,className:"flex items-center gap-3 w-full px-4 py-3 rounded-lg hover:bg-destructive/10 text-destructive transition-colors min-h-[48px]",children:[e.jsx(Xe,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium",children:"Cerrar Sesión"})]})})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ts,{}),e.jsxs(dt,{children:[e.jsx(ut,{asChild:!0,children:e.jsx(P,{variant:"ghost",className:"relative h-9 w-9 rounded-full",children:e.jsxs(Be,{className:"h-9 w-9",children:[e.jsx(qe,{src:_||"",alt:b||s?.email||"Usuario"}),e.jsx(Ge,{children:b?M(b):e.jsx(ae,{className:"h-4 w-4"})})]})})}),e.jsxs(mt,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(ft,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:b||"Usuario"}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:s?.email})]})}),e.jsx(q,{}),e.jsx("div",{className:"px-2 py-1.5",children:e.jsx(Ye,{variant:"inline"})}),e.jsx(q,{}),N.map(p=>e.jsxs(G,{onClick:()=>f(p.href),children:[p.icon&&e.jsx(p.icon,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:p.name})]},p.href)),e.jsx(q,{}),e.jsxs(G,{onClick:()=>f("/mensajes"),children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Mensajes"})]}),e.jsxs(G,{onClick:()=>f("/my-purchases"),children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Mis Compras"})]}),x&&e.jsxs(e.Fragment,{children:[e.jsx(q,{}),e.jsxs(G,{onClick:()=>f("/admin"),children:[e.jsx(ie,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Administración"})]})]}),e.jsx(q,{}),e.jsxs(G,{onClick:w,className:"text-destructive focus:text-destructive",children:[e.jsx(Xe,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Cerrar Sesión"})]})]})]})]})},Ps=()=>{const{sectionConfig:t,isAuthenticated:s}=me(),a=fe();if(a.pathname==="/"||t.hideContextualMenu||!t.subSectionLinks||t.subSectionLinks.length===0)return null;const i=n=>n.includes("?")?a.pathname+a.search===n:n==="/"?a.pathname==="/":a.pathname===n||a.pathname.startsWith(n+"/"),r=t.quickAction,o=r&&(!r.requiresAuth||s);return e.jsx("div",{className:"hidden md:flex items-center bg-muted/30 border-b border-border",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"flex items-center h-10 gap-1 overflow-x-auto scrollbar-hide",children:[e.jsxs("div",{className:"flex items-center gap-2 pr-4 border-r border-border mr-2",children:[t.sectionIcon&&e.jsx(t.sectionIcon,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm font-semibold text-primary whitespace-nowrap",children:t.section})]}),t.subSectionLinks.map(n=>n.requiresAuth&&!s?null:e.jsxs(I,{to:n.href,className:T("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors whitespace-nowrap",i(n.href)?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:[n.icon&&e.jsx(n.icon,{className:"h-3.5 w-3.5"}),n.name]},n.href)),e.jsx("div",{className:"flex-1"}),o&&e.jsxs(I,{to:r.href,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-md transition-colors whitespace-nowrap",children:[r.icon&&e.jsx(r.icon,{className:"h-3.5 w-3.5"}),r.name]})]})})})},Ds=[{label:"Red Marcial",items:[{name:"Mapa Mundial de Dojos",href:"/mapa-dojos",icon:xe},{name:"Directorio de Dojos",href:"/dojos",icon:ce},{name:"Maestros e Instructores",href:"/maestros",icon:et},{name:"Miembros",href:"/miembros",icon:le},{name:"Artes Marciales",href:"/artes-marciales",icon:Le}]},{label:"Aprende",items:[{name:"Clásicos · Tratados Marciales",href:"/clasicos",icon:pt,badge:"NUEVO"},{name:"Artículos",href:"/articulos",icon:re},{name:"Videoteca",href:"/videos",icon:tt},{name:"Eventos y Seminarios",href:"/eventos",icon:Pe},{name:"Podcast",href:st,icon:jt,external:!0},{name:"Newsletter",href:"/newsletter",icon:Ie}]},{label:"Tienda",items:[{name:"Librería de Ebooks",href:"/tienda/ebooks",icon:nt},{name:"Tienda General",href:"/tienda",icon:at},{name:"Productos Digitales",href:"/tienda/digitales",icon:rt},{name:"Mis Descargas",href:"/mis-descargas",icon:it}
21,{name:"Acceso Premium",href:"/premium",icon:ot,badge:"PRO"}]},{label:"Certificaciones",items:[{name:"Programa Oficial KBR",href:"/certificaciones",icon:ct},{name:"Miembro Registrado",href:"/certificaciones/miembro-registrado",icon:le},{name:"Instructor Certificado",href:"/certificaciones/instructor-certificado",icon:Te},{name:"Dojo Certificado",href:"/certificaciones/dojo-certificado",icon:ce},{name:"DojoMaster Pro",href:"/gestion-dojo",icon:ie,badge:"NUEVO"}]},{label:"Precios",items:[{name:"Planes y Precios",href:"/precios",icon:ss}]}],Ls=()=>{const{isMobileMenuOpen:t,closeMobileMenu:s,sectionConfig:a,isAuthenticated:i}=me(),r=fe(),o=n=>n==="/"?r.pathname==="/":r.pathname.startsWith(n);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-40 lg:hidden",onClick:s,"aria-hidden":"true"}),e.jsxs("div",{className:T("fixed inset-y-0 right-0 w-full max-w-sm bg-background z-50 lg:hidden","flex flex-col shadow-2xl","animate-in slide-in-from-right duration-300"),role:"dialog","aria-modal":"true","aria-label":"Menú de navegación",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:e.jsx("span",{className:"text-primary-foreground font-bold text-sm",children:"武"})}),e.jsx("span",{className:"font-semibold text-lg",children:"Kokusai Bujin Renmei"})]}),e.jsx("button",{onClick:s,className:"p-2 -mr-2 rounded-full hover:bg-muted transition-colors min-h-[44px] min-w-[44px] flex items-center justify-center","aria-label":"Cerrar menú",children:e.jsx(oe,{className:"h-6 w-6"})})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[a.subSectionLinks&&a.subSectionLinks.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"En esta sección"}),e.jsx("div",{className:"space-y-1",children:a.subSectionLinks.map(n=>e.jsx(te,{item:n,isActive:o(n.href),onClick:s},n.href))})]}),e.jsx(Ne,{})]}),a.relatedServices&&a.relatedServices.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Servicios relacionados"}),e.jsx("div",{className:"space-y-1",children:a.relatedServices.map(n=>e.jsx(te,{item:n,isActive:o(n.href),onClick:s,showBadge:!0},n.href))})]}),e.jsx(Ne,{})]}),e.jsx(Ne,{}),e.jsxs("div",{className:"p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Menú principal"}),e.jsx(vs,{type:"multiple",className:"w-full",children:Ds.map(n=>e.jsxs(js,{value:n.label,className:"border-b border-border/60",children:[e.jsx(bs,{className:"py-3 text-base font-medium hover:no-underline",children:n.label}),e.jsx(Ns,{className:"pb-2",children:e.jsx("div",{className:"space-y-1",children:n.items.map(m=>e.jsx(te,{item:m,isActive:o(m.href),onClick:s,showBadge:!0},m.href))})})]},n.label))})]}),e.jsxs("div",{className:"p-4 pt-0",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Accesos rápidos"}),e.jsx("div",{className:"space-y-1",children:ts.map(n=>e.jsx(te,{item:n,isActive:o(n.href),onClick:s},n.href))})]}),i&&e.jsx(_e,{variant:"mobile"})]}),!i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx(_e,{variant:"mobile"})})]})]}):null},te=({item:t,isActive:s,onClick:a,showBadge:i})=>{const r=t.external?"a":I,o=t.external?{href:t.href,target:"_blank",rel:"noopener noreferrer"}:{to:t.href};return e.jsxs(r,{...o,onClick:a,className:T("flex items-center justify-between px-4 py-3 rounded-lg transition-colors min-h-[48px]",s?"bg-primary/10 text-primary font-medium":"hover:bg-muted text-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[t.icon&&e.jsx(t.icon,{className:T("h-5 w-5",s?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-base",children:t.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[i&&t.badge&&e.jsx(Z,{variant:t.badge==="GRATIS"?"secondary":"default",className:T("text-xs",t.badge==="PRO"&&"bg-primary text-primary-foreground"),children:t.badge}),e.jsx(ws,{className:"h-4 w-4 text-muted-foreground"})]})]})},Os=[{name:"Inicio",href:"/",icon:ns},{name:"Buscar",href:"/search",icon:lt},{name:"Dojos",href:"/dojos",icon:xe},{name:"Eventos",href:"/eventos",icon:Pe},{name:"Perfil",href:"/dashboard",icon:ae,requiresAuth:!0}],Fs=()=>{const t=fe(),{user:s}=Q(),a=r=>r==="/"?t.pathname==="/":t.pathname.startsWith(r),i=()=>s?"/dashboard":"/auth";return e.jsx("nav",{className:"md:hidden fixed bottom-0 left-0 right-0 z-50 bg-background/95 backdrop-blur-lg border-t border-border safe-bottom",children:e.jsx("div",{className:"flex items-center justify-around h-16 px-2",children:Os.map(r=>{const o=r.requiresAuth?i():r.href,n=a(o),m=r.icon;return e.jsxs(I,{to:o,className:T("flex flex-col items-center justify-center gap-1 py-2 px-3 rounded-lg transition-all duration-200 min-w-[60px] min-h-[44px]",n?"text-primary":"text-muted-foreground hover:text-foreground"),children:[e.jsx(m,{className:T("w-5 h-5 transition-transform",n&&"scale-110"),strokeWidth:n?2.5:2}),e.jsx("span",{className:T("text-[10px] font-medium leading-none",n&&"font-semibold"),children:r.name})]},r.name)})})})};var B="NavigationMenu",[Oe,bt,$s]=vt(B),[Me,zs,Vs]=vt(B),[Fe,Ga]=ys(B,[$s,Vs]),[Us,$]=Fe(B),[Ks,Bs]=Fe(B),Nt=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,value:i,onValueChange:r,defaultValue:o,delayDuration:n=200,skipDelayDuration:m=300,orientation:x="horizontal",dir:f,...l}=t,[v,_]=c.useState(null),b=J(s,S=>_(S)),w=Cs(f),M=c.useRef(0),k=c.useRef(0),N=c.useRef(0),[p,d]=c.useState(!0),[y,C]=ht({prop:i,onChange:S=>{const A=S!=="",j=m>0;A?(window.clearTimeout(N.current),j&&d(!1)):(window.clearTimeout(N.current),N.current=window.setTimeout(()=>d(!0),m)),r?.(S)},defaultProp:o??"",caller:B}),R=c.useCallback(()=>{window.clearTimeout(k.current),k.current=window.setTimeout(()=>C(""),150)},[C]),O=c.useCallback(S=>{window.clearTimeout(k.current),C(S)},[C]),z=c.useCallback(S=>{y===S?window.clearTimeout(k.current):M.current=window.setTimeout(()=>{window.clearTimeout(k.current),C(S)},n)},[y,C,n]);return c.useEffect(()=>()=>
21{window.clearTimeout(M.current),window.clearTimeout(k.current),window.clearTimeout(N.current)},[]),e.jsx(wt,{scope:a,isRootMenu:!0,value:y,dir:w,orientation:x,rootNavigationMenu:v,onTriggerEnter:S=>{window.clearTimeout(M.current),p?z(S):O(S)},onTriggerLeave:()=>{window.clearTimeout(M.current),R()},onContentEnter:()=>window.clearTimeout(k.current),onContentLeave:R,onItemSelect:S=>{C(A=>A===S?"":S)},onItemDismiss:()=>C(""),children:e.jsx(V.nav,{"aria-label":"Main","data-orientation":x,dir:w,...l,ref:b})})});Nt.displayName=B;var ke="NavigationMenuSub",qs=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,value:i,onValueChange:r,defaultValue:o,orientation:n="horizontal",...m}=t,x=$(ke,a),[f,l]=ht({prop:i,onChange:r,defaultProp:o??"",caller:ke});return e.jsx(wt,{scope:a,isRootMenu:!1,value:f,dir:x.dir,orientation:n,rootNavigationMenu:x.rootNavigationMenu,onTriggerEnter:v=>l(v),onItemSelect:v=>l(v),onItemDismiss:()=>l(""),children:e.jsx(V.div,{"data-orientation":n,...m,ref:s})})});qs.displayName=ke;var wt=t=>{const{scope:s,isRootMenu:a,rootNavigationMenu:i,dir:r,orientation:o,children:n,value:m,onItemSelect:x,onItemDismiss:f,onTriggerEnter:l,onTriggerLeave:v,onContentEnter:_,onContentLeave:b}=t,[w,M]=c.useState(null),[k,N]=c.useState(new Map),[p,d]=c.useState(null);return e.jsx(Us,{scope:s,isRootMenu:a,rootNavigationMenu:i,value:m,previousValue:Ms(m),baseId:gt(),dir:r,orientation:o,viewport:w,onViewportChange:M,indicatorTrack:p,onIndicatorTrackChange:d,onTriggerEnter:K(l),onTriggerLeave:K(v),onContentEnter:K(_),onContentLeave:K(b),onItemSelect:K(x),onItemDismiss:K(f),onViewportContentChange:c.useCallback((y,C)=>{N(R=>(R.set(y,C),new Map(R)))},[]),onViewportContentRemove:c.useCallback(y=>{N(C=>C.has(y)?(C.delete(y),new Map(C)):C)},[]),children:e.jsx(Oe.Provider,{scope:s,children:e.jsx(Ks,{scope:s,items:k,children:n})})})},yt="NavigationMenuList",Ct=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,...i}=t,r=$(yt,a),o=e.jsx(V.ul,{"data-orientation":r.orientation,...i,ref:s});return e.jsx(V.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:e.jsx(Oe.Slot,{scope:a,children:r.isRootMenu?e.jsx(Pt,{asChild:!0,children:o}):o})})});Ct.displayName=yt;var _t="NavigationMenuItem",[Gs,Mt]=Fe(_t),kt=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,value:i,...r}=t,o=gt(),n=i||o||"LEGACY_REACT_AUTO_VALUE",m=c.useRef(null),x=c.useRef(null),f=c.useRef(null),l=c.useRef(()=>{}),v=c.useRef(!1),_=c.useCallback((w="start")=>{if(m.current){l.current();const M=Ee(m.current);M.length&&Ve(w==="start"?M:M.reverse())}},[]),b=c.useCallback(()=>{if(m.current){const w=Ee(m.current);w.length&&(l.current=Js(w))}},[]);return e.jsx(Gs,{scope:a,value:n,triggerRef:x,contentRef:m,focusProxyRef:f,wasEscapeCloseRef:v,onEntryKeyDown:_,onFocusProxyEnter:_,onRootContentClose:b,onContentFocusOutside:b,children:e.jsx(V.li,{...r,ref:s})})});kt.displayName=_t;var Se="NavigationMenuTrigger",St=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,disabled:i,...r}=t,o=$(Se,t.__scopeNavigationMenu),n=Mt(Se,t.__scopeNavigationMenu),m=c.useRef(null),x=J(m,n.triggerRef,s),f=Lt(o.baseId,n.value),l=Ot(o.baseId,n.value),v=c.useRef(!1),_=c.useRef(!1),b=n.value===o.value;return e.jsxs(e.Fragment,{children:[e.jsx(Oe.ItemSlot,{scope:a,value:n.value,children:e.jsx(Dt,{asChild:!0,children:e.jsx(V.button,{id:f,disabled:i,"data-disabled":i?"":void 0,"data-state":Ue(b),"aria-expanded":b,"aria-controls":l,...r,ref:x,onPointerEnter:L(t.onPointerEnter,()=>{_.current=!1,n.wasEscapeCloseRef.current=!1}),onPointerMove:L(t.onPointerMove,de(()=>{i||_.current||n.wasEscapeCloseRef.current||v.current||(o.onTriggerEnter(n.value),v.current=!0)})),onPointerLeave:L(t.onPointerLeave,de(()=>{i||(o.onTriggerLeave(),v.current=!1)})),onClick:L(t.onClick,()=>{o.onItemSelect(n.value),_.current=b}),onKeyDown:L(t.onKeyDown,w=>{const k={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];b&&w.key===k&&(n.onEntryKeyDown(),w.preventDefault())})})})}),b&&e.jsxs(e.Fragment,{children:[e.jsx(ks,{"aria-hidden":!0,tabIndex:0,ref:n.focusProxyRef,onFocus:w=>{const M=n.contentRef.current,k=w.relatedTarget,N=k===m.current,p=M?.contains(k);(N||!p)&&n.onFocusProxyEnter(N?"start":"end")}}),o.viewport&&e.jsx("span",{"aria-owns":l})]})]})});St.displayName=Se;var Hs="NavigationMenuLink",Qe="navigationMenu.linkSelect",Et=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,active:i,onSelect:r,...o}=t;return e.jsx(Dt,{asChild:!0,children:e.jsx(V.a,{"data-active":i?"":void 0,"aria-current":i?"page":void 0,...o,ref:s,onClick:L(t.onClick,n=>{const m=n.target,x=new CustomEvent(Qe,{bubbles:!0,cancelable:!0});if(m.addEventListener(Qe,f=>r?.(f),{once:!0}),Ze(m,x),!x.defaultPrevented&&!n.metaKey){const f=new CustomEvent(ne,{bubbles:!0,cancelable:!0});Ze(m,f)}},{checkForDefaultPrevented:!1})})})});Et.displayName=Hs;var $e="NavigationMenuIndicator",Rt=c.forwardRef((t,s)=>{const{forceMount:a,...i}=t,r=$($e,t.__scopeNavigationMenu),o=!!r.value;return r.indicatorTrack?Yt.createPortal(e.jsx(pe,{present:a||o,children:e.jsx(Ws,{...i,ref:s})}),r.indicatorTrack):null});Rt.displayName=$e;var Ws=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,...i}=t,r=$($e,a),o=bt(a),[n,m]=c.useState(null),[x,f]=c.useState(null),l=r.orientation==="horizontal",v=!!r.value;c.useEffect(()=>{const w=o().find(M=>M.value===r.value)?.ref.current;w&&m(w)},[o,r.value]);const _=()=>{n&&f({size:l?n.offsetWidth:n.offsetHeight,offset:l?n.offsetLeft:n.offsetTop})};return Re(n,_),Re(r.indicatorTrack,_),x?e.jsx(V.div,{"aria-hidden":!0,"data-state":v?"visible":"hidden","data-orientation":r.orientation,...i,ref:s,style:{position:"absolute",...l?{left:0,width:x.size+"px",transform:`translateX(${x.offset}px)`}:{top:0,height:x.size+"px",transform:`translateY(${x.offset}px)`},...i.style}}):null}),X="NavigationMenuContent",At=c.forwardRef((t,s)=>{const{forceMount:a,...i}=t,r=$(X,t.__scopeNavigationMenu),o=Mt(X,t.__scopeNavigationMenu),n=J(o.contentRef,s),m=o.value===r.value,x={value:o.value,triggerRef:o.triggerRef,focu
21sProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...i};return r.viewport?e.jsx(Zs,{forceMount:a,...x,ref:n}):e.jsx(pe,{present:a||m,children:e.jsx(It,{"data-state":Ue(m),...x,ref:n,onPointerEnter:L(t.onPointerEnter,r.onContentEnter),onPointerLeave:L(t.onPointerLeave,de(r.onContentLeave)),style:{pointerEvents:!m&&r.isRootMenu?"none":void 0,...x.style}})})});At.displayName=X;var Zs=c.forwardRef((t,s)=>{const a=$(X,t.__scopeNavigationMenu),{onViewportContentChange:i,onViewportContentRemove:r}=a;return Ce(()=>{i(t.value,{ref:s,...t})},[t,s,i]),Ce(()=>()=>r(t.value),[t.value,r]),null}),ne="navigationMenu.rootContentDismiss",It=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,value:i,triggerRef:r,focusProxyRef:o,wasEscapeCloseRef:n,onRootContentClose:m,onContentFocusOutside:x,...f}=t,l=$(X,a),v=c.useRef(null),_=J(v,s),b=Lt(l.baseId,i),w=Ot(l.baseId,i),M=bt(a),k=c.useRef(null),{onItemDismiss:N}=l;c.useEffect(()=>{const d=v.current;if(l.isRootMenu&&d){const y=()=>{N(),m(),d.contains(document.activeElement)&&r.current?.focus()};return d.addEventListener(ne,y),()=>d.removeEventListener(ne,y)}},[l.isRootMenu,t.value,r,N,m]);const p=c.useMemo(()=>{const y=M().map(A=>A.value);l.dir==="rtl"&&y.reverse();const C=y.indexOf(l.value),R=y.indexOf(l.previousValue),O=i===l.value,z=R===y.indexOf(i);if(!O&&!z)return k.current;const S=(()=>{if(C!==R){if(O&&R!==-1)return C>R?"from-end":"from-start";if(z&&C!==-1)return C>R?"to-start":"to-end"}return null})();return k.current=S,S},[l.previousValue,l.value,l.dir,M,i]);return e.jsx(Pt,{asChild:!0,children:e.jsx(_s,{id:w,"aria-labelledby":b,"data-motion":p,"data-orientation":l.orientation,...f,ref:_,disableOutsidePointerEvents:!1,onDismiss:()=>{const d=new Event(ne,{bubbles:!0,cancelable:!0});v.current?.dispatchEvent(d)},onFocusOutside:L(t.onFocusOutside,d=>{x();const y=d.target;l.rootNavigationMenu?.contains(y)&&d.preventDefault()}),onPointerDownOutside:L(t.onPointerDownOutside,d=>{const y=d.target,C=M().some(O=>O.ref.current?.contains(y)),R=l.isRootMenu&&l.viewport?.contains(y);(C||R||!l.isRootMenu)&&d.preventDefault()}),onKeyDown:L(t.onKeyDown,d=>{const y=d.altKey||d.ctrlKey||d.metaKey;if(d.key==="Tab"&&!y){const R=Ee(d.currentTarget),O=document.activeElement,z=R.findIndex(j=>j===O),A=d.shiftKey?R.slice(0,z).reverse():R.slice(z+1,R.length);Ve(A)?d.preventDefault():o.current?.focus()}}),onEscapeKeyDown:L(t.onEscapeKeyDown,d=>{n.current=!0})})})}),ze="NavigationMenuViewport",Tt=c.forwardRef((t,s)=>{const{forceMount:a,...i}=t,o=!!$(ze,t.__scopeNavigationMenu).value;return e.jsx(pe,{present:a||o,children:e.jsx(Xs,{...i,ref:s})})});Tt.displayName=ze;var Xs=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,children:i,...r}=t,o=$(ze,a),n=J(s,o.onViewportChange),m=Bs(X,t.__scopeNavigationMenu),[x,f]=c.useState(null),[l,v]=c.useState(null),_=x?x?.width+"px":void 0,b=x?x?.height+"px":void 0,w=!!o.value,M=w?o.value:o.previousValue;return Re(l,()=>{l&&f({width:l.offsetWidth,height:l.offsetHeight})}),e.jsx(V.div,{"data-state":Ue(w),"data-orientation":o.orientation,...r,ref:n,style:{pointerEvents:!w&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":_,"--radix-navigation-menu-viewport-height":b,...r.style},onPointerEnter:L(t.onPointerEnter,o.onContentEnter),onPointerLeave:L(t.onPointerLeave,de(o.onContentLeave)),children:Array.from(m.items).map(([N,{ref:p,forceMount:d,...y}])=>{const C=M===N;return e.jsx(pe,{present:d||C,children:e.jsx(It,{...y,ref:as(p,R=>{C&&R&&v(R)})})},N)})})}),Ys="FocusGroup",Pt=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,...i}=t,r=$(Ys,a);return e.jsx(Me.Provider,{scope:a,children:e.jsx(Me.Slot,{scope:a,children:e.jsx(V.div,{dir:r.dir,...i,ref:s})})})}),Je=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Qs="FocusGroupItem",Dt=c.forwardRef((t,s)=>{const{__scopeNavigationMenu:a,...i}=t,r=zs(a),o=$(Qs,a);return e.jsx(Me.ItemSlot,{scope:a,children:e.jsx(V.button,{...i,ref:s,onKeyDown:L(t.onKeyDown,n=>{if(["Home","End",...Je].includes(n.key)){let x=r().map(v=>v.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(n.key)&&x.reverse(),Je.includes(n.key)){const v=
21x.indexOf(n.currentTarget);x=x.slice(v+1)}setTimeout(()=>Ve(x)),n.preventDefault()}})})})});function Ee(t){const s=[],a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)s.push(a.currentNode);return s}function Ve(t){const s=document.activeElement;return t.some(a=>a===s?!0:(a.focus(),document.activeElement!==s))}function Js(t){return t.forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")}),()=>{t.forEach(s=>{const a=s.dataset.tabindex;s.setAttribute("tabindex",a)})}}function Re(t,s){const a=K(s);Ce(()=>{let i=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(a)});return r.observe(t),()=>{window.cancelAnimationFrame(i),r.unobserve(t)}}},[t,a])}function Ue(t){return t?"open":"closed"}function Lt(t,s){return`${t}-trigger-${s}`}function Ot(t,s){return`${t}-content-${s}`}function de(t){return s=>s.pointerType==="mouse"?t(s):void 0}var Ft=Nt,$t=Ct,en=kt,zt=St,tn=Et,Vt=Rt,Ut=At,Kt=Tt;const Bt=c.forwardRef(({className:t,children:s,...a},i)=>e.jsxs(Ft,{ref:i,className:T("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...a,children:[s,e.jsx(Gt,{})]}));Bt.displayName=Ft.displayName;const qt=c.forwardRef(({className:t,...s},a)=>e.jsx($t,{ref:a,className:T("group flex flex-1 list-none items-center justify-center space-x-1",t),...s}));qt.displayName=$t.displayName;const U=en,sn=rs("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),H=c.forwardRef(({className:t,children:s,...a},i)=>e.jsxs(zt,{ref:i,className:T(sn(),"group",t),...a,children:[s," ",e.jsx(xt,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));H.displayName=zt.displayName;const W=c.forwardRef(({className:t,...s},a)=>e.jsx(Ut,{ref:a,className:T("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",t),...s}));W.displayName=Ut.displayName;const Y=tn,Gt=c.forwardRef(({className:t,...s},a)=>e.jsx("div",{className:T("absolute left-0 top-full flex justify-center"),children:e.jsx(Kt,{className:T("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:a,...s})}));Gt.displayName=Kt.displayName;const nn=c.forwardRef(({className:t,...s},a)=>e.jsx(Vt,{ref:a,className:T("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...s,children:e.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));nn.displayName=Vt.displayName;const an=1,rn="0e6be311-7380-4751-85ec-f3110a5f9a6a",on="c0dabb2d-25ed-4579-a289-5a430ac0ec37",cn="/__l5e/assets-v1/0e6be311-7380-4751-85ec-f3110a5f9a6a/menu-dojos.jpg",ln="a/v1/c0dabb2d-25ed-4579-a289-5a430ac0ec37/0e6be311-7380-4751-85ec-f3110a5f9a6a/menu-dojos.jpg",dn="menu-dojos.jpg",un=30349,mn="image/jpeg",fn="2026-06-11T06:39:35Z",xn={version:an,asset_id:rn,project_id:on,url:cn,r2_key:ln,original_filename:dn,size:un,content_type:mn,created_at:fn},pn=1,hn="46ad20d3-51c9-4784-b430-69c2d299b691",gn="c0dabb2d-25ed-4579-a289-5a430ac0ec37",vn="/__l5e/assets-v1/46ad20d3-51c9-4784-b430-69c2d299b691/menu-clasicos.jpg",jn="a/v1/c0dabb2d-25ed-4579-a289-5a430ac0ec37/46ad20d3-51c9-4784-b430-69c2d299b691/menu-clasicos.jpg",bn="menu-clasicos.jpg",Nn=46055,wn="image/jpeg",yn="2026-06-11T06:39:43Z",Cn={version:pn,asset_id:hn,project_id:gn,url:vn,r2_key:jn,original_filename:bn,size:Nn,content_type:wn,created_at:yn},_n=1,Mn="13d3dce6-5d36-420b-9874-af8561d44595",kn="c0dabb2d-25ed-4579-a289-5a430ac0ec37",Sn="/__l5e/assets-v1/13d3dce6-5d36-420b-9874-af8561d44595/menu-ebooks.jpg",En="a/v1/c0dabb2d-25ed-4579-a289-5a430ac0ec37/13d3dce6-5d36-420b-9874-af8561d44595/menu-ebooks.jpg",Rn="menu-ebooks.jpg",An=50873,In="image/jpeg",Tn="2026-06-11T06:39:43Z",Pn={version:_n,asset_id:Mn,project_id:kn,url:Sn,r2_key:En,original_filename:Rn,size:An,content_type:In,created_at:Tn},Dn=1,Ln="e520c541-88e8-4c02-bfb7-caa83613d47d",On="c0dabb2d-25ed-4579-a289-5a430ac0ec37",Fn="/__l5e/assets-v1/e520c541-88e8-4c02-bfb7-caa83613d47d/menu-certs.jpg",$n="a/v1/c0dabb2d-25ed-4579-a289-5a430ac0ec37/e520c541-88e8-4c02-bfb7-caa83613d47d/menu-certs.jpg",zn="menu-certs.jpg",Vn=78116,Un="image/jpeg",Kn="2026-06-11T06:39:43Z",Bn={version:Dn,asset_id:Ln,project_id:On,url:Fn,r2_key:$n,original_filename:zn,size:Vn,content_type:Un,created_at:Kn},se=({card:t})=>{const s=t.icon;return e.jsx(Y,{asChild:!0,children:e.jsxs(I,{to:t.to,className:"group relative flex h-full min-h-[200px] w-full select-none flex-col justify-end overflow-hidden rounded-md p-6 no-underline outline-none ring-1 ring-border/60 hover:ring-primary/40 transition-all focus:shadow-md",children:[t.image&&e.jsx("img",{src:t.image,alt:"",loading:"lazy",className:"absolute inset-0 h-full w-full object-cover transition-transform duration-700 group-hover:scale-105"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/85 to-background/30"}),e.jsx(s,{className:"absolute right-4 top-4 h-8 w-8 text-primary drop-shadow-lg"}),t.badge&&e.jsx("span",{className:"absolute left-4 top-4 text-[10px] uppercase tracking-wider font-bold text-primary bg-background/90 backdrop-blur px-2 py-0.5 rounded",children:t.badge}),e.jsxs("div",{className:"relative mt-auto",children:[e.jsx("div",{className:"mb-1.5 text-lg font-bold leading-tight drop-shadow-sm",children:t.title}),e.jsx("p",{className:"text-sm leading-snug text-muted-foreground",children:t.description})]})]})})},D=({item:t})=>{const s=t.icon;return e.jsx(Y,{asChild:!0,children:e.jsxs(I,{to:t.to,className:"group flex items-start gap-3 select-none rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent",children:[s&&e.jsx("span",{className:"mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary group-hover:bg-primary/15",children:e.jsx(s,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold",children:t.title}),t.badge&&e.jsx("span",{className:"text-[9px] uppercase tracking-wider font-bold text-primary bg-primary/10 px-1.5 py-0.5 rounded",children:t.badge})]}),t.description&&e.jsx("p",{className:"mt-1 text-xs leading-snug text-muted-foreground line-clamp-2",children:t.description})]})]})})},qn=[{slug:"sun-zi",title:"Sun Zi · El Arte de la Guerra"},{slug:"bubishi",title:"Bubishi · Biblia del Karate"},{slug:"shaolin",title:"Shaolin · Tradición Marcial"},{slug:"wubei-zhi",title:"Wubei Zhi · Enciclopedia Ming"},{slug:"jixiao-xinshu",title:"Jixiao Xinshu · Manual Militar"},{slug:"yijin-jing",title:"Yijin Jing · Cuerpo Shaolin"},{slug:"muye-dobo-tongji",title:"Muye Dobo Tongji · Corea"},{slug:"dhanurveda",title:"Dhanurveda · India"},{slug:"kalaripayattu",title:"Kalaripayattu · India"},{slug:"mahabharata",title:"Mahabharata · Épico Guerrero"},{slug:"huangdi-neijing",title:"Huangdi Neijing · Medicina"},{slug:"estrategia-asiatica",title:"Estrategia Asiática Comparada"}],Gn=()=>e.jsx(Bt,{className:"hidden lg:flex",children:e.jsxs(qt,{children:[e.jsxs(U,{children:[e.jsx(H,{className:"bg-transparent",children:"Red Marcial"}),e.jsx(W,{children:e.jsxs("div",{className:"grid gap-3 p-4 md:w-[600px] lg:w-[700px] lg:grid-cols-[.9fr_1.1fr]",children:[e.jsx(se,{card:{to:"/mapa-dojos",title:"Mapa Mundial de Dojos",description:"Encuentra dojos verificados cerca de ti en cualquier país.",icon:xe,image:xn.url,badge:"Destacado"}}),e.jsxs("ul",{className:"grid gap-1",children:[e.jsx("li",{children:e.jsx(D,{item:{to:"/dojos",title:"Directorio de Dojos",description:"Buscador por estilo, ciudad y país.",icon:ce}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/maestros",title:"Maestros e Instructores",description:"Perfiles verificados con su trayectoria.",icon:et}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/miembros",title:"Miembros",description:"Comunidad global de practicantes.",icon:le}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/artes-marciales",title:"Artes Marciales",description:"Explora estilos y tradiciones.",icon:Le}})})]})]})})]}),e.jsxs(U,{children:[e.jsx(H,{className:"bg-transparent",children:"Aprende"}),e.jsx(W,{children:e.jsxs("div",{className:"grid gap-3 p-4 md:w-[640px] lg:w-[760px] lg:grid-cols-[1fr_1fr]",children:[e.jsx(se,{card:{to:"/clasicos",title:"Clásicos · Tratados Marciales",description:"Sun Zi, Bubishi, Shaolin y 9 pilares más con +140 guías y ebooks.",icon:pt,image:Cn.url,badge:"Nuevo"}}),e.jsxs("ul",{className:"grid gap-1",children:[e.jsx("li",{children:e.jsx(D,{item:{to:"/articulos",title:"Artículos",description:"Análisis profundo, historia y técnica.",icon:re}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/videos",title:"Videoteca",description:"Lecciones y demostraciones.",icon:tt}}
21)}),e.jsx("li",{children:e.jsx(D,{item:{to:"/eventos",title:"Eventos y Seminarios",description:"Próximos seminarios mundiales.",icon:Pe}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/newsletter",title:"Newsletter",description:"Recibe lo mejor cada semana.",icon:Ie}})})]})]})})]}),e.jsxs(U,{children:[e.jsx(H,{className:"bg-transparent",children:"Clásicos"}),e.jsx(W,{children:e.jsxs("div",{className:"p-4 md:w-[640px] lg:w-[760px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 px-1",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold",children:"Pilares de la Sabiduría Marcial"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Los 12 grandes tratados de Asia."})]}),e.jsx(I,{to:"/clasicos",className:"text-xs font-semibold text-primary hover:underline",children:"Ver todos →"})]}),e.jsx("ul",{className:"grid grid-cols-2 gap-1",children:qn.map(t=>e.jsx("li",{children:e.jsx(Y,{asChild:!0,children:e.jsx(I,{to:`/clasicos#${t.slug}`,className:"block rounded-md p-2.5 text-sm font-medium hover:bg-accent hover:text-accent-foreground transition-colors",children:t.title})})},t.slug))})]})})]}),e.jsxs(U,{children:[e.jsx(H,{className:"bg-transparent",children:"Tienda"}),e.jsx(W,{children:e.jsxs("div",{className:"grid gap-3 p-4 md:w-[640px] lg:w-[760px] lg:grid-cols-[1fr_1fr]",children:[e.jsx(se,{card:{to:"/tienda/ebooks",title:"Librería de Ebooks",description:"PDF, EPUB y MOBI. Tratados clásicos y guías modernas.",icon:nt,image:Pn.url,badge:"Destacado"}}),e.jsxs("ul",{className:"grid gap-1",children:[e.jsx("li",{children:e.jsx(D,{item:{to:"/tienda",title:"Tienda General",description:"Productos físicos y digitales.",icon:at}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/tienda/digitales",title:"Productos Digitales",description:"Descargas instantáneas.",icon:rt}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/mis-descargas",title:"Mis Descargas",description:"Accede a tus compras.",icon:it}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/premium",title:"Acceso Premium",description:"Beneficios exclusivos.",icon:ot,badge:"PRO"}})})]})]})})]}),e.jsxs(U,{children:[e.jsx(H,{className:"bg-transparent",children:"Certificaciones"}),e.jsx(W,{children:e.jsxs("div",{className:"grid gap-3 p-4 md:w-[600px] lg:grid-cols-[.9fr_1.1fr]",children:[e.jsx(se,{card:{to:"/certificaciones",title:"Programa Oficial KBR",description:"Verificación internacional para miembros, instructores y dojos.",icon:ct,image:Bn.url}}),e.jsxs("ul",{className:"grid gap-1",children:[e.jsx("li",{children:e.jsx(D,{item:{to:"/certificaciones/miembro-registrado",title:"Miembro Registrado",icon:le}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/certificaciones/instructor-certificado",title:"Instructor Certificado",icon:Te}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/certificaciones/dojo-certificado",title:"Dojo Certificado",icon:ce}})}),e.jsx("li",{children:e.jsx(D,{item:{to:"/gestion-dojo",title:"DojoMaster Pro",description:"Software de gestión.",icon:ie,badge:"Nuevo"}})})]})]})})]}),e.jsx(U,{children:e.jsx(Y,{asChild:!0,className:T("group inline-flex h-9 w-max items-center justify-center gap-1.5 rounded-md bg-transparent px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground"),children:e.jsxs("a",{href:st,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(jt,{className:"h-4 w-4"}),"Podcast"]})})}),e.jsx(U,{children:e.jsx(Y,{asChild:!0,className:T("group inline-flex h-9 w-max items-center justify-center rounded-md bg-transparent px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground"),children:e.jsx(I,{to:"/precios",children:"Precios"})})})]})}),Hn=({message:t="🎉 Nueva App de Gestión para Dojos y Federaciones",linkText:s="Descúbrela",linkHref:a="/gestion-dojo",variant:i="gradient",dismissible:r=!0,storageKey:o="announcement-dismissed"})=>{const[n,m]=c.useState(()=>typeof window<"u"?localStorage.getItem(o)==="true":!1),x=()=>{m(!0),typeof window<"u"&&localStorage.setItem(o,"true")};if(n)return null;const f={default:"bg-primary text-primary-foreground",gradient:"bg-gradient-to-r from-primary via-primary/90 to-accent text-primary-foreground",highlight:"bg-amber-500 text-amber-950"};return e.jsxs("div",{className:T("relative py-2 px-4 text-center text-sm font-medium",f[i]),children:[e.jsxs("div",{className:"container mx-auto flex items-center justify-center gap-2",children:[e.jsx(Le,{className:"w-4 h-4 hidden sm:inline-block animate-pulse"}),e.jsx("span",{className:"hidden sm:inline",children:t}),e.jsx("span",{className:"sm:hidden",children:"🎉 Nueva App de Gestión"}),e.jsxs(I,{to:a,className:"inline-flex items-center gap-1 underline underline-offset-2 hover:no-underline font-semibold",children:[s,e.jsx(is,{className:"w-3 h-3"})]})]}),r&&e.jsx("button",{onClick:x,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded-full hover:bg-white/20 transition-colors","aria-label":"Cerrar anuncio",children:e.jsx(oe,{className:"w-4 h-4"})})]})},Ha=()=>{const[t,s]=c.useState(!1),[a,i]=c.useState(""),[r,o]=c.useState([]),[n,m]=c.useState(null),[x,f]=c.useState(!1),[l,v]=c.useState(0),{toggleMobileMenu:_,isMobileMenuOpen:b}=me(),{user:w}=Q();De();const M=Ae();return fe(),c.useEffect(()=>{(async()=>
21{if(!w){f(!1),m(null);return}try{const{data:N}=await E.from("dojos").select("id, slug, on_trial, trial_ends_at, subscription_status, is_premium").eq("user_id",w.id);if(N&&N.length>0){const p=N.filter(d=>{const y=d.on_trial&&d.trial_ends_at&&new Date(d.trial_ends_at).getTime()>Date.now(),C=d.is_premium||d.subscription_status==="active";return y||C});f(p.length>0),m(p[0]?.slug||N[0]?.slug||null),v(N.length)}else f(!1),m(null),v(0)}catch{f(!1),m(null),v(0)}})()},[w]),c.useEffect(()=>{const N=setTimeout(async()=>{const p=a.trim();if(!p){o([]);return}const d=`%${p}%`,[y,C,R,O,z,S]=await Promise.all([E.from("articles").select("id, title, slug, summary").eq("published",!0).ilike("title",d).limit(5),E.from("dojos").select("id, name, slug, city").ilike("name",d).limit(5),E.from("events").select("id, title, slug, location, date_start").eq("published",!0).ilike("title",d).limit(5),E.from("teacher_profiles").select("id, name, slug, bio").ilike("name",d).limit(5),E.from("video_gallery").select("id, title, slug, description").eq("is_active",!0).ilike("title",d).limit(5),E.from("marketplace_products").select("id, title, slug, description, format, category").eq("published",!0).eq("available",!0).ilike("title",d).limit(8)]),A=[];(y.data||[]).forEach(j=>A.push({id:`a-${j.id}`,title:j.title,subtitle:j.summary||void 0,slug:j.slug,type:"article"})),(C.data||[]).forEach(j=>A.push({id:`d-${j.id}`,title:j.name,subtitle:j.city||void 0,slug:j.slug,type:"dojo"})),(R.data||[]).forEach(j=>A.push({id:`e-${j.id}`,title:j.title,subtitle:j.location||void 0,slug:j.slug,type:"event"})),(O.data||[]).forEach(j=>A.push({id:`t-${j.id}`,title:j.name,subtitle:j.bio||void 0,slug:j.slug,type:"maestro"})),(z.data||[]).forEach(j=>A.push({id:`v-${j.id}`,title:j.title,subtitle:j.description||void 0,slug:j.slug,type:"video"})),(S.data||[]).forEach(j=>{const ee=/pdf|epub|mobi/i.test(j.format||"")||/libro|ebook/i.test(j.category||"");A.push({id:`p-${j.id}`,title:j.title,subtitle:j.description||void 0,slug:j.slug,type:ee?"ebook":"product"})}),o(A)},250);return()=>clearTimeout(N)},[a]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sticky top-0 z-50",children:[e.jsx(Hn,{}),e.jsx("nav",{className:"border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"flex items-center justify-between h-14 md:h-16 gap-2 md:gap-4",children:[e.jsxs(I,{to:"/",className:"flex items-center space-x-2 flex-shrink-0 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-primary rounded-sm flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-primary-foreground font-bold text-sm",children:"K"})}),e.jsx("span",{className:"font-bold text-base md:text-lg tracking-tight hidden sm:inline-block truncate",children:"Kokusai Bujin Renmei"})]}),e.jsx(Gn,{}),e.jsx("div",{className:"hidden md:flex items-center flex-1 min-w-[220px] max-w-md lg:max-w-lg xl:max-w-xl mx-4",children:e.jsx(Ke,{value:a,onChange:i,onSelect:()=>i(""),suggestions:r,placeholder:"Buscar dojos, eventos, artículos…",autoNavigate:!0,className:"w-full"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{asChild:!0,size:"sm",variant:"default",className:"hidden md:inline-flex gap-2",children:e.jsxs(I,{to:"/dojos?nearby=1","aria-label":"Encuentra dojos cerca de ti",children:[e.jsx(xe,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden lg:inline",children:"Cerca de mí"})]})}),e.jsx("button",{className:"md:hidden p-2 rounded-md hover:bg-muted transition-colors min-h-[44px] min-w-[44px] flex items-center justify-center",onClick:()=>s(!0),"aria-label":"Buscar",children:e.jsx(lt,{className:"w-5 h-5"})}),e.jsx("div",{className:"hidden md:block",children:e.jsx(Rs,{})}),e.jsx(_e,{variant:"desktop"}),e.jsx("button",{className:"lg:hidden p-2 rounded-md hover:bg-muted transition-colors min-h-[44px] min-w-[44px] flex items-center justify-center",onClick:_,"aria-label":b?"Cerrar menú":"Abrir menú","aria-expanded":b,children:b?e.jsx(oe,{className:"w-5 h-5"}):e.jsx(Es,{className:"w-5 h-5"})})]})]})})})]}),t&&e.jsx("div",{className:"md:hidden fixed inset-0 bg-background z-[60] overflow-y-auto animate-in fade-in duration-200",children:e.jsxs("div",{className:"container mx-auto px-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Buscar"}),e.jsx("button",{onClick:()=>{s(!1),i("")},className:"p-2 rounded-full hover:bg-muted transition-colors min-h-[44px] min-w-[44px] flex items-center justify-center","aria-label":"Cerrar búsqueda",children:e.jsx(oe,{className:"w-6 h-6"})})]}),e.jsx(Ke,{value:a,onChange:i,onSelect:()=>{i(""),s(!1)},onSubmit:k=>{i(""),s(!1),M(`/buscar?q=${encodeURIComponent(k)}`)},suggestions:r,placeholder:"Buscar dojos, eventos, artículos, ebooks…",autoNavigate:!0,className:"w-full"})]})}),e.jsx(Ps,{}),e.jsx(Ls,{}),e.jsx(Fs,{})]})};export{Ha as AdaptiveNavigation,Ha 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.