@classytic/labs 0.6.0 → 0.7.0

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 (1867) hide show
  1. package/README.md +37 -21
  2. package/dist/algorithms/index.d.mts +1 -3
  3. package/dist/algorithms/index.mjs +1 -3
  4. package/dist/algorithms/react/index.d.mts +1 -2
  5. package/dist/algorithms/react/index.mjs +1 -2
  6. package/dist/algorithms/sorting.mjs +1 -1
  7. package/dist/authoring/evidence.d.mts +29 -0
  8. package/dist/authoring/index.d.mts +2 -1
  9. package/dist/authoring/index.mjs +2 -1
  10. package/dist/blocks/authoring.d.mts +27 -13
  11. package/dist/blocks/authoring.mjs +72 -19
  12. package/dist/blocks/lab-config.d.mts +3 -1
  13. package/dist/blocks/lab-config.mjs +109 -66
  14. package/dist/build/CircuitScene.mjs +53 -9
  15. package/dist/build/contract.d.mts +1 -1
  16. package/dist/build/editor-ui.mjs +6 -5
  17. package/dist/build/parts/bench.mjs +2 -2
  18. package/dist/build/viewport.mjs +28 -17
  19. package/dist/chem/evidence-scenes.mjs +5 -3
  20. package/dist/chem/solution/field.mjs +27 -33
  21. package/dist/chem/stereochemistry/preset.mjs +1 -1
  22. package/dist/circuits/circuit/preset.mjs +3 -3
  23. package/dist/circuits/op-amp-feedback/preset.mjs +2 -2
  24. package/dist/circuits/semiconductor/shared.mjs +17 -98
  25. package/dist/commerce/accounting/books/entry.d.mts +2 -1
  26. package/dist/commerce/accounting/books/entry.mjs +4 -2
  27. package/dist/commerce/accounting/books/world.d.mts +61 -0
  28. package/dist/commerce/accounting/books/world.mjs +54 -3
  29. package/dist/commerce/accounting/books/worlds/kalam.mjs +2 -3
  30. package/dist/core/index.d.mts +2 -5
  31. package/dist/core/index.mjs +2 -5
  32. package/dist/deep-learning/foundation/parameter-dial.mjs +14 -16
  33. package/dist/diagrams/fraction/FractionDiagram.mjs +1 -1
  34. package/dist/diagrams/geometry/GeometryDiagram.mjs +208 -0
  35. package/dist/diagrams/geometry/core.mjs +112 -0
  36. package/dist/diagrams/geometry/schema.mjs +135 -0
  37. package/dist/diagrams/geometry/spec.d.mts +90 -0
  38. package/dist/diagrams/graph/GraphDiagram.mjs +58 -24
  39. package/dist/diagrams/index.d.mts +2 -1
  40. package/dist/diagrams/index.mjs +2 -0
  41. package/dist/diagrams/magnetism/core.mjs +4 -3
  42. package/dist/diagrams/schema.mjs +3 -1
  43. package/dist/diagrams/spatial/SpatialDiagram.mjs +1 -1
  44. package/dist/discrete/core/index.d.mts +2 -7
  45. package/dist/discrete/core/index.mjs +2 -7
  46. package/dist/discrete/index.d.mts +4 -8
  47. package/dist/discrete/index.mjs +4 -8
  48. package/dist/domains/accounting/accounting-scenes.mjs +0 -2
  49. package/dist/domains/accounting/apportion/model.mjs +7 -3
  50. package/dist/domains/accounting/apportion/runtime.mjs +7 -3
  51. package/dist/domains/accounting/apportion/scene.mjs +2 -1
  52. package/dist/domains/accounting/balance-off/balance-figure.mjs +14 -11
  53. package/dist/domains/accounting/balance-off/model.mjs +14 -17
  54. package/dist/domains/accounting/balance-off/scene.mjs +21 -18
  55. package/dist/domains/accounting/bank-reconciliation/model.mjs +1 -0
  56. package/dist/domains/accounting/bank-reconciliation/runtime.mjs +6 -6
  57. package/dist/domains/accounting/bank-reconciliation/scene.mjs +13 -10
  58. package/dist/domains/accounting/break-even/model.mjs +12 -2
  59. package/dist/domains/accounting/break-even/runtime.mjs +16 -5
  60. package/dist/domains/accounting/break-even/scene.mjs +13 -7
  61. package/dist/domains/accounting/business-day-mission/model.mjs +2 -1
  62. package/dist/domains/accounting/business-day-mission/runtime.mjs +5 -4
  63. package/dist/domains/accounting/business-day-mission/scene.mjs +8 -8
  64. package/dist/domains/accounting/business-lesson/model.mjs +11 -1
  65. package/dist/domains/accounting/business-lesson/runtime.mjs +52 -12
  66. package/dist/domains/accounting/business-lesson/scene.mjs +0 -2
  67. package/dist/domains/accounting/cash-book/activity.mjs +49 -0
  68. package/dist/domains/accounting/cash-book/manifest.mjs +114 -0
  69. package/dist/domains/accounting/cash-book/model.mjs +829 -0
  70. package/dist/domains/accounting/cash-book/runtime.mjs +24 -0
  71. package/dist/domains/accounting/cash-book/scene.mjs +388 -0
  72. package/dist/domains/accounting/cash-budget-runway/model.mjs +2 -1
  73. package/dist/domains/accounting/cash-budget-runway/runtime.mjs +6 -5
  74. package/dist/domains/accounting/cash-budget-runway/scene.mjs +4 -5
  75. package/dist/domains/accounting/claim-split/activity.mjs +3 -2
  76. package/dist/domains/accounting/claim-split/manifest.mjs +3 -2
  77. package/dist/domains/accounting/claim-split/model.mjs +6 -7
  78. package/dist/domains/accounting/claim-split/runtime.mjs +3 -2
  79. package/dist/domains/accounting/claim-split/scene.mjs +3 -2
  80. package/dist/domains/accounting/club-subscriptions/activity.mjs +4 -3
  81. package/dist/domains/accounting/club-subscriptions/model.mjs +2 -1
  82. package/dist/domains/accounting/club-subscriptions/runtime.mjs +9 -21
  83. package/dist/domains/accounting/club-subscriptions/scene.mjs +6 -7
  84. package/dist/domains/accounting/company-statement-builder/activity.mjs +2 -2
  85. package/dist/domains/accounting/company-statement-builder/model.mjs +2 -1
  86. package/dist/domains/accounting/company-statement-builder/runtime.mjs +5 -4
  87. package/dist/domains/accounting/company-statement-builder/scene.mjs +5 -5
  88. package/dist/domains/accounting/compound-interest/model.d.mts +6 -6
  89. package/dist/domains/accounting/compound-interest/model.mjs +11 -1
  90. package/dist/domains/accounting/compound-interest/runtime.mjs +20 -6
  91. package/dist/domains/accounting/compound-interest/scene.mjs +27 -12
  92. package/dist/domains/accounting/control-account-builder/activity.mjs +8 -8
  93. package/dist/domains/accounting/control-account-builder/model.mjs +3 -1
  94. package/dist/domains/accounting/control-account-builder/runtime.mjs +11 -11
  95. package/dist/domains/accounting/control-account-builder/scene.mjs +14 -12
  96. package/dist/domains/accounting/cost-ladder/activity.mjs +74 -0
  97. package/dist/domains/accounting/cost-ladder/manifest.mjs +258 -0
  98. package/dist/domains/accounting/cost-ladder/model.mjs +636 -0
  99. package/dist/domains/accounting/cost-ladder/runtime.mjs +24 -0
  100. package/dist/domains/accounting/cost-ladder/scene.mjs +319 -0
  101. package/dist/domains/accounting/costing-profit-bridge/model.mjs +2 -1
  102. package/dist/domains/accounting/costing-profit-bridge/runtime.mjs +4 -3
  103. package/dist/domains/accounting/costing-profit-bridge/scene.mjs +2 -2
  104. package/dist/domains/accounting/credit-promise-bridge/scene.mjs +21 -7
  105. package/dist/domains/accounting/debit-credit-sprint/core.mjs +4 -4
  106. package/dist/domains/accounting/debit-credit-sprint/model.d.mts +2 -0
  107. package/dist/domains/accounting/debit-credit-sprint/model.mjs +8 -1
  108. package/dist/domains/accounting/debit-credit-sprint/scene.mjs +2 -2
  109. package/dist/domains/accounting/depreciation/model.mjs +8 -1
  110. package/dist/domains/accounting/depreciation/runtime.mjs +40 -16
  111. package/dist/domains/accounting/depreciation/scene.mjs +21 -9
  112. package/dist/domains/accounting/document-desk/activity.mjs +67 -0
  113. package/dist/domains/accounting/document-desk/manifest.mjs +109 -0
  114. package/dist/domains/accounting/document-desk/model.mjs +1448 -0
  115. package/dist/domains/accounting/document-desk/runtime.mjs +24 -0
  116. package/dist/domains/accounting/document-desk/scene.mjs +691 -0
  117. package/dist/domains/accounting/dual-aspect-transfer/scene.mjs +42 -10
  118. package/dist/domains/accounting/entity-spotlight/model.mjs +29 -8
  119. package/dist/domains/accounting/entity-spotlight/scene.mjs +5 -3
  120. package/dist/domains/accounting/entry-desk/core.mjs +3 -5
  121. package/dist/domains/accounting/entry-desk/model.mjs +18 -5
  122. package/dist/domains/accounting/entry-desk/runtime.mjs +2 -2
  123. package/dist/domains/accounting/entry-desk/scene.mjs +4 -4
  124. package/dist/domains/accounting/eoq/model.mjs +11 -1
  125. package/dist/domains/accounting/eoq/runtime.mjs +32 -13
  126. package/dist/domains/accounting/eoq/scene.mjs +9 -6
  127. package/dist/domains/accounting/equation-balance/model.d.mts +6 -2
  128. package/dist/domains/accounting/equation-balance/model.mjs +19 -5
  129. package/dist/domains/accounting/equation-balance/runtime.mjs +42 -10
  130. package/dist/domains/accounting/equation-balance/scene.mjs +34 -7
  131. package/dist/domains/accounting/equation-map/activity.mjs +36 -0
  132. package/dist/domains/accounting/equation-map/manifest.mjs +89 -0
  133. package/dist/domains/accounting/equation-map/model.mjs +260 -0
  134. package/dist/domains/accounting/equation-map/runtime.mjs +23 -0
  135. package/dist/domains/accounting/equation-map/scene.mjs +146 -0
  136. package/dist/domains/accounting/factory-expansion-case/model.mjs +5 -1
  137. package/dist/domains/accounting/factory-expansion-case/scene.mjs +7 -8
  138. package/dist/domains/accounting/household-accounts/activity.mjs +86 -0
  139. package/dist/domains/accounting/household-accounts/manifest.mjs +305 -0
  140. package/dist/domains/accounting/household-accounts/model.mjs +1133 -0
  141. package/dist/domains/accounting/household-accounts/runtime.mjs +24 -0
  142. package/dist/domains/accounting/household-accounts/scene.mjs +659 -0
  143. package/dist/domains/accounting/incomplete-records/model.mjs +13 -3
  144. package/dist/domains/accounting/incomplete-records/runtime.mjs +5 -1
  145. package/dist/domains/accounting/incomplete-records/scene.mjs +10 -6
  146. package/dist/domains/accounting/integrated-budget-mission/runtime.mjs +18 -18
  147. package/dist/domains/accounting/integrated-budget-mission/scene.mjs +8 -9
  148. package/dist/domains/accounting/inventory-costing/model.mjs +5 -1
  149. package/dist/domains/accounting/inventory-costing/runtime.mjs +5 -1
  150. package/dist/domains/accounting/inventory-costing/scene.mjs +44 -15
  151. package/dist/domains/accounting/investment-appraisal/model.mjs +5 -1
  152. package/dist/domains/accounting/investment-appraisal/runtime.mjs +6 -6
  153. package/dist/domains/accounting/investment-appraisal/scene.mjs +2 -2
  154. package/dist/domains/accounting/journal-poster/model.d.mts +0 -1
  155. package/dist/domains/accounting/journal-poster/model.mjs +4 -6
  156. package/dist/domains/accounting/journal-poster/runtime.mjs +3 -2
  157. package/dist/domains/accounting/journal-poster/scene.mjs +6 -7
  158. package/dist/domains/accounting/ledger-detective/ledger-detective/core.mjs +2 -3
  159. package/dist/domains/accounting/ledger-detective/model.mjs +23 -11
  160. package/dist/domains/accounting/limited-company/model.mjs +2 -1
  161. package/dist/domains/accounting/limited-company/runtime.mjs +41 -10
  162. package/dist/domains/accounting/limited-company/scene.mjs +26 -8
  163. package/dist/domains/accounting/limiting-factor-mix/model.mjs +4 -4
  164. package/dist/domains/accounting/limiting-factor-mix/runtime.mjs +11 -11
  165. package/dist/domains/accounting/limiting-factor-mix/scene.mjs +2 -2
  166. package/dist/domains/accounting/loan-claim/activity.mjs +21 -5
  167. package/dist/domains/accounting/loan-claim/model.mjs +16 -5
  168. package/dist/domains/accounting/loan-claim/runtime.mjs +12 -4
  169. package/dist/domains/accounting/loan-claim/scene.mjs +28 -10
  170. package/dist/domains/accounting/management-scenes.mjs +12 -14
  171. package/dist/domains/accounting/manufacturing-flow/model.mjs +27 -2
  172. package/dist/domains/accounting/manufacturing-flow/runtime.mjs +21 -5
  173. package/dist/domains/accounting/manufacturing-flow/scene.mjs +48 -11
  174. package/dist/domains/accounting/operating-budget-chain/runtime.mjs +7 -6
  175. package/dist/domains/accounting/operating-budget-chain/scene.mjs +11 -11
  176. package/dist/domains/accounting/partnership-split/model.mjs +18 -6
  177. package/dist/domains/accounting/partnership-split/runtime.mjs +10 -3
  178. package/dist/domains/accounting/partnership-split/scene.mjs +28 -8
  179. package/dist/domains/accounting/period-adjustment-workbench/runtime.mjs +2 -1
  180. package/dist/domains/accounting/period-adjustment-workbench/scene.mjs +7 -8
  181. package/dist/domains/accounting/period-close-mission/activity.mjs +8 -8
  182. package/dist/domains/accounting/period-close-mission/model.mjs +7 -11
  183. package/dist/domains/accounting/period-close-mission/runtime.mjs +14 -14
  184. package/dist/domains/accounting/period-close-mission/scene.mjs +9 -10
  185. package/dist/domains/accounting/posting-path/model.mjs +5 -2
  186. package/dist/domains/accounting/posting-path/runtime.mjs +5 -1
  187. package/dist/domains/accounting/process-loss/model.mjs +10 -4
  188. package/dist/domains/accounting/process-loss/runtime.mjs +8 -4
  189. package/dist/domains/accounting/process-loss/scene.mjs +18 -11
  190. package/dist/domains/accounting/purpose-timeline/model.mjs +9 -3
  191. package/dist/domains/accounting/purpose-timeline/scene.mjs +5 -5
  192. package/dist/domains/accounting/ratio-lab/core.d.mts +0 -1
  193. package/dist/domains/accounting/ratio-lab/core.mjs +1 -2
  194. package/dist/domains/accounting/ratio-lab/model.d.mts +2 -2
  195. package/dist/domains/accounting/ratio-lab/model.mjs +6 -2
  196. package/dist/domains/accounting/ratio-lab/runtime.mjs +12 -3
  197. package/dist/domains/accounting/ratio-lab/scene.mjs +37 -8
  198. package/dist/domains/accounting/reorder-point/model.d.mts +2 -2
  199. package/dist/domains/accounting/settlement-trail/model.mjs +25 -4
  200. package/dist/domains/accounting/settlement-trail/scene.mjs +46 -13
  201. package/dist/domains/accounting/statement-builder/core.mjs +1 -2
  202. package/dist/domains/accounting/statement-builder/model.mjs +20 -2
  203. package/dist/domains/accounting/statement-builder/runtime.mjs +34 -7
  204. package/dist/domains/accounting/statement-builder/scene.mjs +10 -3
  205. package/dist/domains/accounting/statement-sorter/model.d.mts +3 -1
  206. package/dist/domains/accounting/statement-sorter/model.mjs +23 -6
  207. package/dist/domains/accounting/statement-sorter/runtime.mjs +15 -2
  208. package/dist/domains/accounting/statement-sorter/scene.mjs +43 -12
  209. package/dist/domains/accounting/statement-workshop/activity.mjs +36 -0
  210. package/dist/domains/accounting/statement-workshop/manifest.mjs +330 -0
  211. package/dist/domains/accounting/statement-workshop/model.mjs +824 -0
  212. package/dist/domains/accounting/statement-workshop/runtime.mjs +24 -0
  213. package/dist/domains/accounting/statement-workshop/scene.mjs +249 -0
  214. package/dist/domains/accounting/suspense-reconstruction/model.mjs +9 -3
  215. package/dist/domains/accounting/suspense-reconstruction/runtime.mjs +9 -3
  216. package/dist/domains/accounting/suspense-reconstruction/scene.mjs +44 -12
  217. package/dist/domains/accounting/trial-balance/activity.mjs +26 -0
  218. package/dist/domains/accounting/trial-balance/manifest.mjs +206 -0
  219. package/dist/domains/accounting/trial-balance/model.mjs +569 -0
  220. package/dist/domains/accounting/trial-balance/runtime.mjs +24 -0
  221. package/dist/domains/accounting/trial-balance/scene.mjs +293 -0
  222. package/dist/domains/accounting/value-crossing/model.mjs +20 -8
  223. package/dist/domains/accounting/value-crossing/scene.mjs +25 -10
  224. package/dist/domains/accounting/variance-detective/model.mjs +3 -2
  225. package/dist/domains/accounting/variance-detective/runtime.mjs +4 -3
  226. package/dist/domains/accounting/variance-detective/scene.mjs +6 -6
  227. package/dist/domains/biology/cell-energy/scene.mjs +7 -8
  228. package/dist/domains/biology/cell-system/scene.mjs +5 -14
  229. package/dist/domains/biology/central-dogma/scene.mjs +0 -1
  230. package/dist/domains/biology/enzyme-rate/scene.mjs +1 -2
  231. package/dist/domains/biology/genetic-cross/scene.mjs +0 -1
  232. package/dist/domains/biology/meiosis-explorer/scene.mjs +2 -4
  233. package/dist/domains/biology/membrane-transport/scene.d.mts +0 -1
  234. package/dist/domains/biology/membrane-transport/scene.mjs +1 -2
  235. package/dist/domains/biology/mitosis-explorer/scene.d.mts +0 -1
  236. package/dist/domains/biology/mitosis-explorer/scene.mjs +3 -5
  237. package/dist/domains/biology/photosynthesis-factors/scene.mjs +1 -2
  238. package/dist/domains/biology/sequence/scene.mjs +1 -2
  239. package/dist/domains/biology/sex-linked-cross/scene.mjs +0 -1
  240. package/dist/domains/block-sets/accounting.mjs +56 -42
  241. package/dist/domains/block-sets/chem.mjs +77 -67
  242. package/dist/domains/block-sets/circuits.mjs +7 -5
  243. package/dist/domains/block-sets/geometry.mjs +5 -3
  244. package/dist/domains/block-sets/ict.mjs +28 -22
  245. package/dist/domains/block-sets/math.mjs +91 -87
  246. package/dist/domains/catalog-map.mjs +630 -25
  247. package/dist/domains/chem/acid-base/indicator-bench/scene.mjs +3 -5
  248. package/dist/domains/chem/acid-base/ph-scale/activity.mjs +221 -0
  249. package/dist/domains/chem/acid-base/ph-scale/manifest.mjs +99 -0
  250. package/dist/domains/chem/acid-base/ph-scale/model.mjs +280 -0
  251. package/dist/domains/chem/acid-base/ph-scale/reference.mjs +117 -0
  252. package/dist/domains/chem/acid-base/ph-scale/runtime.mjs +68 -0
  253. package/dist/domains/chem/acid-base/ph-scale/scene.mjs +412 -0
  254. package/dist/domains/chem/acid-base/proton-transfer/scene.mjs +0 -1
  255. package/dist/domains/chem/acid-base/titration/scene.mjs +5 -6
  256. package/dist/domains/chem/acid-base/titration-run/live-scene.mjs +3 -5
  257. package/dist/domains/chem/acid-base/titration-run/scene.mjs +5 -7
  258. package/dist/domains/chem/analysis/apparatus-builder/scene.mjs +16 -17
  259. package/dist/domains/chem/analysis/apparatus-choice/scene.mjs +4 -6
  260. package/dist/domains/chem/analysis/change-detective/scene.mjs +2 -3
  261. package/dist/domains/chem/analysis/chem-qualitative-analysis/scene.mjs +6 -8
  262. package/dist/domains/chem/analysis/chromatography-plate/scene.mjs +1 -2
  263. package/dist/domains/chem/analysis/complex-colour/scene.mjs +4 -3
  264. package/dist/domains/chem/analysis/composition-evidence/scene.mjs +3 -2
  265. package/dist/domains/chem/analysis/conductivity-bench/dropper-bottle.mjs +3 -5
  266. package/dist/domains/chem/analysis/conductivity-bench/material-scene.mjs +26 -54
  267. package/dist/domains/chem/analysis/conductivity-bench/runtime.mjs +2 -2
  268. package/dist/domains/chem/analysis/conductivity-bench/scene.mjs +13 -13
  269. package/dist/domains/chem/analysis/flame-test/scene.mjs +4 -6
  270. package/dist/domains/chem/analysis/paper-chromatogram/scene.mjs +4 -5
  271. package/dist/domains/chem/analysis/practical-observation/scene.mjs +6 -8
  272. package/dist/domains/chem/analysis/precipitation-bench/activity.mjs +1 -1
  273. package/dist/domains/chem/analysis/precipitation-bench/runtime.mjs +2 -2
  274. package/dist/domains/chem/analysis/precipitation-bench/scene.mjs +6 -7
  275. package/dist/domains/chem/analysis/reaction-evidence/scene.mjs +1 -2
  276. package/dist/domains/chem/analysis/species-workshop/scene.mjs +1 -2
  277. package/dist/domains/chem/analysis/specimen-row/scene.mjs +4 -3
  278. package/dist/domains/chem/analysis/structure-detective/scene.mjs +2 -3
  279. package/dist/domains/chem/electrochemistry/battery/scene.mjs +9 -12
  280. package/dist/domains/chem/electrochemistry/corrosion-cell/scene.mjs +4 -7
  281. package/dist/domains/chem/electrochemistry/electrochem/scene.mjs +7 -7
  282. package/dist/domains/chem/electrochemistry/electrolysis-bench/scene.mjs +17 -18
  283. package/dist/domains/chem/electrochemistry/faraday-bench/runtime.mjs +1 -1
  284. package/dist/domains/chem/electrochemistry/faraday-bench/scene.mjs +18 -5
  285. package/dist/domains/chem/electrochemistry/fuel-cell-flow/scene.mjs +12 -11
  286. package/dist/domains/chem/electrochemistry/redox-balancer/scene.mjs +9 -7
  287. package/dist/domains/chem/electrochemistry/redox-transfer/activity.mjs +160 -0
  288. package/dist/domains/chem/electrochemistry/redox-transfer/cases.mjs +172 -0
  289. package/dist/domains/chem/electrochemistry/redox-transfer/manifest.mjs +98 -0
  290. package/dist/domains/chem/electrochemistry/redox-transfer/model.mjs +807 -0
  291. package/dist/domains/chem/electrochemistry/redox-transfer/number-scene.mjs +150 -0
  292. package/dist/domains/chem/electrochemistry/redox-transfer/runtime.mjs +56 -0
  293. package/dist/domains/chem/electrochemistry/redox-transfer/scene.mjs +17 -0
  294. package/dist/domains/chem/electrochemistry/redox-transfer/sort-scene.mjs +214 -0
  295. package/dist/domains/chem/electrochemistry/redox-transfer/transfer-scene.mjs +396 -0
  296. package/dist/domains/chem/energetics/bond-energy-ledger/scene.mjs +8 -6
  297. package/dist/domains/chem/energetics/energy-cycle/hess-scene.mjs +3 -2
  298. package/dist/domains/chem/energetics/energy-cycle/scene.mjs +5 -5
  299. package/dist/domains/chem/energetics/hydrate-cycle/scene.mjs +3 -2
  300. package/dist/domains/chem/energetics/reaction-calorimeter/scene.mjs +3 -5
  301. package/dist/domains/chem/gases-and-states/air-composition/scene.mjs +6 -8
  302. package/dist/domains/chem/gases-and-states/diffusion/model.mjs +12 -10
  303. package/dist/domains/chem/gases-and-states/diffusion/scene.mjs +21 -10
  304. package/dist/domains/chem/gases-and-states/effusion/activity.mjs +66 -0
  305. package/dist/domains/chem/gases-and-states/effusion/manifest.mjs +76 -0
  306. package/dist/domains/chem/gases-and-states/effusion/model.mjs +281 -0
  307. package/dist/domains/chem/gases-and-states/effusion/runtime.mjs +44 -0
  308. package/dist/domains/chem/gases-and-states/effusion/scene.mjs +303 -0
  309. package/dist/domains/chem/gases-and-states/gas-box/scene.mjs +4 -6
  310. package/dist/domains/chem/gases-and-states/gas-diffusion/activity.mjs +86 -0
  311. package/dist/domains/chem/gases-and-states/gas-diffusion/manifest.mjs +91 -0
  312. package/dist/domains/chem/gases-and-states/gas-diffusion/model.mjs +433 -0
  313. package/dist/domains/chem/gases-and-states/gas-diffusion/runtime.mjs +39 -0
  314. package/dist/domains/chem/gases-and-states/gas-diffusion/scene.mjs +454 -0
  315. package/dist/domains/chem/gases-and-states/particle-theatre/scene.mjs +2 -4
  316. package/dist/domains/chem/gases-and-states/particle-theatre/world.mjs +111 -103
  317. package/dist/domains/chem/glide.mjs +5 -4
  318. package/dist/domains/chem/industrial/applied-chemistry/parts.mjs +2 -4
  319. package/dist/domains/chem/industrial/applied-chemistry/scene.mjs +8 -9
  320. package/dist/domains/chem/industrial/contact-process-control/scene.mjs +3 -3
  321. package/dist/domains/chem/industrial/industrial-process/equipment.mjs +1 -3
  322. package/dist/domains/chem/industrial/industrial-process/scene.mjs +7 -8
  323. package/dist/domains/chem/kinetics-equilibrium/catalytic-cycle/scene.mjs +1 -2
  324. package/dist/domains/chem/kinetics-equilibrium/kinetics/scene.mjs +3 -5
  325. package/dist/domains/chem/kinetics-equilibrium/kinetics/world.mjs +181 -167
  326. package/dist/domains/chem/kinetics-equilibrium/le-chatelier/model.mjs +5 -3
  327. package/dist/domains/chem/kinetics-equilibrium/le-chatelier/scene.mjs +9 -14
  328. package/dist/domains/chem/kinetics-equilibrium/le-chatelier/world.mjs +79 -128
  329. package/dist/domains/chem/kinetics-equilibrium/mechanism-walk/scene.mjs +0 -1
  330. package/dist/domains/chem/kinetics-equilibrium/reaction-lab/scene.mjs +4 -6
  331. package/dist/domains/chem/kinetics-equilibrium/reaction-lab/world.mjs +60 -50
  332. package/dist/domains/chem/kinetics-equilibrium/reaction-profile/scene.mjs +2 -3
  333. package/dist/domains/chem/metals/metal-reactivity-bench/scene.mjs +19 -24
  334. package/dist/domains/chem/organic/alkene-geometry/scene.mjs +11 -7
  335. package/dist/domains/chem/organic/arene-evidence/scene.mjs +29 -24
  336. package/dist/domains/chem/organic/ball-stick.mjs +1 -2
  337. package/dist/domains/chem/organic/functional-group-lens/scene.mjs +4 -3
  338. package/dist/domains/chem/organic/isomer-builder/scene.mjs +0 -1
  339. package/dist/domains/chem/organic/organic-formula-studio/pattern-scene.mjs +0 -1
  340. package/dist/domains/chem/organic/organic-formula-studio/scene.mjs +1 -2
  341. package/dist/domains/chem/organic/organic-reaction-map/reaction-bench.mjs +0 -1
  342. package/dist/domains/chem/organic/organic-reaction-map/scene.mjs +1 -2
  343. package/dist/domains/chem/organic/polymer-builder/scene.mjs +8 -7
  344. package/dist/domains/chem/organic/spectrum-reader/scene.mjs +2 -0
  345. package/dist/domains/chem/organic/stereochemistry/scene.mjs +4 -5
  346. package/dist/domains/chem/organic/synthesis-route/scene.mjs +26 -37
  347. package/dist/domains/chem/quantitative/constant-mass/scene.mjs +4 -6
  348. package/dist/domains/chem/quantitative/dilution/scene.mjs +3 -5
  349. package/dist/domains/chem/quantitative/equation-conservation-desk/scene.mjs +0 -1
  350. package/dist/domains/chem/quantitative/formula-forge/scene.mjs +0 -1
  351. package/dist/domains/chem/quantitative/formula-workbench/scene.mjs +0 -1
  352. package/dist/domains/chem/quantitative/gas-collection/scene.mjs +2 -4
  353. package/dist/domains/chem/quantitative/mole-factory/scene.mjs +2 -3
  354. package/dist/domains/chem/quantitative/percent-lens/scene.mjs +4 -3
  355. package/dist/domains/chem/quantitative/percentage-purity-lab/scene.mjs +2 -3
  356. package/dist/domains/chem/quantitative/percentage-yield-lab/scene.mjs +1 -2
  357. package/dist/domains/chem/quantitative/ratio-normalizer/preset.mjs +11 -11
  358. package/dist/domains/chem/quantitative/redox-titration/scene.mjs +3 -5
  359. package/dist/domains/chem/quantitative/relation-origin/scene.mjs +0 -1
  360. package/dist/domains/chem/quantitative/solution-box/scene.mjs +3 -5
  361. package/dist/domains/chem/quantitative/solution-mixer/scene.mjs +2 -4
  362. package/dist/domains/chem/quantitative/standard-solution/scene.mjs +4 -6
  363. package/dist/domains/chem/quantitative/stoichiometry/scene.mjs +4 -4
  364. package/dist/domains/chem/salts-and-solubility/reagent-ladder/scene.mjs +4 -3
  365. package/dist/domains/chem/salts-and-solubility/selective-solvent-bench/scene.mjs +4 -7
  366. package/dist/domains/chem/salts-and-solubility/soap-hard-water/activity.mjs +234 -0
  367. package/dist/domains/chem/salts-and-solubility/soap-hard-water/manifest.mjs +86 -0
  368. package/dist/domains/chem/salts-and-solubility/soap-hard-water/model.mjs +462 -0
  369. package/dist/domains/chem/salts-and-solubility/soap-hard-water/parts.mjs +199 -0
  370. package/dist/domains/chem/salts-and-solubility/soap-hard-water/runtime.mjs +87 -0
  371. package/dist/domains/chem/salts-and-solubility/soap-hard-water/samples.mjs +88 -0
  372. package/dist/domains/chem/salts-and-solubility/soap-hard-water/scene.mjs +1177 -0
  373. package/dist/domains/chem/salts-and-solubility/solubility-kitchen/scene.mjs +3 -5
  374. package/dist/domains/chem/salts-and-solubility/solubility-rules/scene.mjs +0 -1
  375. package/dist/domains/chem/salts-and-solubility/soluble-salt-workshop/scene.mjs +6 -6
  376. package/dist/domains/chem/structure/atomic-orbital/runtime.d.mts +8 -0
  377. package/dist/domains/chem/structure/atomic-orbital/runtime.mjs +2 -2
  378. package/dist/domains/chem/structure/atomic-orbital/scene.d.mts +4 -2
  379. package/dist/domains/chem/structure/atomic-orbital/scene.mjs +7 -22
  380. package/dist/domains/chem/structure/atomic-orbital/world.d.mts +5 -0
  381. package/dist/domains/chem/structure/atomic-orbital/world.mjs +50 -42
  382. package/dist/domains/chem/structure/bohr-atom/activity.mjs +232 -27
  383. package/dist/domains/chem/structure/bohr-atom/ladder.mjs +85 -0
  384. package/dist/domains/chem/structure/bohr-atom/landing.mjs +44 -0
  385. package/dist/domains/chem/structure/bohr-atom/layout.mjs +111 -0
  386. package/dist/domains/chem/structure/bohr-atom/manifest.mjs +51 -2
  387. package/dist/domains/chem/structure/bohr-atom/model.d.mts +182 -8
  388. package/dist/domains/chem/structure/bohr-atom/model.mjs +422 -58
  389. package/dist/domains/chem/structure/bohr-atom/runtime.d.mts +7 -1
  390. package/dist/domains/chem/structure/bohr-atom/runtime.mjs +8 -3
  391. package/dist/domains/chem/structure/bohr-atom/scene.mjs +118 -55
  392. package/dist/domains/chem/structure/bohr-atom/shell-view.mjs +109 -0
  393. package/dist/domains/chem/structure/bohr-atom/subshell-view.mjs +128 -0
  394. package/dist/domains/chem/structure/complex-shape/scene.mjs +3 -2
  395. package/dist/domains/chem/structure/covalent-bond-builder/activity.mjs +74 -28
  396. package/dist/domains/chem/structure/covalent-bond-builder/manifest.mjs +28 -2
  397. package/dist/domains/chem/structure/covalent-bond-builder/model.d.mts +39 -12
  398. package/dist/domains/chem/structure/covalent-bond-builder/model.mjs +188 -98
  399. package/dist/domains/chem/structure/covalent-bond-builder/scene.mjs +181 -37
  400. package/dist/domains/chem/structure/crystal-lattice/runtime.d.mts +8 -0
  401. package/dist/domains/chem/structure/crystal-lattice/runtime.mjs +2 -2
  402. package/dist/domains/chem/structure/crystal-lattice/scene.d.mts +4 -2
  403. package/dist/domains/chem/structure/crystal-lattice/scene.mjs +11 -27
  404. package/dist/domains/chem/structure/crystal-lattice/world.d.mts +5 -0
  405. package/dist/domains/chem/structure/crystal-lattice/world.mjs +86 -78
  406. package/dist/domains/chem/structure/electron-configuration/scene.mjs +3 -6
  407. package/dist/domains/chem/structure/ionic-bond-builder/scene.mjs +2 -5
  408. package/dist/domains/chem/structure/molecular-geometry/runtime.d.mts +8 -0
  409. package/dist/domains/chem/structure/molecular-geometry/runtime.mjs +2 -2
  410. package/dist/domains/chem/structure/molecular-geometry/scene.d.mts +4 -2
  411. package/dist/domains/chem/structure/molecular-geometry/scene.mjs +9 -32
  412. package/dist/domains/chem/structure/molecular-geometry/world.d.mts +5 -0
  413. package/dist/domains/chem/structure/molecular-geometry/world.mjs +55 -47
  414. package/dist/domains/chem/structure/orbital-diagram/runtime.mjs +1 -1
  415. package/dist/domains/chem/structure/orbital-diagram/scene.mjs +3 -6
  416. package/dist/domains/chem/structure/orbital-overlap/runtime.d.mts +8 -0
  417. package/dist/domains/chem/structure/orbital-overlap/runtime.mjs +2 -2
  418. package/dist/domains/chem/structure/orbital-overlap/scene.d.mts +4 -2
  419. package/dist/domains/chem/structure/orbital-overlap/scene.mjs +7 -23
  420. package/dist/domains/chem/structure/orbital-overlap/world.d.mts +5 -0
  421. package/dist/domains/chem/structure/orbital-overlap/world.mjs +58 -50
  422. package/dist/domains/chem/structure/periodic-trends/scene.mjs +2 -3
  423. package/dist/domains/chem/structure/trend-axis/scene.mjs +13 -14
  424. package/dist/domains/circuits/ac-dc/scene.mjs +4 -7
  425. package/dist/domains/circuits/ac-response/scene.mjs +86 -49
  426. package/dist/domains/circuits/bjt-amplifier/scene.mjs +3 -6
  427. package/dist/domains/circuits/bjt-inside/scene.mjs +32 -24
  428. package/dist/domains/circuits/brownout/scene.mjs +9 -11
  429. package/dist/domains/circuits/capacitor-leak/scene.mjs +17 -19
  430. package/dist/domains/circuits/cell-combination/scene.mjs +1 -2
  431. package/dist/domains/circuits/circuit/scene.mjs +1 -2
  432. package/dist/domains/circuits/circuit-builder/scene.mjs +2 -3
  433. package/dist/domains/circuits/circuit-lab/scene.mjs +1 -2
  434. package/dist/domains/circuits/circuit-sandbox/runtime.mjs +13 -5
  435. package/dist/domains/circuits/circuit-scene/scene.mjs +1 -2
  436. package/dist/domains/circuits/cmos-inverter/scene.mjs +14 -14
  437. package/dist/domains/circuits/cmos-nand/scene.mjs +9 -10
  438. package/dist/domains/circuits/cmos-nor/scene.mjs +9 -10
  439. package/dist/domains/circuits/conduction/apparatus.mjs +45 -59
  440. package/dist/domains/circuits/conduction/runtime.mjs +0 -1
  441. package/dist/domains/circuits/diode/scene.mjs +3 -6
  442. package/dist/domains/circuits/energy-cost/scene.mjs +1 -2
  443. package/dist/domains/circuits/hall-effect/runtime.mjs +0 -1
  444. package/dist/domains/circuits/hall-effect/scene.mjs +18 -17
  445. package/dist/domains/circuits/kirchhoff-laws/scene.mjs +1 -2
  446. package/dist/domains/circuits/meter-conversion/scene.mjs +1 -3
  447. package/dist/domains/circuits/mosfet-inside/model.d.mts +1 -1
  448. package/dist/domains/circuits/mosfet-inside/scene.mjs +22 -20
  449. package/dist/domains/circuits/network-reduction/scene.mjs +8 -7
  450. package/dist/domains/circuits/null-balance/scene.mjs +1 -2
  451. package/dist/domains/circuits/op-amp-comparator/scene.mjs +14 -16
  452. package/dist/domains/circuits/pn-junction/scene.mjs +34 -27
  453. package/dist/domains/circuits/potential-divider/scene.mjs +7 -10
  454. package/dist/domains/circuits/potential-hill/activity.mjs +132 -0
  455. package/dist/domains/circuits/potential-hill/manifest.mjs +107 -0
  456. package/dist/domains/circuits/potential-hill/model.mjs +207 -0
  457. package/dist/domains/circuits/potential-hill/runtime.mjs +24 -0
  458. package/dist/domains/circuits/potential-hill/scene.mjs +267 -0
  459. package/dist/domains/circuits/rc-charging/activity.mjs +5 -5
  460. package/dist/domains/circuits/rc-charging/manifest.mjs +5 -10
  461. package/dist/domains/circuits/rc-charging/model.mjs +31 -10
  462. package/dist/domains/circuits/rc-charging/runtime.mjs +4 -7
  463. package/dist/domains/circuits/rc-charging/scene.mjs +273 -210
  464. package/dist/domains/circuits/rnmos-not/scene.mjs +14 -14
  465. package/dist/domains/circuits/silicon-lattice/runtime.mjs +0 -1
  466. package/dist/domains/circuits/silicon-lattice/scene.mjs +0 -1
  467. package/dist/domains/circuits/transistor/scene.mjs +3 -6
  468. package/dist/domains/data/design-records/scene.mjs +1 -2
  469. package/dist/domains/data/dirty-data/scene.mjs +1 -2
  470. package/dist/domains/databases/b-plus-range/model.mjs +1 -1
  471. package/dist/domains/databases/b-plus-range/scene.mjs +2 -3
  472. package/dist/domains/databases/index-detective/model.mjs +1 -1
  473. package/dist/domains/databases/index-detective/scene.mjs +2 -3
  474. package/dist/domains/databases/query-plan/model.mjs +1 -1
  475. package/dist/domains/databases/query-plan/scene.mjs +2 -3
  476. package/dist/domains/databases/range-query/model.mjs +1 -1
  477. package/dist/domains/databases/range-query/scene.mjs +2 -3
  478. package/dist/domains/discrete/arrangements/scene.mjs +3 -6
  479. package/dist/domains/discrete/bayes/scene.mjs +6 -8
  480. package/dist/domains/discrete/binomial/runtime.mjs +2 -1
  481. package/dist/domains/discrete/binomial/scene.mjs +155 -148
  482. package/dist/domains/discrete/combination-studio/scene.mjs +2 -4
  483. package/dist/domains/discrete/counting-slots/scene.mjs +3 -6
  484. package/dist/domains/discrete/counting-tree/scene.mjs +6 -8
  485. package/dist/domains/discrete/expected-value/activity.mjs +2 -1
  486. package/dist/domains/discrete/expected-value/model.mjs +1 -1
  487. package/dist/domains/discrete/expected-value/scene.mjs +8 -9
  488. package/dist/domains/discrete/hypergeometric/activity.mjs +3 -2
  489. package/dist/domains/discrete/hypergeometric/runtime.mjs +4 -3
  490. package/dist/domains/discrete/hypergeometric/scene.mjs +3 -6
  491. package/dist/domains/discrete/induction-ladder/scene.mjs +2 -5
  492. package/dist/domains/discrete/invariant-detective/scene.mjs +3 -5
  493. package/dist/domains/discrete/karnaugh/activity.mjs +4 -4
  494. package/dist/domains/discrete/karnaugh/kmap.mjs +1 -1
  495. package/dist/domains/discrete/karnaugh/manifest.mjs +40 -19
  496. package/dist/domains/discrete/karnaugh/model.mjs +45 -12
  497. package/dist/domains/discrete/karnaugh/runtime.mjs +1 -0
  498. package/dist/domains/discrete/karnaugh/scene.mjs +19 -10
  499. package/dist/domains/discrete/lln/model.mjs +1 -1
  500. package/dist/domains/discrete/lln/scene.mjs +2 -5
  501. package/dist/domains/discrete/modular-clock/scene.mjs +3 -5
  502. package/dist/domains/discrete/monte-carlo/model.mjs +18 -13
  503. package/dist/domains/discrete/monte-carlo/scene.mjs +5 -5
  504. package/dist/domains/discrete/monty-hall/activity.mjs +24 -18
  505. package/dist/domains/discrete/monty-hall/manifest.mjs +2 -1
  506. package/dist/domains/discrete/monty-hall/model.mjs +92 -80
  507. package/dist/domains/discrete/monty-hall/runtime.mjs +1 -1
  508. package/dist/domains/discrete/monty-hall/scene.mjs +80 -66
  509. package/dist/domains/discrete/outcome-builder/activity.mjs +25 -0
  510. package/dist/domains/discrete/outcome-builder/manifest.mjs +15 -2
  511. package/dist/domains/discrete/outcome-builder/model.mjs +57 -20
  512. package/dist/domains/discrete/outcome-builder/runtime.mjs +19 -3
  513. package/dist/domains/discrete/outcome-builder/scene.mjs +1 -2
  514. package/dist/domains/discrete/pascal/scene.mjs +2 -4
  515. package/dist/domains/discrete/pigeonhole-adversary/scene.mjs +3 -6
  516. package/dist/domains/discrete/proof-builder/diagram.mjs +2 -1
  517. package/dist/domains/discrete/proof-builder/scene.mjs +1 -3
  518. package/dist/domains/discrete/recurrence-builder/scene.mjs +6 -8
  519. package/dist/domains/discrete/rule-card/complex-rules.mjs +4 -3
  520. package/dist/domains/discrete/rule-card/diagrams.mjs +2 -1
  521. package/dist/domains/discrete/rule-card/manifest.mjs +1 -2
  522. package/dist/domains/discrete/rule-card/rule-figures.mjs +5 -5
  523. package/dist/domains/discrete/rule-card/rules.d.mts +7 -6
  524. package/dist/domains/discrete/rule-card/rules.mjs +30 -18
  525. package/dist/domains/discrete/rule-card/trig-rules.mjs +6 -5
  526. package/dist/domains/discrete/sample-space/scene.mjs +0 -1
  527. package/dist/domains/discrete/selection/scene.mjs +9 -9
  528. package/dist/domains/discrete/statement-logic/scene.mjs +1 -5
  529. package/dist/domains/discrete/truth-table/activity.mjs +28 -4
  530. package/dist/domains/discrete/truth-table/manifest.mjs +11 -1
  531. package/dist/domains/discrete/truth-table/model.mjs +29 -18
  532. package/dist/domains/discrete/truth-table/scene.mjs +4 -15
  533. package/dist/domains/discrete/venn/model.mjs +10 -5
  534. package/dist/domains/discrete/venn/runtime.mjs +66 -62
  535. package/dist/domains/discrete/venn/scene.mjs +20 -16
  536. package/dist/domains/discrete/venn/sets.d.mts +0 -1
  537. package/dist/domains/discrete/venn/sets.mjs +1 -6
  538. package/dist/domains/distributed-systems/shard-key/shard-key-board.mjs +0 -1
  539. package/dist/domains/domain-map.mjs +38 -0
  540. package/dist/domains/economics/demand-shift-vs-move/scene.mjs +2 -3
  541. package/dist/domains/economics/elasticity-revenue/scene.mjs +2 -3
  542. package/dist/domains/economics/market-equilibrium/scene.mjs +2 -3
  543. package/dist/domains/exam/command-lens/manifest.mjs +4 -3
  544. package/dist/domains/exam/command-lens/scene.mjs +1 -2
  545. package/dist/domains/exam/exam-question/scene.mjs +6 -1
  546. package/dist/domains/exam/practice-set/model.mjs +7 -1
  547. package/dist/domains/exam/practice-set/runtime.mjs +1 -1
  548. package/dist/domains/geography/cycle/scene.mjs +5 -2
  549. package/dist/domains/geometry/geometry-board/builder.mjs +4 -1
  550. package/dist/domains/geometry/geometry-board/manifest.mjs +1 -69
  551. package/dist/domains/geometry/geometry-board/runtime.mjs +2 -2
  552. package/dist/domains/geometry/geometry-figure/manifest.mjs +114 -0
  553. package/dist/domains/geometry/geometry-figure/runtime.mjs +19 -0
  554. package/dist/domains/geometry/intersecting-circles/scene.mjs +1 -2
  555. package/dist/domains/ict/array-vs-list/scene.mjs +1 -1
  556. package/dist/domains/ict/binary-counter/scene.mjs +1 -2
  557. package/dist/domains/ict/binary-display/scene.mjs +0 -2
  558. package/dist/domains/ict/binary-search/scene.mjs +1 -1
  559. package/dist/domains/ict/bound-prover/scene.mjs +4 -4
  560. package/dist/domains/ict/code-trace/activity.mjs +23 -0
  561. package/dist/domains/ict/code-trace/manifest.mjs +81 -0
  562. package/dist/domains/ict/code-trace/model.mjs +199 -0
  563. package/dist/domains/ict/code-trace/runtime.mjs +30 -0
  564. package/dist/domains/ict/code-trace/scene.mjs +321 -0
  565. package/dist/domains/ict/coin-change/scene.mjs +1 -1
  566. package/dist/domains/ict/complexity-growth/scene.mjs +1 -1
  567. package/dist/domains/ict/cost-derivation/scene.mjs +2 -3
  568. package/dist/domains/ict/graph-algorithm/scene.mjs +1 -1
  569. package/dist/domains/ict/grid-path-dp/scene.mjs +1 -1
  570. package/dist/domains/ict/hash-table/scene.mjs +1 -1
  571. package/dist/domains/ict/heap-quest/HeapDualView.mjs +2 -0
  572. package/dist/domains/ict/jk-flip-flop/activity.mjs +1 -1
  573. package/dist/domains/ict/jk-flip-flop/model.mjs +1 -1
  574. package/dist/domains/ict/jk-flip-flop/runtime.mjs +14 -7
  575. package/dist/domains/ict/jk-flip-flop/scene.mjs +3 -10
  576. package/dist/domains/ict/jk-flip-flop/task-view.mjs +58 -0
  577. package/dist/domains/ict/latch-vs-flip-flop/TimingScene.d.mts +0 -1
  578. package/dist/domains/ict/latch-vs-flip-flop/scene.mjs +1 -2
  579. package/dist/domains/ict/logic-builder/LogicEditScene.mjs +0 -5
  580. package/dist/domains/ict/logic-builder/activity.mjs +2 -2
  581. package/dist/domains/ict/logic-builder/manifest.mjs +46 -1
  582. package/dist/domains/ict/logic-builder/model.mjs +126 -36
  583. package/dist/domains/ict/logic-builder/runtime.mjs +1 -1
  584. package/dist/domains/ict/logic-builder/scene.mjs +87 -43
  585. package/dist/domains/ict/logic-gate/scene.mjs +0 -1
  586. package/dist/domains/ict/mini-sheet/activity.mjs +23 -0
  587. package/dist/domains/ict/mini-sheet/manifest.mjs +93 -0
  588. package/dist/domains/ict/mini-sheet/model.mjs +175 -0
  589. package/dist/domains/ict/mini-sheet/runtime.mjs +25 -0
  590. package/dist/domains/ict/mini-sheet/scene.mjs +216 -0
  591. package/dist/domains/ict/recursion-tree/scene.mjs +2 -7
  592. package/dist/domains/ict/sequence-detector/activity.mjs +6 -6
  593. package/dist/domains/ict/sequence-detector/manifest.mjs +11 -3
  594. package/dist/domains/ict/sequence-detector/model.mjs +3 -2
  595. package/dist/domains/ict/sequence-detector/scene.mjs +2 -3
  596. package/dist/domains/ict/shift-register/ShiftScene.mjs +0 -1
  597. package/dist/domains/ict/sorting-quest/Bars.mjs +11 -7
  598. package/dist/domains/ict/sorting-quest/scene.mjs +1 -1
  599. package/dist/domains/ict/sr-latch/scene.mjs +4 -6
  600. package/dist/domains/ict/state-machine-builder/activity.mjs +46 -0
  601. package/dist/domains/ict/state-machine-builder/manifest.mjs +56 -0
  602. package/dist/domains/ict/state-machine-builder/model.mjs +422 -0
  603. package/dist/domains/ict/state-machine-builder/runtime.mjs +24 -0
  604. package/dist/domains/ict/state-machine-builder/scene.mjs +211 -0
  605. package/dist/domains/ict/tree-quest/scene.mjs +1 -1
  606. package/dist/domains/ict/twos-complement/scene.mjs +2 -3
  607. package/dist/domains/ict/wire-a-chip/ChipScene.d.mts +0 -1
  608. package/dist/domains/ict/wire-a-chip/ChipScene.mjs +426 -314
  609. package/dist/domains/language/_shared/construction.mjs +1 -1
  610. package/dist/domains/language/article-lens/model.d.mts +5 -5
  611. package/dist/domains/language/preposition/model.d.mts +5 -5
  612. package/dist/domains/manifests.mjs +730 -692
  613. package/dist/domains/math/_shared/parameter-name.mjs +24 -0
  614. package/dist/domains/math/algebra/area-model/activity.mjs +43 -4
  615. package/dist/domains/math/algebra/area-model/manifest.mjs +26 -2
  616. package/dist/domains/math/algebra/area-model/model.mjs +117 -54
  617. package/dist/domains/math/algebra/area-model/runtime.mjs +3 -3
  618. package/dist/domains/math/algebra/area-model/scene.mjs +28 -1
  619. package/dist/domains/math/algebra/balance-algebra/scene.mjs +0 -1
  620. package/dist/domains/math/algebra/discriminant-radar/manifest.mjs +12 -0
  621. package/dist/domains/math/algebra/discriminant-radar/scene.mjs +5 -6
  622. package/dist/domains/math/algebra/distribute-strip/scene.mjs +0 -1
  623. package/dist/domains/math/algebra/fraction-cancellation/scene.mjs +3 -5
  624. package/dist/domains/math/algebra/inequality-line/scene.mjs +5 -4
  625. package/dist/domains/math/algebra/inequality-solver/scene.mjs +2 -1
  626. package/dist/domains/math/algebra/linear-system/scene.mjs +4 -3
  627. package/dist/domains/math/algebra/log-law-workbench/activity.mjs +185 -188
  628. package/dist/domains/math/algebra/log-law-workbench/manifest.mjs +31 -9
  629. package/dist/domains/math/algebra/log-law-workbench/model.mjs +234 -37
  630. package/dist/domains/math/algebra/log-law-workbench/runtime.mjs +2 -10
  631. package/dist/domains/math/algebra/log-law-workbench/scene.mjs +338 -21
  632. package/dist/domains/math/algebra/mystery-bucket/scene.mjs +101 -28
  633. package/dist/domains/math/algebra/partial-fractions/scene.mjs +1 -2
  634. package/dist/domains/math/algebra/polynomial-solver/activity.mjs +6 -2
  635. package/dist/domains/math/algebra/polynomial-solver/cases-division.mjs +47 -1
  636. package/dist/domains/math/algebra/polynomial-solver/cases-factor.mjs +2 -0
  637. package/dist/domains/math/algebra/polynomial-solver/cases-two-letter.mjs +129 -0
  638. package/dist/domains/math/algebra/polynomial-solver/engine.mjs +1 -0
  639. package/dist/domains/math/algebra/polynomial-solver/games.mjs +6 -5
  640. package/dist/domains/math/algebra/polynomial-solver/manifest.mjs +33 -1
  641. package/dist/domains/math/algebra/polynomial-solver/model.mjs +20 -11
  642. package/dist/domains/math/algebra/polynomial-solver/moves.mjs +1 -1
  643. package/dist/domains/math/algebra/polynomial-solver/plots.mjs +2 -2
  644. package/dist/domains/math/algebra/polynomial-solver/runtime.mjs +1 -1
  645. package/dist/domains/math/algebra/polynomial-solver/scene-calculator.mjs +2 -1
  646. package/dist/domains/math/algebra/polynomial-solver/scene-long-division.mjs +121 -0
  647. package/dist/domains/math/algebra/polynomial-solver/scene-parts.mjs +3 -3
  648. package/dist/domains/math/algebra/polynomial-solver/scene-split.mjs +49 -3
  649. package/dist/domains/math/algebra/polynomial-solver/scene-tableau.mjs +17 -3
  650. package/dist/domains/math/algebra/polynomial-solver/trace-renderers.mjs +7 -2
  651. package/dist/domains/math/algebra/root-fingerprint/scene.mjs +3 -4
  652. package/dist/domains/math/algebra/root-mover/scene.mjs +3 -3
  653. package/dist/domains/math/algebra/slide-rule/scene.mjs +0 -1
  654. package/dist/domains/math/algebra/substitute-value/scene.mjs +2 -1
  655. package/dist/domains/math/algebra/system-solve/scene.mjs +0 -1
  656. package/dist/domains/math/calculus/derivative-explorer/scene.mjs +4 -3
  657. package/dist/domains/math/calculus/differential-equation/runtime.mjs +2 -2
  658. package/dist/domains/math/calculus/differential-equation/scene.mjs +5 -4
  659. package/dist/domains/math/calculus/fundamental-theorem/scene.mjs +5 -4
  660. package/dist/domains/math/calculus/gradient-descent/runtime.mjs +22 -17
  661. package/dist/domains/math/calculus/implicit-parametric-derivative/activity.mjs +9 -4
  662. package/dist/domains/math/calculus/implicit-parametric-derivative/model.mjs +8 -4
  663. package/dist/domains/math/calculus/implicit-parametric-derivative/runtime.mjs +7 -7
  664. package/dist/domains/math/calculus/implicit-parametric-derivative/scene.mjs +8 -7
  665. package/dist/domains/math/calculus/integral-explorer/scene.mjs +3 -4
  666. package/dist/domains/math/calculus/integration-workbench/activity.mjs +12 -11
  667. package/dist/domains/math/calculus/integration-workbench/manifest.mjs +15 -0
  668. package/dist/domains/math/calculus/integration-workbench/model.mjs +49 -14
  669. package/dist/domains/math/calculus/integration-workbench/runtime.mjs +3 -3
  670. package/dist/domains/math/calculus/integration-workbench/scene.mjs +20 -18
  671. package/dist/domains/math/calculus/limit-explorer/scene.mjs +5 -4
  672. package/dist/domains/math/calculus/newton-method/scene.mjs +4 -4
  673. package/dist/domains/math/calculus/phase-portrait/scene.mjs +5 -5
  674. package/dist/domains/math/calculus/solids-of-revolution/flat-scene.mjs +7 -7
  675. package/dist/domains/math/calculus/solids-of-revolution/runtime.d.mts +8 -0
  676. package/dist/domains/math/calculus/solids-of-revolution/runtime.mjs +2 -2
  677. package/dist/domains/math/calculus/solids-of-revolution/scene.d.mts +5 -8
  678. package/dist/domains/math/calculus/solids-of-revolution/scene.mjs +15 -30
  679. package/dist/domains/math/calculus/stationary-point-classifier/activity.mjs +2 -2
  680. package/dist/domains/math/calculus/stationary-point-classifier/runtime.mjs +2 -2
  681. package/dist/domains/math/calculus/stationary-point-classifier/scene.mjs +4 -3
  682. package/dist/domains/math/calculus/tangent-normal/scene.mjs +2 -4
  683. package/dist/domains/math/calculus/taylor-series/runtime.mjs +2 -2
  684. package/dist/domains/math/calculus/taylor-series/scene.mjs +2 -4
  685. package/dist/domains/math/coordinate-geometry/angle-between-lines/scene.mjs +0 -1
  686. package/dist/domains/math/coordinate-geometry/chord-bisection/scene.mjs +1 -1
  687. package/dist/domains/math/coordinate-geometry/chord-given-midpoint/scene.mjs +1 -1
  688. package/dist/domains/math/coordinate-geometry/chord-of-contact/scene.mjs +1 -1
  689. package/dist/domains/math/coordinate-geometry/circle-diameter-endpoints/activity.mjs +3 -4
  690. package/dist/domains/math/coordinate-geometry/circle-diameter-endpoints/manifest.mjs +2 -2
  691. package/dist/domains/math/coordinate-geometry/circle-diameter-endpoints/runtime.mjs +10 -17
  692. package/dist/domains/math/coordinate-geometry/circle-diameter-endpoints/scene.mjs +1 -1
  693. package/dist/domains/math/coordinate-geometry/circle-geometry/scene.mjs +3 -2
  694. package/dist/domains/math/coordinate-geometry/circle-intersection-angle/scene.mjs +1 -1
  695. package/dist/domains/math/coordinate-geometry/circle-line-tangency/scene.mjs +1 -1
  696. package/dist/domains/math/coordinate-geometry/circle-through-points/scene.mjs +1 -1
  697. package/dist/domains/math/coordinate-geometry/common-tangents-count/scene.mjs +1 -1
  698. package/dist/domains/math/coordinate-geometry/conic/scene.mjs +0 -1
  699. package/dist/domains/math/coordinate-geometry/coord-point/scene.mjs +5 -4
  700. package/dist/domains/math/coordinate-geometry/line-concurrency/scene.mjs +1 -1
  701. package/dist/domains/math/coordinate-geometry/line-family/scene.mjs +1 -1
  702. package/dist/domains/math/coordinate-geometry/point-line-distance/scene.mjs +83 -33
  703. package/dist/domains/math/coordinate-geometry/point-reflection/activity.mjs +3 -3
  704. package/dist/domains/math/coordinate-geometry/point-reflection/runtime.mjs +1 -1
  705. package/dist/domains/math/coordinate-geometry/point-reflection/scene.mjs +160 -46
  706. package/dist/domains/math/coordinate-geometry/polar-cartesian/model.mjs +12 -8
  707. package/dist/domains/math/coordinate-geometry/polar-cartesian/runtime.mjs +3 -3
  708. package/dist/domains/math/coordinate-geometry/polar-cartesian/scene.mjs +12 -12
  709. package/dist/domains/math/coordinate-geometry/radical-axis/scene.mjs +1 -1
  710. package/dist/domains/math/coordinate-geometry/section-formula/scene.mjs +1 -1
  711. package/dist/domains/math/coordinate-geometry/straight-line/scene.mjs +10 -7
  712. package/dist/domains/math/coordinate-geometry/tangent-length-power-of-point/scene.mjs +1 -1
  713. package/dist/domains/math/coordinate-geometry/triangle-area/scene.mjs +21 -7
  714. package/dist/domains/math/functions/composite-functions/composite/scenes.mjs +2 -2
  715. package/dist/domains/math/functions/composite-functions/scene.mjs +5 -4
  716. package/dist/domains/math/functions/domain-range/authoring.mjs +66 -9
  717. package/dist/domains/math/functions/domain-range/manifest.mjs +25 -0
  718. package/dist/domains/math/functions/domain-range/model.mjs +49 -12
  719. package/dist/domains/math/functions/domain-range/runtime.mjs +2 -2
  720. package/dist/domains/math/functions/domain-range/scene.mjs +50 -4
  721. package/dist/domains/math/functions/family-tree/scenes.mjs +4 -4
  722. package/dist/domains/math/functions/function-machine/conveyor-figure.mjs +13 -5
  723. package/dist/domains/math/functions/graph/authoring.mjs +16 -0
  724. package/dist/domains/math/functions/graph/manifest.mjs +32 -0
  725. package/dist/domains/math/functions/graph/model.mjs +98 -12
  726. package/dist/domains/math/functions/graph/runtime.mjs +1 -1
  727. package/dist/domains/math/functions/graph/scene.mjs +104 -35
  728. package/dist/domains/math/functions/graph-transform/scene.mjs +4 -4
  729. package/dist/domains/math/functions/injective-classifier/scene.mjs +1 -1
  730. package/dist/domains/math/functions/inverse-functions/scene.mjs +1 -1
  731. package/dist/domains/math/functions/linearisation/scene.mjs +1 -1
  732. package/dist/domains/math/functions/modulus-function/scene.mjs +1 -1
  733. package/dist/domains/math/functions/modulus-inequality/activity.mjs +33 -16
  734. package/dist/domains/math/functions/modulus-inequality/endpoint-label-layout.mjs +38 -0
  735. package/dist/domains/math/functions/modulus-inequality/manifest.mjs +45 -1
  736. package/dist/domains/math/functions/modulus-inequality/model.mjs +24 -18
  737. package/dist/domains/math/functions/modulus-inequality/runtime.mjs +3 -2
  738. package/dist/domains/math/functions/modulus-inequality/scene.mjs +194 -139
  739. package/dist/domains/math/functions/vertex-parabola/scene.mjs +1 -1
  740. package/dist/domains/math/geometry/angle-chase/model.mjs +1 -1
  741. package/dist/domains/math/geometry/angle-chase/runtime.mjs +2 -3
  742. package/dist/domains/math/geometry/angle-chase/scene.mjs +0 -1
  743. package/dist/domains/math/geometry/area-rearrange/activity.mjs +2 -2
  744. package/dist/domains/math/geometry/area-rearrange/runtime.mjs +1 -1
  745. package/dist/domains/math/geometry/area-rearrange/scene.mjs +2 -2
  746. package/dist/domains/math/geometry/broken-tree/activity.mjs +2 -2
  747. package/dist/domains/math/geometry/broken-tree/model.mjs +1 -1
  748. package/dist/domains/math/geometry/broken-tree/scene.mjs +14 -12
  749. package/dist/domains/math/geometry/clock-hand-angle/scene.mjs +0 -1
  750. package/dist/domains/math/geometry/cone-frustum/scene.mjs +22 -10
  751. package/dist/domains/math/geometry/geometry-foundations/scene.mjs +44 -16
  752. package/dist/domains/math/geometry/geometry-transform/scene.mjs +1 -1
  753. package/dist/domains/math/geometry/measurement/activity.mjs +22 -1
  754. package/dist/domains/math/geometry/measurement/circle-grid-scene.mjs +145 -0
  755. package/dist/domains/math/geometry/measurement/manifest.mjs +9 -1
  756. package/dist/domains/math/geometry/measurement/model.mjs +135 -8
  757. package/dist/domains/math/geometry/measurement/runtime.mjs +19 -8
  758. package/dist/domains/math/geometry/measurement/scene.mjs +258 -228
  759. package/dist/domains/math/geometry/pythagoras-dissection/runtime.mjs +10 -7
  760. package/dist/domains/math/geometry/pythagoras-dissection/scene.mjs +237 -213
  761. package/dist/domains/math/geometry/solid-net/model.mjs +1 -1
  762. package/dist/domains/math/geometry/solid-net/runtime.mjs +2 -2
  763. package/dist/domains/math/geometry/solid-net/scene.mjs +18 -14
  764. package/dist/domains/math/geometry/solid-slice/scene.mjs +76 -34
  765. package/dist/domains/math/geometry/tank-design/activity.mjs +0 -1
  766. package/dist/domains/math/geometry/tank-design/scene.mjs +5 -6
  767. package/dist/domains/math/number/alligation-mix/scene.mjs +0 -1
  768. package/dist/domains/math/number/bounds-window/activity.mjs +2 -2
  769. package/dist/domains/math/number/bounds-window/manifest.mjs +2 -2
  770. package/dist/domains/math/number/bounds-window/runtime.mjs +1 -1
  771. package/dist/domains/math/number/bounds-window/scene.mjs +53 -44
  772. package/dist/domains/math/number/division-workbench/model.mjs +1 -1
  773. package/dist/domains/math/number/division-workbench/runtime.mjs +6 -1
  774. package/dist/domains/math/number/division-workbench/visuals.mjs +209 -195
  775. package/dist/domains/math/number/fraction-bar/activity.mjs +8 -2
  776. package/dist/domains/math/number/fraction-bar/manifest.mjs +29 -2
  777. package/dist/domains/math/number/fraction-bar/model.mjs +147 -26
  778. package/dist/domains/math/number/fraction-bar/runtime.mjs +5 -3
  779. package/dist/domains/math/number/fraction-bar/scene.mjs +167 -4
  780. package/dist/domains/math/number/fraction-division/activity.mjs +15 -0
  781. package/dist/domains/math/number/fraction-division/manifest.mjs +73 -0
  782. package/dist/domains/math/number/fraction-division/model.mjs +86 -0
  783. package/dist/domains/math/number/fraction-division/runtime.mjs +24 -0
  784. package/dist/domains/math/number/fraction-division/scene.mjs +162 -0
  785. package/dist/domains/math/number/fraction-product/activity.mjs +15 -0
  786. package/dist/domains/math/number/fraction-product/manifest.mjs +79 -0
  787. package/dist/domains/math/number/fraction-product/model.mjs +85 -0
  788. package/dist/domains/math/number/fraction-product/runtime.mjs +23 -0
  789. package/dist/domains/math/number/fraction-product/scene.mjs +99 -0
  790. package/dist/domains/math/number/number-line/scene.mjs +4 -3
  791. package/dist/domains/math/number/number-structure/scene.mjs +282 -172
  792. package/dist/domains/math/number/percent-bar/scene.mjs +59 -44
  793. package/dist/domains/math/number/price-chain/scene.mjs +4 -3
  794. package/dist/domains/math/number/rate-machine/runtime.mjs +1 -1
  795. package/dist/domains/math/number/rate-machine/scene.mjs +10 -11
  796. package/dist/domains/math/number/ratio-share/scene.mjs +4 -3
  797. package/dist/domains/math/number/relative-speed-track/scene.mjs +2 -1
  798. package/dist/domains/math/number/square-builder/scene.mjs +2 -4
  799. package/dist/domains/math/reasoning/derivation/authoring.mjs +198 -35
  800. package/dist/domains/math/reasoning/derivation/derivation.d.mts +13 -11
  801. package/dist/domains/math/reasoning/derivation/derivation.mjs +382 -81
  802. package/dist/domains/math/reasoning/derivation/manifest.mjs +22 -10
  803. package/dist/domains/math/reasoning/derivation/runtime.mjs +2 -2
  804. package/dist/domains/math/reasoning/derivation/step-tex.mjs +78 -0
  805. package/dist/domains/math/reasoning/derivation/steps.d.mts +88 -0
  806. package/dist/domains/math/reasoning/derivation/steps.mjs +162 -0
  807. package/dist/domains/math/reasoning/interactive-problem/runtime.mjs +12 -1
  808. package/dist/domains/math/reasoning/story-scene/preload.mjs +18 -0
  809. package/dist/domains/math/schemas.mjs +29 -12
  810. package/dist/domains/math/sequences/growing-pattern/scene.mjs +24 -19
  811. package/dist/domains/math/sequences/iteration/model.mjs +5 -4
  812. package/dist/domains/math/sequences/iteration/scene.mjs +4 -3
  813. package/dist/domains/math/shared.mjs +1 -7
  814. package/dist/domains/math/trigonometry/_shared/cut-scene.mjs +1 -1
  815. package/dist/domains/math/trigonometry/_shared/wheel-scene.mjs +60 -22
  816. package/dist/domains/math/trigonometry/associated-angle-wheel/scene.mjs +1 -1
  817. package/dist/domains/math/trigonometry/bearings/bearings-scene.mjs +198 -13
  818. package/dist/domains/math/trigonometry/bearings/scene.mjs +3 -2
  819. package/dist/domains/math/trigonometry/circular-measure/scene.mjs +7 -12
  820. package/dist/domains/math/trigonometry/compound-angle-proof/scene.mjs +9 -8
  821. package/dist/domains/math/trigonometry/harmonic-form/scene.mjs +2 -3
  822. package/dist/domains/math/trigonometry/multiple-angle-wheel/scene.mjs +1 -1
  823. package/dist/domains/math/trigonometry/oblique-triangle/oblique-scene.mjs +70 -89
  824. package/dist/domains/math/trigonometry/oblique-triangle/scene.mjs +1 -2
  825. package/dist/domains/math/trigonometry/radian-wrap/runtime.mjs +1 -1
  826. package/dist/domains/math/trigonometry/radian-wrap/scene.mjs +8 -12
  827. package/dist/domains/math/trigonometry/sum-to-product-waves/scene.mjs +2 -3
  828. package/dist/domains/math/trigonometry/tangent-rule-triangle/scene.mjs +2 -3
  829. package/dist/domains/math/trigonometry/triangle-trig/runtime.mjs +1 -20
  830. package/dist/domains/math/trigonometry/triangle-trig/scene.mjs +170 -13
  831. package/dist/domains/math/trigonometry/trig-equation-solver/equation-scene.mjs +0 -1
  832. package/dist/domains/math/trigonometry/trig-equation-solver/scene.mjs +1 -2
  833. package/dist/domains/math/trigonometry/trig-explorer/model.mjs +1 -1
  834. package/dist/domains/math/trigonometry/trig-explorer/scene.mjs +7 -13
  835. package/dist/domains/math/trigonometry/trig-general-solution/scene.mjs +3 -3
  836. package/dist/domains/math/trigonometry/trig-signs/scene.mjs +7 -4
  837. package/dist/domains/math/vectors-matrices/complex-plane/runtime.mjs +2 -2
  838. package/dist/domains/math/vectors-matrices/complex-plane/scene.mjs +17 -13
  839. package/dist/domains/math/vectors-matrices/linear-map/runtime.mjs +1 -1
  840. package/dist/domains/math/vectors-matrices/linear-map/scene.mjs +3 -3
  841. package/dist/domains/math/vectors-matrices/lines-in-space/model.d.mts +1 -1
  842. package/dist/domains/math/vectors-matrices/lines-in-space/model.mjs +1 -1
  843. package/dist/domains/math/vectors-matrices/lines-in-space/runtime.mjs +7 -4
  844. package/dist/domains/math/vectors-matrices/lines-in-space/scene.mjs +21 -25
  845. package/dist/domains/math/vectors-matrices/vector-geometry-two-d/model.mjs +4 -4
  846. package/dist/domains/math/vectors-matrices/vector-geometry-two-d/runtime.mjs +2 -2
  847. package/dist/domains/math/vectors-matrices/vector-geometry-two-d/scene.mjs +124 -79
  848. package/dist/domains/ml/activation-gates/manifest.mjs +2 -2
  849. package/dist/domains/ml/activation-gates/model.d.mts +2 -1
  850. package/dist/domains/ml/activation-gates/model.mjs +15 -6
  851. package/dist/domains/ml/activation-gates/runtime.mjs +4 -4
  852. package/dist/domains/ml/activation-gates/scene.d.mts +18 -0
  853. package/dist/domains/ml/activation-gates/scene.mjs +159 -17
  854. package/dist/domains/ml/affine-neuron/scene.d.mts +1 -1
  855. package/dist/domains/ml/affine-neuron/scene.mjs +2 -3
  856. package/dist/domains/ml/anomaly-detector/model.d.mts +4 -4
  857. package/dist/domains/ml/anomaly-detector/scene.mjs +1 -2
  858. package/dist/domains/ml/attention-routing/scene.mjs +1 -2
  859. package/dist/domains/ml/autoencoder/scene.mjs +0 -1
  860. package/dist/domains/ml/backprop-tracer/backprop-graph-diagram.mjs +0 -1
  861. package/dist/domains/ml/causal-mask/scene.mjs +1 -2
  862. package/dist/domains/ml/char-model/scene.mjs +4 -6
  863. package/dist/domains/ml/classifier-threshold/model.d.mts +4 -4
  864. package/dist/domains/ml/classifier-threshold/scene.mjs +6 -5
  865. package/dist/domains/ml/context-window/context-window-diagram.mjs +0 -1
  866. package/dist/domains/ml/decision-boundary/scene.mjs +2 -2
  867. package/dist/domains/ml/denoising/denoising-diagram.mjs +0 -1
  868. package/dist/domains/ml/denoising/runtime.mjs +2 -2
  869. package/dist/domains/ml/embedding-neighborhood/scene.mjs +1 -2
  870. package/dist/domains/ml/embedding-space/scene.mjs +4 -4
  871. package/dist/domains/ml/encoder-decoder/encoder-decoder-diagram.mjs +4 -7
  872. package/dist/domains/ml/feature-map/feature-map-diagram.mjs +0 -1
  873. package/dist/domains/ml/feature-map/feature-map.mjs +2 -2
  874. package/dist/domains/ml/feature-map/scene.mjs +2 -3
  875. package/dist/domains/ml/feed-forward-network/feed-forward-workshop-diagram.mjs +0 -1
  876. package/dist/domains/ml/feed-forward-network/model.d.mts +6 -6
  877. package/dist/domains/ml/feed-forward-network/scene.mjs +2 -2
  878. package/dist/domains/ml/fit-evidence/linear-fit-diagram.mjs +0 -1
  879. package/dist/domains/ml/fit-evidence/scene.mjs +3 -4
  880. package/dist/domains/ml/gradient-step/gradient-step-diagram.mjs +0 -1
  881. package/dist/domains/ml/gradient-step/scene.mjs +2 -2
  882. package/dist/domains/ml/kmeans/scene.mjs +11 -3
  883. package/dist/domains/ml/knn/scene.mjs +2 -2
  884. package/dist/domains/ml/latent-space/latent-space-diagram.mjs +0 -1
  885. package/dist/domains/ml/latent-space/scene.mjs +2 -2
  886. package/dist/domains/ml/layer-normalization/layer-normalization-diagram.mjs +0 -1
  887. package/dist/domains/ml/layer-normalization/model.d.mts +4 -4
  888. package/dist/domains/ml/layer-normalization/scene.mjs +2 -2
  889. package/dist/domains/ml/learning-loop/learning-loop-diagram.mjs +0 -1
  890. package/dist/domains/ml/learning-loop/scene.mjs +2 -2
  891. package/dist/domains/ml/logistic-fit/scene.mjs +6 -5
  892. package/dist/domains/ml/loss-error/loss-diagram.mjs +3 -3
  893. package/dist/domains/ml/loss-error/scene.mjs +2 -2
  894. package/dist/domains/ml/matrix-vector/matrix-vector-diagram.mjs +0 -1
  895. package/dist/domains/ml/matrix-vector/scene.mjs +2 -2
  896. package/dist/domains/ml/memory-relay/model.d.mts +4 -4
  897. package/dist/domains/ml/memory-relay/scene.mjs +5 -4
  898. package/dist/domains/ml/model-complexity/scene.mjs +12 -4
  899. package/dist/domains/ml/multi-head-attention/multi-head-attention-diagram.mjs +0 -1
  900. package/dist/domains/ml/multi-head-attention/scene.mjs +4 -4
  901. package/dist/domains/ml/multimodal-alignment/scene.mjs +4 -4
  902. package/dist/domains/ml/next-token/scene.mjs +4 -5
  903. package/dist/domains/ml/overfit-gap/overfit-gap-diagram.mjs +2 -2
  904. package/dist/domains/ml/overfit-gap/scene.mjs +3 -4
  905. package/dist/domains/ml/pixel-filter/convolution-diagram.mjs +0 -1
  906. package/dist/domains/ml/pixel-filter/pixel-window-diagram.mjs +0 -1
  907. package/dist/domains/ml/pixel-filter/scene.mjs +2 -2
  908. package/dist/domains/ml/position-signals/scene.mjs +1 -2
  909. package/dist/domains/ml/query-key-value/model.d.mts +2 -2
  910. package/dist/domains/ml/query-key-value/query-key-value-diagram.mjs +0 -1
  911. package/dist/domains/ml/query-key-value/scene.mjs +3 -4
  912. package/dist/domains/ml/regression/activity.mjs +12 -8
  913. package/dist/domains/ml/regression/manifest.mjs +34 -1
  914. package/dist/domains/ml/regression/model.d.mts +8 -0
  915. package/dist/domains/ml/regression/model.mjs +12 -10
  916. package/dist/domains/ml/regression/runtime.mjs +12 -9
  917. package/dist/domains/ml/regression/scene.mjs +74 -17
  918. package/dist/domains/ml/residual-stream/residual-stream-diagram.d.mts +0 -1
  919. package/dist/domains/ml/residual-stream/residual-stream-diagram.mjs +0 -1
  920. package/dist/domains/ml/residual-stream/scene.mjs +4 -4
  921. package/dist/domains/ml/reward-groups/model.mjs +1 -1
  922. package/dist/domains/ml/reward-groups/scene.mjs +3 -4
  923. package/dist/domains/ml/scaled-dot-product-attention/scene.mjs +1 -2
  924. package/dist/domains/ml/tiny-network/model.mjs +1 -1
  925. package/dist/domains/ml/tiny-network/scene.mjs +5 -6
  926. package/dist/domains/ml/token-generation/model.mjs +1 -1
  927. package/dist/domains/ml/token-generation/scene.mjs +1 -2
  928. package/dist/domains/ml/tokenizer-bpe/model.mjs +1 -1
  929. package/dist/domains/ml/training-loop/scene.mjs +2 -4
  930. package/dist/domains/ml/transformer-block/scene.mjs +2 -3
  931. package/dist/domains/ml/unembedding/scene.mjs +2 -3
  932. package/dist/domains/networking/adaptive-video-call/scene.mjs +2 -5
  933. package/dist/domains/networking/bottleneck-queue/scene.mjs +82 -19
  934. package/dist/domains/networking/broadcast-delivery/scene.mjs +1 -3
  935. package/dist/domains/networking/cafe-privacy/runtime.mjs +6 -1
  936. package/dist/domains/networking/cafe-privacy/scene.mjs +296 -180
  937. package/dist/domains/networking/cell-size/CellSizeScene.mjs +1 -3
  938. package/dist/domains/networking/cloud-storage-design/manifest.mjs +2 -3
  939. package/dist/domains/networking/cloud-storage-design/scene.mjs +4 -7
  940. package/dist/domains/networking/container-deployment/scene.mjs +5 -8
  941. package/dist/domains/networking/data-recovery-planner/scene.mjs +4 -7
  942. package/dist/domains/networking/dhcp-lease/scene.mjs +0 -2
  943. package/dist/domains/networking/distributed-inference-topology/scene.mjs +3 -5
  944. package/dist/domains/networking/dns-resolution/scene.mjs +1 -4
  945. package/dist/domains/networking/edge-cache-delivery/scene.mjs +4 -7
  946. package/dist/domains/networking/ethernet-pinout/PlugScene.mjs +1 -3
  947. package/dist/domains/networking/failure-domain-planner/scene.mjs +4 -7
  948. package/dist/domains/networking/generation-capability/CapabilityTesterScene.mjs +0 -1
  949. package/dist/domains/networking/geo-market-routing/scene.mjs +3 -6
  950. package/dist/domains/networking/group-message-sync/scene.mjs +1 -3
  951. package/dist/domains/networking/handover-margin/scene.mjs +2 -4
  952. package/dist/domains/networking/home-broadband-journey/scene.mjs +1 -3
  953. package/dist/domains/networking/inference-capacity-planner/scene.mjs +3 -5
  954. package/dist/domains/networking/inference-degradation-planner/scene.mjs +3 -5
  955. package/dist/domains/networking/inference-request-pipeline/scene.mjs +0 -1
  956. package/dist/domains/networking/infrastructure-drift-planner/scene.mjs +3 -5
  957. package/dist/domains/networking/ipv6-neighbor/scene.mjs +0 -2
  958. package/dist/domains/networking/layer-encapsulation/scene.mjs +5 -9
  959. package/dist/domains/networking/live-stream-pipeline/scene.mjs +1 -3
  960. package/dist/domains/networking/media-encoding/scene.mjs +1 -3
  961. package/dist/domains/networking/message-journey/scene.mjs +1 -3
  962. package/dist/domains/networking/mobile-call-journey/scene.mjs +1 -3
  963. package/dist/domains/networking/model-routing-economics/scene.mjs +3 -5
  964. package/dist/domains/networking/modem-modulation/scene.mjs +2 -4
  965. package/dist/domains/networking/nat-traversal/scene.mjs +0 -2
  966. package/dist/domains/networking/network-media/scene.mjs +0 -2
  967. package/dist/domains/networking/orbit-latency/SatelliteScene.mjs +1 -3
  968. package/dist/domains/networking/orchestration-reconciler/scene.mjs +5 -8
  969. package/dist/domains/networking/packet-journey/NetworkScene.d.mts +0 -1
  970. package/dist/domains/networking/packet-journey/NetworkScene.mjs +0 -2
  971. package/dist/domains/networking/prefix-cache-planner/scene.mjs +4 -6
  972. package/dist/domains/networking/release-strategy-planner/scene.mjs +2 -4
  973. package/dist/domains/networking/route-learning/scene.mjs +2 -4
  974. package/dist/domains/networking/secret-rotation-planner/scene.mjs +2 -4
  975. package/dist/domains/networking/server-deployment/scene.mjs +0 -2
  976. package/dist/domains/networking/service-scaling/scene.mjs +2 -5
  977. package/dist/domains/networking/shared-airtime/scene.mjs +2 -4
  978. package/dist/domains/networking/signal-through-walls/SignalThroughWallsScene.mjs +2 -5
  979. package/dist/domains/networking/slo-incident-console/scene.mjs +3 -6
  980. package/dist/domains/networking/spectrum-map/SpectrumMapScene.mjs +0 -1
  981. package/dist/domains/networking/subnet-builder/SubnetScene.mjs +0 -2
  982. package/dist/domains/networking/switch-learning/SwitchScene.mjs +0 -3
  983. package/dist/domains/networking/tcp-handshake/scene.mjs +6 -7
  984. package/dist/domains/networking/tcp-sender/scene.mjs +0 -2
  985. package/dist/domains/networking/tls-connection/scene.mjs +0 -2
  986. package/dist/domains/networking/vlan-designer/VlanScene.mjs +8 -10
  987. package/dist/domains/networking/vpc-route-planner/scene.mjs +4 -7
  988. package/dist/domains/networking/vpn-tunnel/VpnScene.mjs +3 -6
  989. package/dist/domains/networking/wave-size/WaveSizeScene.mjs +10 -10
  990. package/dist/domains/networking/wifi-contention/scene.mjs +0 -2
  991. package/dist/domains/networking/wifi-coverage/scene.mjs +4 -5
  992. package/dist/domains/networking/workload-identity-planner/scene.mjs +2 -4
  993. package/dist/domains/physics/electricity/capacitor-energy/activity.mjs +1 -1
  994. package/dist/domains/physics/electricity/capacitor-energy/layout.mjs +107 -0
  995. package/dist/domains/physics/electricity/capacitor-energy/manifest.mjs +1 -1
  996. package/dist/domains/physics/electricity/capacitor-energy/scene.mjs +286 -323
  997. package/dist/domains/physics/electricity/circuit-energy-flow/scene.mjs +1 -3
  998. package/dist/domains/physics/electricity/circuit-fault-detective/scene.mjs +3 -3
  999. package/dist/domains/physics/electricity/circuit-iv-investigation/scene.mjs +4 -5
  1000. package/dist/domains/physics/electricity/coulomb-superposition/manifest.mjs +1 -1
  1001. package/dist/domains/physics/electricity/coulomb-superposition/model.mjs +2 -2
  1002. package/dist/domains/physics/electricity/coulomb-superposition/scene.mjs +2 -3
  1003. package/dist/domains/physics/electricity/electric-field/scene.mjs +7 -11
  1004. package/dist/domains/physics/electricity/electric-flux/preset.mjs +1 -1
  1005. package/dist/domains/physics/electricity/electric-flux/scene.mjs +7 -4
  1006. package/dist/domains/physics/electricity/friction-charging/scene.mjs +4 -6
  1007. package/dist/domains/physics/electricity/gauss-law/runtime.mjs +0 -1
  1008. package/dist/domains/physics/electricity/gauss-law/scene.mjs +4 -5
  1009. package/dist/domains/physics/electricity/plug-safety-inspector/scene.mjs +6 -8
  1010. package/dist/domains/physics/electricity/rectifier-bench/scene.mjs +290 -281
  1011. package/dist/domains/physics/electricity/regulated-supply/scene.mjs +1 -3
  1012. package/dist/domains/physics/electricity/work-potential/labels.mjs +85 -0
  1013. package/dist/domains/physics/electricity/work-potential/scene.mjs +37 -41
  1014. package/dist/domains/physics/energy/bullet-walls/scene.mjs +6 -5
  1015. package/dist/domains/physics/energy/efficiency/device-art.mjs +7 -9
  1016. package/dist/domains/physics/energy/efficiency/scene.mjs +0 -1
  1017. package/dist/domains/physics/energy/energy-resource-grid/scene.mjs +10 -11
  1018. package/dist/domains/physics/energy/energy-skate/scene.mjs +2 -4
  1019. package/dist/domains/physics/energy/lifting-work/scene.mjs +1 -3
  1020. package/dist/domains/physics/energy/power/activity.mjs +1 -1
  1021. package/dist/domains/physics/energy/power/manifest.mjs +2 -1
  1022. package/dist/domains/physics/energy/power/model.mjs +2 -2
  1023. package/dist/domains/physics/energy/power/scene.mjs +28 -22
  1024. package/dist/domains/physics/energy/work-energy/scene.mjs +11 -13
  1025. package/dist/domains/physics/fields/field-geometry/scene.mjs +2 -4
  1026. package/dist/domains/physics/fields/gravitation/scene.mjs +2 -4
  1027. package/dist/domains/physics/fields/gravity-profile/runtime.mjs +0 -1
  1028. package/dist/domains/physics/fields/gravity-profile/scene.mjs +1 -5
  1029. package/dist/domains/physics/fields/kepler/scene.mjs +2 -4
  1030. package/dist/domains/physics/fields/orbit-lab/model.mjs +46 -28
  1031. package/dist/domains/physics/fields/orbit-lab/scene.mjs +3 -6
  1032. package/dist/domains/physics/forces/atwood/scene.mjs +13 -18
  1033. package/dist/domains/physics/forces/beam-reactions/scene.mjs +13 -14
  1034. package/dist/domains/physics/forces/circular-motion/scene.mjs +7 -8
  1035. package/dist/domains/physics/forces/collision-track/activity.mjs +8 -1
  1036. package/dist/domains/physics/forces/collision-track/manifest.mjs +6 -2
  1037. package/dist/domains/physics/forces/collision-track/model.mjs +1 -8
  1038. package/dist/domains/physics/forces/collision-track/runtime.mjs +1 -1
  1039. package/dist/domains/physics/forces/collision-track/scene.mjs +13 -10
  1040. package/dist/domains/physics/forces/contact-pressure/footprint-scene.mjs +12 -10
  1041. package/dist/domains/physics/forces/couple-torque/scene.mjs +10 -10
  1042. package/dist/domains/physics/forces/force-pairs/scene.mjs +8 -11
  1043. package/dist/domains/physics/forces/impulse/activity.mjs +3 -3
  1044. package/dist/domains/physics/forces/impulse/manifest.mjs +1 -1
  1045. package/dist/domains/physics/forces/impulse/model.mjs +2 -2
  1046. package/dist/domains/physics/forces/impulse/runtime.mjs +3 -3
  1047. package/dist/domains/physics/forces/impulse/scene.mjs +16 -20
  1048. package/dist/domains/physics/forces/lever/runtime.mjs +0 -1
  1049. package/dist/domains/physics/forces/lever/scene.mjs +6 -9
  1050. package/dist/domains/physics/forces/lift-weight/scene.mjs +9 -8
  1051. package/dist/domains/physics/forces/newton-first-law/model.mjs +1 -0
  1052. package/dist/domains/physics/forces/newton-first-law/scene.mjs +15 -13
  1053. package/dist/domains/physics/forces/ramp-forces/evidence.mjs +1 -3
  1054. package/dist/domains/physics/forces/ramp-forces/scene.mjs +35 -26
  1055. package/dist/domains/physics/forces/rocket-flight/scene.mjs +3 -5
  1056. package/dist/domains/physics/forces/spin-studio/activity.mjs +2 -34
  1057. package/dist/domains/physics/forces/spin-studio/manifest.mjs +3 -3
  1058. package/dist/domains/physics/forces/spin-studio/model.mjs +0 -1
  1059. package/dist/domains/physics/forces/spin-studio/scene.mjs +112 -82
  1060. package/dist/domains/physics/forces/spring-combinations/scene.mjs +7 -11
  1061. package/dist/domains/physics/forces/stability/scene.mjs +10 -16
  1062. package/dist/domains/physics/forces/terminal-velocity/scene.mjs +3 -5
  1063. package/dist/domains/physics/magnetism/ac-generator/model.mjs +2 -3
  1064. package/dist/domains/physics/magnetism/ac-generator/scene.mjs +167 -58
  1065. package/dist/domains/physics/magnetism/alternating-current/scene.mjs +290 -360
  1066. package/dist/domains/physics/magnetism/coil-torque/scene.mjs +7 -5
  1067. package/dist/domains/physics/magnetism/dc-motor/manifest.mjs +1 -1
  1068. package/dist/domains/physics/magnetism/dc-motor/runtime.mjs +2 -2
  1069. package/dist/domains/physics/magnetism/dc-motor/scene.mjs +362 -262
  1070. package/dist/domains/physics/magnetism/earth-field/scene.mjs +216 -177
  1071. package/dist/domains/physics/magnetism/generator-grid-mission/scene.mjs +18 -21
  1072. package/dist/domains/physics/magnetism/induction-bench/scene.mjs +8 -13
  1073. package/dist/domains/physics/magnetism/inductor-energy/scene.mjs +9 -11
  1074. package/dist/domains/physics/magnetism/lorentz/scene.mjs +2 -4
  1075. package/dist/domains/physics/magnetism/magnet-pair/lesson-examples.mjs +4 -4
  1076. package/dist/domains/physics/magnetism/magnet-pair/manifest.mjs +1 -1
  1077. package/dist/domains/physics/magnetism/magnet-pair/model.mjs +3 -3
  1078. package/dist/domains/physics/magnetism/magnet-pair/runtime.mjs +5 -5
  1079. package/dist/domains/physics/magnetism/magnet-pair/scene.mjs +103 -313
  1080. package/dist/domains/physics/magnetism/magnetic-field/activity.mjs +44 -36
  1081. package/dist/domains/physics/magnetism/magnetic-field/manifest.mjs +1 -1
  1082. package/dist/domains/physics/magnetism/magnetic-field/model.mjs +6 -6
  1083. package/dist/domains/physics/magnetism/magnetic-field/runtime.mjs +2 -1
  1084. package/dist/domains/physics/magnetism/magnetic-field/scene.mjs +33 -39
  1085. package/dist/domains/physics/magnetism/magnetism/model.mjs +15 -8
  1086. package/dist/domains/physics/magnetism/magnetism/runtime.mjs +0 -1
  1087. package/dist/domains/physics/magnetism/magnetism/scene.mjs +3 -5
  1088. package/dist/domains/physics/magnetism/magnetism-diagram/schema.mjs +1 -2
  1089. package/dist/domains/physics/magnetism/mutual-induction/scene.mjs +7 -9
  1090. package/dist/domains/physics/magnetism/relay-bench/scene.mjs +11 -16
  1091. package/dist/domains/physics/magnetism/rl-step-response/model.mjs +3 -2
  1092. package/dist/domains/physics/magnetism/rl-step-response/scene.mjs +1 -3
  1093. package/dist/domains/physics/magnetism/soft-iron-steel/scene.mjs +74 -124
  1094. package/dist/domains/physics/magnetism/solenoid-bench/activity.mjs +1 -1
  1095. package/dist/domains/physics/magnetism/solenoid-bench/manifest.mjs +3 -8
  1096. package/dist/domains/physics/magnetism/solenoid-bench/model.mjs +3 -3
  1097. package/dist/domains/physics/magnetism/solenoid-bench/runtime.mjs +2 -1
  1098. package/dist/domains/physics/magnetism/solenoid-bench/scene.mjs +239 -162
  1099. package/dist/domains/physics/magnetism/spatial-lorentz/scene.mjs +3 -4
  1100. package/dist/domains/physics/magnetism/transformer-bench/scene.mjs +171 -62
  1101. package/dist/domains/physics/magnetism/wire-force-angle/scene.mjs +2 -3
  1102. package/dist/domains/physics/matter/buoyancy/scene.mjs +2 -3
  1103. package/dist/domains/physics/matter/carnot/cycle-scene.mjs +272 -218
  1104. package/dist/domains/physics/matter/cooling-insulation-investigation/scene.mjs +13 -15
  1105. package/dist/domains/physics/matter/density-displacement/scene.mjs +10 -10
  1106. package/dist/domains/physics/matter/entropy/entropy-scene.mjs +277 -231
  1107. package/dist/domains/physics/matter/evaporation/activity.mjs +12 -5
  1108. package/dist/domains/physics/matter/evaporation/dish-scene.mjs +189 -162
  1109. package/dist/domains/physics/matter/evaporation/manifest.mjs +4 -2
  1110. package/dist/domains/physics/matter/evaporation/model.mjs +23 -38
  1111. package/dist/domains/physics/matter/evaporation/runtime.mjs +1 -0
  1112. package/dist/domains/physics/matter/fluid-pressure/scene.mjs +1 -2
  1113. package/dist/domains/physics/matter/gas-process/manifest.mjs +3 -2
  1114. package/dist/domains/physics/matter/gas-process/model.mjs +9 -4
  1115. package/dist/domains/physics/matter/gas-process/scene.mjs +201 -153
  1116. package/dist/domains/physics/matter/gas-theory/theory-scenes.mjs +11 -14
  1117. package/dist/domains/physics/matter/heat-transfer/conduction-scene.mjs +19 -15
  1118. package/dist/domains/physics/matter/heat-transfer/convection-scene.mjs +9 -10
  1119. package/dist/domains/physics/matter/heat-transfer/radiation-scene.mjs +54 -66
  1120. package/dist/domains/physics/matter/heat-transfer/scene.mjs +1 -2
  1121. package/dist/domains/physics/matter/heat-transfer-cases/scene.mjs +24 -26
  1122. package/dist/domains/physics/matter/heating-curve/heating-scene.mjs +9 -11
  1123. package/dist/domains/physics/matter/heating-curve/model.mjs +5 -13
  1124. package/dist/domains/physics/matter/specific-heat/scene.mjs +11 -11
  1125. package/dist/domains/physics/matter/stress-strain/wire-scene.mjs +13 -13
  1126. package/dist/domains/physics/matter/temperature-scales/scene.mjs +6 -8
  1127. package/dist/domains/physics/matter/thermal-equilibrium/scene.mjs +13 -14
  1128. package/dist/domains/physics/matter/thermal-expansion/expansion-scenes.mjs +24 -26
  1129. package/dist/domains/physics/matter/thermal-expansion/scene.mjs +1 -2
  1130. package/dist/domains/physics/matter/venturi/activity.mjs +1 -1
  1131. package/dist/domains/physics/matter/venturi/manifest.mjs +8 -7
  1132. package/dist/domains/physics/matter/venturi/model.mjs +1 -1
  1133. package/dist/domains/physics/matter/venturi/runtime.mjs +1 -0
  1134. package/dist/domains/physics/matter/venturi/scene.mjs +2 -3
  1135. package/dist/domains/physics/matter/water-density/scene.mjs +2 -4
  1136. package/dist/domains/physics/measurement/data-table-clinic/scene.mjs +0 -1
  1137. package/dist/domains/physics/measurement/evaluation-clinic/scene.mjs +5 -8
  1138. package/dist/domains/physics/measurement/graph-craft/scene.mjs +2 -4
  1139. package/dist/domains/physics/measurement/homogeneity-check/scene.mjs +1 -2
  1140. package/dist/domains/physics/measurement/paper5-analysis-lab/scene.mjs +4 -6
  1141. package/dist/domains/physics/measurement/physics-practical-studio/scene.mjs +10 -10
  1142. package/dist/domains/physics/measurement/precision-measurement-lab/scene.mjs +7 -5
  1143. package/dist/domains/physics/measurement/prefix-ladder/scene.mjs +0 -1
  1144. package/dist/domains/physics/measurement/reading-spread/scene.mjs +20 -7
  1145. package/dist/domains/physics/measurement/scale-reading/scene.mjs +11 -13
  1146. package/dist/domains/physics/measurement/uncertainty-budget/scene.mjs +0 -1
  1147. package/dist/domains/physics/measurement/unit-machine/scene.mjs +1 -2
  1148. package/dist/domains/physics/modern/acoustic-boundary/acoustic-boundary.mjs +2 -3
  1149. package/dist/domains/physics/modern/bloch-sphere/runtime.mjs +1 -2
  1150. package/dist/domains/physics/modern/double-slit/double-slit-scene.mjs +1 -3
  1151. package/dist/domains/physics/modern/fission-chain/fission-scene.mjs +1 -3
  1152. package/dist/domains/physics/modern/hydrogen-spectrum/scene.mjs +2 -4
  1153. package/dist/domains/physics/modern/length-contraction/scene.mjs +3 -6
  1154. package/dist/domains/physics/modern/lorentz-transformation/scene.mjs +7 -6
  1155. package/dist/domains/physics/modern/muon-survival/scene.mjs +23 -15
  1156. package/dist/domains/physics/modern/nuclear-binding-energy/scene.mjs +8 -10
  1157. package/dist/domains/physics/modern/pet-scan/pet-scene.mjs +5 -8
  1158. package/dist/domains/physics/modern/photoelectric-effect/scene.mjs +16 -18
  1159. package/dist/domains/physics/modern/quantum-gates/scene.mjs +1 -2
  1160. package/dist/domains/physics/modern/radiation-half-life-investigation/runtime.mjs +7 -18
  1161. package/dist/domains/physics/modern/radiation-half-life-investigation/scene.mjs +67 -57
  1162. package/dist/domains/physics/modern/radioactive-decay/scene.mjs +3 -5
  1163. package/dist/domains/physics/modern/relativity-light-clock/light-clock.mjs +3 -5
  1164. package/dist/domains/physics/modern/relativity-light-clock/spacetime.mjs +0 -1
  1165. package/dist/domains/physics/modern/relativity-simultaneity/simultaneity-scene.mjs +3 -5
  1166. package/dist/domains/physics/modern/tomography/scene.mjs +0 -1
  1167. package/dist/domains/physics/modern/ultrasound-frequency/scene.mjs +1 -3
  1168. package/dist/domains/physics/modern/uncertainty-wave-packet/scene.mjs +2 -3
  1169. package/dist/domains/physics/modern/xray-attenuation/xray-scene.mjs +8 -6
  1170. package/dist/domains/physics/modern/xray-tube-spectrum/spectrum-scene.mjs +17 -9
  1171. package/dist/domains/physics/motion/falling-target/target-scene.mjs +8 -6
  1172. package/dist/domains/physics/motion/gravity-drop/scene.mjs +4 -6
  1173. package/dist/domains/physics/motion/intercept/animals.mjs +0 -1
  1174. package/dist/domains/physics/motion/intercept/scene.mjs +9 -9
  1175. package/dist/domains/physics/motion/linear-pursuit/pursuit-scene.mjs +4 -6
  1176. package/dist/domains/physics/motion/moving-launcher/runtime.mjs +0 -1
  1177. package/dist/domains/physics/motion/moving-launcher/scene.mjs +4 -10
  1178. package/dist/domains/physics/motion/projectile-lab/model.mjs +4 -4
  1179. package/dist/domains/physics/motion/projectile-lab/scene.mjs +14 -18
  1180. package/dist/domains/physics/motion/rain-relative/model.mjs +5 -11
  1181. package/dist/domains/physics/motion/rain-relative/scene.mjs +9 -8
  1182. package/dist/domains/physics/motion/river-boat/model.mjs +6 -12
  1183. package/dist/domains/physics/motion/river-boat/scene.mjs +9 -10
  1184. package/dist/domains/physics/motion/stopping-distance/stopping-scene.mjs +5 -7
  1185. package/dist/domains/physics/motion/trolley-acceleration-investigation/scene.mjs +14 -13
  1186. package/dist/domains/physics/motion/trolley-acceleration-investigation/trolley.d.mts +0 -1
  1187. package/dist/domains/physics/motion/trolley-acceleration-investigation/trolley.mjs +26 -17
  1188. package/dist/domains/physics/motion/vector-board/model.mjs +14 -14
  1189. package/dist/domains/physics/motion/vector-board/preset.d.mts +1 -1
  1190. package/dist/domains/physics/motion/vector-board/preset.mjs +8 -5
  1191. package/dist/domains/physics/motion/vector-board/scene.mjs +157 -27
  1192. package/dist/domains/physics/motion/vector-types/scene.mjs +2 -3
  1193. package/dist/domains/physics/motion/vector-types/trip-scene.mjs +2 -4
  1194. package/dist/domains/physics/motion/velocity-gradient/scene.mjs +1 -2
  1195. package/dist/domains/physics/space/cosmic-expansion/scene.mjs +2 -3
  1196. package/dist/domains/physics/space/stellar-distance/scene.mjs +2 -4
  1197. package/dist/domains/physics/space/stellar-evolution/scene.mjs +2 -4
  1198. package/dist/domains/physics/space/stellar-radiation/scene.mjs +2 -3
  1199. package/dist/domains/physics/waves/bench/bench-scene.mjs +35 -13
  1200. package/dist/domains/physics/waves/bench/wave-experience-scene.mjs +4 -6
  1201. package/dist/domains/physics/waves/car-suspension/scene.mjs +3 -5
  1202. package/dist/domains/physics/waves/diffraction-grating/scene.mjs +8 -7
  1203. package/dist/domains/physics/waves/doppler/doppler-scene.mjs +3 -5
  1204. package/dist/domains/physics/waves/echo-ranging/scene.mjs +5 -6
  1205. package/dist/domains/physics/waves/fibre-pulse/scene.mjs +1 -1
  1206. package/dist/domains/physics/waves/gap-diffraction/gap-scene.mjs +20 -13
  1207. package/dist/domains/physics/waves/glass-block-refraction/scene.mjs +3 -3
  1208. package/dist/domains/physics/waves/guitar-string/scene.mjs +1 -2
  1209. package/dist/domains/physics/waves/harmonic-modes/scene.mjs +3 -5
  1210. package/dist/domains/physics/waves/lens-focal-investigation/activity.mjs +127 -118
  1211. package/dist/domains/physics/waves/lens-focal-investigation/manifest.mjs +9 -2
  1212. package/dist/domains/physics/waves/lens-focal-investigation/model.mjs +4 -1
  1213. package/dist/domains/physics/waves/lens-focal-investigation/runtime.mjs +1 -0
  1214. package/dist/domains/physics/waves/lens-focal-investigation/scene.mjs +25 -47
  1215. package/dist/domains/physics/waves/lens-geometry/scene.mjs +31 -33
  1216. package/dist/domains/physics/waves/lens-imaging/runtime.mjs +0 -1
  1217. package/dist/domains/physics/waves/lens-imaging/scene.mjs +0 -1
  1218. package/dist/domains/physics/waves/lens-mission/scene.mjs +3 -5
  1219. package/dist/domains/physics/waves/mirror-imaging/runtime.mjs +0 -1
  1220. package/dist/domains/physics/waves/mirror-imaging/scene.mjs +0 -1
  1221. package/dist/domains/physics/waves/optics/apparatus.mjs +8 -4
  1222. package/dist/domains/physics/waves/optics/runtime.mjs +0 -1
  1223. package/dist/domains/physics/waves/optics/scene.mjs +3 -4
  1224. package/dist/domains/physics/waves/optics-mission/scene.mjs +2 -4
  1225. package/dist/domains/physics/waves/pendulum-worlds/scene.mjs +118 -72
  1226. package/dist/domains/physics/waves/plane-mirror/scene.mjs +1 -2
  1227. package/dist/domains/physics/waves/polarisation/polariser-scene.mjs +20 -14
  1228. package/dist/domains/physics/waves/prism-dispersion/scene.mjs +0 -1
  1229. package/dist/domains/physics/waves/progressive-stationary/scene.mjs +2 -4
  1230. package/dist/domains/physics/waves/pulse-echo/scene.mjs +1 -2
  1231. package/dist/domains/physics/waves/refraction/scene.mjs +15 -12
  1232. package/dist/domains/physics/waves/ripple-tank/scene.mjs +1 -2
  1233. package/dist/domains/physics/waves/shm/model.mjs +43 -8
  1234. package/dist/domains/physics/waves/shm/scene.mjs +3 -5
  1235. package/dist/domains/physics/waves/shm-energy/scene.mjs +1 -2
  1236. package/dist/domains/physics/waves/shm-graphs/scene.mjs +1 -2
  1237. package/dist/domains/physics/waves/sound-air/scene.mjs +2 -3
  1238. package/dist/domains/physics/waves/sound-medium/scene.mjs +1 -2
  1239. package/dist/domains/physics/waves/sound-mission/scene.mjs +1 -2
  1240. package/dist/domains/physics/waves/spectral-resolver/scene.mjs +0 -1
  1241. package/dist/domains/physics/waves/spectrum-mission/scene.mjs +0 -1
  1242. package/dist/domains/physics/waves/string-reflection/scene.mjs +2 -4
  1243. package/dist/domains/physics/waves/timbre/scene.mjs +0 -1
  1244. package/dist/domains/physics/waves/two-source/two-source-scene.mjs +3 -5
  1245. package/dist/domains/physics/waves/water-wave-refraction/scene.mjs +2 -3
  1246. package/dist/domains/physics/waves/young-double-slit/model.mjs +4 -1
  1247. package/dist/domains/physics/waves/young-double-slit/young-scene.mjs +8 -9
  1248. package/dist/domains/render-map.mjs +39 -1
  1249. package/dist/domains/render.d.mts +1 -9
  1250. package/dist/domains/render.mjs +11 -15
  1251. package/dist/domains/revision/chapter-summary/manifest.mjs +1 -2
  1252. package/dist/domains/revision/concept-sprint/model.mjs +2 -2
  1253. package/dist/domains/revision/step-order-puzzle/model.mjs +1 -1
  1254. package/dist/domains/statistics/bar-chart-builder/model.mjs +1 -1
  1255. package/dist/domains/statistics/bar-chart-builder/scene.mjs +0 -1
  1256. package/dist/domains/statistics/center-spread/activity.mjs +5 -3
  1257. package/dist/domains/statistics/center-spread/balance-scene.mjs +75 -23
  1258. package/dist/domains/statistics/center-spread/model.mjs +2 -1
  1259. package/dist/domains/statistics/center-spread/scene.mjs +8 -7
  1260. package/dist/domains/statistics/cumulative-frequency-builder/scene.mjs +0 -1
  1261. package/dist/domains/statistics/frequency-density/activity.mjs +1 -1
  1262. package/dist/domains/statistics/frequency-density/density-scene.mjs +127 -122
  1263. package/dist/domains/statistics/frequency-density/manifest.mjs +2 -2
  1264. package/dist/domains/statistics/frequency-density/runtime.mjs +5 -4
  1265. package/dist/domains/statistics/galton/model.mjs +137 -108
  1266. package/dist/domains/statistics/galton/runtime.mjs +14 -35
  1267. package/dist/domains/statistics/galton/scene.mjs +85 -153
  1268. package/dist/domains/statistics/histogram/manifest.mjs +19 -0
  1269. package/dist/domains/statistics/histogram/model.mjs +9 -3
  1270. package/dist/domains/statistics/histogram/runtime.mjs +1 -1
  1271. package/dist/domains/statistics/histogram/scene.mjs +21 -11
  1272. package/dist/domains/statistics/histogram-builder/scene.mjs +0 -1
  1273. package/dist/domains/statistics/histogram-interval/scene.mjs +0 -1
  1274. package/dist/domains/statistics/normal/normal-scene.mjs +0 -1
  1275. package/dist/domains/statistics/normal/runtime.mjs +1 -1
  1276. package/dist/domains/statistics/normal/scene.mjs +1 -2
  1277. package/dist/domains/statistics/ogive/ogive-scene.mjs +63 -36
  1278. package/dist/domains/statistics/ogive/scene.mjs +1 -2
  1279. package/dist/domains/statistics/pictogram-builder/model.mjs +5 -4
  1280. package/dist/domains/statistics/pictogram-builder/scene.mjs +0 -1
  1281. package/dist/domains/statistics/pie-chart-builder/model.mjs +5 -4
  1282. package/dist/domains/statistics/pie-chart-builder/scene.mjs +0 -1
  1283. package/dist/domains/statistics/sampling/model.mjs +2 -2
  1284. package/dist/domains/statistics/sampling/runtime.mjs +4 -4
  1285. package/dist/domains/statistics/sampling/sampling-scene.mjs +0 -1
  1286. package/dist/domains/statistics/sampling/scene.mjs +1 -2
  1287. package/dist/domains/statistics/scatter-builder/scene.mjs +0 -1
  1288. package/dist/domains/statistics/series/model.mjs +6 -4
  1289. package/dist/domains/statistics/series/runtime.mjs +4 -4
  1290. package/dist/domains/statistics/series/series-scene.mjs +50 -17
  1291. package/dist/domains/statistics/series-chart-builder/model.mjs +5 -4
  1292. package/dist/domains/statistics/series-chart-builder/scene.mjs +0 -1
  1293. package/dist/domains/statistics/two-way-table-builder/model.mjs +4 -3
  1294. package/dist/domains/statistics/two-way-table-builder/scene.mjs +0 -1
  1295. package/dist/domains/statistics/z-table/scene.mjs +0 -1
  1296. package/dist/exam/answer-spec.mjs +15 -2
  1297. package/dist/exam/exam-question/core.d.mts +1 -1
  1298. package/dist/exam/exam-question/core.mjs +9 -2
  1299. package/dist/geometry/board/construction.d.mts +11 -3
  1300. package/dist/geometry/board/construction.mjs +13 -0
  1301. package/dist/geometry/board/index.d.mts +1 -1
  1302. package/dist/geometry/board/schema.mjs +106 -0
  1303. package/dist/geometry/index.d.mts +1 -1
  1304. package/dist/ict/number-systems/wheel.mjs +2 -2
  1305. package/dist/illustrations/story-scene/accounting/cash-credit-flow.mjs +1 -1
  1306. package/dist/illustrations/story-scene/accounting/delivery-van.mjs +1 -1
  1307. package/dist/illustrations/story-scene/accounting/shop-counter-till.mjs +1 -1
  1308. package/dist/illustrations/story-scene/accounting/stocktake-shelves.mjs +4 -3
  1309. package/dist/illustrations/story-scene/accounting/supplier-delivery.mjs +1 -1
  1310. package/dist/illustrations/story-scene/accounting/tea-stall.mjs +1 -1
  1311. package/dist/illustrations/story-scene/accounting/van.mjs +3 -3
  1312. package/dist/illustrations/story-scene/accounting/workshop-machine.mjs +4 -3
  1313. package/dist/illustrations/story-scene/chemistry/acid-rain.mjs +6 -5
  1314. package/dist/illustrations/story-scene/chemistry/balls-in-box.mjs +1 -1
  1315. package/dist/illustrations/story-scene/chemistry/blast-furnace.mjs +4 -3
  1316. package/dist/illustrations/story-scene/chemistry/bread-dough.mjs +4 -3
  1317. package/dist/illustrations/story-scene/chemistry/brick-rebuild.mjs +6 -5
  1318. package/dist/illustrations/story-scene/chemistry/bromine-water-test.mjs +4 -3
  1319. package/dist/illustrations/story-scene/chemistry/charge-see-saw.mjs +4 -3
  1320. package/dist/illustrations/story-scene/chemistry/cold-pack.mjs +4 -3
  1321. package/dist/illustrations/story-scene/chemistry/corridor-pace.mjs +1 -1
  1322. package/dist/illustrations/story-scene/chemistry/crowd-states.mjs +1 -1
  1323. package/dist/illustrations/story-scene/chemistry/distillation-rig.mjs +1 -1
  1324. package/dist/illustrations/story-scene/chemistry/dozen-weigh.mjs +4 -3
  1325. package/dist/illustrations/story-scene/chemistry/ethene-bag.mjs +4 -3
  1326. package/dist/illustrations/story-scene/chemistry/fertiliser-field.mjs +4 -4
  1327. package/dist/illustrations/story-scene/chemistry/fractionating-tower.mjs +4 -3
  1328. package/dist/illustrations/story-scene/chemistry/fruity-ester.mjs +8 -7
  1329. package/dist/illustrations/story-scene/chemistry/hand-sanitiser.mjs +6 -5
  1330. package/dist/illustrations/story-scene/chemistry/hand-warmer.mjs +4 -3
  1331. package/dist/illustrations/story-scene/chemistry/ionic-tug-of-war.mjs +6 -5
  1332. package/dist/illustrations/story-scene/chemistry/lime-kiln.mjs +1 -1
  1333. package/dist/illustrations/story-scene/chemistry/lunch-box.mjs +4 -3
  1334. package/dist/illustrations/story-scene/chemistry/magnesium-ribbon.mjs +4 -3
  1335. package/dist/illustrations/story-scene/chemistry/nylon-rope.mjs +8 -7
  1336. package/dist/illustrations/story-scene/chemistry/pancake-stack.mjs +4 -3
  1337. package/dist/illustrations/story-scene/chemistry/petrol-station.mjs +6 -5
  1338. package/dist/illustrations/story-scene/chemistry/photosynthesis-leaf.mjs +1 -1
  1339. package/dist/illustrations/story-scene/chemistry/plastic-recycling.mjs +4 -3
  1340. package/dist/illustrations/story-scene/chemistry/recipe-card.mjs +4 -3
  1341. package/dist/illustrations/story-scene/chemistry/rusty-bike.mjs +4 -3
  1342. package/dist/illustrations/story-scene/chemistry/sandwich-stall.mjs +4 -3
  1343. package/dist/illustrations/story-scene/chemistry/scrap-box.mjs +4 -3
  1344. package/dist/illustrations/story-scene/chemistry/squash-jug.mjs +6 -5
  1345. package/dist/illustrations/story-scene/chemistry/sugar-cube.mjs +4 -3
  1346. package/dist/illustrations/story-scene/chemistry/vinegar-kitchen.mjs +6 -5
  1347. package/dist/illustrations/story-scene/chemistry/water-treatment.mjs +10 -9
  1348. package/dist/illustrations/story-scene/everyday/bicycle-wheel.mjs +4 -3
  1349. package/dist/illustrations/story-scene/everyday/cake-slices.mjs +3 -3
  1350. package/dist/illustrations/story-scene/everyday/car-road.mjs +3 -3
  1351. package/dist/illustrations/story-scene/everyday/phone-battery.mjs +3 -3
  1352. package/dist/illustrations/story-scene/everyday/train-speedometer.mjs +1 -1
  1353. package/dist/illustrations/story-scene/math/bag-of-counters.mjs +3 -3
  1354. package/dist/illustrations/story-scene/math/bank-savings.mjs +3 -3
  1355. package/dist/illustrations/story-scene/math/building-shadow.mjs +1 -1
  1356. package/dist/illustrations/story-scene/math/bus-timetable.mjs +4 -3
  1357. package/dist/illustrations/story-scene/math/cylinder-tank.mjs +4 -3
  1358. package/dist/illustrations/story-scene/math/elevation.mjs +1 -1
  1359. package/dist/illustrations/story-scene/math/flag-pole.mjs +1 -1
  1360. package/dist/illustrations/story-scene/math/football-goal.mjs +1 -1
  1361. package/dist/illustrations/story-scene/math/kite-string.mjs +1 -1
  1362. package/dist/illustrations/story-scene/math/ladder-wall.mjs +1 -1
  1363. package/dist/illustrations/story-scene/math/map-scale.mjs +3 -3
  1364. package/dist/illustrations/story-scene/math/phone-tower.mjs +1 -1
  1365. package/dist/illustrations/story-scene/math/photo-line-up.mjs +1 -1
  1366. package/dist/illustrations/story-scene/math/population-town.mjs +1 -1
  1367. package/dist/illustrations/story-scene/math/pyramid-tent.mjs +4 -3
  1368. package/dist/illustrations/story-scene/math/ramp.mjs +4 -3
  1369. package/dist/illustrations/story-scene/math/shop-price-tag.mjs +3 -3
  1370. package/dist/illustrations/story-scene/math/tank-tap.mjs +4 -3
  1371. package/dist/illustrations/story-scene/math/team-pick.mjs +1 -1
  1372. package/dist/illustrations/story-scene/parts.mjs +9 -8
  1373. package/dist/illustrations/story-scene/physics/cliff-throw.mjs +1 -1
  1374. package/dist/illustrations/story-scene/physics/curved-slide.mjs +4 -3
  1375. package/dist/illustrations/story-scene/physics/electric-kettle.mjs +3 -3
  1376. package/dist/illustrations/story-scene/physics/hot-drink.mjs +3 -3
  1377. package/dist/illustrations/story-scene/physics/lift-shaft.mjs +1 -1
  1378. package/dist/illustrations/story-scene/physics/sealed-syringe.mjs +3 -3
  1379. package/dist/illustrations/story-scene/physics/see-saw.mjs +4 -3
  1380. package/dist/illustrations/story-scene/physics/trolley-pull.mjs +4 -3
  1381. package/dist/illustrations/story-scene/story-scene.mjs +33 -19
  1382. package/dist/index.d.mts +2 -5
  1383. package/dist/index.mjs +1 -4
  1384. package/dist/kit/active-recall.mjs +1 -1
  1385. package/dist/kit/activity-authoring.d.mts +27 -1
  1386. package/dist/kit/activity.mjs +1 -1
  1387. package/dist/kit/algorithms/graph.d.mts +10 -3
  1388. package/dist/kit/algorithms/graph.mjs +14 -14
  1389. package/dist/kit/algorithms/index.mjs +3 -3
  1390. package/dist/kit/anim.d.mts +82 -28
  1391. package/dist/kit/anim.mjs +378 -63
  1392. package/dist/kit/annotate.mjs +22 -9
  1393. package/dist/kit/assets.mjs +1 -1
  1394. package/dist/kit/authored-activity-runtime.d.mts +9 -0
  1395. package/dist/kit/authored-activity-runtime.mjs +4 -4
  1396. package/dist/kit/authored-response.mjs +5 -1
  1397. package/dist/kit/bar-strip.mjs +8 -8
  1398. package/dist/kit/biology/cell/membrane.mjs +3 -17
  1399. package/dist/kit/biology/genetics/chromosome-diagram.mjs +0 -1
  1400. package/dist/kit/biology/index.d.mts +1 -1
  1401. package/dist/kit/biology/index.mjs +1 -1
  1402. package/dist/kit/canvas-layer.d.mts +2 -1
  1403. package/dist/kit/canvas-layer.mjs +3 -1
  1404. package/dist/kit/checkpoint.mjs +1 -1
  1405. package/dist/kit/chemistry/bench.d.mts +6 -2
  1406. package/dist/kit/chemistry/bench.mjs +63 -65
  1407. package/dist/kit/chemistry/calorimeter.d.mts +0 -1
  1408. package/dist/kit/chemistry/calorimeter.mjs +4 -4
  1409. package/dist/kit/chemistry/carbon-sphere.mjs +0 -1
  1410. package/dist/kit/chemistry/electrode.mjs +0 -1
  1411. package/dist/kit/chemistry/equation-ledger.mjs +1 -2
  1412. package/dist/kit/chemistry/flame.mjs +0 -1
  1413. package/dist/kit/chemistry/formula.mjs +0 -1
  1414. package/dist/kit/chemistry/gas-collection.mjs +2 -3
  1415. package/dist/kit/chemistry/glass-label.d.mts +17 -0
  1416. package/dist/kit/chemistry/glass-label.mjs +47 -0
  1417. package/dist/kit/chemistry/glassware.mjs +35 -33
  1418. package/dist/kit/chemistry/index.d.mts +2 -1
  1419. package/dist/kit/chemistry/index.mjs +2 -1
  1420. package/dist/kit/chemistry/ion-assembly.mjs +1 -2
  1421. package/dist/kit/chemistry/mechanism.mjs +7 -7
  1422. package/dist/kit/chemistry/molecule.mjs +2 -1
  1423. package/dist/kit/chemistry/nmr-figure.mjs +0 -1
  1424. package/dist/kit/chemistry/observation.d.mts +9 -15
  1425. package/dist/kit/chemistry/observation.mjs +12 -16
  1426. package/dist/kit/chemistry/particles.d.mts +8 -3
  1427. package/dist/kit/chemistry/particles.mjs +11 -12
  1428. package/dist/kit/chemistry/process.mjs +11 -18
  1429. package/dist/kit/chemistry/quantity-route-figure.mjs +29 -39
  1430. package/dist/kit/chemistry/quantity-route-objects.mjs +7 -8
  1431. package/dist/kit/chemistry/reaction.mjs +0 -1
  1432. package/dist/kit/chemistry/spectrum.mjs +0 -1
  1433. package/dist/kit/chemistry/structure-figure.mjs +2 -1
  1434. package/dist/kit/chemistry/volumetric-flask.mjs +6 -5
  1435. package/dist/kit/clue-scene.d.mts +5 -0
  1436. package/dist/kit/clue-scene.mjs +63 -31
  1437. package/dist/kit/cluster.mjs +0 -1
  1438. package/dist/kit/commerce/books.d.mts +3 -1
  1439. package/dist/kit/commerce/books.mjs +4 -4
  1440. package/dist/kit/commerce/buildings.mjs +4 -10
  1441. package/dist/kit/commerce/glyphs.mjs +4 -5
  1442. package/dist/kit/commerce/ledger.mjs +12 -21
  1443. package/dist/kit/controls.d.mts +28 -5
  1444. package/dist/kit/controls.mjs +104 -26
  1445. package/dist/kit/coords.d.mts +27 -1
  1446. package/dist/kit/coords.mjs +76 -27
  1447. package/dist/kit/counting/cards.mjs +1 -3
  1448. package/dist/kit/counting/counter.mjs +8 -8
  1449. package/dist/kit/counting/running-chart.mjs +0 -2
  1450. package/dist/kit/counting/tiles.mjs +1 -3
  1451. package/dist/kit/cycle.mjs +34 -14
  1452. package/dist/kit/data/categorical-bar-board.d.mts +0 -1
  1453. package/dist/kit/data/categorical-bar-core.mjs +25 -12
  1454. package/dist/kit/data/histogram-construction-board.d.mts +0 -1
  1455. package/dist/kit/data/histogram-construction-board.mjs +8 -3
  1456. package/dist/kit/data/histogram-interval-board.d.mts +0 -1
  1457. package/dist/kit/data/histogram-interval-board.mjs +8 -3
  1458. package/dist/kit/data/histogram-plot.mjs +8 -3
  1459. package/dist/kit/data/index.mjs +1 -1
  1460. package/dist/kit/data/pictogram-board.d.mts +0 -1
  1461. package/dist/kit/data/pictogram-board.mjs +23 -6
  1462. package/dist/kit/data/pie-chart-board.d.mts +2 -6
  1463. package/dist/kit/data/pie-chart-board.mjs +7 -30
  1464. package/dist/kit/data/scatter-point-board.d.mts +0 -1
  1465. package/dist/kit/data/scatter-point-board.mjs +8 -3
  1466. package/dist/kit/data/series-chart-board.d.mts +0 -1
  1467. package/dist/kit/data/two-way-table-board.d.mts +0 -1
  1468. package/dist/kit/data/two-way-table-board.mjs +21 -5
  1469. package/dist/kit/data-scene.mjs +0 -1
  1470. package/dist/kit/diagram/annotations.mjs +50 -3
  1471. package/dist/kit/diagram/label-placement.mjs +47 -2
  1472. package/dist/kit/discrete/tile.mjs +1 -3
  1473. package/dist/{domains/economics/_shared → kit/economics}/market-plot.mjs +18 -14
  1474. package/dist/kit/electronics/_shared.mjs +8 -29
  1475. package/dist/kit/electronics/bench-instruments.mjs +32 -16
  1476. package/dist/kit/electronics/bench-set.mjs +115 -167
  1477. package/dist/kit/electronics/bench.mjs +12 -10
  1478. package/dist/kit/electronics/carriers.mjs +88 -0
  1479. package/dist/kit/electronics/components.mjs +2 -4
  1480. package/dist/kit/electronics/icons.mjs +3 -2
  1481. package/dist/kit/electronics/index.mjs +5 -4
  1482. package/dist/kit/electronics/logic-bench.mjs +8 -7
  1483. package/dist/kit/electronics/rectifier.mjs +34 -25
  1484. package/dist/kit/electronics/signals.mjs +38 -31
  1485. package/dist/kit/embed.mjs +1 -1
  1486. package/dist/kit/ensure-asset.mjs +9 -10
  1487. package/dist/kit/figure/action.mjs +5 -1
  1488. package/dist/kit/figure/container.d.mts +2 -1
  1489. package/dist/kit/figure/container.mjs +72 -36
  1490. package/dist/kit/figure/database.mjs +2 -3
  1491. package/dist/kit/figure/detent-path-grip.d.mts +6 -2
  1492. package/dist/kit/figure/detent-path-grip.mjs +150 -49
  1493. package/dist/kit/figure/figure.d.mts +22 -18
  1494. package/dist/kit/figure/figure.mjs +13 -10
  1495. package/dist/kit/figure/format.d.mts +2 -30
  1496. package/dist/kit/figure/format.mjs +2 -62
  1497. package/dist/kit/figure/grip-motion.d.mts +103 -0
  1498. package/dist/kit/figure/grip-motion.mjs +283 -0
  1499. package/dist/kit/figure/grip-pointer.d.mts +54 -0
  1500. package/dist/kit/figure/grip-pointer.mjs +108 -0
  1501. package/dist/kit/figure/grip.d.mts +35 -6
  1502. package/dist/kit/figure/grip.mjs +347 -131
  1503. package/dist/kit/figure/index.d.mts +10 -4
  1504. package/dist/kit/figure/index.mjs +9 -3
  1505. package/dist/kit/figure/key-scale.mjs +73 -17
  1506. package/dist/kit/figure/legend.mjs +12 -5
  1507. package/dist/kit/figure/lines.d.mts +24 -0
  1508. package/dist/kit/figure/lines.mjs +16 -0
  1509. package/dist/kit/figure/math-text.mjs +1 -1
  1510. package/dist/kit/figure/plot.d.mts +5 -1
  1511. package/dist/kit/figure/plot.mjs +6 -5
  1512. package/dist/kit/figure/reading.d.mts +120 -0
  1513. package/dist/kit/figure/reading.mjs +437 -0
  1514. package/dist/kit/figure/run-key.mjs +2 -4
  1515. package/dist/kit/figure/text-metrics.d.mts +92 -0
  1516. package/dist/kit/figure/text-metrics.data.mjs +654 -0
  1517. package/dist/kit/figure/text-metrics.mjs +125 -0
  1518. package/dist/kit/figure/text.d.mts +0 -13
  1519. package/dist/kit/figure/text.mjs +19 -36
  1520. package/dist/kit/figure/value-control.d.mts +0 -1
  1521. package/dist/kit/figure/value-control.mjs +30 -26
  1522. package/dist/kit/figure-drag.mjs +53 -40
  1523. package/dist/kit/finance-viz/index.mjs +1 -1
  1524. package/dist/kit/finance-viz/plot-chart.mjs +13 -7
  1525. package/dist/kit/finance-viz/tradeoff-curve.mjs +10 -7
  1526. package/dist/kit/frame.mjs +1 -1
  1527. package/dist/kit/freq-tree.mjs +0 -1
  1528. package/dist/kit/gameshow.mjs +17 -6
  1529. package/dist/kit/geometry/bound-figure.mjs +7 -6
  1530. package/dist/kit/geometry/compass-construction-figure.d.mts +0 -1
  1531. package/dist/kit/geometry/compass-construction-figure.mjs +4 -4
  1532. package/dist/kit/geometry/cuboid-body.mjs +1 -1
  1533. package/dist/kit/geometry/cuboid-mirror-figure.d.mts +0 -1
  1534. package/dist/kit/geometry/cuboid-mirror-figure.mjs +2 -2
  1535. package/dist/kit/geometry/cuboid-planes-figure.d.mts +0 -1
  1536. package/dist/kit/geometry/cuboid-planes-figure.mjs +19 -6
  1537. package/dist/kit/geometry/folding-net-figure.d.mts +0 -1
  1538. package/dist/kit/geometry/folding-net-figure.mjs +3 -3
  1539. package/dist/kit/geometry/instrument-figure.d.mts +0 -1
  1540. package/dist/kit/geometry/instrument-figure.mjs +21 -5
  1541. package/dist/kit/geometry/projected-solid-body.mjs +2 -2
  1542. package/dist/kit/geometry/pyramid-mirror-figure.d.mts +0 -1
  1543. package/dist/kit/geometry/pyramid-mirror-figure.mjs +3 -3
  1544. package/dist/kit/geometry/solid-rotation-figure.d.mts +0 -1
  1545. package/dist/kit/geometry/solid-rotation-figure.mjs +3 -3
  1546. package/dist/kit/gravitation/section.mjs +2 -2
  1547. package/dist/kit/index.d.mts +45 -36
  1548. package/dist/kit/index.mjs +47 -38
  1549. package/dist/kit/instruments.mjs +185 -143
  1550. package/dist/kit/language/speaker-glyph.mjs +0 -1
  1551. package/dist/kit/lesson-questions.mjs +24 -3
  1552. package/dist/kit/logic-gates/display.mjs +0 -1
  1553. package/dist/kit/logic-gates/gate.mjs +7 -4
  1554. package/dist/kit/logic-gates/register.mjs +1 -3
  1555. package/dist/kit/magnetism/bench.mjs +1 -7
  1556. package/dist/kit/magnetism/fleming-hand.mjs +374 -0
  1557. package/dist/kit/magnetism/glyphs.d.mts +2 -7
  1558. package/dist/kit/magnetism/glyphs.mjs +82 -68
  1559. package/dist/kit/magnetism/index.d.mts +2 -2
  1560. package/dist/kit/magnetism/index.mjs +1 -1
  1561. package/dist/kit/magnetism/machine.d.mts +17 -5
  1562. package/dist/kit/magnetism/machine.mjs +123 -57
  1563. package/dist/kit/math/algebra-area-tiles.d.mts +7 -1
  1564. package/dist/kit/math/algebra-area-tiles.mjs +113 -16
  1565. package/dist/kit/math/algebra-balance.d.mts +0 -1
  1566. package/dist/kit/math/algebra-balance.mjs +165 -152
  1567. package/dist/kit/math/algebra-elimination-board.d.mts +0 -1
  1568. package/dist/kit/math/algebra-elimination-board.mjs +0 -1
  1569. package/dist/kit/math/index.d.mts +2 -1
  1570. package/dist/kit/math/index.mjs +2 -1
  1571. package/dist/kit/math/math-rail.mjs +2 -1
  1572. package/dist/kit/math/square-of-sum-grid.d.mts +26 -0
  1573. package/dist/kit/math/square-of-sum-grid.mjs +167 -0
  1574. package/dist/kit/molecules.mjs +0 -1
  1575. package/dist/kit/movable-dot.d.mts +2 -2
  1576. package/dist/kit/movable-dot.mjs +2 -2
  1577. package/dist/kit/networking/accelerator-card.mjs +1 -3
  1578. package/dist/kit/networking/access-glyphs.mjs +0 -2
  1579. package/dist/{domains/networking/_shared → kit/networking}/decision-scene.d.mts +1 -1
  1580. package/dist/{domains/networking/_shared → kit/networking}/decision-scene.mjs +10 -8
  1581. package/dist/kit/networking/failure-domain-map.mjs +0 -2
  1582. package/dist/kit/networking/index.mjs +2 -2
  1583. package/dist/kit/networking/infrastructure-glyphs.mjs +0 -2
  1584. package/dist/kit/networking/memory-budget-strip.mjs +1 -3
  1585. package/dist/kit/networking/primitives.d.mts +1 -2
  1586. package/dist/kit/networking/primitives.mjs +3 -4
  1587. package/dist/kit/networking/prompt-token-strip.mjs +1 -5
  1588. package/dist/kit/networking/release-glyphs.mjs +0 -1
  1589. package/dist/kit/networking/replica-fleet.d.mts +0 -1
  1590. package/dist/kit/networking/replica-fleet.mjs +0 -1
  1591. package/dist/kit/networking/request-outcome-strip.mjs +0 -1
  1592. package/dist/kit/networking/scene/buffer.mjs +2 -6
  1593. package/dist/kit/networking/scene/channel.d.mts +0 -1
  1594. package/dist/kit/networking/scene/channel.mjs +2 -4
  1595. package/dist/kit/networking/scene/control.d.mts +0 -1
  1596. package/dist/kit/networking/scene/control.mjs +8 -8
  1597. package/dist/kit/networking/scene/index.mjs +2 -2
  1598. package/dist/kit/networking/scene/media.mjs +1 -3
  1599. package/dist/kit/networking/scene/objects.mjs +16 -19
  1600. package/dist/kit/networking/scene/observability.mjs +0 -1
  1601. package/dist/kit/networking/scene/route.mjs +1 -3
  1602. package/dist/kit/networking/scene/switch.mjs +3 -3
  1603. package/dist/kit/networking/secret-glyphs.mjs +0 -1
  1604. package/dist/kit/networking/signal-glyphs.mjs +1 -3
  1605. package/dist/kit/networking/vpc-route-glyph.mjs +0 -2
  1606. package/dist/kit/number-response.mjs +1 -1
  1607. package/dist/kit/plane-grip.d.mts +1 -1
  1608. package/dist/kit/plane-grip.mjs +2 -1
  1609. package/dist/kit/play.mjs +1 -1
  1610. package/dist/kit/point-binding.d.mts +1 -1
  1611. package/dist/kit/predict.d.mts +1 -1
  1612. package/dist/kit/predict.mjs +2 -1
  1613. package/dist/kit/probability.mjs +0 -1
  1614. package/dist/kit/quantum/bloch-sphere.mjs +0 -1
  1615. package/dist/kit/reaction.mjs +0 -1
  1616. package/dist/kit/reasoning/claim-card.mjs +1 -3
  1617. package/dist/kit/receipt.mjs +2 -2
  1618. package/dist/kit/rich.mjs +1 -1
  1619. package/dist/kit/rule.d.mts +2 -1
  1620. package/dist/kit/rule.mjs +22 -13
  1621. package/dist/kit/scale.mjs +17 -16
  1622. package/dist/kit/scene/compare.mjs +210 -0
  1623. package/dist/kit/scene/context.d.mts +1 -1
  1624. package/dist/kit/scene/cutaway.mjs +202 -0
  1625. package/dist/kit/scene/explode.mjs +235 -0
  1626. package/dist/kit/scene/graph.d.mts +14 -2
  1627. package/dist/kit/scene/graph.mjs +100 -11
  1628. package/dist/kit/scene/index.mjs +16 -10
  1629. package/dist/kit/scene/loupe.mjs +252 -0
  1630. package/dist/kit/scene/materials.d.mts +132 -0
  1631. package/dist/kit/scene/materials.mjs +247 -0
  1632. package/dist/kit/scene/objects/balance.mjs +3 -4
  1633. package/dist/kit/scene/objects/bench.mjs +11 -13
  1634. package/dist/kit/scene/objects/block.d.mts +22 -36
  1635. package/dist/kit/scene/objects/block.mjs +394 -118
  1636. package/dist/kit/scene/objects/car.mjs +4 -4
  1637. package/dist/kit/scene/objects/charges.mjs +1 -2
  1638. package/dist/kit/scene/objects/clock.mjs +2 -3
  1639. package/dist/kit/scene/objects/dial.mjs +22 -29
  1640. package/dist/kit/scene/objects/energy.mjs +4 -5
  1641. package/dist/kit/scene/objects/fan.mjs +1 -2
  1642. package/dist/kit/scene/objects/forces.d.mts +5 -2
  1643. package/dist/kit/scene/objects/forces.mjs +4 -4
  1644. package/dist/kit/scene/objects/gauges.mjs +2 -15
  1645. package/dist/kit/scene/objects/instruments.mjs +10 -9
  1646. package/dist/kit/scene/objects/knob.mjs +146 -0
  1647. package/dist/kit/scene/objects/lift.mjs +0 -2
  1648. package/dist/kit/scene/objects/light-clock.mjs +4 -6
  1649. package/dist/kit/scene/objects/mechanics.mjs +21 -30
  1650. package/dist/kit/scene/objects/mechanisms.mjs +9 -9
  1651. package/dist/kit/scene/objects/observer.mjs +1 -2
  1652. package/dist/kit/scene/objects/optical-bench.mjs +8 -5
  1653. package/dist/kit/scene/objects/optical-signal.mjs +0 -1
  1654. package/dist/kit/scene/objects/parachute.mjs +1 -2
  1655. package/dist/kit/scene/objects/pendulum.mjs +6 -5
  1656. package/dist/kit/scene/objects/person.mjs +1 -2
  1657. package/dist/kit/scene/objects/piston.mjs +3 -4
  1658. package/dist/kit/scene/objects/projectiles.mjs +4 -5
  1659. package/dist/kit/scene/objects/replay.mjs +0 -1
  1660. package/dist/kit/scene/objects/rocket.mjs +1 -2
  1661. package/dist/kit/scene/objects/roller.mjs +1 -2
  1662. package/dist/kit/scene/objects/signed-bars.mjs +0 -1
  1663. package/dist/kit/scene/objects/spacecraft.mjs +0 -1
  1664. package/dist/kit/scene/objects/spectrum.mjs +0 -1
  1665. package/dist/kit/scene/objects/stand.mjs +4 -4
  1666. package/dist/kit/scene/objects/strike.mjs +1 -2
  1667. package/dist/kit/scene/objects/suspension.mjs +4 -5
  1668. package/dist/kit/scene/objects/tank.mjs +0 -1
  1669. package/dist/kit/scene/objects/thermometer.mjs +1 -2
  1670. package/dist/kit/scene/objects/top-vehicle.mjs +1 -2
  1671. package/dist/kit/scene/objects/train.mjs +3 -4
  1672. package/dist/kit/scene/objects/waves.mjs +73 -18
  1673. package/dist/kit/scene/river.mjs +102 -93
  1674. package/dist/kit/scene/scene.d.mts +0 -1
  1675. package/dist/kit/scene/scene.mjs +25 -29
  1676. package/dist/kit/scene/scenery.d.mts +0 -7
  1677. package/dist/kit/scene/scenery.mjs +12 -17
  1678. package/dist/kit/scene/tokens.d.mts +66 -8
  1679. package/dist/kit/scene/tokens.mjs +84 -33
  1680. package/dist/kit/scene/vectors.mjs +0 -1
  1681. package/dist/kit/scene/workbench.d.mts +2 -2
  1682. package/dist/kit/scene/workbench.mjs +5 -5
  1683. package/dist/kit/scene-settings.d.mts +3 -1
  1684. package/dist/kit/scene-settings.mjs +24 -16
  1685. package/dist/kit/scenes.d.mts +7 -1
  1686. package/dist/kit/scenes.mjs +53 -26
  1687. package/dist/kit/shell/context.d.mts +15 -1
  1688. package/dist/kit/shell/context.mjs +40 -8
  1689. package/dist/kit/shell/earned.mjs +13 -11
  1690. package/dist/kit/shell/index.d.mts +3 -3
  1691. package/dist/kit/shell/index.mjs +4 -4
  1692. package/dist/kit/shell/model-entry.mjs +38 -20
  1693. package/dist/kit/shell/model-note.mjs +52 -0
  1694. package/dist/kit/shell/note.mjs +3 -1
  1695. package/dist/kit/shell/parts.d.mts +3 -2
  1696. package/dist/kit/shell/parts.mjs +50 -31
  1697. package/dist/kit/shell/provider.d.mts +10 -1
  1698. package/dist/kit/shell/provider.mjs +52 -22
  1699. package/dist/kit/shell/question-evidence.mjs +6 -5
  1700. package/dist/kit/shell/scene-control.mjs +3 -3
  1701. package/dist/kit/shell/select-choices.mjs +7 -5
  1702. package/dist/kit/simulation/clock.mjs +3 -3
  1703. package/dist/kit/simulation/use-simulation.mjs +3 -3
  1704. package/dist/kit/space/bodies.mjs +2 -2
  1705. package/dist/kit/ticks.mjs +13 -4
  1706. package/dist/kit/transport.d.mts +10 -1
  1707. package/dist/kit/transport.mjs +21 -7
  1708. package/dist/kit/turn-surface.mjs +31 -24
  1709. package/dist/kit/vessel.mjs +0 -1
  1710. package/dist/kit/world/runtime.mjs +3 -3
  1711. package/dist/kit/world/world-scene.mjs +2 -2
  1712. package/dist/lab-def/define-lab.d.mts +6 -3
  1713. package/dist/lab-def/lab-props.mjs +2 -1
  1714. package/dist/lab-def/lab-runtime.d.mts +3 -1
  1715. package/dist/lab-def/lab-runtime.mjs +158 -67
  1716. package/dist/lab-def/runtime-load.mjs +35 -0
  1717. package/dist/lab-def/to-block.mjs +6 -1
  1718. package/dist/logic/LogicScene.mjs +16 -5
  1719. package/dist/logic/index.d.mts +1 -2
  1720. package/dist/logic/index.mjs +1 -2
  1721. package/dist/logic/registry.d.mts +5 -0
  1722. package/dist/logic/registry.mjs +33 -2
  1723. package/dist/logic/runtime/index.d.mts +1 -2
  1724. package/dist/logic/runtime/index.mjs +1 -2
  1725. package/dist/math/answer-accuracy/core.mjs +1 -1
  1726. package/dist/math/index.d.mts +2 -1
  1727. package/dist/math/interactive/preset.d.mts +1 -1
  1728. package/dist/math/interactive/preset.mjs +46 -24
  1729. package/dist/math/lines-in-space/index.mjs +1 -1
  1730. package/dist/math/mystery-bucket/asset.d.mts +3 -1
  1731. package/dist/math/mystery-bucket/asset.mjs +37 -12
  1732. package/dist/math/mystery-bucket/preset.d.mts +4 -4
  1733. package/dist/math/mystery-bucket/preset.mjs +4 -5
  1734. package/dist/ml/worlds/synthetic.mjs +1 -1
  1735. package/dist/model/controls.d.mts +4 -0
  1736. package/dist/model/define.d.mts +14 -0
  1737. package/dist/model/define.mjs +20 -1
  1738. package/dist/model/format.d.mts +33 -0
  1739. package/dist/model/format.mjs +76 -0
  1740. package/dist/model/index.d.mts +4 -2
  1741. package/dist/model/index.mjs +3 -1
  1742. package/dist/model/model-note.d.mts +16 -0
  1743. package/dist/model/model-note.mjs +34 -0
  1744. package/dist/model/money.d.mts +36 -0
  1745. package/dist/model/money.mjs +45 -0
  1746. package/dist/model/resolved-value.mjs +16 -0
  1747. package/dist/model/session.d.mts +3 -0
  1748. package/dist/model/session.mjs +7 -1
  1749. package/dist/networking/CellularScene.mjs +4 -3
  1750. package/dist/physics/constants.d.mts +12 -11
  1751. package/dist/physics/constants.mjs +27 -26
  1752. package/dist/physics/exponential/asset.mjs +7 -2
  1753. package/dist/physics/exponential/preset.mjs +60 -58
  1754. package/dist/physics/mechanics/presentation.mjs +8 -9
  1755. package/dist/physics/modern/shared/experiment-transport.mjs +3 -3
  1756. package/dist/physics/optics/eye-correction.mjs +2 -2
  1757. package/dist/physics/optics/imaging-world-scene.mjs +18 -14
  1758. package/dist/physics/optics/light-path-world-scene.mjs +4 -4
  1759. package/dist/physics/waves/wave-bench-scene.mjs +2 -2
  1760. package/dist/physics/waves/wave-bench-skins.mjs +11 -13
  1761. package/dist/registry/generated/packs/accounting.mjs +56 -0
  1762. package/dist/registry/generated/packs/chem.mjs +40 -0
  1763. package/dist/registry/generated/packs/circuits.mjs +8 -0
  1764. package/dist/registry/generated/packs/geometry.mjs +9 -0
  1765. package/dist/registry/generated/packs/ict.mjs +24 -0
  1766. package/dist/registry/generated/packs/math.mjs +20 -1
  1767. package/dist/registry/pack.d.mts +8 -0
  1768. package/dist/registry/registry.d.mts +25 -1
  1769. package/dist/registry/registry.mjs +22 -1
  1770. package/dist/runtime/index.d.mts +2 -2
  1771. package/dist/runtime/index.mjs +2 -2
  1772. package/dist/runtime/lab-goals.mjs +8 -3
  1773. package/dist/runtime/lab-keys.mjs +13 -15
  1774. package/dist/runtime/lab-viewport.mjs +29 -0
  1775. package/dist/runtime/use-control.d.mts +2 -2
  1776. package/dist/runtime/use-control.mjs +7 -5
  1777. package/dist/runtime/use-lab-view.d.mts +2 -0
  1778. package/dist/runtime/use-lab-view.mjs +1 -0
  1779. package/dist/runtime/use-lab.d.mts +6 -0
  1780. package/dist/runtime/use-lab.mjs +12 -6
  1781. package/dist/runtime/use-reveal.mjs +2 -2
  1782. package/dist/runtime/visibility.d.mts +32 -0
  1783. package/dist/runtime/visibility.mjs +80 -0
  1784. package/dist/schemas/activity-authoring.d.mts +78 -4
  1785. package/dist/schemas/activity-authoring.mjs +26 -0
  1786. package/dist/schemas/index.d.mts +4 -4
  1787. package/dist/schemas/lesson-questions.d.mts +22 -0
  1788. package/dist/schemas/lesson-questions.mjs +28 -10
  1789. package/dist/shared/fields.mjs +21 -1
  1790. package/dist/styles/manifest.mjs +714 -695
  1791. package/dist/testing/conformance.d.mts +8 -2
  1792. package/dist/testing/conformance.mjs +12 -4
  1793. package/dist/three/chemistry/atomic-orbital.d.mts +3 -6
  1794. package/dist/three/chemistry/atomic-orbital.mjs +5 -6
  1795. package/dist/three/chemistry/crystal-lattice.d.mts +2 -1
  1796. package/dist/three/chemistry/crystal-lattice.mjs +4 -1
  1797. package/dist/three/chemistry/molecular-geometry.d.mts +2 -1
  1798. package/dist/three/chemistry/molecular-geometry.mjs +4 -1
  1799. package/dist/three/chemistry/orbital-overlap.d.mts +2 -1
  1800. package/dist/three/chemistry/orbital-overlap.mjs +4 -1
  1801. package/dist/three/index.d.mts +2 -1
  1802. package/dist/three/index.mjs +2 -1
  1803. package/dist/three/math/solids-of-revolution.d.mts +3 -7
  1804. package/dist/three/math/solids-of-revolution.mjs +5 -7
  1805. package/dist/three/primitives.d.mts +11 -6
  1806. package/dist/three/primitives.mjs +21 -24
  1807. package/dist/three/studio.d.mts +102 -0
  1808. package/dist/three/studio.mjs +263 -0
  1809. package/dist/three/surface.mjs +14 -4
  1810. package/package.json +105 -29
  1811. package/styles/core/components.css +3 -7
  1812. package/styles/core/figure-interaction.css +10 -24
  1813. package/styles/core/interaction-scenes.css +10 -1
  1814. package/styles/core/primitives.css +1 -1
  1815. package/styles/core/runtime.css +8 -8
  1816. package/styles/core/shared.css +7 -10
  1817. package/styles/core/workbenches.css +11 -6
  1818. package/styles/domains/commerce.css +3 -0
  1819. package/styles/domains/parts/commerce-books.css +443 -0
  1820. package/styles/domains/parts/commerce-costing.css +341 -0
  1821. package/styles/domains/parts/commerce-foundation.css +517 -21
  1822. package/styles/domains/parts/commerce-household.css +379 -0
  1823. package/styles/domains/parts/commerce-statements.css +293 -0
  1824. package/styles/domains/parts/discrete-6.css +7 -0
  1825. package/styles/domains/parts/exam-practice.css +2 -1
  1826. package/styles/domains/parts/ict.css +235 -0
  1827. package/styles/domains/parts/math-1.css +139 -10
  1828. package/styles/domains/parts/math-7.css +35 -0
  1829. package/styles/domains.css +3 -0
  1830. package/styles/figure.css +64 -48
  1831. package/styles/runtime.css +5 -3
  1832. package/styles/scene.css +324 -100
  1833. package/styles/shell.css +61 -0
  1834. package/styles.css +3 -3
  1835. package/tailwind.css +12 -6
  1836. package/dist/algorithms/ListLab.d.mts +0 -54
  1837. package/dist/algorithms/ListLab.mjs +0 -692
  1838. package/dist/algorithms/TraceTransport.d.mts +0 -11
  1839. package/dist/algorithms/TraceTransport.mjs +0 -165
  1840. package/dist/blocks/lab-block.mjs +0 -87
  1841. package/dist/commerce/accounting/books/index.mjs +0 -8
  1842. package/dist/core/numeric.d.mts +0 -19
  1843. package/dist/core/numeric.mjs +0 -36
  1844. package/dist/core/rng.d.mts +0 -2
  1845. package/dist/core/rng.mjs +0 -3
  1846. package/dist/core/timeline.d.mts +0 -32
  1847. package/dist/core/timeline.mjs +0 -80
  1848. package/dist/discrete/core/combinatorics.d.mts +0 -45
  1849. package/dist/discrete/core/combinatorics.mjs +0 -100
  1850. package/dist/discrete/core/probability.d.mts +0 -28
  1851. package/dist/discrete/core/probability.mjs +0 -43
  1852. package/dist/discrete/core/rng.d.mts +0 -2
  1853. package/dist/discrete/core/rng.mjs +0 -3
  1854. package/dist/domains/discrete/venn/inclusionExclusion.d.mts +0 -17
  1855. package/dist/domains/discrete/venn/inclusionExclusion.mjs +0 -30
  1856. package/dist/kit/counting/index.mjs +0 -6
  1857. package/dist/kit/reasoning/index.mjs +0 -3
  1858. package/dist/logic/gates.d.mts +0 -4
  1859. package/dist/logic/gates.mjs +0 -32
  1860. package/dist/statistics/core/descriptive.d.mts +0 -34
  1861. package/dist/statistics/core/descriptive.mjs +0 -65
  1862. package/dist/statistics/core/index.d.mts +0 -3
  1863. package/dist/statistics/core/index.mjs +0 -4
  1864. package/dist/statistics/core/normal.d.mts +0 -20
  1865. package/dist/statistics/core/normal.mjs +0 -37
  1866. package/dist/statistics/index.d.mts +0 -4
  1867. package/dist/statistics/index.mjs +0 -5
