solve-engine 1.0.0-beta.0 → 1.0.0-beta.1

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 (249) hide show
  1. package/dist/BytecodeBuilder-3egMyuDi.d.cts +274 -0
  2. package/dist/BytecodeBuilder-3egMyuDi.d.ts +274 -0
  3. package/dist/Configuration-fVpd-HC-.d.cts +228 -0
  4. package/dist/Configuration-fVpd-HC-.d.ts +228 -0
  5. package/dist/EngineError-DvPSnhZi.d.cts +304 -0
  6. package/dist/EngineError-DvPSnhZi.d.ts +304 -0
  7. package/dist/Lexer-BJdhlnej.d.cts +531 -0
  8. package/dist/Lexer-D9l4Yrk2.d.ts +531 -0
  9. package/dist/NormalizerRule-BrVoVjmP.d.cts +163 -0
  10. package/dist/NormalizerRule-CEjf1FyD.d.ts +163 -0
  11. package/dist/PackageRegistry-D-Tv_7ca.d.cts +2572 -0
  12. package/dist/PackageRegistry-DaH4aIKP.d.ts +2572 -0
  13. package/dist/Parselet-CK8cQu2a.d.cts +299 -0
  14. package/dist/Parselet-ConOIdRO.d.ts +299 -0
  15. package/dist/ScopeManager-B5k0nk05.d.ts +559 -0
  16. package/dist/ScopeManager-CKfQtl7l.d.cts +559 -0
  17. package/dist/Token-0jpvUdPY.d.cts +245 -0
  18. package/dist/Token-0jpvUdPY.d.ts +245 -0
  19. package/dist/VMCheckpoints-BmDwIXgK.d.ts +171 -0
  20. package/dist/VMCheckpoints-CqFuLwrT.d.cts +171 -0
  21. package/dist/Value-KtAQNHur.d.cts +295 -0
  22. package/dist/Value-KtAQNHur.d.ts +295 -0
  23. package/dist/chunk-2RWAXT6O.js +3 -0
  24. package/dist/chunk-2RWAXT6O.js.map +1 -0
  25. package/dist/chunk-34RRD7PC.js +1492 -0
  26. package/dist/chunk-34RRD7PC.js.map +1 -0
  27. package/dist/chunk-3PPFLFH4.js +5097 -0
  28. package/dist/chunk-3PPFLFH4.js.map +1 -0
  29. package/dist/chunk-3VGDNEE3.js +84 -0
  30. package/dist/chunk-3VGDNEE3.js.map +1 -0
  31. package/dist/chunk-3YNVWKR2.cjs +370 -0
  32. package/dist/chunk-3YNVWKR2.cjs.map +1 -0
  33. package/dist/chunk-47LRVGOT.cjs +316 -0
  34. package/dist/chunk-47LRVGOT.cjs.map +1 -0
  35. package/dist/chunk-4MG4XKO2.js +1644 -0
  36. package/dist/chunk-4MG4XKO2.js.map +1 -0
  37. package/dist/chunk-4QADQTWS.js +2392 -0
  38. package/dist/chunk-4QADQTWS.js.map +1 -0
  39. package/dist/chunk-53B6KDDJ.cjs +1651 -0
  40. package/dist/chunk-53B6KDDJ.cjs.map +1 -0
  41. package/dist/chunk-5X2PTP6F.cjs +104 -0
  42. package/dist/chunk-5X2PTP6F.cjs.map +1 -0
  43. package/dist/chunk-5YEMOYSE.js +264 -0
  44. package/dist/chunk-5YEMOYSE.js.map +1 -0
  45. package/dist/chunk-64W6GLLZ.js +481 -0
  46. package/dist/chunk-64W6GLLZ.js.map +1 -0
  47. package/dist/chunk-6BKTCEUP.cjs +233 -0
  48. package/dist/chunk-6BKTCEUP.cjs.map +1 -0
  49. package/dist/chunk-6NTVRDQV.cjs +1642 -0
  50. package/dist/chunk-6NTVRDQV.cjs.map +1 -0
  51. package/dist/chunk-6RDSQURE.js +290 -0
  52. package/dist/chunk-6RDSQURE.js.map +1 -0
  53. package/dist/chunk-75JP4BZX.js +93 -0
  54. package/dist/chunk-75JP4BZX.js.map +1 -0
  55. package/dist/chunk-BVAR5J2F.js +257 -0
  56. package/dist/chunk-BVAR5J2F.js.map +1 -0
  57. package/dist/chunk-C4XZV6E7.cjs +269 -0
  58. package/dist/chunk-C4XZV6E7.cjs.map +1 -0
  59. package/dist/chunk-CCJPSHGI.cjs +40 -0
  60. package/dist/chunk-CCJPSHGI.cjs.map +1 -0
  61. package/dist/chunk-CLL7RUQV.cjs +316 -0
  62. package/dist/chunk-CLL7RUQV.cjs.map +1 -0
  63. package/dist/chunk-DM3LMRBC.js +329 -0
  64. package/dist/chunk-DM3LMRBC.js.map +1 -0
  65. package/dist/chunk-DUEZFTK2.js +38 -0
  66. package/dist/chunk-DUEZFTK2.js.map +1 -0
  67. package/dist/chunk-EBSPLUW4.cjs +489 -0
  68. package/dist/chunk-EBSPLUW4.cjs.map +1 -0
  69. package/dist/chunk-EHAHVROS.cjs +261 -0
  70. package/dist/chunk-EHAHVROS.cjs.map +1 -0
  71. package/dist/chunk-EPOXXJBK.js +96 -0
  72. package/dist/chunk-EPOXXJBK.js.map +1 -0
  73. package/dist/chunk-FEAIOR7N.cjs +91 -0
  74. package/dist/chunk-FEAIOR7N.cjs.map +1 -0
  75. package/dist/chunk-G535KJEG.js +312 -0
  76. package/dist/chunk-G535KJEG.js.map +1 -0
  77. package/dist/chunk-GCM5JHMX.js +88 -0
  78. package/dist/chunk-GCM5JHMX.js.map +1 -0
  79. package/dist/chunk-GOLDJNMZ.js +368 -0
  80. package/dist/chunk-GOLDJNMZ.js.map +1 -0
  81. package/dist/chunk-GW32KPCU.cjs +360 -0
  82. package/dist/chunk-GW32KPCU.cjs.map +1 -0
  83. package/dist/chunk-HO2CDZRC.js +5508 -0
  84. package/dist/chunk-HO2CDZRC.js.map +1 -0
  85. package/dist/chunk-HTXVVJRA.cjs +1549 -0
  86. package/dist/chunk-HTXVVJRA.cjs.map +1 -0
  87. package/dist/chunk-HWSZJQCI.js +311 -0
  88. package/dist/chunk-HWSZJQCI.js.map +1 -0
  89. package/dist/chunk-IF532O7C.js +101 -0
  90. package/dist/chunk-IF532O7C.js.map +1 -0
  91. package/dist/chunk-J73SJHR3.cjs +2415 -0
  92. package/dist/chunk-J73SJHR3.cjs.map +1 -0
  93. package/dist/chunk-KVILKGMS.js +228 -0
  94. package/dist/chunk-KVILKGMS.js.map +1 -0
  95. package/dist/chunk-LIPPNDBE.js +258 -0
  96. package/dist/chunk-LIPPNDBE.js.map +1 -0
  97. package/dist/chunk-M4N5GA5Z.cjs +309 -0
  98. package/dist/chunk-M4N5GA5Z.cjs.map +1 -0
  99. package/dist/chunk-MZOVP3WI.cjs +96 -0
  100. package/dist/chunk-MZOVP3WI.cjs.map +1 -0
  101. package/dist/chunk-N5YFR4UP.cjs +10 -0
  102. package/dist/chunk-N5YFR4UP.cjs.map +1 -0
  103. package/dist/chunk-NGBBNL4K.cjs +4 -0
  104. package/dist/chunk-NGBBNL4K.cjs.map +1 -0
  105. package/dist/chunk-NH2O2AUR.js +146 -0
  106. package/dist/chunk-NH2O2AUR.js.map +1 -0
  107. package/dist/chunk-NLNDMWZC.js +31 -0
  108. package/dist/chunk-NLNDMWZC.js.map +1 -0
  109. package/dist/chunk-NMCRQP3Z.cjs +778 -0
  110. package/dist/chunk-NMCRQP3Z.cjs.map +1 -0
  111. package/dist/chunk-NMD5VRN4.cjs +1327 -0
  112. package/dist/chunk-NMD5VRN4.cjs.map +1 -0
  113. package/dist/chunk-OC6LTXYS.cjs +286 -0
  114. package/dist/chunk-OC6LTXYS.cjs.map +1 -0
  115. package/dist/chunk-OT6OJY7C.cjs +114 -0
  116. package/dist/chunk-OT6OJY7C.cjs.map +1 -0
  117. package/dist/chunk-PEWZMGH7.cjs +5522 -0
  118. package/dist/chunk-PEWZMGH7.cjs.map +1 -0
  119. package/dist/chunk-PFSDGGYL.js +8 -0
  120. package/dist/chunk-PFSDGGYL.js.map +1 -0
  121. package/dist/chunk-QNJ4ACRT.cjs +155 -0
  122. package/dist/chunk-QNJ4ACRT.cjs.map +1 -0
  123. package/dist/chunk-QWY3VEZN.js +1637 -0
  124. package/dist/chunk-QWY3VEZN.js.map +1 -0
  125. package/dist/chunk-RFYD5TJE.js +111 -0
  126. package/dist/chunk-RFYD5TJE.js.map +1 -0
  127. package/dist/chunk-RIN643A3.js +354 -0
  128. package/dist/chunk-RIN643A3.js.map +1 -0
  129. package/dist/chunk-RZCWSXTA.cjs +5122 -0
  130. package/dist/chunk-RZCWSXTA.cjs.map +1 -0
  131. package/dist/chunk-SDGRK7EP.js +774 -0
  132. package/dist/chunk-SDGRK7EP.js.map +1 -0
  133. package/dist/chunk-VEKIWQ3F.cjs +39 -0
  134. package/dist/chunk-VEKIWQ3F.cjs.map +1 -0
  135. package/dist/chunk-W44QGY5J.cjs +172 -0
  136. package/dist/chunk-W44QGY5J.cjs.map +1 -0
  137. package/dist/chunk-WQTTOGXC.cjs +99 -0
  138. package/dist/chunk-WQTTOGXC.cjs.map +1 -0
  139. package/dist/chunk-X6K3HUOY.cjs +86 -0
  140. package/dist/chunk-X6K3HUOY.cjs.map +1 -0
  141. package/dist/chunk-XJCMXB2E.cjs +333 -0
  142. package/dist/chunk-XJCMXB2E.cjs.map +1 -0
  143. package/dist/chunk-XVWCOTR6.js +1324 -0
  144. package/dist/chunk-XVWCOTR6.js.map +1 -0
  145. package/dist/chunk-Z2XP767T.cjs +35 -0
  146. package/dist/chunk-Z2XP767T.cjs.map +1 -0
  147. package/dist/chunk-Z4X2RWOF.js +37 -0
  148. package/dist/chunk-Z4X2RWOF.js.map +1 -0
  149. package/dist/chunk-ZP3UY6ZX.js +167 -0
  150. package/dist/chunk-ZP3UY6ZX.js.map +1 -0
  151. package/dist/constants.cjs +21 -0
  152. package/dist/constants.cjs.map +1 -0
  153. package/dist/constants.d.cts +12 -0
  154. package/dist/constants.d.ts +12 -0
  155. package/dist/constants.js +4 -0
  156. package/dist/constants.js.map +1 -0
  157. package/dist/engine.cjs +78 -0
  158. package/dist/engine.cjs.map +1 -0
  159. package/dist/engine.d.cts +587 -0
  160. package/dist/engine.d.ts +587 -0
  161. package/dist/engine.js +33 -0
  162. package/dist/engine.js.map +1 -0
  163. package/dist/errors.cjs +80 -0
  164. package/dist/errors.cjs.map +1 -0
  165. package/dist/errors.d.cts +95 -0
  166. package/dist/errors.d.ts +95 -0
  167. package/dist/errors.js +3 -0
  168. package/dist/errors.js.map +1 -0
  169. package/dist/format.cjs +170 -0
  170. package/dist/format.cjs.map +1 -0
  171. package/dist/format.d.cts +51 -0
  172. package/dist/format.d.ts +51 -0
  173. package/dist/format.js +167 -0
  174. package/dist/format.js.map +1 -0
  175. package/dist/index.cjs +96 -0
  176. package/dist/index.cjs.map +1 -0
  177. package/dist/index.d.cts +152 -0
  178. package/dist/index.d.ts +152 -0
  179. package/dist/index.js +74 -0
  180. package/dist/index.js.map +1 -0
  181. package/dist/language.cjs +307 -0
  182. package/dist/language.cjs.map +1 -0
  183. package/dist/language.d.cts +110 -0
  184. package/dist/language.d.ts +110 -0
  185. package/dist/language.js +286 -0
  186. package/dist/language.js.map +1 -0
  187. package/dist/lexer.cjs +63 -0
  188. package/dist/lexer.cjs.map +1 -0
  189. package/dist/lexer.d.cts +56 -0
  190. package/dist/lexer.d.ts +56 -0
  191. package/dist/lexer.js +10 -0
  192. package/dist/lexer.js.map +1 -0
  193. package/dist/normalizer.cjs +39 -0
  194. package/dist/normalizer.cjs.map +1 -0
  195. package/dist/normalizer.d.cts +364 -0
  196. package/dist/normalizer.d.ts +364 -0
  197. package/dist/normalizer.js +10 -0
  198. package/dist/normalizer.js.map +1 -0
  199. package/dist/packages.cjs +120 -0
  200. package/dist/packages.cjs.map +1 -0
  201. package/dist/packages.d.cts +691 -0
  202. package/dist/packages.d.ts +691 -0
  203. package/dist/packages.js +23 -0
  204. package/dist/packages.js.map +1 -0
  205. package/dist/parser.cjs +54 -0
  206. package/dist/parser.cjs.map +1 -0
  207. package/dist/parser.d.cts +46 -0
  208. package/dist/parser.d.ts +46 -0
  209. package/dist/parser.js +9 -0
  210. package/dist/parser.js.map +1 -0
  211. package/dist/pipeline-CrsRPmsv.d.ts +285 -0
  212. package/dist/pipeline-DPUQt7yL.d.cts +285 -0
  213. package/dist/resolvers.cjs +12 -0
  214. package/dist/resolvers.cjs.map +1 -0
  215. package/dist/resolvers.d.cts +111 -0
  216. package/dist/resolvers.d.ts +111 -0
  217. package/dist/resolvers.js +3 -0
  218. package/dist/resolvers.js.map +1 -0
  219. package/dist/services.cjs +20 -0
  220. package/dist/services.cjs.map +1 -0
  221. package/dist/services.d.cts +30 -0
  222. package/dist/services.d.ts +30 -0
  223. package/dist/services.js +3 -0
  224. package/dist/services.js.map +1 -0
  225. package/dist/uom.cjs +55 -0
  226. package/dist/uom.cjs.map +1 -0
  227. package/dist/uom.d.cts +224 -0
  228. package/dist/uom.d.ts +224 -0
  229. package/dist/uom.js +10 -0
  230. package/dist/uom.js.map +1 -0
  231. package/dist/utilities.cjs +31 -0
  232. package/dist/utilities.cjs.map +1 -0
  233. package/dist/utilities.d.cts +113 -0
  234. package/dist/utilities.d.ts +113 -0
  235. package/dist/utilities.js +6 -0
  236. package/dist/utilities.js.map +1 -0
  237. package/dist/variables.cjs +16 -0
  238. package/dist/variables.cjs.map +1 -0
  239. package/dist/variables.d.cts +87 -0
  240. package/dist/variables.d.ts +87 -0
  241. package/dist/variables.js +3 -0
  242. package/dist/variables.js.map +1 -0
  243. package/dist/vm.cjs +283 -0
  244. package/dist/vm.cjs.map +1 -0
  245. package/dist/vm.d.cts +68 -0
  246. package/dist/vm.d.ts +68 -0
  247. package/dist/vm.js +193 -0
  248. package/dist/vm.js.map +1 -0
  249. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vm/Value.ts"],"names":["ValueType","v","ErrorFactory"],"mappings":";;;;;AA8CO,IAAK,SAAA,qBAAAA,UAAAA,KAAL;AAEN,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AACA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,SAAM,CAAA,CAAA,GAAN,KAAA;AACA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AACA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AACA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,cAAW,CAAA,CAAA,GAAX,UAAA;AACA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,gBAAa,CAAA,CAAA,GAAb,YA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,CAAO,OAAA,CAAQ,kBAAoB,CAAC,CAAA;AACvE,EAAA,OAAO,IAAI,KAAA,CAAM,CAAA,iBAAoB,CAAC,CAAA;AACvC;AAGO,SAAS,gBAAgB,CAAA,EAAkB;AACjD,EAAA,IAAI,gBAAgB,MAAA,EAAQ,OAAO,MAAA,CAAO,OAAA,CAAQ,oBAAsB,CAAC,CAAA;AACzE,EAAA,OAAO,IAAI,KAAA,CAAM,CAAA,mBAAsB,CAAC,CAAA;AACzC;AAQO,SAAS,aAAa,QAAA,EAAyB;AACrD,EAAA,OAAO,IAAI,KAAA,CAAM,EAAA,gBAAmB,QAAQ,CAAA;AAC7C;AAQO,SAAS,UAAA,CAAW,MAAc,OAAA,EAAwB;AAChE,EAAA,OAAO,IAAI,KAAA,CAAM,EAAA,cAAiB,IAAA,EAAM,OAAO,CAAA;AAChD","file":"chunk-OC6LTXYS.cjs","sourcesContent":["import { ErrorFactory } from \"@solve-js/errors/UnifiedErrorFramework\";\nimport type { SymbolicNode } from \"@solve-js/symbolic\";\n\n/**\n * A single matrix cell. `boolean` covers element-wise comparison results\n * (`[1,6;3,8] < [5,2;7,4]` produces a Matrix of booleans, not numbers). A\n * `SymbolicNode` cell is a free-variable algebraic entry, e.g. `s =\n * [sx,0,0;0,sy,0;0,0,1]` where `sx`/`sy` are never assigned, so those\n * cells store a real `SymbolicNode` (a bare `var` node initially) rather\n * than degrading to `0`. See `MatrixOps.ts`'s `entryToSymbolic()`/\n * `symbolicToEntry()` for the two-way conversion every symbolic-aware\n * matrix op (multiply, inverse, determinant) uses.\n */\nexport type MatrixEntry = number | boolean | SymbolicNode;\n\n/**\n * A general rows×cols matrix, a vector is just a 1×N (row) or N×1 (column)\n * matrix. `data` is COLUMN-MAJOR (`data[row + col*rows]`), matching the\n * spec's own `a[index]` column-major indexing semantics directly (no\n * translation needed for single-index reads). `hasSymbolic` lets every\n * numeric matrix op fast-path the all-numeric case with one boolean check,\n * mirroring `binaryOp()`'s existing Number+Number fast path, computed by\n * `matrixValue()` itself (true the moment any cell is a `SymbolicNode`\n * object rather than a plain number/boolean), not something callers set\n * by hand.\n */\nexport interface MatrixData {\n\treadonly rows: number;\n\treadonly cols: number;\n\treadonly data: readonly MatrixEntry[];\n\treadonly hasSymbolic: boolean;\n}\n\n/** A first-class integer range `min:max`, both bounds inclusive. */\nexport interface RangeData {\n\treadonly min: number;\n\treadonly max: number;\n}\n\n/**\n * Discriminated union tag for {@link Value} objects.\n *\n * Determines the runtime type of a Value and how its `value` field should\n * be interpreted. Used by the VM for type-aware dispatch in arithmetic,\n * comparison, and conversion operations.\n */\nexport enum ValueType {\n\t/** Plain 64-bit floating point number (IEEE 754 double) */\n\tNumber = 0,\n\tHex = 1,\n\tBigInt = 2,\n\tString = 3,\n\tDatetime = 4,\n\tPercentage = 5,\n\tUom = 6,\n\t/** General rows×cols matrix (a vector is a 1×N or N×1 matrix). Value is {@link MatrixData}. */\n\tMatrix = 7,\n\t/** A first-class integer range `min:max`, both inclusive. Value is {@link RangeData}. */\n\tRange = 8,\n\t/** A symbolic/algebraic expression tree (free-variable formula, not a concrete number). Value is a `SymbolicNode` (`@solve-js/symbolic`). */\n\tSymbolic = 9,\n\t/** Boolean true/false. Value is `boolean`. */\n\tBoolean = 10,\n\t/** Unit of measurement token (lexer only, not a runtime value). */\n\tUnit = 11,\n\t/** Async result pending resolution. Value stores the queryKey string. */\n\tPending = 12,\n\t/** Plugin-raised error propagated through the DAG. Value stores error code, unit stores message. */\n\tError = 13,\n}\n\n// ── ValueArena ────────────────────────────────────────────────────────────\n// Phase 5.3: Bump-allocator arena for zero-allocation Value reuse during scroll.\n// Instead of allocating new Value objects per instruction, we pre-allocate a\n// block and bump an index. A single arena.reset() per scroll frame recycles all\n// Values, no per-value release overhead, no GC pressure during 60fps scrolling.\n\n/**\n * Bump-allocator arena for zero-allocation Value reuse during scroll.\n *\n * Instead of allocating new Value objects per instruction, pre-allocates a\n * block and bumps an index. `arena.reset()` per scroll frame recycles all\n * Values, no per-value release overhead, no GC pressure during 60fps scrolling.\n *\n * Only active during Tier 2 scroll execution (ThreeTierEvaluator).\n */\nexport class ValueArena {\n\tprivate arena: Value[] = [];\n\tprivate index: number = 0;\n\n\t/** Pre-allocate initial block. 512 Values covers ~30-line viewport comfortably. */\n\tconstructor(initialSize: number = 512) {\n\t\tfor (let i = 0; i < initialSize; i++) {\n\t\t\tthis.arena.push(new Value(ValueType.Number, 0));\n\t\t}\n\t}\n\n\t/** Bump-allocate a recycled Value. Falls back to allocation only for overflow. */\n\tacquire(type: ValueType, value: number | bigint | string | boolean | MatrixData | RangeData | SymbolicNode, unit?: string): Value {\n\t\tif (this.index < this.arena.length) {\n\t\t\tconst v = this.arena[this.index++];\n\t\t\tv.recycle(type, value, unit);\n\t\t\treturn v;\n\t\t}\n\t\t// Arena overflow, allocate fresh (rare, only for very complex expressions)\n\t\tconst v = new Value(type, value, unit);\n\t\tthis.arena.push(v);\n\t\tthis.index++;\n\t\treturn v;\n\t}\n\n\t/** Reset for next scroll frame. O(1), just resets the index. */\n\treset(): void {\n\t\tthis.index = 0;\n\t}\n\n\t/** Current arena utilization (for diagnostics). */\n\tget usage(): number { return this.index; }\n\tget capacity(): number { return this.arena.length; }\n}\n\n// Module-level arena toggle. Single-threaded JS, so global state is safe.\n// The arena is ONLY active during Tier 2 scroll execution, the ThreeTierEvaluator\n// enables it before evaluating visible lines and disables it after.\n//\n// The arena INSTANCE survives disable(): constructing a ValueArena allocates\n// its whole initial block (512 Values), so dropping it on every disable would\n// pay that allocation cost again on the next enable, more garbage than the\n// arena saves. Instead, an `_arenaActive` flag gates use of the long-lived\n// instance; enable() just resets the bump index.\nlet _arena: ValueArena | null = null;\nlet _arenaActive = false;\n\n/** Enable the Value arena for zero-allocation scroll execution. */\nexport function enableValueArena(size?: number): ValueArena {\n\tif (!_arena) _arena = new ValueArena(size);\n\t_arena.reset();\n\t_arenaActive = true;\n\treturn _arena;\n}\n\n/** Disable the arena (returns to normal GC-collected allocation). */\nexport function disableValueArena(): void {\n\t_arenaActive = false;\n}\n\n/** Check if arena is active (used by STORE_VAR / HALT to decide cloning). */\nexport function isArenaActive(): boolean {\n\treturn _arenaActive;\n}\n\n/**\n * Allocate a Value that persists beyond the current arena cycle.\n * Used for values stored in variables (STORE_VAR) and final expression results\n * (HALT return), these must survive arena.reset() in the next scroll frame.\n */\nexport function persistentValue(v: Value): Value {\n\treturn new Value(v.type, v.value, v.unit);\n}\n\n// ── Dev-mode immutability guard (Part II, L5, Value model hardening) ──\n//\n// Value is documented immutable by convention, not enforcement: the arena\n// mutates objects in place via recycle() (by design, for Tier-2 scroll\n// performance), so Value can never be unconditionally frozen. This guard\n// freezes a Value ONLY when it is safe to do so, i.e. NOT while the arena\n// is active, since an arena-active Value may still be recycled later in\n// the same scroll frame. It is a no-op outside development builds (matches\n// the existing `process.env.NODE_ENV === \"development\"` convention used by\n// the app-layer logger) so there is zero runtime cost in production.\nconst isDevelopmentBuild = process.env.NODE_ENV === \"development\";\n\n/**\n * Freeze a Value in development builds, catching accidental external\n * mutation of \"immutable\" results early. Safe to call unconditionally\n * it is a no-op in production and a no-op whenever the arena is active\n * (an arena-active Value may still be recycle()'d before this scroll\n * frame ends, and freezing it would make recycle() throw).\n *\n * Intended for values leaving a public evaluation boundary\n * (ExpressionEngine.evaluateLine* / evaluateExpression), not for values\n * still moving through internal VM/arena machinery.\n */\nexport function freezeIfDev<T extends Value>(value: T): T {\n\tif (isDevelopmentBuild && !isArenaActive()) {\n\t\t// toNumber() lazily memoizes _cachedNumber for bigint/string values\n\t\t// (Number/Hex are already eagerly cached by the constructor), warm\n\t\t// it now so a later toNumber() call on the frozen object doesn't\n\t\t// try to write to a frozen field.\n\t\tvalue.toNumber();\n\t\tObject.freeze(value);\n\t}\n\treturn value;\n}\n\n/**\n * Universal runtime value for the solve-js VM.\n *\n * Carries a {@link ValueType} discriminant, a polymorphic `value` payload,\n * and an optional `unit` string (for UoM values). Treated as immutable after\n * construction, the arena reuses objects internally via `recycle()`, but\n * external code should never mutate Value fields.\n *\n * A cached `_cachedNumber` avoids repeated `toNumber()` computation on\n * hot paths (ADD/SUB/MUL in the VM dispatch loop).\n */\nexport class Value {\n\t// Cached numeric representation, computed once on first toNumber() call.\n\t// Cleared on recycle() when the arena reuses this Value for a new value.\n\tprivate _cachedNumber: number | undefined;\n\n\t// Fields are NOT readonly, the arena reuses Value objects by calling\n\t// recycle() which overwrites all fields. External code should treat Values\n\t// as immutable after construction (arena handles mutation internally).\n\tpublic type: ValueType;\n\tpublic value: number | bigint | string | boolean | MatrixData | RangeData | SymbolicNode;\n\tpublic unit?: string;\n\t/** Set by async resolvers when a fetch timed out, the result is a fallback (typically 0). */\n\tpublic timedOut?: boolean;\n\n\tconstructor(\n\t\ttype: ValueType,\n\t\tvalue: number | bigint | string | boolean | MatrixData | RangeData | SymbolicNode,\n\t\tunit?: string\n\t) {\n\t\tthis.type = type;\n\t\tthis.value = value;\n\t\tthis.unit = unit;\n\t\t// Eagerly cache for Number and Hex types (the most common case).\n\t\t// This avoids a method call + type-check on first toNumber().\n\t\tif (typeof value === 'number') {\n\t\t\tthis._cachedNumber = value;\n\t\t}\n\t}\n\n\t/**\n\t * Phase 5.3: Reset all fields for arena reuse.\n\t * Called by ValueArena.acquire(), zero allocation, just field assignment.\n\t */\n\trecycle(type: ValueType, value: number | bigint | string | boolean | MatrixData | RangeData | SymbolicNode, unit?: string): void {\n\t\tthis.type = type;\n\t\tthis.value = value;\n\t\tthis.unit = unit;\n\t\t// Clear cache, value changed, cached number is stale.\n\t\t// Re-eager-cache for Number type (most common).\n\t\tthis._cachedNumber = typeof value === 'number' ? value : undefined;\n\t\t// Clear timeout flag, recycled Values shouldn't inherit stale metadata.\n\t\tthis.timedOut = undefined;\n\t}\n\n\tisNumber(): this is Value & { value: number } {\n\t\treturn this.type === ValueType.Number;\n\t}\n\n\tisHex(): this is Value & { value: number } {\n\t\treturn this.type === ValueType.Hex;\n\t}\n\n\tisBigInt(): this is Value & { value: bigint } {\n\t\treturn this.type === ValueType.BigInt;\n\t}\n\n\tisString(): this is Value & { value: string } {\n\t\treturn this.type === ValueType.String;\n\t}\n\n\tisMatrix(): this is Value & { value: MatrixData } {\n\t\treturn this.type === ValueType.Matrix;\n\t}\n\n\t/** A Matrix shaped like a vector, 1×N (row) or N×1 (column). */\n\tisVectorShape(): boolean {\n\t\tif (this.type !== ValueType.Matrix) return false;\n\t\tconst m = this.value as MatrixData;\n\t\treturn m.rows === 1 || m.cols === 1;\n\t}\n\n\tisRange(): this is Value & { value: RangeData } {\n\t\treturn this.type === ValueType.Range;\n\t}\n\n\tisSymbolic(): this is Value & { value: SymbolicNode } {\n\t\treturn this.type === ValueType.Symbolic;\n\t}\n\n\ttoNumber(): number {\n\t\t// Pending/Error have no numeric representation at all, 0 (established\n\t\t// convention). A genuinely multi-cell Matrix has no single numeric\n\t\t// representation either (real callers branch on `.isMatrix()` BEFORE\n\t\t// reaching this fallback. See e.g. VM.ts's MUL/comparison dispatch)\n\t\t// but a 1x1 Matrix, the shape `float(x)`'s legacy sugar produces, see\n\t\t// packages/vector/parselets/FloatParselet.ts, IS a scalar in every\n\t\t// meaningful sense, so it degrades to that single cell's numeric value\n\t\t// rather than 0 (this exact case used to work \"by accident\" pre-Matrix,\n\t\t// since `parseFloat([2].toString())` happened to yield `2`).\n\t\tif (this.type === ValueType.Pending) return 0;\n\t\tif (this.type === ValueType.Error) return 0;\n\t\tif (this.type === ValueType.Matrix) {\n\t\t\tconst m = this.value as MatrixData;\n\t\t\tif (m.rows === 1 && m.cols === 1 && typeof m.data[0] === \"number\") return m.data[0];\n\t\t\treturn 0;\n\t\t}\n\t\tif (this.type === ValueType.Range) return 0;\n\t\t// A symbolic expression has no single concrete numeric value by\n\t\t// definition (it's a free-variable formula), 0, matching the\n\t\t// Pending/Error/Range convention. Real callers branch on\n\t\t// `.isSymbolic()` BEFORE reaching this fallback (see\n\t\t// `VMConversion.ts`'s `binaryOp()`).\n\t\tif (this.type === ValueType.Symbolic) return 0;\n\n\t\tif (this._cachedNumber !== undefined) return this._cachedNumber;\n\n\t\tif (typeof this.value === 'bigint') {\n\t\t\tthis._cachedNumber = Number(this.value);\n\t\t\treturn this._cachedNumber;\n\t\t}\n\t\t// Prevent silent NaN propagation from non-numeric strings\n\t\tconst result = parseFloat(this.value as string);\n\t\tthis._cachedNumber = isNaN(result) ? 0 : result;\n\t\treturn this._cachedNumber;\n\t}\n\n\tisNaN(): boolean {\n\t\tif (this.type === ValueType.Pending) return false;\n\t\tif (this.type === ValueType.Error) return false;\n\t\tif (this.type === ValueType.Matrix) {\n\t\t\tconst m = this.value as MatrixData;\n\t\t\tif (m.rows === 1 && m.cols === 1 && typeof m.data[0] === \"number\") return isNaN(m.data[0]);\n\t\t\treturn false;\n\t\t}\n\t\tif (this.type === ValueType.Range) return false;\n\t\tif (this.type === ValueType.Symbolic) return false;\n\t\tif (typeof this.value === 'number') return isNaN(this.value);\n\t\tif (typeof this.value === 'bigint') return false;\n\t\treturn isNaN(parseFloat(this.value as string));\n\t}\n}\n\n/**\n * Create a Number-typed Value. Uses the arena when active for zero-allocation.\n * This is the most common factory, over 90% of all Value creations.\n */\nexport function numberValue(n: number): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Number, n);\n\treturn new Value(ValueType.Number, n);\n}\n\n/** Which base a {@link ValueType.Hex} value is displayed in. */\nexport type DisplayBase = \"hex\" | \"bin\" | \"oct\";\n\n/**\n * Create a Hex-typed Value: a **number** that displays in another base.\n *\n * The type is numeric on purpose, and that is the whole point of it. A base is\n * a way of writing a quantity, not a different kind of quantity, so `0xFF + 1`\n * has to be 256. Returning a string instead makes it 1, because a string reads\n * as zero in arithmetic, and nothing about that failure is visible at the point\n * of use.\n *\n * @param n - The number itself, in full precision.\n * @param base - How to display it, defaulting to hexadecimal. Carried in the\n * `unit` slot, which is free for this type.\n */\nexport function hexValue(n: number, base: DisplayBase = \"hex\"): Value {\n\tconst tag = base === \"hex\" ? undefined : base;\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Hex, n, tag);\n\treturn new Value(ValueType.Hex, n, tag);\n}\n\n/** Create a BigInt-typed Value (arbitrary-precision integer). */\nexport function bigIntValue(n: bigint): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.BigInt, n);\n\treturn new Value(ValueType.BigInt, n);\n}\n\n/** Create a String-typed Value. */\nexport function stringValue(s: string): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.String, s);\n\treturn new Value(ValueType.String, s);\n}\n\n/** Create a Unit-of-Measurement Value (typed number with unit annotation). */\nexport function uomValue(n: number, unit: string): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Uom, n, unit);\n\treturn new Value(ValueType.Uom, n, unit);\n}\n\n// ── Rate, \"quantity per unit of something\" (SoulverCore: `$99/week`\n// `3 hours/day`, `30 fps`). Represented as a `ValueType.Uom` (no new\n// ValueType, a rate IS a unit-of-measurement, just a compound one) whose\n// `unit` string is `\"<numerator>/<denominator>\"`. The numerator is an\n// opaque label (may be a real convertible unit like \"USD\"/\"km\", or a bare\n// tag like \"frames\" that the `convert` package doesn't know about, rate\n// arithmetic never needs to convert the numerator, only compare it for\n// equality when combining two rates). The denominator MUST be a unit\n// `convertUnit()`/`getMeasure()` (uom/UomConverter.ts) recognizes, since\n// that's the part rate arithmetic actually rescales. See `vm/VM.ts`'s\n// `RATE_CONVERT`/`RATE_MUL`/`RATE_DIV` opcodes for the operations built on\n// this representation.\n\n/** Create a Rate value: `magnitude` of `numeratorUnit` per one `denominatorUnit`. */\nexport function rateValue(magnitude: number, numeratorUnit: string, denominatorUnit: string): Value {\n\treturn uomValue(magnitude, `${numeratorUnit}/${denominatorUnit}`);\n}\n\n/** Whether `unit` is a compound rate unit (`\"X/Y\"`) rather than a plain unit. */\nexport function isRateUnit(unit: string | undefined): unit is string {\n\treturn typeof unit === \"string\" && unit.includes(\"/\");\n}\n\n/**\n * Split a rate unit string into its numerator/denominator halves.\n * @throws if `unit` isn't a rate unit, check with {@link isRateUnit} first.\n */\nexport function splitRateUnit(unit: string): { numerator: string; denominator: string } {\n\tconst idx = unit.indexOf(\"/\");\n\tif (idx < 0) {\n\t\tthrow ErrorFactory.internal(\n\t\t\t\"INVALID_RATE_UNIT\",\n\t\t\t`splitRateUnit: \"${unit}\" is not a rate unit (expected \"numerator/denominator\")`,\n\t\t\t{ unit },\n\t\t);\n\t}\n\treturn { numerator: unit.slice(0, idx), denominator: unit.slice(idx + 1) };\n}\n\n/** Join a numerator/denominator pair back into a rate unit string. */\nexport function joinRateUnit(numeratorUnit: string, denominatorUnit: string): string {\n\treturn `${numeratorUnit}/${denominatorUnit}`;\n}\n\n// ── Video timecode, \"HH:MM:SS:FF at a given fps\" (SoulverCore: video\n// editing timecode literals, e.g. `01:02:03:04 at 30fps`). Represented the\n// same way Rate is above: NOT a new ValueType, just a `ValueType.Uom` whose\n// `unit` string is `\"timecode@<fps>\"` and whose numeric `value` is the\n// TOTAL FRAME COUNT since 00:00:00:00 at that fps, e.g. \"00:00:01:00 at\n// 30fps\" is `Uom(30, \"timecode@30\")`.\n//\n// Storing the total frame count (rather than four separate H/M/S/F fields)\n// means ordinary integer addition/subtraction on the numeric value is\n// ALREADY correct carry/borrow-aware arithmetic with zero extra logic\n// e.g. \"frame 29 + 2 frames\" at 30fps is just `29 + 2 = 31`, and 31 total\n// frames at 30fps IS frame 1 of the next second, with no explicit carry\n// step required. Carry/borrow only needs to be reconstructed when\n// converting a total frame count back into HH:MM:SS:FF display notation\n// see `packages/time/timecode/TimecodeMath.ts`'s `framesToTimecodeString()`.\n// See `vm/VM.ts`'s ADD/SUB dispatch for the arithmetic built on this\n// representation (timecode + frames, + duration, + timecode, - timecode).\n\nconst TIMECODE_UNIT_PREFIX = \"timecode@\";\n\n/** Build a timecode Uom unit string embedding its frame rate, e.g. `timecodeUnit(30)` -> `\"timecode@30\"`. */\nexport function timecodeUnit(fps: number): string {\n\treturn `${TIMECODE_UNIT_PREFIX}${fps}`;\n}\n\n/** Whether `unit` is a compound video-timecode unit (`\"timecode@<fps>\"`). */\nexport function isTimecodeUnit(unit: string | undefined): unit is string {\n\treturn typeof unit === \"string\" && unit.startsWith(TIMECODE_UNIT_PREFIX);\n}\n\n/**\n * Extract the fps from a timecode unit string.\n * @throws if `unit` isn't a timecode unit, check with {@link isTimecodeUnit} first.\n */\nexport function timecodeFps(unit: string): number {\n\tif (!isTimecodeUnit(unit)) {\n\t\tthrow ErrorFactory.internal(\n\t\t\t\"INVALID_TIMECODE_UNIT\",\n\t\t\t`timecodeFps: \"${unit}\" is not a timecode unit (expected \"timecode@<fps>\")`,\n\t\t\t{ unit },\n\t\t);\n\t}\n\treturn parseFloat(unit.slice(TIMECODE_UNIT_PREFIX.length));\n}\n\n/**\n * Create a Matrix value from an explicit shape + column-major data array.\n * `data.length` must equal `rows*cols`, callers building a matrix from\n * row-major source syntax (e.g. the `[1,2;3,4]` literal) must transpose\n * into column-major order before calling this; see `MatrixOps.ts`'s\n * `rowMajorToColumnMajor()`.\n */\nexport function matrixValue(rows: number, cols: number, data: readonly MatrixEntry[]): Value {\n\t// A SymbolicNode cell is the only object-typed MatrixEntry variant\n\t// (number/boolean are primitives), a cheap, always-correct way to\n\t// derive hasSymbolic without asking every caller to track it by hand.\n\t// The `\"kind\" in cell` half is a tripwire, not redundancy. MatrixEntry is\n\t// `number | boolean | SymbolicNode`, so an object cell should always be a\n\t// node; requiring the discriminant means a Rational that escaped\n\t// MatrixOps.ts's symbolicToEntry() shows up as a wrong result rather than as\n\t// a matrix that silently believes it is symbolic.\n\tconst hasSymbolic = data.some(cell => typeof cell === \"object\" && cell !== null && \"kind\" in cell);\n\tconst m: MatrixData = { rows, cols, data, hasSymbolic };\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Matrix, m);\n\treturn new Value(ValueType.Matrix, m);\n}\n\n/** A 1×N row-vector Matrix, row-major and column-major storage are identical for a single row. */\nexport function rowVectorValue(data: readonly number[]): Value {\n\treturn matrixValue(1, data.length, data);\n}\n\n/** An N×1 column-vector Matrix, row-major and column-major storage are identical for a single column. */\nexport function colVectorValue(data: readonly number[]): Value {\n\treturn matrixValue(data.length, 1, data);\n}\n\n/** Create a Range value, a first-class integer range `min:max`, both bounds inclusive. */\nexport function rangeValue(min: number, max: number): Value {\n\tconst r: RangeData = { min, max };\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Range, r);\n\treturn new Value(ValueType.Range, r);\n}\n\n/** Create a Symbolic value, a free-variable algebraic expression tree (`symbolic/SymbolicNode.ts`'s `SymbolicNode`), not a concrete number. */\nexport function symbolicValue(node: SymbolicNode): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Symbolic, node);\n\treturn new Value(ValueType.Symbolic, node);\n}\n\n\n\n/** Create a Boolean-typed Value. */\nexport function boolValue(b: boolean): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Boolean, b);\n\treturn new Value(ValueType.Boolean, b);\n}\n\n/** Create a Datetime-typed Value (Unix timestamp in milliseconds). */\nexport function datetimeValue(n: number): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Datetime, n);\n\treturn new Value(ValueType.Datetime, n);\n}\n\n/** Create a Percentage-typed Value (stored as fraction, e.g. 0.5 for 50%). */\nexport function percentageValue(n: number): Value {\n\tif (_arenaActive && _arena) return _arena.acquire(ValueType.Percentage, n);\n\treturn new Value(ValueType.Percentage, n);\n}\n\n/**\n * Create a Pending value, signals that an async result is not yet resolved.\n * The value field stores the queryKey string for deduplication and diagnostics.\n * Pending values should NEVER be stored in the arena (they persist across\n * scroll frames until resolution completes).\n */\nexport function pendingValue(queryKey: string): Value {\n\treturn new Value(ValueType.Pending, queryKey);\n}\n\n/**\n * Create an Error value, propagated through the DAG when a plugin raises an error.\n * The value field stores the EngineError code, unit stores the message.\n * Downstream consumers (lines that depend on errored data) bubble this up.\n * Should NEVER be stored in the arena.\n */\nexport function errorValue(code: string, message: string): Value {\n\treturn new Value(ValueType.Error, code, message);\n}\n"]}
