@cuemath/leap 2.8.61-as15 → 2.8.61-as17

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.
@@ -1,270 +1,157 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { memo as de, useState as L, useRef as E, useLayoutEffect as ue, useCallback as a } from "react";
3
- import B from "../../assets/line-icons/icons/eye2.js";
4
- import he from "../../assets/line-icons/icons/more-vertical.js";
5
- import me from "../../assets/line-icons/icons/redo.js";
6
- import fe from "../chapters-v2/comps/node-card/node-card-tags.js";
7
- import { getNodeTypeBasedBgImage as pe } from "../chapters-v2/utils/index.js";
8
- import { getNodeCardBasedIcon as $e } from "../chapters-v2/utils/node-card-utils.js";
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
+ import { memo as q, useRef as O, useCallback as h } from "react";
3
+ import R from "../../assets/line-icons/icons/eye2.js";
4
+ import G from "../../assets/line-icons/icons/more-vertical.js";
5
+ import J from "../../assets/line-icons/icons/redo.js";
9
6
  import V from "../ui/arrow-tooltip/arrow-tooltip.js";
10
- import we from "../ui/buttons/clickable/clickable.js";
11
- import j from "../ui/hooks/use-context-menu-click-handler.js";
12
- import i from "../ui/layout/flex-view.js";
13
- import be from "../ui/lottie-animation/lottie-animation.js";
14
- import I from "../ui/text/text.js";
15
- import G from "./card-menu-options.js";
16
- import ge from "./node-progress.js";
17
- import { CardContainer as Ce, CardWrapper as ke, IconWrapper as Te, BannerImageWrapper as _e, BannerImage as Ee, HeaderText as Ie, SubHeaderText as Re, MenuWrapper as ve, CardKebabMenuWrapper as ye, StyledMinus2Icon as xe } from "./styles.js";
18
- const Ae = ({
19
- header: R,
20
- nodeData: r,
21
- subHeader: K,
22
- userType: z,
7
+ import L from "../ui/buttons/clickable/clickable.js";
8
+ import S from "../ui/hooks/use-context-menu-click-handler.js";
9
+ import P from "../ui/layout/flex-view.js";
10
+ import T from "./card-menu-options.js";
11
+ import Z from "./homework-card-view.js";
12
+ import { CardContainer as Q, MenuWrapper as U, CardKebabMenuWrapper as D, BlurContainer as N, BlurFlexView as ee, StyledMinus2Icon as re } from "./styles.js";
13
+ const te = ({
14
+ header: x,
15
+ nodeData: e,
16
+ subHeader: M,
17
+ userType: W,
23
18
  userMilestoneId: t,
24
- onNodeUnassign: u,
25
- onNodeReattempt: h,
26
- onNodeView: $,
27
- onNodeReview: o,
28
- onNodeAttempt: w,
29
- renderAs: F,
30
- shouldOpenOnRight: P
19
+ onNodeUnassign: c,
20
+ onNodeReattempt: s,
21
+ onNodeView: f,
22
+ onNodeReview: i,
23
+ onNodeAttempt: m,
24
+ renderAs: H,
25
+ shouldOpenOnRight: X,
26
+ isInQueue: k
31
27
  }) => {
32
- const s = F === "homework", {
33
- node_type: l,
34
- state: v,
35
- accuracy: Y,
36
- due_date_ts: b,
37
- image_url: y,
38
- image_hue: x,
39
- card_header: q = "",
40
- permissions: J,
41
- user_node_id: m,
42
- unlocked_on_ts: A,
43
- user_milestone_id: g
44
- } = r, [Q, O] = L(!1), Z = pe(l), { icon: U, lottie: D } = $e(l), C = E(null), k = E(null), d = E(null), { menuVisible: S, onMenuClick: N } = j(C), { menuVisible: ee, onMenuClick: H } = j(k), [re, te] = L(!1), {
45
- can_start: W,
46
- can_resume: M,
47
- can_review: c,
48
- can_unassign: ne,
49
- can_reset: ie
50
- } = J, T = z === "STUDENT";
51
- ue(() => {
52
- d.current && d.current.scrollHeight > d.current.clientHeight && te(!0);
53
- }, [d]);
54
- const f = a(() => {
55
- if (c) {
56
- if (typeof o != "function")
28
+ const n = H === "homework", {
29
+ node_type: A,
30
+ state: I,
31
+ permissions: j,
32
+ user_node_id: l,
33
+ user_milestone_id: d
34
+ } = e, p = O(null), w = O(null), { menuVisible: $, onMenuClick: F } = S(p), { menuVisible: B, onMenuClick: E } = S(w), {
35
+ can_start: _,
36
+ can_resume: v,
37
+ can_review: o,
38
+ can_unassign: z,
39
+ can_reset: K
40
+ } = j, b = W === "STUDENT", u = h(() => {
41
+ if (o) {
42
+ if (typeof i != "function")
57
43
  throw new Error("onReview must be a function");
58
- if (!m)
44
+ if (!l)
59
45
  throw new Error("user node id must be present to review the sheet");
60
- o(r, t);
46
+ i(e, t);
61
47
  return;
62
48
  }
63
- }, [c, o, m, r, t]), oe = a(() => {
64
- if (W || M) {
65
- if (typeof w != "function")
49
+ }, [o, i, l, e, t]), Y = h(() => {
50
+ if (_ || v) {
51
+ if (typeof m != "function")
66
52
  throw new Error("onNodeAttempt must be a function");
67
- w(r);
53
+ m(e);
68
54
  return;
69
55
  }
70
- if (!s) {
71
- H();
56
+ if (!n) {
57
+ E();
72
58
  return;
73
59
  }
74
- f();
60
+ u();
75
61
  }, [
76
- W,
77
- M,
78
- s,
79
- f,
80
- w,
81
- r,
82
- H
83
- ]), _ = a(() => {
84
- if (c) {
85
- if (typeof o != "function")
62
+ _,
63
+ v,
64
+ n,
65
+ u,
66
+ m,
67
+ e,
68
+ E
69
+ ]), C = h(() => {
70
+ if (o) {
71
+ if (typeof i != "function")
86
72
  throw new Error("onNodeReview must be a function");
87
- if (!m)
73
+ if (!l)
88
74
  throw new Error("user node id must be present to review the sheet");
89
- o(r, t || g);
75
+ i(e, t || d);
90
76
  return;
91
77
  }
92
- if (typeof $ != "function")
78
+ if (typeof f != "function")
93
79
  throw new Error("onNodeView must be a function");
94
- $(r, t || g);
95
- }, [c, t, r, o, g, $, m]), p = a(
96
- (X) => {
97
- switch (X) {
80
+ f(e, t || d);
81
+ }, [o, t, e, i, d, f, l]), a = h(
82
+ (y) => {
83
+ switch (y) {
98
84
  case "teacher-card-view":
99
- _();
85
+ C();
100
86
  return;
101
87
  case "student-card-view":
102
- f();
88
+ u();
103
89
  return;
104
90
  case "teacher-card-unassign":
105
- u == null || u(r, t);
91
+ c == null || c(e, t);
106
92
  return;
107
93
  case "student-card-reattempt":
108
- h == null || h(r, t);
94
+ s == null || s(e, t);
109
95
  return;
110
96
  default:
111
- throw new Error(`No callback function for ${X}`);
97
+ throw new Error(`No callback function for ${y}`);
112
98
  }
113
99
  },
114
100
  [
115
- r,
116
- h,
101
+ e,
102
+ s,
103
+ c,
117
104
  u,
118
- f,
119
- _,
105
+ C,
120
106
  t
121
107
  ]
122
- ), ce = a(() => {
123
- O(!0);
124
- }, []), ae = a(() => {
125
- O(!1);
126
- }, []), se = [
127
- {
128
- id: "teacher-card-view",
129
- label: c ? "Review" : "View",
130
- icon: B,
131
- disabled: !1,
132
- onClick: p
133
- },
134
- {
135
- id: "teacher-card-unassign",
136
- label: "Unassign",
137
- icon: xe,
138
- disabled: s ? l === "MASTERY" : !ne,
139
- onClick: p
140
- }
141
- ], le = [
142
- {
143
- id: "student-card-view",
144
- label: "Review",
145
- icon: B,
146
- disabled: !c,
147
- onClick: p
148
- },
149
- {
150
- id: "student-card-reattempt",
151
- label: "Reattempt",
152
- icon: me,
153
- disabled: !ie,
154
- onClick: p
155
- }
156
- ];
157
- return /* @__PURE__ */ n(Ce, { $position: "relative", $width: "fit-content", children: [
158
- /* @__PURE__ */ e(
159
- we,
108
+ );
109
+ return /* @__PURE__ */ g(Q, { $position: "relative", $width: "fit-content", children: [
110
+ /* @__PURE__ */ r(
111
+ L,
160
112
  {
161
- onClick: T ? oe : _,
113
+ onClick: b ? Y : C,
162
114
  label: "homework-card",
163
- children: /* @__PURE__ */ n(
164
- i,
115
+ children: /* @__PURE__ */ r(
116
+ Z,
165
117
  {
166
- ref: k,
167
- $widthX: 12.38,
168
- $position: "relative",
169
- $background: `${x || "ORANGE"}_2`,
170
- onMouseEnter: ce,
171
- onMouseLeave: ae,
172
- children: [
173
- /* @__PURE__ */ n(
174
- ke,
175
- {
176
- $flexDirection: "row",
177
- $alignItems: "center",
178
- $width: "100%",
179
- $heightX: 3.5,
180
- $bgImage: Z,
181
- $gutterX: 0.78125,
182
- $flexGap: 8.5,
183
- $position: "relative",
184
- children: [
185
- /* @__PURE__ */ e(
186
- Te,
187
- {
188
- $width: 31,
189
- $height: 31,
190
- $borderRadiusX: 2,
191
- $background: "WHITE_1",
192
- $position: "relative",
193
- $alignItems: "center",
194
- $justifyContent: "center",
195
- children: Q ? /* @__PURE__ */ e(be, { src: D }) : /* @__PURE__ */ e(U, { width: 20, height: 20 })
196
- }
197
- ),
198
- l === "MASTERY" ? /* @__PURE__ */ n(i, { children: [
199
- /* @__PURE__ */ e(i, { $background: "BLACK_T_60", $width: "fit-content", $gutterX: 0.25, children: /* @__PURE__ */ e(I, { $color: "WHITE", $renderAs: "ac4-black", children: "Smart" }) }),
200
- /* @__PURE__ */ e(I, { $renderAs: "ac4-black", children: "Practice" })
201
- ] }) : /* @__PURE__ */ e(I, { $renderAs: "ac4-black", children: q }),
202
- !!y && /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ e(Ee, { src: y, alt: "Chapter image" }) })
203
- ]
204
- }
205
- ),
206
- /* @__PURE__ */ e(
207
- fe,
208
- {
209
- nodeType: l,
210
- state: v,
211
- accuracy: Y,
212
- dueDateTs: b
213
- }
214
- ),
215
- b && A && /* @__PURE__ */ e(
216
- ge,
217
- {
218
- dueDate: b * 1e3,
219
- unlockedOn: A * 1e3,
220
- progressBg: `${x || "ORANGE"}_4`
221
- }
222
- ),
223
- /* @__PURE__ */ n(i, { $gutterX: 0.75, $gapX: 1, $flexRowGapX: 0.5, $background: "WHITE", children: [
224
- /* @__PURE__ */ e(
225
- V,
226
- {
227
- renderAs: "primary",
228
- position: "bottom",
229
- tooltipItem: R,
230
- width: 300,
231
- hidden: !re,
232
- parentWidth: "auto",
233
- zIndex: 6,
234
- children: /* @__PURE__ */ e(i, { $heightX: 2.5, children: /* @__PURE__ */ e(Ie, { ref: d, $renderAs: "ab3", children: R }) })
235
- }
236
- ),
237
- /* @__PURE__ */ n(
238
- i,
239
- {
240
- $flexDirection: "row",
241
- $heightX: 1.25,
242
- $alignItems: "center",
243
- $justifyContent: "space-between",
244
- children: [
245
- /* @__PURE__ */ e(Re, { $renderAs: "ub3", $color: "BLACK_T_60", children: K }),
246
- /* @__PURE__ */ e(i, { $width: 32 })
247
- ]
248
- }
249
- )
250
- ] })
251
- ]
118
+ header: x,
119
+ isInQueue: k,
120
+ nodeData: e,
121
+ studentContainerRef: w,
122
+ subHeader: M,
123
+ isHomeWork: n
252
124
  }
253
125
  )
254
126
  }
255
127
  ),
256
- T && !s && /* @__PURE__ */ e(
257
- G,
128
+ b && !n && /* @__PURE__ */ r(
129
+ T,
258
130
  {
259
131
  $width: 200,
260
- options: le,
261
- triggerRef: k,
262
- visible: ee,
132
+ options: [
133
+ {
134
+ id: "student-card-view",
135
+ label: "Review",
136
+ icon: R,
137
+ disabled: !o,
138
+ onClick: a
139
+ },
140
+ {
141
+ id: "student-card-reattempt",
142
+ label: "Reattempt",
143
+ icon: J,
144
+ disabled: !K,
145
+ onClick: a
146
+ }
147
+ ],
148
+ triggerRef: w,
149
+ visible: B,
263
150
  shouldOpenOnRight: !1
264
151
  }
265
152
  ),
266
- !T && /* @__PURE__ */ n(ve, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
267
- /* @__PURE__ */ e(
153
+ !b && /* @__PURE__ */ g(U, { $position: "absolute", $width: "fit-content", $borderRadiusX: 2, children: [
154
+ /* @__PURE__ */ r(
268
155
  V,
269
156
  {
270
157
  renderAs: "primary",
@@ -272,32 +159,48 @@ const Ae = ({
272
159
  position: "bottom",
273
160
  zIndex: 6,
274
161
  parentWidth: "100%",
275
- hidden: S || v !== "WAIT_FOR_REVIEW" && s,
276
- children: /* @__PURE__ */ e(
277
- ye,
162
+ hidden: $ || I !== "WAIT_FOR_REVIEW" && n,
163
+ children: /* @__PURE__ */ r(
164
+ D,
278
165
  {
279
166
  $alignItems: "center",
280
167
  $justifyContent: "center",
281
- ref: C,
282
- onClick: N,
283
- children: /* @__PURE__ */ e(he, { width: 16, height: 16 })
168
+ ref: p,
169
+ onClick: F,
170
+ children: /* @__PURE__ */ r(G, { width: 16, height: 16 })
284
171
  }
285
172
  )
286
173
  }
287
174
  ),
288
- /* @__PURE__ */ e(
289
- G,
175
+ /* @__PURE__ */ r(
176
+ T,
290
177
  {
291
- options: se,
292
- triggerRef: C,
293
- visible: S,
294
- shouldOpenOnRight: P
178
+ options: [
179
+ {
180
+ id: "teacher-card-view",
181
+ label: o ? "Review" : "View",
182
+ icon: R,
183
+ disabled: !1,
184
+ onClick: a
185
+ },
186
+ {
187
+ id: "teacher-card-unassign",
188
+ label: "Unassign",
189
+ icon: re,
190
+ disabled: n ? A === "MASTERY" : !z,
191
+ onClick: a
192
+ }
193
+ ],
194
+ triggerRef: p,
195
+ visible: $,
196
+ shouldOpenOnRight: X
295
197
  }
296
198
  )
297
- ] })
199
+ ] }),
200
+ k && /* @__PURE__ */ r(N, { $background: "WHITE_5", children: /* @__PURE__ */ r(ee, { $heightX: 1, $widthX: 6, children: /* @__PURE__ */ r(V, { renderAs: "primary", tooltipItem: "Not visible to student", position: "bottom", children: /* @__PURE__ */ r(P, { $heightX: 1, $widthX: 6 }) }) }) })
298
201
  ] });
299
- }, Je = de(Ae);
202
+ }, be = q(te);
300
203
  export {
301
- Je as default
204
+ be as default
302
205
  };
303
206
  //# sourceMappingURL=homework-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { IHomeworkData } from './hw-card-list/api/get-homeworks';\n\nimport { memo, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport NodeCardTags from '../chapters-v2/comps/node-card/node-card-tags';\nimport { getNodeTypeBasedBgImage } from '../chapters-v2/utils';\nimport { getNodeCardBasedIcon } from '../chapters-v2/utils/node-card-utils';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport LottieAnimation from '../ui/lottie-animation/lottie-animation';\nimport Text from '../ui/text/text';\nimport CardMenuOptions from './card-menu-options';\nimport NodeProgress from './node-progress';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps | IHomeworkData;\n subHeader: string;\n userType: TUserTypes;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n}\n\nconst HomeworkCard = ({\n header,\n nodeData,\n subHeader,\n userType,\n userMilestoneId,\n onNodeUnassign,\n onNodeReattempt,\n onNodeView,\n onNodeReview,\n onNodeAttempt,\n renderAs,\n shouldOpenOnRight,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n accuracy,\n due_date_ts: dueDateTs,\n image_url: imageUrl,\n image_hue: imageHue,\n card_header: cardHeader = '',\n permissions,\n user_node_id: userNodeId,\n unlocked_on_ts: unlockedOnTs,\n user_milestone_id: milestoneId,\n } = nodeData;\n\n const [renderLottie, setRenderLottie] = useState(false);\n const bgImage = getNodeTypeBasedBgImage(nodeType);\n const { icon: NodeCardIcon, lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, userMilestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onNodeReview(nodeData, userMilestoneId || milestoneId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId || milestoneId);\n }, [canReview, userMilestoneId, nodeData, onNodeReview, milestoneId, onNodeView, userNodeId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n userMilestoneId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n setRenderLottie(true);\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n setRenderLottie(false);\n }, []);\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n >\n <FlexView\n ref={studentContainerRef}\n $widthX={12.38}\n $position=\"relative\"\n $background={`${imageHue || 'ORANGE'}_2`}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.CardWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={bgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $position=\"relative\"\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $borderRadiusX={2}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {renderLottie ? (\n <LottieAnimation src={nodeCardLottie} />\n ) : (\n <NodeCardIcon width={20} height={20} />\n )}\n </Styled.IconWrapper>\n {nodeType === 'MASTERY' ? (\n <FlexView>\n <FlexView $background=\"BLACK_T_60\" $width=\"fit-content\" $gutterX={0.25}>\n <Text $color=\"WHITE\" $renderAs=\"ac4-black\">\n Smart\n </Text>\n </FlexView>\n <Text $renderAs=\"ac4-black\">Practice</Text>\n </FlexView>\n ) : (\n <Text $renderAs=\"ac4-black\">{cardHeader}</Text>\n )}\n\n {!!imageUrl && (\n <Styled.BannerImageWrapper>\n <Styled.BannerImage src={imageUrl} alt=\"Chapter image\" />\n </Styled.BannerImageWrapper>\n )}\n </Styled.CardWrapper>\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n dueDateTs={dueDateTs}\n />\n {dueDateTs && unlockedOnTs && (\n <NodeProgress\n dueDate={dueDateTs * 1000}\n unlockedOn={unlockedOnTs * 1000}\n progressBg={`${imageHue || 'ORANGE'}_4`}\n />\n )}\n <FlexView $gutterX={0.75} $gapX={1} $flexRowGapX={0.5} $background=\"WHITE\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={header}\n width={300}\n hidden={!showTitleTooltip}\n parentWidth=\"auto\"\n zIndex={6}\n >\n <FlexView $heightX={2.5}>\n <Styled.HeaderText ref={titleTextRef} $renderAs=\"ab3\">\n {header}\n </Styled.HeaderText>\n </FlexView>\n </ArrowTooltip>\n <FlexView\n $flexDirection=\"row\"\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n >\n <Styled.SubHeaderText $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subHeader}\n </Styled.SubHeaderText>\n <FlexView $width={32} />\n </FlexView>\n </FlexView>\n </FlexView>\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","header","nodeData","subHeader","userType","userMilestoneId","onNodeUnassign","onNodeReattempt","onNodeView","onNodeReview","onNodeAttempt","renderAs","shouldOpenOnRight","isHomeWork","nodeType","state","accuracy","dueDateTs","imageUrl","imageHue","cardHeader","permissions","userNodeId","unlockedOnTs","milestoneId","renderLottie","setRenderLottie","useState","bgImage","getNodeTypeBasedBgImage","NodeCardIcon","nodeCardLottie","getNodeCardBasedIcon","teacherContainerRef","useRef","studentContainerRef","titleTextRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","showTitleTooltip","setShowTitleTooltip","canStart","canResume","canReview","canUnassign","canReset","isStudent","useLayoutEffect","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","handleOnMouseEnter","handleOnMouseLeave","teacherOptions","Eye2Icon","Styled.StyledMinus2Icon","studentOptions","RedoIcon","Styled.CardContainer","jsx","Clickable","jsxs","FlexView","Styled.CardWrapper","Styled.IconWrapper","LottieAnimation","Text","Styled.BannerImageWrapper","Styled.BannerImage","NodeCardTags","NodeProgress","ArrowTooltip","Styled.HeaderText","Styled.SubHeaderText","CardMenuOptions","Styled.MenuWrapper","Styled.Card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gBAAAoD;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,SAASlB;AAAA,QACT,YAAY3B;AAAA,QACZ,SAASK;AAAA,QACT,mBAAmB;AAAA,MAAA;AAAA,IACrB;AAAA,IAED,CAACS,KACA,gBAAAkB,EAACc,IAAA,EAAmB,WAAU,YAAW,QAAO,eAAc,gBAAgB,GAC5E,UAAA;AAAA,MAAA,gBAAAhB;AAAA,QAACY;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,aAAY;AAAA,UACZ,UAAS;AAAA,UACT,QAAQ;AAAA,UACR,aAAY;AAAA,UACZ,QAAQxC,KAAuBtB,MAAU,qBAAqBF;AAAA,UAE9D,UAAA,gBAAAoD;AAAA,YAACiB;AAAAA,YAAA;AAAA,cACC,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,KAAKjD;AAAA,cACL,SAASK;AAAA,cAET,UAAC,gBAAA2B,EAAAkB,IAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAlB;AAAA,QAACe;AAAA,QAAA;AAAA,UACC,SAASrB;AAAA,UACT,YAAY1B;AAAA,UACZ,SAASI;AAAA,UACT,mBAAAzB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEewE,KAAAC,GAAKrF,EAAY;"}
1
+ {"version":3,"file":"homework-card.js","sources":["../../../src/features/homework/homework-card.tsx"],"sourcesContent":["import type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../chapters-v2/comps/node-card/node-card-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { IHomeworkData } from './hw-card-list/api/get-homeworks';\n\nimport { memo, useCallback, useRef } from 'react';\n\nimport Eye2Icon from '../../assets/line-icons/icons/eye2';\nimport MoreVerticalIcon from '../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../ui/arrow-tooltip/arrow-tooltip';\nimport Clickable from '../ui/buttons/clickable/clickable';\nimport useContextMenuClickHandler from '../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../ui/layout/flex-view';\nimport CardMenuOptions from './card-menu-options';\nimport HomeworkView from './homework-card-view';\nimport * as Styled from './styles';\n\ninterface IHomeworkCardProps extends INodeCardCallbacks {\n header: string;\n nodeData: INodeDataProps | IHomeworkData;\n subHeader: string;\n userType: TUserTypes;\n userMilestoneId?: string;\n renderAs: 'homework' | 'milestone';\n shouldOpenOnRight: boolean;\n isInQueue?: boolean;\n}\n\nconst HomeworkCard = ({\n header,\n nodeData,\n subHeader,\n userType,\n userMilestoneId,\n onNodeUnassign,\n onNodeReattempt,\n onNodeView,\n onNodeReview,\n onNodeAttempt,\n renderAs,\n shouldOpenOnRight,\n isInQueue,\n}: IHomeworkCardProps) => {\n const isHomeWork = renderAs === 'homework';\n const {\n node_type: nodeType,\n state,\n permissions,\n user_node_id: userNodeId,\n user_milestone_id: milestoneId,\n } = nodeData;\n\n const teacherContainerRef = useRef<HTMLDivElement>(null);\n const studentContainerRef = useRef<HTMLDivElement>(null);\n const { menuVisible: teacherMenuVisible, onMenuClick: onTeacherMenuClick } =\n useContextMenuClickHandler(teacherContainerRef);\n const { menuVisible: studentMenuVisible, onMenuClick: onStudentMenuClick } =\n useContextMenuClickHandler(studentContainerRef);\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n const isStudent = userType === 'STUDENT';\n\n const onStudentViewSheet = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n onNodeReview(nodeData, userMilestoneId);\n\n return;\n }\n }, [canReview, onNodeReview, userNodeId, nodeData, userMilestoneId]);\n\n const onStudentCardClick = useCallback(() => {\n if (canStart || canResume) {\n if (typeof onNodeAttempt !== 'function') {\n throw new Error('onNodeAttempt must be a function');\n }\n\n onNodeAttempt(nodeData);\n\n return;\n }\n\n if (!isHomeWork) {\n onStudentMenuClick();\n\n return;\n }\n onStudentViewSheet();\n }, [\n canStart,\n canResume,\n isHomeWork,\n onStudentViewSheet,\n onNodeAttempt,\n nodeData,\n onStudentMenuClick,\n ]);\n\n const onTeacherCardClick = useCallback(() => {\n if (canReview) {\n if (typeof onNodeReview !== 'function') {\n throw new Error('onNodeReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onNodeReview(nodeData, userMilestoneId || milestoneId);\n\n return;\n }\n\n if (typeof onNodeView !== 'function') {\n throw new Error('onNodeView must be a function');\n }\n\n onNodeView(nodeData, userMilestoneId || milestoneId);\n }, [canReview, userMilestoneId, nodeData, onNodeReview, milestoneId, onNodeView, userNodeId]);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'teacher-card-view':\n onTeacherCardClick();\n\n return;\n case 'student-card-view':\n onStudentViewSheet();\n\n return;\n case 'teacher-card-unassign':\n onNodeUnassign?.(nodeData, userMilestoneId);\n\n return;\n case 'student-card-reattempt':\n onNodeReattempt?.(nodeData, userMilestoneId);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n nodeData,\n onNodeReattempt,\n onNodeUnassign,\n onStudentViewSheet,\n onTeacherCardClick,\n userMilestoneId,\n ],\n );\n\n const teacherOptions = [\n {\n id: 'teacher-card-view',\n label: canReview ? 'Review' : 'View',\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'teacher-card-unassign',\n label: 'Unassign',\n icon: Styled.StyledMinus2Icon,\n disabled: isHomeWork ? nodeType === 'MASTERY' : !canUnassign,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n const studentOptions = [\n {\n id: 'student-card-view',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'student-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <Styled.CardContainer $position=\"relative\" $width=\"fit-content\">\n <Clickable\n onClick={isStudent ? onStudentCardClick : onTeacherCardClick}\n label=\"homework-card\"\n >\n <HomeworkView\n header={header}\n isInQueue={isInQueue}\n nodeData={nodeData}\n studentContainerRef={studentContainerRef}\n subHeader={subHeader}\n isHomeWork={isHomeWork}\n />\n </Clickable>\n {isStudent && !isHomeWork && (\n <CardMenuOptions\n $width={200}\n options={studentOptions}\n triggerRef={studentContainerRef}\n visible={studentMenuVisible}\n shouldOpenOnRight={false}\n />\n )}\n {!isStudent && (\n <Styled.MenuWrapper $position=\"absolute\" $width=\"fit-content\" $borderRadiusX={2}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Review\"\n position=\"bottom\"\n zIndex={6}\n parentWidth=\"100%\"\n hidden={teacherMenuVisible || (state !== 'WAIT_FOR_REVIEW' && isHomeWork)}\n >\n <Styled.CardKebabMenuWrapper\n $alignItems=\"center\"\n $justifyContent=\"center\"\n ref={teacherContainerRef}\n onClick={onTeacherMenuClick}\n >\n <MoreVerticalIcon width={16} height={16} />\n </Styled.CardKebabMenuWrapper>\n </ArrowTooltip>\n <CardMenuOptions\n options={teacherOptions}\n triggerRef={teacherContainerRef}\n visible={teacherMenuVisible}\n shouldOpenOnRight={shouldOpenOnRight}\n />\n </Styled.MenuWrapper>\n )}\n {isInQueue && (\n <Styled.BlurContainer $background=\"WHITE_5\">\n <Styled.BlurFlexView $heightX={1} $widthX={6}>\n <ArrowTooltip renderAs=\"primary\" tooltipItem=\"Not visible to student\" position=\"bottom\">\n <FlexView $heightX={1} $widthX={6} />\n </ArrowTooltip>\n </Styled.BlurFlexView>\n </Styled.BlurContainer>\n )}\n </Styled.CardContainer>\n );\n};\n\nexport default memo(HomeworkCard);\n"],"names":["HomeworkCard","header","nodeData","subHeader","userType","userMilestoneId","onNodeUnassign","onNodeReattempt","onNodeView","onNodeReview","onNodeAttempt","renderAs","shouldOpenOnRight","isInQueue","isHomeWork","nodeType","state","permissions","userNodeId","milestoneId","teacherContainerRef","useRef","studentContainerRef","teacherMenuVisible","onTeacherMenuClick","useContextMenuClickHandler","studentMenuVisible","onStudentMenuClick","canStart","canResume","canReview","canUnassign","canReset","isStudent","onStudentViewSheet","useCallback","onStudentCardClick","onTeacherCardClick","handleOnMenuOptionClick","optionId","Styled.CardContainer","jsx","Clickable","HomeworkView","CardMenuOptions","Eye2Icon","RedoIcon","jsxs","Styled.MenuWrapper","ArrowTooltip","Styled.CardKebabMenuWrapper","MoreVerticalIcon","Styled.StyledMinus2Icon","Styled.BlurContainer","Styled.BlurFlexView","FlexView","HomeworkCard$1","memo"],"mappings":";;;;;;;;;;;;AA+BA,MAAMA,KAAe,CAAC;AAAA,EACpB,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,MAA0B;AACxB,QAAMC,IAAaH,MAAa,YAC1B;AAAA,IACJ,WAAWI;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,EACjB,IAAAjB,GAEEkB,IAAsBC,EAAuB,IAAI,GACjDC,IAAsBD,EAAuB,IAAI,GACjD,EAAE,aAAaE,GAAoB,aAAaC,MACpDC,EAA2BL,CAAmB,GAC1C,EAAE,aAAaM,GAAoB,aAAaC,MACpDF,EAA2BH,CAAmB,GAE1C;AAAA,IACJ,WAAWM;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ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styled-components";
1
+ import o, { css as n } from "styled-components";
2
2
  import e from "../../ui/layout/flex-view.js";
3
- const s = t(e)`
3
+ import i from "../../ui/text/text.js";
4
+ const l = o(e)`
4
5
  overflow-x: hidden;
5
6
  overflow-y: visible;
6
7
  padding: 16px 0px 92px 0px;
7
8
  margin-bottom: -92px;
8
9
  margin-top: -16px;
9
- `, l = t(e)`
10
- right: ${({ right: o }) => o};
11
- left: ${({ left: o }) => o};
10
+ `, c = o(e)`
11
+ right: ${({ right: t }) => t};
12
+ left: ${({ left: t }) => t};
12
13
  width: 32px;
13
14
  cursor: pointer;
14
15
  transition: opacity 0.3s ease-in-out;
15
- opacity: ${({ $visible: o }) => o ? 1 : 0};
16
- pointer-events: ${({ $visible: o }) => o ? "auto" : "none"};
16
+ opacity: ${({ $visible: t }) => t ? 1 : 0};
17
+ pointer-events: ${({ $visible: t }) => t ? "auto" : "none"};
17
18
  z-index: 10;
18
19
  path {
19
- fill: ${({ theme: o }) => o.colors.WHITE};
20
+ fill: ${({ theme: t }) => t.colors.WHITE};
20
21
  }
21
- `, a = t(e)(
22
- ({ $disablePointerEvents: o, theme: n }) => `
22
+ `, x = o(e)(
23
+ ({ $disablePointerEvents: t, theme: r }) => `
23
24
  position: relative;
24
25
  pointer-events: auto;
25
- ${o && i`
26
+ ${t && n`
26
27
  pointer-events: none;
27
28
  :after {
28
29
  content: '';
@@ -31,22 +32,40 @@ const s = t(e)`
31
32
  left: 0;
32
33
  right: 0;
33
34
  bottom: 0;
34
- background: ${n.colors.GREY_3};
35
+ background: ${r.colors.GREY_3};
35
36
  }
36
37
  `}
37
38
  `
38
- ), c = t(e)`
39
+ ), d = o(i)`
40
+ writing-mode: sideways-lr;
41
+ `, g = o(e)`
42
+ position: relative;
43
+
44
+ &::after {
45
+ content: '';
46
+ position: absolute;
47
+ height: 8px;
48
+ width: 8px;
49
+ clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
50
+ background-color: ${({ theme: t }) => t.colors.BLACK_4};
51
+ top: 50%;
52
+ right: 0;
53
+ transform: translate(50%, calc(-50% + 0px)) rotate(225deg);
54
+ }
55
+ `, u = o(e)`
39
56
  cursor: pointer;
40
57
  height: 100%;
41
- right: ${({ right: o }) => o};
42
- left: ${({ left: o }) => o};
58
+ right: ${({ right: t }) => t};
59
+ left: ${({ left: t }) => t};
43
60
  pointer-events: all;
44
61
  z-index: 5;
45
62
  `;
46
63
  export {
47
- a as ContentWrapper,
48
- c as HoverZone,
49
- l as ScrollButton,
50
- s as ScrollContainer
64
+ x as ContentWrapper,
65
+ u as HoverZone,
66
+ d as QueueText,
67
+ g as QueueWrapper,
68
+ c as ScrollButton,
69
+ l as ScrollContainer
51
70
  };
52
71
  //# sourceMappingURL=hw-card-list-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hw-card-list-styled.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\n\nexport const ScrollContainer = styled(FlexView)`\n overflow-x: hidden;\n overflow-y: visible;\n padding: 16px 0px 92px 0px;\n margin-bottom: -92px;\n margin-top: -16px;\n`;\n\nexport const ScrollButton = styled(FlexView)<{ $visible: boolean; right: string; left: string }>`\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n width: 32px;\n cursor: pointer;\n transition: opacity 0.3s ease-in-out;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n pointer-events: ${({ $visible }) => ($visible ? 'auto' : 'none')};\n z-index: 10;\n path {\n fill: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents, theme }) => `\n position: relative;\n pointer-events: auto;\n ${\n $disablePointerEvents &&\n css`\n pointer-events: none;\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: ${theme.colors.GREY_3};\n }\n `\n }\n `,\n);\n\nexport const HoverZone = styled(FlexView)<{ right: string; left: string }>`\n cursor: pointer;\n height: 100%;\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n pointer-events: all;\n z-index: 5;\n`;\n"],"names":["ScrollContainer","styled","FlexView","ScrollButton","right","left","$visible","theme","ContentWrapper","$disablePointerEvents","css","HoverZone"],"mappings":";;AAIa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAeF,EAAOC,CAAQ;AAAA,WAChC,CAAC,EAAE,OAAAE,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;AAAA,aAIf,CAAC,EAAE,UAAAC,EAAA,MAAgBA,IAAW,IAAI,CAAE;AAAA,oBAC7B,CAAC,EAAE,UAAAA,EAAA,MAAgBA,IAAW,SAAS,MAAO;AAAA;AAAA;AAAA,YAGtD,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIhCC,IAAiBP,EAAOC,CAAQ;AAAA,EAC3C,CAAC,EAAE,uBAAAO,GAAuB,OAAAF,EAAA,MAAY;AAAA;AAAA;AAAA,MAIlCE,KACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASkBH,EAAM,OAAO,MAAM;AAAA;AAAA,OAGvC;AAAA;AAEJ,GAEaI,IAAYV,EAAOC,CAAQ;AAAA;AAAA;AAAA,WAG7B,CAAC,EAAE,OAAAE,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"hw-card-list-styled.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\n\nexport const ScrollContainer = styled(FlexView)`\n overflow-x: hidden;\n overflow-y: visible;\n padding: 16px 0px 92px 0px;\n margin-bottom: -92px;\n margin-top: -16px;\n`;\n\nexport const ScrollButton = styled(FlexView)<{ $visible: boolean; right: string; left: string }>`\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n width: 32px;\n cursor: pointer;\n transition: opacity 0.3s ease-in-out;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n pointer-events: ${({ $visible }) => ($visible ? 'auto' : 'none')};\n z-index: 10;\n path {\n fill: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents, theme }) => `\n position: relative;\n pointer-events: auto;\n ${\n $disablePointerEvents &&\n css`\n pointer-events: none;\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: ${theme.colors.GREY_3};\n }\n `\n }\n `,\n);\n\nexport const QueueText = styled(Text)`\n writing-mode: sideways-lr;\n`;\n\nexport const QueueWrapper = styled(FlexView)`\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n height: 8px;\n width: 8px;\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n background-color: ${({ theme }) => theme.colors.BLACK_4};\n top: 50%;\n right: 0;\n transform: translate(50%, calc(-50% + 0px)) rotate(225deg);\n }\n`;\nexport const HoverZone = styled(FlexView)<{ right: string; left: string }>`\n cursor: pointer;\n height: 100%;\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n pointer-events: all;\n z-index: 5;\n`;\n"],"names":["ScrollContainer","styled","FlexView","ScrollButton","right","left","$visible","theme","ContentWrapper","$disablePointerEvents","css","QueueText","Text","QueueWrapper","HoverZone"],"mappings":";;;AAKa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAeF,EAAOC,CAAQ;AAAA,WAChC,CAAC,EAAE,OAAAE,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;AAAA,aAIf,CAAC,EAAE,UAAAC,EAAA,MAAgBA,IAAW,IAAI,CAAE;AAAA,oBAC7B,CAAC,EAAE,UAAAA,EAAA,MAAgBA,IAAW,SAAS,MAAO;AAAA;AAAA;AAAA,YAGtD,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIhCC,IAAiBP,EAAOC,CAAQ;AAAA,EAC3C,CAAC,EAAE,uBAAAO,GAAuB,OAAAF,EAAA,MAAY;AAAA;AAAA;AAAA,MAIlCE,KACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASkBH,EAAM,OAAO,MAAM;AAAA;AAAA,OAGvC;AAAA;AAEJ,GAEaI,IAAYV,EAAOW,CAAI;AAAA;AAAA,GAIvBC,IAAeZ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASnB,CAAC,EAAE,OAAAK,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAM9CO,IAAYb,EAAOC,CAAQ;AAAA;AAAA;AAAA,WAG7B,CAAC,EAAE,OAAAE,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;"}