PageSourceSearch

https://beakschool.com/assets/trainer-Bro---I4.js

js beakschool.com collected 2026-10-09 04:58:49 UTC 3,526 bytes, 1 lines download raw bytes

1import{u as T,m as w,b as h,cz as A,fF as F,r as p,c as L,j as e,N as u,L as S,dI as C,B as W,l as B,O as I,t as l,aG as M}from"./index-D216bJFT.js";import{T as q}from"./TrainerAgreementPanel-BpZYML8m.js";import{M as n}from"./MemberShell-B-4iMjXG.js";import{C as E}from"./checkbox-DEQzkYAy.js";import"./index-CaPmXL38.js";function K(){const{user:t,loading:j}=T(),a=w(),b=h(A),g=h(F),[d,m]=p.useState(!1),[i,f]=p.useState(!1),c=L({queryKey:["my-trainer-status",t?.id],queryFn:()=>b({}),enabled:!!t,staleTime:6e4});if(j||t&&c.isLoading)return e.jsx(n,{centre:"max-w-6xl",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-8 w-48 animate-pulse rounded-lg bg-ink/5"}),e.jsx("div",{className:"h-32 animate-pulse rounded-2xl bg-ink/5"}),e.jsx("div",{className:"h-32 animate-pulse rounded-2xl bg-ink/5"})]})});if(!t)return e.jsx(u,{to:"/login",search:{redirect:"/trainer"},replace:!0});const s=c.data;if(!s?.isTrainer)return e.jsx(n,{centre:"max-w-2xl",children:e.jsxs("div",{className:"py-10 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-jungle-deep",children:"Trainer access required"}),e.jsx("p",{className:"mt-3 text-sm text-ink/70",children:"This area is only for approved Beak School trainers. If you'd like to join the roster, apply below."}),e.jsx(S,{to:"/become-a-trainer",className:"mt-6 inline-flex min-h-[44px] items-center justify-center rounded-lg bg-sunset px-5 py-2.5 text-sm font-semibold text-white hover:bg-sunset/90",children:"Apply to become a trainer"})]})});const y=s.profile?.onboarded_at,x=a.pathname==="/trainer/messages";if(s.isTrainer&&!y&&!a.pathname.startsWith("/trainer/onboarding")&&!x)return e.jsx(u,{to:"/trainer/onboarding"});const v=a.pathname.startsWith("/trainer/onboarding"),N=a.pathname.startsWith("/trainer/call/")||a.pathname.startsWith("/trainer/bookings");if(s.needsTermsAcceptance&&s.currentTerms&&!v&&!x&&!N){const r=s.currentTerms;async function k(){if(!i){l.error("Please confirm you've read the agreement.");return}m(!0);try{await g({data:{versionId:r.id}}),l.success("Welcome aboard."),c.refetch()}catch(o){l.error(M(o,"Failed to record acceptance"))}finally{m(!1)}}return e.jsx(n,{centre:"max-w-3xl",children:e.jsx("div",{className:"py-4",children:e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-white",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-border/60 px-6 py-4",children:[e.jsx(C,{className:"h-5 w-5 shrink-0 text-jungle-deep"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-lg font-semibold text-jungle-deep",children:"New trainer agreement"}),e.jsxs("p",{className:"text-xs text-ink/60",children:[r.title," (version ",r.version,"). Give this a read and accept it to continue into your trainer panel."]})]})]}),e.jsx("div",{className:"px-6 py-5",children:e.jsx(q,{terms:r})}),e.jsxs("div",{className:"space-y-3 border-t border-border/60 px-6 py-4",children:[e.jsxs("label",{className:"flex min-h-[44px] items-start gap-2 py-1 text-sm text-ink",children:[e.jsx(E,{checked:i,onCheckedChange:o=>f(!!o),className:"mt-0.5"}),e.jsxs("span",{children:["I have read and agree to the Beak School Trainer Agreement (version ",r.version,")."]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(W,{onClick:k,disabled:!i||d,children:[d&&e.jsx(B,{className:"mr-2 h-4 w-4 animate-spin"}),"Accept and continue"]})})]})]})})})}return e.jsx(n,{centre:"max-w-5xl",children:e.jsx("div",{className:"min-w-0",children:e.jsx(I,{})})})}export{K as component};

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.