@cuemath/leap 3.3.16 → 3.3.17-akm-2
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/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js +6 -6
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.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 +20 -21
- 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/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js +60 -61
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +71 -73
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +1 -1
- package/dist/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createGetAPI as
|
|
2
|
-
import { BASE_URL as
|
|
3
|
-
const { useGet:
|
|
4
|
-
getURL: (
|
|
1
|
+
import { createGetAPI as i } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL as r } from "./constants.js";
|
|
3
|
+
const { useGet: a, invalidate: c } = i({
|
|
4
|
+
getURL: (o, { user_id: e, grade: t }) => `${r}/circle-home/?intelenrollment_id=${e}&grade=${t}`
|
|
5
5
|
});
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
c as invalidateCircleHomeAPI,
|
|
8
|
+
a as useGetCircleHomeAPI
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=get-circle-home-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-circle-home-api.js","sources":["../../../../../../src/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.ts"],"sourcesContent":["import type {\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel,\n} from './get-circle-home-api-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from './constants';\n\nexport const { useGet: useGetCircleHomeAPI, invalidate: invalidateCircleHomeAPI } = createGetAPI<\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel\n>({\n getURL: (_, { user_id,
|
|
1
|
+
{"version":3,"file":"get-circle-home-api.js","sources":["../../../../../../src/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.ts"],"sourcesContent":["import type {\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel,\n} from './get-circle-home-api-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from './constants';\n\nexport const { useGet: useGetCircleHomeAPI, invalidate: invalidateCircleHomeAPI } = createGetAPI<\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel\n>({\n getURL: (_, { user_id, grade }) =>\n `${BASE_URL}/circle-home/?intelenrollment_id=${user_id}&grade=${grade}`,\n});\n"],"names":["useGetCircleHomeAPI","invalidateCircleHomeAPI","createGetAPI","_","user_id","grade","BASE_URL"],"mappings":";;AASO,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAA4BC,EAGlF;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,SAAAC,GAAS,OAAAC,EACrB,MAAA,GAAGC,CAAQ,oCAAoCF,CAAO,UAAUC,CAAK;AACzE,CAAC;"}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { useGetCircleHomeAPI as
|
|
3
|
-
import { transformCircleHomeData as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
import { useMemo as H, useState as D, useCallback as s, useEffect as p } from "react";
|
|
2
|
+
import { useGetCircleHomeAPI as u, invalidateCircleHomeAPI as y } from "../../api/get-content-for-today/get-circle-home-api.js";
|
|
3
|
+
import { transformCircleHomeData as c } from "./helper.js";
|
|
4
|
+
const A = (e, a) => {
|
|
5
|
+
const t = H(
|
|
6
6
|
() => ({
|
|
7
7
|
user_id: e,
|
|
8
|
-
grade: a
|
|
9
|
-
country_code: l
|
|
8
|
+
grade: a
|
|
10
9
|
}),
|
|
11
|
-
[e, a
|
|
10
|
+
[e, a]
|
|
12
11
|
), {
|
|
13
12
|
data: o = null,
|
|
14
|
-
get:
|
|
13
|
+
get: l,
|
|
15
14
|
isProcessed: i,
|
|
16
|
-
...
|
|
17
|
-
} =
|
|
18
|
-
|
|
15
|
+
...n
|
|
16
|
+
} = u(e, t), [r, m] = D(
|
|
17
|
+
c(o)
|
|
19
18
|
), C = s(() => {
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
|
|
19
|
+
l(e, t);
|
|
20
|
+
}, [l, t, e]), f = s(() => {
|
|
21
|
+
y(e, t);
|
|
23
22
|
}, [t, e]);
|
|
24
|
-
return
|
|
25
|
-
i && o &&
|
|
23
|
+
return p(() => {
|
|
24
|
+
i && o && m(c(o));
|
|
26
25
|
}, [o, i]), {
|
|
27
|
-
data:
|
|
26
|
+
data: r,
|
|
28
27
|
isProcessed: i,
|
|
29
28
|
getCircleHomeDetails: C,
|
|
30
|
-
invalidateCircleHomeDetails:
|
|
31
|
-
...
|
|
29
|
+
invalidateCircleHomeDetails: f,
|
|
30
|
+
...n
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
A as useGetCircleHomeDetailsDal
|
|
36
35
|
};
|
|
37
36
|
//# sourceMappingURL=use-get-circle-home-details-dal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport {\n invalidateCircleHomeAPI,\n useGetCircleHomeAPI,\n} from '../../api/get-content-for-today/get-circle-home-api';\nimport { transformCircleHomeData } from './helper';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n
|
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport {\n invalidateCircleHomeAPI,\n useGetCircleHomeAPI,\n} from '../../api/get-content-for-today/get-circle-home-api';\nimport { transformCircleHomeData } from './helper';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n invalidateCircleHomeDetails: () => void;\n} => {\n const initialQuery = useMemo(\n () => ({\n user_id: userId,\n grade,\n }),\n [userId, grade],\n );\n\n const {\n data = null,\n get: getHomeDetails,\n isProcessed,\n ...rest\n } = useGetCircleHomeAPI(userId, initialQuery);\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(\n transformCircleHomeData(data),\n );\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails(userId, initialQuery);\n }, [getHomeDetails, initialQuery, userId]);\n\n const invalidateCircleHomeDetails = useCallback(() => {\n invalidateCircleHomeAPI(userId, initialQuery);\n }, [initialQuery, userId]);\n\n useEffect(() => {\n if (isProcessed && data) {\n setContentForToday(transformCircleHomeData(data));\n }\n }, [data, isProcessed]);\n\n return {\n data: contentForToday,\n isProcessed,\n getCircleHomeDetails,\n invalidateCircleHomeDetails,\n ...rest,\n };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","grade","initialQuery","useMemo","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","contentForToday","setContentForToday","useState","transformCircleHomeData","getCircleHomeDetails","useCallback","invalidateCircleHomeDetails","invalidateCircleHomeAPI","useEffect"],"mappings":";;;AAUa,MAAAA,IAA6B,CACxCC,GACAC,MAKG;AACH,QAAMC,IAAeC;AAAA,IACnB,OAAO;AAAA,MACL,SAASH;AAAA,MACT,OAAAC;AAAA,IAAA;AAAA,IAEF,CAACD,GAAQC,CAAK;AAAA,EAAA,GAGV;AAAA,IACJ,MAAAG,IAAO;AAAA,IACP,KAAKC;AAAA,IACL,aAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDC,EAAoBR,GAAQE,CAAY,GACtC,CAACO,GAAiBC,CAAkB,IAAIC;AAAA,IAC5CC,EAAwBR,CAAI;AAAA,EAAA,GAGxBS,IAAuBC,EAAY,MAAM;AAC7C,IAAAT,EAAeL,GAAQE,CAAY;AAAA,EAClC,GAAA,CAACG,GAAgBH,GAAcF,CAAM,CAAC,GAEnCe,IAA8BD,EAAY,MAAM;AACpD,IAAAE,EAAwBhB,GAAQE,CAAY;AAAA,EAAA,GAC3C,CAACA,GAAcF,CAAM,CAAC;AAEzB,SAAAiB,EAAU,MAAM;AACd,IAAIX,KAAeF,KACEM,EAAAE,EAAwBR,CAAI,CAAC;AAAA,EAClD,GACC,CAACA,GAAME,CAAW,CAAC,GAEf;AAAA,IACL,MAAMG;AAAA,IACN,aAAAH;AAAA,IACA,sBAAAO;AAAA,IACA,6BAAAE;AAAA,IACA,GAAGR;AAAA,EAAA;AAEP;"}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 isAdmin?: boolean;\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 starEligibleTime?: number;\n starEligibleAccuracy?: number;\n starRewarded?: boolean;\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 | ITrackEvent | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import { jsxs as s, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { getTimeStrInFormatHMS as
|
|
4
|
-
import { useWebViewGames as
|
|
5
|
-
import { WebView as
|
|
1
|
+
import { jsxs as s, Fragment as K, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Q, useRef as X, useState as ee, useMemo as h, useCallback as m, useEffect as re } from "react";
|
|
3
|
+
import { getTimeStrInFormatHMS as te } from "../../../../helpers/date-time.js";
|
|
4
|
+
import { useWebViewGames as ae } from "../../../circle-games/games/web-view/hooks/use-webview-games.js";
|
|
5
|
+
import { WebView as ie } from "../../../circle-games/games/web-view/web-view.js";
|
|
6
6
|
import v from "../../../ui/layout/flex-view.js";
|
|
7
7
|
import E from "../../../ui/separator/separator.js";
|
|
8
8
|
import d from "../../../ui/text/text.js";
|
|
9
|
-
import { useTrialSessionContext as
|
|
10
|
-
import { TrialPageId as
|
|
11
|
-
import { TrialCircleGameLaunchScreen as
|
|
12
|
-
import { GameContainer as le, GameWrapper as
|
|
9
|
+
import { useTrialSessionContext as oe } from "../../context/use-trial-session-context.js";
|
|
10
|
+
import { TrialPageId as y } from "../../trial-session-constants.js";
|
|
11
|
+
import { TrialCircleGameLaunchScreen as ne } from "./trial-circle-game-launch-screen/trial-circle-game-launch-screen.js";
|
|
12
|
+
import { GameContainer as le, GameWrapper as ce, GameLaunchOverlay as se } from "./trial-circle-game-styled.js";
|
|
13
13
|
import { ProjectType as e } from "../../../circle-games/games/web-view/enums/project-type-enum.js";
|
|
14
14
|
import S from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
15
|
-
const
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
},
|
|
20
|
-
const { slideConfig: b, trialGameUrl: j, circleGames: A, formData: k, handleInfoMessage: $, updateSlideConfig: o } =
|
|
21
|
-
showCircleGameScreen:
|
|
15
|
+
const me = {
|
|
16
|
+
[y.CIRCLE_GAME]: e.GAME,
|
|
17
|
+
[y.CIRCLE_PUZZLE]: e.PUZZLE,
|
|
18
|
+
[y.CIRCLE_SKILL]: e.LESSON
|
|
19
|
+
}, Pe = Q(() => {
|
|
20
|
+
const { slideConfig: b, trialGameUrl: j, circleGames: A, formData: k, handleInfoMessage: $, updateSlideConfig: o } = oe(), {
|
|
21
|
+
showCircleGameScreen: g = !0,
|
|
22
22
|
isCircleGamePlayed: u = !1,
|
|
23
|
-
isCirclePuzzleSolved:
|
|
23
|
+
isCirclePuzzleSolved: c = !1,
|
|
24
24
|
isCircleSkillCompleted: p = !1,
|
|
25
|
-
accuracyStr:
|
|
25
|
+
accuracyStr: C = "",
|
|
26
26
|
totalTimeTaken: G = 0,
|
|
27
27
|
matchmakingId: f
|
|
28
|
-
} = k || {}, I =
|
|
28
|
+
} = k || {}, I = X(null), { playGame: P } = ae({ webViewRef: I }), [T, L] = ee(!0), { header: U, id: M } = b, r = me[M], { circleConfig: O, playerDetails: W } = A, { games: l, puzzles: n, lessons: a } = O ?? {}, _ = h(() => ({
|
|
29
29
|
[e.GAME]: u,
|
|
30
|
-
[e.PUZZLE]:
|
|
30
|
+
[e.PUZZLE]: c,
|
|
31
31
|
[e.LESSON]: p
|
|
32
|
-
}), [u,
|
|
32
|
+
}), [u, c, p]), w = h(() => {
|
|
33
33
|
const i = {
|
|
34
|
-
[e.GAME]: u ?
|
|
35
|
-
[e.PUZZLE]:
|
|
34
|
+
[e.GAME]: u ? l.game_card : l.tutorial,
|
|
35
|
+
[e.PUZZLE]: c ? n.game_card : n.tutorial,
|
|
36
36
|
[e.LESSON]: p ? a.game_card : a.tutorial
|
|
37
37
|
};
|
|
38
38
|
return r ? i[r] : "";
|
|
39
39
|
}, [
|
|
40
40
|
r,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
l.game_card,
|
|
42
|
+
l.tutorial,
|
|
43
43
|
n.game_card,
|
|
44
44
|
n.tutorial,
|
|
45
45
|
a.game_card,
|
|
46
46
|
a.tutorial,
|
|
47
47
|
u,
|
|
48
|
-
|
|
48
|
+
c,
|
|
49
49
|
p
|
|
50
|
-
]), x = h(() => r === e.PUZZLE &&
|
|
51
|
-
id:
|
|
50
|
+
]), x = h(() => r === e.PUZZLE && c ? "You've solved it!" : "", [r, c]), { circle_username: D, userId: H, grade: N, user_avatar: R, playerType: Z } = W ?? {}, z = {
|
|
51
|
+
id: H,
|
|
52
52
|
username: D,
|
|
53
|
-
grade:
|
|
53
|
+
grade: N,
|
|
54
54
|
avatar: R,
|
|
55
|
-
playerType: Z
|
|
56
|
-
|
|
57
|
-
}, B = h(() => {
|
|
55
|
+
playerType: Z
|
|
56
|
+
}, F = h(() => {
|
|
58
57
|
const i = {
|
|
59
58
|
joinByRoomId: f,
|
|
60
59
|
enableCloseButton: !1,
|
|
@@ -63,8 +62,8 @@ const de = {
|
|
|
63
62
|
};
|
|
64
63
|
return r === e.GAME ? {
|
|
65
64
|
...i,
|
|
66
|
-
projectId:
|
|
67
|
-
variant:
|
|
65
|
+
projectId: l.project_id,
|
|
66
|
+
variant: l.variant,
|
|
68
67
|
projectType: e.GAME
|
|
69
68
|
} : r === e.PUZZLE ? {
|
|
70
69
|
...i,
|
|
@@ -82,15 +81,15 @@ const de = {
|
|
|
82
81
|
targetQuestions: a.target_questions,
|
|
83
82
|
projectType: e.LESSON
|
|
84
83
|
};
|
|
85
|
-
}, [
|
|
86
|
-
|
|
87
|
-
}, []),
|
|
88
|
-
|
|
89
|
-
}, [r, o]),
|
|
84
|
+
}, [l, n, a, r, f]), B = m(() => {
|
|
85
|
+
L(!1);
|
|
86
|
+
}, []), V = m(() => {
|
|
87
|
+
L(!0), (r === e.GAME || r === e.PUZZLE || r === e.LESSON) && o({ showCircleGameScreen: !0, matchmakingId: S() });
|
|
88
|
+
}, [r, o]), q = m(() => {
|
|
90
89
|
o({ showCircleGameScreen: !1, accuracyStr: "", totalTimeTaken: 0 });
|
|
91
|
-
}, [o]),
|
|
90
|
+
}, [o]), Y = m(
|
|
92
91
|
(i) => {
|
|
93
|
-
|
|
92
|
+
L(!0), r === e.LESSON ? o({
|
|
94
93
|
accuracyStr: i.value,
|
|
95
94
|
totalTimeTaken: i.timeSpent,
|
|
96
95
|
isCircleSkillCompleted: !0,
|
|
@@ -107,52 +106,52 @@ const de = {
|
|
|
107
106
|
});
|
|
108
107
|
},
|
|
109
108
|
[o, r]
|
|
110
|
-
),
|
|
109
|
+
), J = m(() => C && G ? /* @__PURE__ */ s(K, { children: [
|
|
111
110
|
/* @__PURE__ */ s(v, { $flexDirection: "row", children: [
|
|
112
111
|
/* @__PURE__ */ t(d, { $renderAs: "ab2", $color: "WHITE", children: "Finished in" }),
|
|
113
112
|
/* @__PURE__ */ t(E, { width: 5 }),
|
|
114
|
-
/* @__PURE__ */ t(d, { $renderAs: "ab2-bold", $color: "WHITE", children:
|
|
113
|
+
/* @__PURE__ */ t(d, { $renderAs: "ab2-bold", $color: "WHITE", children: te(G) })
|
|
115
114
|
] }),
|
|
116
115
|
/* @__PURE__ */ t(E, { height: 20 }),
|
|
117
116
|
/* @__PURE__ */ s(v, { $flexDirection: "row", children: [
|
|
118
117
|
/* @__PURE__ */ t(d, { $renderAs: "ab2", $color: "WHITE", children: "Accuracy:" }),
|
|
119
118
|
/* @__PURE__ */ t(E, { width: 5 }),
|
|
120
|
-
/* @__PURE__ */ t(d, { $renderAs: "ab2-bold", $color: "WHITE", children:
|
|
119
|
+
/* @__PURE__ */ t(d, { $renderAs: "ab2-bold", $color: "WHITE", children: C })
|
|
121
120
|
] })
|
|
122
|
-
] }) : null, [
|
|
123
|
-
return
|
|
124
|
-
!
|
|
125
|
-
}, [
|
|
121
|
+
] }) : null, [C, G]);
|
|
122
|
+
return re(() => {
|
|
123
|
+
!T && !g && P();
|
|
124
|
+
}, [g, P, T]), /* @__PURE__ */ s(le, { children: [
|
|
126
125
|
/* @__PURE__ */ t(E, { height: 16 }),
|
|
127
126
|
/* @__PURE__ */ t(d, { $renderAs: "ah3-bold", $color: "WHITE_T_87", $align: "center", $marginBottom: 16, children: U }),
|
|
128
|
-
/* @__PURE__ */ s(
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
128
|
+
g && /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(
|
|
129
|
+
ne,
|
|
131
130
|
{
|
|
132
131
|
assetUrl: w,
|
|
133
132
|
assetUrlType: w.endsWith("mp4") ? "video" : "lottie",
|
|
134
133
|
descriptionHeader: x,
|
|
135
134
|
playerType: Z,
|
|
136
|
-
isLoading:
|
|
135
|
+
isLoading: T,
|
|
137
136
|
isGamePlayed: (r && _[r]) ?? !1,
|
|
138
|
-
onPlay:
|
|
139
|
-
custEle: r === e.LESSON ?
|
|
137
|
+
onPlay: q,
|
|
138
|
+
custEle: r === e.LESSON ? J() : void 0,
|
|
140
139
|
celebrationText: r && _[r] ? "WELL DONE!" : ""
|
|
141
140
|
}
|
|
142
141
|
) }),
|
|
143
142
|
f && /* @__PURE__ */ t(
|
|
144
|
-
|
|
143
|
+
ie,
|
|
145
144
|
{
|
|
146
145
|
ref: I,
|
|
147
146
|
height: "100%",
|
|
148
147
|
width: "100%",
|
|
149
148
|
baseUrl: j,
|
|
150
|
-
playerDetails:
|
|
151
|
-
projectDetails:
|
|
152
|
-
onGameLoad:
|
|
153
|
-
onBack:
|
|
149
|
+
playerDetails: z,
|
|
150
|
+
projectDetails: F,
|
|
151
|
+
onGameLoad: B,
|
|
152
|
+
onBack: V,
|
|
154
153
|
handleInfoMessage: $,
|
|
155
|
-
onGamePlayFinish:
|
|
154
|
+
onGamePlayFinish: Y,
|
|
156
155
|
parentDomain: window.location.origin
|
|
157
156
|
},
|
|
158
157
|
f
|
|
@@ -161,6 +160,6 @@ const de = {
|
|
|
161
160
|
] });
|
|
162
161
|
});
|
|
163
162
|
export {
|
|
164
|
-
|
|
163
|
+
Pe as default
|
|
165
164
|
};
|
|
166
165
|
//# sourceMappingURL=trial-circle-game.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trial-circle-game.js","sources":["../../../../../src/features/trial-session/comps/trial-circle-game/trial-circle-game.tsx"],"sourcesContent":["import type {\n ILessonWebGameProps,\n IMultiplayerWebGameProps,\n IPlayer,\n IPlayerStats,\n IPuzzleWebGameProps,\n} from '../../../circle-games/games/web-view/web-view-types';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { getTimeStrInFormatHMS } from '../../../../helpers/date-time';\nimport { ProjectType } from '../../../circle-games/games/web-view/enums';\nimport { useWebViewGames } from '../../../circle-games/games/web-view/hooks/use-webview-games';\nimport { WebView } from '../../../circle-games/games/web-view/web-view';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport { TrialCircleGameLaunchScreen } from './trial-circle-game-launch-screen/trial-circle-game-launch-screen';\nimport * as Styled from './trial-circle-game-styled';\n\nconst PROJECT_TYPE_MAP: Partial<Record<TrialPageId, Omit<ProjectType, ProjectType.TABLE>>> = {\n [TrialPageId.CIRCLE_GAME]: ProjectType.GAME,\n [TrialPageId.CIRCLE_PUZZLE]: ProjectType.PUZZLE,\n [TrialPageId.CIRCLE_SKILL]: ProjectType.LESSON,\n};\n\nconst TrialCircleGame = memo(() => {\n const { slideConfig, trialGameUrl, circleGames, formData, handleInfoMessage, updateSlideConfig } =\n useTrialSessionContext();\n const {\n showCircleGameScreen = true,\n isCircleGamePlayed = false,\n isCirclePuzzleSolved = false,\n isCircleSkillCompleted = false,\n accuracyStr = '',\n totalTimeTaken = 0,\n matchmakingId,\n } = formData || {};\n const webViewRef = useRef<HTMLIFrameElement>(null) as React.RefObject<HTMLIFrameElement>;\n const { playGame } = useWebViewGames({ webViewRef });\n const [isLoading, setIsLoading] = useState(true);\n\n const { header, id } = slideConfig;\n const projectType = PROJECT_TYPE_MAP[id];\n const { circleConfig, playerDetails } = circleGames;\n const { games, puzzles, lessons } = circleConfig ?? {};\n\n const isPlayed = useMemo(() => {\n const playedStats = {\n [ProjectType.GAME]: isCircleGamePlayed,\n [ProjectType.PUZZLE]: isCirclePuzzleSolved,\n [ProjectType.LESSON]: isCircleSkillCompleted,\n };\n\n return playedStats;\n }, [isCircleGamePlayed, isCirclePuzzleSolved, isCircleSkillCompleted]);\n\n const assetUrl = useMemo(() => {\n const url: Omit<Record<ProjectType, string>, ProjectType.TABLE> = {\n [ProjectType.GAME]: isCircleGamePlayed ? games.game_card : games.tutorial,\n [ProjectType.PUZZLE]: isCirclePuzzleSolved ? puzzles.game_card : puzzles.tutorial,\n [ProjectType.LESSON]: isCircleSkillCompleted ? lessons.game_card : lessons.tutorial,\n };\n\n return projectType\n ? url[projectType as keyof Omit<Record<ProjectType, string>, ProjectType.TABLE>]\n : '';\n }, [\n projectType,\n games.game_card,\n games.tutorial,\n puzzles.game_card,\n puzzles.tutorial,\n lessons.game_card,\n lessons.tutorial,\n isCircleGamePlayed,\n isCirclePuzzleSolved,\n isCircleSkillCompleted,\n ]);\n\n const descriptionHeader = useMemo(() => {\n if (projectType === ProjectType.PUZZLE && isCirclePuzzleSolved) {\n return \"You've solved it!\";\n }\n\n return '';\n }, [projectType, isCirclePuzzleSolved]);\n\n const { circle_username, userId, grade, user_avatar, playerType, countryCode } =\n playerDetails ?? {};\n\n const playerData: IPlayer = {\n id: userId,\n username: circle_username,\n grade: grade,\n avatar: user_avatar,\n playerType,\n countryCode: countryCode || 'IN',\n };\n\n const projectDetails = useMemo(() => {\n const commonConfig = {\n joinByRoomId: matchmakingId,\n enableCloseButton: false,\n enablePlayerTurnIndicators: true,\n enableSync: true,\n };\n\n if (projectType === ProjectType.GAME) {\n return {\n ...commonConfig,\n projectId: games.project_id,\n variant: games.variant,\n projectType: ProjectType.GAME,\n } as IMultiplayerWebGameProps;\n }\n\n if (projectType === ProjectType.PUZZLE) {\n return {\n ...commonConfig,\n projectId: puzzles.project_id,\n variant: puzzles.variant,\n question: puzzles.question,\n askHintPermission: false,\n projectType: ProjectType.PUZZLE,\n } as IPuzzleWebGameProps;\n }\n\n return {\n ...commonConfig,\n projectId: lessons.project_id,\n variant: lessons.variant,\n miniGameIdentifier: lessons.mini_game_identifier,\n sessionId: lessons.session_id,\n targetQuestions: lessons.target_questions,\n projectType: ProjectType.LESSON,\n } as ILessonWebGameProps;\n\n // return commonConfig;\n }, [games, puzzles, lessons, projectType, matchmakingId]);\n\n const onGameLoad = useCallback(() => {\n setIsLoading(false);\n }, []);\n\n const handleBack = useCallback(() => {\n setIsLoading(true);\n if (\n projectType === ProjectType.GAME ||\n projectType === ProjectType.PUZZLE ||\n projectType === ProjectType.LESSON\n ) {\n updateSlideConfig({ showCircleGameScreen: true, matchmakingId: uuidv4() });\n }\n }, [projectType, updateSlideConfig]);\n\n const onPlay = useCallback(() => {\n updateSlideConfig({ showCircleGameScreen: false, accuracyStr: '', totalTimeTaken: 0 });\n }, [updateSlideConfig]);\n\n const handleGameFinish = useCallback(\n (playerStats: IPlayerStats) => {\n setIsLoading(true);\n if (projectType === ProjectType.LESSON) {\n updateSlideConfig({\n accuracyStr: playerStats.value,\n totalTimeTaken: playerStats.timeSpent,\n isCircleSkillCompleted: true,\n showCircleGameScreen: true,\n matchmakingId: uuidv4(),\n });\n } else if (projectType === ProjectType.GAME) {\n updateSlideConfig({\n isCircleGamePlayed: true,\n showCircleGameScreen: true,\n matchmakingId: uuidv4(),\n });\n } else if (projectType === ProjectType.PUZZLE) {\n updateSlideConfig({\n isCirclePuzzleSolved: true,\n showCircleGameScreen: true,\n matchmakingId: uuidv4(),\n });\n }\n },\n [updateSlideConfig, projectType],\n );\n\n const getCustEle = useCallback(() => {\n if (accuracyStr && totalTimeTaken) {\n return (\n <>\n <FlexView $flexDirection=\"row\">\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n Finished in\n </Text>\n <Separator width={5} />\n <Text $renderAs=\"ab2-bold\" $color=\"WHITE\">\n {getTimeStrInFormatHMS(totalTimeTaken)}\n </Text>\n </FlexView>\n <Separator height={20} />\n <FlexView $flexDirection=\"row\">\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n Accuracy:\n </Text>\n <Separator width={5} />\n <Text $renderAs=\"ab2-bold\" $color=\"WHITE\">\n {accuracyStr}\n </Text>\n </FlexView>\n </>\n );\n }\n\n return null;\n }, [accuracyStr, totalTimeTaken]);\n\n useEffect(() => {\n if (!isLoading && !showCircleGameScreen) {\n playGame();\n }\n }, [showCircleGameScreen, playGame, isLoading]);\n\n return (\n <Styled.GameContainer>\n <Separator height={16} />\n <Text $renderAs=\"ah3-bold\" $color=\"WHITE_T_87\" $align=\"center\" $marginBottom={16}>\n {header}\n </Text>\n <Styled.GameWrapper>\n {showCircleGameScreen && (\n <Styled.GameLaunchOverlay>\n <TrialCircleGameLaunchScreen\n assetUrl={assetUrl}\n assetUrlType={assetUrl.endsWith('mp4') ? 'video' : 'lottie'}\n descriptionHeader={descriptionHeader}\n playerType={playerType}\n isLoading={isLoading}\n isGamePlayed={\n (projectType &&\n isPlayed[\n projectType as keyof Omit<Record<ProjectType, string>, ProjectType.TABLE>\n ]) ??\n false\n }\n onPlay={onPlay}\n custEle={projectType === ProjectType.LESSON ? getCustEle() : undefined}\n celebrationText={\n projectType &&\n isPlayed[projectType as keyof Omit<Record<ProjectType, string>, ProjectType.TABLE>]\n ? 'WELL DONE!'\n : ''\n }\n />\n </Styled.GameLaunchOverlay>\n )}\n {matchmakingId && (\n <WebView\n key={matchmakingId}\n ref={webViewRef}\n height=\"100%\"\n width=\"100%\"\n baseUrl={trialGameUrl}\n playerDetails={playerData}\n projectDetails={projectDetails}\n onGameLoad={onGameLoad}\n onBack={handleBack}\n handleInfoMessage={handleInfoMessage}\n onGamePlayFinish={handleGameFinish}\n parentDomain={window.location.origin}\n />\n )}\n </Styled.GameWrapper>\n </Styled.GameContainer>\n );\n});\n\nexport default TrialCircleGame;\n"],"names":["PROJECT_TYPE_MAP","TrialPageId","ProjectType","TrialCircleGame","memo","slideConfig","trialGameUrl","circleGames","formData","handleInfoMessage","updateSlideConfig","useTrialSessionContext","showCircleGameScreen","isCircleGamePlayed","isCirclePuzzleSolved","isCircleSkillCompleted","accuracyStr","totalTimeTaken","matchmakingId","webViewRef","useRef","playGame","useWebViewGames","isLoading","setIsLoading","useState","header","id","projectType","circleConfig","playerDetails","games","puzzles","lessons","isPlayed","useMemo","assetUrl","url","descriptionHeader","circle_username","userId","grade","user_avatar","playerType","countryCode","playerData","projectDetails","commonConfig","onGameLoad","useCallback","handleBack","uuidv4","onPlay","handleGameFinish","playerStats","getCustEle","jsxs","Fragment","FlexView","jsx","Text","Separator","getTimeStrInFormatHMS","useEffect","Styled.GameContainer","Styled.GameWrapper","Styled.GameLaunchOverlay","TrialCircleGameLaunchScreen","WebView"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,KAAuF;AAAA,EAC3F,CAACC,EAAY,WAAW,GAAGC,EAAY;AAAA,EACvC,CAACD,EAAY,aAAa,GAAGC,EAAY;AAAA,EACzC,CAACD,EAAY,YAAY,GAAGC,EAAY;AAC1C,GAEMC,KAAkBC,EAAK,MAAM;AAC3B,QAAA,EAAE,aAAAC,GAAa,cAAAC,GAAc,aAAAC,GAAa,UAAAC,GAAU,mBAAAC,GAAmB,mBAAAC,MAC3EC,MACI;AAAA,IACJ,sBAAAC,IAAuB;AAAA,IACvB,oBAAAC,IAAqB;AAAA,IACrB,sBAAAC,IAAuB;AAAA,IACvB,wBAAAC,IAAyB;AAAA,IACzB,aAAAC,IAAc;AAAA,IACd,gBAAAC,IAAiB;AAAA,IACjB,eAAAC;AAAA,EAAA,IACEV,KAAY,CAAA,GACVW,IAAaC,G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QAXzBnC;AAAA,MAYP;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"trial-circle-game.js","sources":["../../../../../src/features/trial-session/comps/trial-circle-game/trial-circle-game.tsx"],"sourcesContent":["import type {\n ILessonWebGameProps,\n IMultiplayerWebGameProps,\n IPlayer,\n IPlayerStats,\n IPuzzleWebGameProps,\n} from '../../../circle-games/games/web-view/web-view-types';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { getTimeStrInFormatHMS } from '../../../../helpers/date-time';\nimport { ProjectType } from '../../../circle-games/games/web-view/enums';\nimport { useWebViewGames } from '../../../circle-games/games/web-view/hooks/use-webview-games';\nimport { WebView } from '../../../circle-games/games/web-view/web-view';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport { TrialCircleGameLaunchScreen } from './trial-circle-game-launch-screen/trial-circle-game-launch-screen';\nimport * as Styled from './trial-circle-game-styled';\n\nconst PROJECT_TYPE_MAP: Partial<Record<TrialPageId, Omit<ProjectType, ProjectType.TABLE>>> = {\n [TrialPageId.CIRCLE_GAME]: ProjectType.GAME,\n [TrialPageId.CIRCLE_PUZZLE]: ProjectType.PUZZLE,\n [TrialPageId.CIRCLE_SKILL]: ProjectType.LESSON,\n};\n\nconst TrialCircleGame = memo(() => {\n const { slideConfig, trialGameUrl, circleGames, formData, handleInfoMessage, updateSlideConfig } =\n useTrialSessionContext();\n const {\n showCircleGameScreen = true,\n isCircleGamePlayed = false,\n isCirclePuzzleSolved = false,\n isCircleSkillCompleted = false,\n accuracyStr = '',\n totalTimeTaken = 0,\n matchmakingId,\n } = formData || {};\n const webViewRef = useRef<HTMLIFrameElement>(null) as React.RefObject<HTMLIFrameElement>;\n const { playGame } = useWebViewGames({ webViewRef });\n const [isLoading, setIsLoading] = useState(true);\n\n const { header, id } = slideConfig;\n const projectType = PROJECT_TYPE_MAP[id];\n const { circleConfig, playerDetails } = circleGames;\n const { games, puzzles, lessons } = circleConfig ?? {};\n\n const isPlayed = useMemo(() => {\n const playedStats = {\n [ProjectType.GAME]: isCircleGamePlayed,\n [ProjectType.PUZZLE]: isCirclePuzzleSolved,\n [ProjectType.LESSON]: isCircleSkillCompleted,\n };\n\n return playedStats;\n }, [isCircleGamePlayed, isCirclePuzzleSolved, isCircleSkillCompleted]);\n\n const assetUrl = useMemo(() => {\n const url: Omit<Record<ProjectType, string>, ProjectType.TABLE> = {\n [ProjectType.GAME]: isCircleGamePlayed ? games.game_card : games.tutorial,\n [ProjectType.PUZZLE]: isCirclePuzzleSolved ? puzzles.game_card : puzzles.tutorial,\n [ProjectType.LESSON]: isCircleSkillCompleted ? lessons.game_card : lessons.tutorial,\n };\n\n return projectType\n ? url[projectType as keyof Omit<Record<ProjectType, string>, ProjectType.TABLE>]\n : '';\n }, [\n projectType,\n games.game_card,\n games.tutorial,\n puzzles.game_card,\n puzzles.tutorial,\n lessons.game_card,\n lessons.tutorial,\n isCircleGamePlayed,\n isCirclePuzzleSolved,\n isCircleSkillCompleted,\n ]);\n\n const descriptionHeader = useMemo(() => {\n if (projectType === ProjectType.PUZZLE && isCirclePuzzleSolved) {\n return \"You've solved it!\";\n }\n\n return '';\n }, [projectType, isCirclePuzzleSolved]);\n\n const { circle_username, userId, grade, user_avatar, playerType } = playerDetails ?? {};\n\n const playerData: IPlayer = {\n id: userId,\n username: circle_username,\n grade: grade,\n avatar: user_avatar,\n playerType,\n };\n\n const projectDetails = useMemo(() => {\n const commonConfig = {\n joinByRoomId: matchmakingId,\n enableCloseButton: false,\n enablePlayerTurnIndicators: true,\n enableSync: true,\n };\n\n if (projectType === ProjectType.GAME) {\n return {\n ...commonConfig,\n projectId: games.project_id,\n variant: games.variant,\n projectType: ProjectType.GAME,\n } as IMultiplayerWebGameProps;\n }\n\n if (projectType === ProjectType.PUZZLE) {\n return {\n ...commonConfig,\n projectId: puzzles.project_id,\n variant: puzzles.variant,\n question: puzzles.question,\n askHintPermission: false,\n projectType: ProjectType.PUZZLE,\n } as IPuzzleWebGameProps;\n }\n\n return {\n ...commonConfig,\n projectId: lessons.project_id,\n variant: lessons.variant,\n miniGameIdentifier: lessons.mini_game_identifier,\n sessionId: lessons.session_id,\n targetQuestions: lessons.target_questions,\n projectType: ProjectType.LESSON,\n } as ILessonWebGameProps;\n\n // return commonConfig;\n }, [games, puzzles, lessons, projectType, matchmakingId]);\n\n const onGameLoad = useCallback(() => {\n setIsLoading(false);\n }, []);\n\n const handleBack = useCallback(() => {\n setIsLoading(true);\n if (\n projectType === ProjectType.GAME ||\n projectType === ProjectType.PUZZLE ||\n projectType === ProjectType.LESSON\n ) {\n updateSlideConfig({ showCircleGameScreen: true, matchmakingId: uuidv4() });\n }\n }, [projectType, updateSlideConfig]);\n\n const onPlay = useCallback(() => {\n updateSlideConfig({ showCircleGameScreen: false, accuracyStr: '', totalTimeTaken: 0 });\n }, [updateSlideConfig]);\n\n const handleGameFinish = useCallback(\n (playerStats: IPlayerStats) => {\n setIsLoading(true);\n if (projectType === ProjectType.LESSON) {\n updateSlideConfig({\n accuracyStr: playerStats.value,\n totalTimeTaken: playerStats.timeSpent,\n isCircleSkillCompleted: true,\n showCircleGameScreen: true,\n matchmakingId: uuidv4(),\n });\n } else if (projectType === ProjectType.GAME) {\n updateSlideConfig({\n isCircleGamePlayed: true,\n showCircleGameScreen: true,\n matchmakingId: uuidv4(),\n });\n } else if (projectType === ProjectType.PUZZLE) {\n updateSlideConfig({\n isCirclePuzzleSolved: true,\n showCircleGameScreen: true,\n matchmakingId: uuidv4(),\n });\n }\n },\n [updateSlideConfig, projectType],\n );\n\n const getCustEle = useCallback(() => {\n if (accuracyStr && totalTimeTaken) {\n return (\n <>\n <FlexView $flexDirection=\"row\">\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n Finished in\n </Text>\n <Separator width={5} />\n <Text $renderAs=\"ab2-bold\" $color=\"WHITE\">\n {getTimeStrInFormatHMS(totalTimeTaken)}\n </Text>\n </FlexView>\n <Separator height={20} />\n <FlexView $flexDirection=\"row\">\n <Text $renderAs=\"ab2\" $color=\"WHITE\">\n Accuracy:\n </Text>\n <Separator width={5} />\n <Text $renderAs=\"ab2-bold\" $color=\"WHITE\">\n {accuracyStr}\n </Text>\n </FlexView>\n </>\n );\n }\n\n return null;\n }, [accuracyStr, totalTimeTaken]);\n\n useEffect(() => {\n if (!isLoading && !showCircleGameScreen) {\n playGame();\n }\n }, [showCircleGameScreen, playGame, isLoading]);\n\n return (\n <Styled.GameContainer>\n <Separator height={16} />\n <Text $renderAs=\"ah3-bold\" $color=\"WHITE_T_87\" $align=\"center\" $marginBottom={16}>\n {header}\n </Text>\n <Styled.GameWrapper>\n {showCircleGameScreen && (\n <Styled.GameLaunchOverlay>\n <TrialCircleGameLaunchScreen\n assetUrl={assetUrl}\n assetUrlType={assetUrl.endsWith('mp4') ? 'video' : 'lottie'}\n descriptionHeader={descriptionHeader}\n playerType={playerType}\n isLoading={isLoading}\n isGamePlayed={\n (projectType &&\n isPlayed[\n projectType as keyof Omit<Record<ProjectType, string>, ProjectType.TABLE>\n ]) ??\n false\n }\n onPlay={onPlay}\n custEle={projectType === ProjectType.LESSON ? getCustEle() : undefined}\n celebrationText={\n projectType &&\n isPlayed[projectType as keyof Omit<Record<ProjectType, string>, ProjectType.TABLE>]\n ? 'WELL DONE!'\n : ''\n }\n />\n </Styled.GameLaunchOverlay>\n )}\n {matchmakingId && (\n <WebView\n key={matchmakingId}\n ref={webViewRef}\n height=\"100%\"\n width=\"100%\"\n baseUrl={trialGameUrl}\n playerDetails={playerData}\n projectDetails={projectDetails}\n onGameLoad={onGameLoad}\n onBack={handleBack}\n handleInfoMessage={handleInfoMessage}\n onGamePlayFinish={handleGameFinish}\n parentDomain={window.location.origin}\n />\n )}\n </Styled.GameWrapper>\n </Styled.GameContainer>\n );\n});\n\nexport default TrialCircleGame;\n"],"names":["PROJECT_TYPE_MAP","TrialPageId","ProjectType","TrialCircleGame","memo","slideConfig","trialGameUrl","circleGames","formData","handleInfoMessage","updateSlideConfig","useTrialSessionContext","showCircleGameScreen","isCircleGamePlayed","isCirclePuzzleSolved","isCircleSkillCompleted","accuracyStr","totalTimeTaken","matchmakingId","webViewRef","useRef","playGame","useWebViewGames","isLoading","setIsLoading","useState","header","id","projectType","circleConfig","playerDetails","games","puzzles","lessons","isPlayed","useMemo","assetUrl","url","descriptionHeader","circle_username","userId","grade","user_avatar","playerType","playerData","projectDetails","commonConfig","onGameLoad","useCallback","handleBack","uuidv4","onPlay","handleGameFinish","playerStats","getCustEle","jsxs","Fragment","FlexView","jsx","Text","Separator","getTimeStrInFormatHMS","useEffect","Styled.GameContainer","Styled.GameWrapper","Styled.GameLaunchOverlay","TrialCircleGameLaunchScreen","WebView"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAMA,KAAuF;AAAA,EAC3F,CAACC,EAAY,WAAW,GAAGC,EAAY;AAAA,EACvC,CAACD,EAAY,aAAa,GAAGC,EAAY;AAAA,EACzC,CAACD,EAAY,YAAY,GAAGC,EAAY;AAC1C,GAEMC,KAAkBC,EAAK,MAAM;AAC3B,QAAA,EAAE,aAAAC,GAAa,cAAAC,GAAc,aAAAC,GAAa,UAAAC,GAAU,mBAAAC,GAAmB,mBAAAC,MAC3EC,MACI;AAAA,IACJ,sBAAAC,IAAuB;AAAA,IACvB,oBAAAC,IAAqB;AAAA,IACrB,sBAAAC,IAAuB;AAAA,IACvB,wBAAAC,IAAyB;AAAA,IACzB,aAAAC,IAAc;AAAA,IACd,gBAAAC,IAAiB;AAAA,IACjB,eAAAC;AAAA,EAAA,IACEV,KAAY,CAAA,GACVW,IAAaC,EAA0B,IAAI,GAC3C,EAAE,UAAAC,EAAS,IAAIC,GAAgB,EAAE,YAAAH,EAAY,CAAA,GAC7C,CAAC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.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n course?: string;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n
|
|
1
|
+
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type {\n IMilestoneConfig,\n TCourseStream,\n TPreferenceCategory,\n} from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, ReactElement, SetStateAction } from 'react';\n\nexport type { TSessionReportData as TSessionReport } from './comps/session-report/session-report-types';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport type TPreferenceSchema = {\n preference_code: string;\n preference_name: string;\n preference_category: TPreferenceCategory;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = {\n degree_name?: string;\n field_of_study?: string;\n degree_code?: string;\n};\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n first_name: string;\n last_name: string;\n teacher_profile_url?: string;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n showProfileHighlights?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n personalizedObjectives?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n numberInNameError?: boolean;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n course?: string;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: ReactElement;\n studentPanel?: ReactElement;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: ReactElement;\n worksheetNavigationPanel?: ReactElement;\n questionsRatingPanel?: ReactElement;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AA+BY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,110 +1,108 @@
|
|
|
1
|
-
import { jsx as D, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { getGradesFromConfig as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useButtonStateForLeftPanel as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsx as D, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { memo as J, useState as K, useMemo as m, useCallback as Q, useEffect as S } from "react";
|
|
3
|
+
import { getGradesFromConfig as W } from "../milestone/create/milestone-create-helpers.js";
|
|
4
|
+
import X from "../ui/layout/flex-view.js";
|
|
5
|
+
import Y from "./context/trial-session-context.js";
|
|
6
|
+
import { useButtonStateForLeftPanel as Z } from "./hooks/use-left-panel-button-state.js";
|
|
7
|
+
import ee from "./left-panel/index.js";
|
|
8
|
+
import te from "./right-panel/index.js";
|
|
9
|
+
const de = J((H) => {
|
|
10
10
|
const {
|
|
11
|
-
countryCode: I,
|
|
12
11
|
userType: r,
|
|
13
|
-
teacherPanel:
|
|
14
|
-
studentPanel:
|
|
15
|
-
trialGameUrl:
|
|
16
|
-
formData:
|
|
17
|
-
height:
|
|
12
|
+
teacherPanel: I,
|
|
13
|
+
studentPanel: T,
|
|
14
|
+
trialGameUrl: x,
|
|
15
|
+
formData: s,
|
|
16
|
+
height: L = "100vh",
|
|
18
17
|
trialHomeData: t,
|
|
19
|
-
milestoneConfig:
|
|
18
|
+
milestoneConfig: o,
|
|
20
19
|
onFormDataChange: u,
|
|
21
|
-
worksheet:
|
|
20
|
+
worksheet: P,
|
|
22
21
|
studentId: i,
|
|
23
22
|
teacherId: l,
|
|
24
23
|
classStartedOn: _,
|
|
25
24
|
worksheetNavigationPanel: v,
|
|
26
|
-
questionsRatingPanel:
|
|
27
|
-
studentAbsentInClass:
|
|
28
|
-
openEndClassModal:
|
|
29
|
-
onTrialInformationUpdate:
|
|
25
|
+
questionsRatingPanel: y,
|
|
26
|
+
studentAbsentInClass: E,
|
|
27
|
+
openEndClassModal: w,
|
|
28
|
+
onTrialInformationUpdate: F,
|
|
30
29
|
onStudentTimezoneUpdate: f,
|
|
31
|
-
handleInfoMessage:
|
|
32
|
-
onRemoveOptionalSlides:
|
|
33
|
-
classDuration:
|
|
30
|
+
handleInfoMessage: G,
|
|
31
|
+
onRemoveOptionalSlides: M,
|
|
32
|
+
classDuration: R,
|
|
34
33
|
studentTimezone: g,
|
|
35
|
-
classTimeAlertConfig:
|
|
36
|
-
} =
|
|
34
|
+
classTimeAlertConfig: $
|
|
35
|
+
} = H, a = r === "TEACHER", { pages: p = [], student: O } = t, { name: b, grade: c } = O || {}, [n, q] = K(s), h = a ? n : s, C = h == null ? void 0 : h.id, j = m(
|
|
37
36
|
() => p.find((e) => e.id === C) ?? p[0],
|
|
38
37
|
[C, p]
|
|
39
|
-
),
|
|
38
|
+
), k = m(() => {
|
|
40
39
|
const e = {
|
|
41
40
|
circleConfig: t.circle_trial_game_config,
|
|
42
41
|
playerDetails: {
|
|
43
42
|
userId: a ? l : i,
|
|
44
43
|
circle_username: t[a ? "teacher" : "student"].circle_username,
|
|
45
44
|
user_avatar: t[a ? "teacher" : "student"].user_avatar,
|
|
46
|
-
playerType: r
|
|
47
|
-
countryCode: I
|
|
45
|
+
playerType: r
|
|
48
46
|
}
|
|
49
47
|
};
|
|
50
48
|
return r === "STUDENT" && (e.playerDetails.grade = t.student.grade), e;
|
|
51
|
-
}, [
|
|
52
|
-
|
|
53
|
-
}, []), { buttonState:
|
|
49
|
+
}, [a, i, l, t, r]), d = Q((e) => {
|
|
50
|
+
q((B) => B ? { ...B, ...e } : e);
|
|
51
|
+
}, []), { buttonState: A, updateButtonState: N } = Z(), U = m(
|
|
54
52
|
() => ({
|
|
55
|
-
teacherPanel:
|
|
56
|
-
studentPanel:
|
|
53
|
+
teacherPanel: I,
|
|
54
|
+
studentPanel: T,
|
|
57
55
|
isTeacher: a,
|
|
58
|
-
slideConfig:
|
|
59
|
-
milestoneConfig:
|
|
60
|
-
formData: a ? n :
|
|
56
|
+
slideConfig: j,
|
|
57
|
+
milestoneConfig: o,
|
|
58
|
+
formData: a ? n : s,
|
|
61
59
|
updateSlideConfig: d,
|
|
62
|
-
worksheet:
|
|
63
|
-
buttonState:
|
|
64
|
-
updateButtonState:
|
|
60
|
+
worksheet: P,
|
|
61
|
+
buttonState: A,
|
|
62
|
+
updateButtonState: N,
|
|
65
63
|
studentId: i,
|
|
66
64
|
teacherId: l,
|
|
67
65
|
classStartedOn: _,
|
|
68
66
|
trialHomeData: t,
|
|
69
67
|
worksheetNavigationPanel: v,
|
|
70
|
-
questionsRatingPanel:
|
|
71
|
-
onTrialInformationUpdate:
|
|
72
|
-
openEndClassModal:
|
|
73
|
-
studentAbsentInClass:
|
|
74
|
-
circleGames:
|
|
75
|
-
trialGameUrl:
|
|
76
|
-
handleInfoMessage:
|
|
77
|
-
onRemoveOptionalSlides:
|
|
78
|
-
classDuration:
|
|
79
|
-
classTimeAlertConfig:
|
|
68
|
+
questionsRatingPanel: y,
|
|
69
|
+
onTrialInformationUpdate: F,
|
|
70
|
+
openEndClassModal: w,
|
|
71
|
+
studentAbsentInClass: E,
|
|
72
|
+
circleGames: k,
|
|
73
|
+
trialGameUrl: x,
|
|
74
|
+
handleInfoMessage: G,
|
|
75
|
+
onRemoveOptionalSlides: M,
|
|
76
|
+
classDuration: R,
|
|
77
|
+
classTimeAlertConfig: $
|
|
80
78
|
}),
|
|
81
79
|
[
|
|
80
|
+
I,
|
|
82
81
|
T,
|
|
83
|
-
x,
|
|
84
82
|
a,
|
|
85
|
-
|
|
86
|
-
s,
|
|
87
|
-
n,
|
|
83
|
+
j,
|
|
88
84
|
o,
|
|
85
|
+
n,
|
|
86
|
+
s,
|
|
89
87
|
d,
|
|
90
|
-
|
|
88
|
+
P,
|
|
89
|
+
A,
|
|
91
90
|
N,
|
|
92
|
-
V,
|
|
93
91
|
i,
|
|
94
92
|
l,
|
|
95
93
|
_,
|
|
96
94
|
t,
|
|
97
95
|
v,
|
|
98
|
-
|
|
99
|
-
G,
|
|
96
|
+
y,
|
|
100
97
|
F,
|
|
101
98
|
w,
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
E,
|
|
100
|
+
k,
|
|
101
|
+
x,
|
|
102
|
+
G,
|
|
104
103
|
M,
|
|
105
104
|
R,
|
|
106
|
-
|
|
107
|
-
b
|
|
105
|
+
$
|
|
108
106
|
]
|
|
109
107
|
);
|
|
110
108
|
S(() => {
|
|
@@ -112,28 +110,28 @@ const me = K((L) => {
|
|
|
112
110
|
}, [u, n]), S(() => {
|
|
113
111
|
g || f == null || f();
|
|
114
112
|
}, [C]);
|
|
115
|
-
const
|
|
116
|
-
() => !!
|
|
117
|
-
[
|
|
113
|
+
const V = m(
|
|
114
|
+
() => !!W(o).find((e) => e.id === c),
|
|
115
|
+
[o, c]
|
|
118
116
|
);
|
|
119
117
|
return S(() => {
|
|
120
118
|
d({
|
|
121
119
|
studentTimezone: g,
|
|
122
|
-
name:
|
|
123
|
-
grade:
|
|
120
|
+
name: b,
|
|
121
|
+
grade: V ? c : ""
|
|
124
122
|
});
|
|
125
123
|
}, [
|
|
126
|
-
|
|
124
|
+
b,
|
|
127
125
|
c,
|
|
128
126
|
d,
|
|
129
127
|
g,
|
|
130
|
-
|
|
131
|
-
]), /* @__PURE__ */ D(
|
|
132
|
-
/* @__PURE__ */ D(
|
|
133
|
-
/* @__PURE__ */ D(
|
|
128
|
+
V
|
|
129
|
+
]), /* @__PURE__ */ D(Y.Provider, { value: U, children: /* @__PURE__ */ z(X, { $height: L, $flexDirection: "row", $justifyContent: "center", $alignItems: "center", children: [
|
|
130
|
+
/* @__PURE__ */ D(ee, {}),
|
|
131
|
+
/* @__PURE__ */ D(te, {})
|
|
134
132
|
] }) });
|
|
135
133
|
});
|
|
136
134
|
export {
|
|
137
|
-
|
|
135
|
+
de as default
|
|
138
136
|
};
|
|
139
137
|
//# sourceMappingURL=trial-session-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trial-session-view.js","sources":["../../../src/features/trial-session/trial-session-view.tsx"],"sourcesContent":["import type { ITrialCircleGameParams } from './comps/trial-circle-game/trial-circle-game-types';\nimport type {\n ITrialSessionContext,\n ITrialSessionViewProps,\n ITrialSessionFormFields,\n} from './trial-session-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { getGradesFromConfig } from '../milestone/create/milestone-create-helpers';\nimport FlexView from '../ui/layout/flex-view';\nimport TrialSessionContext from './context/trial-session-context';\nimport { useButtonStateForLeftPanel } from './hooks/use-left-panel-button-state';\nimport LeftPanel from './left-panel';\nimport RightPanel from './right-panel';\n\nconst TrialSessionView: FC<ITrialSessionViewProps> = memo(props => {\n const {\n
|
|
1
|
+
{"version":3,"file":"trial-session-view.js","sources":["../../../src/features/trial-session/trial-session-view.tsx"],"sourcesContent":["import type { ITrialCircleGameParams } from './comps/trial-circle-game/trial-circle-game-types';\nimport type {\n ITrialSessionContext,\n ITrialSessionViewProps,\n ITrialSessionFormFields,\n} from './trial-session-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { getGradesFromConfig } from '../milestone/create/milestone-create-helpers';\nimport FlexView from '../ui/layout/flex-view';\nimport TrialSessionContext from './context/trial-session-context';\nimport { useButtonStateForLeftPanel } from './hooks/use-left-panel-button-state';\nimport LeftPanel from './left-panel';\nimport RightPanel from './right-panel';\n\nconst TrialSessionView: FC<ITrialSessionViewProps> = memo(props => {\n const {\n userType,\n teacherPanel,\n studentPanel,\n trialGameUrl,\n formData: formDataProps,\n height = '100vh',\n trialHomeData,\n milestoneConfig,\n onFormDataChange,\n worksheet,\n studentId,\n teacherId,\n classStartedOn,\n worksheetNavigationPanel,\n questionsRatingPanel,\n studentAbsentInClass,\n openEndClassModal,\n onTrialInformationUpdate,\n onStudentTimezoneUpdate,\n handleInfoMessage,\n onRemoveOptionalSlides,\n classDuration,\n studentTimezone,\n classTimeAlertConfig,\n } = props;\n const isTeacher = userType === 'TEACHER';\n const { pages: slides = [], student } = trialHomeData;\n const { name: studentName, grade: studentGrade } = student || {};\n const [formData, setFormData] = useState<ITrialSessionFormFields | undefined>(formDataProps);\n const formDataToUse = isTeacher ? formData : formDataProps;\n const currentSlideId = formDataToUse?.id;\n const currentSlideConfig = useMemo(\n () => slides.find(config => config.id === currentSlideId) ?? slides[0]!,\n [currentSlideId, slides],\n );\n\n const circleGames = useMemo(() => {\n const data = {\n circleConfig: trialHomeData.circle_trial_game_config,\n playerDetails: {\n userId: isTeacher ? teacherId : studentId,\n circle_username: trialHomeData[isTeacher ? 'teacher' : 'student'].circle_username,\n user_avatar: trialHomeData[isTeacher ? 'teacher' : 'student'].user_avatar,\n playerType: userType,\n },\n } as ITrialCircleGameParams;\n\n if (userType === 'STUDENT') {\n data.playerDetails.grade = trialHomeData.student.grade;\n }\n\n return data;\n }, [isTeacher, studentId, teacherId, trialHomeData, userType]);\n\n const updateSlideConfig = useCallback((config: Partial<ITrialSessionFormFields>) => {\n setFormData(previousProps => {\n if (!previousProps) return config as ITrialSessionFormFields;\n\n return { ...previousProps, ...config };\n });\n }, []);\n const { buttonState, updateButtonState } = useButtonStateForLeftPanel();\n\n const contextValue = useMemo<ITrialSessionContext>(\n () => ({\n teacherPanel,\n studentPanel,\n isTeacher,\n slideConfig: currentSlideConfig,\n milestoneConfig,\n formData: isTeacher ? formData : formDataProps,\n updateSlideConfig,\n worksheet,\n buttonState,\n updateButtonState,\n studentId,\n teacherId,\n classStartedOn,\n trialHomeData,\n worksheetNavigationPanel,\n questionsRatingPanel,\n onTrialInformationUpdate,\n openEndClassModal,\n studentAbsentInClass,\n circleGames,\n trialGameUrl,\n handleInfoMessage,\n onRemoveOptionalSlides,\n classDuration,\n classTimeAlertConfig,\n }),\n [\n teacherPanel,\n studentPanel,\n isTeacher,\n currentSlideConfig,\n milestoneConfig,\n formData,\n formDataProps,\n updateSlideConfig,\n worksheet,\n buttonState,\n updateButtonState,\n studentId,\n teacherId,\n classStartedOn,\n trialHomeData,\n worksheetNavigationPanel,\n questionsRatingPanel,\n onTrialInformationUpdate,\n openEndClassModal,\n studentAbsentInClass,\n circleGames,\n trialGameUrl,\n handleInfoMessage,\n onRemoveOptionalSlides,\n classDuration,\n classTimeAlertConfig,\n ],\n );\n\n useEffect(() => {\n if (formData && onFormDataChange) {\n onFormDataChange(formData);\n }\n }, [onFormDataChange, formData]);\n\n useEffect(() => {\n if (!studentTimezone) onStudentTimezoneUpdate?.();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentSlideId]);\n\n const IsGradeExistInMilestoneConfig = useMemo(\n () => !!getGradesFromConfig(milestoneConfig).find(element => element.id === studentGrade),\n [milestoneConfig, studentGrade],\n );\n\n useEffect(() => {\n updateSlideConfig({\n studentTimezone,\n name: studentName,\n grade: IsGradeExistInMilestoneConfig ? studentGrade : '',\n });\n }, [\n studentName,\n studentGrade,\n updateSlideConfig,\n studentTimezone,\n IsGradeExistInMilestoneConfig,\n ]);\n\n return (\n <TrialSessionContext.Provider value={contextValue}>\n <FlexView $height={height} $flexDirection=\"row\" $justifyContent=\"center\" $alignItems=\"center\">\n <LeftPanel />\n <RightPanel />\n </FlexView>\n </TrialSessionContext.Provider>\n );\n});\n\nexport default TrialSessionView;\n"],"names":["TrialSessionView","memo","props","userType","teacherPanel","studentPanel","trialGameUrl","formDataProps","height","trialHomeData","milestoneConfig","onFormDataChange","worksheet","studentId","teacherId","classStartedOn","worksheetNavigationPanel","questionsRatingPanel","studentAbsentInClass","openEndClassModal","onTrialInformationUpdate","onStudentTimezoneUpdate","handleInfoMessage","onRemoveOptionalSlides","classDuration","studentTimezone","classTimeAlertConfig","isTeacher","slides","student","studentName","studentGrade","formData","setFormData","useState","formDataToUse","currentSlideId","currentSlideConfig","useMemo","config","circleGames","data","updateSlideConfig","useCallback","previousProps","buttonState","updateButtonState","useButtonStateForLeftPanel","contextValue","useEffect","IsGradeExistInMilestoneConfig","getGradesFromConfig","element","jsx","TrialSessionContext","jsxs","FlexView","LeftPanel","RightPanel"],"mappings":";;;;;;;;AAiBM,MAAAA,KAA+CC,EAAK,CAASC,MAAA;AAC3D,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAUC;AAAA,IACV,QAAAC,IAAS;AAAA,IACT,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,W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C,MAAWA,EAAQ,OAAOrB,CAAY;AAAA,IACxF,CAACrB,GAAiBqB,CAAY;AAAA,EAAA;AAGhC,SAAAkB,EAAU,MAAM;AACI,IAAAP,EAAA;AAAA,MAChB,iBAAAjB;AAAA,MACA,MAAMK;AAAA,MACN,OAAOoB,IAAgCnB,IAAe;AAAA,IAAA,CACvD;AAAA,EAAA,GACA;AAAA,IACDD;AAAA,IACAC;AAAA,IACAW;AAAA,IACAjB;AAAA,IACAyB;AAAA,EAAA,CACD,GAGE,gBAAAG,EAAAC,EAAoB,UAApB,EAA6B,OAAON,GACnC,UAAA,gBAAAO,EAACC,GAAS,EAAA,SAAShD,GAAQ,gBAAe,OAAM,iBAAgB,UAAS,aAAY,UACnF,UAAA;AAAA,IAAA,gBAAA6C,EAACI,IAAU,EAAA;AAAA,sBACVC,IAAW,EAAA;AAAA,EAAA,EACd,CAAA,EACF,CAAA;AAEJ,CAAC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1696,7 +1696,6 @@ declare interface IGetCheckboxConfig {
|
|
|
1696
1696
|
declare interface IGetCircleHomePayloadModel {
|
|
1697
1697
|
user_id: string;
|
|
1698
1698
|
grade: string;
|
|
1699
|
-
country_code: string;
|
|
1700
1699
|
}
|
|
1701
1700
|
|
|
1702
1701
|
declare interface IGetCircleHomeResponseModel {
|
|
@@ -3055,7 +3054,6 @@ export declare interface IPlayer {
|
|
|
3055
3054
|
grade?: string;
|
|
3056
3055
|
avatar?: IAvatarLayer[] | null;
|
|
3057
3056
|
playerType: TUserTypes;
|
|
3058
|
-
countryCode: string;
|
|
3059
3057
|
isAdmin?: boolean;
|
|
3060
3058
|
}
|
|
3061
3059
|
|
|
@@ -4133,7 +4131,6 @@ declare interface ITrialSessionMetadata {
|
|
|
4133
4131
|
}
|
|
4134
4132
|
|
|
4135
4133
|
declare interface ITrialSessionProps {
|
|
4136
|
-
countryCode?: string;
|
|
4137
4134
|
classStartedOn?: Date;
|
|
4138
4135
|
height?: string | number;
|
|
4139
4136
|
userType: TUserTypes;
|
|
@@ -6843,7 +6840,7 @@ declare const useGetCircleHomeAPI: (initialId?: string, initialQuery?: IGetCircl
|
|
|
6843
6840
|
} & Record<string, unknown>) | undefined;
|
|
6844
6841
|
};
|
|
6845
6842
|
|
|
6846
|
-
export declare const useGetCircleHomeDetailsDal: (userId: string, grade: string
|
|
6843
|
+
export declare const useGetCircleHomeDetailsDal: (userId: string, grade: string) => Omit<ReturnType<typeof useGetCircleHomeAPI>, "data" | "get"> & {
|
|
6847
6844
|
data: ICircleHomeDetails | null;
|
|
6848
6845
|
getCircleHomeDetails: () => void;
|
|
6849
6846
|
invalidateCircleHomeDetails: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import b from "
|
|
1
|
+
import b from "./node_modules/decode-uri-component/index.js";
|
|
2
2
|
import l from "../split-on-first/index.js";
|
|
3
3
|
import { includeKeys as N } from "../filter-obj/index.js";
|
|
4
4
|
const j = (r) => r == null, A = (r) => encodeURIComponent(r).replace(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), u = Symbol("encodeFragmentIdentifier");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/query-string/node_modules/decode-uri-component/index.js"],"sourcesContent":["const token = '%[a-f0-9]{2}';\nconst singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');\nconst multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn [decodeURIComponent(components.join(''))];\n\t} catch {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tconst left = components.slice(0, split);\n\tconst right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch {\n\t\tlet tokens = input.match(singleMatcher) || [];\n\n\t\tfor (let i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher) || [];\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tconst replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD',\n\t};\n\n\tlet match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch {\n\t\t\tconst result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tconst entries = Object.keys(replaceMap);\n\n\tfor (const key of entries) {\n\t\t// Replace all decoded components\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nexport default function decodeUriComponent(encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n}\n"],"names":["token","singleMatcher","multiMatcher","decodeComponents","components","split","left","right","decode","input","tokens","i","customDecodeURIComponent","replaceMap","match","result","entries","key","decodeUriComponent","encodedURI"],"mappings":"AAAA,MAAMA,IAAQ,gBACRC,IAAgB,IAAI,OAAO,MAAMD,IAAQ,cAAc,IAAI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,OAAO,KAAKH,CAAU;AAEtC,aAAWI,KAAOD;AAEjB,IAAAP,IAAQA,EAAM,QAAQ,IAAI,OAAOQ,GAAK,GAAG,GAAGJ,EAAWI,CAAG,CAAC;AAG5D,SAAOR;AACR;AAEe,SAASS,EAAmBC,GAAY;AACtD,MAAI,OAAOA,KAAe;AACzB,UAAM,IAAI,UAAU,wDAAwD,OAAOA,IAAa,GAAG;AAGpG,MAAI;AAEH,WAAO,mBAAmBA,CAAU;AAAA,EACtC,QAAS;AAEP,WAAOP,EAAyBO,CAAU;AAAA,EAC1C;AACF;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/regex.js"],"sourcesContent":["export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;"],"names":["REGEX"],"mappings":"AAAA,MAAAA,IAAe;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const e = new Uint8Array(16);
|
|
1
|
+
var t, e = new Uint8Array(16);
|
|
3
2
|
function o() {
|
|
4
|
-
if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
|
|
3
|
+
if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !t))
|
|
5
4
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
6
5
|
return t(e);
|
|
7
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rng.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\
|
|
1
|
+
{"version":3,"file":"rng.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}"],"names":["getRandomValues","rnds8","rng"],"mappings":"AAGA,IAAIA,GACAC,IAAQ,IAAI,WAAW,EAAE;AACd,SAASC,IAAM;AAE5B,MAAI,CAACF,MAGHA,IAAkB,OAAO,SAAW,OAAe,OAAO,mBAAmB,OAAO,gBAAgB,KAAK,MAAM,KAAK,OAAO,WAAa,OAAe,OAAO,SAAS,mBAAoB,cAAc,SAAS,gBAAgB,KAAK,QAAQ,GAE3O,CAACA;AACH,UAAM,IAAI,MAAM,0GAA0G;AAI9H,SAAOA,EAAgBC,CAAK;AAC9B;","x_google_ignoreList":[0]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import s from "./validate.js";
|
|
2
|
+
var t = [];
|
|
3
|
+
for (var n = 0; n < 256; ++n)
|
|
4
|
+
t.push((n + 256).toString(16).substr(1));
|
|
5
|
+
function f(e) {
|
|
6
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = (t[e[i + 0]] + t[e[i + 1]] + t[e[i + 2]] + t[e[i + 3]] + "-" + t[e[i + 4]] + t[e[i + 5]] + "-" + t[e[i + 6]] + t[e[i + 7]] + "-" + t[e[i + 8]] + t[e[i + 9]] + "-" + t[e[i + 10]] + t[e[i + 11]] + t[e[i + 12]] + t[e[i + 13]] + t[e[i + 14]] + t[e[i + 15]]).toLowerCase();
|
|
7
|
+
if (!s(o))
|
|
8
|
+
throw TypeError("Stringified UUID is invalid");
|
|
9
|
+
return o;
|
|
6
10
|
}
|
|
7
11
|
export {
|
|
8
|
-
|
|
12
|
+
f as default
|
|
9
13
|
};
|
|
10
14
|
//# sourceMappingURL=stringify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\
|
|
1
|
+
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;"],"names":["byteToHex","i","stringify","arr","offset","uuid","validate"],"mappings":";AAMA,IAAIA,IAAY,CAAA;AAEhB,SAASC,IAAI,GAAGA,IAAI,KAAK,EAAEA;AACzB,EAAAD,EAAU,MAAMC,IAAI,KAAO,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;AAGnD,SAASC,EAAUC,GAAK;AACtB,MAAIC,IAAS,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAY,UAAU,CAAC,IAAI,GAG7EC,KAAQL,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,GAAG;AAMzf,MAAI,CAACE,EAASD,CAAI;AAChB,UAAM,UAAU,6BAA6B;AAG/C,SAAOA;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
function g(n, m, t) {
|
|
5
|
-
if (e.randomUUID && !m && !n)
|
|
6
|
-
return e.randomUUID();
|
|
1
|
+
import d from "./rng.js";
|
|
2
|
+
import f from "./stringify.js";
|
|
3
|
+
function v(n, m, x) {
|
|
7
4
|
n = n || {};
|
|
8
|
-
|
|
5
|
+
var r = n.random || (n.rng || d)();
|
|
9
6
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, m) {
|
|
10
|
-
|
|
11
|
-
for (
|
|
12
|
-
m[
|
|
7
|
+
x = x || 0;
|
|
8
|
+
for (var a = 0; a < 16; ++a)
|
|
9
|
+
m[x + a] = r[a];
|
|
13
10
|
return m;
|
|
14
11
|
}
|
|
15
|
-
return
|
|
12
|
+
return f(r);
|
|
16
13
|
}
|
|
17
14
|
export {
|
|
18
|
-
|
|
15
|
+
v as default
|
|
19
16
|
};
|
|
20
17
|
//# sourceMappingURL=v4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v4.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"v4.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;"],"names":["v4","options","buf","offset","rnds","rng","i","stringify"],"mappings":";;AAGA,SAASA,EAAGC,GAASC,GAAKC,GAAQ;AAChC,EAAAF,IAAUA,KAAW;AACrB,MAAIG,IAAOH,EAAQ,WAAWA,EAAQ,OAAOI;AAK7C,MAHAD,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,IAC3BA,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,KAEvBF,GAAK;AACP,IAAAC,IAASA,KAAU;AAEnB,aAASG,IAAI,GAAGA,IAAI,IAAI,EAAEA;AACxB,MAAAJ,EAAIC,IAASG,CAAC,IAAIF,EAAKE,CAAC;AAG1B,WAAOJ;AAAA,EACR;AAED,SAAOK,EAAUH,CAAI;AACvB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/validate.js"],"sourcesContent":["import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;"],"names":["validate","uuid","REGEX"],"mappings":";AAEA,SAASA,EAASC,GAAM;AACtB,SAAO,OAAOA,KAAS,YAAYC,EAAM,KAAKD,CAAI;AACpD;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/decode-uri-component/index.js"],"sourcesContent":["const token = '%[a-f0-9]{2}';\nconst singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');\nconst multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn [decodeURIComponent(components.join(''))];\n\t} catch {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tconst left = components.slice(0, split);\n\tconst right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch {\n\t\tlet tokens = input.match(singleMatcher) || [];\n\n\t\tfor (let i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher) || [];\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tconst replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD',\n\t};\n\n\tlet match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch {\n\t\t\tconst result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tconst entries = Object.keys(replaceMap);\n\n\tfor (const key of entries) {\n\t\t// Replace all decoded components\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nexport default function decodeUriComponent(encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n}\n"],"names":["token","singleMatcher","multiMatcher","decodeComponents","components","split","left","right","decode","input","tokens","i","customDecodeURIComponent","replaceMap","match","result","entries","key","decodeUriComponent","encodedURI"],"mappings":"AAAA,MAAMA,IAAQ,gBACRC,IAAgB,IAAI,OAAO,MAAMD,IAAQ,cAAc,IAAI,GAC3DE,IAAe,IAAI,OAAO,MAAMF,IAAQ,MAAM,IAAI;AAExD,SAASG,EAAiBC,GAAYC,GAAO;AAC5C,MAAI;AAEH,WAAO,CAAC,mBAAmBD,EAAW,KAAK,EAAE,CAAC,CAAC;AAAA,EACjD,QAAS;AAAA,EAEP;AAED,MAAIA,EAAW,WAAW;AACzB,WAAOA;AAGR,EAAAC,IAAQA,KAAS;AAGjB,QAAMC,IAAOF,EAAW,MAAM,GAAGC,CAAK,GAChCE,IAAQH,EAAW,MAAMC,CAAK;AAEpC,SAAO,MAAM,UAAU,OAAO,KAAK,CAAA,GAAIF,EAAiBG,CAAI,GAAGH,EAAiBI,CAAK,CAAC;AACvF;AAEA,SAASC,EAAOC,GAAO;AACtB,MAAI;AACH,WAAO,mBAAmBA,CAAK;AAAA,EACjC,QAAS;AACP,QAAIC,IAASD,EAAM,MAAMR,CAAa,KAAK,CAAA;AAE3C,aAASU,IAAI,GAAGA,IAAID,EAAO,QAAQC;AAClC,MAAAF,IAAQN,EAAiBO,GAAQC,CAAC,EAAE,KAAK,EAAE,GAE3CD,IAASD,EAAM,MAAMR,CAAa,KAAK,CAAA;AAGxC,WAAOQ;AAAA,EACP;AACF;AAEA,SAASG,EAAyBH,GAAO;AAExC,QAAMI,IAAa;AAAA,IAClB,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAEC,MAAIC,IAAQZ,EAAa,KAAKO,CAAK;AACnC,SAAOK,KAAO;AACb,QAAI;AAEH,MAAAD,EAAWC,EAAM,CAAC,CAAC,IAAI,mBAAmBA,EAAM,CAAC,CAAC;AAAA,IACrD,QAAU;AACP,YAAMC,IAASP,EAAOM,EAAM,CAAC,CAAC;AAE9B,MAAIC,MAAWD,EAAM,CAAC,MACrBD,EAAWC,EAAM,CAAC,CAAC,IAAIC;AAAA,IAExB;AAED,IAAAD,IAAQZ,EAAa,KAAKO,CAAK;AAAA,EAC/B;AAGD,EAAAI,EAAW,KAAK,IAAI;AAEpB,QAAMG,IAAU,OAAO,KAAKH,CAAU;AAEtC,aAAWI,KAAOD;AAEjB,IAAAP,IAAQA,EAAM,QAAQ,IAAI,OAAOQ,GAAK,GAAG,GAAGJ,EAAWI,CAAG,CAAC;AAG5D,SAAOR;AACR;AAEe,SAASS,EAAmBC,GAAY;AACtD,MAAI,OAAOA,KAAe;AACzB,UAAM,IAAI,UAAU,wDAAwD,OAAOA,IAAa,GAAG;AAGpG,MAAI;AAEH,WAAO,mBAAmBA,CAAU;AAAA,EACtC,QAAS;AAEP,WAAOP,EAAyBO,CAAU;AAAA,EAC1C;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/native.js"],"sourcesContent":["const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};"],"names":["randomUUID","native"],"mappings":"AAAA,MAAMA,IAAa,OAAO,SAAW,OAAe,OAAO,cAAc,OAAO,WAAW,KAAK,MAAM,GACvFC,IAAA;AAAA,EACb,YAAAD;AACF;","x_google_ignoreList":[0]}
|
|
File without changes
|