@@ -0,0 +1,1448 @@
1
+ import { defineLabModel } from "../../../model/define.mjs";
2
+ import { formatMoney } from "../../../model/money.mjs";
3
+ import { isRefusal, refuse } from "../../../model/index.mjs";
4
+ import { z } from "zod";
5
+ import { parseAmount } from "@classytic/stage/math/answer";
6
+ import { EQUATION_TERMS, equationChange, termPosition } from "@classytic/stage/finance/accounting";
7
+
8
+ //#region src/domains/accounting/document-desk/model.ts
9
+ /**
10
+ * The document desk: the first page of the books, where an accountant decides what counts and what proves it.
11
+ *
12
+ * Three modes, one lab, the lesson picks with `mode`:
13
+ *
14
+ * - `sort`: event or transaction. One card at a time; the learner says whether it is a transaction. The equation
15
+ * then answers: a transaction moves its terms and both sides still agree; an event moves nothing.
16
+ * - `identify`: name the document. A document drawn as the NCTB book prints it, title hidden; the learner names
17
+ * its kind and, when it has two parties, who issued it. The feedback names the clue.
18
+ * - `fill`: fill a voucher. A short story; the learner picks the voucher type and fills its date, party, account
19
+ * head and amount, then checks. Each field is marked on its own, with a why for a wrong one.
20
+ * - `journal`: into the journals. A document drawn as in identify mode; the learner picks the journal it belongs in
21
+ * (purchases, sales, purchase returns, sales returns, cash receipts, cash payments or general), then fills that
22
+ * journal's row in the book's columns. The row lands in the journal; a journal whose documents are all in shows
23
+ * its total and the month-end posting its amount column names.
24
+ *
25
+ * Every word the learner reads as content (card text, reasons, document kinds, party names, field names, the
26
+ * equation's term names, feedback sentences) is a prop, so a Bangla lesson passes its own; the lab's buttons stay
27
+ * English. The equation check (`equationChange`) and reading a written amount (`parseAmount`, Bangla digits and
28
+ * lakh grouping included) come from stage.
29
+ */
30
+ const DOC_KINDS = [
31
+ "invoice",
32
+ "cash-memo",
33
+ "debit-note",
34
+ "credit-note",
35
+ "debit-voucher",
36
+ "credit-voucher"
37
+ ];
38
+ const FILL_FIELDS = [
39
+ "kind",
40
+ "date",
41
+ "party",
42
+ "account",
43
+ "amount"
44
+ ];
45
+ const KIND_LABEL = {
46
+ invoice: "Invoice",
47
+ "cash-memo": "Cash memo",
48
+ "debit-note": "Debit note",
49
+ "credit-note": "Credit note",
50
+ "debit-voucher": "Debit voucher",
51
+ "credit-voucher": "Credit voucher"
52
+ };
53
+ const KIND_CLUE = {
54
+ invoice: "Goods sold on credit, listed with quantity and rate, and the seller's name at the top: an invoice, sent by the seller.",
55
+ "cash-memo": "A sale paid for on the spot: a cash memo, given by the seller with the goods.",
56
+ "debit-note": "Goods sent back to the seller, and \"we have debited your account\": a debit note, sent by the buyer who returns them.",
57
+ "credit-note": "The seller accepts the returned goods, \"we have credited your account\": a credit note, sent by the seller.",
58
+ "debit-voucher": "Money paid out: a debit voucher, the business's own proof of a payment.",
59
+ "credit-voucher": "Money received: a credit voucher, the business's own proof of a receipt."
60
+ };
61
+ const TERM_LABEL = {
62
+ assets: "Assets",
63
+ liabilities: "Liabilities",
64
+ capital: "Capital",
65
+ drawings: "Drawings",
66
+ revenue: "Revenue",
67
+ expenses: "Expenses"
68
+ };
69
+ const FIELD_LABEL = {
70
+ particulars: "Particulars",
71
+ qty: "Qty",
72
+ rate: "Rate",
73
+ amount: "Amount",
74
+ total: "Total",
75
+ less: "Less",
76
+ to: "To",
77
+ date: "Date",
78
+ ref: "No.",
79
+ party: "Name",
80
+ paidTo: "Paid to",
81
+ receivedFrom: "Received from",
82
+ account: "Account head",
83
+ voucherType: "Voucher",
84
+ terms: "Terms",
85
+ /** The general journal's account pickers: named for the account, not the amount column above them. */
86
+ debitAccount: "Debit account",
87
+ creditAccount: "Credit account"
88
+ };
89
+ const PHRASE = {
90
+ transaction: "Transaction",
91
+ event: "Not a transaction",
92
+ nothingMoved: "Nothing in the equation moved.",
93
+ stillEqual: "Both sides moved by the same amount, so they still agree.",
94
+ left: "Left side",
95
+ right: "Right side",
96
+ kindQuestion: "What is this document?",
97
+ issuerQuestion: "Who issued it?",
98
+ journalQuestion: "Which journal does it go in?",
99
+ notThisJournal: "Not this journal.",
100
+ monthEnd: "Posted at month end:"
101
+ };
102
+ const JOURNALS = [
103
+ "purchases",
104
+ "sales",
105
+ "purchase-returns",
106
+ "sales-returns",
107
+ "cash-receipts",
108
+ "cash-payments",
109
+ "general"
110
+ ];
111
+ const JOURNAL_FIELDS = [
112
+ "date",
113
+ "party",
114
+ "ref",
115
+ "debit",
116
+ "amount"
117
+ ];
118
+ /** The fields a journal's row asks for, in its column order. */
119
+ function journalFields(journal) {
120
+ if (journal === "general") return [
121
+ "date",
122
+ "debit",
123
+ "party",
124
+ "amount"
125
+ ];
126
+ if (journal === "cash-receipts" || journal === "cash-payments") return [
127
+ "date",
128
+ "party",
129
+ "amount"
130
+ ];
131
+ return [
132
+ "date",
133
+ "party",
134
+ "ref",
135
+ "amount"
136
+ ];
137
+ }
138
+ const JOURNAL_LABEL = {
139
+ purchases: "Purchases journal",
140
+ sales: "Sales journal",
141
+ "purchase-returns": "Purchase returns journal",
142
+ "sales-returns": "Sales returns journal",
143
+ "cash-receipts": "Cash receipts journal",
144
+ "cash-payments": "Cash payments journal",
145
+ general: "General journal"
146
+ };
147
+ const JOURNAL_CLUE = {
148
+ purchases: "Goods for resale bought on credit, entered from the supplier's invoice.",
149
+ sales: "Goods sold on credit, entered from the invoice the business sends its customer.",
150
+ "purchase-returns": "Goods sent back to a supplier, entered from the debit note the business sends.",
151
+ "sales-returns": "Goods a customer sends back, entered from the credit note the business issues.",
152
+ "cash-receipts": "Every receipt of cash.",
153
+ "cash-payments": "Every payment of cash.",
154
+ general: "Anything no special journal takes, such as an asset bought on credit for the business to use."
155
+ };
156
+ /**
157
+ * Column headings, as the book prints them (formats.md, Journal ch6). In a special journal `debit` and `credit`
158
+ * are the two lines of its one amount column, which name its month-end posting; in the general journal they head
159
+ * its two amount columns and `dr`/`cr` end its debit and credit lines.
160
+ */
161
+ const HEADING_KEYS = [
162
+ "date",
163
+ "party",
164
+ "terms",
165
+ "ref",
166
+ "folio",
167
+ "debit",
168
+ "credit",
169
+ "dr",
170
+ "cr"
171
+ ];
172
+ const JOURNAL_HEADING = {
173
+ purchases: {
174
+ date: "Date",
175
+ party: "Credit account",
176
+ terms: "Terms",
177
+ ref: "Invoice No.",
178
+ folio: "L.F.",
179
+ debit: "Purchases A/c Dr",
180
+ credit: "Accounts payable A/c Cr"
181
+ },
182
+ sales: {
183
+ date: "Date",
184
+ party: "Debit account",
185
+ ref: "Invoice No.",
186
+ folio: "L.F.",
187
+ debit: "Accounts receivable A/c Dr",
188
+ credit: "Sales A/c Cr"
189
+ },
190
+ "purchase-returns": {
191
+ date: "Date",
192
+ party: "Debit account",
193
+ ref: "Debit note No.",
194
+ folio: "L.F.",
195
+ debit: "Accounts payable A/c Dr",
196
+ credit: "Purchase returns A/c Cr"
197
+ },
198
+ "sales-returns": {
199
+ date: "Date",
200
+ party: "Credit account",
201
+ ref: "Credit note No.",
202
+ folio: "L.F.",
203
+ debit: "Sales returns A/c Dr",
204
+ credit: "Accounts receivable A/c Cr"
205
+ },
206
+ "cash-receipts": {
207
+ date: "Date",
208
+ party: "Credit account",
209
+ folio: "L.F.",
210
+ debit: "Cash A/c Dr"
211
+ },
212
+ "cash-payments": {
213
+ date: "Date",
214
+ party: "Debit account",
215
+ folio: "L.F.",
216
+ credit: "Cash A/c Cr"
217
+ },
218
+ general: {
219
+ date: "Date",
220
+ party: "Particulars",
221
+ folio: "L.F.",
222
+ debit: "Debit",
223
+ credit: "Credit",
224
+ dr: "Dr",
225
+ cr: "Cr"
226
+ }
227
+ };
228
+ /** Which documents a journal can take, seen from the business (`ours`: the business issued it). */
229
+ function journalTakes(journal, kind, ours) {
230
+ switch (journal) {
231
+ case "purchases": return kind === "invoice" && !ours;
232
+ case "sales": return kind === "invoice" && ours;
233
+ case "purchase-returns": return kind === "debit-note" && ours;
234
+ case "sales-returns": return kind === "credit-note" && ours;
235
+ case "cash-receipts": return kind === "credit-voucher" || kind === "cash-memo" && ours;
236
+ case "cash-payments": return kind === "debit-voucher" || kind === "cash-memo" && !ours;
237
+ case "general": return true;
238
+ }
239
+ }
240
+ const DEFAULT_CARDS = [
241
+ {
242
+ id: "fridge",
243
+ text: "The shop buys a fridge for $32,000 in cash.",
244
+ transaction: true,
245
+ effects: [{
246
+ term: "assets",
247
+ label: "Fridge",
248
+ delta: 32e3
249
+ }, {
250
+ term: "assets",
251
+ label: "Cash",
252
+ delta: -32e3
253
+ }],
254
+ reason: "It changes what the business owns, and it can be measured in money."
255
+ },
256
+ {
257
+ id: "order",
258
+ text: "A customer phones to order $5,000 of goods for next week.",
259
+ transaction: false,
260
+ reason: "An order is only a promise. No goods or money have moved yet."
261
+ },
262
+ {
263
+ id: "computer",
264
+ text: "The shop buys a computer on credit from Tech Mart for $45,000.",
265
+ transaction: true,
266
+ effects: [{
267
+ term: "assets",
268
+ label: "Computer",
269
+ delta: 45e3
270
+ }, {
271
+ term: "liabilities",
272
+ label: "Tech Mart",
273
+ delta: 45e3
274
+ }],
275
+ reason: "An asset came in and the shop now owes Tech Mart. Paying later still counts."
276
+ },
277
+ {
278
+ id: "hire",
279
+ text: "The owner hires a cashier who starts work next month.",
280
+ transaction: false,
281
+ reason: "No work has been done and nothing is owed yet, so the business has not changed."
282
+ },
283
+ {
284
+ id: "rent",
285
+ text: "The shop pays this month's rent, $4,000, in cash.",
286
+ transaction: true,
287
+ effects: [{
288
+ term: "assets",
289
+ label: "Cash",
290
+ delta: -4e3
291
+ }, {
292
+ term: "expenses",
293
+ label: "Rent",
294
+ delta: 4e3
295
+ }],
296
+ reason: "Cash left the business to pay for something it used up: an expense."
297
+ }
298
+ ];
299
+ const DEFAULT_DOCUMENTS = [
300
+ {
301
+ id: "sale-on-credit",
302
+ kind: "invoice",
303
+ from: "Green Leaf Traders",
304
+ to: "Mitu Stationers",
305
+ date: "5 March",
306
+ ref: "214",
307
+ rows: [{
308
+ label: "Exercise books",
309
+ qty: 200,
310
+ rate: 40,
311
+ amount: 8e3
312
+ }, {
313
+ label: "Gel pens",
314
+ qty: 100,
315
+ rate: 15,
316
+ amount: 1500
317
+ }],
318
+ less: [{
319
+ label: "Trade discount 5%",
320
+ amount: 475
321
+ }],
322
+ total: 9025,
323
+ note: "Payment due within 30 days."
324
+ },
325
+ {
326
+ id: "counter-sale",
327
+ kind: "cash-memo",
328
+ from: "Mitu Stationers",
329
+ to: "Rafi Ahmed",
330
+ date: "6 March",
331
+ ref: "088",
332
+ rows: [{
333
+ label: "Geometry box",
334
+ qty: 2,
335
+ rate: 250,
336
+ amount: 500
337
+ }, {
338
+ label: "Notebooks",
339
+ qty: 4,
340
+ rate: 60,
341
+ amount: 240
342
+ }],
343
+ total: 740,
344
+ note: "Paid in cash. Thank you!"
345
+ },
346
+ {
347
+ id: "books-returned",
348
+ kind: "debit-note",
349
+ from: "Mitu Stationers",
350
+ to: "Green Leaf Traders",
351
+ date: "9 March",
352
+ ref: "12",
353
+ rows: [{
354
+ label: "Exercise books returned, torn covers",
355
+ qty: 20,
356
+ rate: 40,
357
+ amount: 800
358
+ }],
359
+ total: 800,
360
+ note: "We have debited your account with the above amount."
361
+ },
362
+ {
363
+ id: "return-accepted",
364
+ kind: "credit-note",
365
+ from: "Green Leaf Traders",
366
+ to: "Mitu Stationers",
367
+ date: "11 March",
368
+ ref: "31",
369
+ rows: [{
370
+ label: "Exercise books returned, torn covers",
371
+ qty: 20,
372
+ rate: 40,
373
+ amount: 800
374
+ }],
375
+ total: 800,
376
+ note: "We have credited your account with the above amount."
377
+ },
378
+ {
379
+ id: "power-bill",
380
+ kind: "debit-voucher",
381
+ from: "Mitu Stationers",
382
+ to: "City Power Ltd",
383
+ date: "14 March",
384
+ ref: "7",
385
+ rows: [{
386
+ label: "Electricity bill for March",
387
+ amount: 2400
388
+ }],
389
+ total: 2400,
390
+ note: "Approved by the manager."
391
+ }
392
+ ];
393
+ /** journal mode: one month of Mitu Stationers' documents (two purchases, so a total appears mid-way). */
394
+ const DEFAULT_JOURNAL_DOCUMENTS = [
395
+ {
396
+ id: "stock-bought",
397
+ kind: "invoice",
398
+ from: "Green Leaf Traders",
399
+ to: "Mitu Stationers",
400
+ date: "5 March",
401
+ ref: "214",
402
+ rows: [{
403
+ label: "Exercise books",
404
+ qty: 200,
405
+ rate: 40,
406
+ amount: 8e3
407
+ }, {
408
+ label: "Gel pens",
409
+ qty: 100,
410
+ rate: 15,
411
+ amount: 1500
412
+ }],
413
+ less: [{
414
+ label: "Trade discount 5%",
415
+ amount: 475
416
+ }],
417
+ total: 9025,
418
+ terms: "2/10, net 30",
419
+ journal: "purchases"
420
+ },
421
+ {
422
+ id: "school-order",
423
+ kind: "invoice",
424
+ from: "Mitu Stationers",
425
+ to: "Lake View School",
426
+ date: "8 March",
427
+ ref: "61",
428
+ rows: [{
429
+ label: "Drawing books",
430
+ qty: 50,
431
+ rate: 80,
432
+ amount: 4e3
433
+ }],
434
+ total: 4e3,
435
+ terms: "net 30",
436
+ journal: "sales"
437
+ },
438
+ {
439
+ id: "torn-books",
440
+ kind: "debit-note",
441
+ from: "Mitu Stationers",
442
+ to: "Green Leaf Traders",
443
+ date: "9 March",
444
+ ref: "12",
445
+ rows: [{
446
+ label: "Exercise books returned, torn covers",
447
+ qty: 20,
448
+ rate: 40,
449
+ amount: 800
450
+ }],
451
+ total: 800,
452
+ journal: "purchase-returns"
453
+ },
454
+ {
455
+ id: "school-return",
456
+ kind: "credit-note",
457
+ from: "Mitu Stationers",
458
+ to: "Lake View School",
459
+ date: "12 March",
460
+ ref: "5",
461
+ rows: [{
462
+ label: "Drawing books returned, wrong size",
463
+ qty: 5,
464
+ rate: 80,
465
+ amount: 400
466
+ }],
467
+ total: 400,
468
+ journal: "sales-returns"
469
+ },
470
+ {
471
+ id: "shop-fridge",
472
+ kind: "invoice",
473
+ from: "Cool Home Electronics",
474
+ to: "Mitu Stationers",
475
+ date: "15 March",
476
+ ref: "77",
477
+ rows: [{
478
+ label: "Fridge for the shop",
479
+ qty: 1,
480
+ rate: 32e3,
481
+ amount: 32e3
482
+ }],
483
+ total: 32e3,
484
+ terms: "net 60",
485
+ journal: "general",
486
+ debit: "Fridge",
487
+ options: { debit: [
488
+ "Fridge",
489
+ "Purchases",
490
+ "Cash"
491
+ ] },
492
+ why: { journal: "Kept for the shop to use, not stock to resell." }
493
+ },
494
+ {
495
+ id: "paper-bought",
496
+ kind: "invoice",
497
+ from: "Paper House",
498
+ to: "Mitu Stationers",
499
+ date: "18 March",
500
+ ref: "388",
501
+ rows: [{
502
+ label: "Printing paper (reams)",
503
+ qty: 20,
504
+ rate: 300,
505
+ amount: 6e3
506
+ }],
507
+ total: 6e3,
508
+ terms: "net 30",
509
+ journal: "purchases"
510
+ }
511
+ ];
512
+ const DEFAULT_VOUCHERS = [{
513
+ story: "On 12 March, Mitu Stationers paid $1,800 in cash to Bright Cleaners for cleaning the shop.",
514
+ kind: "debit-voucher",
515
+ business: "Mitu Stationers",
516
+ fields: {
517
+ date: "12 March",
518
+ party: "Bright Cleaners",
519
+ account: "Cleaning expenses",
520
+ amount: 1800
521
+ },
522
+ options: {
523
+ date: [
524
+ "10 March",
525
+ "12 March",
526
+ "15 March"
527
+ ],
528
+ party: ["Bright Cleaners", "Mitu Stationers"],
529
+ account: [
530
+ "Cleaning expenses",
531
+ "Cash",
532
+ "Accounts receivable",
533
+ "Sales"
534
+ ]
535
+ },
536
+ why: {}
537
+ }, {
538
+ story: "On 15 March, Mitu Stationers received $5,000 in cash from Rafi Ahmed, who owed the shop for goods.",
539
+ kind: "credit-voucher",
540
+ business: "Mitu Stationers",
541
+ fields: {
542
+ date: "15 March",
543
+ party: "Rafi Ahmed",
544
+ account: "Accounts receivable",
545
+ amount: 5e3
546
+ },
547
+ options: {
548
+ date: [
549
+ "12 March",
550
+ "15 March",
551
+ "20 March"
552
+ ],
553
+ party: ["Rafi Ahmed", "Mitu Stationers"],
554
+ account: [
555
+ "Cleaning expenses",
556
+ "Cash",
557
+ "Accounts receivable",
558
+ "Sales"
559
+ ]
560
+ },
561
+ why: {}
562
+ }];
563
+ const text = (max = 240) => z.string().trim().min(1).max(max);
564
+ const id = z.string().trim().min(1).max(40).regex(/^[a-z0-9-]+$/, "ids are lower-case words joined by hyphens");
565
+ const money = z.number().finite().nonnegative();
566
+ const termSchema = z.enum([
567
+ "assets",
568
+ "liabilities",
569
+ "capital",
570
+ "drawings",
571
+ "revenue",
572
+ "expenses"
573
+ ]);
574
+ const kindSchema = z.enum(DOC_KINDS);
575
+ const partial = (keys) => z.object(Object.fromEntries(keys.map((k) => [k, text().optional()])));
576
+ const choiceList = z.array(text(80)).min(2).max(8).optional();
577
+ const cardSchema = z.object({
578
+ id,
579
+ text: text(),
580
+ transaction: z.boolean(),
581
+ effects: z.array(z.object({
582
+ term: termSchema,
583
+ label: text(60),
584
+ delta: z.number().finite().refine((v) => v !== 0, "a change cannot be zero")
585
+ })).max(6).optional(),
586
+ reason: text()
587
+ });
588
+ const documentSchema = z.object({
589
+ id,
590
+ kind: kindSchema,
591
+ from: text(80),
592
+ to: text(80).optional(),
593
+ date: text(40).optional(),
594
+ ref: text(40).optional(),
595
+ rows: z.array(z.object({
596
+ label: text(80),
597
+ qty: z.number().finite().positive().optional(),
598
+ rate: money.optional(),
599
+ amount: money
600
+ })).min(1).max(8),
601
+ less: z.array(z.object({
602
+ label: text(80),
603
+ amount: money
604
+ })).max(3).optional(),
605
+ total: money,
606
+ terms: text(40).optional(),
607
+ note: text().optional(),
608
+ clue: text().optional(),
609
+ journal: z.enum(JOURNALS).optional(),
610
+ why: z.union([text(), partial(["journal", ...JOURNAL_FIELDS])]).optional(),
611
+ debit: text(80).optional(),
612
+ credit: text(80).optional(),
613
+ options: z.object({
614
+ date: choiceList,
615
+ party: choiceList,
616
+ ref: choiceList,
617
+ debit: choiceList
618
+ }).optional()
619
+ });
620
+ const voucherSchema = z.object({
621
+ story: text(400),
622
+ kind: z.enum(["debit-voucher", "credit-voucher"]),
623
+ business: text(80).optional(),
624
+ fields: z.object({
625
+ date: text(40),
626
+ party: text(80),
627
+ account: text(80),
628
+ amount: money.positive()
629
+ }),
630
+ options: z.object({
631
+ date: choiceList,
632
+ party: choiceList,
633
+ account: choiceList
634
+ }).default({}),
635
+ why: partial(FILL_FIELDS).default({})
636
+ });
637
+ const documentDeskParamsSchema = z.object({
638
+ mode: z.enum([
639
+ "sort",
640
+ "identify",
641
+ "fill",
642
+ "journal"
643
+ ]).default("sort").describe("sort: event or transaction; identify: name the document; fill: fill a voucher; journal: enter documents in the journals"),
644
+ cards: z.array(cardSchema).min(1).max(12).default(DEFAULT_CARDS).describe("sort mode: { id, text, transaction, effects?: [{ term, label, delta }], reason }, one at a time"),
645
+ documents: z.array(documentSchema).min(1).max(8).optional().describe("identify and journal modes: { id, kind, from, to?, date?, ref?, rows: [{ label, qty?, rate?, amount }], less?, total, terms?, note?, clue?; journal mode also journal, why? (text, or { journal?, date?, party?, ref?, debit?, amount? }), debit? and credit? (general journal only), options? { date?, party?, ref?, debit? } }. Each mode has its own default set."),
646
+ business: text(80).optional().describe("journal mode: the business whose books these are; left out, it is the one name on every document"),
647
+ journalLabels: partial(JOURNALS).default({}).describe("journal mode: each journal as the lesson names it"),
648
+ journalHeadings: z.object(Object.fromEntries(JOURNALS.map((j) => [j, partial(HEADING_KEYS).optional()]))).default({}).describe("journal mode: per journal, its column headings { date, party, terms, ref, folio, debit, credit, dr, cr }; a special journal's debit/credit are its amount column's two lines"),
649
+ journalClues: partial(JOURNALS).default({}).describe("journal mode: what each journal takes, the feedback when it is picked"),
650
+ kinds: z.array(kindSchema).min(2).max(6).default([...DOC_KINDS]).describe("identify mode: the document kinds offered as answers, in this order"),
651
+ vouchers: z.array(voucherSchema).min(1).max(6).default(DEFAULT_VOUCHERS).describe("fill mode: { story, kind, business?, fields: { date, party, account, amount }, options?: { date?, party?, account? }, why? }"),
652
+ accounts: z.array(text(80)).max(8).default([]).describe("fill mode: account heads to choose from when a voucher gives none of its own; journal mode: added to the general journal debit choices"),
653
+ kindLabels: partial(DOC_KINDS).default({}).describe("each document kind as the lesson names it"),
654
+ kindClues: partial(DOC_KINDS).default({}).describe("the clue the feedback names for each kind"),
655
+ termLabels: partial(EQUATION_TERMS).default({}).describe("each equation term's name as the lesson writes it"),
656
+ fieldLabels: partial(Object.keys(FIELD_LABEL)).default({}).describe("words printed on documents and the voucher form: particulars, qty, rate, amount, paidTo, …"),
657
+ phrases: partial(Object.keys(PHRASE)).default({}).describe("answer names and feedback sentences: transaction, event, nothingMoved, stillEqual, …"),
658
+ currency: z.string().min(1).max(6).default("$").describe("printed before amounts; Tk groups in lakhs")
659
+ });
660
+ const BLANK = {
661
+ kind: "",
662
+ date: "",
663
+ party: "",
664
+ account: "",
665
+ amount: "",
666
+ ref: ""
667
+ };
668
+ const money$ = (s, v) => formatMoney(v, { currency: s.currency });
669
+ /** A change as the equation shows it: "+$32,000" or "−$32,000". */
670
+ function signedMoney(currency, v) {
671
+ return `${v < 0 ? "−" : "+"}${formatMoney(Math.abs(v), { currency })}`;
672
+ }
673
+ function sameText(a, b) {
674
+ const norm = (x) => x.trim().replace(/\s+/g, " ").toLowerCase();
675
+ return norm(a) === norm(b);
676
+ }
677
+ function amountMark(written, answer) {
678
+ if (written.trim() === "") return "wrong";
679
+ const value = parseAmount(written);
680
+ if (isRefusal(value)) return "unreadable";
681
+ return Math.abs(value - answer) < .005 ? "right" : "wrong";
682
+ }
683
+ function fieldMark(v, draft, field) {
684
+ if (field === "amount") return amountMark(draft.amount, v.fields.amount);
685
+ const answer = field === "kind" ? v.kind : v.fields[field];
686
+ return sameText(draft[field], answer) ? "right" : "wrong";
687
+ }
688
+ function unionOf(values) {
689
+ return [...new Set(values.map((x) => x.trim()))];
690
+ }
691
+ const draftKey = (f) => f === "debit" ? "account" : f;
692
+ function journalMark(e, draft, field) {
693
+ if (field === "amount") return amountMark(draft.amount, e.answer.amount);
694
+ return sameText(draft[draftKey(field)], e.answer[field]) ? "right" : "wrong";
695
+ }
696
+ function booksOf(s, st) {
697
+ const landed = (i) => i < st.index || i === st.index && st.done;
698
+ return JOURNALS.flatMap((journal) => {
699
+ const all = s.entries.map((e, i) => ({
700
+ e,
701
+ i
702
+ })).filter(({ e }) => e.journal === journal);
703
+ if (all.length === 0) return [];
704
+ const rows = all.filter(({ i }) => landed(i)).map(({ e }) => ({
705
+ id: e.id,
706
+ date: e.answer.date,
707
+ party: e.answer.party,
708
+ ref: e.answer.ref,
709
+ debit: e.answer.debit,
710
+ terms: e.terms,
711
+ amount: e.answer.amount
712
+ }));
713
+ return [{
714
+ journal,
715
+ rows,
716
+ complete: rows.length === all.length,
717
+ total: rows.reduce((sum, r) => sum + r.amount, 0)
718
+ }];
719
+ });
720
+ }
721
+ /** journal: the row is open (the right journal is picked) and its journal has this column. */
722
+ function rowAsks(s, st, field) {
723
+ const e = s.mode === "journal" ? s.entries[st.index] : undefined;
724
+ return !!e && st.pick === e.journal && e.fields.includes(field);
725
+ }
726
+ /** A row field's name: its column heading in the journal (the general journal's credit line for `party`). */
727
+ function journalFieldLabel(s, journal, field) {
728
+ const h = s.journalHeadings[journal];
729
+ switch (field) {
730
+ case "date": return h.date;
731
+ case "party": return journal === "general" ? s.labels.creditAccount : h.party;
732
+ case "ref": return h.ref ?? s.labels.ref;
733
+ case "debit": return journal === "general" ? s.labels.debitAccount : h.debit ?? s.labels.account;
734
+ case "amount": return s.labels.amount;
735
+ }
736
+ }
737
+ function rowLabel(s, st, field) {
738
+ return journalFieldLabel(s, s.entries[st.index]?.journal ?? "purchases", field);
739
+ }
740
+ const documentDeskModel = defineLabModel({
741
+ id: "document-desk",
742
+ params: documentDeskParamsSchema,
743
+ resolve(p) {
744
+ const termLabel = (t) => p.termLabels[t] ?? TERM_LABEL[t];
745
+ const kindLabels = Object.fromEntries(DOC_KINDS.map((k) => [k, p.kindLabels[k] ?? KIND_LABEL[k]]));
746
+ const labels = {
747
+ ...FIELD_LABEL,
748
+ ...p.fieldLabels
749
+ };
750
+ const phrases = {
751
+ ...PHRASE,
752
+ ...p.phrases
753
+ };
754
+ const unique = (ids) => new Set(ids).size === ids.length;
755
+ if (!unique(p.cards.map((c) => c.id))) return refuse("duplicate-id", "Each card needs its own id.");
756
+ const cards = [];
757
+ for (const card of p.cards) {
758
+ const effects = card.effects ?? [];
759
+ if (!card.transaction && effects.length > 0) {
760
+ return refuse("event-has-effects", `"${card.id}" is not a transaction, so nothing in the equation can move: remove its effects.`);
761
+ }
762
+ if (card.transaction && effects.length === 0) {
763
+ return refuse("transaction-needs-effects", `"${card.id}" is a transaction: give the terms it moves.`);
764
+ }
765
+ const moved = equationChange(effects.map((e) => ({
766
+ term: e.term,
767
+ delta: e.delta
768
+ })));
769
+ if (!moved.balanced) {
770
+ return refuse("effects-unbalanced", `"${card.id}" moves the left side by ${moved.left} and the right side by ${moved.right}; a transaction keeps them equal.`);
771
+ }
772
+ cards.push({
773
+ id: card.id,
774
+ text: card.text,
775
+ transaction: card.transaction,
776
+ reason: card.reason,
777
+ effects: effects.map((e) => ({
778
+ term: e.term,
779
+ termLabel: termLabel(e.term),
780
+ side: termPosition(e.term) === "left" ? "left" : "right",
781
+ label: e.label,
782
+ delta: e.delta
783
+ })),
784
+ moved: {
785
+ left: moved.left,
786
+ right: moved.right
787
+ }
788
+ });
789
+ }
790
+ const docs = p.documents ?? (p.mode === "journal" ? DEFAULT_JOURNAL_DOCUMENTS : DEFAULT_DOCUMENTS);
791
+ if (!unique(docs.map((d) => d.id))) return refuse("duplicate-id", "Each document needs its own id.");
792
+ if (!unique(p.kinds)) return refuse("duplicate-kind", "Offer each document kind once.");
793
+ const documents = [];
794
+ for (const doc of docs) {
795
+ if (!p.kinds.includes(doc.kind)) {
796
+ return refuse("kind-not-offered", `"${doc.id}" is a ${doc.kind}, which is not among the kinds offered.`);
797
+ }
798
+ if (doc.to !== undefined && sameText(doc.to, doc.from)) {
799
+ return refuse("same-parties", `"${doc.id}" names ${doc.from} as both parties.`);
800
+ }
801
+ for (const row of doc.rows) {
802
+ if (row.qty !== undefined && row.rate !== undefined && Math.abs(row.qty * row.rate - row.amount) >= .005) {
803
+ return refuse("row-mismatch", `"${doc.id}": ${row.label} is ${row.qty} × ${row.rate}, not ${row.amount}.`);
804
+ }
805
+ }
806
+ const gross = doc.rows.reduce((sum, r) => sum + r.amount, 0);
807
+ const less = (doc.less ?? []).reduce((sum, r) => sum + r.amount, 0);
808
+ if (Math.abs(gross - less - doc.total) >= .005) {
809
+ return refuse("total-mismatch", `"${doc.id}": the rows come to ${gross - less}, not ${doc.total}.`);
810
+ }
811
+ documents.push({
812
+ ...doc,
813
+ title: kindLabels[doc.kind],
814
+ clueText: doc.clue ?? p.kindClues[doc.kind] ?? KIND_CLUE[doc.kind]
815
+ });
816
+ }
817
+ const journalLabels = Object.fromEntries(JOURNALS.map((j) => [j, p.journalLabels[j] ?? JOURNAL_LABEL[j]]));
818
+ const journalHeadings = Object.fromEntries(JOURNALS.map((j) => [j, {
819
+ ...JOURNAL_HEADING[j],
820
+ ...p.journalHeadings[j]
821
+ }]));
822
+ const journalClues = Object.fromEntries(JOURNALS.map((j) => [j, p.journalClues[j] ?? JOURNAL_CLUE[j]]));
823
+ let business = p.business ?? "";
824
+ const entries = [];
825
+ if (p.mode === "journal") {
826
+ const missing = documents.find((d) => d.journal === undefined);
827
+ if (missing) {
828
+ return refuse("needs-journal", `"${missing.id}" needs a journal: purchases, sales, purchase-returns, sales-returns, cash-receipts, cash-payments or general.`);
829
+ }
830
+ if (!business) {
831
+ const names = unionOf(documents.flatMap((d) => [d.from, ...d.to ? [d.to] : []]));
832
+ const everywhere = names.filter((n) => documents.every((d) => sameText(d.from, n) || d.to !== undefined && sameText(d.to, n)));
833
+ if (everywhere.length !== 1) {
834
+ return refuse("business-unclear", "Name the business whose books these are: give `business` (no single name is on every document).");
835
+ }
836
+ business = everywhere[0];
837
+ }
838
+ const needsRef = (j) => journalFields(j).includes("ref");
839
+ const generalCredit = (d, other) => d.credit ?? other;
840
+ const otherOf = (d) => sameText(d.from, business) ? d.to : d.to !== undefined && sameText(d.to, business) ? d.from : undefined;
841
+ for (const d of documents) {
842
+ const journal = d.journal;
843
+ const ours = sameText(d.from, business);
844
+ if (!ours && (d.to === undefined || !sameText(d.to, business))) {
845
+ return refuse("business-not-party", `"${d.id}" is not to or from ${business}.`);
846
+ }
847
+ if (!journalTakes(journal, d.kind, ours)) {
848
+ return refuse("journal-kind-mismatch", `"${d.id}" is a ${d.kind} ${ours ? "issued by" : "received by"} ${business}; the ${journal} journal does not take it.`);
849
+ }
850
+ if (!d.date) return refuse("needs-date", `"${d.id}" needs a date: its row starts with one.`);
851
+ if (needsRef(journal) && !d.ref) {
852
+ return refuse("needs-ref", `"${d.id}" needs a ref: the ${journal} journal has a number column.`);
853
+ }
854
+ if (journal !== "general" && (d.debit !== undefined || d.credit !== undefined)) {
855
+ return refuse("accounts-outside-general", `"${d.id}": debit and credit are for the general journal; the ${journal} journal's column names them.`);
856
+ }
857
+ if (journal === "general" && d.debit === undefined) {
858
+ return refuse("needs-debit", `"${d.id}" goes in the general journal: give the account it debits.`);
859
+ }
860
+ if (otherOf(d) === undefined && !(journal === "general" && d.credit !== undefined)) {
861
+ return refuse("needs-party", `"${d.id}" needs the other party: give \`to\`.`);
862
+ }
863
+ }
864
+ const general = documents.filter((d) => d.journal === "general");
865
+ const defaults = {
866
+ date: unionOf(documents.map((d) => d.date)),
867
+ party: unionOf([...documents.flatMap((d) => [d.from, ...d.to ? [d.to] : []]), ...general.flatMap((d) => d.credit ? [d.credit] : [])]),
868
+ ref: unionOf(documents.flatMap((d) => d.ref ? [d.ref] : [])),
869
+ debit: unionOf([...general.map((d) => d.debit), ...p.accounts])
870
+ };
871
+ for (const d of documents) {
872
+ const journal = d.journal;
873
+ const heading = journalHeadings[journal];
874
+ const party = journal === "general" ? generalCredit(d, otherOf(d) ?? "") : otherOf(d);
875
+ const answer = {
876
+ date: d.date,
877
+ party,
878
+ ref: d.ref ?? "",
879
+ debit: d.debit ?? "",
880
+ amount: d.total
881
+ };
882
+ const options = {
883
+ date: unionOf(d.options?.date ?? defaults.date),
884
+ party: unionOf(d.options?.party ?? defaults.party),
885
+ ref: unionOf(d.options?.ref ?? defaults.ref),
886
+ debit: unionOf(d.options?.debit ?? defaults.debit)
887
+ };
888
+ const fields = journalFields(journal);
889
+ for (const field of fields) {
890
+ if (field === "amount") continue;
891
+ if (!options[field].some((o) => sameText(o, answer[field]))) {
892
+ return refuse("answer-not-offered", `"${d.id}": "${answer[field]}" is not among its ${field} choices.`);
893
+ }
894
+ if (options[field].length < 2) {
895
+ return refuse("needs-choices", `"${d.id}" needs at least two ${field} choices: give options.${field}${field === "debit" ? " or accounts" : ""}.`);
896
+ }
897
+ }
898
+ const authored = typeof d.why === "string" ? { journal: d.why } : d.why ?? {};
899
+ const amount = money$(p, d.total);
900
+ entries.push({
901
+ ...d,
902
+ journal,
903
+ fields,
904
+ answer,
905
+ options,
906
+ why: {
907
+ journal: authored.journal ?? journalClues[journal],
908
+ date: authored.date ?? `The row takes the date on the document: ${answer.date}.`,
909
+ party: authored.party ?? (journal === "general" ? `${heading.credit ?? "Credit"}: ${party}.` : `${heading.party}: ${party}, the other party on the document.`),
910
+ ref: authored.ref ?? `${heading.ref ?? "No."}: ${answer.ref}, the number printed on the document.`,
911
+ debit: authored.debit ?? (answer.debit ? `${heading.debit ?? "Debit"}: ${answer.debit}.` : ""),
912
+ amount: authored.amount ?? `The row takes the document's total, after trade discount: ${amount}.`
913
+ }
914
+ });
915
+ }
916
+ }
917
+ const vouchers = [];
918
+ for (const [i, v] of p.vouchers.entries()) {
919
+ const options = {
920
+ date: unionOf(v.options.date ?? p.vouchers.map((x) => x.fields.date)),
921
+ party: unionOf(v.options.party ?? p.vouchers.map((x) => x.fields.party)),
922
+ account: unionOf(v.options.account ?? (p.accounts.length > 0 ? p.accounts : p.vouchers.map((x) => x.fields.account)))
923
+ };
924
+ for (const field of [
925
+ "date",
926
+ "party",
927
+ "account"
928
+ ]) {
929
+ if (!options[field].some((o) => sameText(o, v.fields[field]))) {
930
+ return refuse("answer-not-offered", `Voucher ${i + 1}: "${v.fields[field]}" is not among its ${field} choices.`);
931
+ }
932
+ if (options[field].length < 2) {
933
+ return refuse("needs-choices", `Voucher ${i + 1} needs at least two ${field} choices: give options.${field}.`);
934
+ }
935
+ }
936
+ const amount = money$(p, v.fields.amount);
937
+ const paid = v.kind === "debit-voucher";
938
+ vouchers.push({
939
+ story: v.story,
940
+ kind: v.kind,
941
+ business: v.business,
942
+ fields: v.fields,
943
+ options,
944
+ why: {
945
+ kind: v.why.kind ?? p.kindClues[v.kind] ?? KIND_CLUE[v.kind],
946
+ date: v.why.date ?? `A voucher carries the day the cash moved: ${v.fields.date}.`,
947
+ party: v.why.party ?? (paid ? `The voucher names who was paid: ${v.fields.party}.` : `The voucher names who paid the business: ${v.fields.party}.`),
948
+ account: v.why.account ?? `The account head says what the money was for: ${v.fields.account}.`,
949
+ amount: v.why.amount ?? `The story's amount is ${amount}. Write it in figures, like ${amount}.`
950
+ }
951
+ });
952
+ }
953
+ const count = p.mode === "sort" ? cards.length : p.mode === "identify" || p.mode === "journal" ? documents.length : vouchers.length;
954
+ return {
955
+ mode: p.mode,
956
+ currency: p.currency,
957
+ cards,
958
+ documents,
959
+ entries,
960
+ business,
961
+ journalLabels,
962
+ journalHeadings,
963
+ journalClues,
964
+ vouchers,
965
+ kinds: p.kinds,
966
+ kindLabels,
967
+ labels,
968
+ phrases,
969
+ count
970
+ };
971
+ },
972
+ initial: () => ({
973
+ index: 0,
974
+ pick: "",
975
+ issuer: "",
976
+ draft: BLANK,
977
+ checked: null,
978
+ done: false,
979
+ tries: 0,
980
+ misses: 0,
981
+ firstTry: []
982
+ }),
983
+ controls: (c) => ({
984
+ sortAnswer: c.choice({
985
+ unset: true,
986
+ label: "Transaction or not?",
987
+ when: (s) => s.mode === "sort",
988
+ options: (s) => [{
989
+ value: "transaction",
990
+ label: s.phrases.transaction
991
+ }, {
992
+ value: "event",
993
+ label: s.phrases.event
994
+ }],
995
+ get: (st, s) => s.mode === "sort" ? st.pick : "",
996
+ set: (st, value, s) => {
997
+ if (st.done) return st;
998
+ const card = s.cards[st.index];
999
+ const right = value === "transaction" === card.transaction;
1000
+ return {
1001
+ ...st,
1002
+ pick: value,
1003
+ done: true,
1004
+ tries: 1,
1005
+ firstTry: [...st.firstTry, right]
1006
+ };
1007
+ }
1008
+ }),
1009
+ docKind: c.choice({
1010
+ unset: true,
1011
+ label: (s) => s.phrases.kindQuestion,
1012
+ when: (s) => s.mode === "identify",
1013
+ options: (s) => s.kinds.map((k) => ({
1014
+ value: k,
1015
+ label: s.kindLabels[k]
1016
+ })),
1017
+ get: (st, s) => s.mode === "identify" ? st.pick : "",
1018
+ set: (st, value) => st.done ? st : {
1019
+ ...st,
1020
+ pick: value
1021
+ }
1022
+ }),
1023
+ issuer: c.choice({
1024
+ unset: true,
1025
+ label: (s) => s.phrases.issuerQuestion,
1026
+ when: (s, st) => s.mode === "identify" && s.documents[st.index]?.to !== undefined,
1027
+ options: (s, st) => {
1028
+ const doc = s.documents[st.index];
1029
+ if (!doc?.to) return [];
1030
+ const both = [{
1031
+ value: "from",
1032
+ label: doc.from
1033
+ }, {
1034
+ value: "to",
1035
+ label: doc.to
1036
+ }];
1037
+ return both.sort((a, b) => a.label < b.label ? -1 : a.label > b.label ? 1 : 0);
1038
+ },
1039
+ get: (st) => st.issuer,
1040
+ set: (st, value) => st.done ? st : {
1041
+ ...st,
1042
+ issuer: value
1043
+ }
1044
+ }),
1045
+ voucherKind: c.choice({
1046
+ unset: true,
1047
+ label: (s) => s.labels.voucherType,
1048
+ when: (s) => s.mode === "fill",
1049
+ options: (s) => [{
1050
+ value: "debit-voucher",
1051
+ label: s.kindLabels["debit-voucher"]
1052
+ }, {
1053
+ value: "credit-voucher",
1054
+ label: s.kindLabels["credit-voucher"]
1055
+ }],
1056
+ get: (st, s) => s.mode === "fill" ? st.draft.kind : "",
1057
+ set: (st, value) => st.done ? st : {
1058
+ ...st,
1059
+ draft: {
1060
+ ...st.draft,
1061
+ kind: value
1062
+ }
1063
+ }
1064
+ }),
1065
+ voucherDate: c.choice({
1066
+ unset: true,
1067
+ label: (s) => s.labels.date,
1068
+ when: (s) => s.mode === "fill",
1069
+ options: (s, st) => (s.vouchers[st.index]?.options.date ?? []).map((o) => ({
1070
+ value: o,
1071
+ label: o
1072
+ })),
1073
+ get: (st, s) => s.mode === "fill" ? st.draft.date : "",
1074
+ set: (st, value) => st.done ? st : {
1075
+ ...st,
1076
+ draft: {
1077
+ ...st.draft,
1078
+ date: value
1079
+ }
1080
+ }
1081
+ }),
1082
+ voucherParty: c.choice({
1083
+ unset: true,
1084
+ label: (s, st) => st.draft.kind === "debit-voucher" ? s.labels.paidTo : st.draft.kind === "credit-voucher" ? s.labels.receivedFrom : s.labels.party,
1085
+ when: (s) => s.mode === "fill",
1086
+ options: (s, st) => (s.vouchers[st.index]?.options.party ?? []).map((o) => ({
1087
+ value: o,
1088
+ label: o
1089
+ })),
1090
+ get: (st, s) => s.mode === "fill" ? st.draft.party : "",
1091
+ set: (st, value) => st.done ? st : {
1092
+ ...st,
1093
+ draft: {
1094
+ ...st.draft,
1095
+ party: value
1096
+ }
1097
+ }
1098
+ }),
1099
+ voucherAccount: c.choice({
1100
+ unset: true,
1101
+ label: (s) => s.labels.account,
1102
+ when: (s) => s.mode === "fill",
1103
+ options: (s, st) => (s.vouchers[st.index]?.options.account ?? []).map((o) => ({
1104
+ value: o,
1105
+ label: o
1106
+ })),
1107
+ get: (st, s) => s.mode === "fill" ? st.draft.account : "",
1108
+ set: (st, value) => st.done ? st : {
1109
+ ...st,
1110
+ draft: {
1111
+ ...st.draft,
1112
+ account: value
1113
+ }
1114
+ }
1115
+ }),
1116
+ voucherAmount: c.text({
1117
+ label: (s) => s.labels.amount,
1118
+ when: (s) => s.mode === "fill",
1119
+ inputMode: "decimal",
1120
+ get: (st, s) => s.mode === "fill" ? st.draft.amount : "",
1121
+ set: (st, value) => st.done ? st : {
1122
+ ...st,
1123
+ draft: {
1124
+ ...st.draft,
1125
+ amount: value
1126
+ }
1127
+ }
1128
+ }),
1129
+ journalPick: c.choice({
1130
+ unset: true,
1131
+ label: (s) => s.phrases.journalQuestion,
1132
+ when: (s) => s.mode === "journal",
1133
+ options: (s) => JOURNALS.map((j) => ({
1134
+ value: j,
1135
+ label: s.journalLabels[j]
1136
+ })),
1137
+ get: (st, s) => s.mode === "journal" ? st.pick : "",
1138
+ set: (st, value, s) => {
1139
+ const e = s.entries[st.index];
1140
+ if (!e || st.done || st.pick === e.journal) return st;
1141
+ return {
1142
+ ...st,
1143
+ pick: value,
1144
+ misses: value === e.journal ? st.misses : st.misses + 1
1145
+ };
1146
+ }
1147
+ }),
1148
+ journalDate: c.choice({
1149
+ unset: true,
1150
+ label: (s, st) => s.journalHeadings[s.entries[st.index]?.journal ?? "purchases"].date,
1151
+ when: (s, st) => rowAsks(s, st, "date"),
1152
+ options: (s, st) => (s.entries[st.index]?.options.date ?? []).map((o) => ({
1153
+ value: o,
1154
+ label: o
1155
+ })),
1156
+ get: (st, s) => s.mode === "journal" ? st.draft.date : "",
1157
+ set: (st, value) => st.done ? st : {
1158
+ ...st,
1159
+ draft: {
1160
+ ...st.draft,
1161
+ date: value
1162
+ }
1163
+ }
1164
+ }),
1165
+ journalParty: c.choice({
1166
+ unset: true,
1167
+ label: (s, st) => rowLabel(s, st, "party"),
1168
+ when: (s, st) => rowAsks(s, st, "party"),
1169
+ options: (s, st) => (s.entries[st.index]?.options.party ?? []).map((o) => ({
1170
+ value: o,
1171
+ label: o
1172
+ })),
1173
+ get: (st, s) => s.mode === "journal" ? st.draft.party : "",
1174
+ set: (st, value) => st.done ? st : {
1175
+ ...st,
1176
+ draft: {
1177
+ ...st.draft,
1178
+ party: value
1179
+ }
1180
+ }
1181
+ }),
1182
+ journalRef: c.choice({
1183
+ unset: true,
1184
+ label: (s, st) => rowLabel(s, st, "ref"),
1185
+ when: (s, st) => rowAsks(s, st, "ref"),
1186
+ options: (s, st) => (s.entries[st.index]?.options.ref ?? []).map((o) => ({
1187
+ value: o,
1188
+ label: o
1189
+ })),
1190
+ get: (st, s) => s.mode === "journal" ? st.draft.ref : "",
1191
+ set: (st, value) => st.done ? st : {
1192
+ ...st,
1193
+ draft: {
1194
+ ...st.draft,
1195
+ ref: value
1196
+ }
1197
+ }
1198
+ }),
1199
+ journalDebit: c.choice({
1200
+ unset: true,
1201
+ label: (s, st) => rowLabel(s, st, "debit"),
1202
+ when: (s, st) => rowAsks(s, st, "debit"),
1203
+ options: (s, st) => (s.entries[st.index]?.options.debit ?? []).map((o) => ({
1204
+ value: o,
1205
+ label: o
1206
+ })),
1207
+ get: (st, s) => s.mode === "journal" ? st.draft.account : "",
1208
+ set: (st, value) => st.done ? st : {
1209
+ ...st,
1210
+ draft: {
1211
+ ...st.draft,
1212
+ account: value
1213
+ }
1214
+ }
1215
+ }),
1216
+ journalAmount: c.text({
1217
+ label: (s, st) => rowLabel(s, st, "amount"),
1218
+ when: (s, st) => rowAsks(s, st, "amount"),
1219
+ inputMode: "decimal",
1220
+ get: (st, s) => s.mode === "journal" ? st.draft.amount : "",
1221
+ set: (st, value) => st.done ? st : {
1222
+ ...st,
1223
+ draft: {
1224
+ ...st.draft,
1225
+ amount: value
1226
+ }
1227
+ }
1228
+ }),
1229
+ check: c.action({
1230
+ label: "Check",
1231
+ when: (s) => s.mode !== "sort",
1232
+ enabled: (s, st) => {
1233
+ if (st.done) return false;
1234
+ if (s.mode === "identify") {
1235
+ return st.pick !== "" && (s.documents[st.index]?.to === undefined || st.issuer !== "");
1236
+ }
1237
+ if (s.mode === "journal") {
1238
+ const e = s.entries[st.index];
1239
+ return !!e && st.pick === e.journal && e.fields.every((f) => st.draft[draftKey(f)].trim() !== "");
1240
+ }
1241
+ return FILL_FIELDS.every((f) => st.draft[f].trim() !== "");
1242
+ },
1243
+ run: (s, st) => {
1244
+ if (st.done) return st;
1245
+ if (s.mode === "identify") {
1246
+ const doc = s.documents[st.index];
1247
+ const right = st.pick === doc.kind && (doc.to === undefined || st.issuer === "from");
1248
+ return {
1249
+ ...st,
1250
+ done: true,
1251
+ tries: 1,
1252
+ firstTry: [...st.firstTry, right]
1253
+ };
1254
+ }
1255
+ if (s.mode === "journal") {
1256
+ const e = s.entries[st.index];
1257
+ if (st.pick !== e.journal) return st;
1258
+ const tries = st.tries + 1;
1259
+ const allRight = e.fields.every((f) => journalMark(e, st.draft, f) === "right");
1260
+ return {
1261
+ ...st,
1262
+ checked: st.draft,
1263
+ tries,
1264
+ done: allRight,
1265
+ firstTry: allRight ? [...st.firstTry, tries === 1 && st.misses === 0] : st.firstTry
1266
+ };
1267
+ }
1268
+ const v = s.vouchers[st.index];
1269
+ const tries = st.tries + 1;
1270
+ const allRight = FILL_FIELDS.every((f) => fieldMark(v, st.draft, f) === "right");
1271
+ return {
1272
+ ...st,
1273
+ checked: st.draft,
1274
+ tries,
1275
+ done: allRight,
1276
+ firstTry: allRight ? [...st.firstTry, tries === 1] : st.firstTry
1277
+ };
1278
+ }
1279
+ }),
1280
+ next: c.action({
1281
+ label: "Next",
1282
+ enabled: (s, st) => st.done && st.index < s.count - 1,
1283
+ run: (s, st) => st.done && st.index < s.count - 1 ? {
1284
+ ...st,
1285
+ index: st.index + 1,
1286
+ pick: "",
1287
+ issuer: "",
1288
+ draft: BLANK,
1289
+ checked: null,
1290
+ done: false,
1291
+ tries: 0,
1292
+ misses: 0
1293
+ } : st
1294
+ })
1295
+ }),
1296
+ read(s, st) {
1297
+ const last = st.index >= s.count - 1;
1298
+ const card = s.mode === "sort" ? s.cards[st.index] : undefined;
1299
+ const doc = s.mode === "identify" ? s.documents[st.index] : undefined;
1300
+ const voucher = s.mode === "fill" ? s.vouchers[st.index] : undefined;
1301
+ const sortRight = card && st.done ? st.pick === "transaction" === card.transaction : undefined;
1302
+ const kindRight = doc && st.done ? st.pick === doc.kind : undefined;
1303
+ const issuerRight = doc && st.done && doc.to !== undefined ? st.issuer === "from" : undefined;
1304
+ const marks = Object.fromEntries(FILL_FIELDS.map((f) => {
1305
+ if (!voucher || !st.checked) return [f, "pending"];
1306
+ if (st.checked[f] !== st.draft[f]) return [f, "pending"];
1307
+ return [f, fieldMark(voucher, st.checked, f)];
1308
+ }));
1309
+ const entry = s.mode === "journal" ? s.entries[st.index] : undefined;
1310
+ /** journal: the pick is the right journal, so the row is open. */
1311
+ const journalOpen = !!entry && st.pick === entry.journal;
1312
+ const journalPickMark = !entry || st.pick === "" ? undefined : journalOpen ? "right" : "wrong";
1313
+ const rowMarks = Object.fromEntries(JOURNAL_FIELDS.map((f) => {
1314
+ if (!entry || !st.checked || !entry.fields.includes(f)) return [f, "pending"];
1315
+ const key = draftKey(f);
1316
+ if (st.checked[key] !== st.draft[key]) return [f, "pending"];
1317
+ return [f, journalMark(entry, st.checked, f)];
1318
+ }));
1319
+ const books = s.mode === "journal" ? booksOf(s, st) : [];
1320
+ const finished = st.done && last;
1321
+ const rightFirst = st.firstTry.filter(Boolean).length;
1322
+ return {
1323
+ index: st.index,
1324
+ count: s.count,
1325
+ last,
1326
+ done: st.done,
1327
+ finished,
1328
+ card,
1329
+ doc,
1330
+ voucher,
1331
+ entry,
1332
+ journalOpen,
1333
+ journalPickMark,
1334
+ rowMarks,
1335
+ books,
1336
+ sortRight,
1337
+ kindRight,
1338
+ issuerRight,
1339
+ marks,
1340
+ rightFirst,
1341
+ partyLabel: st.draft.kind === "debit-voucher" ? s.labels.paidTo : st.draft.kind === "credit-voucher" ? s.labels.receivedFrom : s.labels.party
1342
+ };
1343
+ },
1344
+ goals: { finished: (r) => r.finished },
1345
+ witness: (s) => {
1346
+ const lastIndex = s.count - 1;
1347
+ const base = {
1348
+ index: lastIndex,
1349
+ issuer: "",
1350
+ checked: null,
1351
+ done: true,
1352
+ tries: 1,
1353
+ misses: 0,
1354
+ firstTry: Array(s.count).fill(true)
1355
+ };
1356
+ if (s.mode === "journal") {
1357
+ const e = s.entries[lastIndex];
1358
+ const draft = {
1359
+ ...BLANK,
1360
+ date: e.answer.date,
1361
+ party: e.answer.party,
1362
+ ref: e.answer.ref,
1363
+ account: e.answer.debit,
1364
+ amount: String(e.answer.amount)
1365
+ };
1366
+ return {
1367
+ ...base,
1368
+ pick: e.journal,
1369
+ draft,
1370
+ checked: draft
1371
+ };
1372
+ }
1373
+ if (s.mode === "sort") {
1374
+ const card = s.cards[lastIndex];
1375
+ return {
1376
+ ...base,
1377
+ pick: card.transaction ? "transaction" : "event",
1378
+ draft: BLANK
1379
+ };
1380
+ }
1381
+ if (s.mode === "identify") {
1382
+ const doc = s.documents[lastIndex];
1383
+ return {
1384
+ ...base,
1385
+ pick: doc.kind,
1386
+ issuer: doc.to ? "from" : "",
1387
+ draft: BLANK
1388
+ };
1389
+ }
1390
+ const v = s.vouchers[lastIndex];
1391
+ const draft = {
1392
+ ...BLANK,
1393
+ kind: v.kind,
1394
+ ...v.fields,
1395
+ amount: String(v.fields.amount)
1396
+ };
1397
+ return {
1398
+ ...base,
1399
+ pick: "",
1400
+ draft,
1401
+ checked: draft
1402
+ };
1403
+ },
1404
+ describe: (s, st, r) => {
1405
+ const position = `${st.index + 1} of ${s.count}.`;
1406
+ if (r.card) {
1407
+ if (!st.done) return `${position} ${r.card.text} Transaction or not?`;
1408
+ const verdict = r.card.transaction ? s.phrases.transaction : s.phrases.event;
1409
+ const moved = r.card.transaction ? `${r.card.effects.map((e) => `${e.termLabel}: ${e.label} ${signedMoney(s.currency, e.delta)}`).join(", ")}. ${s.phrases.stillEqual}` : s.phrases.nothingMoved;
1410
+ return `${position} ${r.card.text} ${r.sortRight ? "Right" : "Not quite"}: ${verdict}. ${moved} ${r.card.reason}`;
1411
+ }
1412
+ if (r.doc) {
1413
+ const doc = r.doc;
1414
+ const head = `${position} A document from ${doc.from}${doc.to ? ` to ${doc.to}` : ""}, total ${money$(s, doc.total)}.`;
1415
+ if (!st.done) return `${head} ${s.phrases.kindQuestion}`;
1416
+ return `${head} ${r.kindRight ? "Right" : "Not quite"}: ${doc.title}${doc.to ? `, issued by ${doc.from}` : ""}. ${doc.clueText}`;
1417
+ }
1418
+ if (r.entry) {
1419
+ const e = r.entry;
1420
+ const head = `${position} ${e.title} from ${e.from}${e.to ? ` to ${e.to}` : ""}, ${e.date}, total ${money$(s, e.total)}.`;
1421
+ if (!r.journalOpen) {
1422
+ const miss = r.journalPickMark === "wrong" ? ` ${s.phrases.notThisJournal} ${s.journalLabels[st.pick] ?? st.pick}: ${s.journalClues[st.pick] ?? ""}` : "";
1423
+ return `${head}${miss} ${s.phrases.journalQuestion}`;
1424
+ }
1425
+ const label = s.journalLabels[e.journal];
1426
+ const wrong = e.fields.filter((f) => r.rowMarks[f] === "wrong" || r.rowMarks[f] === "unreadable").map((f) => journalFieldLabel(s, e.journal, f));
1427
+ const book = r.books.find((b) => b.journal === e.journal);
1428
+ const h = s.journalHeadings[e.journal];
1429
+ const posting = st.done && book?.complete && e.journal !== "general" ? ` ${label} ${s.labels.total} ${money$(s, book.total)}. ${s.phrases.monthEnd} ${[h.debit, h.credit].filter(Boolean).join(" / ")}.` : "";
1430
+ const status = st.done ? `Entered in the ${label}.${posting}` : st.checked ? wrong.length > 0 ? `Fix: ${wrong.join(", ")}.` : "Check again." : `${label}: fill its row, then check.`;
1431
+ return `${head} ${status}`;
1432
+ }
1433
+ const v = r.voucher;
1434
+ const name = {
1435
+ kind: s.labels.voucherType,
1436
+ date: s.labels.date,
1437
+ party: r.partyLabel,
1438
+ account: s.labels.account,
1439
+ amount: s.labels.amount
1440
+ };
1441
+ const wrong = FILL_FIELDS.filter((f) => r.marks[f] === "wrong" || r.marks[f] === "unreadable").map((f) => name[f]);
1442
+ const status = st.done ? "Every field is right." : st.checked ? wrong.length > 0 ? `Fix: ${wrong.join(", ")}.` : "Check again." : "Fill the voucher, then check.";
1443
+ return `${position} ${v.story} ${status}`;
1444
+ }
1445
+ });
1446
+
1447
+ //#endregion
1448
+ export { DOC_KINDS, FILL_FIELDS, JOURNALS, JOURNAL_FIELDS, documentDeskModel, documentDeskParamsSchema, journalFieldLabel, journalFields, signedMoney };