alexsys-exam-renderer 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { useSortable as I } from "@dnd-kit/react/sortable";
8
8
  //#region src/exam-session/examScoring.ts
9
9
  var re = 1e3, L = 600, R = 70;
10
10
  function ie(e, t) {
11
- let n = e.sections.filter((e) => e.isScored !== !1).map((e) => ae(e, t)), r = H(n, (e) => e.correctCount), i = H(n, (e) => e.incorrectCount), a = H(n, (e) => e.unansweredCount), o = i + a, s = H(n, (e) => e.totalUnits), c = Ce(H(n, (e) => e.maxScore)), l = Ce(H(n, (e) => e.score));
11
+ let n = e.sections.filter((e) => e.isScored !== !1).map((e) => ae(e, t)), r = H(n, (e) => e.correctCount), i = H(n, (e) => e.incorrectCount), a = H(n, (e) => e.unansweredCount), o = i + a, s = H(n, (e) => e.totalUnits), c = we(H(n, (e) => e.maxScore)), l = we(H(n, (e) => e.score));
12
12
  return {
13
13
  attentionWarningCount: 0,
14
14
  correctCount: r,
@@ -16,7 +16,7 @@ function ie(e, t) {
16
16
  incorrectCount: i,
17
17
  maxScore: c,
18
18
  notCorrectCount: o,
19
- percentage: c > 0 ? Ce(l / c * 100) : 0,
19
+ percentage: c > 0 ? we(l / c * 100) : 0,
20
20
  score: l,
21
21
  sections: n,
22
22
  subject: e.subject,
@@ -29,7 +29,7 @@ function ae(e, t) {
29
29
  let n = e.questions.flatMap((e) => oe(e, t)).map((t) => ({
30
30
  ...t,
31
31
  sectionId: e.id
32
- })), r = Number.parseFloat(e.points) || 0, i = Se(n, "correct"), a = Se(n, "incorrect"), o = Se(n, "unanswered"), s = a + o, c = n.length > 0 ? r / n.length : 0;
32
+ })), r = Number.parseFloat(e.points) || 0, i = Ce(n, "correct"), a = Ce(n, "incorrect"), o = Ce(n, "unanswered"), s = a + o, c = n.length > 0 ? r / n.length : 0;
33
33
  return {
34
34
  badge: e.badge,
35
35
  correctCount: i,
@@ -37,7 +37,7 @@ function ae(e, t) {
37
37
  incorrectCount: a,
38
38
  maxScore: r,
39
39
  notCorrectCount: s,
40
- score: Ce(i * c),
40
+ score: we(i * c),
41
41
  title: e.title,
42
42
  tone: e.tone,
43
43
  totalUnits: n.length,
@@ -59,79 +59,83 @@ function oe(e, t) {
59
59
  return [B(r, e.id, n.before, n.correctAnswer, t[r])];
60
60
  });
61
61
  case "number-line": return [B(e.id, e.id, e.expression, e.correctAnswer, t[e.id])];
62
- case "visual-choice": return se(e.id, e.id, e.grading.pairs, t[e.id]);
63
- case "length-estimation": return ce(e, t);
64
- case "shape-choice": return se(e.id, e.id, e.grading.pairs, t[e.id]);
65
- case "drag-match": return se(e.id, e.id, e.grading?.pairs, t[e.id]);
66
- case "drawing-grid": return [pe(e, t[e.id])];
67
- case "table-response": return ue(e, t[e.id]);
62
+ case "operation-solving": return [B(e.id, e.id, se(e), e.correctAnswer, t[e.id])];
63
+ case "visual-choice": return ce(e.id, e.id, e.grading.pairs, t[e.id]);
64
+ case "length-estimation": return le(e, t);
65
+ case "shape-choice": return ce(e.id, e.id, e.grading.pairs, t[e.id]);
66
+ case "drag-match": return ce(e.id, e.id, e.grading?.pairs, t[e.id]);
67
+ case "drawing-grid": return [me(e, t[e.id])];
68
+ case "table-response": return de(e, t[e.id]);
68
69
  case "text-input": return e.correctAnswer ? [B(e.id, e.id, e.prompt, e.correctAnswer, t[e.id])] : [];
69
70
  case "word-problem": return e.parts.flatMap((n) => {
70
71
  let r = `${e.id}:${n.id}`;
71
- return n.type === "coin-table" ? de(e.id, n, t[r]) : n.correctAnswer ? [B(r, e.id, n.prompt, n.correctAnswer, t[r])] : [];
72
+ return n.type === "coin-table" ? fe(e.id, n, t[r]) : n.correctAnswer ? [B(r, e.id, n.prompt, n.correctAnswer, t[r])] : [];
72
73
  });
73
74
  case "sortable-answer": return [];
74
- case "label-placement": return fe(e.id, e.grading?.targetsByLabelId, t[e.id]);
75
+ case "label-placement": return pe(e.id, e.grading?.targetsByLabelId, t[e.id]);
75
76
  case "audio-recording": return [z(e, t[e.id])];
76
77
  }
77
78
  }
78
79
  function z(e, t) {
79
80
  return t?.kind === "audio-recording" ? V(e.id, e.id, e.expectedAnswer, t.evaluation.isCorrect ? "correct" : "incorrect") : V(e.id, e.id, e.expectedAnswer, "unanswered");
80
81
  }
82
+ function se(e) {
83
+ return `${e.leftOperand} ${e.operator} ${e.rightOperand} =`;
84
+ }
81
85
  function B(e, t, n, r, i) {
82
- return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ? V(e, t, n, "unanswered") : V(e, t, n, i.recognizedValue && be(i.recognizedValue, r) ? "correct" : "incorrect") : i?.kind !== "text" || xe(i.value) === "" ? V(e, t, n, "unanswered") : V(e, t, n, be(i.value, r) ? "correct" : "incorrect") : V(e, t, n, "incorrect");
86
+ return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ? V(e, t, n, "unanswered") : V(e, t, n, i.recognizedValue && xe(i.recognizedValue, r) ? "correct" : "incorrect") : i?.kind !== "text" || Se(i.value) === "" ? V(e, t, n, "unanswered") : V(e, t, n, xe(i.value, r) ? "correct" : "incorrect") : V(e, t, n, "incorrect");
83
87
  }
