hyperbook 0.113.0 → 0.113.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +18 -3
  2. package/dist/asset-manifest.json +9 -9
  3. package/dist/assets/directive-bitflow/{EditorElement-zyz99U6n.js → EditorElement-CE3Yr86b.js} +155 -155
  4. package/dist/assets/directive-bitflow/{ReportElements-BnX14NtV.js → ReportElements-eYGRtw6N.js} +1 -1
  5. package/dist/assets/directive-bitflow/{bitLoaders-DIGwTcpd.js → bitLoaders-CxvZkGrY.js} +1138 -1073
  6. package/dist/assets/directive-bitflow/editor.js +3 -3
  7. package/dist/assets/directive-bitflow/flow.js +3 -3
  8. package/dist/assets/directive-bitflow/{index-IQHOi2fr.js → index-88c3K20U.js} +31 -31
  9. package/dist/assets/directive-bitflow/{index-Bqf-kixT.js → index-B61LKxr1.js} +45 -45
  10. package/dist/assets/directive-bitflow/{index-CFcRAa3F.js → index-BG0PL-Z6.js} +30 -30
  11. package/dist/assets/directive-bitflow/{index-B3jMTk1o.js → index-BNdpL6Ss.js} +78 -78
  12. package/dist/assets/directive-bitflow/{index-Fq7njn6_.js → index-BO-d4HVC.js} +48 -48
  13. package/dist/assets/directive-bitflow/{index-Bf_NXJjq.js → index-BZhNY0lo.js} +12 -12
  14. package/dist/assets/directive-bitflow/{index-COndsSPW.js → index-BadyFTU5.js} +8 -8
  15. package/dist/assets/directive-bitflow/{index-CvCZVgKv.js → index-BlT1EcFH.js} +34 -34
  16. package/dist/assets/directive-bitflow/{index-CW9iev-_.js → index-BuQ-K_tR.js} +7 -7
  17. package/dist/assets/directive-bitflow/{index-DjWNEPDL.js → index-Bw0pL0hW.js} +28 -28
  18. package/dist/assets/directive-bitflow/{index-BQ5h4nDN.js → index-BwBVUdJ9.js} +94 -94
  19. package/dist/assets/directive-bitflow/{index-CjscG0z6.js → index-BydYlLy4.js} +73 -73
  20. package/dist/assets/directive-bitflow/{index-BpG316Ls.js → index-C7RJxxAx.js} +63 -63
  21. package/dist/assets/directive-bitflow/{index-eN2S_MLj.js → index-CERSJ9uS.js} +70 -70
  22. package/dist/assets/directive-bitflow/{index-DtsDy2By.js → index-CLHtOGrW.js} +11 -11
  23. package/dist/assets/directive-bitflow/{index-Bf_FQRbK.js → index-CWe2GjBK.js} +14 -14
  24. package/dist/assets/directive-bitflow/{index-CzdZQibq.js → index-CfKpkSVC.js} +72 -72
  25. package/dist/assets/directive-bitflow/{index-Fr7yl4Vn.js → index-CjKhq7gY.js} +23 -23
  26. package/dist/assets/directive-bitflow/{index-DoKlIgCD.js → index-Cm4w1Zyc.js} +38 -38
  27. package/dist/assets/directive-bitflow/{index-D5yZNeIg.js → index-D0U3nepG.js} +52 -52
  28. package/dist/assets/directive-bitflow/{index-C5czXkRd.js → index-D4PdXMcj.js} +33 -33
  29. package/dist/assets/directive-bitflow/{index-BLcJNyog.js → index-D9LOuqr2.js} +99 -99
  30. package/dist/assets/directive-bitflow/{index-BIJ7VfD2.js → index-DIb3CXwC.js} +42 -42
  31. package/dist/assets/directive-bitflow/{index-CZyaFdD2.js → index-DQP0cUsP.js} +70 -70
  32. package/dist/assets/directive-bitflow/{index-ChgzyMHe.js → index-DUOrQfVe.js} +27 -27
  33. package/dist/assets/directive-bitflow/{index-kRpwcprB.js → index-DW3cUBvZ.js} +1 -1
  34. package/dist/assets/directive-bitflow/{index-C_ZTSeqv.js → index-DYWo0PUv.js} +24 -24
  35. package/dist/assets/directive-bitflow/{index-xapm2BQE.js → index-D_QhyFcx.js} +101 -91
  36. package/dist/assets/directive-bitflow/{index-BdBBCZSy.js → index-Dn5hHVuT.js} +226 -193
  37. package/dist/assets/directive-bitflow/{index-D7m-hJZ9.js → index-DruC5d43.js} +69 -69
  38. package/dist/assets/directive-bitflow/{index-e_8twLaN.js → index-EKIgFddO.js} +105 -105
  39. package/dist/assets/directive-bitflow/{index-8jTO-NJA.js → index-HXNGIC7K.js} +70 -70
  40. package/dist/assets/directive-bitflow/{index-DnVYIuen.js → index-ISbOe239.js} +42 -42
  41. package/dist/assets/directive-bitflow/{index-cnRM_JDB.js → index-IsMJtrUT.js} +31 -31
  42. package/dist/assets/directive-bitflow/{index-B7Z6Q-PQ.js → index-TUXuIR22.js} +6 -6
  43. package/dist/assets/directive-bitflow/{index-CK1UMcfT.js → index-WbE9UOFa.js} +24 -24
  44. package/dist/assets/directive-bitflow/{index-YPMWh-1B.js → index-d5ebPDeY.js} +13 -13
  45. package/dist/assets/directive-bitflow/{index-NyNuXp4C.js → index-ledofrbo.js} +33 -33
  46. package/dist/assets/directive-bitflow/{index-BseSaQlX.js → index-oNmOArKu.js} +1 -1
  47. package/dist/assets/directive-bitflow/{index-ivI25bnR.js → index-rp4UTV85.js} +84 -84
  48. package/dist/assets/directive-bitflow/{index-XxGfBwJe.js → index-xTX3CXJW.js} +23 -23
  49. package/dist/assets/directive-bitflow/index.js +6 -6
  50. package/dist/assets/directive-bitflow/katex-DSLAjWZH-CHGN3Pr6.js +11314 -0
  51. package/dist/assets/directive-bitflow/katex-Dv-tcU2S-Dv-tcU2S.js +4 -0
  52. package/dist/assets/directive-bitflow/report.js +1 -1
  53. package/dist/assets/directive-bitflow/{shareableReport-ArQU1XjG.js → shareableReport-vjEU4OvA.js} +2 -2
  54. package/dist/index.js +6351 -3340
  55. package/dist/schemas/hyperbook.schema.json +4 -4
  56. package/package.json +5 -5