@@ -0,0 +1,114 @@
1
+ 'use strict';
2
+
3
+ // src/uom/CurrencyAliases.ts
4
+ var CURRENCY_SYMBOL_ALIASES = {
5
+ "$": "USD",
6
+ "\xA3": "GBP",
7
+ "\u20AC": "EUR",
8
+ // ¥ is genuinely ambiguous between JPY and CNY in real-world usage, JPY
9
+ // is the conventional default (matches Numi/most calculator apps' own
10
+ // choice); a user wanting CNY specifically can still type "CNY" directly.
11
+ "\xA5": "JPY",
12
+ "\u20BD": "RUB",
13
+ "\u20A9": "KRW",
14
+ "\u20B9": "INR",
15
+ "\u20BA": "TRY",
16
+ "\u20B4": "UAH",
17
+ "\u20AA": "ILS",
18
+ "\u20AB": "VND",
19
+ "\u20A6": "NGN",
20
+ "\u20B1": "PHP"
21
+ };
22
+ var CURRENCY_WORD_ALIASES = {
23
+ dollar: "USD",
24
+ dollars: "USD",
25
+ euro: "EUR",
26
+ euros: "EUR",
27
+ yen: "JPY",
28
+ ruble: "RUB",
29
+ rubles: "RUB",
30
+ rouble: "RUB",
31
+ roubles: "RUB",
32
+ won: "KRW",
33
+ rupee: "INR",
34
+ rupees: "INR",
35
+ yuan: "CNY",
36
+ renminbi: "CNY",
37
+ franc: "CHF",
38
+ francs: "CHF",
39
+ rand: "ZAR",
40
+ krona: "SEK",
41
+ kronor: "SEK",
42
+ krone: "NOK",
43
+ kroner: "NOK",
44
+ real: "BRL",
45
+ reais: "BRL",
46
+ peso: "MXN",
47
+ pesos: "MXN",
48
+ shekel: "ILS",
49
+ shekels: "ILS",
50
+ lira: "TRY",
51
+ hryvnia: "UAH",
52
+ hryvnias: "UAH",
53
+ zloty: "PLN",
54
+ zlotys: "PLN",
55
+ forint: "HUF",
56
+ koruna: "CZK",
57
+ dirham: "AED",
58
+ dirhams: "AED",
59
+ riyal: "SAR",
60
+ riyals: "SAR",
61
+ rial: "SAR",
62
+ rials: "SAR",
63
+ ringgit: "MYR",
64
+ rupiah: "IDR",
65
+ baht: "THB",
66
+ dong: "VND",
67
+ naira: "NGN"
68
+ };
69
+ function resolveCurrencyAlias(text) {
70
+ return CURRENCY_SYMBOL_ALIASES[text] ?? CURRENCY_WORD_ALIASES[text.toLowerCase()];
71
+ }
72
+ var CURRENCY_DISPLAY = {
73
+ USD: { symbol: "$", position: "prefix", spaced: false },
74
+ AUD: { symbol: "$", position: "prefix", spaced: false },
75
+ CAD: { symbol: "$", position: "prefix", spaced: false },
76
+ NZD: { symbol: "$", position: "prefix", spaced: false },
77
+ HKD: { symbol: "$", position: "prefix", spaced: false },
78
+ SGD: { symbol: "$", position: "prefix", spaced: false },
79
+ MXN: { symbol: "$", position: "prefix", spaced: false },
80
+ GBP: { symbol: "\xA3", position: "prefix", spaced: false },
81
+ // English-language convention (€100.00), many EU locales instead suffix
82
+ // with a space ("100,00 €"); this engine's default locale is "en", so
83
+ // the English convention was chosen. A locale-aware override would be a
84
+ // reasonable future extension, not attempted here.
85
+ EUR: { symbol: "\u20AC", position: "prefix", spaced: false },
86
+ JPY: { symbol: "\xA5", position: "prefix", spaced: false },
87
+ CNY: { symbol: "\xA5", position: "prefix", spaced: false },
88
+ KRW: { symbol: "\u20A9", position: "prefix", spaced: false },
89
+ INR: { symbol: "\u20B9", position: "prefix", spaced: false },
90
+ // Russian convention places the ruble sign AFTER the amount, with a space.
91
+ RUB: { symbol: "\u20BD", position: "suffix", spaced: true },
92
+ TRY: { symbol: "\u20BA", position: "prefix", spaced: false },
93
+ UAH: { symbol: "\u20B4", position: "suffix", spaced: true },
94
+ ILS: { symbol: "\u20AA", position: "prefix", spaced: false },
95
+ // Vietnamese convention: no space, symbol after the amount.
96
+ VND: { symbol: "\u20AB", position: "suffix", spaced: false },
97
+ NGN: { symbol: "\u20A6", position: "prefix", spaced: false },
98
+ PHP: { symbol: "\u20B1", position: "prefix", spaced: false },
99
+ BRL: { symbol: "R$", position: "prefix", spaced: false },
100
+ ZAR: { symbol: "R", position: "prefix", spaced: false },
101
+ // Scandinavian convention: amount then "kr", space-separated.
102
+ SEK: { symbol: "kr", position: "suffix", spaced: true },
103
+ NOK: { symbol: "kr", position: "suffix", spaced: true },
104
+ DKK: { symbol: "kr", position: "suffix", spaced: true },
105
+ PLN: { symbol: "z\u0142", position: "suffix", spaced: true },
106
+ CHF: { symbol: "Fr", position: "suffix", spaced: true },
107
+ HUF: { symbol: "Ft", position: "suffix", spaced: true },
108
+ CZK: { symbol: "K\u010D", position: "suffix", spaced: true }
109
+ };
110
+
111
+ exports.CURRENCY_DISPLAY = CURRENCY_DISPLAY;
112
+ exports.resolveCurrencyAlias = resolveCurrencyAlias;
113
+ //# sourceMappingURL=chunk-OT6OJY7C.cjs.map
114
+ //# sourceMappingURL=chunk-OT6OJY7C.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/uom/CurrencyAliases.ts"],"names":[],"mappings":";;;AAwBO,IAAM,uBAAA,GAAkD;AAAA,EAC7D,GAAA,EAAK,KAAA;AAAA,EACL,MAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA;AAAA;AAAA;AAAA,EAIL,MAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK,KAAA;AAAA,EACL,QAAA,EAAK;AACP,CAAA;AAuCO,IAAM,qBAAA,GAAgD;AAAA,EAC3D,MAAA,EAAQ,KAAA;AAAA,EAAO,OAAA,EAAS,KAAA;AAAA,EACxB,IAAA,EAAM,KAAA;AAAA,EAAO,KAAA,EAAO,KAAA;AAAA,EACpB,GAAA,EAAK,KAAA;AAAA,EACL,KAAA,EAAO,KAAA;AAAA,EAAO,MAAA,EAAQ,KAAA;AAAA,EAAO,MAAA,EAAQ,KAAA;AAAA,EAAO,OAAA,EAAS,K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U,QAAQ,IAAA,EAAK;AAAA,EACtD,KAAK,EAAE,MAAA,EAAQ,WAAM,QAAA,EAAU,QAAA,EAAU,QAAQ,IAAA;AACnD","file":"chunk-OT6OJY7C.cjs","sourcesContent":["/**\n * Currency symbol/word → ISO 4217 code aliases, and the reverse table used\n * for display formatting (see `format/FormatEngine.ts`'s `formatUom()`).\n *\n * Single source of truth for BOTH directions so the same ambiguity\n * decisions (documented inline below) aren't made twice, inconsistently,\n * in two different files.\n */\n\n/**\n * Currency SYMBOLS (non-alphanumeric characters), safe to recognize as\n * bare lexer tokens with zero risk of colliding with a variable name,\n * since `:name = expr` variable names can never be symbol characters.\n * `CurrencySymbolParselet.ts` consumes these directly.\n *\n * `¥`/`₱`/`peso` ambiguity note: the PESO SIGN (₱) is, per Unicode, the\n * Philippine peso specifically, but the WORD \"peso\" (see\n * `CURRENCY_WORD_ALIASES` below) defaults to the Mexican peso, the most\n * globally recognized \"peso\" in English financial writing. This is a\n * deliberate inconsistency between the symbol and the word for the same\n * general concept, same reasoning as `¥` (JPY) vs \"yuan\" (CNY) below\n * document rather than silently guess, and a user wanting the other one\n * can always type the ISO code directly (\"PHP\"/\"CNY\").\n */\nexport const CURRENCY_SYMBOL_ALIASES: Record<string, string> = {\n \"$\": \"USD\",\n \"£\": \"GBP\",\n \"€\": \"EUR\",\n // ¥ is genuinely ambiguous between JPY and CNY in real-world usage, JPY\n // is the conventional default (matches Numi/most calculator apps' own\n // choice); a user wanting CNY specifically can still type \"CNY\" directly.\n \"¥\": \"JPY\",\n \"₽\": \"RUB\",\n \"₩\": \"KRW\",\n \"₹\": \"INR\",\n \"₺\": \"TRY\",\n \"₴\": \"UAH\",\n \"₪\": \"ILS\",\n \"₫\": \"VND\",\n \"₦\": \"NGN\",\n \"₱\": \"PHP\",\n};\n\n/**\n * Currency WORD forms (singular/plural, all lowercase. This codebase's\n * unit table is strictly case-sensitive with no aliasing, so \"Euro\"/\"EURO\"\n * are deliberately NOT recognized, matching every other word-unit here).\n * Registered as `UNIT` tokens (see `lexer/units.ts`) rather than bare\n * keywords: a bare keyword can never be a `:variableName` (this codebase's\n * tested, intentional policy. See `VariableParselet.ts`'s doc comment)\n * but `:dollar = 5` etc. must keep working, and UNIT-typed tokens ARE\n * accepted as variable names (e.g. \":b = 5\" already works for the \"b\" bits\n * unit), so these ride the same safe mechanism `workday`/`workdays` used.\n *\n * Deliberately NOT included: \"pound\"/\"pounds\", already a MASS unit in\n * `lexer/units.ts` (450g, matching \"lb\"). Remapping it to GBP would be a\n * real, silent regression for anyone using \"5 pounds\" to mean weight; GBP\n * stays reachable via the £ symbol or the \"GBP\" code, same as before.\n *\n * Deliberately NOT included: \"dinar\", used by ~10 countries (Kuwaiti\n * Bahraini, Jordanian, Iraqi, Algerian, ... dinars) with wildly different\n * values (a Kuwaiti dinar is worth roughly 1000x an Algerian one), no\n * single default is defensible the way ¥→JPY or peso→MXN are. Type the\n * ISO code directly (KWD/BHD/JOD/...).\n *\n * Ambiguous-but-resolved cases, and why:\n * - \"peso\"/\"pesos\" → MXN (Mexican peso is the most globally recognized\n * \"peso\" in English financial writing). See the ₱ symbol note above\n * for why this deliberately differs from the ₱ SYMBOL's PHP mapping.\n * - \"franc\"/\"francs\" → CHF (Swiss franc; also used by several African\n * currencies, CHF is the overwhelmingly dominant \"franc\" in English use).\n * - \"krona\"/\"kronor\" → SEK (Swedish); \"krone\"/\"kroner\" → NOK (Norwegian)\n * Danish also uses \"krone\" (DKK) with the identical spelling as\n * Norwegian; NOK was picked arbitrarily as the more commonly-referenced\n * of the two in English text. Type \"DKK\" directly for Danish krone.\n * - \"riyal\"/\"riyals\"/\"rial\"/\"rials\" → SAR (Saudi riyal), both spellings\n * also refer to Qatari/Omani riyals and the Iranian rial; SAR is the\n * most commonly referenced in English. Type \"QAR\"/\"OMR\"/\"IRR\" directly\n * for the others.\n */\nexport const CURRENCY_WORD_ALIASES: Record<string, string> = {\n dollar: \"USD\", dollars: \"USD\",\n euro: \"EUR\", euros: \"EUR\",\n yen: \"JPY\",\n ruble: \"RUB\", rubles: \"RUB\", rouble: \"RUB\", roubles: \"RUB\",\n won: \"KRW\",\n rupee: \"INR\", rupees: \"INR\",\n yuan: \"CNY\", renminbi: \"CNY\",\n franc: \"CHF\", francs: \"CHF\",\n rand: \"ZAR\",\n krona: \"SEK\", kronor: \"SEK\",\n krone: \"NOK\", kroner: \"NOK\",\n real: \"BRL\", reais: \"BRL\",\n peso: \"MXN\", pesos: \"MXN\",\n shekel: \"ILS\", shekels: \"ILS\",\n lira: \"TRY\",\n hryvnia: \"UAH\", hryvnias: \"UAH\",\n zloty: \"PLN\", zlotys: \"PLN\",\n forint: \"HUF\",\n koruna: \"CZK\",\n dirham: \"AED\", dirhams: \"AED\",\n riyal: \"SAR\", riyals: \"SAR\", rial: \"SAR\", rials: \"SAR\",\n ringgit: \"MYR\",\n rupiah: \"IDR\",\n baht: \"THB\",\n dong: \"VND\",\n naira: \"NGN\",\n};\n\n/**\n * Resolve a raw lexed unit/symbol string to its canonical ISO 4217 code\n * e.g. `\"euro\"` -> `\"EUR\"`, `\"$\"` -> `\"USD\"`, `\"USD\"` -> `\"USD\"` (already\n * canonical, returned unchanged). Returns `undefined` if `text` isn't a\n * recognized currency alias at all (distinct from \"already canonical\"\n * callers should fall back to the original text in that case).\n */\nexport function resolveCurrencyAlias(text: string): string | undefined {\n return CURRENCY_SYMBOL_ALIASES[text] ?? CURRENCY_WORD_ALIASES[text.toLowerCase()];\n}\n\n/** How a currency's amount and symbol are conventionally arranged for display. */\nexport interface CurrencyDisplayInfo {\n /** The symbol/abbreviation to render, e.g. \"$\", \"kr\", \"R$\". */\n readonly symbol: string;\n /** Whether the symbol comes before or after the formatted amount. */\n readonly position: \"prefix\" | \"suffix\";\n /** Whether a space separates the symbol from the amount. */\n readonly spaced: boolean;\n}\n\n/**\n * Display convention per ISO code, for currencies with a widely-recognized\n * symbol/abbreviation and an unambiguous placement convention. NOT\n * exhaustive, any code absent here (most of the ~150 codes\n * `CurrencyExchange.isCurrency()` recognizes) falls back to the existing\n * \"amount CODE\" format (e.g. \"100.00 AED\") in `FormatEngine.formatUom()`,\n * exactly as before this table existed. Extend as needed, same pattern as\n * this session's other \"not exhaustive, additive\" tables (city timezones,\n * ingredient densities).\n *\n * Several currencies share the same symbol (USD/AUD/CAD/NZD/HKD/SGD/MXN\n * all conventionally use \"$\" locally). This is safe here because OUTPUT\n * formatting always starts from an already-resolved, unambiguous ISO code\n * (`value.unit`), unlike INPUT parsing where a bare \"$\" genuinely is\n * ambiguous (see `CURRENCY_SYMBOL_ALIASES`'s USD default above).\n */\nexport const CURRENCY_DISPLAY: Record<string, CurrencyDisplayInfo> = {\n USD: { symbol: \"$\", position: \"prefix\", spaced: false },\n AUD: { symbol: \"$\", position: \"prefix\", spaced: false },\n CAD: { symbol: \"$\", position: \"prefix\", spaced: false },\n NZD: { symbol: \"$\", position: \"prefix\", spaced: false },\n HKD: { symbol: \"$\", position: \"prefix\", spaced: false },\n SGD: { symbol: \"$\", position: \"prefix\", spaced: false },\n MXN: { symbol: \"$\", position: \"prefix\", spaced: false },\n GBP: { symbol: \"£\", position: \"prefix\", spaced: false },\n // English-language convention (€100.00), many EU locales instead suffix\n // with a space (\"100,00 €\"); this engine's default locale is \"en\", so\n // the English convention was chosen. A locale-aware override would be a\n // reasonable future extension, not attempted here.\n EUR: { symbol: \"€\", position: \"prefix\", spaced: false },\n JPY: { symbol: \"¥\", position: \"prefix\", spaced: false },\n CNY: { symbol: \"¥\", position: \"prefix\", spaced: false },\n KRW: { symbol: \"₩\", position: \"prefix\", spaced: false },\n INR: { symbol: \"₹\", position: \"prefix\", spaced: false },\n // Russian convention places the ruble sign AFTER the amount, with a space.\n RUB: { symbol: \"₽\", position: \"suffix\", spaced: true },\n TRY: { symbol: \"₺\", position: \"prefix\", spaced: false },\n UAH: { symbol: \"₴\", position: \"suffix\", spaced: true },\n ILS: { symbol: \"₪\", position: \"prefix\", spaced: false },\n // Vietnamese convention: no space, symbol after the amount.\n VND: { symbol: \"₫\", position: \"suffix\", spaced: false },\n NGN: { symbol: \"₦\", position: \"prefix\", spaced: false },\n PHP: { symbol: \"₱\", position: \"prefix\", spaced: false },\n BRL: { symbol: \"R$\", position: \"prefix\", spaced: false },\n ZAR: { symbol: \"R\", position: \"prefix\", spaced: false },\n // Scandinavian convention: amount then \"kr\", space-separated.\n SEK: { symbol: \"kr\", position: \"suffix\", spaced: true },\n NOK: { symbol: \"kr\", position: \"suffix\", spaced: true },\n DKK: { symbol: \"kr\", position: \"suffix\", spaced: true },\n PLN: { symbol: \"zł\", position: \"suffix\", spaced: true },\n CHF: { symbol: \"Fr\", position: \"suffix\", spaced: true },\n HUF: { symbol: \"Ft\", position: \"suffix\", spaced: true },\n CZK: { symbol: \"Kč\", position: \"suffix\", spaced: true },\n};\n"]}