PageSourceSearch

https://app.luzclimbing.com/assets/AppLayout-Yru-jxME.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5

js luzclimbing.com collected 2026-10-09 22:59:32 UTC 16,799 bytes, 1 lines download raw bytes

1import{_ as e,b as t,d as n,g as r,l as i,t as a,u as o}from"./chunk-OB3PAWPO-_QycuKQg.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{P as s,n as c,t as l}from"./useMutation-BR1gprHw.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{h as u,n as d,s as f,u as p}from"./api-hooks-eDO0FKsc.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{o as m,t as h}from"./useTranslation-B0S81Ykm.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{O as g,S as _,b as v,n as y,w as b,x}from"./ui-Qn-rhT_1.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{t as S}from"./message-square-8RUmKeOc.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{t as C}from"./ModeToggle-CsUDAwNB.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{t as w}from"./apiClientWithAuth-DEZUvJNz.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";import{i as T,l as E,y as D}from"./index-DDUSkQ7y.js?dpl=dpl_GcGqAmmt7QDBDUd3B6otoHaA1dc5";var O={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};O.node;var k=m(O),A={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};A.node;var j=m(A),M=t(e(),1),N=r();function P(){let{t:e}=h(),{data:t}=d(),{mutate:n,isPending:r}=f(),[i,a]=(0,M.useState)(!1),o=(t?.journal_ask_pending??!1)&&!i;return(0,N.jsx)(g,{open:o,onOpenChange:e=>{e||a(!0)},title:e(`settings.journalAsk.title`),description:e(`settings.journalAsk.description`),confirmText:e(`settings.journalAsk.allow`),cancelText:e(`settings.journalAsk.keepPrivate`),isLoading:r,onConfirm:()=>n({journal_visible_to_ai:!0}),onCancel:()=>n({journal_visible_to_ai:!1})})}function F(){let{t:e}=h(),t=o(),{totalUnread:n,totalCoachUnread:r,totalTeamUnread:i,hasCoaches:a,hasTeams:s}=T();return!a&&!s?null:(0,N.jsxs)(v,{children:[(0,N.jsx)(y,{content:e(`notifications.title`,{defaultValue:`Notifications`}),children:(0,N.jsx)(b,{asChild:!0,children:(0,N.jsxs)(`button`,{className:`relative h-10 w-10 p-0 inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 rounded-md hover:bg-primary/10 hover:text-primary`,"aria-label":e(`notifications.title`,{defaultValue:`Notifications`}),children:[(0,N.jsx)(k,{className:`h-5 w-5`}),n>0&&(0,N.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-[10px] font-bold text-destructive-foreground animate-in fade-in zoom-in`,children:n>99?`99+`:n})]})})}),(0,N.jsxs)(x,{align:`end`,className:`w-64`,children:[a&&(0,N.jsxs)(_,{onClick:()=>{localStorage.setItem(`chat_tab`,`coach`),t(`/chat`)},children:[(0,N.jsx)(S,{className:`mr-2 h-4 w-4 shrink-0`}),(0,N.jsx)(`span`,{className:`flex-1`,children:e(`notifications.coachMessages`,{defaultValue:`Coach messages`})}),r>0&&(0,N.jsx)(`span`,{className:`ml-2 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1.5 text-[10px] font-bold text-destructive-foreground`,children:r})]}),s&&(0,N.jsxs)(_,{onClick:()=>{localStorage.setItem(`chat_tab`,`teams`),t(`/chat`)},children:[(0,N.jsx)(j,{className:`mr-2 h-4 w-4 shrink-0`}),(0,N.jsx)(`span`,{className:`flex-1`,children:e(`notifications.teamMessages`,{defaultValue:`Team messages`})}),i>0&&(0,N.jsx)(`span`,{className:`ml-2 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1.5 text-[10px] font-bold text-destructive-foreground`,children:i})]}),n===0&&(0,N.jsx)(`div`,{className:`px-3 py-4 text-center text-sm text-muted-foreground`,children:e(`notifications.noNew`,{defaultValue:`No new notifications`})})]})]})}var I=[`ai-chat`,`dashboard`,`calendar`,`logbook`,`projects`,`training`,`wellbeing`,`reports`,`settings`],L={"ai-chat":!0,dashboard:!0,calendar:!0,logbook:!0,projects:!0,training:!0,wellbeing:!0,reports:!0,settings:!0},R=`navigation-preferences`,z=`navigation-preferences-updated`;function B(e){let t=[...e];for(let e of I)if(!t.includes(e)){let n=I.indexOf(e),r=Math.min(n,t.length);t.splice(r,0,e)}return t}var V=()=>{window.dispatchEvent(new CustomEvent(z))};function H(){let[e,t]=(0,M.useState)(()=>{try{let e=localStorage.getItem(R);if(e){let t=JSON.parse(e);return{order:B(t.order||I),visibility:{...L,...t.visibility}}}}catch(e){console.error(`Failed to parse navigation preferences from localStorage:`,e)}return{order:I,visibility:L}});(0,M.useEffect)(()=>{let e=()=>{try{let e=localStorage.getItem(R);if(e){let n=JSON.parse(e);t({order:B(n.order||I),visibility:{...L,...n.visibility}})}}catch(e){console.error(`Failed to sync navigation preferences:`,e)}};window.addEventListener(z,e);let n=t=>{t.key===R&&e()};return window.addEventListener(`storage`,n),()=>{window.removeEventListener(z,e),window.removeEventListener(`storage`,n)}},[]);let n=(0,M.useCallback)(e=>{try{localStorage.setItem(R,JSON.stringify(e)),t(e),V()}catch(e){console.error(`Failed to save navigation preferences to localStorage:`,e)}},[]);return{preferences:e,updateOrder:(0,M.useCallback)(t=>{let r={...e,order:t};n(r)},[e,n]),updateVisibility:(0,M.useCallback)((t,r)=>{if(t===`settings`||t===`ai-chat`||t===`dashboard`)return;let i={...e,visibility:{...e.visibility,[t]:r}};n(i)},[e,n]),resetToDefaults:(0,M.useCallback)(()=>{n({order:I,visibility:L})},[n]),getOrderedVisibleItems:(0,M.useCallback)(t=>{let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e.order){let i=n.get(t);i&&(e.visibility[t]||i.isAlwaysVisible)&&r.push({...i,isVisible:e.visibility[t]??!0})}
1for(let n of t)!e.order.includes(n.id)&&(e.visibility[n.id]!==!1||n.isAlwaysVisible)&&r.push({...n,isVisible:e.visibility[n.id]??!0});return r},[e])}}var U=20;function W(e){return c({queryKey:[`reports`,e],queryFn:async()=>await w.getReports({period_type:e?.periodType,limit:e?.limit,offset:e?.offset}),staleTime:3e5})}function G(e){let t=e?.limit??U;return u({queryKey:[`reports`,`infinite`,{periodType:e?.periodType,limit:t}],queryFn:async({pageParam:n})=>await w.getReports({period_type:e?.periodType,limit:t,offset:n}),initialPageParam:0,getNextPageParam:(e,t)=>{if(e.reports.length===0)return;let n=t.reduce((e,t)=>e+t.reports.length,0);return n<e.total?n:void 0},staleTime:3e5})}function K(e){return c({queryKey:[`report`,e],queryFn:async()=>{if(!e)throw Error(`No report ID`);return await w.getReport(e)},enabled:!!e,staleTime:6e5,refetchInterval:e=>{let t=e.state.data?.status;return t===`generating`||t===`pending`?2e4:!1}})}function q(){let e=W({limit:5}),t=e.data?.reports,n;if(t&&t.length>0){let e=t.find(e=>e.periodType===`monthly`&&e.status===`completed`&&!e.readAt),r=t.find(e=>e.periodType===`weekly`&&e.status===`completed`&&!e.readAt);n=e||r||t[0]}return{report:n,isLoading:e.isLoading,error:e.error}}function J(){let e=W({limit:10});return{unreadCount:e.data?.reports?.filter(e=>e.status===`completed`&&!e.readAt).length??0,isLoading:e.isLoading}}function Y(){let e=s();return l({mutationFn:async e=>await w.markReportRead(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`reports`]})}})}function X(){let e=s();return l({mutationFn:async({reportId:e,answers:t})=>await w.saveReflectionAnswers(e,t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`report`,n.reportId]}),e.invalidateQueries({queryKey:[`reports`]})}})}function Z(){let e=s();return l({mutationFn:async e=>await w.generateReport(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`reports`]}),e.invalidateQueries({queryKey:[`report`]})}})}var Q=new Map;D.forEach(e=>{Q.set(e.path,e)});function $({isOpen:e}){let{t}=h(),{data:r,error:o}=p(),s=i(),c=n(),{getOrderedVisibleItems:l}=H(),{totalUnread:u}=T(),{unreadCount:d}=J(),f=E(),m=(0,M.useMemo)(()=>[{id:`ai-chat`,name:t(f?`navigation.journal`:`chat.title`),href:`/chat`,isVisible:!0,isAlwaysVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z`})})},{id:`dashboard`,name:t(`navigation.dashboard`),href:`/dashboard`,isVisible:!0,isAlwaysVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z`})})},{id:`calendar`,name:t(`common.calendar`,{defaultValue:`Calendar`}),href:`/calendar`,isVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z`})})},{id:`logbook`,name:t(`common.logbook`,{defaultValue:`Logbook`}),href:`/logbook`,isVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253`})})},{id:`projects`,name:t(`navigation.projects`),href:`/projects`,isVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2`})})},{id:`training`,name:t(`navigation.training`),href:`/training`,isVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M13 10V3L4 14h7v7l9-11h-7z`})})},{id:`wellbeing`,name:t(`navigation.wellbeing`),href:`/wellbeing`,isVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`})})},{id:`reports`,name:t(`reports.pageTitle`),href:`/reports`,isVisible:!0,icon:(0,N.jsx)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})})},{id:`settings`,name:t(`navigation.settings`),href:`/settings`,isVisible:!0,isAlwaysVisible:!0,icon:(0,N.jsxs)(`svg`,{className:`nav-icon`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:[(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,N.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})}],[t,f]),g=(0,M.useMemo)(()=>l(m),[l,m]);return o&&console.error(`Failed to load user profile:`,o),(0,N.jsxs)(`aside`,{className:`fixed inset-y-0 left-0 z-30 w-64 transform transition duration-300 ease-in-out bg-card text-card-foreground border-r border-border md:translate-x-0 md:relative flex flex-col ${e?`translate-x-0`:`-translate-x-full`}`,children:[(0,N.jsx)(`div`,{className:`py-4 md:py-6 px-4 border-b border-border flex-shrink-0`,children:(0,N.jsxs)(a,{to:`/`,className:`flex flex-col md:flex-col items-center gap-2 md:gap-2 hover:no-underline group`,children:[(0,N.jsx)(`img`,{src:`/app-icon.png`,alt:`Luz`,className:`h-8 md:h-10 w-8 md:w-10 transition-transform duration-300 group-hover:scale-105 flex-shrink-0 rounded-lg`}),(0,N.jsx)(`div`,{className:`text-center`,children:(0,N.jsx)(`span`,{className:`font-display text-lg md:text-xl font-semibold text-card-foreground`,children:`Luz`})})]})}),(0,N.jsx)(`nav`,{className:`flex-1 px-4 pt-4 space-y-2 overflow-y-auto pb-4`,children:g.map(e=>{let t=s.pathname===e.href||s.pathname.startsWith(e.href+`/`),n=c.location?.pathname===e.href||c.location?.pathname.startsWith(e.href+`/`);return(0,N.jsxs)(a,{to:e.href,className:`nav-link ${t?`active`:``} ${n?`navigating`:``}`,prefetch:`intent`,onMouseEnter:()=>{Q.get(e.href)?.component.preload?.()},children:[e.icon,e.name,e.id===`ai-chat`&&u>0&&(0,N.jsx)(`span`,{className:`ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1.5 text-[10px] font-bold text-destructive-foreground`,children:u}),e.id===`reports`&&d>0&&(0,N.jsx)(`span`,{className:`ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-[10px] font-bold text-primary-foreground`,children:d}),n&&(0,N.jsx)(`span`,{className:`ml-auto`,children:(0,N.jsxs)(`svg`,{className:`animate-spin h-4 w-4 text-primary`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,N.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,N.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})})]},e.name)})}),(0,N.jsxs)(`div`,{className:`border-t border-border p-3 md:p-4 flex-shrink-0`,children:[(0,N.jsxs)(a,{to:`/profile`,className:`flex items-center p-2 rounded-lg hover:bg-muted transition-colors`,children:[r?.avatar_url?(0,N.jsx)(`img`,{className:`h-8 md:h-10 w-8 md:w-10 rounded-full border-2 border-primary/30 flex-shrink-0`,src:r.avatar_url,alt:`User Profile`,width:40,height:40}):(0,N.jsx)(`div`,{className:`h-8 md:h-10 w-8 md:w-10 rounded-full border-2 border-primary/30 flex-shrink-0 bg-primary flex items-center justify-center text-primary-foreground font-semibold`,children:(r?.full_name||r?.username||`U`)[0].toUpperCase()}),(0,N.jsxs)(`div`,{className:`ml-2 md:ml-3 min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`text-sm md:text-base font-semibold text-card-foreground truncate`,children:r?.full_name||r?.username||`Loading...`}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`profile.title`)})]})]}),(0,N.jsx)(`div`,{className:`mt-2 md:mt-3 flex justify-center`,children:(0,N.jsx)(C,{dropdownDirection:`up`})})]})]})}function ee({children:e}){let[t,n]=(0,M.useState)(!1),{t:r}=h();return(0,N.jsxs)(`div`,{className:`flex h-screen bg-background mobile-viewport-fix`,children:[(0,N.jsx)(P,{}),(0,N.jsx)($,{isOpen:t}),(0,N.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,N.jsxs)(`header`,{className:`flex justify-between items-center p-4 bg-card text-card-foreground md:hidden shadow-md border-b border-border`,children:[(0,N.jsxs)(a,{to:`/`,className:`flex items-center gap-2 hover:no-underline`,prefetch:`intent`,children:[(0,N.jsx)(`img`,{src:`/app-icon.png`,alt:r(`common.appName`),className:`h-7 w-7 rounded-lg`}),(0,N.jsx)(`span`,{className:`font-display text-lg font-semibold`,children:r(`common.appName`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,N.jsx)(F,{}),(0,N.jsx)(C,{}),(0,N.jsx)(`button`,{onClick:()=>n(!t),className:`focus:outline-none`,children:(0,N.jsx)(`svg`,{className:`h-6 w-6`,viewBox:`0 0 24 24`,fill:`none`,children:t?(0,N.jsx)(`path`,{d:`M6 18L18 6M6 6l12 12`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,N.jsx)(`path`,{d:`M4 6H20M4 12H20M4 18H20`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]}),(0,N.jsx)(`main`,{className:`flex-1 mobile-scroll-container bg-background`,children:e})]})]})}export{Y as a,H as c,k as d,q as i,F as l,Z as n,K as o,G as r,X as s,ee as t,j as u};

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.