@@ -1,12 +1,12 @@
1
- import { L as Z, ak as he, P as N, a2 as E, ac as we, ad as ne, a9 as q, a4 as pe, j as i, a as x, a5 as ve, b as P, aj as O, aa as xe, s as ge } from "./dom-uYx_3K1r.js";
2
- import { v as ke, A as I, M as G, P as je, t as K, _ as Y, e as ye, E as Le, s as Ne, L as Te, R as Se } from "./bitLoaders-DIGwTcpd.js";
3
- const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
1
+ import { L as A, ak as he, P as N, a2 as O, ac as we, ad as ne, a9 as q, a4 as pe, j as i, a as x, a5 as ve, b as P, aj as E, aa as xe, s as ge } from "./dom-uYx_3K1r.js";
2
+ import { e as ke, g as R, F as G, M as je, r as K, i as Y, P as ye, B as Le, y as Ne, U as Te, H as Se } from "./bitLoaders-CxvZkGrY.js";
3
+ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
4
4
  /** Stable across edits, so a placed marker and an answer keep pointing at
5
5
  * the same item even after the author reorders the list. */
6
- id: E().min(1),
6
+ id: O().min(1),
7
7
  /** What the chip and the marker show — plain text, e.g. "3/4" or "√2". Not
8
8
  * parsed: it is only ever displayed, never read back into arithmetic. */
9
- label: E().min(1),
9
+ label: O().min(1),
10
10
  /** The correct position, in the line's own units — never a fraction of the
11
11
  * line's length. The author types an expression in the form ("3/4",
12
12
  * "sqrt(2)"); this is always the evaluated number. */
@@ -14,8 +14,8 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
14
14
  /** Overrides `tolerance` for this one item — a harder root among easier
15
15
  * fractions, say. Absent means the line's own tolerance applies. */
16
16
  tolerance: N().min(0).optional()
17
- }), ze = Z({
18
- instruction: E().default(""),
17
+ }), He = A({
18
+ instruction: O().default(""),
19
19
  /** The line's extent, in its own units. */
20
20
  min: N().default(-2),
21
21
  max: N().default(2),
@@ -77,24 +77,24 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
77
77
  message: `${o.value} is outside the line (${r} to ${c}).`
78
78
  });
