PageSourceSearch

https://attentivekids.com/assets/dashboard.tools-BjUQh0_6.js

js attentivekids.com collected 2026-10-05 19:25:20 UTC 12,316 bytes, 1 lines download raw bytes

vendor: 5,501 bytes, line 1
1import{r as a,j as e,a4 as he,s as M}from"./index-BsRSMeKU.js";import{S as U}from"./SiteLayout-DNSxubCI.js";import{I as Te}from"./input-CNQIkxUg.js";import{b as Y,c as _,d as I,e as Q,a as W,i as ye}from"./index-AxcXCPyn.js";import{e as Ie,u as J}from"./select--8WqYCbA.js";import{u as we,c as $}from"./utils-Cd1xaGFt.js";import{d as je}from"./index-CEKKEku5.js";import{B as q}from"./badge-BlipHigB.js";import{B as Ne}from"./button-ZaEW_QT0.js";import{g as Ce,T as z}from"./registry-D32_MIfL.js";import{T as Se}from"./ToolPanel-CIjBtsCm.js";import{P as Fe}from"./PublicToolPanel-DUYBDdLg.js";import{T as Re}from"./ToolErrorBoundary-C9vHvsq1.js";import{L as _e}from"./loader-circle-D_8RmJX5.js";import{S as Ae}from"./sparkles-DbJgDMA0.js";import{S as Ee}from"./search-DxDxv8Qe.js";import{L as Pe}from"./lock-BuGBiAdB.js";import"./country--Iv0tniC.js";import"./locale-yHjLYqC7.js";import"./useServerFn-DhhRxcq0.js";import"./geo.functions-CvW3GFoq.js";import"./createServerFn-BHw5sAbd.js";import"./check-D8hA-j4R.js";import"./clsx-B-dksMZM.js";import"./RedeemCodeLink-1pz8wfVS.js";import"./sheet-DsWlTkFG.js";import"./textarea-CUFZA43Z.js";import"./label-C163Lkh3.js";import"./slider-Cj_1ZTTl.js";import"./circle-alert-BSsyl-X-.js";import"./refresh-cw-BM5BeKwt.js";import"./copy-BNvaHOFZ.js";import"./printer-CbPdeqYO.js";import"./WhatsAppShareButton-y3z5KNBb.js";import"./message-circle-By3ZEpyo.js";import"./arrow-right-B5PUMYeT.js";import"./triangle-alert-CJdkJ04V.js";var G="rovingFocusGroup.onEntryFocus",Le={bubbles:!1,cancelable:!0},A="RovingFocusGroup",[O,X,ke]=Ie(A),[De,Z]=Q(A,[ke]),[Me,Ge]=De(A),ee=a.forwardRef((t,o)=>e.jsx(O.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(O.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Oe,{...t,ref:o})})}));ee.displayName=A;var Oe=a.forwardRef((t,o)=>{const{__scopeRovingFocusGroup:s,orientation:r,loop:n=!1,dir:m,currentTabStopId:l,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:h,onEntryFocus:f,preventScrollOnEntryFocus:i=!1,...u}=t,x=a.useRef(null),w=we(o,x),j=J(m),[N,d]=W({prop:l,defaultProp:v??null,onChange:h,caller:A}),[T,R]=a.useState(!1),b=ye(f),y=X(s),c=a.useRef(!1),[g,C]=a.useState(0);return a.useEffect(()=>{const p=x.current;if(p)return p.addEventListener(G,b),()=>p.removeEventListener(G,b)},[b]),e.jsx(Me,{scope:s,orientation:r,dir:j,loop:n,currentTabStopId:N,onItemFocus:a.useCallback(p=>d(p),[d]),onItemShiftTab:a.useCallback(()=>R(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(p=>p+1),[]),onFocusableItemRemove:a.useCallback(()=>C(p=>p-1),[]),children:e.jsx(_.div,{tabIndex:T||g===0?-1:0,"data-orientation":r,...u,ref:w,style:{outline:"none",...t.style},onMouseDown:I(t.onMouseDown,()=>{c.current=!0}),onFocus:I(t.onFocus,p=>{const k=!c.current;if(p.target===p.currentTarget&&k&&!T){const E=new CustomEvent(G,Le);if(p.currentTarget.dispatchEvent(E),!E.defaultPrevented){const S=y().filter(F=>F.focusable),D=S.find(F=>F.active),P=S.find(F=>F.id===N),xe=[D,P,...S].filter(Boolean).map(F=>F.ref.current);re(xe,i)}}c.current=!1}),onBlur:I(t.onBlur,()=>R(!1))})})}),te="RovingFocusGroupItem",oe=a.forwardRef((t,o)=>{const{__scopeRovingFocusGroup:s,focusable:r=!0,active:n=!1,tabStopId:m,children:l,...v}=t,h=Y(),f=m||h,i=Ge(te,s),u=i.currentTabStopId===f,x=X(s),{onFocusableItemAdd:w,onFocusableItemRemove:j,currentTabStopId:N}=i;return a.useEffect(()=>{if(r)return w(),()=>j()},[r,w,j]),e.jsx(O.ItemSlot,{scope:s,id:f,focusable:r,active:n,children:e.jsx(_.span,{tabIndex:u?0:-1,"data-orientation":i.orientation,...v,ref:o,onMouseDown:I(t.onMouseDown,d=>{r?i.onItemFocus(f):d.preventDefault()}),onFocus:I(t.onFocus,()=>i.onItemFocus(f)),onKeyDown:I(t.onKeyDown,d=>{if(d.key==="Tab"&&d.shiftKey){i.onItemShiftTab();return}if(d.target!==d.currentTarget)return;const T=$e(d,i.orientation,i.dir);if(T!==void 0){if(d.metaKey||d.ctrlKey||d.altKey||d.shiftKey)return;d.preventDefault();let b=x().filter(y=>y.focusable).map(y=>y.ref.current);if(T==="last")b.reverse();else if(T==="prev"||T==="next"){T==="prev"&&b.reverse();const y=b.indexOf(d.currentTarget);b=i.loop?Ve(b,y+1):b.slice(y+1)}setTimeout(()=>re(b))}}),children:typeof l=="function"?l({isCurrentTabStop:u,hasTabStop:N!=null}):l})})});oe.displayName=te;var Ke={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Be(t,o){return o!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function $e(t,o,s){const r=Be(t.key,s);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ke[r]}function re(t,o=!1){const s=document.activeElement;for(const r of t)if(r===s||(r.focus({preventScroll:o}),document.activeElement!==s))return}function Ve(t,o){return t.map((s,r)=>t[(o+r)%t.length])}var Ue=ee,qe=oe,L="Tabs",[ze]=Q(L,[Z]),se=Z(),[He,V]=ze(L),ae=a.forwardRef((t,o)=>{const{__scopeTabs:s,value:r,onValueChange:n,defaultValue:m,orientation:l="horizontal",dir:v,activationMode:h="automatic",...f}=t,i=J(v),[u,x]=W({prop:r,onChange:n,defaultProp:m??"",caller:L});return e.jsx(He,{scope:s,baseId:Y(),value:u,onValueChange:x,orientation:l,dir:i,activationMode:h,children:e.jsx(_.div,{dir:i,"data-orientation":l,...f,ref:o})})});ae.displayName=L;var ne="TabsList",ie=a.forwardRef((t,o)=>{const{__scopeTabs:s,loop:r=!0,...n}=t,m=V(ne,s),l=se(s);return e.jsx(Ue,{asChild:!0,...l,orientation:m.orientation,dir:m.dir,loop:r,children:e.jsx(_.div,{role:"tablist","aria-orientation":m.orientation,...n,ref:o})})});
1ie.displayName=ne;var ce="TabsTrigger",le=a.forwardRef((t,o)=>{const{__scopeTabs:s,value:r,disabled:n=!1,...m}=t,l=V(ce,s),v=se(s),h=me(l.baseId,r),f=fe(l.baseId,r),i=r===l.value;return e.jsx(qe,{asChild:!0,...v,focusable:!n,active:i,children:e.jsx(_.button,{type:"button",role:"tab","aria-selected":i,"aria-controls":f,"data-state":i?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:h,...m,ref:o,onMouseDown:I(t.onMouseDown,u=>{!n&&u.button===0&&u.ctrlKey===!1?l.onValueChange(r):u.preventDefault()}),onKeyDown:I(t.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&l.onValueChange(r)}),onFocus:I(t.onFocus,()=>{const u=l.activationMode!=="manual";!i&&!n&&u&&l.onValueChange(r)})})})});le.displayName=ce;var ue="TabsContent",de=a.forwardRef((t,o)=>{const{__scopeTabs:s,value:r,forceMount:n,children:m,...l}=t,v=V(ue,s),h=me(v.baseId,r),f=fe(v.baseId,r),i=r===v.value,u=a.useRef(i);return a.useEffect(()=>{const x=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(x)},[]),e.jsx(je,{present:n||i,children:({present:x})=>e.jsx(_.div,{"data-state":i?"active":"inactive","data-orientation":v.orientation,role:"tabpanel","aria-labelledby":h,hidden:!x,id:f,tabIndex:0,...l,ref:o,style:{...t.style,animationDuration:u.current?"0s":void 0},children:x&&m})})});de.displayName=ue;function me(t,o){return`${t}-trigger-${o}`}function fe(t,o){return`${t}-content-${o}`}var Ye=ae,pe=ie,ve=le,be=de;const Qe=Ye,ge=a.forwardRef(({className:t,...o},s)=>e.jsx(pe,{ref:s,className:$("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...o}));ge.displayName=pe.displayName;const K=a.forwardRef(({className:t,...o},s)=>e.jsx(ve,{ref:s,className:$("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...o}));K.displayName=ve.displayName;const B=a.forwardRef(({className:t,...o},s)=>e.jsx(be,{ref:s,className:$("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...o}));B.displayName=be.displayName;function We(){const t=he.useSearch(),[o,s]=a.useState(!1),[r,n]=a.useState(!1),[m,l]=a.useState(null),[v,h]=a.useState(null),[f,i]=a.useState(!1),[u,x]=a.useState(""),[w,j]=a.useState(null),[N,d]=a.useState(!1);a.useEffect(()=>{let c=!1;return(async()=>{const{data:{session:g}}=await M.auth.getSession();if(!g){if(c)return;n(!1),s(!0);return}n(!0);const[C,p]=await Promise.all([M.from("profiles").select("country_code, child_age").eq("id",g.user.id).maybeSingle(),M.from("user_access").select("product_slug, is_active, expires_at").eq("user_id",g.user.id).eq("is_active",!0)]);if(c)return;l(C.data?.country_code??null),h(C.data?.child_age??null);const k=Date.now(),E=(p.data??[]).some(S=>{const D=!S.expires_at||new Date(S.expires_at).getTime()>k,P=S.product_slug??"";return D&&(P.startsWith("membership-")||P==="ai-child-coach")});i(E),s(!0)})(),()=>{c=!0}},[]),a.useEffect(()=>{if(!o)return;const c=t.tool;if(!c)return;const g=Ce(c);g&&(j(g),d(!0))},[o,t.tool]);const T=a.useMemo(()=>{const c=u.trim().toLowerCase();return c?z.filter(g=>g.name.toLowerCase().includes(c)||g.description.toLowerCase().includes(c)||g.category.toLowerCase().includes(c)):z},[u]),R=T.filter(c=>c.audience==="parent").sort((c,g)=>{if(m!=="IN")return 0;const C=c.india_priority?1:0;return(g.india_priority?1:0)-C}),b=T.filter(c=>c.audience==="child"),y=c=>{j(c),d(!0)};return o?e.jsxs(U,{children:[e.jsx("div",{className:"bg-navy",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-12",children:[e.jsxs("div",{className:"flex items-center gap-3 text-amber",children:[e.jsx(Ae,{className:"h-6 w-6"}),e.jsx("span",{className:"text-sm font-semibold uppercase tracking-wider",children:"AI Tools"})]}),e.jsx("h1",{className:"mt-3 font-serif text-4xl md:text-5xl text-cream",children:"AI Tools Suite"}),e.jsx("p",{className:"mt-3 text-lg text-cream/80",children:"40 AI-powered tools for parents and children."}),m==="IN"&&e.jsx("p",{className:"mt-2 text-sm text-amber-light",children:"🇮🇳 Personalised for India · Children's tools use Prof. Ary
1an"}),e.jsxs("div",{className:"mt-6 max-w-md relative",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-navy/40"}),e.jsx(Te,{placeholder:"Search tools...",value:u,onChange:c=>x(c.target.value),className:"pl-10 bg-cream"})]})]})}),e.jsx("div",{className:"bg-cream min-h-screen",children:e.jsx("div",{className:"mx-auto max-w-7xl px-6 py-10",children:e.jsxs(Qe,{defaultValue:"parents",children:[e.jsxs(ge,{className:"bg-navy/5",children:[e.jsxs(K,{value:"parents",children:["For Parents (",R.length,")"]}),e.jsxs(K,{value:"children",children:["For Children (",b.length,")"]})]}),e.jsx(B,{value:"parents",className:"mt-6",children:e.jsx(H,{tools:R,isMember:f,onLaunch:y})}),e.jsx(B,{value:"children",className:"mt-6",children:e.jsx(H,{tools:b,isMember:f,onLaunch:y,childMode:!0})})]})})}),r?e.jsx(Se,{tool:w,open:N,onOpenChange:d,countryCode:m,childAge:v,isMember:f}):e.jsx(Fe,{tool:w,open:N,onOpenChange:d,isAuthenticated:!1,countryCode:m})]}):e.jsx(U,{children:e.jsx("div",{className:"flex min-h-[60vh] items-center justify-center bg-navy",children:e.jsx(_e,{className:"h-6 w-6 animate-spin text-amber"})})})}function H({tools:t,isMember:o,onLaunch:s,childMode:r}){return t.length===0?e.jsx("p",{className:"text-center text-navy-mid py-12",children:"No tools match your search."}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(n=>{const m=n.gate==="members"&&!o;return e.jsxs("div",{className:`rounded-lg border-2 p-5 transition hover:shadow-md ${r?"bg-amber-pale border-amber/30":"bg-white border-navy/10"}`,children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:r?"text-4xl":"text-3xl",children:n.icon}),n.gate==="members"?e.jsxs(q,{variant:"outline",className:"border-amber text-amber bg-amber-pale",children:[e.jsx(Pe,{className:"mr-1 h-3 w-3"})," Members"]}):e.jsx(q,{variant:"outline",className:"border-sage text-sage",children:"Free"})]}),e.jsx("h3",{className:`mt-3 font-bold text-navy ${r?"text-lg":"text-base"}`,children:n.name}),e.jsx("p",{className:"mt-1 text-sm text-navy-mid line-clamp-2",children:n.description}),e.jsx(Ne,{onClick:()=>s(n),className:`mt-4 w-full ${r?"bg-coral hover:bg-coral/90 text-white":"bg-navy hover:bg-navy-mid text-cream"}`,size:"sm",children:m?"Preview":"Launch"})]},n.id)})})}const kt=()=>e.jsx(Re,{children:e.jsx(We,{})});export{kt 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.