1import{bN as N,z as _,ag as S,D as p,y as o,aI as D,R as g,G as e,dx as A,T as B,U as F,a9 as m,aT as I,aU as L}from"./index-DW7v_Ckm.js";import{u as z,a as U,b as O,F as n,c as K}from"./FoafScreen-6SzS40vq.js";import{F as M}from"./utils-Bt2qgV1o.js";import"./useComponentLog-Dg9MuHi3.js";import"./useIdleLogout-BSiYxPXB.js";import"./index-DnOG0iK0.js";import"./index-BAqTfHN5.js";import"./index-C4G5wZl2.js";import"./ProgressBar-CfoyRw-5.js";import"./index-sNpNzxxm.js";import"./index-CTn1QHYO.js";import"./chevron-CmmIZDPq.js";import"./skip-forward-DfF7EBdi.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"[email protected]"};var i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="b14951d9-9a24-409a-9258-9db422365fb8",s._sentryDebugIdIdentifier="sentry-dbid-b14951d9-9a24-409a-9258-9db422365fb8")}catch{}})();const ae=()=>{z("FoafReady");const s=N(),{bucketivityId:i,nodeId:a}=s,c=_(S),{data:t,isLoading:b,isError:R,refetch:j}=U({progressId:c,bucketivityId:i??""}),d=O(),u=p.useRef(null);p.useEffect(()=>{a&&o.dispatch({type:D,payload:{nodeId:a}})},[a]);const x=t&&!t.bucketivityProgress;if(p.useEffect(()=>{x&&!d.isPending&&d.mutate({data:{progressId:c,bucketivityId:i??""}},{onSuccess:()=>void j()})},[x]),p.useEffect(()=>{u.current&&u.current.scrollIntoView()},[u.current]),R)return o.dispatch({type:g,payload:{url:"dash.index"}}),null;if(b||!t?.bucketivityProgress)return e.jsxs(n.Root,{children:[e.jsx(n.Content,{children:e.jsx(A,{})}),e.jsx(n.Navigation,{})]});const w=t.bucketivity?.title??"Types of Food",r=t.bucketivityProgress?.is?.complete??!1,f=(t.bucketivityProgress.totalCorrectCount??0)+(t.bucketivityProgress.totalIncorrectCount??0)>0,h=t.bucketivityProgress.categoryList.flatMap(l=>l.remainingDescriptors).length===0,y=l=>{o.dispatch({type:g,payload:{url:"foaf.categorize",params:{...s,bucketivityProgressId:l}}})},v=()=>{o.dispatch({type:g,payload:{url:"foaf.results",params:{...s,bucketivityProgressId:t.bucketivityProgress._id}}})},k=()=>{h?v():y(t.bucketivityProgress._id)},T=()=>{d.mutate({data:{progressId:c,bucketivityId:i??""}},{onSuccess:l=>{const C=l.data;y(C.bucketivityProgress._id)}})},P=()=>{h?v():y(t.bucketivityProgress._id)},E=()=>{if(!r&&!f){k();return}if(!r&&f){P();return}r&&o.dispatch({type:I})};return e.jsxs(n.Root,{children:[e.jsxs(n.Content,{"data-test":"foaf-ready-container",className:"flex flex-col flex-1 justify-center items-center text-center max-w-[1024px] mx-auto",children:[e.jsx(B,{as:"h1",size:"xxlarge",className:"pb-2",children:"Facts of a Feather"}),e.jsxs(F,{weight:"extrabold",className:"pb-6",children:[e.jsx("b",{children:"Topic:"})," ",w]}),e.jsx(F,{className:"pb-10",children:"Match the categories to the facts that describe them."}),e.jsxs("div",{children:[!r&&!f&&e.jsx(m,{id:"play-btn",className:"w-full",onClick:k,children:"Play Facts of a Feather"}),!r&&f&&e.jsx(m,{id:"resume-btn",className:"w-full",onClick:P,children:"Resume Facts of a Feather"}),r&&e.jsx(m,{id:"play-again-btn",className:"w-[150px]",onClick:T,disabled:d.isPending,children:d.isPending?"Starting...":"Play Again"})]}),e.jsx("div",{className:"mb-10",ref:u})]}),e.jsx(V,{isSkippable:t.bucketivity?.isSkippable??!1,onMoveForward:E})]})};function V({isSkippable:s,onMoveForward:i}){const{isDebug:a,node:c}=K(),t=a?M:"",b=!a&&!s;return e.jsx(n.Navigation,{backButton:{text:"Previous",callback:()=>o.dispatch({type:L}),disabled:!c?.isBacktrackAllowed||!1,"data-test":"icon-arrow-prev",id:"icon-arrow-prev"},forwardButton:{text:t,callback:()=>{if(a){o.dispatch({type:I});return}i()},disabled:b,id:"results-continue-btn",...a?{"data-test":"foaf-skip-game-button"}:{}}})}export{ae as default}; 2//# sourceMappingURL=index-DLpeXlkV.js.map
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.