@pie-element/match 13.0.2-next.20261007003844 → 13.0.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.
@@ -1,10 +1,10 @@
1
1
  import { o as e } from "../browser-jJGxjKdp.js";
2
- import { A as t, B as n, Ht as r, O as i, St as a, a as o, bt as s, d as c, f as l, k as u, n as ee, p as te, r as ne, t as d, u as f, wt as p, x as m, xt as h } from "../Typography-Dbijy3Wq.js";
3
- import g, { useRef as re } from "react";
4
- import { createRoot as ie } from "react-dom/client";
2
+ import { A as t, B as n, Ct as r, O as i, St as a, Tt as o, Ut as s, a as c, bt as l, d as u, f as ee, k as d, n as f, p as te, r as ne, t as re, u as p, x as ie, xt as m } from "../Typography-DrUWMCh4.js";
3
+ import h, { useRef as g } from "react";
4
+ import { createRoot as ae } from "react-dom/client";
5
5
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
6
6
  //#region ../../lib-react/correct-answer-toggle/dist/expander.js
7
- var y = /* @__PURE__ */ e(r(), 1), b = "height ease-in 300ms, opacity ease-in 300ms", ae = p("div")(() => ({
7
+ var y = /* @__PURE__ */ e(s(), 1), b = "height ease-in 300ms, opacity ease-in 300ms", oe = o("div")(() => ({
8
8
  position: "relative",
9
9
  height: 0,
10
10
  overflow: "hidden",
@@ -39,9 +39,9 @@ var y = /* @__PURE__ */ e(r(), 1), b = "height ease-in 300ms, opacity ease-in 30
39
39
  width: 0
40
40
  }
41
41
  })), x = (e) => {
42
- let { show: t, children: n, className: r } = e, i = re(null);
43
- return /* @__PURE__ */ _(a, {
44
- nodeRef: i,
42
+ let { show: t, children: n, className: i } = e, a = g(null);
43
+ return /* @__PURE__ */ _(r, {
44
+ nodeRef: a,
45
45
  in: t,
46
46
  appear: !0,
47
47
  mountOnEnter: !1,
@@ -52,9 +52,9 @@ var y = /* @__PURE__ */ e(r(), 1), b = "height ease-in 300ms, opacity ease-in 30
52
52
  exit: "exit",
53
53
  exitDone: "exit-done"
54
54
  },
55
- children: /* @__PURE__ */ _(ae, {
56
- ref: i,
57
- className: r,
55
+ children: /* @__PURE__ */ _(oe, {
56
+ ref: a,
57
+ className: i,
58
58
  children: n
59
59
  })
60
60
  });
@@ -141,7 +141,7 @@ C.propTypes = {
141
141
  fgFill: y.default.string.isRequired,
142
142
  borderFill: y.default.string.isRequired
143
143
  };
144
- var w = p("div")(({ size: e }) => ({
144
+ var w = o("div")(({ size: e }) => ({
145
145
  width: e || "25px",
146
146
  height: e || "25px"
147
147
  })), T = ({ open: e, size: t }) => /* @__PURE__ */ _(w, {
@@ -167,17 +167,17 @@ function E(e) {
167
167
  function D(e, t) {
168
168
  return !e || E(e) ? e : E(e.default) ? e.default : t && E(e[t]) ? e[t] : t && E(e[t]?.default) ? e[t].default : e;
169
169
  }
170
- var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe = A && typeof A == "object" ? A : k, { translator: j } = u, se = {
170
+ var se = D(ee, "Readable") || D(ce.Readable, "Readable"), O = c, k = O.default, ce = k && typeof k == "object" ? k : O, { translator: A } = d, j = {
171
171
  WebkitTouchCallout: "none",
172
172
  WebkitUserSelect: "none",
173
173
  KhtmlUserSelect: "none",
174
174
  MozUserSelect: "none",
175
175
  msUserSelect: "none",
176
176
  userSelect: "none"
177
- }, ce = p("div")(() => ({
177
+ }, le = o("div")(() => ({
178
178
  width: "100%",
179
179
  cursor: "pointer"
180
- })), le = p("button")(() => ({
180
+ })), M = o("button")(() => ({
181
181
  margin: "0 auto",
182
182
  textAlign: "center",
183
183
  display: "flex",
@@ -190,18 +190,18 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
190
190
  font: "inherit",
191
191
  cursor: "pointer",
192
192
  "&:focus-visible": {
193
- outline: `2px solid ${h.buttonFocusOutline()}`,
193
+ outline: `2px solid ${a.buttonFocusOutline()}`,
194
194
  outlineOffset: "-2px"
195
195
  }
196
- })), ue = p("div")(() => ({
196
+ })), N = o("div")(() => ({
197
197
  width: "fit-content",
198
198
  minWidth: "140px",
199
199
  alignSelf: "center",
200
200
  verticalAlign: "middle",
201
- color: `var(--correct-answer-toggle-label-color, ${h.text()})`,
201
+ color: `var(--correct-answer-toggle-label-color, ${a.text()})`,
202
202
  fontWeight: "normal",
203
- ...se
204
- })), M = p("div")(() => ({
203
+ ...j
204
+ })), P = o("div")(() => ({
205
205
  position: "absolute",
206
206
  width: "25px",
207
207
  "&.enter": { opacity: "0" },
@@ -214,12 +214,12 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
214
214
  opacity: "0",
215
215
  transition: "opacity 0.3s ease-in"
216
216
  }
217
- })), N = p("div")(() => ({
217
+ })), F = o("div")(() => ({
218
218
  width: "25px",
219
219
  marginRight: "5px",
220
220
  display: "flex",
221
221
  alignItems: "center"
222
- })), P = class e extends g.Component {
222
+ })), I = class e extends h.Component {
223
223
  static propTypes = {
224
224
  onToggle: y.default.func,
225
225
  toggled: y.default.bool,
@@ -236,10 +236,10 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
236
236
  toggled: !1
237
237
  };
238
238
  constructor(t) {
239
- super(t), this.state = { show: t.show }, this.openIconRef = g.createRef(), this.closedIconRef = g.createRef(), e.defaultProps = {
239
+ super(t), this.state = { show: t.show }, this.openIconRef = h.createRef(), this.closedIconRef = h.createRef(), e.defaultProps = {
240
240
  ...e.defaultProps,
241
- showMessage: j.t("common:showCorrectAnswer", { lng: t.language }),
242
- hideMessage: j.t("common:hideCorrectAnswer", { lng: t.language })
241
+ showMessage: A.t("common:showCorrectAnswer", { lng: t.language }),
242
+ hideMessage: A.t("common:hideCorrectAnswer", { lng: t.language })
243
243
  };
244
244
  }
245
245
  onClick() {
@@ -251,22 +251,22 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
251
251
  UNSAFE_componentWillReceiveProps(t) {
252
252
  this.setState({ show: t.show }), t.language !== this.props?.language && (e.defaultProps = {
253
253
  ...e.defaultProps,
254
- showMessage: j.t("common:showCorrectAnswer", { lng: t.language }),
255
- hideMessage: j.t("common:hideCorrectAnswer", { lng: t.language })
254
+ showMessage: A.t("common:showCorrectAnswer", { lng: t.language }),
255
+ hideMessage: A.t("common:hideCorrectAnswer", { lng: t.language })
256
256
  });
257
257
  }
258
258
  render() {
259
- let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
260
- return /* @__PURE__ */ _(ce, {
259
+ let { className: e, toggled: t, hideMessage: n, showMessage: i } = this.props;
260
+ return /* @__PURE__ */ _(le, {
261
261
  className: e,
262
262
  children: /* @__PURE__ */ _(x, {
263
263
  show: this.state.show,
264
- children: /* @__PURE__ */ v(le, {
264
+ children: /* @__PURE__ */ v(M, {
265
265
  type: "button",
266
266
  "aria-pressed": !!t,
267
267
  onClick: this.onClick.bind(this),
268
268
  onTouchEnd: this.onTouch.bind(this),
269
- children: [/* @__PURE__ */ v(N, { children: [/* @__PURE__ */ _(a, {
269
+ children: [/* @__PURE__ */ v(F, { children: [/* @__PURE__ */ _(r, {
270
270
  nodeRef: this.openIconRef,
271
271
  timeout: 400,
272
272
  in: t,
@@ -277,11 +277,11 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
277
277
  exit: "exit",
278
278
  exitActive: "exit-active"
279
279
  },
280
- children: /* @__PURE__ */ _(M, {
280
+ children: /* @__PURE__ */ _(P, {
281
281
  ref: this.openIconRef,
282
282
  children: /* @__PURE__ */ _(T, { open: t }, "correct-open")
283
283
  })
284
- }), /* @__PURE__ */ _(a, {
284
+ }), /* @__PURE__ */ _(r, {
285
285
  nodeRef: this.closedIconRef,
286
286
  timeout: 5e3,
287
287
  in: !t,
@@ -292,40 +292,40 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
292
292
  exit: "exit",
293
293
  exitActive: "exit-active"
294
294
  },
295
- children: /* @__PURE__ */ _(M, {
295
+ children: /* @__PURE__ */ _(P, {
296
296
  ref: this.closedIconRef,
297
297
  children: /* @__PURE__ */ _(T, { open: t }, "correct-closed")
298
298
  })
299
- })] }), /* @__PURE__ */ _(O, {
299
+ })] }), /* @__PURE__ */ _(se, {
300
300
  false: !0,
301
- children: /* @__PURE__ */ _(ue, {
301
+ children: /* @__PURE__ */ _(N, {
302
302
  "aria-hidden": !this.state.show,
303
- children: t ? n : r
303
+ children: t ? n : i
304
304
  })
305
305
  })]
306
306
  })
307
307
  })
308
308
  });
309
309
  }
310
- }, F = p("div")(({ theme: e }) => ({
310
+ }, L = o("div")(({ theme: e }) => ({
311
311
  marginLeft: "auto",
312
312
  marginRight: "auto",
313
313
  marginTop: e.spacing(1),
314
314
  marginBottom: e.spacing(1)
315
- })), I = p("td")({ padding: "5px 0" }), L = p(d)(({ theme: e }) => ({ margin: e.spacing(2) })), R = p("th")({ padding: 0 }), z = p("div")(({ theme: e, isQuestionText: t }) => ({
315
+ })), R = o("td")({ padding: "5px 0" }), z = o(re)(({ theme: e }) => ({ margin: e.spacing(2) })), B = o("th")({ padding: 0 }), V = o("div")(({ theme: e, isQuestionText: t }) => ({
316
316
  padding: e.spacing(1.5),
317
317
  textAlign: t ? "left" : "center"
318
- })), B = p("tr")({
318
+ })), H = o("tr")({
319
319
  border: 0,
320
- borderTop: `2.5px solid ${h.primaryLight()}`,
320
+ borderTop: `2.5px solid ${a.primaryLight()}`,
321
321
  width: "100%"
322
- }), V = p("table")({
323
- color: h.text(),
324
- backgroundColor: h.background(),
322
+ }), U = o("table")({
323
+ color: a.text(),
324
+ backgroundColor: a.background(),
325
325
  borderCollapse: "collapse",
326
326
  borderSpacing: 0,
327
327
  marginBottom: 0
328
- }), H = class extends g.Component {
328
+ }), ue = class extends h.Component {
329
329
  static propTypes = {
330
330
  correctAnswers: y.default.object,
331
331
  view: y.default.bool.isRequired,
@@ -352,53 +352,53 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
352
352
  return r[e][n] === !0 && t === !1 || r[e][n] === !1 && t === !0;
353
353
  };
354
354
  controlColor = (e, t, n) => {
355
- let { showCorrect: r, disabled: i, view: a } = this.props, o = i && !a;
356
- return r && t === !0 || o && this.answerIsCorrect(e, t, n) ? h.correct() : o && this.answerIsIncorrect(e, t, n) ? h.incorrect() : t === !0 && !o ? h.primary() : i ? h.disabled() : h.text();
355
+ let { showCorrect: r, disabled: i, view: o } = this.props, s = i && !o;
356
+ return r && t === !0 || s && this.answerIsCorrect(e, t, n) ? a.correct() : s && this.answerIsIncorrect(e, t, n) ? a.incorrect() : t === !0 && !s ? a.primary() : i ? a.disabled() : a.text();
357
357
  };
358
358
  render() {
359
- let { headers: e, rows: t, choiceMode: n, answers: r, disabled: i } = this.props, a = n === "radio" ? ne : ee, o = (e) => `${this.instanceId}-header-${e}`, s = (e) => `${this.instanceId}-row-${e}`, c = (e) => n === "radio" ? `${this.instanceId}-row-${e}-choice` : void 0;
360
- return !t || t.length === 0 ? /* @__PURE__ */ _(F, { children: /* @__PURE__ */ _(L, {
359
+ let { headers: e, rows: t, choiceMode: n, answers: r, disabled: i } = this.props, o = n === "radio" ? ne : f, s = (e) => `${this.instanceId}-header-${e}`, c = (e) => `${this.instanceId}-row-${e}`, l = (e) => n === "radio" ? `${this.instanceId}-row-${e}-choice` : void 0;
360
+ return !t || t.length === 0 ? /* @__PURE__ */ _(L, { children: /* @__PURE__ */ _(z, {
361
361
  component: "div",
362
362
  children: "There are currently no questions to show."
363
- }) }) : /* @__PURE__ */ _(F, { children: /* @__PURE__ */ v(V, { children: [
363
+ }) }) : /* @__PURE__ */ _(L, { children: /* @__PURE__ */ v(U, { children: [
364
364
  /* @__PURE__ */ _("colgroup", { children: (e || []).map((e, t) => /* @__PURE__ */ _("col", {}, `col-${t}`)) }),
365
- /* @__PURE__ */ _("thead", { children: /* @__PURE__ */ _("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ _(R, {
366
- id: o(t),
365
+ /* @__PURE__ */ _("thead", { children: /* @__PURE__ */ _("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ _(B, {
366
+ id: s(t),
367
367
  "data-colno": `${t}`,
368
368
  scope: "col",
369
- children: /* @__PURE__ */ _(z, {
369
+ children: /* @__PURE__ */ _(V, {
370
370
  isQuestionText: t === 0,
371
- dangerouslySetInnerHTML: { __html: e }
371
+ dangerouslySetInnerHTML: { __html: m(e) }
372
372
  })
373
373
  }, `th-${t}`)) }) }),
374
374
  (t || []).map((e, t) => /* @__PURE__ */ _("tbody", {
375
375
  role: n === "radio" ? "radiogroup" : "group",
376
- "aria-labelledby": s(t),
377
- children: /* @__PURE__ */ v(B, { children: [/* @__PURE__ */ _("td", {
378
- id: s(t),
376
+ "aria-labelledby": c(t),
377
+ children: /* @__PURE__ */ v(H, { children: [/* @__PURE__ */ _("td", {
378
+ id: c(t),
379
379
  "data-colno": "0",
380
- children: /* @__PURE__ */ _(z, {
380
+ children: /* @__PURE__ */ _(V, {
381
381
  isQuestionText: !0,
382
- dangerouslySetInnerHTML: { __html: e.title }
382
+ dangerouslySetInnerHTML: { __html: m(e.title) }
383
383
  })
384
384
  }, `td-title-${t}`), (r[e.id] || []).map((n, r) => {
385
- let l = this.controlColor(e.id, n, r);
386
- return /* @__PURE__ */ _(I, {
385
+ let u = this.controlColor(e.id, n, r);
386
+ return /* @__PURE__ */ _(R, {
387
387
  "data-colno": `${r + 1}`,
388
- children: /* @__PURE__ */ _(z, { children: /* @__PURE__ */ _(a, {
388
+ children: /* @__PURE__ */ _(V, { children: /* @__PURE__ */ _(o, {
389
389
  sx: {
390
390
  padding: "6px",
391
- color: l,
392
- "&&.Mui-checked": { color: l },
393
- "&&.Mui-disabled": { color: l },
391
+ color: u,
392
+ "&&.Mui-checked": { color: u },
393
+ "&&.Mui-disabled": { color: u },
394
394
  cursor: i ? "not-allowed" : "pointer",
395
395
  pointerEvents: i ? "initial" : "auto",
396
396
  opacity: i ? .7 : 1,
397
397
  "& input": { width: "100% !important" },
398
- "&&:hover:not(.Mui-disabled)": { color: h.primaryLight() }
398
+ "&&:hover:not(.Mui-disabled)": { color: a.primaryLight() }
399
399
  },
400
- slotProps: { input: { "aria-labelledby": `${s(t)} ${o(r + 1)}` } },
401
- name: c(t),
400
+ slotProps: { input: { "aria-labelledby": `${c(t)} ${s(r + 1)}` } },
401
+ name: l(t),
402
402
  disabled: i,
403
403
  onChange: this.onRowValueChange(e.id, r),
404
404
  checked: n === !0
@@ -411,13 +411,13 @@ var O = D(l, "Readable") || D(oe.Readable, "Readable"), k = o, A = k.default, oe
411
411
  };
412
412
  //#endregion
413
413
  //#region src/delivery/main.tsx
414
- function U(e) {
414
+ function W(e) {
415
415
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
416
416
  }
417
- function W(e, t) {
418
- return !e || U(e) ? e : U(e.default) ? e.default : t && U(e[t]) ? e[t] : t && U(e[t]?.default) ? e[t].default : e;
417
+ function G(e, t) {
418
+ return !e || W(e) ? e : W(e.default) ? e.default : t && W(e[t]) ? e[t] : t && W(e[t]?.default) ? e[t].default : e;
419
419
  }
420
- var de = W(m, "UiLayout") || W(X.UiLayout, "UiLayout"), G = W(te, "PreviewPrompt") || W(X.PreviewPrompt, "PreviewPrompt"), K = W(s, "Feedback") || W(X.Feedback, "Feedback"), q = W(i, "Collapsible") || W(X.Collapsible, "Collapsible"), J = o, Y = J.default, X = Y && typeof Y == "object" ? Y : J, { translator: Z } = u, fe = p("div")({ verticalAlign: "middle" }), pe = p(q)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Q = class extends g.Component {
420
+ var de = G(ie, "UiLayout") || G(X.UiLayout, "UiLayout"), K = G(te, "PreviewPrompt") || G(X.PreviewPrompt, "PreviewPrompt"), fe = G(l, "Feedback") || G(X.Feedback, "Feedback"), q = G(i, "Collapsible") || G(X.Collapsible, "Collapsible"), J = c, Y = J.default, X = Y && typeof Y == "object" ? Y : J, { translator: Z } = d, pe = o("div")({ verticalAlign: "middle" }), me = o(q)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Q = class extends h.Component {
421
421
  static propTypes = {
422
422
  session: y.default.object.isRequired,
423
423
  onSessionChange: y.default.func,
@@ -468,25 +468,25 @@ var de = W(m, "UiLayout") || W(X.UiLayout, "UiLayout"), G = W(te, "PreviewPrompt
468
468
  } }), this.callOnSessionChange);
469
469
  };
470
470
  render() {
471
- let { model: e } = this.props, { showCorrect: t, session: n } = this.state, { correctness: r = {}, extraCSSRules: i, language: a } = e, o = r.correctness && r.correctness !== "correct", s = e.rationale && (c(e.rationale) || f(e.rationale));
471
+ let { model: e } = this.props, { showCorrect: t, session: n } = this.state, { correctness: r = {}, extraCSSRules: i, language: a } = e, o = r.correctness && r.correctness !== "correct", s = e.rationale && (u(e.rationale) || p(e.rationale));
472
472
  return /* @__PURE__ */ v(de, {
473
473
  extraCSSRules: i,
474
474
  children: [
475
- e.teacherInstructions && (c(e.teacherInstructions) || f(e.teacherInstructions)) && /* @__PURE__ */ _(pe, {
475
+ e.teacherInstructions && (u(e.teacherInstructions) || p(e.teacherInstructions)) && /* @__PURE__ */ _(me, {
476
476
  labels: {
477
477
  hidden: Z.t("common:showTeacherInstructions", { lng: a }),
478
478
  visible: Z.t("common:hideTeacherInstructions", { lng: a })
479
479
  },
480
- children: /* @__PURE__ */ _(G, { prompt: e.teacherInstructions })
480
+ children: /* @__PURE__ */ _(K, { prompt: e.teacherInstructions })
481
481
  }),
482
- e.prompt && /* @__PURE__ */ _(fe, { children: /* @__PURE__ */ _(G, { prompt: e.prompt }) }),
483
- /* @__PURE__ */ _(P, {
482
+ e.prompt && /* @__PURE__ */ _(pe, { children: /* @__PURE__ */ _(K, { prompt: e.prompt }) }),
483
+ /* @__PURE__ */ _(I, {
484
484
  language: a,
485
485
  show: o,
486
486
  toggled: t,
487
487
  onToggle: this.toggleShowCorrect
488
488
  }),
489
- /* @__PURE__ */ _(H, {
489
+ /* @__PURE__ */ _(ue, {
490
490
  showCorrect: t,
491
491
  correctAnswers: e.correctResponse,
492
492
  disabled: e.disabled,
@@ -502,9 +502,9 @@ var de = W(m, "UiLayout") || W(X.UiLayout, "UiLayout"), G = W(te, "PreviewPrompt
502
502
  hidden: Z.t("common:showRationale", { lng: a }),
503
503
  visible: Z.t("common:hideRationale", { lng: a })
504
504
  },
505
- children: /* @__PURE__ */ _(G, { prompt: e.rationale })
505
+ children: /* @__PURE__ */ _(K, { prompt: e.rationale })
506
506
  }),
507
- e.feedback && /* @__PURE__ */ _(K, {
507
+ e.feedback && /* @__PURE__ */ _(fe, {
508
508
  correctness: r.correctness,
509
509
  feedback: e.feedback
510
510
  })
@@ -528,7 +528,7 @@ var de = W(m, "UiLayout") || W(X.UiLayout, "UiLayout"), G = W(te, "PreviewPrompt
528
528
  }), this.component = t, this.complete = n;
529
529
  }
530
530
  });
531
- var me = class e extends CustomEvent {
531
+ var he = class e extends CustomEvent {
532
532
  static {
533
533
  this.TYPE = "session-changed";
534
534
  }
@@ -546,7 +546,7 @@ var me = class e extends CustomEvent {
546
546
  if (!t) return !1;
547
547
  let r = e.answers && e.answers[n];
548
548
  return Array.isArray(r) && r.includes(!0) && t;
549
- }, !0), he = class extends HTMLElement {
549
+ }, !0), ge = class extends HTMLElement {
550
550
  constructor() {
551
551
  super(), this._root = null;
552
552
  }
@@ -565,19 +565,19 @@ var me = class e extends CustomEvent {
565
565
  sessionChanged(e) {
566
566
  this._session.answers = e.answers;
567
567
  let t = $(this._session, this._model);
568
- this.dispatchEvent(new me(this.tagName.toLowerCase(), t)), this._render();
568
+ this.dispatchEvent(new he(this.tagName.toLowerCase(), t)), this._render();
569
569
  }
570
570
  connectedCallback() {
571
571
  this._render();
572
572
  }
573
573
  _render() {
574
574
  if (!this._model || !this._session) return;
575
- let e = g.createElement(Q, {
575
+ let e = h.createElement(Q, {
576
576
  model: this._model,
577
577
  session: this._session,
578
578
  onSessionChange: this.sessionChanged.bind(this)
579
579
  });
580
- this._root ||= ie(this), this._root.render(e), queueMicrotask(() => {
580
+ this._root ||= ae(this), this._root.render(e), queueMicrotask(() => {
581
581
  t(this);
582
582
  });
583
583
  }
@@ -586,6 +586,6 @@ var me = class e extends CustomEvent {
586
586
  }
587
587
  };
588
588
  //#endregion
589
- export { Q as Component, he as default, $ as isComplete };
589
+ export { Q as Component, ge as default, $ as isComplete };
590
590
 
591
591
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../lib-react/correct-answer-toggle/dist/expander.js","../../../../../../lib-react/icons/dist/correct-response-icon.js","../../../../../../lib-react/correct-answer-toggle/dist/index.js","../../../../src/delivery/answer-grid.tsx","../../../../src/delivery/main.tsx","../../../../../../shared/player-events/dist/index.js","../../../../src/delivery/index.ts"],"sourcesContent":["import { styled as e } from \"@mui/material/styles\";\nimport { CSSTransition as t } from \"react-transition-group\";\nimport { jsx as n } from \"react/jsx-runtime\";\nimport { useRef as r } from \"react\";\nimport i from \"prop-types\";\n//#region src/expander.tsx\nvar a = \"height ease-in 300ms, opacity ease-in 300ms\", o = e(\"div\")(() => ({\n\tposition: \"relative\",\n\theight: 0,\n\toverflow: \"hidden\",\n\tdisplay: \"flex\",\n\tvisibility: \"hidden\",\n\twidth: 0,\n\t\"&.enter\": {\n\t\ttransition: a,\n\t\topacity: 1,\n\t\theight: \"auto\",\n\t\twidth: \"auto\",\n\t\tvisibility: \"visible\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.enter-done\": {\n\t\theight: \"auto\",\n\t\tvisibility: \"visible\",\n\t\twidth: \"auto\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.exit\": {\n\t\ttransition: a,\n\t\topacity: 0,\n\t\theight: 0,\n\t\tvisibility: \"visible\",\n\t\twidth: 0\n\t},\n\t\"&.exit-done\": {\n\t\topacity: 0,\n\t\tvisibility: \"hidden\",\n\t\theight: 0,\n\t\twidth: 0\n\t}\n})), s = (e) => {\n\tlet { show: i, children: a, className: s } = e, c = r(null);\n\treturn /* @__PURE__ */ n(t, {\n\t\tnodeRef: c,\n\t\tin: i,\n\t\tappear: !0,\n\t\tmountOnEnter: !1,\n\t\ttimeout: 300,\n\t\tclassNames: {\n\t\t\tenter: \"enter\",\n\t\t\tenterDone: \"enter-done\",\n\t\t\texit: \"exit\",\n\t\t\texitDone: \"exit-done\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ n(o, {\n\t\t\tref: c,\n\t\t\tclassName: s,\n\t\t\tchildren: a\n\t\t})\n\t});\n};\ns.propTypes = {\n\tshow: i.bool.isRequired,\n\tclassName: i.string,\n\tchildren: i.oneOfType([i.arrayOf(i.node), i.node]).isRequired\n};\n//#endregion\nexport { s as default };\n","import \"react\";\nimport e from \"prop-types\";\nimport { jsx as t, jsxs as n } from \"react/jsx-runtime\";\nimport { styled as r } from \"@mui/material/styles\";\n//#region src/correct-response-icon.tsx\nvar i = ({ bgFill: e, fgFill: r }) => /* @__PURE__ */ n(\"svg\", {\n\t\"aria-hidden\": \"true\",\n\tfocusable: \"false\",\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-283 359 34 35\",\n\tstyle: { enableBackground: \"new -283 359 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-266\",\n\t\t\tcy: \"375.9\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\ni.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired\n};\nvar a = ({ bgFill: e, fgFill: r, borderFill: i }) => /* @__PURE__ */ n(\"svg\", {\n\t\"aria-hidden\": \"true\",\n\tfocusable: \"false\",\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-129.5 127 34 35\",\n\tstyle: { enableBackground: \"new -129.5 127 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#D0CAC5\",\n\t\t\t\tstroke: \"#E6E3E0\",\n\t\t\t\tstrokeWidth: .75,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\\n C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#B3ABA4\",\n\t\t\t\tstroke: \"#CDC7C2\",\n\t\t\t\tstrokeWidth: .5,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-114.2\",\n\t\t\tcy: \"143.5\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\",\n\t\t\tfill: i\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\na.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired,\n\tborderFill: e.string.isRequired\n};\nvar o = r(\"div\")(({ size: e }) => ({\n\twidth: e || \"25px\",\n\theight: e || \"25px\"\n})), s = ({ open: e, size: n }) => /* @__PURE__ */ t(o, {\n\tsize: n,\n\tchildren: e ? /* @__PURE__ */ t(i, {\n\t\tbgFill: \"#bce2ff\",\n\t\tfgFill: \"#1a9cff\"\n\t}) : /* @__PURE__ */ t(a, {\n\t\tbgFill: \"white\",\n\t\tfgFill: \"#1a9cff\",\n\t\tborderFill: \"#bce2ff\"\n\t})\n});\ns.propTypes = {\n\topen: e.bool,\n\tsize: e.string\n}, s.defaultProps = { open: !1 };\n//#endregion\nexport { s as default };\n","import e from \"./expander.js\";\nimport { styled as t } from \"@mui/material/styles\";\nimport { CSSTransition as n } from \"react-transition-group\";\nimport { CorrectResponse as r } from \"@pie-lib/icons\";\nimport * as i from \"@pie-lib/render-ui\";\nimport { Readable as a, color as o } from \"@pie-lib/render-ui\";\nimport { jsx as s, jsxs as c } from \"react/jsx-runtime\";\nimport l from \"react\";\nimport u from \"prop-types\";\nimport d from \"@pie-lib/translator\";\n//#region src/index.tsx\nfunction f(e) {\n\treturn typeof e == \"function\" || typeof e == \"object\" && !!e && typeof e.$$typeof == \"symbol\";\n}\nfunction p(e, t) {\n\treturn !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;\n}\nvar m = p(a, \"Readable\") || p(_.Readable, \"Readable\"), h = i, g = h.default, _ = g && typeof g == \"object\" ? g : h, { translator: v } = d, y = {\n\tWebkitTouchCallout: \"none\",\n\tWebkitUserSelect: \"none\",\n\tKhtmlUserSelect: \"none\",\n\tMozUserSelect: \"none\",\n\tmsUserSelect: \"none\",\n\tuserSelect: \"none\"\n}, b = t(\"div\")(() => ({\n\twidth: \"100%\",\n\tcursor: \"pointer\"\n})), x = t(\"button\")(() => ({\n\tmargin: \"0 auto\",\n\ttextAlign: \"center\",\n\tdisplay: \"flex\",\n\tminWidth: \"24px\",\n\tminHeight: \"24px\",\n\tpadding: 0,\n\tborder: 0,\n\tbackground: \"none\",\n\tcolor: \"inherit\",\n\tfont: \"inherit\",\n\tcursor: \"pointer\",\n\t\"&:focus-visible\": {\n\t\toutline: `2px solid ${o.buttonFocusOutline()}`,\n\t\toutlineOffset: \"-2px\"\n\t}\n})), S = t(\"div\")(() => ({\n\twidth: \"fit-content\",\n\tminWidth: \"140px\",\n\talignSelf: \"center\",\n\tverticalAlign: \"middle\",\n\tcolor: `var(--correct-answer-toggle-label-color, ${o.text()})`,\n\tfontWeight: \"normal\",\n\t...y\n})), C = t(\"div\")(() => ({\n\tposition: \"absolute\",\n\twidth: \"25px\",\n\t\"&.enter\": { opacity: \"0\" },\n\t\"&.enter-active\": {\n\t\topacity: \"1\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t},\n\t\"&.exit\": { opacity: \"1\" },\n\t\"&.exit-active\": {\n\t\topacity: \"0\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t}\n})), w = t(\"div\")(() => ({\n\twidth: \"25px\",\n\tmarginRight: \"5px\",\n\tdisplay: \"flex\",\n\talignItems: \"center\"\n})), T = class t extends l.Component {\n\tstatic propTypes = {\n\t\tonToggle: u.func,\n\t\ttoggled: u.bool,\n\t\tshow: u.bool,\n\t\thideMessage: u.string,\n\t\tshowMessage: u.string,\n\t\tclassName: u.string,\n\t\tlanguage: u.string\n\t};\n\tstatic defaultProps = {\n\t\tshowMessage: \"Show correct answer\",\n\t\thideMessage: \"Hide correct answer\",\n\t\tshow: !1,\n\t\ttoggled: !1\n\t};\n\tconstructor(e) {\n\t\tsuper(e), this.state = { show: e.show }, this.openIconRef = l.createRef(), this.closedIconRef = l.createRef(), t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t};\n\t}\n\tonClick() {\n\t\tthis.props.onToggle(!this.props.toggled);\n\t}\n\tonTouch(e) {\n\t\te.preventDefault(), this.props.onToggle(!this.props.toggled);\n\t}\n\tUNSAFE_componentWillReceiveProps(e) {\n\t\tthis.setState({ show: e.show }), e.language !== this.props?.language && (t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t});\n\t}\n\trender() {\n\t\tlet { className: t, toggled: i, hideMessage: a, showMessage: o } = this.props;\n\t\treturn /* @__PURE__ */ s(b, {\n\t\t\tclassName: t,\n\t\t\tchildren: /* @__PURE__ */ s(e, {\n\t\t\t\tshow: this.state.show,\n\t\t\t\tchildren: /* @__PURE__ */ c(x, {\n\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\"aria-pressed\": !!i,\n\t\t\t\t\tonClick: this.onClick.bind(this),\n\t\t\t\t\tonTouchEnd: this.onTouch.bind(this),\n\t\t\t\t\tchildren: [/* @__PURE__ */ c(w, { children: [/* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.openIconRef,\n\t\t\t\t\t\ttimeout: 400,\n\t\t\t\t\t\tin: i,\n\t\t\t\t\t\texit: !i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.openIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-open\")\n\t\t\t\t\t\t})\n\t\t\t\t\t}), /* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.closedIconRef,\n\t\t\t\t\t\ttimeout: 5e3,\n\t\t\t\t\t\tin: !i,\n\t\t\t\t\t\texit: i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.closedIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-closed\")\n\t\t\t\t\t\t})\n\t\t\t\t\t})] }), /* @__PURE__ */ s(m, {\n\t\t\t\t\t\tfalse: !0,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(S, {\n\t\t\t\t\t\t\t\"aria-hidden\": !this.state.show,\n\t\t\t\t\t\t\tchildren: i ? a : o\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n};\n//#endregion\nexport { T as CorrectAnswerToggle, T as default };\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Radio from '@mui/material/Radio';\nimport Checkbox from '@mui/material/Checkbox';\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\nimport { color, createUniqueId } from '@pie-lib/render-ui';\n\nconst ControlsContainer: any = styled('div')(({ theme }) => ({\n marginLeft: 'auto',\n marginRight: 'auto',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}));\n\nconst Column: any = styled('td')({\n padding: '5px 0',\n});\n\nconst EmptyTypography: any = styled(Typography)(({ theme }) => ({\n margin: theme.spacing(2),\n}));\n\nconst RowHeader: any = styled('th')({\n padding: 0,\n});\n\nconst RowItem: any = styled('div')(({ theme, isQuestionText }) => ({\n padding: theme.spacing(1.5),\n textAlign: isQuestionText ? 'left' : 'center',\n}));\n\nconst Separator: any = styled('tr')({\n border: 0,\n borderTop: `2.5px solid ${color.primaryLight()}`,\n width: '100%',\n});\n\nconst Table: any = styled('table')({\n color: color.text(),\n backgroundColor: color.background(),\n borderCollapse: 'collapse',\n borderSpacing: 0,\n marginBottom: 0,\n});\n\nexport class AnswerGrid extends React.Component {\n static propTypes = {\n correctAnswers: PropTypes.object,\n view: PropTypes.bool.isRequired,\n showCorrect: PropTypes.bool.isRequired,\n disabled: PropTypes.bool.isRequired,\n onAnswerChange: PropTypes.func.isRequired,\n choiceMode: PropTypes.string.isRequired,\n rows: PropTypes.array.isRequired,\n headers: PropTypes.array.isRequired,\n answers: PropTypes.object.isRequired,\n };\n\n // Ids that tie each control to its row title and column header, and each row group to its title.\n // The same prefix makes each row's radio name unique on the page, so a row is one tab stop.\n instanceId: string = createUniqueId('match-grid');\n\n onRowValueChange = (rowId, answerIndex) => (event) => {\n const { onAnswerChange, choiceMode, answers } = this.props;\n const newAnswers = { ...answers };\n\n if (choiceMode === 'radio') {\n for (let i = 0; i < newAnswers[rowId].length; i++) {\n newAnswers[rowId][i] = false;\n }\n }\n\n newAnswers[rowId][answerIndex] = event.target.checked;\n\n onAnswerChange(newAnswers);\n };\n\n answerIsCorrect: any = (rowId, rowValue, rowValueIndex) => {\n const { correctAnswers } = this.props;\n\n return correctAnswers[rowId][rowValueIndex] === rowValue && rowValue === true;\n };\n\n // needs a separate method because what isn't correct isn't necessarily incorrect\n answerIsIncorrect: any = (rowId, rowValue, rowValueIndex) => {\n const { correctAnswers } = this.props;\n\n return (\n (correctAnswers[rowId][rowValueIndex] === true && rowValue === false) ||\n (correctAnswers[rowId][rowValueIndex] === false && rowValue === true)\n );\n };\n\n // The colour the control paints in every state. Kept in one place because it has to\n // be applied to `.Mui-checked` and `.Mui-disabled` as well as the root.\n controlColor: any = (rowId, rowValue, rowValueIndex) => {\n const { showCorrect, disabled, view } = this.props;\n const evaluate = disabled && !view;\n\n if (\n (showCorrect && rowValue === true) ||\n (evaluate && this.answerIsCorrect(rowId, rowValue, rowValueIndex))\n ) {\n return color.correct();\n }\n\n if (evaluate && this.answerIsIncorrect(rowId, rowValue, rowValueIndex)) {\n return color.incorrect();\n }\n\n if (rowValue === true && !evaluate) {\n return color.primary();\n }\n\n return disabled ? color.disabled() : color.text();\n };\n\n render() {\n const { headers, rows, choiceMode, answers, disabled } = this.props;\n const Tag = choiceMode === 'radio' ? Radio : Checkbox;\n const headerId = (idx) => `${this.instanceId}-header-${idx}`;\n const rowTitleId = (idx) => `${this.instanceId}-row-${idx}`;\n const rowGroupName = (idx) => (choiceMode === 'radio' ? `${this.instanceId}-row-${idx}-choice` : undefined);\n\n if (!rows || rows.length === 0) {\n return (\n <ControlsContainer>\n <EmptyTypography component=\"div\">\n There are currently no questions to show.\n </EmptyTypography>\n </ControlsContainer>\n );\n }\n\n return (\n <ControlsContainer>\n <Table>\n <colgroup>\n {(headers || []).map((header, idx) => (\n <col key={`col-${idx}`} />\n ))}\n </colgroup>\n\n <thead>\n <tr>\n {(headers || []).map((header, idx) => (\n <RowHeader key={`th-${idx}`} id={headerId(idx)} data-colno={`${idx}`} scope=\"col\">\n <RowItem\n isQuestionText={idx === 0}\n dangerouslySetInnerHTML={{ __html: header }}\n />\n </RowHeader>\n ))}\n </tr>\n </thead>\n\n {(rows || []).map((row, idx) => (\n <tbody\n key={`row-${idx}`}\n role={choiceMode === 'radio' ? 'radiogroup' : 'group'}\n aria-labelledby={rowTitleId(idx)}\n >\n <Separator>\n <td key={`td-title-${idx}`} id={rowTitleId(idx)} data-colno={'0'}>\n <RowItem\n isQuestionText={true}\n dangerouslySetInnerHTML={{ __html: row.title }}\n />\n </td>\n\n {(answers[row.id] || []).map((rowItem, answerIndex) => {\n const controlColor = this.controlColor(row.id, rowItem, answerIndex);\n\n return (\n <Column key={`td-${idx}-${answerIndex}`} data-colno={`${answerIndex + 1}`}>\n <RowItem>\n <Tag\n sx={{\n padding: '6px',\n color: controlColor,\n // MUI paints the checked state from `palette.primary.main` via\n // `.MuiCheckbox-root.Mui-checked` / `.MuiRadio-root.Mui-checked`.\n // That is two classes, so a bare `color` above loses to it and the\n // control renders MUI's default blue under every PIE theme. `&&`\n // matches the specificity so the token wins.\n '&&.Mui-checked': {\n color: controlColor,\n },\n '&&.Mui-disabled': {\n color: controlColor,\n },\n cursor: disabled ? 'not-allowed' : 'pointer',\n pointerEvents: disabled ? 'initial' : 'auto',\n opacity: disabled ? 0.7 : 1,\n '& input': {\n width: '100% !important',\n },\n '&&:hover:not(.Mui-disabled)': {\n color: color.primaryLight(),\n },\n }}\n slotProps={{\n input: { 'aria-labelledby': `${rowTitleId(idx)} ${headerId(answerIndex + 1)}` },\n }}\n name={rowGroupName(idx)}\n disabled={disabled}\n onChange={this.onRowValueChange(row.id, answerIndex)}\n checked={rowItem === true}\n />\n </RowItem>\n </Column>\n );\n })}\n </Separator>\n </tbody>\n ))}\n </Table>\n </ControlsContainer>\n );\n }\n}\n\nexport default AnswerGrid;\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { Collapsible as CollapsibleImport, Feedback as FeedbackImport, hasText, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport, hasMedia } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport AnswerGrid from './answer-grid.js';\nimport { styled } from '@mui/material/styles';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst StyledPrompt: any = styled('div')({\n verticalAlign: 'middle',\n});\n\nconst StyledCollapsible: any = styled(Collapsible)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nexport class Main extends React.Component {\n static propTypes = {\n session: PropTypes.object.isRequired,\n onSessionChange: PropTypes.func,\n model: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n session: {\n ...props.session,\n answers: (props.session && props.session.answers) || this.generateAnswers(props.model),\n },\n showCorrect: false,\n };\n\n this.callOnSessionChange();\n }\n\n generateAnswers: any = (model) => {\n const answers = {};\n\n model.rows?.forEach((row) => {\n answers[row.id] = new Array(model.layout - 1).fill(false);\n });\n\n return answers;\n };\n\n isAnswerRegenerationRequired: any = (nextProps) => {\n const { model: { choiceMode, layout, rows } = {} } = this.props;\n const { session: { answers } = {} } = nextProps;\n let isRequired = false;\n\n if (choiceMode !== nextProps.model.choiceMode) {\n isRequired = true;\n }\n\n if (layout !== nextProps.model.layout) {\n isRequired = true;\n }\n\n if (\n rows.length !== nextProps.model.rows.length ||\n (answers && nextProps.model.rows.length !== Object.keys(answers).length)\n ) {\n isRequired = true;\n }\n\n return isRequired || !answers;\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const regenAnswers = this.isAnswerRegenerationRequired(nextProps);\n\n this.setState(\n (state) => ({\n session: {\n ...nextProps.session,\n // regenerate answers if layout or choiceMode change\n answers: regenAnswers ? this.generateAnswers(nextProps.model) : nextProps.session.answers,\n },\n showCorrect:\n this.props.model.disabled && !nextProps.model.disabled && state.showCorrect ? false : state.showCorrect,\n }),\n () => {\n if (regenAnswers) this.callOnSessionChange();\n },\n );\n }\n\n callOnSessionChange: any = () => {\n const { onSessionChange } = this.props;\n\n if (onSessionChange) {\n onSessionChange(this.state.session);\n }\n };\n\n toggleShowCorrect: any = (show) => {\n this.setState({ showCorrect: show });\n };\n\n onAnswerChange: any = (newAnswers) => {\n this.setState(\n (state) => ({\n session: {\n ...state.session,\n answers: newAnswers,\n },\n }),\n this.callOnSessionChange,\n );\n };\n\n render() {\n const { model } = this.props;\n const { showCorrect, session } = this.state;\n const { correctness = {}, extraCSSRules, language } = model;\n const showCorrectAnswerToggle = correctness.correctness && correctness.correctness !== 'correct';\n\n const showRationale = model.rationale && (hasText(model.rationale) || hasMedia(model.rationale));\n const showTeacherInstructions =\n model.teacherInstructions && (hasText(model.teacherInstructions) || hasMedia(model.teacherInstructions));\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n {showTeacherInstructions && (\n <StyledCollapsible\n labels={{\n hidden: translator.t('common:showTeacherInstructions', { lng: language }),\n visible: translator.t('common:hideTeacherInstructions', { lng: language }),\n }}\n >\n <PreviewPrompt prompt={model.teacherInstructions} />\n </StyledCollapsible>\n )}\n\n {model.prompt && (\n <StyledPrompt>\n <PreviewPrompt prompt={model.prompt} />\n </StyledPrompt>\n )}\n\n <CorrectAnswerToggle\n language={language}\n show={showCorrectAnswerToggle}\n toggled={showCorrect}\n onToggle={this.toggleShowCorrect}\n />\n\n <AnswerGrid\n showCorrect={showCorrect}\n correctAnswers={model.correctResponse}\n disabled={model.disabled}\n view={model.view}\n onAnswerChange={this.onAnswerChange}\n choiceMode={model.choiceMode}\n answers={showCorrect ? model.correctResponse || {} : session.answers}\n headers={model.headers}\n rows={model.rows}\n />\n\n {showRationale && (\n <Collapsible labels={{ hidden: translator.t('common:showRationale', { lng: language }), visible: translator.t('common:hideRationale', { lng: language }) }}>\n <PreviewPrompt prompt={model.rationale} />\n </Collapsible>\n )}\n\n {model.feedback && <Feedback correctness={correctness.correctness} feedback={model.feedback} />}\n </UiLayout>\n );\n }\n}\n\nexport default Main;\n","//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region src/index.ts\nvar s = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, c = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { s as ModelSetEvent, e as SESSION_COMMIT_METHOD, c as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers };\n","// @ts-nocheck\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Main from './main.js';\nimport { SessionChangedEvent } from '@pie-element/shared-player-events';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nexport { Main as Component };\n\nexport const isComplete = (session, model) => {\n const ids = model?.rows?.map((r) => r.id) || [];\n\n return ids.reduce((acc, id) => {\n if (!acc) {\n return false;\n }\n\n const arr = session.answers && session.answers[id];\n const hasChoice = Array.isArray(arr) && arr.includes(true);\n\n return hasChoice && acc;\n }, true);\n};\n\nexport default class Match extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n }\n\n set model(m) {\n // config object props should be part of the model props\n // model.config should be no longer used\n this._model = { ...m, ...(m?.config || {}) };\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n sessionChanged(s) {\n this._session.answers = s.answers;\n const complete = isComplete(this._session, this._model);\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), complete));\n\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onSessionChange: this.sessionChanged.bind(this),\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;mCAMI,IAAI,+CAA+C,KAAI,EAAE,KAAK,CAAC,QAAQ;CAC1E,UAAU;CACV,QAAQ;CACR,UAAU;CACV,SAAS;CACT,YAAY;CACZ,OAAO;CACP,WAAW;EACV,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,OAAO;EACP,YAAY;EACZ,WAAW;CACZ;CACA,gBAAgB;EACf,QAAQ;EACR,YAAY;EACZ,OAAO;EACP,WAAW;CACZ;CACA,UAAU;EACT,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,YAAY;EACZ,OAAO;CACR;CACA,eAAe;EACd,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,OAAO;CACR;AACD,EAAE,GAAG,KAAK,MAAM;CACf,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,MAAM,GAAG,IAAI,GAAE,IAAI;CAC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AI;EACjB,CAAC;CACH;CAEA,uBAAuB;EACrB,AAEE,KAAK,WADL,KAAK,MAAM,QAAQ,GACN;CAEjB;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../lib-react/correct-answer-toggle/dist/expander.js","../../../../../../lib-react/icons/dist/correct-response-icon.js","../../../../../../lib-react/correct-answer-toggle/dist/index.js","../../../../src/delivery/answer-grid.tsx","../../../../src/delivery/main.tsx","../../../../../../shared/player-events/dist/index.js","../../../../src/delivery/index.ts"],"sourcesContent":["import { styled as e } from \"@mui/material/styles\";\nimport { CSSTransition as t } from \"react-transition-group\";\nimport { jsx as n } from \"react/jsx-runtime\";\nimport { useRef as r } from \"react\";\nimport i from \"prop-types\";\n//#region src/expander.tsx\nvar a = \"height ease-in 300ms, opacity ease-in 300ms\", o = e(\"div\")(() => ({\n\tposition: \"relative\",\n\theight: 0,\n\toverflow: \"hidden\",\n\tdisplay: \"flex\",\n\tvisibility: \"hidden\",\n\twidth: 0,\n\t\"&.enter\": {\n\t\ttransition: a,\n\t\topacity: 1,\n\t\theight: \"auto\",\n\t\twidth: \"auto\",\n\t\tvisibility: \"visible\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.enter-done\": {\n\t\theight: \"auto\",\n\t\tvisibility: \"visible\",\n\t\twidth: \"auto\",\n\t\tminHeight: \"25px\"\n\t},\n\t\"&.exit\": {\n\t\ttransition: a,\n\t\topacity: 0,\n\t\theight: 0,\n\t\tvisibility: \"visible\",\n\t\twidth: 0\n\t},\n\t\"&.exit-done\": {\n\t\topacity: 0,\n\t\tvisibility: \"hidden\",\n\t\theight: 0,\n\t\twidth: 0\n\t}\n})), s = (e) => {\n\tlet { show: i, children: a, className: s } = e, c = r(null);\n\treturn /* @__PURE__ */ n(t, {\n\t\tnodeRef: c,\n\t\tin: i,\n\t\tappear: !0,\n\t\tmountOnEnter: !1,\n\t\ttimeout: 300,\n\t\tclassNames: {\n\t\t\tenter: \"enter\",\n\t\t\tenterDone: \"enter-done\",\n\t\t\texit: \"exit\",\n\t\t\texitDone: \"exit-done\"\n\t\t},\n\t\tchildren: /* @__PURE__ */ n(o, {\n\t\t\tref: c,\n\t\t\tclassName: s,\n\t\t\tchildren: a\n\t\t})\n\t});\n};\ns.propTypes = {\n\tshow: i.bool.isRequired,\n\tclassName: i.string,\n\tchildren: i.oneOfType([i.arrayOf(i.node), i.node]).isRequired\n};\n//#endregion\nexport { s as default };\n","import \"react\";\nimport e from \"prop-types\";\nimport { jsx as t, jsxs as n } from \"react/jsx-runtime\";\nimport { styled as r } from \"@mui/material/styles\";\n//#region src/correct-response-icon.tsx\nvar i = ({ bgFill: e, fgFill: r }) => /* @__PURE__ */ n(\"svg\", {\n\t\"aria-hidden\": \"true\",\n\tfocusable: \"false\",\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-283 359 34 35\",\n\tstyle: { enableBackground: \"new -283 359 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-266\",\n\t\t\tcy: \"375.9\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\ni.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired\n};\nvar a = ({ bgFill: e, fgFill: r, borderFill: i }) => /* @__PURE__ */ n(\"svg\", {\n\t\"aria-hidden\": \"true\",\n\tfocusable: \"false\",\n\tpreserveAspectRatio: \"xMinYMin meet\",\n\tversion: \"1.1\",\n\tviewBox: \"-129.5 127 34 35\",\n\tstyle: { enableBackground: \"new -129.5 127 34 35\" },\n\tchildren: [\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#D0CAC5\",\n\t\t\t\tstroke: \"#E6E3E0\",\n\t\t\t\tstrokeWidth: .75,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\\n C-97.4,153.5-104.3,160.4-112.9,160.4z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\tstyle: {\n\t\t\t\tfill: \"#B3ABA4\",\n\t\t\t\tstroke: \"#CDC7C2\",\n\t\t\t\tstrokeWidth: .5,\n\t\t\t\tstrokeMiterlimit: 10\n\t\t\t},\n\t\t\td: \"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"\n\t\t}),\n\t\t/* @__PURE__ */ t(\"circle\", {\n\t\t\tcx: \"-114.2\",\n\t\t\tcy: \"143.5\",\n\t\t\tr: \"14\",\n\t\t\tfill: e\n\t\t}),\n\t\t/* @__PURE__ */ t(\"path\", {\n\t\t\td: \"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\",\n\t\t\tfill: i\n\t\t}),\n\t\t/* @__PURE__ */ t(\"polygon\", {\n\t\t\tpoints: \"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\",\n\t\t\tfill: r\n\t\t})\n\t]\n});\na.propTypes = {\n\tbgFill: e.string.isRequired,\n\tfgFill: e.string.isRequired,\n\tborderFill: e.string.isRequired\n};\nvar o = r(\"div\")(({ size: e }) => ({\n\twidth: e || \"25px\",\n\theight: e || \"25px\"\n})), s = ({ open: e, size: n }) => /* @__PURE__ */ t(o, {\n\tsize: n,\n\tchildren: e ? /* @__PURE__ */ t(i, {\n\t\tbgFill: \"#bce2ff\",\n\t\tfgFill: \"#1a9cff\"\n\t}) : /* @__PURE__ */ t(a, {\n\t\tbgFill: \"white\",\n\t\tfgFill: \"#1a9cff\",\n\t\tborderFill: \"#bce2ff\"\n\t})\n});\ns.propTypes = {\n\topen: e.bool,\n\tsize: e.string\n}, s.defaultProps = { open: !1 };\n//#endregion\nexport { s as default };\n","import e from \"./expander.js\";\nimport { styled as t } from \"@mui/material/styles\";\nimport { CSSTransition as n } from \"react-transition-group\";\nimport { CorrectResponse as r } from \"@pie-lib/icons\";\nimport * as i from \"@pie-lib/render-ui\";\nimport { Readable as a, color as o } from \"@pie-lib/render-ui\";\nimport { jsx as s, jsxs as c } from \"react/jsx-runtime\";\nimport l from \"react\";\nimport u from \"prop-types\";\nimport d from \"@pie-lib/translator\";\n//#region src/index.tsx\nfunction f(e) {\n\treturn typeof e == \"function\" || typeof e == \"object\" && !!e && typeof e.$$typeof == \"symbol\";\n}\nfunction p(e, t) {\n\treturn !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;\n}\nvar m = p(a, \"Readable\") || p(_.Readable, \"Readable\"), h = i, g = h.default, _ = g && typeof g == \"object\" ? g : h, { translator: v } = d, y = {\n\tWebkitTouchCallout: \"none\",\n\tWebkitUserSelect: \"none\",\n\tKhtmlUserSelect: \"none\",\n\tMozUserSelect: \"none\",\n\tmsUserSelect: \"none\",\n\tuserSelect: \"none\"\n}, b = t(\"div\")(() => ({\n\twidth: \"100%\",\n\tcursor: \"pointer\"\n})), x = t(\"button\")(() => ({\n\tmargin: \"0 auto\",\n\ttextAlign: \"center\",\n\tdisplay: \"flex\",\n\tminWidth: \"24px\",\n\tminHeight: \"24px\",\n\tpadding: 0,\n\tborder: 0,\n\tbackground: \"none\",\n\tcolor: \"inherit\",\n\tfont: \"inherit\",\n\tcursor: \"pointer\",\n\t\"&:focus-visible\": {\n\t\toutline: `2px solid ${o.buttonFocusOutline()}`,\n\t\toutlineOffset: \"-2px\"\n\t}\n})), S = t(\"div\")(() => ({\n\twidth: \"fit-content\",\n\tminWidth: \"140px\",\n\talignSelf: \"center\",\n\tverticalAlign: \"middle\",\n\tcolor: `var(--correct-answer-toggle-label-color, ${o.text()})`,\n\tfontWeight: \"normal\",\n\t...y\n})), C = t(\"div\")(() => ({\n\tposition: \"absolute\",\n\twidth: \"25px\",\n\t\"&.enter\": { opacity: \"0\" },\n\t\"&.enter-active\": {\n\t\topacity: \"1\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t},\n\t\"&.exit\": { opacity: \"1\" },\n\t\"&.exit-active\": {\n\t\topacity: \"0\",\n\t\ttransition: \"opacity 0.3s ease-in\"\n\t}\n})), w = t(\"div\")(() => ({\n\twidth: \"25px\",\n\tmarginRight: \"5px\",\n\tdisplay: \"flex\",\n\talignItems: \"center\"\n})), T = class t extends l.Component {\n\tstatic propTypes = {\n\t\tonToggle: u.func,\n\t\ttoggled: u.bool,\n\t\tshow: u.bool,\n\t\thideMessage: u.string,\n\t\tshowMessage: u.string,\n\t\tclassName: u.string,\n\t\tlanguage: u.string\n\t};\n\tstatic defaultProps = {\n\t\tshowMessage: \"Show correct answer\",\n\t\thideMessage: \"Hide correct answer\",\n\t\tshow: !1,\n\t\ttoggled: !1\n\t};\n\tconstructor(e) {\n\t\tsuper(e), this.state = { show: e.show }, this.openIconRef = l.createRef(), this.closedIconRef = l.createRef(), t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t};\n\t}\n\tonClick() {\n\t\tthis.props.onToggle(!this.props.toggled);\n\t}\n\tonTouch(e) {\n\t\te.preventDefault(), this.props.onToggle(!this.props.toggled);\n\t}\n\tUNSAFE_componentWillReceiveProps(e) {\n\t\tthis.setState({ show: e.show }), e.language !== this.props?.language && (t.defaultProps = {\n\t\t\t...t.defaultProps,\n\t\t\tshowMessage: v.t(\"common:showCorrectAnswer\", { lng: e.language }),\n\t\t\thideMessage: v.t(\"common:hideCorrectAnswer\", { lng: e.language })\n\t\t});\n\t}\n\trender() {\n\t\tlet { className: t, toggled: i, hideMessage: a, showMessage: o } = this.props;\n\t\treturn /* @__PURE__ */ s(b, {\n\t\t\tclassName: t,\n\t\t\tchildren: /* @__PURE__ */ s(e, {\n\t\t\t\tshow: this.state.show,\n\t\t\t\tchildren: /* @__PURE__ */ c(x, {\n\t\t\t\t\ttype: \"button\",\n\t\t\t\t\t\"aria-pressed\": !!i,\n\t\t\t\t\tonClick: this.onClick.bind(this),\n\t\t\t\t\tonTouchEnd: this.onTouch.bind(this),\n\t\t\t\t\tchildren: [/* @__PURE__ */ c(w, { children: [/* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.openIconRef,\n\t\t\t\t\t\ttimeout: 400,\n\t\t\t\t\t\tin: i,\n\t\t\t\t\t\texit: !i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.openIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-open\")\n\t\t\t\t\t\t})\n\t\t\t\t\t}), /* @__PURE__ */ s(n, {\n\t\t\t\t\t\tnodeRef: this.closedIconRef,\n\t\t\t\t\t\ttimeout: 5e3,\n\t\t\t\t\t\tin: !i,\n\t\t\t\t\t\texit: i,\n\t\t\t\t\t\tclassNames: {\n\t\t\t\t\t\t\tenter: \"enter\",\n\t\t\t\t\t\t\tenterActive: \"enter-active\",\n\t\t\t\t\t\t\texit: \"exit\",\n\t\t\t\t\t\t\texitActive: \"exit-active\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(C, {\n\t\t\t\t\t\t\tref: this.closedIconRef,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ s(r, { open: i }, \"correct-closed\")\n\t\t\t\t\t\t})\n\t\t\t\t\t})] }), /* @__PURE__ */ s(m, {\n\t\t\t\t\t\tfalse: !0,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ s(S, {\n\t\t\t\t\t\t\t\"aria-hidden\": !this.state.show,\n\t\t\t\t\t\t\tchildren: i ? a : o\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n};\n//#endregion\nexport { T as CorrectAnswerToggle, T as default };\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Radio from '@mui/material/Radio';\nimport Checkbox from '@mui/material/Checkbox';\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\nimport { color, createUniqueId } from '@pie-lib/render-ui';\nimport { sanitizeModelHtml } from '@pie-element/shared-utils';\n\nconst ControlsContainer: any = styled('div')(({ theme }) => ({\n marginLeft: 'auto',\n marginRight: 'auto',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}));\n\nconst Column: any = styled('td')({\n padding: '5px 0',\n});\n\nconst EmptyTypography: any = styled(Typography)(({ theme }) => ({\n margin: theme.spacing(2),\n}));\n\nconst RowHeader: any = styled('th')({\n padding: 0,\n});\n\nconst RowItem: any = styled('div')(({ theme, isQuestionText }) => ({\n padding: theme.spacing(1.5),\n textAlign: isQuestionText ? 'left' : 'center',\n}));\n\nconst Separator: any = styled('tr')({\n border: 0,\n borderTop: `2.5px solid ${color.primaryLight()}`,\n width: '100%',\n});\n\nconst Table: any = styled('table')({\n color: color.text(),\n backgroundColor: color.background(),\n borderCollapse: 'collapse',\n borderSpacing: 0,\n marginBottom: 0,\n});\n\nexport class AnswerGrid extends React.Component {\n static propTypes = {\n correctAnswers: PropTypes.object,\n view: PropTypes.bool.isRequired,\n showCorrect: PropTypes.bool.isRequired,\n disabled: PropTypes.bool.isRequired,\n onAnswerChange: PropTypes.func.isRequired,\n choiceMode: PropTypes.string.isRequired,\n rows: PropTypes.array.isRequired,\n headers: PropTypes.array.isRequired,\n answers: PropTypes.object.isRequired,\n };\n\n // Ids that tie each control to its row title and column header, and each row group to its title.\n // The same prefix makes each row's radio name unique on the page, so a row is one tab stop.\n instanceId: string = createUniqueId('match-grid');\n\n onRowValueChange = (rowId, answerIndex) => (event) => {\n const { onAnswerChange, choiceMode, answers } = this.props;\n const newAnswers = { ...answers };\n\n if (choiceMode === 'radio') {\n for (let i = 0; i < newAnswers[rowId].length; i++) {\n newAnswers[rowId][i] = false;\n }\n }\n\n newAnswers[rowId][answerIndex] = event.target.checked;\n\n onAnswerChange(newAnswers);\n };\n\n answerIsCorrect: any = (rowId, rowValue, rowValueIndex) => {\n const { correctAnswers } = this.props;\n\n return correctAnswers[rowId][rowValueIndex] === rowValue && rowValue === true;\n };\n\n // needs a separate method because what isn't correct isn't necessarily incorrect\n answerIsIncorrect: any = (rowId, rowValue, rowValueIndex) => {\n const { correctAnswers } = this.props;\n\n return (\n (correctAnswers[rowId][rowValueIndex] === true && rowValue === false) ||\n (correctAnswers[rowId][rowValueIndex] === false && rowValue === true)\n );\n };\n\n // The colour the control paints in every state. Kept in one place because it has to\n // be applied to `.Mui-checked` and `.Mui-disabled` as well as the root.\n controlColor: any = (rowId, rowValue, rowValueIndex) => {\n const { showCorrect, disabled, view } = this.props;\n const evaluate = disabled && !view;\n\n if (\n (showCorrect && rowValue === true) ||\n (evaluate && this.answerIsCorrect(rowId, rowValue, rowValueIndex))\n ) {\n return color.correct();\n }\n\n if (evaluate && this.answerIsIncorrect(rowId, rowValue, rowValueIndex)) {\n return color.incorrect();\n }\n\n if (rowValue === true && !evaluate) {\n return color.primary();\n }\n\n return disabled ? color.disabled() : color.text();\n };\n\n render() {\n const { headers, rows, choiceMode, answers, disabled } = this.props;\n const Tag = choiceMode === 'radio' ? Radio : Checkbox;\n const headerId = (idx) => `${this.instanceId}-header-${idx}`;\n const rowTitleId = (idx) => `${this.instanceId}-row-${idx}`;\n const rowGroupName = (idx) => (choiceMode === 'radio' ? `${this.instanceId}-row-${idx}-choice` : undefined);\n\n if (!rows || rows.length === 0) {\n return (\n <ControlsContainer>\n <EmptyTypography component=\"div\">\n There are currently no questions to show.\n </EmptyTypography>\n </ControlsContainer>\n );\n }\n\n return (\n <ControlsContainer>\n <Table>\n <colgroup>\n {(headers || []).map((header, idx) => (\n <col key={`col-${idx}`} />\n ))}\n </colgroup>\n\n <thead>\n <tr>\n {(headers || []).map((header, idx) => (\n <RowHeader key={`th-${idx}`} id={headerId(idx)} data-colno={`${idx}`} scope=\"col\">\n <RowItem\n isQuestionText={idx === 0}\n dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(header) }}\n />\n </RowHeader>\n ))}\n </tr>\n </thead>\n\n {(rows || []).map((row, idx) => (\n <tbody\n key={`row-${idx}`}\n role={choiceMode === 'radio' ? 'radiogroup' : 'group'}\n aria-labelledby={rowTitleId(idx)}\n >\n <Separator>\n <td key={`td-title-${idx}`} id={rowTitleId(idx)} data-colno={'0'}>\n <RowItem\n isQuestionText={true}\n dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(row.title) }}\n />\n </td>\n\n {(answers[row.id] || []).map((rowItem, answerIndex) => {\n const controlColor = this.controlColor(row.id, rowItem, answerIndex);\n\n return (\n <Column key={`td-${idx}-${answerIndex}`} data-colno={`${answerIndex + 1}`}>\n <RowItem>\n <Tag\n sx={{\n padding: '6px',\n color: controlColor,\n // MUI paints the checked state from `palette.primary.main` via\n // `.MuiCheckbox-root.Mui-checked` / `.MuiRadio-root.Mui-checked`.\n // That is two classes, so a bare `color` above loses to it and the\n // control renders MUI's default blue under every PIE theme. `&&`\n // matches the specificity so the token wins.\n '&&.Mui-checked': {\n color: controlColor,\n },\n '&&.Mui-disabled': {\n color: controlColor,\n },\n cursor: disabled ? 'not-allowed' : 'pointer',\n pointerEvents: disabled ? 'initial' : 'auto',\n opacity: disabled ? 0.7 : 1,\n '& input': {\n width: '100% !important',\n },\n '&&:hover:not(.Mui-disabled)': {\n color: color.primaryLight(),\n },\n }}\n slotProps={{\n input: { 'aria-labelledby': `${rowTitleId(idx)} ${headerId(answerIndex + 1)}` },\n }}\n name={rowGroupName(idx)}\n disabled={disabled}\n onChange={this.onRowValueChange(row.id, answerIndex)}\n checked={rowItem === true}\n />\n </RowItem>\n </Column>\n );\n })}\n </Separator>\n </tbody>\n ))}\n </Table>\n </ControlsContainer>\n );\n }\n}\n\nexport default AnswerGrid;\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\nimport { Collapsible as CollapsibleImport, Feedback as FeedbackImport, hasText, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport, hasMedia } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport AnswerGrid from './answer-grid.js';\nimport { styled } from '@mui/material/styles';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst StyledPrompt: any = styled('div')({\n verticalAlign: 'middle',\n});\n\nconst StyledCollapsible: any = styled(Collapsible)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nexport class Main extends React.Component {\n static propTypes = {\n session: PropTypes.object.isRequired,\n onSessionChange: PropTypes.func,\n model: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n session: {\n ...props.session,\n answers: (props.session && props.session.answers) || this.generateAnswers(props.model),\n },\n showCorrect: false,\n };\n\n this.callOnSessionChange();\n }\n\n generateAnswers: any = (model) => {\n const answers = {};\n\n model.rows?.forEach((row) => {\n answers[row.id] = new Array(model.layout - 1).fill(false);\n });\n\n return answers;\n };\n\n isAnswerRegenerationRequired: any = (nextProps) => {\n const { model: { choiceMode, layout, rows } = {} } = this.props;\n const { session: { answers } = {} } = nextProps;\n let isRequired = false;\n\n if (choiceMode !== nextProps.model.choiceMode) {\n isRequired = true;\n }\n\n if (layout !== nextProps.model.layout) {\n isRequired = true;\n }\n\n if (\n rows.length !== nextProps.model.rows.length ||\n (answers && nextProps.model.rows.length !== Object.keys(answers).length)\n ) {\n isRequired = true;\n }\n\n return isRequired || !answers;\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const regenAnswers = this.isAnswerRegenerationRequired(nextProps);\n\n this.setState(\n (state) => ({\n session: {\n ...nextProps.session,\n // regenerate answers if layout or choiceMode change\n answers: regenAnswers ? this.generateAnswers(nextProps.model) : nextProps.session.answers,\n },\n showCorrect:\n this.props.model.disabled && !nextProps.model.disabled && state.showCorrect ? false : state.showCorrect,\n }),\n () => {\n if (regenAnswers) this.callOnSessionChange();\n },\n );\n }\n\n callOnSessionChange: any = () => {\n const { onSessionChange } = this.props;\n\n if (onSessionChange) {\n onSessionChange(this.state.session);\n }\n };\n\n toggleShowCorrect: any = (show) => {\n this.setState({ showCorrect: show });\n };\n\n onAnswerChange: any = (newAnswers) => {\n this.setState(\n (state) => ({\n session: {\n ...state.session,\n answers: newAnswers,\n },\n }),\n this.callOnSessionChange,\n );\n };\n\n render() {\n const { model } = this.props;\n const { showCorrect, session } = this.state;\n const { correctness = {}, extraCSSRules, language } = model;\n const showCorrectAnswerToggle = correctness.correctness && correctness.correctness !== 'correct';\n\n const showRationale = model.rationale && (hasText(model.rationale) || hasMedia(model.rationale));\n const showTeacherInstructions =\n model.teacherInstructions && (hasText(model.teacherInstructions) || hasMedia(model.teacherInstructions));\n\n return (\n <UiLayout extraCSSRules={extraCSSRules}>\n {showTeacherInstructions && (\n <StyledCollapsible\n labels={{\n hidden: translator.t('common:showTeacherInstructions', { lng: language }),\n visible: translator.t('common:hideTeacherInstructions', { lng: language }),\n }}\n >\n <PreviewPrompt prompt={model.teacherInstructions} />\n </StyledCollapsible>\n )}\n\n {model.prompt && (\n <StyledPrompt>\n <PreviewPrompt prompt={model.prompt} />\n </StyledPrompt>\n )}\n\n <CorrectAnswerToggle\n language={language}\n show={showCorrectAnswerToggle}\n toggled={showCorrect}\n onToggle={this.toggleShowCorrect}\n />\n\n <AnswerGrid\n showCorrect={showCorrect}\n correctAnswers={model.correctResponse}\n disabled={model.disabled}\n view={model.view}\n onAnswerChange={this.onAnswerChange}\n choiceMode={model.choiceMode}\n answers={showCorrect ? model.correctResponse || {} : session.answers}\n headers={model.headers}\n rows={model.rows}\n />\n\n {showRationale && (\n <Collapsible labels={{ hidden: translator.t('common:showRationale', { lng: language }), visible: translator.t('common:hideRationale', { lng: language }) }}>\n <PreviewPrompt prompt={model.rationale} />\n </Collapsible>\n )}\n\n {model.feedback && <Feedback correctness={correctness.correctness} feedback={model.feedback} />}\n </UiLayout>\n );\n }\n}\n\nexport default Main;\n","//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region src/index.ts\nvar s = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, c = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { s as ModelSetEvent, e as SESSION_COMMIT_METHOD, c as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers };\n","// @ts-nocheck\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Main from './main.js';\nimport { SessionChangedEvent } from '@pie-element/shared-player-events';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nexport { Main as Component };\n\nexport const isComplete = (session, model) => {\n const ids = model?.rows?.map((r) => r.id) || [];\n\n return ids.reduce((acc, id) => {\n if (!acc) {\n return false;\n }\n\n const arr = session.answers && session.answers[id];\n const hasChoice = Array.isArray(arr) && arr.includes(true);\n\n return hasChoice && acc;\n }, true);\n};\n\nexport default class Match extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n }\n\n set model(m) {\n // config object props should be part of the model props\n // model.config should be no longer used\n this._model = { ...m, ...(m?.config || {}) };\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n sessionChanged(s) {\n this._session.answers = s.answers;\n const complete = isComplete(this._session, this._model);\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), complete));\n\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onSessionChange: this.sessionChanged.bind(this),\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;mCAMI,IAAI,+CAA+C,KAAI,EAAE,KAAK,CAAC,QAAQ;CAC1E,UAAU;CACV,QAAQ;CACR,UAAU;CACV,SAAS;CACT,YAAY;CACZ,OAAO;CACP,WAAW;EACV,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,OAAO;EACP,YAAY;EACZ,WAAW;CACZ;CACA,gBAAgB;EACf,QAAQ;EACR,YAAY;EACZ,OAAO;EACP,WAAW;CACZ;CACA,UAAU;EACT,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,YAAY;EACZ,OAAO;CACR;CACA,eAAe;EACd,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,OAAO;CACR;AACD,EAAE,GAAG,KAAK,MAAM;CACf,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,MAAM,GAAG,IAAI,EAAE,IAAI;CAC1D,OAAuB,kBAAE,GAAG;EAC3B,SAAS;EACT,IAAI;EACJ,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