79
79
  });
80
- }), at = Z({
80
+ }), at = A({
81
81
  /** Item id → where the learner placed it, in the line's own units. */
82
- positions: he(E(), N()).default({})
83
- }), He = (e) => e.tolerance ?? e.tickStep / 4, Pe = (e, r) => r.tolerance ?? He(e), We = 1e-9, B = (e, r) => {
82
+ positions: he(O(), N()).default({})
83
+ }), ze = (e) => e.tolerance ?? e.tickStep / 4, Pe = (e, r) => r.tolerance ?? ze(e), We = 1e-9, F = (e, r) => {
84
84
  const c = {};
85
85
  for (const n of e.items) {
86
86
  const a = r?.positions?.[n.id];
87
87
  c[n.id] = a !== void 0 && Math.abs(a - n.value) <= Pe(e, n) + We ? "correct" : "wrong";
88
88
  }
89
89
  return c;
90
- }, Re = (e, r) => {
91
- const c = Object.values(B(e, r));
90
+ }, Ie = (e, r) => {
91
+ const c = Object.values(F(e, r));
92
92
  return {
93
93
  earned: c.filter((n) => n === "correct").length,
94
94
  possible: c.length
95
95
  };
96
- }, Ie = (e, r) => {
97
- const c = Object.values(B(e, r));
96
+ }, Re = (e, r) => {
97
+ const c = Object.values(F(e, r));
98
98
  return c.length > 0 && c.every((n) => n === "correct");
99
99
  }, $e = ({
100
100
  data: e,
@@ -102,12 +102,12 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
102
102
  }) => {
103
103
  if (e.evaluation.mode === "skip")
104
104
  return { state: "unknown", allowRetry: !1 };
105
- const c = Ie(e, r), n = Re(e, r), a = e.partialCredit && n.possible > 0 ? n : { earned: c ? 1 : 0, possible: 1 };
105
+ const c = Re(e, r), n = Ie(e, r), a = e.partialCredit && n.possible > 0 ? n : { earned: c ? 1 : 0, possible: 1 };
106
106
  return {
107
107
  state: c ? "correct" : "wrong",
108
108
  score: a,
109
109
  allowRetry: e.evaluation.enableRetry,
110
- detail: { items: B(e, r) }
110
+ detail: { items: F(e, r) }
111
111
  };
112
112
  }, V = {
113
113
  en: {
@@ -144,7 +144,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
144
144
  wrong: "falsch",
145
145
  correctValue: "Richtige Position: {value}"
146
146
  }
147
- }, Ee = ".bitflow-number-line{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-number-line-diagram{width:100%;height:auto;background:var(--bitflow-color-surface);border:1px solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-number-line-axis{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(3 * var(--bitflow-number-line-scale, 1));stroke-linecap:round}.bitflow-number-line-ticks-major line{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-ticks-minor line{stroke:var(--bitflow-color-neutral-200);stroke-width:calc(1.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-tick-labels text{fill:var(--bitflow-color-text-muted);font-family:var(--bitflow-font-family);font-size:calc(23px * var(--bitflow-number-line-scale, 1));font-variant-numeric:tabular-nums;text-anchor:middle}.bitflow-number-line-catcher{cursor:crosshair}.bitflow-number-line-answer line{stroke:var(--bitflow-color-text-muted);stroke-width:3;stroke-dasharray:6 5}.bitflow-number-line-label text{fill:var(--bitflow-color-text);stroke:var(--bitflow-color-surface);stroke-width:5px;paint-order:stroke fill;font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-medium);text-anchor:middle}.bitflow-number-line-dot{fill:var(--bitflow-color-primary);stroke:var(--bitflow-color-on-primary);stroke-width:2}.bitflow-number-line-dot-active{stroke:var(--bitflow-color-neutral-900);stroke-width:3}.bitflow-number-line-dot-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-dot-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-verdict{font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-verdict-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-verdict-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-hit{fill:transparent;stroke:none;cursor:grab;touch-action:none}.bitflow-number-line-hit:focus-visible{outline:3px solid var(--bitflow-color-primary);outline-offset:2px}.bitflow-number-line-palette{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xxsmall)}.bitflow-number-line-chip{display:inline-flex;align-items:center;min-height:44px;padding:var(--bitflow-space-xxsmall) var(--bitflow-space-small);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-full);background:var(--bitflow-color-surface);cursor:pointer}.bitflow-number-line-chip:has(:checked){border-color:var(--bitflow-color-neutral-900);font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-chip:has(:focus-visible){box-shadow:var(--bitflow-shadow-outline)}.bitflow-number-line-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-row-label{flex:1 1 auto;font-variant-numeric:tabular-nums}.bitflow-number-line-badge{font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-badge-correct{color:var(--bitflow-color-correct)}.bitflow-number-line-badge-wrong{color:var(--bitflow-color-wrong)}.bitflow-number-line-editor-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-editor-row>.bitflow-input{flex:1 1 8rem;width:auto;min-width:0}.bitflow-number-line-number{flex:0 1 var(--bitflow-number-line-number-width, 6rem);width:var(--bitflow-number-line-number-width, 6rem)}", Oe = {
147
+ }, Oe = ".bitflow-number-line{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-number-line-diagram{width:100%;height:auto;background:var(--bitflow-color-surface);border:1px solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-number-line-axis{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(3 * var(--bitflow-number-line-scale, 1));stroke-linecap:round}.bitflow-number-line-ticks-major line{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-ticks-minor line{stroke:var(--bitflow-color-neutral-200);stroke-width:calc(1.5 * var(--bitflow-number-line-scale, 1))}.bitflow-number-line-tick-labels text{fill:var(--bitflow-color-text-muted);font-family:var(--bitflow-font-family);font-size:calc(23px * var(--bitflow-number-line-scale, 1));font-variant-numeric:tabular-nums;text-anchor:middle}.bitflow-number-line-catcher{cursor:crosshair}.bitflow-number-line-answer line{stroke:var(--bitflow-color-text-muted);stroke-width:3;stroke-dasharray:6 5}.bitflow-number-line-label text{fill:var(--bitflow-color-text);stroke:var(--bitflow-color-surface);stroke-width:5px;paint-order:stroke fill;font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-medium);text-anchor:middle}.bitflow-number-line-dot{fill:var(--bitflow-color-primary);stroke:var(--bitflow-color-on-primary);stroke-width:2}.bitflow-number-line-dot-active{stroke:var(--bitflow-color-neutral-900);stroke-width:3}.bitflow-number-line-dot-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-dot-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-verdict{font-family:var(--bitflow-font-family);font-size:22px;font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-verdict-correct{fill:var(--bitflow-color-correct)}.bitflow-number-line-verdict-wrong{fill:var(--bitflow-color-wrong)}.bitflow-number-line-hit{fill:transparent;stroke:none;cursor:grab;touch-action:none}.bitflow-number-line-hit:focus-visible{outline:3px solid var(--bitflow-color-primary);outline-offset:2px}.bitflow-number-line-palette{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xxsmall)}.bitflow-number-line-chip{display:inline-flex;align-items:center;min-height:44px;padding:var(--bitflow-space-xxsmall) var(--bitflow-space-small);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-full);background:var(--bitflow-color-surface);cursor:pointer}.bitflow-number-line-chip:has(:checked){border-color:var(--bitflow-color-neutral-900);font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-chip:has(:focus-visible){box-shadow:var(--bitflow-shadow-outline)}.bitflow-number-line-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-row-label{flex:1 1 auto;font-variant-numeric:tabular-nums}.bitflow-number-line-badge{font-weight:var(--bitflow-font-weight-bold)}.bitflow-number-line-badge-correct{color:var(--bitflow-color-correct)}.bitflow-number-line-badge-wrong{color:var(--bitflow-color-wrong)}.bitflow-number-line-editor-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-number-line-editor-row>.bitflow-input{flex:1 1 8rem;width:auto;min-width:0}.bitflow-number-line-number{flex:0 1 var(--bitflow-number-line-number-width, 6rem);width:var(--bitflow-number-line-number-width, 6rem)}", Ee = {
148
148
  en: {
149
149
  instructionLabel: "Instruction",
150
150
  instructionHint: "Shown above the line. Markdown is allowed.",
@@ -213,15 +213,15 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
213
213
  partialCreditHint: "Ein Punkt je Wert statt einer für den ganzen Zahlenstrahl. Neun von zehn richtig platziert sind neun Zehntel der Wertung.",
214
214
  advanced: "Erweitert"
215
215
  }
216
- }, $ = 1e3, Ve = 220, S = { left: 48, right: 48 }, F = $ - S.left - S.right, y = 132, oe = (e) => e.max - e.min || 1, z = (e, r) => S.left + (r - e.min) / oe(e) * F, Ae = (e, r) => e.min + (r - S.left) / F * oe(e), _ = (e) => e.minorTicks > 0 ? e.tickStep / (e.minorTicks + 1) : e.tickStep, se = (e, r) => {
216
+ }, $ = 1e3, Ve = 220, S = { left: 48, right: 48 }, B = $ - S.left - S.right, y = 132, oe = (e) => e.max - e.min || 1, H = (e, r) => S.left + (r - e.min) / oe(e) * B, De = (e, r) => e.min + (r - S.left) / B * oe(e), U = (e) => e.minorTicks > 0 ? e.tickStep / (e.minorTicks + 1) : e.tickStep, se = (e, r) => {
217
217
  if (r !== "none")
218
- return r === "major" ? e.tickStep : _(e);
219
- }, De = (e) => se(e, e.snap) ?? _(e), W = (e) => Math.round(e * 1e9) / 1e9, J = (e, r) => {
218
+ return r === "major" ? e.tickStep : U(e);
219
+ }, Ze = (e) => se(e, e.snap) ?? U(e), W = (e) => Math.round(e * 1e9) / 1e9, J = (e, r) => {
220
220
  const c = Math.min(Math.max(r, e.min), e.max), n = se(e, e.snap);
221
221
  if (!n) return W(c);
222
222
  const a = e.min + Math.round((c - e.min) / n) * n;
223
223
  return W(Math.min(Math.max(a, e.min), e.max));
224
- }, Q = 400, Ze = (e) => {
224
+ }, Q = 400, Ae = (e) => {
225
225
  const { min: r, max: c, tickStep: n } = e;
226
226
  if (!(n > 0)) return { major: [r, c].filter(Number.isFinite), minor: [] };
227
227
  const a = n * 1e-6, o = [];
@@ -229,14 +229,14 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
229
229
  o.push(W(b));
230
230
  const u = [];
231
231
  if (e.minorTicks > 0) {
232
- const b = _(e);
232
+ const b = U(e);
233
233
  for (let d = r; d <= c + a && u.length < Q; d += b) {
234
234
  const k = W(d);
235
235
  o.some((j) => Math.abs(j - k) < a) || u.push(k);
236
236
  }
237
237
  }
238
238
  return { major: o, minor: u };
239
- }, T = (e) => String(W(e * 1e3) / 1e3), Be = (e, r) => {
239
+ }, T = (e) => String(W(e * 1e3) / 1e3), Fe = (e, r) => {
240
240
  const c = [...e].sort((o, u) => o.view - u.view), n = [], a = {};
241
241
  for (const o of c) {
242
242
  let u = 0;
@@ -244,7 +244,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
244
244
  n[u] = o.view, a[o.id] = u;
245
245
  }
246
246
  return a;
247
- }, ee = 9, Fe = 36, D = 14, te = 7, ie = 40, _e = 26, Xe = 22, Ue = 70, qe = 4, Ge = 560, Ke = 2.2, Ye = (e) => {
247
+ }, ee = 9, Be = 36, Z = 14, te = 7, ie = 40, Ue = 26, Xe = 22, _e = 70, qe = 4, Ge = 560, Ke = 2.2, Ye = (e) => {
248
248
  const [r, c] = x.useState(1);
249
249
  return x.useLayoutEffect(() => {
250
250
  const n = e.current;
@@ -267,12 +267,12 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
267
267
  }) => {
268
268
  const u = (t, s) => P(V, t, n, s), b = x.useRef(null), d = Ye(b), k = x.useId(), j = r?.positions ?? {}, [M, l] = x.useState(
269
269
  () => e.items.find((t) => j[t.id] === void 0)?.id ?? e.items[0]?.id
270
- ), [f, p] = x.useState(""), g = x.useRef(null), [, h] = x.useReducer((t) => t + 1, 0), L = !!o && !a, A = Ze(e), X = (t) => {
270
+ ), [f, p] = x.useState(""), g = x.useRef(null), [, h] = x.useReducer((t) => t + 1, 0), L = !!o && !a, D = Ae(e), X = (t) => {
271
271
  const s = b.current?.getBoundingClientRect();
272
272
  if (!s || s.width === 0) return;
273
273
  const m = (t - s.left) / s.width * $;
274
- return Ae(e, m);
275
- }, R = (t, s, m) => {
274
+ return De(e, m);
275
+ }, I = (t, s, m) => {
276
276
  if (!o) return;
277
277
  const v = J(e, s);
278
278
  if (o(t.id, v), p(u(m, { label: t.label, value: T(v) })), m === "placed") {
@@ -284,7 +284,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
284
284
  }, me = (t) => {
285
285
  if (!L || !M) return;
286
286
  const s = e.items.find((v) => v.id === M), m = X(t.clientX);
287
- !s || m === void 0 || R(s, m, j[s.id] === void 0 ? "placed" : "moved");
287
+ !s || m === void 0 || I(s, m, j[s.id] === void 0 ? "placed" : "moved");
288
288
  }, de = (t, s, m) => {
289
289
  !L || t.button !== 0 || (t.stopPropagation(), l(s.id), g.current = { itemId: s.id, startClientX: t.clientX, value: m, moved: !1 }, h());
290
290
  };
@@ -297,19 +297,19 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
297
297
  const t = g.current;
298
298
  if (g.current = null, h(), !t || !t.moved) return;
299
299
  const s = e.items.find((m) => m.id === t.itemId);
300
- s && R(s, t.value, "moved");
300
+ s && I(s, t.value, "moved");
301
301
  });
302
302
  const be = (t, s, m) => {
303
303
  if (!L) return;
304
- const v = t.shiftKey ? e.tickStep : De(e);
304
+ const v = t.shiftKey ? e.tickStep : Ze(e);
305
305
  let w;
306
- t.key === "ArrowLeft" ? w = m - v : t.key === "ArrowRight" ? w = m + v : t.key === "Home" ? w = e.min : t.key === "End" && (w = e.max), w !== void 0 && (t.preventDefault(), R(s, w, "moved"));
307
- }, U = e.items.flatMap((t) => {
306
+ t.key === "ArrowLeft" ? w = m - v : t.key === "ArrowRight" ? w = m + v : t.key === "Home" ? w = e.min : t.key === "End" && (w = e.max), w !== void 0 && (t.preventDefault(), I(s, w, "moved"));
307
+ }, _ = e.items.flatMap((t) => {
308
308
  const s = g.current?.itemId === t.id ? g.current.value : j[t.id];
309
309
  return s === void 0 ? [] : [{ item: t, value: s }];
310
- }), fe = Be(
311
- U.map(({ item: t, value: s }) => ({ id: t.id, view: z(e, s) })),
312
- Ue
310
+ }), fe = Fe(
311
+ _.map(({ item: t, value: s }) => ({ id: t.id, view: H(e, s) })),
312
+ _e
313
313
  );
314
314
  return /* @__PURE__ */ i.jsxs("div", { className: "bitflow-number-line", children: [
315
315
  L && /* @__PURE__ */ i.jsx(
@@ -330,7 +330,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
330
330
  checked: M === t.id,
331
331
  onChange: () => l(t.id),
332
332
  onKeyDown: (m) => {
333
- m.key !== "Enter" || s !== void 0 || (m.preventDefault(), R(t, (e.min + e.max) / 2, "placed"));
333
+ m.key !== "Enter" || s !== void 0 || (m.preventDefault(), I(t, (e.min + e.max) / 2, "placed"));
334
334
  }
335
335
  }
336
336
  ),
@@ -363,19 +363,19 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
363
363
  y2: y
364
364
  }
365
365
  ),
366
- /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-minor", children: A.minor.map((t) => {
367
- const s = z(e, t);
366
+ /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-minor", children: D.minor.map((t) => {
367
+ const s = H(e, t);
368
368
  return /* @__PURE__ */ i.jsx("line", { x1: s, x2: s, y1: y - te, y2: y + te }, `minor-${t}`);
369
369
  }) }),