84
- function se(e, t, n, r) {
88
+ function ce(e, t, n, r) {
85
89
  return n ? Object.entries(n).map(([n, i]) => {
86
90
  let a = r?.kind === "matches" ? r.pairs[n] : void 0, o = a ? a === i ? "correct" : "incorrect" : "unanswered";
87
91
  return V(`${e}:${n}`, t, n, o);
88
92
  }) : [];
89
93
  }
90
- function ce(e, t) {
94
+ function le(e, t) {
91
95
  let n = e.items.map((n) => {
92
96
  let r = `${e.id}:squares:${n.id}`;
93
97
  return B(r, e.id, n.label, n.squareLength.toString(), t[r]);
94
98
  }), r = e.items.flatMap((n) => {
95
99
  if (!n.correctColorId) return [];
96
100
  let r = `${e.id}:color:${n.id}`;
97
- return [le(r, e.id, n.label, n.correctColorId, t[r])];
101
+ return [ue(r, e.id, n.label, n.correctColorId, t[r])];
98
102
  });
99
103
  return n.concat(r);
100
104
  }
101
- function le(e, t, n, r, i) {
105
+ function ue(e, t, n, r, i) {
102
106
  return i?.kind !== "choice" || !i.choiceId ? V(e, t, n, "unanswered") : V(e, t, n, i.choiceId === r ? "correct" : "incorrect");
103
107
  }
104
- function ue(e, t) {
108
+ function de(e, t) {
105
109
  return e.columns.flatMap((n) => {
106
110
  if (typeof n.correctCount != "number") return [];
107
111
  let r = t?.kind === "coin-table" ? t.counts[n.id] : void 0, i = r === void 0 ? "unanswered" : r === n.correctCount ? "correct" : "incorrect";
108
112
  return V(`${e.id}:${n.id}`, e.id, n.title, i);
109
113
  });
110
114
  }
111
- function de(e, t, n) {
115
+ function fe(e, t, n) {
112
116
  return t.columns.flatMap((r) => {
113
117
  if (typeof r.correctCount != "number") return [];
114
118
  let i = n?.kind === "coin-table" ? n.counts[r.id] : void 0, a = i === void 0 ? "unanswered" : i === r.correctCount ? "correct" : "incorrect";
115
119
  return V(`${e}:${t.id}:${r.id}`, e, r.title, a);
116
120
  });
117
121
  }
118
- function fe(e, t, n) {
122
+ function pe(e, t, n) {
119
123
  return t ? Object.entries(t).map(([t, r]) => {
120
124
  let i = n?.kind === "placements" ? n.placements[t]?.targetId : void 0, a = i ? i === r ? "correct" : "incorrect" : "unanswered";
121
125
  return V(`${e}:${t}`, e, t, a);
122
126
  }) : [];
123
127
  }
124
- function pe(e, t) {
128
+ function me(e, t) {
125
129
  let n = e.grading.expectedSegments, r = t?.kind === "drawing" && ((t.elements?.length ?? 0) > 0 || (t.strokes?.length ?? 0) > 0);
126
130
  if (t?.kind !== "drawing" || !r) return V(e.id, e.id, e.prompt, "unanswered");
127
- let i = n.every((n) => me(t, e, n));
131
+ let i = n.every((n) => he(t, e, n));
128
132
  return V(e.id, e.id, e.prompt, i ? "correct" : "incorrect");
129
133
  }
130
- function me(e, t, n) {
131
- let r = ve(t, n.from), i = ve(t, n.to);
132
- return !r || !i ? !1 : he(e).some((e) => ge(e, r, i));
134
+ function he(e, t, n) {
135
+ let r = ye(t, n.from), i = ye(t, n.to);
136
+ return !r || !i ? !1 : ge(e).some((e) => _e(e, r, i));
133
137
  }
134
- function he(e) {
138
+ function ge(e) {
135
139
  let t = e.elements.flatMap((e) => e.type === "line" ? [{
136
140
  end: {
137
141
  x: e.points[2],
@@ -165,25 +169,25 @@ function he(e) {
165
169
  }]) ?? [];
166
170
  return t.concat(n);
167
171
  }
168
- function ge(e, t, n) {
172
+ function _e(e, t, n) {
169
173
  let r = U(e.start, t) <= R && U(e.end, n) <= R, i = U(e.start, n) <= R && U(e.end, t) <= R;
170
- return !r && !i ? !1 : _e(e.points, t, n, R);
174
+ return !r && !i ? !1 : ve(e.points, t, n, R);
171
175
  }
172
- function _e(e, t, n, r) {
173
- for (let i = 0; i < e.length - 1; i += 4) if (we({
176
+ function ve(e, t, n, r) {
177
+ for (let i = 0; i < e.length - 1; i += 4) if (Te({
174
178
  x: e[i],
175
179
  y: e[i + 1]
176
180
  }, t, n) > r) return !1;
177
181
  return !0;
178
182
  }
179
- function ve(e, t) {
183
+ function ye(e, t) {
180
184
  if ("pointId" in t) {
181
185
  let n = e.points.find((e) => e.id === t.pointId);
182
- return n ? ye(n.x, n.y) : null;
186
+ return n ? be(n.x, n.y) : null;
183
187
  }
184
- return ye(t.percentX, t.percentY);
188
+ return be(t.percentX, t.percentY);
185
189
  }
186
- function ye(e, t) {
190
+ function be(e, t) {
187
191
  return {
188
192
  x: e / 100 * re,
189
193
  y: t / 100 * L
@@ -197,26 +201,26 @@ function V(e, t, n, r) {
197
201
  status: r
198
202
  };
199
203
  }
200
- function be(e, t) {
201
- let n = xe(e), r = xe(t), i = Number(n), a = Number(r);
204
+ function xe(e, t) {
205
+ let n = Se(e), r = Se(t), i = Number(n), a = Number(r);
202
206
  return Number.isFinite(i) && Number.isFinite(a) ? i === a : n === r;
203
207
  }
204
- function xe(e) {
208
+ function Se(e) {
205
209
  return e.trim().replace(/[٠-٩]/g, (e) => `${e.charCodeAt(0) - 1632}`).replace(/[۰-۹]/g, (e) => `${e.charCodeAt(0) - 1776}`);
206
210
  }
207
- function Se(e, t) {
211
+ function Ce(e, t) {
208
212
  return e.filter((e) => e.status === t).length;
209
213
  }
210
214
  function H(e, t) {
211
215
  return e.reduce((e, n) => e + t(n), 0);
212
216
  }
213
- function Ce(e) {
217
+ function we(e) {
214
218
  return Math.round(e * 100) / 100;
215
219
  }
216
220
  function U(e, t) {
217
221
  return Math.hypot(e.x - t.x, e.y - t.y);
218
222
  }
219
- function we(e, t, n) {
223
+ function Te(e, t, n) {
220
224
  let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
221
225
  if (a === 0) return U(e, t);
222
226
  let o = Math.max(0, Math.min(1, ((e.x - t.x) * r + (e.y - t.y) * i) / a));
@@ -227,11 +231,11 @@ function we(e, t, n) {
227
231
  }
228
232
  //#endregion
229
233
  //#region src/exam-session/interactions/CoinTableResponse.tsx
230
- var Te = 0, Ee = 12;
231
- function De({ columns: e, value: t, onChange: n }) {
234
+ var Ee = 0, De = 12;
235
+ function Oe({ columns: e, value: t, onChange: n }) {
232
236
  let r = t?.counts ?? {};
233
237
  function i(e, t) {
234
- let i = e.maxCoins ?? Ee, a = Math.max(Te, Math.min(i, t));
238
+ let i = e.maxCoins ?? De, a = Math.max(Ee, Math.min(i, t));
235
239
  n({
236
240
  kind: "coin-table",
237
241
  counts: {
@@ -243,7 +247,7 @@ function De({ columns: e, value: t, onChange: n }) {
243
247
  return /* @__PURE__ */ o("div", {
244
248
  className: "response-table",
245
249
  children: e.map((e) => {
246
- let t = r[e.id] ?? 0, n = e.maxCoins ?? Ee;
250
+ let t = r[e.id] ?? 0, n = e.maxCoins ?? De;
247
251
  return /* @__PURE__ */ s("div", {
248
252
  className: "response-column",
249
253
  children: [
@@ -268,7 +272,7 @@ function De({ columns: e, value: t, onChange: n }) {
268
272
  children: "إِضافَةٌ"
269
273
  }), /* @__PURE__ */ o("button", {
270
274
  className: "coin-action coin-action--secondary",
271
- disabled: t <= Te,
275
+ disabled: t <= Ee,
272
276
  onClick: () => i(e, t - 1),
273
277
  type: "button",
274
278
  children: "حَذْفٌ"
@@ -295,7 +299,7 @@ function De({ columns: e, value: t, onChange: n }) {
295
299
  }
296
300
  //#endregion
297
301
  //#region src/renderer/shapeCatalog.tsx
298
- var Oe = {
302
+ var ke = {
299
303
  circle: p,
300
304
  diamond: m,
301
305
  heart: _,
@@ -305,7 +309,7 @@ var Oe = {
305
309
  square: C,
306
310
  star: w,
307
311
  triangle: E
308
- }, ke = {
312
+ }, Ae = {
309
313
  circle: "Cercle",
310
314
  diamond: "Losange",
311
315
  heart: "Coeur",
@@ -315,15 +319,15 @@ var Oe = {
315
319
  square: "Carre",
316
320
  star: "Etoile",
317
321
  triangle: "Triangle"
318
- }, Ae = Object.keys(ke).map((e) => ({
319
- label: ke[e],
322
+ }, je = Object.keys(Ae).map((e) => ({
323
+ label: Ae[e],
320
324
  value: e
321
325
  }));
322
- function je(e) {
323
- return ke[e];
326
+ function Me(e) {
327
+ return Ae[e];
324
328
  }
325
- function Me({ shapeId: e, title: t }) {
326
- let n = Oe[e];
329
+ function Ne({ shapeId: e, title: t }) {
330
+ let n = ke[e];
327
331
  return /* @__PURE__ */ o("span", {
328
332
  "aria-label": t,
329
333
  role: t ? "img" : void 0,
@@ -333,7 +337,7 @@ function Me({ shapeId: e, title: t }) {
333
337
  }
334
338
  //#endregion
335
339
  //#region src/exam-session/interactions/DragMatch.tsx
336
- function Ne({ items: e, targets: t, value: n, onChange: r }) {
340
+ function Pe({ items: e, targets: t, value: n, onChange: r }) {
337
341
  let i = n?.pairs ?? {}, a = new Set(Object.values(i));
338
342
  return /* @__PURE__ */ o(c, {
339
343
  onDragEnd: (e) => {
@@ -351,10 +355,10 @@ function Ne({ items: e, targets: t, value: n, onChange: r }) {
351
355
  className: "drag-match",
352
356
  children: [/* @__PURE__ */ o("div", {
353
357
  className: "drag-match__items",
354
- children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Pe, { item: e }, e.id))
358
+ children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Fe, { item: e }, e.id))
355
359
  }), /* @__PURE__ */ o("div", {
356
360
  className: "drag-match__targets",
357
- children: t.map((t) => /* @__PURE__ */ o(Fe, {
361
+ children: t.map((t) => /* @__PURE__ */ o(Ie, {
358
362
  assignedItem: e.find((e) => e.id === i[t.id]),
359
363
  target: t
360
364
  }, t.id))
@@ -362,7 +366,7 @@ function Ne({ items: e, targets: t, value: n, onChange: r }) {
362
366
  })
363
367
  });
364
368
  }
365
- function Pe({ item: e }) {
369
+ function Fe({ item: e }) {
366
370
  let { ref: t, isDragging: n } = l({ id: e.id });
367
371
  return /* @__PURE__ */ o("button", {
368
372
  className: n ? "drag-pill drag-pill--dragging" : "drag-pill",
@@ -371,23 +375,23 @@ function Pe({ item: e }) {
371
375
  children: e.label
372
376
  });
373
377
  }
374
- function Fe({ assignedItem: e, target: t }) {
378
+ function Ie({ assignedItem: e, target: t }) {
375
379
  let { ref: n, isDropTarget: r } = u({ id: t.id });
376
380
  return /* @__PURE__ */ s("div", {
377
381
  className: r ? "drop-slot drop-slot--active" : "drop-slot",
378
382
  ref: n,
379
383
  children: [/* @__PURE__ */ o("span", {
380
384
  className: t.shapeId ? "drop-slot__visual drop-slot__visual--shape" : "drop-slot__visual",
381
- children: t.shapeId ? /* @__PURE__ */ o(Me, {
385
+ children: t.shapeId ? /* @__PURE__ */ o(Ne, {
382
386
  shapeId: t.shapeId,
383
387
  title: t.label
384
388
  }) : t.label
385
- }), e ? /* @__PURE__ */ o(Pe, { item: e }) : /* @__PURE__ */ o("span", { children: "ضع الإجابة هنا" })]
389
+ }), e ? /* @__PURE__ */ o(Fe, { item: e }) : /* @__PURE__ */ o("span", { children: "ضع الإجابة هنا" })]
386
390
  });
387
391
  }
388
392
  //#endregion
389
393
  //#region src/exam-session/interactions/HandwrittenNumberAnswer.tsx
390
- var Ie = 132, W = 88, Le = 650;
394
+ var Le = 132, W = 88, Re = 650;
391
395
  function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
392
396
  let u = l?.strokes ?? [], d = u.length === 0, f = r(n), [p, m] = i(!1), [g, _] = i(!1), v = !!c?.isAvailable(), y = c?.getStatus?.() ?? (v ? "ready" : "unavailable"), b = y === "preparing" || y === "error", x = y === "preparing" ? "preparing-model" : y === "error" ? "model-error" : d || p ? "idle" : l?.recognizedValue === void 0 ? !v || y === "unavailable" ? "unavailable" : g ? "unrecognized" : "recognizing" : "recognized";
393
397
  t(() => {
@@ -406,7 +410,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
406
410
  }).catch(() => {
407
411
  e || _(!0);
408
412
  });
409
- }, Le);
413
+ }, Re);
410
414
  return () => {
411
415
  e = !0, window.clearTimeout(t);
412
416
  };
@@ -421,7 +425,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
421
425
  function S(e) {
422
426
  _(!1), n({
423
427
  canvasHeight: W,
424
- canvasWidth: Ie,
428
+ canvasWidth: Le,
425
429
  kind: "handwritten-number",
426
430
  strokes: e
427
431
  });
@@ -468,7 +472,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
468
472
  onPointerMove: C,
469
473
  onPointerUp: w,
470
474
  role: "img",
471
- width: Ie,
475
+ width: Le,
472
476
  children: [/* @__PURE__ */ s(te, {
473
477
  listening: !1,
474
478
  children: [
@@ -478,7 +482,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
478
482
  height: W,
479
483
  stroke: "#cfe3d9",
480
484
  strokeWidth: 2,
481
- width: Ie,
485
+ width: Le,
482
486
  x: 0,
483
487
  y: 0
484
488
  }),
@@ -487,7 +491,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
487
491
  points: [
488
492
  16,
489
493
  W - 18,
490
- Ie - 16,
494
+ Le - 16,
491
495
  W - 18
492
496
  ],
493
497
  stroke: "#dbe9e2",
@@ -502,7 +506,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
502
506
  height: W,
503
507
  text: "ارسم هنا",
504
508
  verticalAlign: "middle",
505
- width: Ie,
509
+ width: Le,
506
510
  x: 0,
507
511
  y: 0
508
512
  }) : null
@@ -529,12 +533,12 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
529
533
  "aria-live": "polite",
530
534
  className: "handwritten-number-status",
531
535
  "data-state": x,
532
- children: Re(x, l?.recognizedValue)
536
+ children: ze(x, l?.recognizedValue)
533
537
  }) : null
534
538
  ]
535
539
  });
536
540
  }
537
- function Re(e, t) {
541
+ function ze(e, t) {
538
542
  switch (e) {
539
543
  case "recognizing": return "جارٍ التعرّف على الرقم…";
540
544
  case "recognized": return `تمّ التعرّف: ${t ?? ""}`;
@@ -547,7 +551,7 @@ function Re(e, t) {
547
551
  }
548
552
  //#endregion
549
553
  //#region src/exam-session/interactions/ColorPenPicker.tsx
550
- function ze({ ariaLabel: e, className: t = "", colors: n, disabled: r = !1, onChange: i, selectedColorId: a }) {
554
+ function Be({ ariaLabel: e, className: t = "", colors: n, disabled: r = !1, onChange: i, selectedColorId: a }) {
551
555
  return /* @__PURE__ */ o("div", {
552
556
  "aria-label": e,
553
557
  className: ["color-pen-picker", t].filter(Boolean).join(" "),
@@ -592,28 +596,28 @@ var K = [
592
596
  label: "أَسْوَدُ",
593
597
  value: "#17212b"
594
598
  }
595
- ], Be = {
599
+ ], Ve = {
596
600
  black: "#17212b",
597
601
  blue: "#256fd2",
598
602
  green: "#0b7f45",
599
603
  red: "#e34a58"
600
604
  };
601
- function Ve(e, t) {
605
+ function He(e, t) {
602
606
  return t ? e.find((e) => e.id === t || e.value === t)?.id ?? e[0]?.id ?? "green" : e[0]?.id ?? "green";
603
607
  }
604
- function He(e, t) {
608
+ function Ue(e, t) {
605
609
  return e.find((e) => e.id === t)?.value ?? e[0]?.value ?? K[0].value;
606
610
  }
607
- function Ue(e) {
611
+ function We(e) {
608
612
  return e.map((e) => ({
609
613
  id: e.id,
610
614
  label: e.label,
611
- value: Be[e.id] ?? K[0].value
615
+ value: Ve[e.id] ?? K[0].value
612
616
  }));
613
617
  }
614
618
  //#endregion
615
619
  //#region src/exam-session/interactions/GeometryCanvas.tsx
616
- var We = 1e3, Ge = 600, q = 30, Ke = 240, qe = 12, Je = K[0].value, J = "#0a8f55", Ye = [
620
+ var Ge = 1e3, Ke = 600, q = 30, qe = 240, Je = 12, Ye = K[0].value, J = "#0a8f55", Xe = [
617
621
  {
618
622
  id: "pen",
619
623
  icon: "✎",
@@ -644,13 +648,13 @@ var We = 1e3, Ge = 600, q = 30, Ke = 240, qe = 12, Je = K[0].value, J = "#0a8f55
644
648
  icon: "⌖",
645
649
  label: "بَرْكارٌ"
646
650
  }
647
- ], Xe = /* @__PURE__ */ new Set([
651
+ ], Ze = /* @__PURE__ */ new Set([
648
652
  "ruler",
649
653
  "protractor",
650
654
  "compass"
651
655
  ]);
652
- function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, className: a = "", colorOptions: c = K, defaultColor: l, disabled: u = !1, minStageWidth: d = Ke, onChange: f, points: p = [], showColorPalette: m = !0, value: h, variant: g = "question" }) {
653
- let _ = c.length > 0 ? c : K, [v, y] = i(null), [b, x] = i([]), [S, ee] = i(() => Ve(_, l ?? "black")), [C, w] = i(() => st(h)), [T, E] = i(() => h?.guides ?? ot(n, t)), [D, O] = i(null), [k, A] = i({
656
+ function Qe({ actionLabel: e, canvasHeight: t = Ke, canvasWidth: n = Ge, className: a = "", colorOptions: c = K, defaultColor: l, disabled: u = !1, minStageWidth: d = qe, onChange: f, points: p = [], showColorPalette: m = !0, value: h, variant: g = "question" }) {
657
+ let _ = c.length > 0 ? c : K, [v, y] = i(null), [b, x] = i([]), [S, ee] = i(() => He(_, l ?? "black")), [C, w] = i(() => ct(h)), [T, E] = i(() => h?.guides ?? st(n, t)), [D, O] = i(null), [k, A] = i({
654
658
  height: t,
655
659
  scale: 1,
656
660
  width: n
@@ -658,16 +662,16 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
658
662
  canRedo: !1,
659
663
  canUndo: !1
660
664
  }), P = r(null), F = r([Y(C)]), I = r(0), re = r(0), L = r(null);
661
- Qe(P, n, t, d, A);
662
- let R = lt(p, n, t), ie = [
665
+ $e(P, n, t, d, A);
666
+ let R = ut(p, n, t), ie = [
663
667
  "geometry-canvas",
664
668
  `geometry-canvas--${g}`,
665
669
  a
666
- ].filter(Boolean).join(" "), ae = _.some((e) => e.id === S) ? S : Ve(_, "black"), oe = He(_, ae), z = ft(v);
667
- function B(e) {
668
- return Xe.has(e) ? !z && b.includes(e) : v === e || b.includes(e);
669
- }
670
+ ].filter(Boolean).join(" "), ae = _.some((e) => e.id === S) ? S : He(_, "black"), oe = Ue(_, ae), z = pt(v);
670
671
  function se(e) {
672
+ return Ze.has(e) ? !z && b.includes(e) : v === e || b.includes(e);
673
+ }
674
+ function B(e) {
671
675
  x((t) => t.includes(e) ? t.filter((t) => t !== e) : t.concat(e));
672
676
  }
673
677
  function ce(e) {
@@ -676,7 +680,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
676
680
  y(null), x((t) => t.includes(e) ? t : t.concat(e));
677
681
  return;
678
682
  }
679
- se(e);
683
+ B(e);
680
684
  return;
681
685
  }
682
686
  if (e === "compass") {
@@ -697,7 +701,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
697
701
  elements: Y(e),
698
702
  guides: t,
699
703
  kind: "drawing",
700
- strokes: ct(e)
704
+ strokes: lt(e)
701
705
  });
702
706
  }
703
707
  function de() {
@@ -731,19 +735,19 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
731
735
  function _e(e) {
732
736
  let r = e.target.getStage()?.getPointerPosition();
733
737
  return r ? {
734
- x: St(r.x / k.scale, 0, n),
735
- y: St(r.y / k.scale, 0, t)
738
+ x: Ct(r.x / k.scale, 0, n),
739
+ y: Ct(r.y / k.scale, 0, t)
736
740
  } : null;
737
741
  }
738
742
  function ve(e) {
739
- if (u || !z && dt(e.target)) return;
743
+ if (u || !z && ft(e.target)) return;
740
744
  let t = _e(e);
741
745
  if (!t || !v) return;
742
746
  if (v === "eraser") {
743
- be(t);
747
+ V(t);
744
748
  return;
745
749
  }
746
- let n = ut(t, R);
750
+ let n = dt(t, R);
747
751
  if (v === "pen") {
748
752
  L.current = n, O({
749
753
  color: oe,
@@ -782,7 +786,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
782
786
  let t = _e(e);
783
787
  if (t) {
784
788
  if (v === "eraser" && !u) {
785
- be(t);
789
+ V(t);
786
790
  return;
787
791
  }
788
792
  if (!(!D || !L.current || u)) {
@@ -794,7 +798,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
794
798
  return;
795
799
  }
796
800
  if (D.type === "line") {
797
- let e = ut(t, R);
801
+ let e = dt(t, R);
798
802
  O({
799
803
  ...D,
800
804
  points: [
@@ -813,13 +817,13 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
813
817
  }
814
818
  }
815
819
  }
816
- function V() {
820
+ function be() {
817
821
  if (!D || u) {
818
822
  L.current = null, O(null);
819
823
  return;
820
824
  }
821
825
  let e = D;
822
- if (L.current = null, O(null), mt(e)) {
826
+ if (L.current = null, O(null), ht(e)) {
823
827
  if (e.type === "circle") {
824
828
  let t = {
825
829
  ...T,
@@ -834,9 +838,9 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
834
838
  fe(C.concat(e));
835
839
  }
836
840
  }
837
- function be(e) {
841
+ function V(e) {
838
842
  if (C.length === 0) return;
839
- let t = ht(C, e);
843
+ let t = gt(C, e);
840
844
  t < 0 || fe(C.filter((e, n) => n !== t));
841
845
  }
842
846
  return /* @__PURE__ */ s("div", {
@@ -847,12 +851,12 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
847
851
  /* @__PURE__ */ o("div", {
848
852
  className: "geometry-toolbar",
849
853
  "aria-label": "أَدَواتُ الوَرَقَةِ المُسَوَّدَةِ",
850
- children: Ye.map((e) => /* @__PURE__ */ s("button", {
851
- "aria-pressed": B(e.id),
854
+ children: Xe.map((e) => /* @__PURE__ */ s("button", {
855
+ "aria-pressed": se(e.id),
852
856
  className: [
853
857
  "geometry-tool-button",
854
- B(e.id) ? "geometry-tool-button--active" : "",
855
- Xe.has(e.id) ? "geometry-tool-button--guide" : ""
858
+ se(e.id) ? "geometry-tool-button--active" : "",
859
+ Ze.has(e.id) ? "geometry-tool-button--guide" : ""
856
860
  ].filter(Boolean).join(" "),
857
861
  disabled: u,
858
862
  onClick: () => ce(e.id),
@@ -863,7 +867,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
863
867
  }), /* @__PURE__ */ o("span", { children: e.label })]
864
868
  }, e.id))
865
869
  }),
866
- m ? /* @__PURE__ */ o(ze, {
870
+ m ? /* @__PURE__ */ o(Be, {
867
871
  ariaLabel: "أَلْوانُ الأَقْلامِ",
868
872
  className: "geometry-color-picker",
869
873
  colors: _,
@@ -877,10 +881,10 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
877
881
  children: /* @__PURE__ */ o(ne, {
878
882
  height: k.height,
879
883
  onMouseDown: ve,
880
- onMouseLeave: V,
884
+ onMouseLeave: be,
881
885
  onMouseMove: ye,
882
- onMouseUp: V,
883
- onTouchEnd: V,
886
+ onMouseUp: be,
887
+ onTouchEnd: be,
884
888
  onTouchMove: ye,
885
889
  onTouchStart: ve,
886
890
  width: k.width,
@@ -895,18 +899,18 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
895
899
  strokeWidth: 1,
896
900
  width: n
897
901
  }),
898
- /* @__PURE__ */ o($e, {
902
+ /* @__PURE__ */ o(et, {
899
903
  canvasHeight: t,
900
904
  canvasWidth: n
901
905
  }),
902
- p.map((e, r) => e.hidden ? null : /* @__PURE__ */ o(et, {
903
- label: tt(e, r),
906
+ p.map((e, r) => e.hidden ? null : /* @__PURE__ */ o(tt, {
907
+ label: nt(e, r),
904
908
  x: e.x / 100 * n,
905
909
  y: e.y / 100 * t
906
910
  }, e.id)),
907
- C.map((e) => at(e)),
908
- D ? at(D, !0) : null,
909
- b.includes("ruler") ? /* @__PURE__ */ o(nt, {
911
+ C.map((e) => ot(e)),
912
+ D ? ot(D, !0) : null,
913
+ b.includes("ruler") ? /* @__PURE__ */ o(rt, {
910
914
  disabled: u,
911
915
  guide: T.ruler,
912
916
  locked: z,
@@ -915,7 +919,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
915
919
  ruler: e
916
920
  })
917
921
  }, `${T.ruler.x}:${T.ruler.y}:${T.ruler.length}:${T.ruler.rotation}`) : null,
918
- b.includes("protractor") ? /* @__PURE__ */ o(rt, {
922
+ b.includes("protractor") ? /* @__PURE__ */ o(it, {
919
923
  disabled: u,
920
924
  guide: T.protractor,
921
925
  locked: z,
@@ -924,7 +928,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
924
928
  protractor: e
925
929
  })
926
930
  }) : null,
927
- b.includes("compass") ? /* @__PURE__ */ o(it, {
931
+ b.includes("compass") ? /* @__PURE__ */ o(at, {
928
932
  disabled: u,
929
933
  guide: T.compass,
930
934
  locked: z,
@@ -964,7 +968,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
964
968
  ]
965
969
  });
966
970
  }
967
- function Qe(e, n, r, i, a) {
971
+ function $e(e, n, r, i, a) {
968
972
  t(() => {
969
973
  let t = e.current;
970
974
  if (!t) return;
@@ -990,7 +994,7 @@ function Qe(e, n, r, i, a) {
990
994
  a
991
995
  ]);
992
996
  }
993
- function $e({ canvasHeight: e, canvasWidth: t }) {
997
+ function et({ canvasHeight: e, canvasWidth: t }) {
994
998
  let n = Math.floor(t / q), r = Math.floor(e / q);
995
999
  return /* @__PURE__ */ s(a, { children: [Array.from({ length: n + 1 }, (t, n) => /* @__PURE__ */ o(M, {
996
1000
  points: [
@@ -1012,7 +1016,7 @@ function $e({ canvasHeight: e, canvasWidth: t }) {
1012
1016
  strokeWidth: 1
1013
1017
  }, `horizontal-${n}`))] });
1014
1018
  }
1015
- function et({ label: e, x: t, y: n }) {
1019
+ function tt({ label: e, x: t, y: n }) {
1016
1020
  return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(A, {
1017
1021
  fill: "#e63542",
1018
1022
  radius: 4.75,
@@ -1031,18 +1035,18 @@ function et({ label: e, x: t, y: n }) {
1031
1035
  y: n - 18
1032
1036
  })] });
1033
1037
  }
1034
- function tt(e, t) {
1038
+ function nt(e, t) {
1035
1039
  let n = e.label?.trim();
1036
1040
  return n && n.length > 0 ? n : String(t + 1);
1037
1041
  }
1038
- function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
1042
+ function rt({ disabled: e, guide: t, locked: n, onCommit: c }) {
1039
1043
  let [l, u] = i(t), d = r(t), f = l.length / 2, p = f + 44, m = -f - 44, h = f + 8, g = -f - 8, _ = !e && !n;
1040
1044
  function v(e) {
1041
1045
  d.current = e, u(e);
1042
1046
  }
1043
1047
  function y(e) {
1044
1048
  e.cancelBubble = !0;
1045
- let t = pt(e);
1049
+ let t = mt(e);
1046
1050
  t && (v({
1047
1051
  ...d.current,
1048
1052
  x: t.x,
@@ -1060,8 +1064,8 @@ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
1060
1064
  }
1061
1065
  function x(e, t) {
1062
1066
  e.cancelBubble = !0;
1063
- let n = pt(e);
1064
- n && (v(bt(d.current, n, t)), e.currentTarget.position({
1067
+ let n = mt(e);
1068
+ n && (v(xt(d.current, n, t)), e.currentTarget.position({
1065
1069
  x: 0,
1066
1070
  y: 0
1067
1071
  }));
@@ -1069,7 +1073,7 @@ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
1069
1073
  function S() {
1070
1074
  let e = {
1071
1075
  ...d.current,
1072
- rotation: Ct(d.current.rotation + 90)
1076
+ rotation: wt(d.current.rotation + 90)
1073
1077
  };
1074
1078
  v(e), c(e);
1075
1079
  }
@@ -1231,8 +1235,8 @@ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
1231
1235
  ]
1232
1236
  }) });
1233
1237
  }
1234
- function rt({ disabled: e, guide: t, locked: n, onChange: r }) {
1235
- let i = !e && !n, c = vt({
1238
+ function it({ disabled: e, guide: t, locked: n, onChange: r }) {
1239
+ let i = !e && !n, c = yt({
1236
1240
  x: 136,
1237
1241
  y: 0
1238
1242
  }, t.rotation, {
@@ -1325,7 +1329,7 @@ function rt({ disabled: e, guide: t, locked: n, onChange: r }) {
1325
1329
  y: c.y
1326
1330
  })] });
1327
1331
  }
1328
- function it({ disabled: e, guide: t, locked: n, onChange: r }) {
1332
+ function at({ disabled: e, guide: t, locked: n, onChange: r }) {
1329
1333
  let i = !e && !n, c = {
1330
1334
  x: t.center.x + t.radius,
1331
1335
  y: t.center.y
@@ -1410,7 +1414,7 @@ function it({ disabled: e, guide: t, locked: n, onChange: r }) {
1410
1414
  })
1411
1415
  ] });
1412
1416
  }
1413
- function at(e, t = !1) {
1417
+ function ot(e, t = !1) {
1414
1418
  let n = t ? .58 : 1;
1415
1419
  return e.type === "freehand" ? /* @__PURE__ */ o(M, {
1416
1420
  lineCap: "round",
@@ -1435,7 +1439,7 @@ function at(e, t = !1) {
1435
1439
  y: e.center.y
1436
1440
  }, e.id);
1437
1441
  }
1438
- function ot(e, t) {
1442
+ function st(e, t) {
1439
1443
  return {
1440
1444
  compass: {
1441
1445
  center: {
@@ -1457,16 +1461,16 @@ function ot(e, t) {
1457
1461
  }
1458
1462
  };
1459
1463
  }
1460
- function st(e) {
1464
+ function ct(e) {
1461
1465
  return e?.elements?.length ? Y(e.elements) : (e?.strokes ?? []).filter((e) => e.tool === "pen" && e.points.length >= 4).map((e) => ({
1462
- color: Je,
1466
+ color: Ye,
1463
1467
  id: e.id,
1464
1468
  points: e.points.slice(),
1465
1469
  strokeWidth: 4,
1466
1470
  type: "freehand"
1467
1471
  }));
1468
1472
  }
1469
- function ct(e) {
1473
+ function lt(e) {
1470
1474
  return e.flatMap((e) => e.type === "freehand" ? [{
1471
1475
  id: e.id,
1472
1476
  points: e.points.slice(),
@@ -1494,7 +1498,7 @@ function Y(e) {
1494
1498
  center: { ...e.center }
1495
1499
  });
1496
1500
  }
1497
- function lt(e, t, n) {
1501
+ function ut(e, t, n) {
1498
1502
  let r = e.map((e) => ({
1499
1503
  x: e.x / 100 * t,
1500
1504
  y: e.y / 100 * n
@@ -1505,14 +1509,14 @@ function lt(e, t, n) {
1505
1509
  });
1506
1510
  return r.concat(i);
1507
1511
  }
1508
- function ut(e, t) {
1509
- let n = e, r = qe;
1512
+ function dt(e, t) {
1513
+ let n = e, r = Je;
1510
1514
  return t.forEach((t) => {
1511
1515
  let i = X(e, t);
1512
1516
  i < r && (n = t, r = i);
1513
1517
  }), n;
1514
1518
  }
1515
- function dt(e) {
1519
+ function ft(e) {
1516
1520
  let t = e;
1517
1521
  for (; t;) {
1518
1522
  if (t.name().split(" ").includes("geometry-guide")) return !0;
@@ -1520,10 +1524,10 @@ function dt(e) {
1520
1524
  }
1521
1525
  return !1;
1522
1526
  }
1523
- function ft(e) {
1527
+ function pt(e) {
1524
1528
  return e === "pen" || e === "line" || e === "eraser";
1525
1529
  }
1526
- function pt(e) {
1530
+ function mt(e) {
1527
1531
  let t = e.target.getStage()?.getPointerPosition();
1528
1532
  if (!t) return null;
1529
1533
  let n = e.target.getLayer(), r = n?.scaleX() || 1, i = n?.scaleY() || r;
@@ -1532,16 +1536,16 @@ function pt(e) {
1532
1536
  y: t.y / i
1533
1537
  };
1534
1538
  }
1535
- function mt(e) {
1536
- return e.type === "freehand" ? e.points.length >= 4 : e.type === "line" ? xt(e.points) > 6 : e.radius > 6;
1539
+ function ht(e) {
1540
+ return e.type === "freehand" ? e.points.length >= 4 : e.type === "line" ? St(e.points) > 6 : e.radius > 6;
1537
1541
  }
1538
- function ht(e, t) {
1539
- for (let n = e.length - 1; n >= 0; --n) if (gt(e[n], t)) return n;
1542
+ function gt(e, t) {
1543
+ for (let n = e.length - 1; n >= 0; --n) if (_t(e[n], t)) return n;
1540
1544
  return -1;
1541
1545
  }
1542
- function gt(e, t) {
1546
+ function _t(e, t) {
1543
1547
  if (e.type === "circle") return Math.abs(X(e.center, t) - e.radius) <= 14;
1544
- for (let n = 0; n < e.points.length - 2; n += 2) if (_t(t, {
1548
+ for (let n = 0; n < e.points.length - 2; n += 2) if (vt(t, {
1545
1549
  x1: e.points[n],
1546
1550
  x2: e.points[n + 2],
1547
1551
  y1: e.points[n + 1],
@@ -1549,27 +1553,27 @@ function gt(e, t) {
1549
1553
  }) <= 14) return !0;
1550
1554
  return !1;
1551
1555
  }
1552
- function _t(e, t) {
1556
+ function vt(e, t) {
1553
1557
  let n = t.x2 - t.x1, r = t.y2 - t.y1, i = n * n + r * r;
1554
1558
  if (i === 0) return X(e, {
1555
1559
  x: t.x1,
1556
1560
  y: t.y1
1557
1561
  });
1558
- let a = St(((e.x - t.x1) * n + (e.y - t.y1) * r) / i, 0, 1);
1562
+ let a = Ct(((e.x - t.x1) * n + (e.y - t.y1) * r) / i, 0, 1);
1559
1563
  return X(e, {
1560
1564
  x: t.x1 + a * n,
1561
1565
  y: t.y1 + a * r
1562
1566
  });
1563
1567
  }
1564
- function vt(e, t, n) {
1568
+ function yt(e, t, n) {
1565
1569
  let r = t * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
1566
1570
  return {
1567
1571
  x: n.x + e.x * i - e.y * a,
1568
1572
  y: n.y + e.x * a + e.y * i
1569
1573
  };
1570
1574
  }
1571
- function yt(e, t) {
1572
- return vt({
1575
+ function bt(e, t) {
1576
+ return yt({
1573
1577
  x: t === "left" ? -e.length / 2 : e.length / 2,
1574
1578
  y: 0
1575
1579
  }, e.rotation, {
@@ -1577,8 +1581,8 @@ function yt(e, t) {
1577
1581
  y: e.y
1578
1582
  });
1579
1583
  }
1580
- function bt(e, t, n) {
1581
- let r = n === "right" ? "left" : "right", i = yt(e, r), a = Math.atan2(t.y - i.y, t.x - i.x) * 180 / Math.PI, o = Ct(n === "right" ? a : a + 180), s = o * Math.PI / 180, c = e.length / 2, l = r === "left" ? 1 : -1;
1584
+ function xt(e, t, n) {
1585
+ let r = n === "right" ? "left" : "right", i = bt(e, r), a = Math.atan2(t.y - i.y, t.x - i.x) * 180 / Math.PI, o = wt(n === "right" ? a : a + 180), s = o * Math.PI / 180, c = e.length / 2, l = r === "left" ? 1 : -1;
1582
1586
  return {
1583
1587
  ...e,
1584
1588
  rotation: o,
@@ -1586,7 +1590,7 @@ function bt(e, t, n) {
1586
1590
  y: i.y + Math.sin(s) * c * l
1587
1591
  };
1588
1592
  }
1589
- function xt(e) {
1593
+ function St(e) {
1590
1594
  return X({
1591
1595
  x: e[0],
1592
1596
  y: e[1]
@@ -1598,16 +1602,16 @@ function xt(e) {
1598
1602
  function X(e, t) {
1599
1603
  return Math.hypot(e.x - t.x, e.y - t.y);
1600
1604
  }
1601
- function St(e, t, n) {
1605
+ function Ct(e, t, n) {
1602
1606
  return Math.min(Math.max(e, t), n);
1603
1607
  }
1604
- function Ct(e) {
1608
+ function wt(e) {
1605
1609
  return (e % 360 + 360) % 360;
1606
1610
  }
1607
1611
  //#endregion
1608
1612
  //#region src/exam-session/interactions/KonvaDrawingGrid.tsx
1609
- function wt({ points: e, value: t, onChange: n }) {
1610
- return /* @__PURE__ */ o(Ze, {
1613
+ function Tt({ points: e, value: t, onChange: n }) {
1614
+ return /* @__PURE__ */ o(Qe, {
1611
1615
  onChange: n,
1612
1616
  points: e,
1613
1617
  value: t,
@@ -1616,7 +1620,7 @@ function wt({ points: e, value: t, onChange: n }) {
1616
1620
  }
1617
1621
  //#endregion
1618
1622
  //#region src/exam-session/interactions/LabelPlacement.tsx
1619
- function Tt({ labels: e, targets: t, value: n, onChange: r }) {
1623
+ function Et({ labels: e, targets: t, value: n, onChange: r }) {
1620
1624
  let i = n?.placements ?? {}, a = new Set(Object.keys(i));
1621
1625
  return /* @__PURE__ */ o(c, {
1622
1626
  onDragEnd: (e) => {
@@ -1639,10 +1643,10 @@ function Tt({ labels: e, targets: t, value: n, onChange: r }) {
1639
1643
  className: "label-placement",
1640
1644
  children: [/* @__PURE__ */ o("div", {
1641
1645
  className: "label-placement__bank",
1642
- children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Et, { label: e }, e.id))
1646
+ children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Dt, { label: e }, e.id))
1643
1647
  }), /* @__PURE__ */ o("div", {
1644
1648
  className: "label-placement__diagram",
1645
- children: t.map((t) => /* @__PURE__ */ o(Dt, {
1649
+ children: t.map((t) => /* @__PURE__ */ o(Ot, {
1646
1650
  label: e.find((e) => i[e.id]?.targetId === t.id),
1647
1651
  target: t
1648
1652
  }, t.id))
@@ -1650,7 +1654,7 @@ function Tt({ labels: e, targets: t, value: n, onChange: r }) {
1650
1654
  })
1651
1655
  });
1652
1656
  }
1653
- function Et({ label: e }) {
1657
+ function Dt({ label: e }) {
1654
1658
  let { ref: t, isDragging: n } = l({ id: e.id });
1655
1659
  return /* @__PURE__ */ o("button", {
1656
1660
  className: n ? "placement-label placement-label--dragging" : "placement-label",
@@ -1659,7 +1663,7 @@ function Et({ label: e }) {
1659
1663
  children: e.label
1660
1664
  });
1661
1665
  }
1662
- function Dt({ label: e, target: t }) {
1666
+ function Ot({ label: e, target: t }) {
1663
1667
  let { ref: n, isDropTarget: r } = u({ id: t.id });
1664
1668
  return /* @__PURE__ */ s("div", {
1665
1669
  className: r ? "placement-target placement-target--active" : "placement-target",
@@ -1671,15 +1675,15 @@ function Dt({ label: e, target: t }) {
1671
1675
  children: [/* @__PURE__ */ o("span", {
1672
1676
  "aria-hidden": "true",
1673
1677
  children: t.label
1674
- }), e ? /* @__PURE__ */ o(Et, { label: e }) : null]
1678
+ }), e ? /* @__PURE__ */ o(Dt, { label: e }) : null]
1675
1679
  });
1676
1680
  }
1677
1681
  //#endregion
1678
1682
  //#region src/exam-session/interactions/NumberLineAnswer.tsx
1679
- function Ot({ answerId: e, expression: t, value: n, onChange: r, onClear: i, recognizer: a }) {
1683
+ function kt({ answerId: e, expression: t, value: n, onChange: r, onClear: i, recognizer: a }) {
1680
1684
  return /* @__PURE__ */ s("div", {
1681
1685
  className: "number-line-layout",
1682
- children: [/* @__PURE__ */ o(kt, {}), /* @__PURE__ */ s("div", {
1686
+ children: [/* @__PURE__ */ o(At, {}), /* @__PURE__ */ s("div", {
1683
1687
  className: "compact-answer",
1684
1688
  children: [/* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(G, {
1685
1689
  ariaLabel: t,
@@ -1691,7 +1695,7 @@ function Ot({ answerId: e, expression: t, value: n, onChange: r, onClear: i, rec
1691
1695
  })]
1692
1696
  });
1693
1697
  }
1694
- function kt() {
1698
+ function At() {
1695
1699
  return /* @__PURE__ */ s("svg", {
1696
1700
  className: "number-line",
1697
1701
  viewBox: "0 0 520 86",
@@ -1718,8 +1722,152 @@ function kt() {
1718
1722
  });
1719
1723
  }
1720
1724
  //#endregion
1725
+ //#region src/exam-session/interactions/OperationWorkArea.tsx
1726
+ var Z = 900, jt = 300, Mt = 260;
1727
+ function Nt({ ariaLabel: e, onChange: n, onClear: a, value: c }) {
1728
+ let l = r(null), [u, d] = i(() => Pt(c)), [f, p] = i(!1), [m, g] = i({
1729
+ height: jt,
1730
+ scale: 1,
1731
+ width: Z
1732
+ }), _ = u.length === 0;
1733
+ t(() => {
1734
+ d(Pt(c));
1735
+ }, [c]), t(() => {
1736
+ let e = l.current;
1737
+ if (!e) return;
1738
+ function t() {
1739
+ let t = Math.max(Mt, Math.min(Z, e?.clientWidth ?? Z)), n = t / Z;
1740
+ g({
1741
+ height: jt * n,
1742
+ scale: n,
1743
+ width: t
1744
+ });
1745
+ }
1746
+ t();
1747
+ let n = new ResizeObserver(t);
1748
+ return n.observe(e), () => n.disconnect();
1749
+ }, []);
1750
+ function v(e) {
1751
+ d(e), n({
1752
+ elements: e,
1753
+ kind: "drawing"
1754
+ });
1755
+ }
1756
+ function y(e) {
1757
+ let t = e?.getPointerPosition();
1758
+ return t ? {
1759
+ x: t.x / m.scale,
1760
+ y: t.y / m.scale
1761
+ } : null;
1762
+ }
1763
+ function b(e) {
1764
+ e.evt.preventDefault();
1765
+ let t = y(e.target.getStage());
1766
+ t && (p(!0), v([...u, {
1767
+ color: "#061013",
1768
+ id: `operation-stroke-${Date.now()}-${Math.round(t.x)}-${Math.round(t.y)}`,
1769
+ points: [t.x, t.y],
1770
+ strokeWidth: 8,
1771
+ type: "freehand"
1772
+ }]));
1773
+ }
1774
+ function x(e) {
1775
+ if (!f || _ || !e.evt.buttons && e.evt.pointerType === "mouse") return;
1776
+ e.evt.preventDefault();
1777
+ let t = y(e.target.getStage());
1778
+ t && v(u.map((e, n) => n === u.length - 1 ? {
1779
+ ...e,
1780
+ points: [
1781
+ ...e.points,
1782
+ t.x,
1783
+ t.y
1784
+ ]
1785
+ } : e));
1786
+ }
1787
+ function S(e) {
1788
+ e.evt.preventDefault(), p(!1);
1789
+ }
1790
+ function ee() {
1791
+ p(!1), v([]), a?.();
1792
+ }
1793
+ return /* @__PURE__ */ s("div", {
1794
+ "aria-label": e,
1795
+ className: "operation-work-area",
1796
+ ref: l,
1797
+ children: [/* @__PURE__ */ o(ne, {
1798
+ className: "operation-work-area__stage",
1799
+ height: m.height,
1800
+ onPointerCancel: S,
1801
+ onPointerDown: b,
1802
+ onPointerMove: x,
1803
+ onPointerUp: S,
1804
+ role: "img",
1805
+ width: m.width,
1806
+ children: /* @__PURE__ */ s(te, {
1807
+ scaleX: m.scale,
1808
+ scaleY: m.scale,
1809
+ children: [
1810
+ /* @__PURE__ */ o(N, {
1811
+ cornerRadius: 22,
1812
+ fill: "#fff",
1813
+ height: jt,
1814
+ stroke: "#cfe3d9",
1815
+ strokeWidth: 2,
1816
+ width: Z,
1817
+ x: 0,
1818
+ y: 0
1819
+ }),
1820
+ Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ o(M, {
1821
+ dash: [8, 12],
1822
+ points: [
1823
+ 28,
1824
+ 58 + t * 40,
1825
+ Z - 28,
1826
+ 58 + t * 40
1827
+ ],
1828
+ stroke: "#edf3ef",
1829
+ strokeWidth: 2
1830
+ }, `line-${t}`)),
1831
+ _ ? /* @__PURE__ */ o(P, {
1832
+ align: "center",
1833
+ fill: "#8fa39a",
1834
+ fontFamily: "Arial, sans-serif",
1835
+ fontSize: 24,
1836
+ fontStyle: "bold",
1837
+ height: jt,
1838
+ text: "اكتب خطوات العملية هنا",
1839
+ verticalAlign: "middle",
1840
+ width: Z,
1841
+ x: 0,
1842
+ y: 0
1843
+ }) : null,
1844
+ u.map((e) => /* @__PURE__ */ o(M, {
1845
+ globalCompositeOperation: "source-over",
1846
+ lineCap: "round",
1847
+ lineJoin: "round",
1848
+ points: e.points,
1849
+ stroke: e.color,
1850
+ strokeWidth: e.strokeWidth,
1851
+ tension: .28
1852
+ }, e.id))
1853
+ ]
1854
+ })
1855
+ }), /* @__PURE__ */ o("button", {
1856
+ "aria-label": "مسح خطوات العملية",
1857
+ className: "operation-work-area__clear",
1858
+ disabled: _,
1859
+ onClick: ee,
1860
+ type: "button",
1861
+ children: /* @__PURE__ */ o(h, { "aria-hidden": "true" })
1862
+ })]
1863
+ });
1864
+ }
1865
+ function Pt(e) {
1866
+ return e?.elements?.filter((e) => e.type === "freehand") ?? [];
1867
+ }
1868
+ //#endregion
1721
1869
  //#region src/voice/evaluateVoiceAiResult.ts
1722
- var At = {
1870
+ var Ft = {
1723
1871
  audioConfig: {
1724
1872
  bitDepth: 16,
1725
1873
  channels: 1,
@@ -1729,18 +1877,18 @@ var At = {
1729
1877
  lang: "fr",
1730
1878
  useModelAi: !0
1731
1879
  };
1732
- function jt(e, t, n) {
1733
- let r = Ft([t, ...n.acceptedPronunciations ?? []]), i = r.map(Mt), a = Mt(e.transcript), o = i.map((e, t) => ({
1880
+ function It(e, t, n) {
1881
+ let r = Bt([t, ...n.acceptedPronunciations ?? []]), i = r.map(Lt), a = Lt(e.transcript), o = i.map((e, t) => ({
1734
1882
  index: t,
1735
- similarity: Pt(a, e)
1883
+ similarity: zt(a, e)
1736
1884
  })).reduce((e, t) => t.similarity > e.similarity ? t : e, {
1737
1885
  index: -1,
1738
1886
  similarity: 0
1739
- }), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l = It(n.minimumSimilarity ?? Nt(s), 0, 1), u = e.language === n.expectedLanguage, d = a.length > 0, f = d && u && o.similarity >= l, p = d ? u ? f ? "correct" : "incorrect" : "language-mismatch" : "no-speech";
1887
+ }), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l = Vt(n.minimumSimilarity ?? Rt(s), 0, 1), u = e.language === n.expectedLanguage, d = a.length > 0, f = d && u && o.similarity >= l, p = d ? u ? f ? "correct" : "incorrect" : "language-mismatch" : "no-speech";
1740
1888
  return {
1741
1889
  acceptedPronunciations: r,
1742
1890
  confidence: e.confidence,
1743
- confidencePercent: Math.round(It(e.confidence, 0, 1) * 100),
1891
+ confidencePercent: Math.round(Vt(e.confidence, 0, 1) * 100),
1744
1892
  detectedPronunciation: e.transcript,
1745
1893
  expectedLanguage: n.expectedLanguage,
1746
1894
  expectedText: t,
@@ -1759,13 +1907,13 @@ function jt(e, t, n) {
1759
1907
  timestamps: e.timestamps ?? []
1760
1908
  };
1761
1909
  }
1762
- function Mt(e) {
1910
+ function Lt(e) {
1763
1911
  return e.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[\u064b-\u065f\u0670]/g, "").replace(/[|]+/g, " ").replace(/[^\p{Letter}\p{Number}\s]/gu, " ").replace(/\s+/g, " ").trim();
1764
1912
  }
1765
- function Nt(e) {
1766
- return (e ? Mt(e).length : 0) <= 4 ? 1 : .85;
1913
+ function Rt(e) {
1914
+ return (e ? Lt(e).length : 0) <= 4 ? 1 : .85;
1767
1915
  }
1768
- function Pt(e, t) {
1916
+ function zt(e, t) {
1769
1917
  let n = Array.from(e), r = Array.from(t), i = Math.max(n.length, r.length);
1770
1918
  if (i === 0) return 0;
1771
1919
  let a = Array.from({ length: r.length + 1 }, (e, t) => t);
@@ -1777,22 +1925,22 @@ function Pt(e, t) {
1777
1925
  }
1778
1926
  a.splice(0, a.length, ...t);
1779
1927
  }
1780
- return It(1 - a[r.length] / i, 0, 1);
1928
+ return Vt(1 - a[r.length] / i, 0, 1);
1781
1929
  }
1782
- function Ft(e) {
1930
+ function Bt(e) {
1783
1931
  let t = /* @__PURE__ */ new Set();
1784
1932
  return e.filter((e) => {
1785
- let n = Mt(e);
1933
+ let n = Lt(e);
1786
1934
  return !n || t.has(n) ? !1 : (t.add(n), !0);
1787
1935
  });
1788
1936
  }
1789
- function It(e, t, n) {
1937
+ function Vt(e, t, n) {
1790
1938
  return Math.min(n, Math.max(t, e));
1791
1939
  }
1792
1940
  //#endregion
1793
1941
  //#region src/exam-session/interactions/PronunciationRecorder.tsx
1794
- function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc: l, instruction: u, language: d, minimumSimilarity: f, onChange: p, onReset: m, recorder: h, value: g }) {
1795
- let [_, v] = i("idle"), [b, x] = i(null), [S, w] = i(0), T = r(null), E = r(!1), D = n(() => g ? jt(g.result.modelAiResult, a, {
1942
+ function Ht({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc: l, instruction: u, language: d, minimumSimilarity: f, onChange: p, onReset: m, recorder: h, value: g }) {
1943
+ let [_, v] = i("idle"), [b, x] = i(null), [S, w] = i(0), T = r(null), E = r(!1), D = n(() => g ? It(g.result.modelAiResult, a, {
1796
1944
  acceptedPronunciations: e,
1797
1945
  expectedLanguage: d,
1798
1946
  minimumSimilarity: f
@@ -1819,14 +1967,14 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1819
1967
  try {
1820
1968
  if (!h) throw Error("مُسجِّل الصَّوت غَير مُتاحٍ فِي هذا التَّطبِيق.");
1821
1969
  let e = {
1822
- ...At,
1970
+ ...Ft,
1823
1971
  lang: d,
1824
1972
  maxDuration: 10
1825
1973
  };
1826
1974
  if (!(await h.startRecording(e)).started) throw Error("تعذّر بدء التسجيل الصوتي.");
1827
1975
  E.current = !0, T.current = Date.now(), w(0), v("recording");
1828
1976
  } catch (e) {
1829
- E.current = !1, T.current = null, x(Vt(e)), v("error");
1977
+ E.current = !1, T.current = null, x(qt(e)), v("error");
1830
1978
  }
1831
1979
  }
1832
1980
  }
@@ -1835,7 +1983,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1835
1983
  v("processing"), x(null);
1836
1984
  try {
1837
1985
  if (!h) throw Error("مُسجِّل الصَّوت غَير مُتاحٍ فِي هذا التَّطبِيق.");
1838
- let t = await h.stopRecording(), n = jt(t.modelAiResult, a, {
1986
+ let t = await h.stopRecording(), n = It(t.modelAiResult, a, {
1839
1987
  acceptedPronunciations: e,
1840
1988
  expectedLanguage: d,
1841
1989
  minimumSimilarity: f
@@ -1846,7 +1994,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1846
1994
  result: t
1847
1995
  }), v("idle");
1848
1996
  } catch (e) {
1849
- E.current = !1, T.current = null, x(Vt(e)), v("error");
1997
+ E.current = !1, T.current = null, x(qt(e)), v("error");
1850
1998
  }
1851
1999
  }
1852
2000
  }
@@ -1871,7 +2019,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1871
2019
  children: [
1872
2020
  /* @__PURE__ */ s("span", { children: [
1873
2021
  "اُنْطِقِ الكَلِمَةَ بِـ",
1874
- Bt(d),
2022
+ Kt(d),
1875
2023
  ":"
1876
2024
  ] }),
1877
2025
  /* @__PURE__ */ o("strong", {
@@ -1889,7 +2037,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1889
2037
  className: "audio-debug-card__icon",
1890
2038
  "aria-hidden": "true",
1891
2039
  children: /* @__PURE__ */ o(y, {})
1892
- }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Ht(_, !!g) }), /* @__PURE__ */ o("span", { children: zt(te) })] })]
2040
+ }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Jt(_, !!g) }), /* @__PURE__ */ o("span", { children: Gt(te) })] })]
1893
2041
  }),
1894
2042
  /* @__PURE__ */ s("div", {
1895
2043
  className: "audio-debug-actions",
@@ -1929,31 +2077,31 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1929
2077
  role: "status",
1930
2078
  children: [/* @__PURE__ */ s("div", {
1931
2079
  className: "audio-pronunciation-feedback__headline",
1932
- children: [/* @__PURE__ */ o(Rt, { status: D.status }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Ut(D.status) }), /* @__PURE__ */ o("span", { children: Wt(D.status, a) })] })]
2080
+ children: [/* @__PURE__ */ o(Ut, { status: D.status }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Yt(D.status) }), /* @__PURE__ */ o("span", { children: Xt(D.status, a) })] })]
1933
2081
  }), /* @__PURE__ */ s("div", {
1934
2082
  className: "audio-debug-metadata",
1935
2083
  children: [
1936
- /* @__PURE__ */ o(Z, {
2084
+ /* @__PURE__ */ o(Wt, {
1937
2085
  label: "ما تَعَرَّفَ عَلَيْهِ النَّمُوذَجُ",
1938
2086
  value: D.detectedPronunciation || "—"
1939
2087
  }),
1940
- /* @__PURE__ */ o(Z, {
2088
+ /* @__PURE__ */ o(Wt, {
1941
2089
  label: "نِسْبَةُ التَّطابُقِ",
1942
2090
  value: `${D.similarityPercent}%`
1943
2091
  }),
1944
- /* @__PURE__ */ o(Z, {
2092
+ /* @__PURE__ */ o(Wt, {
1945
2093
  label: "ثِقَةُ النَّمُوذَجِ",
1946
2094
  value: `${D.confidencePercent}%`
1947
2095
  }),
1948
- /* @__PURE__ */ o(Z, {
2096
+ /* @__PURE__ */ o(Wt, {
1949
2097
  label: "اللُّغَةُ",
1950
2098
  value: D.language.toUpperCase()
1951
2099
  }),
1952
- /* @__PURE__ */ o(Z, {
2100
+ /* @__PURE__ */ o(Wt, {
1953
2101
  label: "زَمَنُ التَّحْلِيلِ",
1954
2102
  value: `${D.latencyMs} ms`
1955
2103
  }),
1956
- /* @__PURE__ */ o(Z, {
2104
+ /* @__PURE__ */ o(Wt, {
1957
2105
  label: "عَدَدُ الرُّمُوزِ الصَّوْتِيَّةِ",
1958
2106
  value: D.timestamps.length.toString()
1959
2107
  })
@@ -1963,10 +2111,10 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
1963
2111
  ]
1964
2112
  });
1965
2113
  }
1966
- function Rt({ status: e }) {
2114
+ function Ut({ status: e }) {
1967
2115
  return o(e === "correct" ? f : e === "no-speech" ? D : O, { "aria-hidden": "true" });
1968
2116
  }
1969
- function Z({ label: e, value: t }) {
2117
+ function Wt({ label: e, value: t }) {
1970
2118
  return /* @__PURE__ */ s("span", {
1971
2119
  className: "audio-debug-meta-card",
1972
2120
  children: [/* @__PURE__ */ o("small", { children: e }), /* @__PURE__ */ o("strong", {
@@ -1975,29 +2123,29 @@ function Z({ label: e, value: t }) {
1975
2123
  })]
1976
2124
  });
1977
2125
  }
1978
- function zt(e) {
2126
+ function Gt(e) {
1979
2127
  let t = Math.max(0, Math.round(e / 1e3)), n = Math.floor(t / 60), r = t % 60;
1980
2128
  return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
1981
2129
  }
1982
- function Bt(e) {
2130
+ function Kt(e) {
1983
2131
  return e === "fr" ? "الفَرَنْسِيَّةِ" : "العَرَبِيَّةِ";
1984
2132
  }
1985
- function Vt(e) {
2133
+ function qt(e) {
1986
2134
  let t = e;
1987
2135
  return t.code === "MISSING_PERMISSION" ? "يَجِبُ السَّماحُ بِاسْتِعْمالِ المِيكْرُوفُونِ لِتَسْجِيلِ الإِجابَةِ." : t.code === "MODEL_VOCAB_MISMATCH" ? "مَلَفُّ نَمُوذَجِ اللُّغَةِ لا يُطابِقُ قامُوسَهُ. يُرْجى تَصْحِيحُ مَلَفِّ النَّمُوذَجِ." : t.message ? t.message : typeof e == "string" ? e : "حَدَثَ خَطَأٌ أَثْناءَ تَسْجِيلِ الإِجابَةِ الصَّوْتِيَّةِ.";
1988
2136
  }
1989
- function Ht(e, t) {
2137
+ function Jt(e, t) {
1990
2138
  return e === "checking" ? "جارِي تَجْهِيزُ المِيكْرُوفُونِ" : e === "recording" ? "جارِي التَّسْجِيلُ... تَكَلَّمِ الآنَ" : e === "processing" ? "جارِي تَحْلِيلُ النُّطْقِ" : e === "error" ? "تَعَذَّرَ تَحْلِيلُ التَّسْجِيلِ" : t ? "اِكْتَمَلَ تَحْلِيلُ الإِجابَةِ" : "المِيكْرُوفُونُ جاهِزٌ";
1991
2139
  }
1992
- function Ut(e) {
2140
+ function Yt(e) {
1993
2141
  return e === "correct" ? "أَحْسَنْتَ! إِجابَةٌ صَحِيحَةٌ" : e === "no-speech" ? "لَمْ نَسْمَعْ كَلِمَةً واضِحَةً" : e === "language-mismatch" ? "اُسْتُعْمِلَ نَمُوذَجُ لُغَةٍ مُخْتَلِفَةٍ" : "حاوِلْ مَرَّةً أُخْرى";
1994
2142
  }
1995
- function Wt(e, t) {
2143
+ function Xt(e, t) {
1996
2144
  return e === "correct" ? `نَطَقْتَ «${t}» بِشَكْلٍ صَحِيحٍ.` : e === "no-speech" ? `قَرِّبْ فَمَكَ مِنَ المِيكْرُوفُونِ وَقُلْ «${t}».` : `اِسْتَمِعْ إِلى نُطْقِ «${t}» ثُمَّ أَعِدِ المُحاوَلَةَ.`;
1997
2145
  }
1998
2146
  //#endregion
1999
2147
  //#region src/exam-session/interactions/SortableAnswer.tsx
2000
- function Gt({ answerId: e, items: t, value: n, onChange: r }) {
2148
+ function Zt({ answerId: e, items: t, value: n, onChange: r }) {
2001
2149
  let i = new Map(t.map((e) => [e.id, e])), a = n?.itemIds.length === t.length ? n.itemIds.filter((e) => i.has(e)) : t.map((e) => e.id);
2002
2150
  return /* @__PURE__ */ o(c, {
2003
2151
  onDragEnd: (e) => {
@@ -2010,7 +2158,7 @@ function Gt({ answerId: e, items: t, value: n, onChange: r }) {
2010
2158
  className: "sortable-answer",
2011
2159
  children: a.map((t, n) => {
2012
2160
  let r = i.get(t);
2013
- return r ? /* @__PURE__ */ o(Kt, {
2161
+ return r ? /* @__PURE__ */ o(Qt, {
2014
2162
  group: e,
2015
2163
  index: n,
2016
2164
  item: r
@@ -2019,7 +2167,7 @@ function Gt({ answerId: e, items: t, value: n, onChange: r }) {
2019
2167
  })
2020
2168
  });
2021
2169
  }
2022
- function Kt({ group: e, index: t, item: n }) {
2170
+ function Qt({ group: e, index: t, item: n }) {
2023
2171
  let { ref: r, isDragging: i, isDropTarget: a } = I({
2024
2172
  id: n.id,
2025
2173
  index: t,
@@ -2039,7 +2187,7 @@ function Kt({ group: e, index: t, item: n }) {
2039
2187
  }
2040
2188
  //#endregion
2041
2189
  //#region src/exam-session/interactions/TextAnswer.tsx
2042
- function qt({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onChange: i }) {
2190
+ function $t({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onChange: i }) {
2043
2191
  return /* @__PURE__ */ o("input", {
2044
2192
  "aria-label": e,
2045
2193
  className: t,
@@ -2053,7 +2201,7 @@ function qt({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onCha
2053
2201
  }
2054
2202
  //#endregion
2055
2203
  //#region src/renderer/visualScene.tsx
2056
- var Jt = {
2204
+ var en = {
2057
2205
  apple: d,
2058
2206
  circle: p,
2059
2207
  flower: g,
@@ -2063,7 +2211,7 @@ var Jt = {
2063
2211
  star: w,
2064
2212
  sun: T,
2065
2213
  triangle: E
2066
- }, Yt = {
2214
+ }, tn = {
2067
2215
  blue: "#4d89d9",
2068
2216
  gray: "#8c97a0",
2069
2217
  green: "#1f9d63",
@@ -2071,7 +2219,7 @@ var Jt = {
2071
2219
  purple: "#8a63d2",
2072
2220
  red: "#eb5b5b",
2073
2221
  yellow: "#f2c641"
2074
- }, Xt = {
2222
+ }, nn = {
2075
2223
  "counter-rows": { rows: [{
2076
2224
  color: "yellow",
2077
2225
  count: 5,
@@ -2098,7 +2246,7 @@ var Jt = {
2098
2246
  id: "star-row",
2099
2247
  state: "plain"
2100
2248
  }] }
2101
- }, Zt = [
2249
+ }, rn = [
2102
2250
  {
2103
2251
  label: "Cercle",
2104
2252
  value: "circle"
@@ -2135,7 +2283,7 @@ var Jt = {
2135
2283
  label: "Hexagone",
2136
2284
  value: "hexagon"
2137
2285
  }
2138
- ], Qt = [
2286
+ ], an = [
2139
2287
  {
2140
2288
  label: "Jaune",
2141
2289
  value: "yellow"
@@ -2164,20 +2312,20 @@ var Jt = {
2164
2312
  label: "Gris",
2165
2313
  value: "gray"
2166
2314
  }
2167
- ], $t = [{
2315
+ ], on = [{
2168
2316
  label: "Normal",
2169
2317
  value: "plain"
2170
2318
  }, {
2171
2319
  label: "Barre",
2172
2320
  value: "crossed"
2173
2321
  }];
2174
- function en(e) {
2175
- return { rows: Xt[e].rows.map((e) => ({ ...e })) };
2322
+ function sn(e) {
2323
+ return { rows: nn[e].rows.map((e) => ({ ...e })) };
2176
2324
  }
2177
- function tn(e) {
2178
- return Yt[e];
2325
+ function cn(e) {
2326
+ return tn[e];
2179
2327
  }
2180
- function nn({ scene: e }) {
2328
+ function ln({ scene: e }) {
2181
2329
  return /* @__PURE__ */ o("div", {
2182
2330
  className: "visual-panel visual-panel--custom",
2183
2331
  "aria-hidden": "true",
@@ -2185,7 +2333,7 @@ function nn({ scene: e }) {
2185
2333
  className: "visual-scene",
2186
2334
  children: e.rows.map((e) => /* @__PURE__ */ o("div", {
2187
2335
  className: "visual-scene-row",
2188
- children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ o(rn, {
2336
+ children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ o(un, {
2189
2337
  color: e.color,
2190
2338
  icon: e.icon,
2191
2339
  state: e.state
@@ -2194,26 +2342,26 @@ function nn({ scene: e }) {
2194
2342
  })
2195
2343
  });
2196
2344
  }
2197
- function rn({ color: e, icon: t, state: n }) {
2198
- let r = Jt[t];
2345
+ function un({ color: e, icon: t, state: n }) {
2346
+ let r = en[t];
2199
2347
  return /* @__PURE__ */ o("span", {
2200
2348
  className: n === "crossed" ? "visual-scene-icon visual-scene-icon--crossed" : "visual-scene-icon",
2201
- style: { color: tn(e) },
2349
+ style: { color: cn(e) },
2202
2350
  children: /* @__PURE__ */ o(r, { "aria-hidden": "true" })
2203
2351
  });
2204
2352
  }
2205
2353
  //#endregion
2206
2354
  //#region src/renderer/QuestionRenderer.tsx
2207
- function an({ adapters: e, clearAnswer: t, question: n, getAnswer: r, updateAnswer: i }) {
2355
+ function dn({ adapters: e, clearAnswer: t, question: n, getAnswer: r, updateAnswer: i }) {
2208
2356
  return /* @__PURE__ */ s("article", {
2209
2357
  className: `question-block question-block--${n.type}`,
2210
- children: [/* @__PURE__ */ o(sn, {
2358
+ children: [/* @__PURE__ */ o(pn, {
2211
2359
  number: n.number,
2212
2360
  prompt: n.prompt
2213
- }), cn(n, r, i, t, e)]
2361
+ }), mn(n, r, i, t, e)]
2214
2362
  });
2215
2363
  }
2216
- function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswer: i }) {
2364
+ function fn({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswer: i }) {
2217
2365
  return /* @__PURE__ */ s("section", {
2218
2366
  className: `question-section question-section--${n.tone}`,
2219
2367
  children: [/* @__PURE__ */ s("header", {
@@ -2231,7 +2379,7 @@ function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
2231
2379
  ]
2232
2380
  }), /* @__PURE__ */ o("div", {
2233
2381
  className: "section-body",
2234
- children: n.questions.map((n) => /* @__PURE__ */ o(an, {
2382
+ children: n.questions.map((n) => /* @__PURE__ */ o(dn, {
2235
2383
  adapters: e,
2236
2384
  clearAnswer: t,
2237
2385
  getAnswer: r,
@@ -2241,17 +2389,17 @@ function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
2241
2389
  })]
2242
2390
  });
2243
2391
  }
2244
- function sn({ number: e, prompt: t }) {
2392
+ function pn({ number: e, prompt: t }) {
2245
2393
  return /* @__PURE__ */ s("div", {
2246
2394
  className: "question-prompt",
2247
2395
  children: [e > 0 ? /* @__PURE__ */ o("span", { children: e }) : null, /* @__PURE__ */ o("strong", { children: t })]
2248
2396
  });
2249
2397
  }
2250
- function cn(e, t, n, r, i) {
2398
+ function mn(e, t, n, r, i) {
2251
2399
  switch (e.type) {
2252
2400
  case "inline-inputs": return /* @__PURE__ */ o("div", {
2253
2401
  className: "inline-equation-grid",
2254
- children: e.items.map((a) => ln({
2402
+ children: e.items.map((a) => hn({
2255
2403
  adapters: i,
2256
2404
  className: "equation-card",
2257
2405
  clearAnswer: r,
@@ -2261,11 +2409,11 @@ function cn(e, t, n, r, i) {
2261
2409
  updateAnswer: n
2262
2410
  }))
2263
2411
  });
2264
- case "visual-choice": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(xn, {
2412
+ case "visual-choice": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(On, {
2265
2413
  choices: e.choices,
2266
2414
  onChange: (t) => n(e.id, t),
2267
2415
  scene: e.scene,
2268
- value: fn(t(e.id)),
2416
+ value: vn(t(e.id)),
2269
2417
  visual: e.visual
2270
2418
  }), e.inputLabel ? /* @__PURE__ */ s("div", {
2271
2419
  className: "compact-answer",
@@ -2277,7 +2425,7 @@ function cn(e, t, n, r, i) {
2277
2425
  value: Q(t(`${e.id}:input`))
2278
2426
  })]
2279
2427
  }) : null] });
2280
- case "number-line": return /* @__PURE__ */ o(Ot, {
2428
+ case "number-line": return /* @__PURE__ */ o(kt, {
2281
2429
  answerId: e.id,
2282
2430
  expression: e.expression,
2283
2431
  onClear: r,
@@ -2285,9 +2433,37 @@ function cn(e, t, n, r, i) {
2285
2433
  recognizer: i?.handwritingRecognizer,
2286
2434
  value: Q(t(e.id))
2287
2435
  });
2436
+ case "operation-solving": return /* @__PURE__ */ s("div", {
2437
+ className: `operation-solving operation-solving--${e.solutionMode}`,
2438
+ children: [
2439
+ /* @__PURE__ */ o("div", {
2440
+ className: "operation-solving__equation-card",
2441
+ children: /* @__PURE__ */ o("span", { children: wn(e) })
2442
+ }),
2443
+ e.solutionMode === "full-process" ? /* @__PURE__ */ s("div", {
2444
+ className: "operation-solving__work",
2445
+ children: [/* @__PURE__ */ o("strong", { children: "أَنْجِزُ الْعَمَلِيَّةَ" }), /* @__PURE__ */ o(Nt, {
2446
+ ariaLabel: "مساحة إنجاز العملية",
2447
+ onChange: (t) => n(`${e.id}:work`, t),
2448
+ onClear: () => r(`${e.id}:work`),
2449
+ value: xn(t(`${e.id}:work`))
2450
+ })]
2451
+ }) : null,
2452
+ /* @__PURE__ */ s("div", {
2453
+ className: "operation-solving__answer compact-answer",
2454
+ children: [/* @__PURE__ */ o("span", { children: "النَّتِيجَةُ" }), /* @__PURE__ */ o(G, {
2455
+ ariaLabel: "اكتب نتيجة العملية",
2456
+ onChange: (t) => n(e.id, t),
2457
+ onClear: () => r(e.id),
2458
+ recognizer: i?.handwritingRecognizer,
2459
+ value: Q(t(e.id))
2460
+ })]
2461
+ })
2462
+ ]
2463
+ });
2288
2464
  case "equation-inputs": return /* @__PURE__ */ o("div", {
2289
2465
  className: "stacked-equations",
2290
- children: e.items.map((a) => ln({
2466
+ children: e.items.map((a) => hn({
2291
2467
  adapters: i,
2292
2468
  ariaPrefix: e.prompt,
2293
2469
  className: "wide-equation-card",
@@ -2298,7 +2474,7 @@ function cn(e, t, n, r, i) {
2298
2474
  updateAnswer: n
2299
2475
  }))
2300
2476
  });
2301
- case "length-estimation": return /* @__PURE__ */ o(Sn, {
2477
+ case "length-estimation": return /* @__PURE__ */ o(kn, {
2302
2478
  answerId: e.id,
2303
2479
  choices: e.choices,
2304
2480
  getAnswer: t,
@@ -2307,7 +2483,7 @@ function cn(e, t, n, r, i) {
2307
2483
  });
2308
2484
  case "shape-choice": return /* @__PURE__ */ s("div", {
2309
2485
  className: "shape-choice-layout",
2310
- children: [/* @__PURE__ */ o(Ne, {
2486
+ children: [/* @__PURE__ */ o(Pe, {
2311
2487
  items: e.choices.map((e) => ({
2312
2488
  id: `${e.id}-label`,
2313
2489
  label: e.label
@@ -2315,24 +2491,24 @@ function cn(e, t, n, r, i) {
2315
2491
  onChange: (t) => n(e.id, t),
2316
2492
  targets: e.choices.map((e) => ({
2317
2493
  id: `${e.id}-target`,
2318
- label: yn(e.id)
2494
+ label: En(e.id)
2319
2495
  })),
2320
- value: fn(t(e.id))
2496
+ value: vn(t(e.id))
2321
2497
  }), /* @__PURE__ */ o("div", {
2322
2498
  className: "shape-row",
2323
2499
  "aria-hidden": "true",
2324
2500
  children: e.choices.map((e) => /* @__PURE__ */ o("span", { className: `shape-drawing shape-drawing--${e.id}` }, e.id))
2325
2501
  })]
2326
2502
  });
2327
- case "drawing-grid": return /* @__PURE__ */ o(wt, {
2503
+ case "drawing-grid": return /* @__PURE__ */ o(Tt, {
2328
2504
  onChange: (t) => n(e.id, t),
2329
2505
  points: e.points,
2330
- value: hn(t(e.id))
2506
+ value: xn(t(e.id))
2331
2507
  });
2332
- case "table-response": return /* @__PURE__ */ o(De, {
2508
+ case "table-response": return /* @__PURE__ */ o(Oe, {
2333
2509
  columns: e.columns,
2334
2510
  onChange: (t) => n(e.id, t),
2335
- value: gn(t(e.id))
2511
+ value: Sn(t(e.id))
2336
2512
  });
2337
2513
  case "text-input": return e.before && !e.after && e.number === 0 ? /* @__PURE__ */ o("p", {
2338
2514
  className: "problem-statement",
@@ -2358,7 +2534,7 @@ function cn(e, t, n, r, i) {
2358
2534
  children: e.situation
2359
2535
  }), /* @__PURE__ */ o("div", {
2360
2536
  className: "word-problem__parts",
2361
- children: e.parts.map((a, s) => /* @__PURE__ */ o(vn, {
2537
+ children: e.parts.map((a, s) => /* @__PURE__ */ o(Tn, {
2362
2538
  adapters: i,
2363
2539
  clearAnswer: r,
2364
2540
  getAnswer: t,
@@ -2369,25 +2545,25 @@ function cn(e, t, n, r, i) {
2369
2545
  }, a.id))
2370
2546
  })]
2371
2547
  });
2372
- case "drag-match": return /* @__PURE__ */ o(Ne, {
2548
+ case "drag-match": return /* @__PURE__ */ o(Pe, {
2373
2549
  items: e.items,
2374
2550
  onChange: (t) => n(e.id, t),
2375
2551
  targets: e.targets,
2376
- value: fn(t(e.id))
2552
+ value: vn(t(e.id))
2377
2553
  });
2378
- case "sortable-answer": return /* @__PURE__ */ o(Gt, {
2554
+ case "sortable-answer": return /* @__PURE__ */ o(Zt, {
2379
2555
  answerId: e.id,
2380
2556
  items: e.items,
2381
2557
  onChange: (t) => n(e.id, t),
2382
- value: pn(t(e.id))
2558
+ value: yn(t(e.id))
2383
2559
  });
2384
- case "label-placement": return /* @__PURE__ */ o(Tt, {
2560
+ case "label-placement": return /* @__PURE__ */ o(Et, {
2385
2561
  labels: e.labels,
2386
2562
  onChange: (t) => n(e.id, t),
2387
2563
  targets: e.targets,
2388
- value: mn(t(e.id))
2564
+ value: bn(t(e.id))
2389
2565
  });
2390
- case "audio-recording": return /* @__PURE__ */ o(Lt, {
2566
+ case "audio-recording": return /* @__PURE__ */ o(Ht, {
2391
2567
  acceptedPronunciations: e.acceptedPronunciations,
2392
2568
  expectedText: e.expectedAnswer,
2393
2569
  imageAlt: e.imageAlt,
@@ -2398,11 +2574,11 @@ function cn(e, t, n, r, i) {
2398
2574
  onChange: (t) => n(e.id, t),
2399
2575
  onReset: () => r(e.id),
2400
2576
  recorder: i?.audioRecorder,
2401
- value: _n(t(e.id))
2577
+ value: Cn(t(e.id))
2402
2578
  });
2403
2579
  }
2404
2580
  }
2405
- function ln({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswer: a, item: c, questionId: l, updateAnswer: u }) {
2581
+ function hn({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswer: a, item: c, questionId: l, updateAnswer: u }) {
2406
2582
  if (c.answers?.length) return /* @__PURE__ */ s("div", {
2407
2583
  className: r,
2408
2584
  children: [c.answers.map((r) => {
@@ -2436,44 +2612,47 @@ function ln({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswe
2436
2612
  ]
2437
2613
  }, c.id);
2438
2614
  }
2439
- function un(e) {
2615
+ function gn(e) {
2440
2616
  return e?.kind === "text" ? e : void 0;
2441
2617
  }
2442
2618
  function Q(e) {
2443
2619
  return e?.kind === "handwritten-number" ? e : void 0;
2444
2620
  }
2445
- function dn(e) {
2621
+ function _n(e) {
2446
2622
  return e?.kind === "choice" ? e : void 0;
2447
2623
  }
2448
- function fn(e) {
2624
+ function vn(e) {
2449
2625
  return e?.kind === "matches" ? e : void 0;
2450
2626
  }
2451
- function pn(e) {
2627
+ function yn(e) {
2452
2628
  return e?.kind === "order" ? e : void 0;
2453
2629
  }
2454
- function mn(e) {
2630
+ function bn(e) {
2455
2631
  return e?.kind === "placements" ? e : void 0;
2456
2632
  }
2457
- function hn(e) {
2633
+ function xn(e) {
2458
2634
  return e?.kind === "drawing" ? e : void 0;
2459
2635
  }
2460
- function gn(e) {
2636
+ function Sn(e) {
2461
2637
  return e?.kind === "coin-table" ? e : void 0;
2462
2638
  }
2463
- function _n(e) {
2639
+ function Cn(e) {
2464
2640
  return e?.kind === "audio-recording" ? e : void 0;
2465
2641
  }
2466
- function vn({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, part: i, partNumber: a, updateAnswer: c }) {
2642
+ function wn(e) {
2643
+ return `${e.leftOperand} ${e.operator} ${e.rightOperand} =`;
2644
+ }
2645
+ function Tn({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, part: i, partNumber: a, updateAnswer: c }) {
2467
2646
  let l = `${r}:${i.id}`;
2468
2647
  return /* @__PURE__ */ s("section", {
2469
2648
  className: "word-problem-part",
2470
2649
  children: [/* @__PURE__ */ s("div", {
2471
2650
  className: "word-problem-part__prompt",
2472
2651
  children: [/* @__PURE__ */ o("span", { children: a }), /* @__PURE__ */ o("strong", { children: i.prompt })]
2473
- }), i.type === "coin-table" ? /* @__PURE__ */ o(De, {
2652
+ }), i.type === "coin-table" ? /* @__PURE__ */ o(Oe, {
2474
2653
  columns: i.columns,
2475
2654
  onChange: (e) => c(l, e),
2476
- value: gn(n(l))
2655
+ value: Sn(n(l))
2477
2656
  }) : /* @__PURE__ */ s("div", {
2478
2657
  className: "sentence-answer word-problem-part__sentence",
2479
2658
  children: [
@@ -2490,12 +2669,12 @@ function vn({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, pa
2490
2669
  })]
2491
2670
  });
2492
2671
  }
2493
- function yn(e) {
2672
+ function En(e) {
2494
2673
  return e === "triangle" ? "△" : e === "square" ? "□" : e === "rectangle" ? "▭" : e;
2495
2674
  }
2496
- var bn = "picture";
2497
- function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
2498
- let u = r(null), d = r(null), f = r(null), p = r({}), m = r(null), h = c?.pairs[bn], [g, _] = i(null), [v, y] = i(null);
2675
+ var Dn = "picture";
2676
+ function On({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
2677
+ let u = r(null), d = r(null), f = r(null), p = r({}), m = r(null), h = c?.pairs[Dn], [g, _] = i(null), [v, y] = i(null);
2499
2678
  function b(e, t) {
2500
2679
  let n = d.current;
2501
2680
  if (n) {
@@ -2570,7 +2749,7 @@ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
2570
2749
  let r = T(e.clientX, e.clientY);
2571
2750
  r && n({
2572
2751
  kind: "matches",
2573
- pairs: { [bn]: r }
2752
+ pairs: { [Dn]: r }
2574
2753
  }), m.current = null, y(null);
2575
2754
  }
2576
2755
  function w(e, t, n) {
@@ -2605,7 +2784,7 @@ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
2605
2784
  }),
2606
2785
  /* @__PURE__ */ s("div", {
2607
2786
  className: "visual-match-picture",
2608
- children: [/* @__PURE__ */ o(nn, { scene: a ?? en(l) }), /* @__PURE__ */ o("button", {
2787
+ children: [/* @__PURE__ */ o(ln, { scene: a ?? sn(l) }), /* @__PURE__ */ o("button", {
2609
2788
  "aria-label": "اربط الصورة بالإجابة",
2610
2789
  className: h ? "visual-match-point visual-match-point--target visual-match-point--target-active" : "visual-match-point visual-match-point--target",
2611
2790
  onPointerCancel: C,
@@ -2637,8 +2816,8 @@ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
2637
2816
  ]
2638
2817
  });
2639
2818
  }
2640
- function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }) {
2641
- let l = Math.max(...a.map((e) => e.squareLength)) + 2, u = Ue(t), [d, f] = i(null), [p, m] = i(!1), [h, g] = i({}), _ = r(null);
2819
+ function kn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }) {
2820
+ let l = Math.max(...a.map((e) => e.squareLength)) + 2, u = We(t), [d, f] = i(null), [p, m] = i(!1), [h, g] = i({}), _ = r(null);
2642
2821
  function v(e, t, n) {
2643
2822
  let r = d;
2644
2823
  r && g((i) => {
@@ -2680,7 +2859,7 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
2680
2859
  "data-coloring": p ? "true" : "false",
2681
2860
  onPointerCancel: () => x(),
2682
2861
  onPointerUp: () => x(),
2683
- children: [/* @__PURE__ */ o(ze, {
2862
+ children: [/* @__PURE__ */ o(Be, {
2684
2863
  ariaLabel: "ألوان الأقلام",
2685
2864
  className: "length-color-picker",
2686
2865
  colors: u,
@@ -2689,7 +2868,7 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
2689
2868
  }), /* @__PURE__ */ o("div", {
2690
2869
  className: "length-card-row",
2691
2870
  children: a.map((t) => {
2692
- let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a = dn(n(i)), d = h[t.id], f = d?.colorId ?? a?.choiceId, p = d?.fill ?? +!!a?.choiceId, m = f ? He(u, f) : "#9aa3a8", g = `${16 + Math.min(p, 1) * 68}%`;
2871
+ let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a = _n(n(i)), d = h[t.id], f = d?.colorId ?? a?.choiceId, p = d?.fill ?? +!!a?.choiceId, m = f ? Ue(u, f) : "#9aa3a8", g = `${16 + Math.min(p, 1) * 68}%`;
2693
2872
  return /* @__PURE__ */ s("div", {
2694
2873
  className: "length-card",
2695
2874
  children: [/* @__PURE__ */ o("div", {
@@ -2724,11 +2903,11 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
2724
2903
  className: "length-value-row",
2725
2904
  children: [
2726
2905
  /* @__PURE__ */ o("span", { children: t.label }),
2727
- /* @__PURE__ */ o(qt, {
2906
+ /* @__PURE__ */ o($t, {
2728
2907
  ariaLabel: `طول ${t.label} بالمربعات`,
2729
2908
  inputMode: "numeric",
2730
2909
  onChange: (e) => c(r, e),
2731
- value: un(n(r))
2910
+ value: gn(n(r))
2732
2911
  }),
2733
2912
  /* @__PURE__ */ o("span", { children: "مربعات" })
2734
2913
  ]
@@ -2740,7 +2919,7 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
2740
2919
  }
2741
2920
  //#endregion
2742
2921
  //#region src/renderer/QuestionPreviewPanel.tsx
2743
- function Cn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
2922
+ function An({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
2744
2923
  let [a, s] = i({}), c = t ?? a;
2745
2924
  function l(e) {
2746
2925
  if (t !== void 0) {
@@ -2763,7 +2942,7 @@ function Cn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
2763
2942
  }
2764
2943
  return /* @__PURE__ */ o("div", {
2765
2944
  className: "exam-renderer-preview",
2766
- children: /* @__PURE__ */ o(an, {
2945
+ children: /* @__PURE__ */ o(dn, {
2767
2946
  adapters: e,
2768
2947
  clearAnswer: d,
2769
2948
  getAnswer: (e) => c[e],
@@ -2774,7 +2953,7 @@ function Cn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
2774
2953
  }
2775
2954
  //#endregion
2776
2955
  //#region src/renderer/PrintableExamDocument.tsx
2777
- var wn = {
2956
+ var jn = {
2778
2957
  ariaLabel: "معلومات المؤسسة",
2779
2958
  logoAlt: "شعار المملكة المغربية",
2780
2959
  logoSrc: "/logo/morocco-logo.png",
@@ -2785,37 +2964,37 @@ var wn = {
2785
2964
  "المديرية الإقليمية"
2786
2965
  ]
2787
2966
  };
2788
- function Tn({ exam: e, locale: t = "fr", variant: n }) {
2789
- let r = qn(t), i = Mn(e);
2967
+ function Mn({ exam: e, locale: t = "fr", variant: n }) {
2968
+ let r = tr(t), i = zn(e);
2790
2969
  return /* @__PURE__ */ s("article", {
2791
2970
  className: `printable-exam printable-exam--${n}`,
2792
- dir: Kn(t) ? "rtl" : "ltr",
2971
+ dir: er(t) ? "rtl" : "ltr",
2793
2972
  children: [/* @__PURE__ */ s("div", {
2794
2973
  className: "printable-exam__top",
2795
- children: [/* @__PURE__ */ o(En, {}), /* @__PURE__ */ s("header", {
2974
+ children: [/* @__PURE__ */ o(Nn, {}), /* @__PURE__ */ s("header", {
2796
2975
  className: "printable-exam__header",
2797
2976
  children: [/* @__PURE__ */ s("div", {
2798
2977
  className: "printable-exam__title-row",
2799
2978
  children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("span", {
2800
2979
  className: "printable-exam__eyebrow",
2801
2980
  children: e.subject
2802
- }), /* @__PURE__ */ o("h1", { children: e.title })] }), /* @__PURE__ */ o(jn, {
2981
+ }), /* @__PURE__ */ o("h1", { children: e.title })] }), /* @__PURE__ */ o(Rn, {
2803
2982
  noteLabel: r.obtainedNote,
2804
2983
  totalPoints: i
2805
2984
  })]
2806
2985
  }), /* @__PURE__ */ s("div", {
2807
2986
  className: "printable-exam__meta",
2808
2987
  children: [
2809
- /* @__PURE__ */ o(An, {
2988
+ /* @__PURE__ */ o(Ln, {
2810
2989
  label: r.duration,
2811
2990
  value: e.timer
2812
2991
  }),
2813
- /* @__PURE__ */ o(An, {
2992
+ /* @__PURE__ */ o(Ln, {
2814
2993
  label: r.level,
2815
2994
  value: e.level
2816
2995
  }),
2817
- /* @__PURE__ */ o(An, {
2818
- label: Kn(t) ? "المادة" : r.subject ?? "Matiere",
2996
+ /* @__PURE__ */ o(Ln, {
2997
+ label: er(t) ? "المادة" : r.subject ?? "Matiere",
2819
2998
  value: e.subject
2820
2999
  })
2821
3000
  ]
@@ -2823,7 +3002,7 @@ function Tn({ exam: e, locale: t = "fr", variant: n }) {
2823
3002
  })]
2824
3003
  }), /* @__PURE__ */ o("div", {
2825
3004
  className: "printable-exam__sections",
2826
- children: e.sections.map((e) => /* @__PURE__ */ o(Dn, {
3005
+ children: e.sections.map((e) => /* @__PURE__ */ o(Pn, {
2827
3006
  locale: t,
2828
3007
  section: e,
2829
3008
  variant: n
@@ -2831,24 +3010,24 @@ function Tn({ exam: e, locale: t = "fr", variant: n }) {
2831
3010
  })]
2832
3011
  });
2833
3012
  }
2834
- function En() {
3013
+ function Nn() {
2835
3014
  return /* @__PURE__ */ s("section", {
2836
- "aria-label": wn.ariaLabel,
3015
+ "aria-label": jn.ariaLabel,
2837
3016
  className: "printable-institution-header",
2838
3017
  dir: "rtl",
2839
3018
  children: [
2840
3019
  /* @__PURE__ */ o("img", {
2841
- alt: wn.logoAlt,
3020
+ alt: jn.logoAlt,
2842
3021
  className: "printable-institution-header__logo",
2843
- src: wn.logoSrc
3022
+ src: jn.logoSrc
2844
3023
  }),
2845
- /* @__PURE__ */ o("h1", { children: wn.title }),
2846
- wn.lines.map((e) => /* @__PURE__ */ o("p", { children: e }, e))
3024
+ /* @__PURE__ */ o("h1", { children: jn.title }),
3025
+ jn.lines.map((e) => /* @__PURE__ */ o("p", { children: e }, e))
2847
3026
  ]
2848
3027
  });
2849
3028
  }
2850
- function Dn({ locale: e = "fr", section: t, variant: n }) {
2851
- let r = qn(e);
3029
+ function Pn({ locale: e = "fr", section: t, variant: n }) {
3030
+ let r = tr(e);
2852
3031
  return /* @__PURE__ */ s("section", {
2853
3032
  className: `printable-section printable-section--${t.tone}`,
2854
3033
  "data-variant": n,
@@ -2873,7 +3052,7 @@ function Dn({ locale: e = "fr", section: t, variant: n }) {
2873
3052
  ]
2874
3053
  }), /* @__PURE__ */ o("div", {
2875
3054
  className: "printable-section__body",
2876
- children: t.questions.map((t) => /* @__PURE__ */ o(On, {
3055
+ children: t.questions.map((t) => /* @__PURE__ */ o(Fn, {
2877
3056
  locale: e,
2878
3057
  question: t,
2879
3058
  variant: n
@@ -2881,8 +3060,8 @@ function Dn({ locale: e = "fr", section: t, variant: n }) {
2881
3060
  })]
2882
3061
  });
2883
3062
  }
2884
- function On({ locale: e = "fr", question: t, variant: n }) {
2885
- let r = qn(e);
3063
+ function Fn({ locale: e = "fr", question: t, variant: n }) {
3064
+ let r = tr(e);
2886
3065
  return /* @__PURE__ */ s("article", {
2887
3066
  className: `printable-question printable-question--${t.type}`,
2888
3067
  children: [/* @__PURE__ */ s("div", {
@@ -2891,31 +3070,48 @@ function On({ locale: e = "fr", question: t, variant: n }) {
2891
3070
  className: "printable-question__number",
2892
3071
  children: t.number
2893
3072
  }) : null, /* @__PURE__ */ o("strong", { children: t.prompt })]
2894
- }), kn(t, n, r, e)]
3073
+ }), In(t, n, r, e)]
2895
3074
  });
2896
3075
  }
2897
- function kn(e, t, n, r) {
3076
+ function In(e, t, n, r) {
2898
3077
  switch (e.type) {
2899
3078
  case "inline-inputs":
2900
3079
  case "equation-inputs": return /* @__PURE__ */ o("div", {
2901
3080
  className: "printable-equation-grid",
2902
3081
  children: e.items.map((e) => /* @__PURE__ */ o("div", {
2903
3082
  className: "printable-equation-card",
2904
- children: /* @__PURE__ */ o(Wn, { item: e })
3083
+ children: /* @__PURE__ */ o(Qn, { item: e })
2905
3084
  }, e.id))
2906
3085
  });
2907
3086
  case "number-line": return /* @__PURE__ */ s("div", {
2908
3087
  className: "printable-number-line-layout",
2909
3088
  children: [/* @__PURE__ */ s("div", {
2910
3089
  className: "printable-number-line-expression",
2911
- children: [/* @__PURE__ */ o("span", { children: e.expression }), /* @__PURE__ */ o(Gn, {})]
2912
- }), /* @__PURE__ */ o(Vn, {})]
3090
+ children: [/* @__PURE__ */ o("span", { children: e.expression }), /* @__PURE__ */ o($n, {})]
3091
+ }), /* @__PURE__ */ o(Yn, {})]
3092
+ });
3093
+ case "operation-solving": return /* @__PURE__ */ s("div", {
3094
+ className: `printable-operation-solving printable-operation-solving--${e.solutionMode}`,
3095
+ children: [
3096
+ /* @__PURE__ */ o("div", {
3097
+ className: "printable-operation-solving__equation",
3098
+ children: Vn(e)
3099
+ }),
3100
+ e.solutionMode === "full-process" ? /* @__PURE__ */ o("div", {
3101
+ className: "printable-operation-solving__work",
3102
+ children: /* @__PURE__ */ o("span", { children: er(r) ? "أَنْجِزُ الْعَمَلِيَّةَ" : "Zone de travail" })
3103
+ }) : null,
3104
+ /* @__PURE__ */ s("div", {
3105
+ className: "printable-inline-answer printable-operation-solving__answer",
3106
+ children: [/* @__PURE__ */ o("span", { children: er(r) ? "النَّتِيجَةُ" : "Resultat" }), /* @__PURE__ */ o($n, {})]
3107
+ })
3108
+ ]
2913
3109
  });
2914
3110
  case "visual-choice": return /* @__PURE__ */ s("div", {
2915
3111
  className: "printable-visual-match",
2916
- children: [/* @__PURE__ */ o(Pn, {
3112
+ children: [/* @__PURE__ */ o(Hn, {
2917
3113
  choices: e.choices,
2918
- scene: e.scene ?? en(e.visual)
3114
+ scene: e.scene ?? sn(e.visual)
2919
3115
  }), e.inputLabel ? /* @__PURE__ */ s("div", {
2920
3116
  className: "printable-inline-answer",
2921
3117
  children: [/* @__PURE__ */ o("span", { children: e.inputLabel }), /* @__PURE__ */ o($, {})]
@@ -2925,9 +3121,9 @@ function kn(e, t, n, r) {
2925
3121
  className: "printable-length-task",
2926
3122
  children: /* @__PURE__ */ o("div", {
2927
3123
  className: "printable-length-list",
2928
- children: e.items.map((e) => /* @__PURE__ */ o(Hn, {
3124
+ children: e.items.map((e) => /* @__PURE__ */ o(Xn, {
2929
3125
  item: e,
2930
- squareUnit: Kn(r) ? "مربعات" : "carres",
3126
+ squareUnit: er(r) ? "مربعات" : "carres",
2931
3127
  variant: t
2932
3128
  }, e.id))
2933
3129
  })
@@ -2939,7 +3135,7 @@ function kn(e, t, n, r) {
2939
3135
  className: "printable-shape-bank",
2940
3136
  children: e.choices.map((e) => /* @__PURE__ */ o("div", {
2941
3137
  className: "printable-shape-card",
2942
- children: /* @__PURE__ */ o(Me, { shapeId: e.id })
3138
+ children: /* @__PURE__ */ o(Ne, { shapeId: e.id })
2943
3139
  }, e.id))
2944
3140
  }),
2945
3141
  /* @__PURE__ */ o("div", {
@@ -2949,12 +3145,12 @@ function kn(e, t, n, r) {
2949
3145
  children: [/* @__PURE__ */ s("span", { children: [t + 1, "."] }), /* @__PURE__ */ o("strong", { children: e.label })]
2950
3146
  }, e.id))
2951
3147
  }),
2952
- /* @__PURE__ */ o(Nn, { label: n.dragArea })
3148
+ /* @__PURE__ */ o(Bn, { label: n.dragArea })
2953
3149
  ]
2954
3150
  });
2955
3151
  case "drawing-grid": return /* @__PURE__ */ o("div", {
2956
3152
  className: "printable-drawing-block",
2957
- children: /* @__PURE__ */ o(Bn, { points: e.points })
3153
+ children: /* @__PURE__ */ o(Jn, { points: e.points })
2958
3154
  });
2959
3155
  case "table-response": return /* @__PURE__ */ o("div", {
2960
3156
  className: "printable-table-response",
@@ -2988,13 +3184,13 @@ function kn(e, t, n, r) {
2988
3184
  children: e.situation
2989
3185
  }), /* @__PURE__ */ o("div", {
2990
3186
  className: "printable-word-problem__parts",
2991
- children: e.parts.map((e, t) => /* @__PURE__ */ o(Un, {
3187
+ children: e.parts.map((e, t) => /* @__PURE__ */ o(Zn, {
2992
3188
  part: e,
2993
3189
  partNumber: t + 1
2994
3190
  }, e.id))
2995
3191
  })]
2996
3192
  });
2997
- case "drag-match": return /* @__PURE__ */ o(In, {
3193
+ case "drag-match": return /* @__PURE__ */ o(Wn, {
2998
3194
  items: e.items,
2999
3195
  targets: e.targets
3000
3196
  });
@@ -3017,7 +3213,7 @@ function kn(e, t, n, r) {
3017
3213
  case "label-placement": return /* @__PURE__ */ s("div", {
3018
3214
  className: "printable-label-placement",
3019
3215
  children: [
3020
- /* @__PURE__ */ o(zn, { targets: e.targets }),
3216
+ /* @__PURE__ */ o(qn, { targets: e.targets }),
3021
3217
  /* @__PURE__ */ o("div", {
3022
3218
  className: "printable-placement-labels",
3023
3219
  children: e.labels.map((e) => /* @__PURE__ */ o("span", {
@@ -3025,7 +3221,7 @@ function kn(e, t, n, r) {
3025
3221
  children: /* @__PURE__ */ o("strong", { children: e.label })
3026
3222
  }, e.id))
3027
3223
  }),
3028
- /* @__PURE__ */ o(Nn, { label: n.placeLabels })
3224
+ /* @__PURE__ */ o(Bn, { label: n.placeLabels })
3029
3225
  ]
3030
3226
  });
3031
3227
  case "audio-recording": return /* @__PURE__ */ s("div", {
@@ -3050,49 +3246,52 @@ function kn(e, t, n, r) {
3050
3246
  });
3051
3247
  }
3052
3248
  }
3053
- function An({ label: e, value: t }) {
3249
+ function Ln({ label: e, value: t }) {
3054
3250
  return /* @__PURE__ */ s("div", {
3055
3251
  className: "printable-meta-pill",
3056
3252
  children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ o("strong", { children: t })]
3057
3253
  });
3058
3254
  }
3059
- function jn({ noteLabel: e, totalPoints: t }) {
3255
+ function Rn({ noteLabel: e, totalPoints: t }) {
3060
3256
  return /* @__PURE__ */ s("div", {
3061
3257
  className: "printable-note-box",
3062
3258
  children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ s("strong", { children: [/* @__PURE__ */ o("i", { "aria-hidden": "true" }), /* @__PURE__ */ s("b", { children: ["/ ", t] })] })]
3063
3259
  });
3064
3260
  }
3065
- function Mn(e) {
3261
+ function zn(e) {
3066
3262
  let t = e.sections.filter((e) => e.isScored !== !1).map((e) => Number.parseFloat(e.points.replace(",", "."))).filter((e) => Number.isFinite(e));
3067
3263
  if (t.length === 0) return "";
3068
3264
  let n = t.reduce((e, t) => e + t, 0);
3069
3265
  return String(Number.isInteger(n) ? n : Number(n.toFixed(2)));
3070
3266
  }
3071
- function Nn({ label: e }) {
3267
+ function Bn({ label: e }) {
3072
3268
  return /* @__PURE__ */ s("div", {
3073
3269
  className: "printable-hint-line",
3074
3270
  children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ o($, {})]
3075
3271
  });
3076
3272
  }
3077
- function Pn({ choices: e, scene: t }) {
3273
+ function Vn(e) {
3274
+ return `${e.leftOperand} ${e.operator} ${e.rightOperand} =`;
3275
+ }
3276
+ function Hn({ choices: e, scene: t }) {
3078
3277
  return /* @__PURE__ */ o("div", {
3079
3278
  className: "printable-visual-match__preview",
3080
3279
  children: /* @__PURE__ */ s("div", {
3081
3280
  className: "visual-line-match printable-visual-line-match",
3082
3281
  children: [/* @__PURE__ */ s("div", {
3083
3282
  className: "visual-match-picture printable-visual-match-picture",
3084
- children: [/* @__PURE__ */ o(nn, { scene: t }), /* @__PURE__ */ o("span", {
3283
+ children: [/* @__PURE__ */ o(ln, { scene: t }), /* @__PURE__ */ o("span", {
3085
3284
  "aria-hidden": "true",
3086
3285
  className: "visual-match-point visual-match-point--target printable-match-point printable-match-point--target"
3087
3286
  })]
3088
3287
  }), /* @__PURE__ */ o("div", {
3089
3288
  className: "visual-line-match__answers printable-visual-line-match__answers",
3090
- children: e.map((e) => /* @__PURE__ */ o(Fn, { choice: e }, e.id))
3289
+ children: e.map((e) => /* @__PURE__ */ o(Un, { choice: e }, e.id))
3091
3290
  })]
3092
3291
  })
3093
3292
  });
3094
3293
  }
3095
- function Fn({ choice: e }) {
3294
+ function Un({ choice: e }) {
3096
3295
  return /* @__PURE__ */ s("div", {
3097
3296
  className: "visual-match-answer printable-visual-match-answer",
3098
3297
  children: [/* @__PURE__ */ o("span", {
@@ -3104,13 +3303,13 @@ function Fn({ choice: e }) {
3104
3303
  })]
3105
3304
  });
3106
3305
  }
3107
- function In({ items: e, targets: t }) {
3306
+ function Wn({ items: e, targets: t }) {
3108
3307
  return /* @__PURE__ */ s("div", {
3109
3308
  className: "printable-drag-match-board",
3110
3309
  children: [
3111
3310
  /* @__PURE__ */ o("div", {
3112
3311
  className: "printable-drag-match-column printable-drag-match-column--targets",
3113
- children: t.map((e, t) => /* @__PURE__ */ o(Ln, {
3312
+ children: t.map((e, t) => /* @__PURE__ */ o(Gn, {
3114
3313
  index: t,
3115
3314
  target: e
3116
3315
  }, e.id))
@@ -3122,7 +3321,7 @@ function In({ items: e, targets: t }) {
3122
3321
  }),
3123
3322
  /* @__PURE__ */ o("div", {
3124
3323
  className: "printable-drag-match-column printable-drag-match-column--answers",
3125
- children: e.map((e, t) => /* @__PURE__ */ o(Rn, {
3324
+ children: e.map((e, t) => /* @__PURE__ */ o(Kn, {
3126
3325
  index: t,
3127
3326
  item: e
3128
3327
  }, e.id))
@@ -3130,7 +3329,7 @@ function In({ items: e, targets: t }) {
3130
3329
  ]
3131
3330
  });
3132
3331
  }
3133
- function Ln({ index: e, target: t }) {
3332
+ function Gn({ index: e, target: t }) {
3134
3333
  return /* @__PURE__ */ s("div", {
3135
3334
  className: "printable-drag-match-card printable-drag-match-card--target",
3136
3335
  children: [
@@ -3140,7 +3339,7 @@ function Ln({ index: e, target: t }) {
3140
3339
  }),
3141
3340
  /* @__PURE__ */ o("div", {
3142
3341
  className: "printable-drag-match-content",
3143
- children: t.shapeId ? /* @__PURE__ */ o(Me, { shapeId: t.shapeId }) : /* @__PURE__ */ o("strong", { children: t.label })
3342
+ children: t.shapeId ? /* @__PURE__ */ o(Ne, { shapeId: t.shapeId }) : /* @__PURE__ */ o("strong", { children: t.label })
3144
3343
  }),
3145
3344
  /* @__PURE__ */ o("span", {
3146
3345
  "aria-hidden": "true",
@@ -3149,7 +3348,7 @@ function Ln({ index: e, target: t }) {
3149
3348
  ]
3150
3349
  });
3151
3350
  }
3152
- function Rn({ index: e, item: t }) {
3351
+ function Kn({ index: e, item: t }) {
3153
3352
  return /* @__PURE__ */ s("div", {
3154
3353
  className: "printable-drag-match-card printable-drag-match-card--answer",
3155
3354
  children: [
@@ -3168,7 +3367,7 @@ function Rn({ index: e, item: t }) {
3168
3367
  ]
3169
3368
  });
3170
3369
  }
3171
- function zn({ targets: e }) {
3370
+ function qn({ targets: e }) {
3172
3371
  return /* @__PURE__ */ o("div", {
3173
3372
  className: "printable-placement-board",
3174
3373
  children: e.map((e, t) => /* @__PURE__ */ o("div", {
@@ -3181,7 +3380,7 @@ function zn({ targets: e }) {
3181
3380
  }, e.id))
3182
3381
  });
3183
3382
  }
3184
- function Bn({ points: e }) {
3383
+ function Jn({ points: e }) {
3185
3384
  return /* @__PURE__ */ s("svg", {
3186
3385
  className: "printable-drawing-grid",
3187
3386
  viewBox: "0 0 1000 420",
@@ -3212,7 +3411,7 @@ function Bn({ points: e }) {
3212
3411
  ]
3213
3412
  });
3214
3413
  }
3215
- function Vn() {
3414
+ function Yn() {
3216
3415
  return /* @__PURE__ */ s("svg", {
3217
3416
  className: "printable-number-line",
3218
3417
  viewBox: "0 0 420 90",
@@ -3236,7 +3435,7 @@ function Vn() {
3236
3435
  }, t))]
3237
3436
  });
3238
3437
  }
3239
- function Hn({ item: e, squareUnit: t, variant: n }) {
3438
+ function Xn({ item: e, squareUnit: t, variant: n }) {
3240
3439
  return /* @__PURE__ */ s("div", {
3241
3440
  className: "length-card printable-length-card",
3242
3441
  children: [/* @__PURE__ */ o("div", {
@@ -3265,13 +3464,13 @@ function Hn({ item: e, squareUnit: t, variant: n }) {
3265
3464
  className: "length-value-row printable-length-value-row",
3266
3465
  children: [
3267
3466
  /* @__PURE__ */ o("span", { children: e.label }),
3268
- /* @__PURE__ */ o(Gn, {}),
3467
+ /* @__PURE__ */ o($n, {}),
3269
3468
  /* @__PURE__ */ o("span", { children: t })
3270
3469
  ]
3271
3470
  })]
3272
3471
  });
3273
3472
  }
3274
- function Un({ part: e, partNumber: t }) {
3473
+ function Zn({ part: e, partNumber: t }) {
3275
3474
  return /* @__PURE__ */ s("section", {
3276
3475
  className: "printable-word-problem__part",
3277
3476
  children: [/* @__PURE__ */ s("div", {
@@ -3300,10 +3499,10 @@ function Un({ part: e, partNumber: t }) {
3300
3499
  })]
3301
3500
  });
3302
3501
  }
3303
- function Wn({ item: t }) {
3304
- return t.answers?.length ? /* @__PURE__ */ s(a, { children: [t.answers.map((t) => /* @__PURE__ */ s(e, { children: [t.before ? /* @__PURE__ */ o("span", { children: t.before }) : null, /* @__PURE__ */ o(Gn, {})] }, t.id)), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] }) : t.correctAnswer ? /* @__PURE__ */ s(a, { children: [
3502
+ function Qn({ item: t }) {
3503
+ return t.answers?.length ? /* @__PURE__ */ s(a, { children: [t.answers.map((t) => /* @__PURE__ */ s(e, { children: [t.before ? /* @__PURE__ */ o("span", { children: t.before }) : null, /* @__PURE__ */ o($n, {})] }, t.id)), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] }) : t.correctAnswer ? /* @__PURE__ */ s(a, { children: [
3305
3504
  /* @__PURE__ */ o("span", { children: t.before }),
3306
- /* @__PURE__ */ o(Gn, {}),
3505
+ /* @__PURE__ */ o($n, {}),
3307
3506
  t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null
3308
3507
  ] }) : /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", { children: t.before }), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] });
3309
3508
  }
@@ -3313,17 +3512,17 @@ function $() {
3313
3512
  "aria-hidden": "true"
3314
3513
  });
3315
3514
  }
3316
- function Gn() {
3515
+ function $n() {
3317
3516
  return /* @__PURE__ */ o("span", {
3318
3517
  className: "printable-blank-box",
3319
3518
  "aria-hidden": "true"
3320
3519
  });
3321
3520
  }
3322
- function Kn(e) {
3521
+ function er(e) {
3323
3522
  return e.startsWith("ar");
3324
3523
  }
3325
- function qn(e) {
3326
- return Kn(e) ? {
3524
+ function tr(e) {
3525
+ return er(e) ? {
3327
3526
  answerArea: "مساحة الجواب",
3328
3527
  countShort: "عدد",
3329
3528
  dragArea: "اربط أو اكتب الجواب",
@@ -3360,7 +3559,7 @@ function qn(e) {
3360
3559
  }
3361
3560
  //#endregion
3362
3561
  //#region src/exam-session/interactions/DraftSheet.tsx
3363
- function Jn({ disabled: e, onChange: t, value: n }) {
3562
+ function nr({ disabled: e, onChange: t, value: n }) {
3364
3563
  let [r, a] = i(!1);
3365
3564
  return /* @__PURE__ */ o("aside", {
3366
3565
  className: "draft-sheet",
@@ -3377,7 +3576,7 @@ function Jn({ disabled: e, onChange: t, value: n }) {
3377
3576
  type: "button",
3378
3577
  children: "إِغْلاقٌ"
3379
3578
  })]
3380
- }), /* @__PURE__ */ o(Ze, {
3579
+ }), /* @__PURE__ */ o(Qe, {
3381
3580
  actionLabel: "مساحة ورقة وساخ",
3382
3581
  canvasHeight: 430,
3383
3582
  disabled: e,
@@ -3396,7 +3595,7 @@ function Jn({ disabled: e, onChange: t, value: n }) {
3396
3595
  }
3397
3596
  //#endregion
3398
3597
  //#region src/exam-session/interactions/SingleChoice.tsx
3399
- function Yn({ answerId: e, choices: t, value: n, onChange: r }) {
3598
+ function rr({ answerId: e, choices: t, value: n, onChange: r }) {
3400
3599
  return /* @__PURE__ */ o("div", {
3401
3600
  className: "choice-group",
3402
3601
  role: "radiogroup",
@@ -3421,4 +3620,4 @@ function Yn({ answerId: e, choices: t, value: n, onChange: r }) {
3421
3620
  });
3422
3621
  }
3423
3622
  //#endregion
3424
- export { De as CoinTableResponse, ze as ColorPenPicker, K as DEFAULT_GEOMETRY_COLORS, At as DEFAULT_NATIVE_VOICE_AI_CONFIG, Jn as DraftSheet, Ne as DragMatch, on as ExamSectionRenderer, Ze as GeometryCanvas, G as HandwrittenNumberAnswer, wt as KonvaDrawingGrid, Tt as LabelPlacement, Ot as NumberLineAnswer, Tn as PrintableExamDocument, On as PrintableQuestionRenderer, Dn as PrintableSectionRenderer, Lt as PronunciationRecorder, Cn as QuestionPreviewPanel, an as QuestionRenderer, Me as ShapeGlyph, Yn as SingleChoice, Gt as SortableAnswer, qt as TextAnswer, nn as VisualSceneGraphic, ie as calculateExamResult, en as createVisualSceneFromVariant, jt as evaluateVoiceAiResult, Ae as examShapeOptions, He as getColorValue, Ve as getDefaultColorId, je as getExamShapeLabel, tn as getVisualSceneColorValue, Ue as mapChoicesToGeometryColors, Mt as normalizeVoiceText, Qt as visualSceneColorOptions, Zt as visualSceneIconOptions, $t as visualSceneStateOptions };
3623
+ export { Oe as CoinTableResponse, Be as ColorPenPicker, K as DEFAULT_GEOMETRY_COLORS, Ft as DEFAULT_NATIVE_VOICE_AI_CONFIG, nr as DraftSheet, Pe as DragMatch, fn as ExamSectionRenderer, Qe as GeometryCanvas, G as HandwrittenNumberAnswer, Tt as KonvaDrawingGrid, Et as LabelPlacement, kt as NumberLineAnswer, Nt as OperationWorkArea, Mn as PrintableExamDocument, Fn as PrintableQuestionRenderer, Pn as PrintableSectionRenderer, Ht as PronunciationRecorder, An as QuestionPreviewPanel, dn as QuestionRenderer, Ne as ShapeGlyph, rr as SingleChoice, Zt as SortableAnswer, $t as TextAnswer, ln as VisualSceneGraphic, ie as calculateExamResult, sn as createVisualSceneFromVariant, It as evaluateVoiceAiResult, je as examShapeOptions, Ue as getColorValue, He as getDefaultColorId, Me as getExamShapeLabel, cn as getVisualSceneColorValue, We as mapChoicesToGeometryColors, Lt as normalizeVoiceText, an as visualSceneColorOptions, rn as visualSceneIconOptions, on as visualSceneStateOptions };