@cuemath/leap 2.8.37-rj-2 → 2.8.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/lottie/lottie.js +0 -4
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +11 -20
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +47 -53
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +212 -235
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +11 -12
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js +7 -8
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +71 -81
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js +7 -0
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js +213 -0
- package/dist/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js.map +1 -1
- package/dist/features/post-game-stats/points/points.js +10 -15
- package/dist/features/post-game-stats/points/points.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +61 -83
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +148 -142
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/index.d.ts +3 -35
- package/dist/index.js +67 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/carat-left.js +0 -26
- package/dist/assets/line-icons/icons/carat-left.js.map +0 -1
- package/dist/assets/line-icons/icons/carat-right.js +0 -26
- package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +0 -9
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +0 -217
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +0 -6
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +0 -197
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js +0 -17
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc-styled.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js +0 -47
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/animated-arc.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js +0 -6
- package/dist/features/post-game-stats/digital-meter/comp/animated-arc/constants.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/constants.js +0 -16
- package/dist/features/post-game-stats/digital-meter/constants.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +0 -87
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter.js +0 -154
- package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +0 -1
- package/dist/features/post-game-stats/digital-meter/helper.js +0 -33
- package/dist/features/post-game-stats/digital-meter/helper.js.map +0 -1
- package/dist/features/post-game-stats/number-count-animation/number-count-animation-styled.js +0 -29
- package/dist/features/post-game-stats/number-count-animation/number-count-animation-styled.js.map +0 -1
- package/dist/features/post-game-stats/number-count-animation/number-count-animation.js +0 -20
- package/dist/features/post-game-stats/number-count-animation/number-count-animation.js.map +0 -1
- package/dist/static/point2.7cec6e24.json +0 -1
- package/dist/static/point3.f96fe7aa.json +0 -1
- package/dist/static/point4.fe04fb83.json +0 -1
- package/dist/static/target-achieved-text.053bd142.json +0 -2830
- package/dist/static/target-achieved-text.10db8475.json +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../src/features/circle-games/game-launcher/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { TJourneyId } from '../../../journey/journey-id/journey-id-types';\nimport type { ICoachmarkProps } from '../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../ui/types';\nimport type { ICarouselRefs } from '../comps/carousel/carousel-types';\nimport type { ISegmentedGameCardRefs } from '../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport NextIcon from '../../../../assets/line-icons/icons/next';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } from '../../../analytics-events/platform-events-student';\nimport { IndicatorType } from '../../../journey/use-journey/constants';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../ui/context/context';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../games/web-view/enums';\nimport { useCircleSounds } from '../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n onSegmentClick,\n setCarouselIndex,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const carouselNextBtnRef = useRef<ICarouselRefs>(null);\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n\n const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n journeyId: TJourneyId,\n isFirstSlide: boolean = false,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n setCarouselIndex((prev: number) => prev + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [nextCoachmark, playButtonSound, setCarouselIndex, trackEventViewed],\n );\n\n const endJourney = useCallback(\n (puzzlesData: Puzzle, journeyId: TJourneyId) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n nextCoachmark(journeyId);\n onJourneyComplete(journeyId);\n },\n [nextCoachmark, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean, journeyId: TJourneyId) => {\n if (isJourneyInProgress.current) {\n return;\n }\n\n // If element refs are not available return, this is just for type safety\n if (\n !carouselNextBtnRef?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n isJourneyInProgress.current = true;\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width + 50,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselNextBtnRef.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width + 50,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselNextBtnRef.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={NextIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width + 50,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => endJourney(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n nextCoachmark(journeyId);\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', journeyId, true);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current, 'ORANGE_4', journeyId, true);\n }\n },\n [endJourney, goToNextCard, nextCoachmark, setJourney],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n carouselNextBtnRef,\n isJourneyInProgress,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n"],"names":["useGameLauncherJourney","onSegmentClick","setCarouselIndex","onJourneyComplete","carouselNextBtnRef","useRef","gameRefs","puzzleRefs","lessonRefs","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","journeyId","isFirstSlide","prev","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","endJourney","puzzlesData","ProjectType","ActionEvent","startJourney","isLessonAvailable","_a","_b","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","NextIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","g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":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n
|
1
|
+
{"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails:\n | IMultiplayerWebGameProps\n | IPuzzleWebGameProps\n | ILessonWebGameProps\n | ITableWebGameProps;\n parentDomain: string;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAkDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R
|
1
|
+
var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R))(E || {});
|
2
2
|
export {
|
3
3
|
E as JOURNEY_ID_STUDENT
|
4
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n
|
1
|
+
{"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BALhBA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var c = /* @__PURE__ */ ((r) => (r.STREAK = "streak", r.ACCURACY = "accuracy", r.CLOCK = "clock", r.POINT = "point", r
|
1
|
+
var c = /* @__PURE__ */ ((r) => (r.STREAK = "streak", r.ACCURACY = "accuracy", r.CLOCK = "clock", r.POINT = "point", r))(c || {});
|
2
2
|
export {
|
3
3
|
c as EPostGameStat
|
4
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"post-game-stats-enum.js","sources":["../../../../src/features/post-game-stats/enums/post-game-stats-enum.ts"],"sourcesContent":["export enum EPostGameStat {\n STREAK = 'streak',\n ACCURACY = 'accuracy',\n CLOCK = 'clock',\n POINT = 'point',\n
|
1
|
+
{"version":3,"file":"post-game-stats-enum.js","sources":["../../../../src/features/post-game-stats/enums/post-game-stats-enum.ts"],"sourcesContent":["export enum EPostGameStat {\n STREAK = 'streak',\n ACCURACY = 'accuracy',\n CLOCK = 'clock',\n POINT = 'point',\n}\n"],"names":["EPostGameStat"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,16 +1,13 @@
|
|
1
1
|
import { jsx as N } from "react/jsx-runtime";
|
2
2
|
import { memo as P, useEffect as T } from "react";
|
3
3
|
import { LOTTIE as o } from "../../../assets/lottie/lottie.js";
|
4
|
-
import { GAME_LAUNCHER_SIZE as
|
5
|
-
import { GAME_LAUNCHER_ASSET_PADDING as
|
4
|
+
import { GAME_LAUNCHER_SIZE as a } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
5
|
+
import { GAME_LAUNCHER_ASSET_PADDING as O, GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH as c } from "../../circle-games/game-launcher/comps/segmented-game-card/constants.js";
|
6
6
|
import { useCircleSounds as f } from "../../circle-games/hooks/use-circle-sounds/use-circle-sounds.js";
|
7
7
|
import { CircleSoundKey as E } from "../../circle-games/hooks/use-circle-sounds/use-circle-sounds-enums.js";
|
8
8
|
import A from "../../ui/lottie-animation/lottie-animation.js";
|
9
9
|
const _ = {
|
10
10
|
point1: o.POINT1,
|
11
|
-
point2: o.POINT2,
|
12
|
-
point3: o.POINT3,
|
13
|
-
point4: o.POINT4,
|
14
11
|
point5: o.POINT5,
|
15
12
|
point10: o.POINT10,
|
16
13
|
point15: o.POINT15,
|
@@ -23,24 +20,22 @@ const _ = {
|
|
23
20
|
point50: o.POINT50,
|
24
21
|
point60: o.POINT60,
|
25
22
|
point100: o.POINT100
|
26
|
-
},
|
23
|
+
}, r = a + O - c, l = {
|
27
24
|
loop: !1,
|
28
25
|
autoplay: !0,
|
29
26
|
renderer: "canvas"
|
30
|
-
},
|
31
|
-
const { point: m = 0, onReveal: n, onComplete: i, show:
|
27
|
+
}, h = P((p) => {
|
28
|
+
const { point: m = 0, onReveal: n, onComplete: i, show: e } = p, { play: s } = f(), t = _[`point${m}`], I = {
|
32
29
|
name: "complete",
|
33
30
|
callback: i
|
34
31
|
};
|
35
32
|
return T(() => {
|
36
|
-
|
37
|
-
|
38
|
-
r && t && (n == null || n());
|
39
|
-
}, [t, i, n, r]), r && t ? /* @__PURE__ */ N(
|
33
|
+
t || i(), e && t && (n == null || n());
|
34
|
+
}, [t, i, n, e]), e && t ? /* @__PURE__ */ N(
|
40
35
|
A,
|
41
36
|
{
|
42
|
-
width:
|
43
|
-
height:
|
37
|
+
width: r,
|
38
|
+
height: r,
|
44
39
|
src: t,
|
45
40
|
settings: l,
|
46
41
|
eventListener: I,
|
@@ -49,6 +44,6 @@ const _ = {
|
|
49
44
|
) : null;
|
50
45
|
});
|
51
46
|
export {
|
52
|
-
|
47
|
+
h as Points
|
53
48
|
};
|
54
49
|
//# sourceMappingURL=points.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"points.js","sources":["../../../../src/features/post-game-stats/points/points.tsx"],"sourcesContent":["import type { IPointsProps } from './points-types';\nimport type { AnimationEventName } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { memo, useEffect } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport {\n GAME_LAUNCHER_ASSET_PADDING,\n GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH,\n} from '../../circle-games/game-launcher/comps/segmented-game-card/constants';\nimport { useCircleSounds } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds-enums';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\n\nconst POINTS_MAP: Record<string, string> = {\n point1: LOTTIE.POINT1,\n
|
1
|
+
{"version":3,"file":"points.js","sources":["../../../../src/features/post-game-stats/points/points.tsx"],"sourcesContent":["import type { IPointsProps } from './points-types';\nimport type { AnimationEventName } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { memo, useEffect } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport {\n GAME_LAUNCHER_ASSET_PADDING,\n GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH,\n} from '../../circle-games/game-launcher/comps/segmented-game-card/constants';\nimport { useCircleSounds } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../../circle-games/hooks/use-circle-sounds/use-circle-sounds-enums';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\n\nconst POINTS_MAP: Record<string, string> = {\n point1: LOTTIE.POINT1,\n point5: LOTTIE.POINT5,\n point10: LOTTIE.POINT10,\n point15: LOTTIE.POINT15,\n point20: LOTTIE.POINT20,\n point25: LOTTIE.POINT25,\n point30: LOTTIE.POINT30,\n point35: LOTTIE.POINT35,\n point40: LOTTIE.POINT40,\n point45: LOTTIE.POINT45,\n point50: LOTTIE.POINT50,\n point60: LOTTIE.POINT60,\n point100: LOTTIE.POINT100,\n};\nconst animationDimension =\n GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING - GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH;\nconst animationSettings = {\n loop: false,\n autoplay: true,\n renderer: 'canvas',\n};\n\nexport const Points: FC<IPointsProps> = memo(props => {\n const { point = 0, onReveal, onComplete, show } = props;\n\n const { play } = useCircleSounds();\n\n const animationPath = POINTS_MAP[`point${point}`];\n const animationEventListener = {\n name: 'complete' as AnimationEventName,\n callback: onComplete,\n };\n\n useEffect(() => {\n if (!animationPath) onComplete();\n\n if (show && animationPath) onReveal?.();\n }, [animationPath, onComplete, onReveal, show]);\n\n if (show && animationPath) {\n return (\n <LottieAnimation\n width={animationDimension}\n height={animationDimension}\n src={animationPath}\n settings={animationSettings}\n eventListener={animationEventListener}\n onRender={() => play(CircleSoundKey.POINTS_AWARDED)}\n />\n );\n }\n\n return null;\n});\n"],"names":["POINTS_MAP","LOTTIE","animationDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH","animationSettings","Points","memo","props","point","onReveal","onComplete","show","play","useCircleSounds","animationPath","animationEventListener","useEffect","jsx","LottieAnimation","CircleSoundKey"],"mappings":";;;;;;;;AAgBA,MAAMA,IAAqC;AAAA,EACzC,QAAQC,EAAO;AAAA,EACf,QAAQA,EAAO;AAAA,EACf,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,SAASA,EAAO;AAAA,EAChB,UAAUA,EAAO;AACnB,GACMC,IACJC,IAAqBC,IAA8BC,GAC/CC,IAAoB;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,GAEaC,IAA2BC,EAAK,CAASC,MAAA;AACpD,QAAM,EAAE,OAAAC,IAAQ,GAAG,UAAAC,GAAU,YAAAC,GAAY,MAAAC,EAAS,IAAAJ,GAE5C,EAAE,MAAAK,MAASC,KAEXC,IAAgBhB,EAAW,QAAQU,CAAK,EAAE,GAC1CO,IAAyB;AAAA,IAC7B,MAAM;AAAA,IACN,UAAUL;AAAA,EAAA;AASZ,SANAM,EAAU,MAAM;AACV,IAACF,KAA0BJ,KAE3BC,KAAQG,MAA0BL,KAAA,QAAAA;AAAA,KACrC,CAACK,GAAeJ,GAAYD,GAAUE,CAAI,CAAC,GAE1CA,KAAQG,IAER,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOlB;AAAA,MACP,QAAQA;AAAA,MACR,KAAKc;AAAA,MACL,UAAUV;AAAA,MACV,eAAeW;AAAA,MACf,UAAU,MAAMH,EAAKO,EAAe,cAAc;AAAA,IAAA;AAAA,EAAA,IAKjD;AACT,CAAC;"}
|
@@ -1,92 +1,70 @@
|
|
1
|
-
import {
|
2
|
-
import { memo as
|
3
|
-
import { Accuracy as
|
4
|
-
import { Clock as
|
5
|
-
import { DigitalMeter as I } from "./digital-meter/digital-meter.js";
|
1
|
+
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { memo as C, forwardRef as T, useState as d, useCallback as h, useImperativeHandle as y } from "react";
|
3
|
+
import { Accuracy as A } from "./accuracy/accuracy.js";
|
4
|
+
import { Clock as R } from "./clock/clock.js";
|
6
5
|
import { EPostGameStat as p } from "./enums/post-game-stats-enum.js";
|
7
|
-
import { Points as
|
8
|
-
import { StatsWrapper as
|
9
|
-
import { Streak as
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
import { Points as k } from "./points/points.js";
|
7
|
+
import { StatsWrapper as w, BlackBg as I } from "./post-game-stats-styled.js";
|
8
|
+
import { Streak as P } from "./streak/streak.js";
|
9
|
+
const b = C(
|
10
|
+
T(({ stats: e, show: f, onComplete: l }, a) => {
|
11
|
+
var i, u;
|
12
|
+
const [r, x] = d(0), t = h(() => {
|
13
|
+
var o, c;
|
14
|
+
if ((c = (o = e[r]) == null ? void 0 : o.onComplete) == null || c.call(o), r === e.length - 1) {
|
15
|
+
l == null || l();
|
16
16
|
return;
|
17
17
|
}
|
18
|
-
|
19
|
-
}, [
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
r
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
accuracy: e.value,
|
65
|
-
show: !0,
|
66
|
-
onComplete: l,
|
67
|
-
helperText: e.helperText
|
68
|
-
},
|
69
|
-
r
|
70
|
-
) : e.type === p.CLOCK ? /* @__PURE__ */ n(
|
71
|
-
A,
|
72
|
-
{
|
73
|
-
timeInMs: e.value,
|
74
|
-
show: !0,
|
75
|
-
onComplete: l,
|
76
|
-
helperText: e.helperText
|
77
|
-
},
|
78
|
-
r
|
79
|
-
) : null;
|
80
|
-
}
|
81
|
-
return null;
|
82
|
-
}, [e, l, t]);
|
83
|
-
return !s || o.length === 0 || t >= o.length ? null : /* @__PURE__ */ y(R, { children: [
|
84
|
-
/* @__PURE__ */ n(S, {}),
|
85
|
-
x
|
18
|
+
x((v) => v + 1);
|
19
|
+
}, [r, l, e]), m = h(() => {
|
20
|
+
var o;
|
21
|
+
(o = e[r]) != null && o.stopAtEnd || t();
|
22
|
+
}, [e, r, t]);
|
23
|
+
return y(a, () => ({
|
24
|
+
moveToNextAndPlay: t
|
25
|
+
})), !f || e.length === 0 || r >= e.length ? null : /* @__PURE__ */ S(w, { children: [
|
26
|
+
/* @__PURE__ */ n(I, {}),
|
27
|
+
/* @__PURE__ */ n(
|
28
|
+
k,
|
29
|
+
{
|
30
|
+
point: e[r].value,
|
31
|
+
show: e[r].type === p.POINT,
|
32
|
+
onComplete: m,
|
33
|
+
onReveal: (i = e[r]) == null ? void 0 : i.onReveal
|
34
|
+
}
|
35
|
+
),
|
36
|
+
/* @__PURE__ */ n(
|
37
|
+
P,
|
38
|
+
{
|
39
|
+
currStreak: e[r].value,
|
40
|
+
show: e[r].type === p.STREAK,
|
41
|
+
onComplete: m,
|
42
|
+
helperText: e[r].helperText,
|
43
|
+
onReveal: (u = e[r]) == null ? void 0 : u.onReveal
|
44
|
+
}
|
45
|
+
),
|
46
|
+
/* @__PURE__ */ n(
|
47
|
+
A,
|
48
|
+
{
|
49
|
+
accuracy: e[r].value,
|
50
|
+
show: e[r].type === p.ACCURACY,
|
51
|
+
onComplete: m,
|
52
|
+
helperText: e[r].helperText
|
53
|
+
}
|
54
|
+
),
|
55
|
+
/* @__PURE__ */ n(
|
56
|
+
R,
|
57
|
+
{
|
58
|
+
timeInMs: e[r].value,
|
59
|
+
show: e[r].type === p.CLOCK,
|
60
|
+
onComplete: m,
|
61
|
+
helperText: e[r].helperText
|
62
|
+
}
|
63
|
+
)
|
86
64
|
] });
|
87
65
|
})
|
88
66
|
);
|
89
67
|
export {
|
90
|
-
|
68
|
+
b as PostGameStats
|
91
69
|
};
|
92
70
|
//# sourceMappingURL=post-game-stats.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle
|
1
|
+
{"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle } from 'react';\n\nimport { Accuracy } from './accuracy/accuracy';\nimport { Clock } from './clock/clock';\nimport { EPostGameStat } from './enums/post-game-stats-enum';\nimport { Points } from './points/points';\nimport * as Styled from './post-game-stats-styled';\nimport { Streak } from './streak/streak';\n\nexport const PostGameStats = memo(\n forwardRef<IPostGameStatsRef, IPostGameStatsProps>(({ stats, show, onComplete }, ref) => {\n const [currStatIndex, setCurrentStatIndex] = useState(0);\n\n const moveToNextAndPlay = useCallback(() => {\n stats[currStatIndex]?.onComplete?.();\n\n if (currStatIndex === stats.length - 1) {\n onComplete?.();\n\n return;\n }\n setCurrentStatIndex(prev => prev + 1);\n }, [currStatIndex, onComplete, stats]);\n\n const onStatAnimationComplete = useCallback(() => {\n if (stats[currStatIndex]?.stopAtEnd) {\n return;\n }\n moveToNextAndPlay(); // Autoplay since stopAtEnd is false\n }, [stats, currStatIndex, moveToNextAndPlay]);\n\n useImperativeHandle(ref, () => ({\n moveToNextAndPlay,\n }));\n\n if (!show || stats.length === 0 || currStatIndex >= stats.length) {\n return null;\n }\n\n return (\n <Styled.StatsWrapper>\n <Styled.BlackBg />\n <Points\n point={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.POINT}\n onComplete={onStatAnimationComplete}\n onReveal={stats[currStatIndex]?.onReveal}\n />\n <Streak\n currStreak={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.STREAK}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]!.helperText}\n onReveal={stats[currStatIndex]?.onReveal}\n />\n <Accuracy\n accuracy={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.ACCURACY}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]!.helperText}\n />\n <Clock\n timeInMs={stats[currStatIndex]!.value}\n show={stats[currStatIndex]!.type === EPostGameStat.CLOCK}\n onComplete={onStatAnimationComplete}\n helperText={stats[currStatIndex]!.helperText}\n />\n </Styled.StatsWrapper>\n );\n }),\n);\n"],"names":["PostGameStats","memo","forwardRef","stats","show","onComplete","ref","currStatIndex","setCurrentStatIndex","useState","moveToNextAndPlay","useCallback","_b","_a","prev","onStatAnimationComplete","useImperativeHandle","jsxs","Styled.StatsWrapper","jsx","Styled.BlackBg","Points","EPostGameStat","Streak","Accuracy","Clock"],"mappings":";;;;;;;;AAWO,MAAMA,IAAgBC;AAAA,EAC3BC,EAAmD,CAAC,EAAE,OAAAC,GAAO,MAAAC,GAAM,YAAAC,EAAA,GAAcC,MAAQ;;AACvF,UAAM,CAACC,GAAeC,CAAmB,IAAIC,EAAS,CAAC,GAEjDC,IAAoBC,EAAY,MAAM;;AAGtC,WAFEC,KAAAC,IAAAV,EAAAI,CAAa,MAAb,gBAAAM,EAAgB,eAAhB,QAAAD,EAAA,KAAAC,IAEFN,MAAkBJ,EAAM,SAAS,GAAG;AACzB,QAAAE,KAAA,QAAAA;AAEb;AAAA,MACF;AACoB,MAAAG,EAAA,CAAAM,MAAQA,IAAO,CAAC;AAAA,IACnC,GAAA,CAACP,GAAeF,GAAYF,CAAK,CAAC,GAE/BY,IAA0BJ,EAAY,MAAM;;AAC5C,OAAAE,IAAAV,EAAMI,CAAa,MAAnB,QAAAM,EAAsB,aAGRH;IACjB,GAAA,CAACP,GAAOI,GAAeG,CAAiB,CAAC;AAM5C,WAJAM,EAAoBV,GAAK,OAAO;AAAA,MAC9B,mBAAAI;AAAA,IACA,EAAA,GAEE,CAACN,KAAQD,EAAM,WAAW,KAAKI,KAAiBJ,EAAM,SACjD,OAIP,gBAAAc,EAACC,GAAA,EACC,UAAA;AAAA,MAAC,gBAAAC,EAAAC,GAAA,EAAe;AAAA,MAChB,gBAAAD;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,OAAOlB,EAAMI,CAAa,EAAG;AAAA,UAC7B,MAAMJ,EAAMI,CAAa,EAAG,SAASe,EAAc;AAAA,UACnD,YAAYP;AAAA,UACZ,WAAUF,IAAAV,EAAMI,CAAa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