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 R, a4 as Z, a as x, j as r, ac as J, ad as _, a2 as L, am as ee, a5 as te, b as P, aa as ae, s as ie } from "./dom-uYx_3K1r.js";
2
- import { S as re, v as ne, A as z, e as q, E as le, L as se, P as oe, D as ce, y as de, R as he } from "./bitLoaders-DIGwTcpd.js";
3
- const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitflow-space-xsmall)}.bitflow-matching-columns{position:relative;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--bitflow-space-large)}.bitflow-matching-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.bitflow-matching-line{stroke:var(--bitflow-color-primary);stroke-width:2;stroke-linecap:round}.bitflow-matching-line-correct{stroke:var(--bitflow-color-correct)}.bitflow-matching-line-wrong{stroke:var(--bitflow-color-wrong)}.bitflow-matching-column{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);padding:0;margin:var(--bitflow-space-xxsmall) 0 0;list-style:none}.bitflow-matching-card{display:flex;gap:var(--bitflow-space-xsmall);align-items:center;width:100%;padding:var(--bitflow-space-xsmall);font:inherit;color:var(--bitflow-color-text);text-align:left;cursor:pointer;background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-matching-card:disabled{cursor:default}.bitflow-matching-image{max-height:4rem}.bitflow-matching-index{flex:none;width:1.5rem;height:1.5rem;font-size:var(--bitflow-font-size-small);font-variant-numeric:tabular-nums;line-height:1.5rem;color:var(--bitflow-color-on-primary);text-align:center;background:var(--bitflow-color-primary);border-radius:50%}.bitflow-matching-card.bitflow-matching-card-held{background:var(--bitflow-color-neutral-100);border-color:var(--bitflow-color-primary);box-shadow:0 0 0 2px var(--bitflow-color-primary)}.bitflow-matching-card.bitflow-matching-card-matched{background:var(--bitflow-color-neutral-100);border-style:dashed}.bitflow-matching-card.bitflow-matching-card-correct{background:color-mix(in srgb,var(--bitflow-color-correct) 12%,var(--bitflow-color-surface));border-style:solid;border-color:var(--bitflow-color-correct)}.bitflow-matching-card.bitflow-matching-card-wrong{background:color-mix(in srgb,var(--bitflow-color-wrong) 12%,var(--bitflow-color-surface));border-style:solid;border-color:var(--bitflow-color-wrong)}.bitflow-matching-status{position:sticky;bottom:0;z-index:1;margin:0;padding:var(--bitflow-space-xsmall) var(--bitflow-space-small);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border-top:var(--bitflow-border-width) solid var(--bitflow-color-primary);box-shadow:var(--bitflow-shadow-medium)}", F = (t) => t.leftId === t.rightId, me = ({
1
+ import { L as C, a4 as Y, a as x, j as r, ac as J, ad as Z, a2 as L, am as ee, a5 as te, b as P, aa as ae, s as ie } from "./dom-uYx_3K1r.js";
2
+ import { $ as re, e as ne, g as z, P as q, B as le, U as se, M as oe, h as ce, C as de, H as he } from "./bitLoaders-CxvZkGrY.js";
3
+ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-matching-columns{position:relative;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--bitflow-space-large)}.bitflow-matching-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.bitflow-matching-line{stroke:var(--bitflow-color-primary);stroke-width:2;stroke-linecap:round}.bitflow-matching-line-correct{stroke:var(--bitflow-color-correct)}.bitflow-matching-line-wrong{stroke:var(--bitflow-color-wrong)}.bitflow-matching-column{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);padding:0;margin:var(--bitflow-space-xxsmall) 0 0;list-style:none}.bitflow-matching-card{display:flex;gap:var(--bitflow-space-xsmall);align-items:center;width:100%;padding:var(--bitflow-space-xsmall);font:inherit;color:var(--bitflow-color-text);text-align:left;cursor:pointer;background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-matching-card:disabled{cursor:default}.bitflow-matching-image{max-height:4rem}.bitflow-matching-index{flex:none;width:1.5rem;height:1.5rem;font-size:var(--bitflow-font-size-small);font-variant-numeric:tabular-nums;line-height:1.5rem;color:var(--bitflow-color-on-primary);text-align:center;background:var(--bitflow-color-primary);border-radius:50%}.bitflow-matching-card.bitflow-matching-card-held{background:var(--bitflow-color-neutral-100);border-color:var(--bitflow-color-primary);box-shadow:0 0 0 2px var(--bitflow-color-primary)}.bitflow-matching-card.bitflow-matching-card-matched{background:var(--bitflow-color-neutral-100);border-style:dashed}.bitflow-matching-card.bitflow-matching-card-correct{background:color-mix(in srgb,var(--bitflow-color-correct) 12%,var(--bitflow-color-surface));border-style:solid;border-color:var(--bitflow-color-correct)}.bitflow-matching-card.bitflow-matching-card-wrong{background:color-mix(in srgb,var(--bitflow-color-wrong) 12%,var(--bitflow-color-surface));border-style:solid;border-color:var(--bitflow-color-wrong)}.bitflow-matching-status{position:sticky;bottom:0;z-index:1;margin:0;padding:var(--bitflow-space-xsmall) var(--bitflow-space-small);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border-top:var(--bitflow-border-width) solid var(--bitflow-color-primary);box-shadow:var(--bitflow-shadow-medium)}", G = (t) => t.leftId === t.rightId, me = ({
4
4
  data: t,
5
5
  answer: l
6
6
  }) => {
7
7
  if (t.evaluation.mode === "skip")
8
8
  return { state: "unknown", allowRetry: !1 };
9
- const h = l?.matches ?? [], s = h.filter(F), n = t.pairs.length;
9
+ const h = l?.matches ?? [], s = h.filter(G), n = t.pairs.length;
10
10
  return {
11
11
  state: n > 0 && s.length === n ? "correct" : "wrong",
12
12
  score: { earned: s.length, possible: n },
@@ -14,10 +14,10 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
14
14
  detail: {
15
15
  // Which pairings held, so each can be marked where it sits rather than
16
16
  // the learner being given a number to reverse-engineer.
17
- matches: h.map((o) => ({ ...o, correct: F(o) }))
17
+ matches: h.map((o) => ({ ...o, correct: G(o) }))
18
18
  }
19
19
  };
20
- }, S = {
20
+ }, R = {
21
21
  en: {
22
22
  name: "Match up",
23
23
  description: "Two columns the learner pairs off.",
@@ -58,7 +58,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
58
58
  matchRight: "richtig",
59
59
  matchWrong: "nicht richtig"
60
60
  }
61
- }, G = R({
61
+ }, U = C({
62
62
  kind: te(["text", "image"]).default("text"),
63
63
  /**
64
64
  * The words on the card, or — for a picture — what the picture shows. One
@@ -66,16 +66,16 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
66
66
  */
67
67
  label: L().default(""),
68
68
  image: ee.optional()
69
- }), fe = R({
69
+ }), fe = C({
70
70
  /** Stable across edits, so an answer keeps pointing at the same pair. */
71
71
  id: L().min(1),
72
- left: G,
73
- right: G
74
- }), ge = R({
72
+ left: U,
73
+ right: U
74
+ }), ge = C({
75
75
  instruction: L().default(""),
76
76
  /** Written as pairs; the learner is given the two columns shuffled. */
77
- pairs: Z(fe).default([]),
78
- evaluation: J.default(_)
77
+ pairs: Y(fe).default([]),
78
+ evaluation: J.default(Z)
79
79
  }).check((t) => {
80
80
  const l = t.value.pairs.map((h) => h.id);
81
81
  new Set(l).size !== l.length && t.issues.push({
@@ -104,13 +104,13 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
104
104
  path: ["pairs"],
105
105
  message: "Add at least two pairs. With one there is nothing to match."
106
106
  });
107
- }), be = R({
107
+ }), be = C({
108
108
  /** The pair the left card came from. */
109
109
  leftId: L().min(1),
110
110
  /** The pair the right card came from — the same one, when it is right. */
111
111
  rightId: L().min(1)
112
- }), ze = R({
113
- matches: Z(be).default([])
112
+ }), ze = C({
113
+ matches: Y(be).default([])
114
114
  }), we = ({
115
115
  pairs: t,
116
116
  leftOrder: l,
@@ -118,50 +118,50 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
118
118
  matches: s,
119
119
  results: n,
120
120
  locale: o,
121
- readonly: y,
121
+ readonly: k,
122
122
  onChange: g
123
123
  }) => {
124
- const u = (e, a) => P(S, e, o, a), [i, d] = x.useState(null), [w, c] = x.useState(""), b = x.useRef(null), T = x.useRef(/* @__PURE__ */ new Map()), [U, C] = x.useState([]), p = (e) => t.find((a) => a.id === e), v = (e) => e.label, H = n !== void 0, M = i ? v(p(i).left) : null, $ = (e) => s.find((a) => a.leftId === e), A = (e) => s.find((a) => a.rightId === e), D = (e) => e && n?.find(
124
+ const u = (e, a) => P(R, e, o, a), [i, d] = x.useState(null), [w, c] = x.useState(""), b = x.useRef(null), T = x.useRef(/* @__PURE__ */ new Map()), [Q, H] = x.useState([]), p = (e) => t.find((a) => a.id === e), v = (e) => e.label, E = n !== void 0, M = i ? v(p(i).left) : null, $ = (e) => s.find((a) => a.leftId === e), A = (e) => s.find((a) => a.rightId === e), K = (e) => e && n?.find(
125
125
  (a) => a.leftId === e.leftId && a.rightId === e.rightId
126
126
  )?.correct;
127
127
  x.useEffect(() => {
128
128
  if (i === null) return;
129
129
  const e = (a) => {
130
- a.key === "Escape" && (d(null), c(P(S, "putDown", o)));
130
+ a.key === "Escape" && (d(null), c(P(R, "putDown", o)));
131
131
  };
132
132
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
133
133
  }, [i, o]);
134
- const E = x.useCallback(() => {
134
+ const S = x.useCallback(() => {
135
135
  const e = b.current;
136
- if (!e) return C([]);
136
+ if (!e) return H([]);
137
137
  const a = e.getBoundingClientRect(), f = [];
138
138
  for (const m of s) {
139
139
  const I = T.current.get(`left:${m.leftId}`), N = T.current.get(`right:${m.rightId}`);
140
140
  if (!I || !N) continue;
141
- const j = I.getBoundingClientRect(), k = N.getBoundingClientRect();
142
- if (k.left < j.right) return C([]);
141
+ const j = I.getBoundingClientRect(), y = N.getBoundingClientRect();
142
+ if (y.left < j.right) return H([]);
143
143
  f.push({
144
144
  id: `${m.leftId}:${m.rightId}`,
145
145
  x1: j.right - a.left,
146
146
  y1: j.top + j.height / 2 - a.top,
147
- x2: k.left - a.left,
148
- y2: k.top + k.height / 2 - a.top,
149
- correct: D(m)
147
+ x2: y.left - a.left,
148
+ y2: y.top + y.height / 2 - a.top,
149
+ correct: K(m)
150
150
  });
151
151
  }
152
- C(f);
152
+ H(f);
153
153
  }, [s, n]);
154
154
  x.useLayoutEffect(() => {
155
- E();
156
- const e = () => E();
155
+ S();
156
+ const e = () => S();
157
157
  window.addEventListener("resize", e);
158
158
  const a = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(e);
159
159
  return a && b.current && a.observe(b.current), () => {
160
160
  window.removeEventListener("resize", e), a?.disconnect();
161
161
  };
162
- }, [E]);
163
- const K = (e) => {
164
- y || (g(
162
+ }, [S]);
163
+ const W = (e) => {
164
+ k || (g(
165
165
  s.filter(
166
166
  (a) => !(a.leftId === e.leftId && a.rightId === e.rightId)
167
167
  )
@@ -172,10 +172,10 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
172
172
  })
173
173
  ));
174
174
  }, V = (e) => {
175
- if (y) return;
175
+ if (k) return;
176
176
  const a = $(e);
177
177
  if (a) {
178
- K(a);
178
+ W(a);
179
179
  return;
180
180
  }
181
181
  const f = i === e ? null : e;
@@ -183,10 +183,10 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
183
183
  f ? u("holding", { card: v(p(e).left) }) : u("putDown")
184
184
  );
185
185
  }, X = (e) => {
186
- if (y) return;
186
+ if (k) return;
187
187
  const a = A(e);
188
188
  if (a && i === null) {
189
- K(a);
189
+ W(a);
190
190
  return;
191
191
  }
192
192
  if (i === null) return;
@@ -199,20 +199,20 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
199
199
  right: v(p(e).right)
200
200
  })
201
201
  );
202
- }, W = (e, a, f) => {
203
- const m = f === "left" ? $(a) : A(a), I = m ? s.indexOf(m) + 1 : void 0, N = m ? f === "left" ? p(m.rightId)?.right : p(m.leftId)?.left : void 0, j = D(m), k = ["bitflow-matching-card"];
204
- return m && k.push("bitflow-matching-card-matched"), i === a && f === "left" && k.push("bitflow-matching-card-held"), H && m && k.push(
202
+ }, D = (e, a, f) => {
203
+ const m = f === "left" ? $(a) : A(a), I = m ? s.indexOf(m) + 1 : void 0, N = m ? f === "left" ? p(m.rightId)?.right : p(m.leftId)?.left : void 0, j = K(m), y = ["bitflow-matching-card"];
204
+ return m && y.push("bitflow-matching-card-matched"), i === a && f === "left" && y.push("bitflow-matching-card-held"), E && m && y.push(
205
205
  j ? "bitflow-matching-card-correct" : "bitflow-matching-card-wrong"
206
206
  ), /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsxs(
207
207
  "button",
208
208
  {
209
209
  type: "button",
210
- ref: (O) => {
211
- const B = `${f}:${a}`;
212
- O ? T.current.set(B, O) : T.current.delete(B);
210
+ ref: (B) => {
211
+ const O = `${f}:${a}`;
212
+ B ? T.current.set(O, B) : T.current.delete(O);
213
213
  },
214
- className: k.join(" "),
215
- disabled: y,
214
+ className: y.join(" "),
215
+ disabled: k,
216
216
  "aria-pressed": f === "left" ? i === a : void 0,
217
217
  "aria-label": N ? u("matchedWith", { card: v(e), other: v(N) }) : u("unmatched", { card: v(e) }),
218
218
  onClick: () => f === "left" ? V(a) : X(a),
@@ -227,7 +227,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
227
227
  draggable: !1
228
228
  }
229
229
  ) : /* @__PURE__ */ r.jsx("span", { children: v(e) }),
230
- H && m && /* @__PURE__ */ r.jsxs("span", { className: "bitflow-visually-hidden", children: [
230
+ E && m && /* @__PURE__ */ r.jsxs("span", { className: "bitflow-visually-hidden", children: [
231
231
  " ",
232
232
  u(j ? "matchRight" : "matchWrong")
233
233
  ] })
@@ -236,9 +236,9 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
236
236
  ) }, a);
237
237
  };
238
238
  return /* @__PURE__ */ r.jsxs("div", { className: "bitflow-matching", children: [
239
- /* @__PURE__ */ r.jsx("p", { className: "bitflow-hint", children: u(y ? "howToReadonly" : "howTo") }),
239
+ /* @__PURE__ */ r.jsx("p", { className: "bitflow-hint", children: u(k ? "howToReadonly" : "howTo") }),
240
240
  /* @__PURE__ */ r.jsxs("div", { className: "bitflow-matching-columns", ref: b, children: [
241
- /* @__PURE__ */ r.jsx("svg", { className: "bitflow-matching-lines", "aria-hidden": "true", children: U.map((e) => /* @__PURE__ */ r.jsx(
241
+ /* @__PURE__ */ r.jsx("svg", { className: "bitflow-matching-lines", "aria-hidden": "true", children: Q.map((e) => /* @__PURE__ */ r.jsx(
242
242
  "line",
243
243
  {
244
244
  className: e.correct === void 0 ? "bitflow-matching-line" : `bitflow-matching-line bitflow-matching-line-${e.correct ? "correct" : "wrong"}`,
@@ -253,14 +253,14 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
253
253
  /* @__PURE__ */ r.jsx("h3", { className: "bitflow-label", children: u("leftHeading") }),
254
254
  /* @__PURE__ */ r.jsx("ul", { className: "bitflow-matching-column", children: l.map((e) => {
255
255
  const a = p(e);
256
- return a ? W(a.left, e, "left") : null;
256
+ return a ? D(a.left, e, "left") : null;
257
257
  }) })
258
258
  ] }),
259
259
  /* @__PURE__ */ r.jsxs("section", { children: [
260
260
  /* @__PURE__ */ r.jsx("h3", { className: "bitflow-label", children: u("rightHeading") }),
261
261
  /* @__PURE__ */ r.jsx("ul", { className: "bitflow-matching-column", children: h.map((e) => {
262
262
  const a = p(e);
263
- return a ? W(a.right, e, "right") : null;
263
+ return a ? D(a.right, e, "right") : null;
264
264
  }) })
265
265
  ] })
266
266
  ] }),
@@ -308,7 +308,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
308
308
  unnamedPair: "Leeres Paar",
309
309
  pairSummary: "{left} → {right}"
310
310
  }
311
- }, Y = (t, l) => {
311
+ }, F = (t, l) => {
312
312
  const h = xe(ve(l)), s = [...t];
313
313
  for (let n = s.length - 1; n > 0; n--) {
314
314
  const o = Math.floor(h() * (n + 1));
@@ -324,21 +324,21 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
324
324
  t |= 0, t = t + 1831565813 | 0;
325
325
  let l = Math.imul(t ^ t >>> 15, 1 | t);
326
326
  return l = l + Math.imul(l ^ l >>> 7, 61 | l) ^ l, ((l ^ l >>> 14) >>> 0) / 4294967296;
327
- }, ye = ({
327
+ }, ke = ({
328
328
  data: t,
329
329
  answer: l,
330
330
  result: h,
331
331
  readonly: s,
332
332
  locale: n,
333
333
  attempt: o,
334
- onAnswerChange: y
334
+ onAnswerChange: k
335
335
  }) => {
336
336
  const g = t.pairs.map((c) => c.id), u = o?.attemptId ?? "bitflow", i = x.useMemo(
337
- () => Y(g, `${u}:left`),
337
+ () => F(g, `${u}:left`),
338
338
  // eslint-disable-next-line react-hooks/exhaustive-deps
339
339
  [g.join(), u]
340
340
  ), d = x.useMemo(
341
- () => Y(g, `${u}:right`),
341
+ () => F(g, `${u}:right`),
342
342
  // eslint-disable-next-line react-hooks/exhaustive-deps
343
343
  [g.join(), u]
344
344
  ), w = (l?.matches ?? []).filter(
@@ -356,11 +356,11 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
356
356
  results: h?.detail?.matches,
357
357
  locale: n,
358
358
  readonly: s,
359
- onChange: (c) => y({ matches: c })
359
+ onChange: (c) => k({ matches: c })
360
360
  }
361
361
  )
362
362
  ] });
363
- }, ke = (t) => {
363
+ }, ye = (t) => {
364
364
  for (let l = t.length + 1; ; l++) {
365
365
  const h = `pair-${l}`;
366
366
  if (!t.includes(h)) return h;
@@ -371,7 +371,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
371
371
  onChange: h,
372
372
  errors: s
373
373
  }) => {
374
- const n = (i, d) => P(pe, i, l, d), o = (i) => h({ ...t, ...i }), y = re(t.pairs.map((i) => i.id)), g = (i, d, w) => o({
374
+ const n = (i, d) => P(pe, i, l, d), o = (i) => h({ ...t, ...i }), k = re(t.pairs.map((i) => i.id)), g = (i, d, w) => o({
375
375
  pairs: t.pairs.map(
376
376
  (c) => c.id === i ? { ...c, [d]: { ...c[d], ...w } } : c
377
377
  )
@@ -438,7 +438,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
438
438
  t.pairs.map((i, d) => /* @__PURE__ */ r.jsx("div", { className: "bitflow-rule", children: /* @__PURE__ */ r.jsxs(
439
439
  q,
440
440
  {
441
- ...y.props(i.id),
441
+ ...k.props(i.id),
442
442
  summary: i.left.label || i.right.label ? n("pairSummary", {
443
443
  left: i.left.label || "…",
444
444
  right: i.right.label || "…"
@@ -469,7 +469,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
469
469
  pairs: [
470
470
  ...t.pairs,
471
471
  {
472
- id: ke(t.pairs.map((i) => i.id)),
472
+ id: ye(t.pairs.map((i) => i.id)),
473
473
  left: { kind: "text", label: "" },
474
474
  right: { kind: "text", label: "" }
475
475
  }
@@ -488,25 +488,25 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
488
488
  }
489
489
  ) })
490
490
  ] });
491
- }, Q = "task-matching";
491
+ }, _ = "task-matching";
492
492
  ae({
493
- type: Q,
493
+ type: _,
494
494
  kind: "task",
495
495
  schema: ge,
496
496
  evaluate: me,
497
- Task: ye,
497
+ Task: ke,
498
498
  Form: je,
499
499
  info: (t) => ({
500
- name: P(S, "name", t),
501
- description: P(S, "description", t)
500
+ name: P(R, "name", t),
501
+ description: P(R, "description", t)
502
502
  }),
503
503
  defaultData: () => ({
504
504
  instruction: "",
505
505
  pairs: [],
506
- evaluation: _()
506
+ evaluation: Z()
507
507
  })
508
508
  });
509
- he(Q);
509
+ he(_);
510
510
  ie("bitflow-styles-task-matching", ue);
511
511
  export {
512
512
  ze as AnswerSchema,
@@ -515,12 +515,12 @@ export {
515
515
  je as Form,
516
516
  be as MatchSchema,
517
517
  fe as PairSchema,
518
- G as SideSchema,
519
- Q as TYPE,
520
- ye as Task,
518
+ U as SideSchema,
519
+ _ as TYPE,
520
+ ke as Task,
521
521
  me as evaluate,
522
522
  pe as formMessages,
523
- F as isRight,
524
- S as messages,
525
- Y as seededShuffle
523
+ G as isRight,
524
+ R as messages,
525
+ F as seededShuffle
526
526
  };
@@ -1,6 +1,6 @@
1
- import { L as j, a9 as g, P as b, a2 as f, ac as z, ad as O, j as t, a5 as D, a as p, b as h, aa as E, s as W } from "./dom-uYx_3K1r.js";
2
- import { v as k, A as m, e as R, M as T, P, t as A, E as F, L as q, R as G } from "./bitLoaders-DIGwTcpd.js";
3
- const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-space-xsmall)}.bitflow-typing-passage{margin:0;padding:var(--bitflow-space-xsmall);font-family:var(--bitflow-font-family-mono);font-size:var(--bitflow-font-size-standard);line-height:var(--bitflow-line-height-standard);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--bitflow-color-neutral-100);border-radius:var(--bitflow-radius-standard)}.bitflow-typing-character-pending{color:var(--bitflow-color-text-muted)}.bitflow-typing-character-right{color:var(--bitflow-color-correct)}.bitflow-typing-character-wrong{color:var(--bitflow-color-wrong);background:var(--bitflow-color-wrong-surface);text-decoration:underline}.bitflow-typing-input{width:100%;padding:var(--bitflow-space-xsmall);font-family:var(--bitflow-font-family-mono);font-size:var(--bitflow-font-size-standard);line-height:var(--bitflow-line-height-standard);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard);resize:vertical}.bitflow-typing-input:focus-visible{outline:none;box-shadow:var(--bitflow-shadow-outline)}.bitflow-typing-input:disabled{-webkit-text-fill-color:var(--bitflow-color-text);opacity:1}.bitflow-typing-touch-notice.bitflow-alert-warning{display:none}@media(pointer:coarse){.bitflow-typing-touch-notice.bitflow-alert-warning{display:flex}}.bitflow-typing-meters{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-small);margin:0;font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text-muted);font-variant-numeric:tabular-nums}", Z = D(["accuracy", "accuracyAndSpeed"]), $ = j({
1
+ import { L as j, a9 as g, P as b, a2 as f, ac as z, ad as O, j as t, a5 as D, a as p, b as h, aa as W, s as E } from "./dom-uYx_3K1r.js";
2
+ import { e as k, g as m, P, F as T, M as R, r as A, B as F, U as q, H as G } from "./bitLoaders-CxvZkGrY.js";
3
+ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-typing-passage{margin:0;padding:var(--bitflow-space-xsmall);font-family:var(--bitflow-font-family-mono);font-size:var(--bitflow-font-size-standard);line-height:var(--bitflow-line-height-standard);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--bitflow-color-neutral-100);border-radius:var(--bitflow-radius-standard)}.bitflow-typing-character-pending{color:var(--bitflow-color-text-muted)}.bitflow-typing-character-right{color:var(--bitflow-color-correct)}.bitflow-typing-character-wrong{color:var(--bitflow-color-wrong);background:var(--bitflow-color-wrong-surface);text-decoration:underline}.bitflow-typing-input{width:100%;padding:var(--bitflow-space-xsmall);font-family:var(--bitflow-font-family-mono);font-size:var(--bitflow-font-size-standard);line-height:var(--bitflow-line-height-standard);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard);resize:vertical}.bitflow-typing-input:focus-visible{outline:none;box-shadow:var(--bitflow-shadow-outline)}.bitflow-typing-input:disabled{-webkit-text-fill-color:var(--bitflow-color-text);opacity:1}.bitflow-typing-touch-notice.bitflow-alert-warning{display:none}@media(pointer:coarse){.bitflow-typing-touch-notice.bitflow-alert-warning{display:flex}}.bitflow-typing-meters{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-small);margin:0;font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text-muted);font-variant-numeric:tabular-nums}", Z = D(["accuracy", "accuracyAndSpeed"]), U = j({
4
4
  instruction: f().default(""),
5
5
  /** The text to type back. */
6
6
  text: f().default(""),
@@ -49,11 +49,11 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
49
49
  for (let o = 0; o < Math.min(e.length, n.length); o++)
50
50
  e[o] === n[o] && i++;
51
51
  return i;
52
- }, Y = (e, n) => {
52
+ }, $ = (e, n) => {
53
53
  const i = Math.max(e.length, n.length);
54
54
  return i === 0 ? 1 : y(e, n) / i;
55
- }, I = (e, n, i) => i <= 0 ? 0 : y(e, n) / 5 / (i / 6e4), M = (e, n) => {
56
- const i = n?.typed ?? "", o = e.timed ? n?.elapsedMs ?? 0 : 0, r = Y(e.text, i), s = e.timed ? I(e.text, i, o) : 0;
55
+ }, B = (e, n, i) => i <= 0 ? 0 : y(e, n) / 5 / (i / 6e4), M = (e, n) => {
56
+ const i = n?.typed ?? "", o = e.timed ? n?.elapsedMs ?? 0 : 0, r = $(e.text, i), s = e.timed ? B(e.text, i, o) : 0;
57
57
  return {
58
58
  correct: y(e.text, i),
59
59
  accuracy: r,
@@ -62,10 +62,10 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
62
62
  accurateEnough: i.length > 0 && r >= e.requiredAccuracy,
63
63
  fastEnough: e.timed && s >= e.targetWpm
64
64
  };
65
- }, U = (e, n) => {
65
+ }, I = (e, n) => {
66
66
  const i = M(e, n), o = e.scoring === "accuracyAndSpeed" ? 2 : 1;
67
67
  return { earned: (i.accurateEnough ? 1 : 0) + (e.scoring === "accuracyAndSpeed" && i.fastEnough ? 1 : 0), possible: o };
68
- }, V = ({
68
+ }, Y = ({
69
69
  data: e,
70
70
  answer: n
71
71
  }) => {
@@ -78,7 +78,7 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
78
78
  allowRetry: !1,
79
79
  detail: { optedOut: !0 }
80
80
  };
81
- const i = M(e, n), o = U(e, n);
81
+ const i = M(e, n), o = I(e, n);
82
82
  return {
83
83
  state: o.earned === o.possible ? "correct" : "wrong",
84
84
  score: o,
@@ -129,7 +129,7 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
129
129
  stoodDown: "Abgemeldet. Diese Aufgabe wird nicht bewertet.",
130
130
  stoodDownNotice: "Du hast dich von dieser Aufgabe abgemeldet, sie wird nicht bewertet."
131
131
  }
132
- }, B = {
132
+ }, V = {
133
133
  en: {
134
134
  instructionLabel: "Instruction",
135
135
  instructionHint: "Shown above the passage. Markdown is allowed.",
@@ -275,7 +275,7 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
275
275
  onChange: i,
276
276
  errors: o
277
277
  }) => {
278
- const r = (a, l) => h(B, a, n, l), s = (a) => i({ ...e, ...a });
278
+ const r = (a, l) => h(V, a, n, l), s = (a) => i({ ...e, ...a });
279
279
  return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-stack", children: [
280
280
  /* @__PURE__ */ t.jsx(
281
281
  k,
@@ -298,7 +298,7 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
298
298
  onChange: (a) => s({ text: a })
299
299
  }
300
300
  ),
301
- /* @__PURE__ */ t.jsxs(R, { summary: r("advanced"), children: [
301
+ /* @__PURE__ */ t.jsxs(P, { summary: r("advanced"), children: [
302
302
  /* @__PURE__ */ t.jsx(
303
303
  T,
304
304
  {
@@ -317,7 +317,7 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
317
317
  }
318
318
  ),
319
319
  /* @__PURE__ */ t.jsx(
320
- P,
320
+ R,
321
321
  {
322
322
  label: r("scoringLabel"),
323
323
  hint: r("scoringHint"),
@@ -388,11 +388,11 @@ const K = ".bitflow-typing{display:flex;flex-direction:column;gap:var(--bitflow-
388
388
  ] })
389
389
  ] });
390
390
  }, N = "task-keyboard-speed";
391
- E({
391
+ W({
392
392
  type: N,
393
393
  kind: "task",
394
- schema: $,
395
- evaluate: V,
394
+ schema: U,
395
+ evaluate: Y,
396
396
  Task: Q,
397
397
  Form: X,
398
398
  info: (e) => ({
@@ -411,21 +411,21 @@ E({
411
411
  })
412
412
  });
413
413
  G(N);
414
- W("bitflow-styles-task-keyboard-speed", K);
414
+ E("bitflow-styles-task-keyboard-speed", K);
415
415
  export {
416
416
  te as AnswerSchema,
417
- $ as DataSchema,
417
+ U as DataSchema,
418
418
  X as Form,
419
419
  Z as ScoringSchema,
420
420
  N as TYPE,
421
421
  Q as Task,
422
422
  J as Typist,
423
- Y as accuracyOf,
423
+ $ as accuracyOf,
424
424
  y as correctCharacters,
425
- V as evaluate,
426
- B as formMessages,
425
+ Y as evaluate,
426
+ V as formMessages,
427
427
  M as measure,
428
428
  w as messages,
429
- U as scoreOf,
430
- I as wordsPerMinute
429
+ I as scoreOf,
430
+ B as wordsPerMinute
431
431
  };