370
- /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-major", children: A.major.map((t) => {
371
- const s = z(e, t);
372
- return /* @__PURE__ */ i.jsx("line", { x1: s, x2: s, y1: y - D, y2: y + D }, `major-${t}`);
370
+ /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-ticks-major", children: D.major.map((t) => {
371
+ const s = H(e, t);
372
+ return /* @__PURE__ */ i.jsx("line", { x1: s, x2: s, y1: y - Z, y2: y + Z }, `major-${t}`);
373
373
  }) }),
374
- e.labelTicks && /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-tick-labels", children: A.major.map((t) => /* @__PURE__ */ i.jsx(
374
+ e.labelTicks && /* @__PURE__ */ i.jsx("g", { className: "bitflow-number-line-tick-labels", children: D.major.map((t) => /* @__PURE__ */ i.jsx(
375
375
  "text",
376
376
  {
377
- x: z(e, t),
378
- y: y + D + 10 + 20 * d,
377
+ x: H(e, t),
378
+ y: y + Z + 10 + 20 * d,
379
379
  textAnchor: "middle",
380
380
  children: T(t)
381
381
  },
@@ -386,7 +386,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
386
386
  {
387
387
  x: S.left,
388
388
  y: y - ie,
389
- width: F,
389
+ width: B,
390
390
  height: ie * 2,
391
391
  fill: "transparent",
392
392
  className: "bitflow-number-line-catcher",
@@ -397,7 +397,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
397
397
  "g",
398
398
  {
399
399
  className: "bitflow-number-line-answer",
400
- transform: `translate(${z(e, t.value)} ${y}) scale(${d})`,
400
+ transform: `translate(${H(e, t.value)} ${y}) scale(${d})`,
401
401
  children: [
402
402
  /* @__PURE__ */ i.jsx("title", { children: u("correctValue", { value: T(t.value) }) }),
403
403
  /* @__PURE__ */ i.jsx("line", { x1: 0, y1: -18, x2: 0, y2: 18 })
@@ -405,8 +405,8 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
405
405
  },
406
406
  `answer-${t.id}`
407
407
  )),
408
- U.map(({ item: t, value: s }) => {
409
- const m = c?.[t.id], v = z(e, s), w = fe[t.id] ?? 0, C = ["bitflow-number-line-dot"];
408
+ _.map(({ item: t, value: s }) => {
409
+ const m = c?.[t.id], v = H(e, s), w = fe[t.id] ?? 0, C = ["bitflow-number-line-dot"];
410
410
  return M === t.id && C.push("bitflow-number-line-dot-active"), m && C.push(`bitflow-number-line-dot-${m}`), /* @__PURE__ */ i.jsxs(
411
411
  "g",
412
412
  {
@@ -417,7 +417,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
417
417
  "g",
418
418
  {
419
419
  className: "bitflow-number-line-label",
420
- transform: `translate(0 ${-(_e + w * Xe)})`,
420
+ transform: `translate(0 ${-(Ue + w * Xe)})`,
421
421
  children: /* @__PURE__ */ i.jsx("text", { children: t.label })
422
422
  }
423
423
  ),
@@ -434,7 +434,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
434
434
  L && /* @__PURE__ */ i.jsx(
435
435
  "circle",
436
436
  {
437
- r: Fe,
437
+ r: Be,
438
438
  className: "bitflow-number-line-hit",
439
439
  role: "slider",
440
440
  tabIndex: 0,
@@ -443,10 +443,10 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
443
443
  "aria-valuemax": e.max,
444
444
  "aria-valuenow": s,
445
445
  "aria-valuetext": T(s),
446
- onPointerDown: (H) => de(H, t, s),
447
- onKeyDown: (H) => be(H, t, s),
448
- onClick: (H) => {
449
- H.stopPropagation(), l(t.id);
446
+ onPointerDown: (z) => de(z, t, s),
447
+ onKeyDown: (z) => be(z, t, s),
448
+ onClick: (z) => {
449
+ z.stopPropagation(), l(t.id);
450
450
  }
451
451
  }
452
452
  )
@@ -512,7 +512,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
512
512
  }) => {
513
513
  const [n, a] = x.useState(() => String(e));
514
514
  return x.useEffect(() => {
515
- const o = O(n);
515
+ const o = E(n);
516
516
  (!o.ok || Math.abs(o.value - e) > 1e-9) && a(String(e));
517
517
  }, [e]), /* @__PURE__ */ i.jsx(
518
518
  "input",
@@ -524,7 +524,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
524
524
  value: n,
525
525
  onChange: (o) => {
526
526
  a(o.target.value);
527
- const u = O(o.target.value);
527
+ const u = E(o.target.value);
528
528
  u.ok && r(u.value);
529
529
  }
530
530
  }
@@ -537,7 +537,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
537
537
  const [n, a] = x.useState(() => e === void 0 ? "" : String(e));
538
538
  return x.useEffect(() => {
539
539
  if (e === void 0) return;
540
- const o = O(n);
540
+ const o = E(n);
541
541
  (!o.ok || Math.abs(o.value - e) > 1e-9) && a(String(e));
542
542
  }, [e]), /* @__PURE__ */ i.jsx(
543
543
  "input",
@@ -553,7 +553,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
553
553
  r(void 0);
554
554
  return;
555
555
  }
556
- const b = O(u);
556
+ const b = E(u);
557
557
  b.ok && r(b.value);
558
558
  }
559
559
  }
@@ -564,7 +564,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
564
564
  if (!r.includes(n)) return n;
565
565
  }
566
566
  }, et = ({ data: e, locale: r, onChange: c, errors: n }) => {
567
- const a = (l, f) => P(Oe, l, r, f), o = (l) => c({ ...e, ...l }), u = (l, f) => o({
567
+ const a = (l, f) => P(Ee, l, r, f), o = (l) => c({ ...e, ...l }), u = (l, f) => o({
568
568
  items: e.items.map((p) => p.id === l ? { ...p, ...f } : p)
569
569
  }), b = () => o({
570
570
  items: [
@@ -606,12 +606,12 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
606
606
  ),
607
607
  /* @__PURE__ */ i.jsxs("div", { className: "bitflow-row", children: [
608
608
  d(a("minLabel"), e.min, (l) => o({ min: l })),
609
- d(a("maxLabel"), e.max, (l) => o({ max: l }), I(n, "max")),
609
+ d(a("maxLabel"), e.max, (l) => o({ max: l }), R(n, "max")),
610
610
  d(
611
611
  a("tickStepLabel"),
612
612
  e.tickStep,
613
613
  (l) => o({ tickStep: l }),
614
- I(n, "tickStep"),
614
+ R(n, "tickStep"),
615
615
  a("tickStepHint")
616
616
  ),
617
617
  d(
@@ -671,7 +671,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
671
671
  value: l.label,
672
672
  placeholder: a("itemLabelPlaceholder"),
673
673
  "aria-label": a("itemLabelOf", { position: p }),
674
- "aria-invalid": I(n, `items.${f}.label`) ? !0 : void 0,
674
+ "aria-invalid": R(n, `items.${f}.label`) ? !0 : void 0,
675
675
  onChange: (h) => u(l.id, { label: h.target.value })
676
676
  }
677
677
  ),
@@ -681,7 +681,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
681
681
  className: "bitflow-input bitflow-number-line-number",
682
682
  value: l.value,
683
683
  "aria-label": a("itemValueOf", { position: p }),
684
- "aria-invalid": I(n, `items.${f}.value`) ? !0 : void 0,
684
+ "aria-invalid": R(n, `items.${f}.value`) ? !0 : void 0,
685
685
  onChange: (h) => u(l.id, { value: h })
686
686
  }
687
687
  ),
@@ -734,7 +734,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = Z({
734
734
  xe({
735
735
  type: ue,
736
736
  kind: "task",
737
- schema: ze,
737
+ schema: He,
738
738
  evaluate: $e,
739
739
  Task: Je,
740
740
  Form: et,
@@ -761,37 +761,37 @@ xe({
761
761
  })
762
762
  });
763
763
  Se(ue);
764
- ge("bitflow-styles-task-number-line", Ee);
764
+ ge("bitflow-styles-task-number-line", Oe);
765
765
  export {
766
766
  at as AnswerSchema,
767
- ze as DataSchema,
767
+ He as DataSchema,
768
768
  et as Form,
769
769
  Ce as ItemSchema,
770
770
  y as LINE_Y,
771
771
  S as MARGIN,
772
772
  ce as NumberLineView,
773
- F as PLOT_WIDTH,
773
+ B as PLOT_WIDTH,
774
774
  re as SNAP_MODES,
775
775
  Me as SnapModeSchema,
776
776
  ue as TYPE,
777
777
  Je as Task,
778
778
  Ve as VIEW_HEIGHT,
779
779
  $ as VIEW_WIDTH,
780
- Ie as allCorrect,
780
+ Re as allCorrect,
781
781
  $e as evaluate,
782
- Oe as formMessages,
782
+ Ee as formMessages,
783
783
  T as formatValue,
784
- B as itemStates,
785
- De as keyboardStepFor,
786
- He as lineTolerance,
784
+ F as itemStates,
785
+ Ze as keyboardStepFor,
786
+ ze as lineTolerance,
787
787
  V as messages,
788
- _ as minorStepFor,
789
- Re as scoreOf,
788
+ U as minorStepFor,
789
+ Ie as scoreOf,
790
790
  se as snapStepFor,
791
791
  J as snapValue,
792
- Be as stackLabels,
793
- Ze as ticksFor,
792
+ Fe as stackLabels,
793
+ Ae as ticksFor,
794
794
  Pe as toleranceFor,
795
- z as valueToView,
796
- Ae as viewToValue
795
+ H as valueToView,
796
+ De as viewToValue
797
797
  };