solve-engine 2.0.0 → 2.2.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 (82) hide show
  1. package/dist/{PackageCompatibility-Bn5jnBtA.d.cts → PackageCompatibility-Cv7zjqSV.d.cts} +1 -1
  2. package/dist/{PackageCompatibility-CIvq2MP5.d.ts → PackageCompatibility-DBsZ0l2a.d.ts} +1 -1
  3. package/dist/{PackageRegistry-dpdurBVO.d.cts → PackageRegistry-BSGQ6saH.d.cts} +9 -2
  4. package/dist/{PackageRegistry-DzeiWcv4.d.ts → PackageRegistry-DRbqNJfI.d.ts} +9 -2
  5. package/dist/{ScopeManager-C2LDOrDx.d.ts → ScopeManager-DkpnlKuz.d.ts} +1 -1
  6. package/dist/{ScopeManager-D7uMXbhS.d.cts → ScopeManager-t6SnP6Ce.d.cts} +1 -1
  7. package/dist/{VMCheckpoints-I9jg3jWR.d.cts → VMCheckpoints-C_jQvABf.d.cts} +2 -2
  8. package/dist/{VMCheckpoints-CGyFhivM.d.ts → VMCheckpoints-CsHmQVaD.d.ts} +2 -2
  9. package/dist/{chunk-6KFVG6UY.cjs → chunk-2LFLR3VZ.cjs} +2 -2
  10. package/dist/chunk-2LFLR3VZ.cjs.map +1 -0
  11. package/dist/{chunk-LR4E4A4W.cjs → chunk-32GC2FHC.cjs} +2 -2
  12. package/dist/{chunk-LR4E4A4W.cjs.map → chunk-32GC2FHC.cjs.map} +1 -1
  13. package/dist/chunk-5FO4PDIG.js +2 -0
  14. package/dist/chunk-5FO4PDIG.js.map +1 -0
  15. package/dist/{chunk-WN5CMP4T.cjs → chunk-6C6IPUBH.cjs} +3 -3
  16. package/dist/chunk-6C6IPUBH.cjs.map +1 -0
  17. package/dist/{chunk-SZGK6RIP.cjs → chunk-7BXPCWKM.cjs} +2 -2
  18. package/dist/{chunk-SZGK6RIP.cjs.map → chunk-7BXPCWKM.cjs.map} +1 -1
  19. package/dist/chunk-7NXAZJDB.js +3 -0
  20. package/dist/chunk-7NXAZJDB.js.map +1 -0
  21. package/dist/{chunk-EYRBENHC.js → chunk-E2Q3PQ2G.js} +3 -3
  22. package/dist/{chunk-EYRBENHC.js.map → chunk-E2Q3PQ2G.js.map} +1 -1
  23. package/dist/{chunk-UI6IFGBT.js → chunk-G7TBEQRQ.js} +2 -2
  24. package/dist/chunk-G7TBEQRQ.js.map +1 -0
  25. package/dist/{chunk-L3FPQSGN.js → chunk-KVTOV3TZ.js} +2 -2
  26. package/dist/{chunk-L3FPQSGN.js.map → chunk-KVTOV3TZ.js.map} +1 -1
  27. package/dist/{chunk-SUXRZWH2.cjs → chunk-OVKDDTXO.cjs} +3 -3
  28. package/dist/{chunk-SUXRZWH2.cjs.map → chunk-OVKDDTXO.cjs.map} +1 -1
  29. package/dist/{chunk-6CY44ZPG.js → chunk-TN5E6JU6.js} +2 -2
  30. package/dist/{chunk-6CY44ZPG.js.map → chunk-TN5E6JU6.js.map} +1 -1
  31. package/dist/{chunk-4J7XZSZJ.cjs → chunk-U2UZJX5W.cjs} +4 -4
  32. package/dist/chunk-U2UZJX5W.cjs.map +1 -0
  33. package/dist/chunk-VAGS5JS7.cjs +2 -0
  34. package/dist/chunk-VAGS5JS7.cjs.map +1 -0
  35. package/dist/{chunk-UDQ57ZRX.cjs → chunk-X3R7B7XM.cjs} +2 -2
  36. package/dist/{chunk-UDQ57ZRX.cjs.map → chunk-X3R7B7XM.cjs.map} +1 -1
  37. package/dist/{chunk-GOIQYUWV.js → chunk-YAHGSBMC.js} +2 -2
  38. package/dist/{chunk-GOIQYUWV.js.map → chunk-YAHGSBMC.js.map} +1 -1
  39. package/dist/{chunk-XR7HEC7B.js → chunk-YU3PACLE.js} +4 -4
  40. package/dist/chunk-YU3PACLE.js.map +1 -0
  41. package/dist/constants.cjs +1 -1
  42. package/dist/constants.js +1 -1
  43. package/dist/engine.cjs +1 -1
  44. package/dist/engine.d.cts +48 -5
  45. package/dist/engine.d.ts +48 -5
  46. package/dist/engine.js +1 -1
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.d.cts +4 -4
  49. package/dist/index.d.ts +4 -4
  50. package/dist/index.js +1 -1
  51. package/dist/language.d.cts +3 -3
  52. package/dist/language.d.ts +3 -3
  53. package/dist/lexer.cjs +1 -1
  54. package/dist/lexer.js +1 -1
  55. package/dist/normalizer.cjs +1 -1
  56. package/dist/normalizer.js +1 -1
  57. package/dist/packages.cjs +1 -1
  58. package/dist/packages.d.cts +2 -2
  59. package/dist/packages.d.ts +2 -2
  60. package/dist/packages.js +1 -1
  61. package/dist/testing.cjs +2 -2
  62. package/dist/testing.d.cts +3 -3
  63. package/dist/testing.d.ts +3 -3
  64. package/dist/testing.js +1 -1
  65. package/dist/vm.d.cts +3 -3
  66. package/dist/vm.d.ts +3 -3
  67. package/dist/worker.cjs +2 -2
  68. package/dist/worker.d.cts +2 -2
  69. package/dist/worker.d.ts +2 -2
  70. package/dist/worker.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunk-4J7XZSZJ.cjs.map +0 -1
  73. package/dist/chunk-6KFVG6UY.cjs.map +0 -1
  74. package/dist/chunk-APN442VD.cjs +0 -2
  75. package/dist/chunk-APN442VD.cjs.map +0 -1
  76. package/dist/chunk-JSPKKNPQ.js +0 -3
  77. package/dist/chunk-JSPKKNPQ.js.map +0 -1
  78. package/dist/chunk-QXQE7X4S.js +0 -2
  79. package/dist/chunk-QXQE7X4S.js.map +0 -1
  80. package/dist/chunk-UI6IFGBT.js.map +0 -1
  81. package/dist/chunk-WN5CMP4T.cjs.map +0 -1
  82. package/dist/chunk-XR7HEC7B.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-dpdurBVO.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-BSGQ6saH.cjs';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-DzeiWcv4.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-DRbqNJfI.js';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -3,7 +3,7 @@ import { V as Value, b as ValueType } from './Value-CCi_Eecs.cjs';
3
3
  import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-B4C1qHXu.cjs';
4
4
  import { IAsyncResolver } from './resolvers.cjs';
5
5
  import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-DnlL7_8c.cjs';
6
- import { a as DependencyGraph, V as VM, D as DagSnapshot, b as EngineContext, S as ScopeManager, P as PluginFunctionHandler } from './ScopeManager-D7uMXbhS.cjs';
6
+ import { D as DependencyGraph, V as VM, a as DagSnapshot, b as EngineContext, S as ScopeManager, P as PluginFunctionHandler } from './ScopeManager-t6SnP6Ce.cjs';
7
7
  import { a as BytecodeProgram } from './BytecodeBuilder-DGGeByAP.cjs';
8
8
  import { QueryClient } from '@tanstack/query-core';
9
9
  import { E as EngineError } from './EngineError-Ce1lPkjZ.cjs';
@@ -1629,6 +1629,13 @@ declare class ExpressionEngine {
1629
1629
  * {@link makeLineContext} has something to read from.
1630
1630
  */
1631
1631
  setDocumentModel(doc: DocumentModel | null): void;
1632
+ /**
1633
+ * The `DocumentModel` this engine is currently wired to, or `null` when it
1634
+ * is not driving one. Lets a caller that borrows the engine for a one-off
1635
+ * incremental pass (see {@link evaluateDocument}) put back whatever a host
1636
+ * had set, rather than assuming it was `null`.
1637
+ */
1638
+ getDocumentModel(): DocumentModel | null;
1632
1639
  /**
1633
1640
  * Build the {@link LineExecutionContext} passed to `executeBytecode()`
1634
1641
  * for a given line. `lineNumber = -1` (the existing sentinel
@@ -3087,4 +3094,4 @@ interface IEnginePackage {
3087
3094
  asConverters?: Record<string, (value: Value) => Value>;
3088
3095
  }
3089
3096
 
3090
- export { type ApplyChangesResult as A, type BatcherMetrics as B, type CacheSnapshot as C, DocumentModel as D, ExpressionEngine as E, LanguageService as F, type LanguageServiceOptions as G, type SemanticToken as H, type IEnginePackage as I, type ParsingResult as J, type LineChange as L, type ParsedLine as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineOptions as a, type EngineRestoreOptions as b, type EngineSnapshot as c, type Explanation as d, type ExplanationStep as e, SNAPSHOT_VERSION as f, type SerializedAnonymousBody as g, type SerializedBytecode as h, type SerializedDecimal as i, type SerializedLineCacheEntry as j, type SerializedNumber as k, type SerializedRational as l, type SerializedUserFunction as m, type SerializedValue as n, SnapshotErrorCodes as o, type InlineSolvePosition as p, type AsyncCachePackageInfo as q, type AsyncErrorEvent as r, AsyncResolutionBatcher as s, type AsyncResolutionEvent as t, type BytecodeCacheEntry as u, type CheckpointSnapshot as v, type LineCacheEntryInfo as w, type LineState as x, type LinesUpdatedEvent as y, type CompletionItem as z };
3097
+ export { type ApplyChangesResult as A, type BatcherMetrics as B, type CompletionItem as C, DocumentModel as D, ExpressionEngine as E, type LineCacheEntryInfo as F, type LineState as G, type LinesUpdatedEvent as H, type IEnginePackage as I, type ParsedLine as J, LanguageService as L, type ParsingResult as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineOptions as a, type EngineRestoreOptions as b, type EngineSnapshot as c, type Explanation as d, type ExplanationStep as e, SNAPSHOT_VERSION as f, type SerializedAnonymousBody as g, type SerializedBytecode as h, type SerializedDecimal as i, type SerializedLineCacheEntry as j, type SerializedNumber as k, type SerializedRational as l, type SerializedUserFunction as m, type SerializedValue as n, SnapshotErrorCodes as o, type LanguageServiceOptions as p, type SemanticToken as q, type LineChange as r, type InlineSolvePosition as s, type AsyncCachePackageInfo as t, type AsyncErrorEvent as u, AsyncResolutionBatcher as v, type AsyncResolutionEvent as w, type BytecodeCacheEntry as x, type CacheSnapshot as y, type CheckpointSnapshot as z };
@@ -3,7 +3,7 @@ import { V as Value, b as ValueType } from './Value-CCi_Eecs.js';
3
3
  import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-DKMlj7Sy.js';
4
4
  import { IAsyncResolver } from './resolvers.js';
5
5
  import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-DCWdZjGz.js';
6
- import { a as DependencyGraph, V as VM, D as DagSnapshot, b as EngineContext, S as ScopeManager, P as PluginFunctionHandler } from './ScopeManager-C2LDOrDx.js';
6
+ import { D as DependencyGraph, V as VM, a as DagSnapshot, b as EngineContext, S as ScopeManager, P as PluginFunctionHandler } from './ScopeManager-DkpnlKuz.js';
7
7
  import { a as BytecodeProgram } from './BytecodeBuilder-DGGeByAP.js';
8
8
  import { QueryClient } from '@tanstack/query-core';
9
9
  import { E as EngineError } from './EngineError-Ce1lPkjZ.js';
@@ -1629,6 +1629,13 @@ declare class ExpressionEngine {
1629
1629
  * {@link makeLineContext} has something to read from.
1630
1630
  */
1631
1631
  setDocumentModel(doc: DocumentModel | null): void;
1632
+ /**
1633
+ * The `DocumentModel` this engine is currently wired to, or `null` when it
1634
+ * is not driving one. Lets a caller that borrows the engine for a one-off
1635
+ * incremental pass (see {@link evaluateDocument}) put back whatever a host
1636
+ * had set, rather than assuming it was `null`.
1637
+ */
1638
+ getDocumentModel(): DocumentModel | null;
1632
1639
  /**
1633
1640
  * Build the {@link LineExecutionContext} passed to `executeBytecode()`
1634
1641
  * for a given line. `lineNumber = -1` (the existing sentinel
@@ -3087,4 +3094,4 @@ interface IEnginePackage {
3087
3094
  asConverters?: Record<string, (value: Value) => Value>;
3088
3095
  }
3089
3096
 
3090
- export { type ApplyChangesResult as A, type BatcherMetrics as B, type CacheSnapshot as C, DocumentModel as D, ExpressionEngine as E, LanguageService as F, type LanguageServiceOptions as G, type SemanticToken as H, type IEnginePackage as I, type ParsingResult as J, type LineChange as L, type ParsedLine as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineOptions as a, type EngineRestoreOptions as b, type EngineSnapshot as c, type Explanation as d, type ExplanationStep as e, SNAPSHOT_VERSION as f, type SerializedAnonymousBody as g, type SerializedBytecode as h, type SerializedDecimal as i, type SerializedLineCacheEntry as j, type SerializedNumber as k, type SerializedRational as l, type SerializedUserFunction as m, type SerializedValue as n, SnapshotErrorCodes as o, type InlineSolvePosition as p, type AsyncCachePackageInfo as q, type AsyncErrorEvent as r, AsyncResolutionBatcher as s, type AsyncResolutionEvent as t, type BytecodeCacheEntry as u, type CheckpointSnapshot as v, type LineCacheEntryInfo as w, type LineState as x, type LinesUpdatedEvent as y, type CompletionItem as z };
3097
+ export { type ApplyChangesResult as A, type BatcherMetrics as B, type CompletionItem as C, DocumentModel as D, ExpressionEngine as E, type LineCacheEntryInfo as F, type LineState as G, type LinesUpdatedEvent as H, type IEnginePackage as I, type ParsedLine as J, LanguageService as L, type ParsingResult as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineOptions as a, type EngineRestoreOptions as b, type EngineSnapshot as c, type Explanation as d, type ExplanationStep as e, SNAPSHOT_VERSION as f, type SerializedAnonymousBody as g, type SerializedBytecode as h, type SerializedDecimal as i, type SerializedLineCacheEntry as j, type SerializedNumber as k, type SerializedRational as l, type SerializedUserFunction as m, type SerializedValue as n, SnapshotErrorCodes as o, type LanguageServiceOptions as p, type SemanticToken as q, type LineChange as r, type InlineSolvePosition as s, type AsyncCachePackageInfo as t, type AsyncErrorEvent as u, AsyncResolutionBatcher as v, type AsyncResolutionEvent as w, type BytecodeCacheEntry as x, type CacheSnapshot as y, type CheckpointSnapshot as z };
@@ -674,4 +674,4 @@ declare class ScopeManager {
674
674
  clear(): void;
675
675
  }
676
676
 
677
- export { type Bytecode as B, type DagSnapshot as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, DependencyGraph as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
677
+ export { type Bytecode as B, DependencyGraph as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, type DagSnapshot as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
@@ -674,4 +674,4 @@ declare class ScopeManager {
674
674
  clear(): void;
675
675
  }
676
676
 
677
- export { type Bytecode as B, type DagSnapshot as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, DependencyGraph as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
677
+ export { type Bytecode as B, DependencyGraph as D, type ExpressionRecord as E, OpRegistry as O, type PluginFunctionHandler as P, ScopeManager as S, type VM as V, type DagSnapshot as a, type EngineContext as b, createVM as c, executeBytecode as e, sharedOpRegistry as s };
@@ -1,5 +1,5 @@
1
1
  import { V as Value } from './Value-CCi_Eecs.cjs';
2
- import { V as VM } from './ScopeManager-D7uMXbhS.cjs';
2
+ import { V as VM } from './ScopeManager-t6SnP6Ce.cjs';
3
3
  import { U as UserFunctionDef } from './BytecodeBuilder-DGGeByAP.cjs';
4
4
 
5
5
  /**
@@ -168,4 +168,4 @@ declare class VMCheckpointer {
168
168
  get vmInstance(): VM;
169
169
  }
170
170
 
171
- export { VMCheckpointer as V, type VMCheckpoint as a };
171
+ export { type VMCheckpoint as V, VMCheckpointer as a };
@@ -1,5 +1,5 @@
1
1
  import { V as Value } from './Value-CCi_Eecs.js';
2
- import { V as VM } from './ScopeManager-C2LDOrDx.js';
2
+ import { V as VM } from './ScopeManager-DkpnlKuz.js';
3
3
  import { U as UserFunctionDef } from './BytecodeBuilder-DGGeByAP.js';
4
4
 
5
5
  /**
@@ -168,4 +168,4 @@ declare class VMCheckpointer {
168
168
  get vmInstance(): VM;
169
169
  }
170
170
 
171
- export { VMCheckpointer as V, type VMCheckpoint as a };
171
+ export { type VMCheckpoint as V, VMCheckpointer as a };
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs'),chunkMSYX32PF_cjs=require('./chunk-MSYX32PF.cjs'),chunkFWW3M36J_cjs=require('./chunk-FWW3M36J.cjs'),chunkSOMGSIO4_cjs=require('./chunk-SOMGSIO4.cjs');chunk5IJD5L3O_cjs.e();function g(){let c=new Uint8Array(128);for(let r=48;r<=57;r++)c[r]=2;for(let r=65;r<=90;r++)c[r]=3;for(let r=97;r<=122;r++)c[r]=3;return c[95]=3,c[46]=4,c[32]=1,c[9]=1,c[10]=1,c[13]=1,c[33]=5,c[37]=5,c[38]=5,c[40]=5,c[41]=5,c[42]=5,c[43]=5,c[44]=5,c[45]=5,c[47]=5,c[58]=5,c[59]=5,c[60]=5,c[61]=5,c[62]=5,c[63]=5,c[91]=5,c[93]=5,c[94]=5,c[123]=5,c[124]=5,c[125]=5,c[126]=5,c[64]=5,c[34]=6,c[35]=7,c[36]=8,c[96]=11,c}function w(c){return c===133||c===160||c===5760||c>=8192&&c<=8202||c===8203||c===8232||c===8233||c===8239||c===8287||c===12288||c===65279}var a=class{constructor(r,t,e,s,o,i,l,n,d){this.type=r;this.typeId=t;this.value=e;this.text=s;this.offset=o;this.lineBreaks=i;this.line=l;this.col=n;this.sourceEnd=d;}},E={61:{61:"EQUALITY",62:"THEREFORE"},33:{61:"NEQ"},62:{61:"GTE"},60:{61:"LTE"},38:{38:"LOGICAL_AND"},124:{124:"LOGICAL_OR"},43:{61:"PLUS_EQUALS"},45:{61:"MINUS_EQUALS"}},y={43:"PLUS",45:"MINUS",42:"STAR",47:"SLASH",94:"CARET",37:"PERCENT",40:"LPAREN",41:"RPAREN",91:"LBRACKET",93:"RBRACKET",123:"LBRACE",125:"RBRACE",44:"COMMA",58:"COLON",59:"SEMICOLON",61:"EQUALS",63:"QUESTION",33:"BANG",38:"BIT_AND",124:"BIT_OR",60:"LT",62:"GT",126:"BIT_NOT",64:"AT"},b=(()=>{let c=new Set;for(let t=48;t<=57;t++)c.add(t);let r=[43,45,42,47,94,37,40,41,91,93,123,125,61,60,62,33,38,124,126,59,63];for(let t of r)c.add(t);return c.add(36),c.add(163),c.add(8364),c.add(165),c.add(8381),c.add(8361),c.add(96),c.add(46),c.add(35),c})(),S=class S{constructor(r="en",t){this.configuredLookup=null;this.input="";this.pos=0;this.len=0;this.line=1;this.lineStartPos=0;this.groupingStack=[];this.pluginKeywordMap=new Map;this.pluginOperators=new Map;this.pluginUnits=new Set;this.hasPluginOps=false;this._inlineSolveSpans=[];this.pluginRawLinePatterns=[];this.pendingRawLineToken=null;this.localeCode=r,this.locale=chunkMSYX32PF_cjs.a(r),this.configuredLookup=t??null,this.keywordMap=new Map;for(let[e,s]of Object.entries(this.locale.keywordMap))this.keywordMap.set(e.toLowerCase(),s);this.mergedKeywords=new Map(this.keywordMap),this.mergedUnits=new Set(chunkFWW3M36J_cjs.a);}matchRawLine(r){for(let t of this.pluginRawLinePatterns){let e=t.pattern.exec(r);if(e&&typeof e[1]=="string"){let s=e[1].trim();if(s.length>0)return new a(t.tokenType,chunk5IJD5L3O_cjs.c(t.tokenType),s,s,0,0,this.line,1)}}return null}rebuildMergedCollections(){this.mergedKeywords=new Map([...this.keywordMap,...this.pluginKeywordMap]),this.mergedUnits=new Set([...chunkFWW3M36J_cjs.a,...this.pluginUnits]);}registerVocabulary(r){if(r.keywords){for(let[t,e]of Object.entries(r.keywords)){let s=t.toLowerCase();if(this.keywordMap.has(s))throw chunkSOMGSIO4_cjs.c.config("PLUGIN_KEYWORD_COLLISION",`Plugin keyword "${t}" conflicts with built-in keyword (type: ${this.keywordMap.get(s)}). Built-in keywords cannot be overridden.`,{keyword:t,builtinType:this.keywordMap.get(s)});this.pluginKeywordMap.set(s,e);}this.rebuildMergedCollections();}if(r.operators){this.hasPluginOps=true;for(let[t,e]of Object.entries(r.operators))if(t.length===2){let s=t.charCodeAt(0),o=t.charCodeAt(1),i=E[s];if(i&&i[o]!==void 0)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: ${i[o]}). Built-in operators cannot be overridden.`,{operator:t,builtinType:i[o]});if(s===60&&o===60)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: LSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"LSHIFT"});if(s===62&&o===62)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: RSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"RSHIFT"});if(s===47&&o===47)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in comment sequence. Comment sequences cannot be overridden.`,{operator:t,builtinType:"COMMENT"});let l=this.pluginOperators.get(s);l||(l=new Map,this.pluginOperators.set(s,l)),l.set(o,e);}}if(r.units){for(let t of r.units){if(chunkFWW3M36J_cjs.a.has(t))throw chunkSOMGSIO4_cjs.c.config("PLUGIN_UNIT_COLLISION",`Plugin unit "${t}" conflicts with a built-in unit. Built-in units cannot be overridden.`,{unit:t});this.pluginUnits.add(t);}this.rebuildMergedCollections();}r.rawLinePatterns&&this.pluginRawLinePatterns.push(...r.rawLinePatterns);}unregisterVocabulary(r){if(r.keywords){for(let t of Object.keys(r.keywords))this.pluginKeywordMap.delete(t.toLowerCase());this.rebuildMergedCollections();}if(r.operators){for(let t of Object.keys(r.operators))if(t.length===2){let e=t.charCodeAt(0),s=t.charCodeAt(1),o=this.pluginOperators.get(e);o&&(o.delete(s),o.size===0&&this.pluginOperators.delete(e));}this.hasPluginOps=this.pluginOperators.size>0;}if(r.units){for(let t of r.units)this.pluginUnits.delete(t);this.rebuildMergedCollections();}if(r.rawLinePatterns){let t=new Set(r.rawLinePatterns);this.pluginRawLinePatterns=this.pluginRawLinePatterns.filter(e=>!t.has(e));}}reset(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0,this.pendingRawLineToken=this.pluginRawLinePatterns.length>0?this.matchRawLine(r):null;}scanDocument(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0;let t=[],e=this.input,s=this.len;for(;this.pos<s;){let o=this.pos,i=this.pos;for(;i<s;){let p=e.charCodeAt(i);if(p===10||p===13)break;i++;}let l=this.line,n=this.classifyFromPositions(o,i),d=e.slice(o,i),u=[];if(!n.skip){let p=this.pluginRawLinePatterns.length>0?this.matchRawLine(d):null;if(p)u=[p];else {let C=this.len;this.len=i,n.contentOffset!==void 0&&(this.pos=n.contentOffset),u=Array.from(this),this.len=C;}}let f=[];if(n.hasInlineSolve)if(!n.skip&&u.length>0){let p=this.findInlineSolves(d);f=this._inlineSolveSpans.map((C,R)=>({start:p[R]?.start??0,end:p[R]?.end??0,expression:p[R]?.expression??"",columnNumber:p[R]?.columnNumber??C.columnNumber,startTokenIndex:C.startTokenIndex,endTokenIndex:C.endTokenIndex}));}else f=this.findInlineSolves(d);if(t.push({text:d,lineNumber:l,startOffset:o,endOffset:i,classification:n,tokens:u,inlineSolves:f}),this.pos=i,this.pos<s){let p=e.charCodeAt(this.pos);p===13?(this.pos++,this.pos<s&&e.charCodeAt(this.pos)===10&&this.pos++):p===10&&this.pos++;}this.line++,this.lineStartPos=this.pos;}return t}tokenizeAll(){return this.pendingRawLineToken?(this._inlineSolveSpans=[],[this.pendingRawLineToken]):Array.from(this)}*[Symbol.iterator](){let r=this.len;if(r===0){this._inlineSolveSpans=[];return}let t=0,e=null,s=[];if(r===1){let i=this.input.charCodeAt(0);switch(S.CHAR_CLASS[i]??0){case 2:case 4:yield new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),this.input,this.input,0,0,1,1),t++;break;case 3:{let n=this.input,d=n.toLowerCase();if(this.mergedUnits.has(n))yield new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),n,n,0,0,1,1);else {let u=this.mergedKeywords.get(d);u?yield new a(u,chunk5IJD5L3O_cjs.c(u),n,n,0,0,1,1):yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),n,n,0,0,1,1);}t++;break}case 5:{let n=y[i];n&&(yield new a(n,chunk5IJD5L3O_cjs.c(n),this.input,this.input,0,0,1,1),t++);break}case 6:this.pos=0,yield this.tokenizeString(),t++;break;case 7:this.pos=0,yield this.tokenizeComment(),t++;break;case 8:yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",0,0,1,1),t++;break;case 11:yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",0,0,1,1),t++;break;default:{w(i)||(i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",0,0,1,1),t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",0,0,1,1),t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",0,0,1,1),t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",0,0,1,1),t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",0,0,1,1),t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",0,0,1,1),t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",0,0,1,1),t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",0,0,1,1),t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",0,0,1,1),t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",0,0,1,1),t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",0,0,1,1),t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",0,0,1,1),t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",0,0,1,1),t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",0,0,1,1),t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",0,0,1,1),t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",0,0,1,1),t++):i>=128&&(yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),this.input,this.input,0,0,1,1),t++));break}}this._inlineSolveSpans=s;return}let o=this.input;for(this.groupingStack.length=0;this.pos<r;){let i=o.charCodeAt(this.pos),l=S.CHAR_CLASS[i]??0;if(e&&i===92&&this.pos+1<r&&o.charCodeAt(this.pos+1)===96){this.pos+=2;continue}switch(l){case 1:this.pos++,i===10?(this.line++,this.lineStartPos=this.pos,this.groupingStack.length=0):i===13&&(this.line++,this.pos<r&&o.charCodeAt(this.pos)===10&&this.pos++,this.lineStartPos=this.pos,this.groupingStack.length=0);break;case 2:yield this.tokenizeNumber(),t++;break;case 3:{let n=this.tokenizeIdentifier();n.type==="INLINE_SOLVE_START"&&(e={startTokenIndex:t,startColumn:n.col}),yield n,t++;break}case 4:if(this.pos+1<r)if((S.CHAR_CLASS[o.charCodeAt(this.pos+1)]??0)===2)yield this.tokenizeNumber();else {let d=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,d),this.pos++;}else {let n=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,n),this.pos++;}t++;break;case 5:yield this.tokenizeOperator(),t++;break;case 6:yield this.tokenizeString(),t++;break;case 7:yield this.tokenizeComment(),t++;break;case 8:{let n=this.pos-this.lineStartPos+1;yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",this.pos,0,this.line,n),this.pos++,t++;break}case 11:{let n=this.pos-this.lineStartPos+1;if(yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",this.pos,0,this.line,n),this.pos++,e){let d=e;s.push({start:0,end:0,expression:"",columnNumber:d.startColumn,startTokenIndex:d.startTokenIndex,endTokenIndex:t}),e=null;}t++;break}default:{let n=this.pos-this.lineStartPos+1;w(i)?(this.pos++,(i===8232||i===8233||i===133)&&(this.line++,this.lineStartPos=this.pos)):i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",this.pos,0,this.line,n),this.pos++,t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",this.pos,0,this.line,n),this.pos++,t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",this.pos,0,this.line,n),this.pos++,t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",this.pos,0,this.line,n),this.pos++,t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",this.pos,0,this.line,n),this.pos++,t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",this.pos,0,this.line,n),this.pos++,t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",this.pos,0,this.line,n),this.pos++,t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",this.pos,0,this.line,n),this.pos++,t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",this.pos,0,this.line,n),this.pos++,t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",this.pos,0,this.line,n),this.pos++,t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",this.pos,0,this.line,n),this.pos++,t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",this.pos,0,this.line,n),this.pos++,t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",this.pos,0,this.line,n),this.pos++,t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",this.pos,0,this.line,n),this.pos++,t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",this.pos,0,this.line,n),this.pos++,t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",this.pos,0,this.line,n),this.pos++,t++):i>=128?(yield this.tokenizeIdentifier(),t++):this.pos++;break}}}this._inlineSolveSpans=s;}tokenizeNumber(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;if(r.charCodeAt(e)===48&&e+1<t){let f=r.charCodeAt(e+1);if(f===120||f===88){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102);)e++;let p=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),p,p,s,0,this.line,o)}if(f===98||f===66){for(e+=2;e<t&&(i=r.charCodeAt(e),i===48||i===49);)e++;let p=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),p,p,s,0,this.line,o)}if(f===111||f===79){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=55);)e++;let p=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),p,p,s,0,this.line,o)}}let l=false;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)l=true,e++;for(;l&&e<t&&(r.charCodeAt(e)===44||r.charCodeAt(e)===46)&&!(r.charCodeAt(e)===44&&this.groupingStack.length>0&&this.groupingStack[this.groupingStack.length-1]);){if(e+4<=t){let f=r.charCodeAt(e+1),p=r.charCodeAt(e+2),C=r.charCodeAt(e+3),R=e+4<t?r.charCodeAt(e+4):-1,I=!(R>=48&&R<=57);if(f>=48&&f<=57&&p>=48&&p<=57&&C>=48&&C<=57&&I){e+=4,l=true;continue}}break}let n=false;if(e<t&&r.charCodeAt(e)===46&&e+1<t){let f=r.charCodeAt(e+1);if(f>=48&&f<=57)for(n=true,e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}let d=false;if(e<t){let f=r.charCodeAt(e);if((f===101||f===69)&&e+1<t){let p=r.charCodeAt(e+1);if(p>=48&&p<=57||p===43||p===45)for(d=true,e++,(p===43||p===45)&&e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}}if(e<t&&r.charCodeAt(e)===110&&l&&!n&&!d){e++;let f=r.slice(s,e);return this.pos=e,new a("BIGINT",chunk5IJD5L3O_cjs.c("BIGINT"),f,f,s,0,this.line,o)}let u=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),u,u,s,0,this.line,o)}tokenizeIdentifier(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95||i>=128&&!w(i));)e++;let l=r.slice(s,e),n=l.toLowerCase();if(n==="s"&&e<t&&r.charCodeAt(e)===96){e++,this.pos=e;let f=r.slice(s,e);return new a("INLINE_SOLVE_START",chunk5IJD5L3O_cjs.c("INLINE_SOLVE_START"),f,f,s,0,this.line,o)}if(this.mergedUnits.has(l)&&!this.isFollowedByLParen(e))return this.pos=e,new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),l,l,s,0,this.line,o);let u=this.mergedKeywords.get(n);return u?(this.pos=e,new a(u,chunk5IJD5L3O_cjs.c(u),l,l,s,0,this.line,o)):(this.pos=e,new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),l,l,s,0,this.line,o))}isFollowedByLParen(r){let t=this.len,e=r;for(;e<t;){let s=this.input.charCodeAt(e);if(s===40)return true;if(s!==32&&s!==9)break;e++;}return false}precededByCallTarget(r){let t=this.input,e=this.lineStartPos,s=r-1;for(;s>=e&&(t.charCodeAt(s)===32||t.charCodeAt(s)===9);)s--;if(s<e)return false;let o=t.charCodeAt(s),i=p=>p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p===95,l=p=>p>=65&&p<=90||p>=97&&p<=122||p===95;if(!i(o))return false;let n=s+1,d=false;for(;s>=e;){let p=t.charCodeAt(s);if(!i(p))break;l(p)&&(d=true),s--;}if(!d)return false;let u=t.slice(s+1,n).toLowerCase(),f=this.mergedKeywords.get(u);return f===void 0||f==="FUNC"}tokenizeOperator(){let r=this.input,t=this.pos,e=t-this.lineStartPos+1,s=r.charCodeAt(t),o=this.len;if(t+1<o){let n=r.charCodeAt(t+1),d=E[s];if(d){let u=d[n];if(u){let f=r.slice(t,t+2);return this.pos=t+2,new a(u,chunk5IJD5L3O_cjs.c(u),f,f,t,0,this.line,e)}}if(s===47&&n===47){let u=t+2;for(;u<o;){let p=r.charCodeAt(u);if(p===10||p===13)break;u++;}let f=r.slice(t,u);return this.pos=u,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),f,f,t,0,this.line,e)}if(s===60&&n===60)return this.pos=t+2,new a("LSHIFT",chunk5IJD5L3O_cjs.c("LSHIFT"),"<<","<<",t,0,this.line,e);if(s===62&&n===62)return r.charCodeAt(t+2)===62?(this.pos=t+3,new a("URSHIFT",chunk5IJD5L3O_cjs.c("URSHIFT"),">>>",">>>",t,0,this.line,e)):(this.pos=t+2,new a("RSHIFT",chunk5IJD5L3O_cjs.c("RSHIFT"),">>",">>",t,0,this.line,e));if(this.hasPluginOps){let u=this.pluginOperators.get(s);if(u){let f=u.get(n);if(f){let p=r.slice(t,t+2);return this.pos=t+2,new a(f,chunk5IJD5L3O_cjs.c(f),p,p,t,0,this.line,e)}}}}this.pos=t+1,s===91?this.groupingStack.push(true):s===40?this.groupingStack.push(this.precededByCallTarget(t)):(s===41||s===93)&&this.groupingStack.length>0&&this.groupingStack.pop();let i=y[s],l=r.charAt(t);return new a(i||"ERROR",chunk5IJD5L3O_cjs.c(i||"ERROR"),l,l,t,0,this.line,e)}tokenizeString(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1,o=e+1,i=0;for(;o<t;){let l=r.charCodeAt(o);if(l===34){o++;let n=r.slice(e,o),d=r.slice(e+1,o-1);return this.pos=o,new a("STRING",chunk5IJD5L3O_cjs.c("STRING"),d,n,e,i,this.line,s)}if(l===92&&o+1<t){o+=2;continue}l===10&&(this.line++,this.lineStartPos=o+1,i++),o++;}throw this.pos=o,chunkSOMGSIO4_cjs.c.parsing("UNTERMINATED_STRING",`Unterminated string literal: ${r.slice(e,o)}`,{literal:r.slice(e,o),offset:e})}static hasExpressionIndicators(r,t,e){let s=b;for(let o=t;o<e;o++){let i=r.charCodeAt(o);if(s.has(i)||i>=128&&(i===215||i===247||i===8800||i===163||i===8364||i===165||i===8381||i===8361))return true}return false}skipMarkerGap(r,t){let e=this.input,s=r;for(;s<t&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9);)s++;if(s+2<t&&e.charCodeAt(s)===91&&e.charCodeAt(s+2)===93){let o=s+3;for(;o<t&&(e.charCodeAt(o)===32||e.charCodeAt(o)===9);)o++;if(o>s+3)return o}return s}matchHexColourEnd(r,t){let e=this.input,s=r+1,o=0;for(;s<t;){let i=e.charCodeAt(s);if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))break;o++,s++;}if(o!==3&&o!==4&&o!==6&&o!==8)return -1;if(s<t){let i=e.charCodeAt(s);if(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95)return -1}return s}classifyFromPositions(r,t){let e=t;if(r>=e)return {type:"empty",skip:true,hasInlineSolve:false};let s=this.input,o=r;for(;o<e;){let n=s.charCodeAt(o);if(n!==32&&n!==9)break;o++;}if(o>=e)return {type:"empty",skip:true,hasInlineSolve:false};let i=s.charCodeAt(o),l;if(i===35){if(this.matchHexColourEnd(o,e)!==-1){if(l===void 0){let d=s.indexOf("s`",o);l=d!==-1&&d<e;}return {type:"expression",skip:false,hasInlineSolve:l}}let n=1;for(;o+n<e&&s.charCodeAt(o+n)===35;)n++;return n<=6&&o+n<e&&s.charCodeAt(o+n)===32?{type:"heading",skip:true,hasInlineSolve:false}:{type:"heading",skip:true,hasInlineSolve:false}}if(i===62&&o+1<e&&s.charCodeAt(o+1)===32)return {type:"blockquote",skip:true,hasInlineSolve:false};if(i===96&&o+2<e&&s.charCodeAt(o+1)===96&&s.charCodeAt(o+2)===96)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===126&&o+2<e&&s.charCodeAt(o+1)===126&&s.charCodeAt(o+2)===126)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===36&&o+1<e&&s.charCodeAt(o+1)===36)return {type:"math_fence",skip:true,hasInlineSolve:false};if(i===45||i===42||i===95){let n=1;for(;o+n<e&&s.charCodeAt(o+n)===i;)n++;if(n>=3){let d=o+n;for(;d<e&&(s.charCodeAt(d)===32||s.charCodeAt(d)===9);)d++;if(d>=e)return {type:"hr",skip:true,hasInlineSolve:false}}}if((i===45||i===42||i===43)&&o+1<e&&s.charCodeAt(o+1)===32){if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(o+1,e)}}if(i>=48&&i<=57){let n=o;for(;n<e&&s.charCodeAt(n)>=48&&s.charCodeAt(n)<=57;)n++;if(n<e&&s.charCodeAt(n)===46&&n+1<e&&s.charCodeAt(n+1)===32){if(l===void 0){let d=s.indexOf("s`",o);l=d!==-1&&d<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(n+1,e)}}}if(i===124){let n=o+1;for(;n<e;){let d=s.charCodeAt(n);if(d!==45&&d!==58&&d!==124&&d!==32&&d!==9&&d!==13)break;n++;}if(n>=e)return {type:"table_separator",skip:true,hasInlineSolve:false}}if(i===91&&o+1<e&&s.charCodeAt(o+1)===91){let n=s.indexOf("]]",o+2);if(n!==-1&&n<e){let d=n+2;for(;d<e&&(s.charCodeAt(d)===32||s.charCodeAt(d)===9);)d++;if(d>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===33&&o+2<e&&s.charCodeAt(o+1)===91&&s.charCodeAt(o+2)===91){let n=s.indexOf("]]",o+3);if(n!==-1&&n<e){let d=n+2;for(;d<e&&(s.charCodeAt(d)===32||s.charCodeAt(d)===9);)d++;if(d>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===47&&o+1<e&&s.charCodeAt(o+1)===47)return {type:"comment",skip:true,hasInlineSolve:false};if(i===62){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"blockquote",skip:true,hasInlineSolve:false}}if(i===45||i===42||i===43){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"list",skip:false,hasInlineSolve:false}}if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}if(!l){let n=true;for(let d=o;d<e;d++){let u=s.charCodeAt(d);if(u>=128||S.CHAR_CLASS[u]>1){n=false;break}}if(n)return {type:"empty",skip:true,hasInlineSolve:false}}return {type:"expression",skip:false,hasInlineSolve:l}}classifyLine(r){let t=this.input,e=this.len,s=this.pos;this.input=r,this.len=r.length,this.pos=0;let o=this.classifyFromPositions(0,r.length);return this.input=t,this.len=e,this.pos=s,o}getKeywords(){return Object.fromEntries(this.mergedKeywords)}findInlineSolves(r){let t=[],e=r.length,s=0;for(;s<e;){let o=r.indexOf("s`",s);if(o===-1)break;let i=o+2,l=i;for(;l<e;){let u=r.charCodeAt(l);if(u===92&&l+1<e){l+=2;continue}if(u===96)break;l++;}l>=e&&(l=e);let n=r.slice(i,l),d=l<e?l+1:l;t.push({start:o,end:d,expression:n,columnNumber:o+1}),s=d;}return t}tokenizeComment(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1;if(r.charCodeAt(e)===35){let l=this.matchHexColourEnd(e,t);if(l!==-1){let u=r.slice(e,l);return this.pos=l,new a("HEX_COLOUR",chunk5IJD5L3O_cjs.c("HEX_COLOUR"),u,u,e,0,this.line,s)}let n=r.charCodeAt(e+1);if(n>=65&&n<=90||n>=97&&n<=122){let u=e+2;for(;u<t;){let p=r.charCodeAt(u);if(!(p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p===95||p===45))break;u++;}let f=r.slice(e+1,u);return this.pos=u,new a("TAG",chunk5IJD5L3O_cjs.c("TAG"),f,f,e,0,this.line,s)}}let o=this.pos;for(o+1<t&&r.charCodeAt(o+1)===47?o+=2:o++;o<t;){let l=r.charCodeAt(o);if(l===10||l===13)break;o++;}let i=r.slice(e,o);return this.pos=o,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),i,i,e,0,this.line,s)}};S.CHAR_CLASS=g();var L=S;exports.a=a;exports.b=L;//# sourceMappingURL=chunk-6KFVG6UY.cjs.map
2
- //# sourceMappingURL=chunk-6KFVG6UY.cjs.map
1
+ 'use strict';var chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs'),chunkMSYX32PF_cjs=require('./chunk-MSYX32PF.cjs'),chunkFWW3M36J_cjs=require('./chunk-FWW3M36J.cjs'),chunkSOMGSIO4_cjs=require('./chunk-SOMGSIO4.cjs');chunk5IJD5L3O_cjs.e();function g(){let c=new Uint8Array(128);for(let r=48;r<=57;r++)c[r]=2;for(let r=65;r<=90;r++)c[r]=3;for(let r=97;r<=122;r++)c[r]=3;return c[95]=3,c[46]=4,c[32]=1,c[9]=1,c[10]=1,c[13]=1,c[33]=5,c[37]=5,c[38]=5,c[40]=5,c[41]=5,c[42]=5,c[43]=5,c[44]=5,c[45]=5,c[47]=5,c[58]=5,c[59]=5,c[60]=5,c[61]=5,c[62]=5,c[63]=5,c[91]=5,c[93]=5,c[94]=5,c[123]=5,c[124]=5,c[125]=5,c[126]=5,c[64]=5,c[34]=6,c[35]=7,c[36]=8,c[96]=11,c}function w(c){return c===133||c===160||c===5760||c>=8192&&c<=8202||c===8203||c===8232||c===8233||c===8239||c===8287||c===12288||c===65279}var a=class{constructor(r,t,e,s,o,i,l,n,p){this.type=r;this.typeId=t;this.value=e;this.text=s;this.offset=o;this.lineBreaks=i;this.line=l;this.col=n;this.sourceEnd=p;}},y={61:{61:"EQUALITY",62:"THEREFORE"},33:{61:"NEQ"},62:{61:"GTE"},60:{61:"LTE"},38:{38:"LOGICAL_AND"},124:{124:"LOGICAL_OR"},43:{61:"PLUS_EQUALS"},45:{61:"MINUS_EQUALS"}},L={43:"PLUS",45:"MINUS",42:"STAR",47:"SLASH",94:"CARET",37:"PERCENT",40:"LPAREN",41:"RPAREN",91:"LBRACKET",93:"RBRACKET",123:"LBRACE",125:"RBRACE",44:"COMMA",58:"COLON",59:"SEMICOLON",61:"EQUALS",63:"QUESTION",33:"BANG",38:"BIT_AND",124:"BIT_OR",60:"LT",62:"GT",126:"BIT_NOT",64:"AT"},b=(()=>{let c=new Set;for(let t=48;t<=57;t++)c.add(t);let r=[43,45,42,47,94,37,40,41,91,93,123,125,61,60,62,33,38,124,126,59,63];for(let t of r)c.add(t);return c.add(36),c.add(163),c.add(8364),c.add(165),c.add(8381),c.add(8361),c.add(96),c.add(46),c.add(35),c})(),S=class S{constructor(r="en",t){this.configuredLookup=null;this.input="";this.pos=0;this.len=0;this.line=1;this.lineStartPos=0;this.groupingStack=[];this.pluginKeywordMap=new Map;this.pluginOperators=new Map;this.pluginUnits=new Set;this.hasPluginOps=false;this._inlineSolveSpans=[];this.pluginRawLinePatterns=[];this.pendingRawLineToken=null;this.localeCode=r,this.locale=chunkMSYX32PF_cjs.a(r),this.configuredLookup=t??null,this.keywordMap=new Map;for(let[e,s]of Object.entries(this.locale.keywordMap))this.keywordMap.set(e.toLowerCase(),s);this.mergedKeywords=new Map(this.keywordMap),this.mergedUnits=new Set(chunkFWW3M36J_cjs.a);}matchRawLine(r){for(let t of this.pluginRawLinePatterns){let e=t.pattern.exec(r);if(e&&typeof e[1]=="string"){let s=e[1].trim();if(s.length>0)return new a(t.tokenType,chunk5IJD5L3O_cjs.c(t.tokenType),s,s,0,0,this.line,1)}}return null}rebuildMergedCollections(){this.mergedKeywords=new Map([...this.keywordMap,...this.pluginKeywordMap]),this.mergedUnits=new Set([...chunkFWW3M36J_cjs.a,...this.pluginUnits]);}registerVocabulary(r){if(r.keywords){for(let[t,e]of Object.entries(r.keywords)){let s=t.toLowerCase();if(this.keywordMap.has(s))throw chunkSOMGSIO4_cjs.c.config("PLUGIN_KEYWORD_COLLISION",`Plugin keyword "${t}" conflicts with built-in keyword (type: ${this.keywordMap.get(s)}). Built-in keywords cannot be overridden.`,{keyword:t,builtinType:this.keywordMap.get(s)});this.pluginKeywordMap.set(s,e);}this.rebuildMergedCollections();}if(r.operators){this.hasPluginOps=true;for(let[t,e]of Object.entries(r.operators))if(t.length===2){let s=t.charCodeAt(0),o=t.charCodeAt(1),i=y[s];if(i&&i[o]!==void 0)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: ${i[o]}). Built-in operators cannot be overridden.`,{operator:t,builtinType:i[o]});if(s===60&&o===60)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: LSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"LSHIFT"});if(s===62&&o===62)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in operator (type: RSHIFT). Built-in operators cannot be overridden.`,{operator:t,builtinType:"RSHIFT"});if(s===47&&o===47)throw chunkSOMGSIO4_cjs.c.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${t}" conflicts with built-in comment sequence. Comment sequences cannot be overridden.`,{operator:t,builtinType:"COMMENT"});let l=this.pluginOperators.get(s);l||(l=new Map,this.pluginOperators.set(s,l)),l.set(o,e);}}if(r.units){for(let t of r.units){if(chunkFWW3M36J_cjs.a.has(t))throw chunkSOMGSIO4_cjs.c.config("PLUGIN_UNIT_COLLISION",`Plugin unit "${t}" conflicts with a built-in unit. Built-in units cannot be overridden.`,{unit:t});this.pluginUnits.add(t);}this.rebuildMergedCollections();}r.rawLinePatterns&&this.pluginRawLinePatterns.push(...r.rawLinePatterns);}unregisterVocabulary(r){if(r.keywords){for(let t of Object.keys(r.keywords))this.pluginKeywordMap.delete(t.toLowerCase());this.rebuildMergedCollections();}if(r.operators){for(let t of Object.keys(r.operators))if(t.length===2){let e=t.charCodeAt(0),s=t.charCodeAt(1),o=this.pluginOperators.get(e);o&&(o.delete(s),o.size===0&&this.pluginOperators.delete(e));}this.hasPluginOps=this.pluginOperators.size>0;}if(r.units){for(let t of r.units)this.pluginUnits.delete(t);this.rebuildMergedCollections();}if(r.rawLinePatterns){let t=new Set(r.rawLinePatterns);this.pluginRawLinePatterns=this.pluginRawLinePatterns.filter(e=>!t.has(e));}}reset(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0,this.pendingRawLineToken=this.pluginRawLinePatterns.length>0?this.matchRawLine(r):null;}scanDocument(r){this.input=r,this.pos=0,this.len=r.length,this.line=1,this.lineStartPos=0;let t=[],e=this.input,s=this.len;for(;this.pos<s;){let o=this.pos,i=this.pos;for(;i<s;){let d=e.charCodeAt(i);if(d===10||d===13)break;i++;}let l=this.line,n=this.classifyFromPositions(o,i),p=e.slice(o,i),u=[];if(!n.skip){let d=this.pluginRawLinePatterns.length>0?this.matchRawLine(p):null;if(d)u=[d];else {let A=this.len;this.len=i,n.contentOffset!==void 0&&(this.pos=n.contentOffset),u=Array.from(this),this.len=A;}}let f=[];if(n.hasInlineSolve)if(!n.skip&&u.length>0){let d=this.findInlineSolves(p);f=this._inlineSolveSpans.map((A,C)=>({start:d[C]?.start??0,end:d[C]?.end??0,expression:d[C]?.expression??"",columnNumber:d[C]?.columnNumber??A.columnNumber,startTokenIndex:A.startTokenIndex,endTokenIndex:A.endTokenIndex}));}else f=this.findInlineSolves(p);if(t.push({text:p,lineNumber:l,startOffset:o,endOffset:i,classification:n,tokens:u,inlineSolves:f}),this.pos=i,this.pos<s){let d=e.charCodeAt(this.pos);d===13?(this.pos++,this.pos<s&&e.charCodeAt(this.pos)===10&&this.pos++):d===10&&this.pos++;}this.line++,this.lineStartPos=this.pos;}return t}tokenizeAll(){return this.pendingRawLineToken?(this._inlineSolveSpans=[],[this.pendingRawLineToken]):Array.from(this)}*[Symbol.iterator](){let r=this.len;if(r===0){this._inlineSolveSpans=[];return}let t=0,e=null,s=[];if(r===1){let i=this.input.charCodeAt(0);switch(S.CHAR_CLASS[i]??0){case 2:case 4:yield new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),this.input,this.input,0,0,1,1),t++;break;case 3:{let n=this.input,p=n.toLowerCase();if(this.mergedUnits.has(n))yield new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),n,n,0,0,1,1);else {let u=this.mergedKeywords.get(p);u?yield new a(u,chunk5IJD5L3O_cjs.c(u),n,n,0,0,1,1):yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),n,n,0,0,1,1);}t++;break}case 5:{let n=L[i];n&&(yield new a(n,chunk5IJD5L3O_cjs.c(n),this.input,this.input,0,0,1,1),t++);break}case 6:this.pos=0,yield this.tokenizeString(),t++;break;case 7:this.pos=0,yield this.tokenizeComment(),t++;break;case 8:yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",0,0,1,1),t++;break;case 11:yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",0,0,1,1),t++;break;default:{w(i)||(i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",0,0,1,1),t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",0,0,1,1),t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",0,0,1,1),t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",0,0,1,1),t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",0,0,1,1),t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",0,0,1,1),t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",0,0,1,1),t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",0,0,1,1),t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",0,0,1,1),t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",0,0,1,1),t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",0,0,1,1),t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",0,0,1,1),t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",0,0,1,1),t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",0,0,1,1),t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",0,0,1,1),t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",0,0,1,1),t++):i>=128&&(yield new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),this.input,this.input,0,0,1,1),t++));break}}this._inlineSolveSpans=s;return}let o=this.input;for(this.groupingStack.length=0;this.pos<r;){let i=o.charCodeAt(this.pos),l=S.CHAR_CLASS[i]??0;if(e&&i===92&&this.pos+1<r&&o.charCodeAt(this.pos+1)===96){this.pos+=2;continue}switch(l){case 1:this.pos++,i===10?(this.line++,this.lineStartPos=this.pos,this.groupingStack.length=0):i===13&&(this.line++,this.pos<r&&o.charCodeAt(this.pos)===10&&this.pos++,this.lineStartPos=this.pos,this.groupingStack.length=0);break;case 2:yield this.tokenizeNumber(),t++;break;case 3:{let n=this.tokenizeIdentifier();n.type==="INLINE_SOLVE_START"&&(e={startTokenIndex:t,startColumn:n.col}),yield n,t++;break}case 4:if(this.pos+1<r)if((S.CHAR_CLASS[o.charCodeAt(this.pos+1)]??0)===2)yield this.tokenizeNumber();else {let p=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,p),this.pos++;}else {let n=this.pos-this.lineStartPos+1;yield new a("DOT",chunk5IJD5L3O_cjs.c("DOT"),".",".",this.pos,0,this.line,n),this.pos++;}t++;break;case 5:yield this.tokenizeOperator(),t++;break;case 6:yield this.tokenizeString(),t++;break;case 7:yield this.tokenizeComment(),t++;break;case 8:{let n=this.pos-this.lineStartPos+1;yield new a("DOLLAR",chunk5IJD5L3O_cjs.c("DOLLAR"),"$","$",this.pos,0,this.line,n),this.pos++,t++;break}case 11:{let n=this.pos-this.lineStartPos+1;if(yield new a("BACKTICK_OPEN",chunk5IJD5L3O_cjs.c("BACKTICK_OPEN"),"`","`",this.pos,0,this.line,n),this.pos++,e){let p=e;s.push({start:0,end:0,expression:"",columnNumber:p.startColumn,startTokenIndex:p.startTokenIndex,endTokenIndex:t}),e=null;}t++;break}default:{let n=this.pos-this.lineStartPos+1;w(i)?(this.pos++,(i===8232||i===8233||i===133)&&(this.line++,this.lineStartPos=this.pos)):i===215?(yield new a("STAR",chunk5IJD5L3O_cjs.c("STAR"),"\xD7","\xD7",this.pos,0,this.line,n),this.pos++,t++):i===247?(yield new a("SLASH",chunk5IJD5L3O_cjs.c("SLASH"),"\xF7","\xF7",this.pos,0,this.line,n),this.pos++,t++):i===177?(yield new a("PLUS_MINUS",chunk5IJD5L3O_cjs.c("PLUS_MINUS"),"\xB1","\xB1",this.pos,0,this.line,n),this.pos++,t++):i===8800?(yield new a("NEQ",chunk5IJD5L3O_cjs.c("NEQ"),"\u2260","\u2260",this.pos,0,this.line,n),this.pos++,t++):i===163?(yield new a("POUND",chunk5IJD5L3O_cjs.c("POUND"),"\xA3","\xA3",this.pos,0,this.line,n),this.pos++,t++):i===8364?(yield new a("EURO",chunk5IJD5L3O_cjs.c("EURO"),"\u20AC","\u20AC",this.pos,0,this.line,n),this.pos++,t++):i===165?(yield new a("YEN",chunk5IJD5L3O_cjs.c("YEN"),"\xA5","\xA5",this.pos,0,this.line,n),this.pos++,t++):i===8381?(yield new a("RUBLE",chunk5IJD5L3O_cjs.c("RUBLE"),"\u20BD","\u20BD",this.pos,0,this.line,n),this.pos++,t++):i===8361?(yield new a("WON",chunk5IJD5L3O_cjs.c("WON"),"\u20A9","\u20A9",this.pos,0,this.line,n),this.pos++,t++):i===8377?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B9","\u20B9",this.pos,0,this.line,n),this.pos++,t++):i===8378?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20BA","\u20BA",this.pos,0,this.line,n),this.pos++,t++):i===8372?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B4","\u20B4",this.pos,0,this.line,n),this.pos++,t++):i===8362?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AA","\u20AA",this.pos,0,this.line,n),this.pos++,t++):i===8363?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20AB","\u20AB",this.pos,0,this.line,n),this.pos++,t++):i===8358?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20A6","\u20A6",this.pos,0,this.line,n),this.pos++,t++):i===8369?(yield new a("CURRENCY_SYMBOL",chunk5IJD5L3O_cjs.c("CURRENCY_SYMBOL"),"\u20B1","\u20B1",this.pos,0,this.line,n),this.pos++,t++):i>=128?(yield this.tokenizeIdentifier(),t++):this.pos++;break}}}this._inlineSolveSpans=s;}tokenizeNumber(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;if(r.charCodeAt(e)===48&&e+1<t){let f=r.charCodeAt(e+1);if(f===120||f===88){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}if(f===98||f===66){for(e+=2;e<t&&(i=r.charCodeAt(e),i===48||i===49);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}if(f===111||f===79){for(e+=2;e<t&&(i=r.charCodeAt(e),i>=48&&i<=55);)e++;let d=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),d,d,s,0,this.line,o)}}let l=false;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)l=true,e++;for(;l&&e<t&&(r.charCodeAt(e)===44||r.charCodeAt(e)===46)&&!(r.charCodeAt(e)===44&&this.groupingStack.length>0&&this.groupingStack[this.groupingStack.length-1]);){if(e+4<=t){let f=r.charCodeAt(e+1),d=r.charCodeAt(e+2),A=r.charCodeAt(e+3),C=e+4<t?r.charCodeAt(e+4):-1,T=!(C>=48&&C<=57);if(f>=48&&f<=57&&d>=48&&d<=57&&A>=48&&A<=57&&T){e+=4,l=true;continue}}break}let n=false;if(e<t&&r.charCodeAt(e)===46&&e+1<t){let f=r.charCodeAt(e+1);if(f>=48&&f<=57)for(n=true,e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}let p=false;if(e<t){let f=r.charCodeAt(e);if((f===101||f===69)&&e+1<t){let d=r.charCodeAt(e+1);if(d>=48&&d<=57||d===43||d===45)for(p=true,e++,(d===43||d===45)&&e++;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57);)e++;}}if(e<t&&r.charCodeAt(e)===110&&l&&!n&&!p){e++;let f=r.slice(s,e);return this.pos=e,new a("BIGINT",chunk5IJD5L3O_cjs.c("BIGINT"),f,f,s,0,this.line,o)}let u=r.slice(s,e);return this.pos=e,new a("NUMBER",chunk5IJD5L3O_cjs.c("NUMBER"),u,u,s,0,this.line,o)}tokenizeIdentifier(){let r=this.input,t=this.len,e=this.pos,s=e,o=e-this.lineStartPos+1,i;for(;e<t&&(i=r.charCodeAt(e),i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95||i>=128&&!w(i));)e++;let l=r.slice(s,e),n=l.toLowerCase();if(n==="s"&&e<t&&r.charCodeAt(e)===96){e++,this.pos=e;let f=r.slice(s,e);return new a("INLINE_SOLVE_START",chunk5IJD5L3O_cjs.c("INLINE_SOLVE_START"),f,f,s,0,this.line,o)}if(this.mergedUnits.has(l)&&!this.isFollowedByLParen(e))return this.pos=e,new a("UNIT",chunk5IJD5L3O_cjs.c("UNIT"),l,l,s,0,this.line,o);let u=this.mergedKeywords.get(n);return u?(this.pos=e,new a(u,chunk5IJD5L3O_cjs.c(u),l,l,s,0,this.line,o)):(this.pos=e,new a("IDENT",chunk5IJD5L3O_cjs.c("IDENT"),l,l,s,0,this.line,o))}isFollowedByLParen(r){let t=this.len,e=r;for(;e<t;){let s=this.input.charCodeAt(e);if(s===40)return true;if(s!==32&&s!==9)break;e++;}return false}precededByCallTarget(r){let t=this.input,e=this.lineStartPos,s=r-1;for(;s>=e&&(t.charCodeAt(s)===32||t.charCodeAt(s)===9);)s--;if(s<e)return false;let o=t.charCodeAt(s),i=d=>d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||d===95,l=d=>d>=65&&d<=90||d>=97&&d<=122||d===95;if(!i(o))return false;let n=s+1,p=false;for(;s>=e;){let d=t.charCodeAt(s);if(!i(d))break;l(d)&&(p=true),s--;}if(!p)return false;let u=t.slice(s+1,n).toLowerCase(),f=this.mergedKeywords.get(u);return f===void 0||f==="FUNC"}tokenizeOperator(){let r=this.input,t=this.pos,e=t-this.lineStartPos+1,s=r.charCodeAt(t),o=this.len;if(t+1<o){let n=r.charCodeAt(t+1),p=y[s];if(p){let u=p[n];if(u){let f=r.slice(t,t+2);return this.pos=t+2,new a(u,chunk5IJD5L3O_cjs.c(u),f,f,t,0,this.line,e)}}if(s===47&&n===47){let u=t+2;for(;u<o;){let d=r.charCodeAt(u);if(d===10||d===13)break;u++;}let f=r.slice(t,u);return this.pos=u,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),f,f,t,0,this.line,e)}if(s===60&&n===60)return this.pos=t+2,new a("LSHIFT",chunk5IJD5L3O_cjs.c("LSHIFT"),"<<","<<",t,0,this.line,e);if(s===62&&n===62)return r.charCodeAt(t+2)===62?(this.pos=t+3,new a("URSHIFT",chunk5IJD5L3O_cjs.c("URSHIFT"),">>>",">>>",t,0,this.line,e)):(this.pos=t+2,new a("RSHIFT",chunk5IJD5L3O_cjs.c("RSHIFT"),">>",">>",t,0,this.line,e));if(this.hasPluginOps){let u=this.pluginOperators.get(s);if(u){let f=u.get(n);if(f){let d=r.slice(t,t+2);return this.pos=t+2,new a(f,chunk5IJD5L3O_cjs.c(f),d,d,t,0,this.line,e)}}}}this.pos=t+1,s===91?this.groupingStack.push(true):s===40?this.groupingStack.push(this.precededByCallTarget(t)):(s===41||s===93)&&this.groupingStack.length>0&&this.groupingStack.pop();let i=L[s],l=r.charAt(t);return new a(i||"ERROR",chunk5IJD5L3O_cjs.c(i||"ERROR"),l,l,t,0,this.line,e)}tokenizeString(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1,o=e+1,i=0;for(;o<t;){let l=r.charCodeAt(o);if(l===34){o++;let n=r.slice(e,o),p=r.slice(e+1,o-1);return this.pos=o,new a("STRING",chunk5IJD5L3O_cjs.c("STRING"),p,n,e,i,this.line,s)}if(l===92&&o+1<t){o+=2;continue}l===10&&(this.line++,this.lineStartPos=o+1,i++),o++;}throw this.pos=o,chunkSOMGSIO4_cjs.c.parsing("UNTERMINATED_STRING",`Unterminated string literal: ${r.slice(e,o)}`,{literal:r.slice(e,o),offset:e})}static hasExpressionIndicators(r,t,e){let s=b;for(let o=t;o<e;o++){let i=r.charCodeAt(o);if(s.has(i)||i>=128&&(i===215||i===247||i===8800||i===163||i===8364||i===165||i===8381||i===8361))return true}return false}skipMarkerGap(r,t){let e=this.input,s=r;for(;s<t&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9);)s++;if(s+2<t&&e.charCodeAt(s)===91&&e.charCodeAt(s+2)===93){let o=s+3;for(;o<t&&(e.charCodeAt(o)===32||e.charCodeAt(o)===9);)o++;if(o>s+3)return o}return s}matchHexColourEnd(r,t){let e=this.input,s=r+1,o=0;for(;s<t;){let i=e.charCodeAt(s);if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))break;o++,s++;}if(o!==3&&o!==4&&o!==6&&o!==8)return -1;if(s<t){let i=e.charCodeAt(s);if(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95)return -1}return s}classifyFromPositions(r,t){let e=t;if(r>=e)return {type:"empty",skip:true,hasInlineSolve:false};let s=this.input,o=r;for(;o<e;){let n=s.charCodeAt(o);if(n!==32&&n!==9)break;o++;}if(o>=e)return {type:"empty",skip:true,hasInlineSolve:false};let i=s.charCodeAt(o),l;if(i===35){if(this.matchHexColourEnd(o,e)!==-1){if(l===void 0){let p=s.indexOf("s`",o);l=p!==-1&&p<e;}return {type:"expression",skip:false,hasInlineSolve:l}}let n=1;for(;o+n<e&&s.charCodeAt(o+n)===35;)n++;return n<=6&&o+n<e&&s.charCodeAt(o+n)===32?{type:"heading",skip:true,hasInlineSolve:false}:{type:"heading",skip:true,hasInlineSolve:false}}if(i===62&&o+1<e&&s.charCodeAt(o+1)===32)return {type:"blockquote",skip:true,hasInlineSolve:false};if(i===96&&o+2<e&&s.charCodeAt(o+1)===96&&s.charCodeAt(o+2)===96)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===126&&o+2<e&&s.charCodeAt(o+1)===126&&s.charCodeAt(o+2)===126)return {type:"code_fence",skip:true,hasInlineSolve:false};if(i===36&&o+1<e&&s.charCodeAt(o+1)===36)return {type:"math_fence",skip:true,hasInlineSolve:false};if(i===45||i===42||i===95){let n=1;for(;o+n<e&&s.charCodeAt(o+n)===i;)n++;if(n>=3){let p=o+n;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"hr",skip:true,hasInlineSolve:false}}}if((i===45||i===42||i===43)&&o+1<e&&s.charCodeAt(o+1)===32){if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(o+1,e)}}if(i>=48&&i<=57){let n=o;for(;n<e&&s.charCodeAt(n)>=48&&s.charCodeAt(n)<=57;)n++;if(n<e&&s.charCodeAt(n)===46&&n+1<e&&s.charCodeAt(n+1)===32){if(l===void 0){let p=s.indexOf("s`",o);l=p!==-1&&p<e;}return {type:"list",skip:false,hasInlineSolve:l,contentOffset:this.skipMarkerGap(n+1,e)}}}if(i===124){let n=o+1;for(;n<e;){let p=s.charCodeAt(n);if(p!==45&&p!==58&&p!==124&&p!==32&&p!==9&&p!==13)break;n++;}if(n>=e)return {type:"table_separator",skip:true,hasInlineSolve:false}}if(i===91&&o+1<e&&s.charCodeAt(o+1)===91){let n=s.indexOf("]]",o+2);if(n!==-1&&n<e){let p=n+2;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===33&&o+2<e&&s.charCodeAt(o+1)===91&&s.charCodeAt(o+2)===91){let n=s.indexOf("]]",o+3);if(n!==-1&&n<e){let p=n+2;for(;p<e&&(s.charCodeAt(p)===32||s.charCodeAt(p)===9);)p++;if(p>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(i===47&&o+1<e&&s.charCodeAt(o+1)===47)return {type:"comment",skip:true,hasInlineSolve:false};if(i===62){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"blockquote",skip:true,hasInlineSolve:false}}if(i===45||i===42||i===43){let n=o+1;for(;n<e&&(s.charCodeAt(n)===32||s.charCodeAt(n)===9);)n++;if(n>=e)return {type:"list",skip:false,hasInlineSolve:false}}if(l===void 0){let n=s.indexOf("s`",o);l=n!==-1&&n<e;}if(!l){let n=true;for(let p=o;p<e;p++){let u=s.charCodeAt(p);if(u>=128||S.CHAR_CLASS[u]>1){n=false;break}}if(n)return {type:"empty",skip:true,hasInlineSolve:false}}return {type:"expression",skip:false,hasInlineSolve:l}}classifyLine(r){let t=this.input,e=this.len,s=this.pos;this.input=r,this.len=r.length,this.pos=0;let o=this.classifyFromPositions(0,r.length);return this.input=t,this.len=e,this.pos=s,o}getKeywords(){return Object.fromEntries(this.mergedKeywords)}findInlineSolves(r){let t=[],e=r.length,s=0;for(;s<e;){let o=r.indexOf("s`",s);if(o===-1)break;let i=o+2,l=i;for(;l<e;){let u=r.charCodeAt(l);if(u===92&&l+1<e){l+=2;continue}if(u===96)break;l++;}l>=e&&(l=e);let n=r.slice(i,l),p=l<e?l+1:l;t.push({start:o,end:p,expression:n,columnNumber:o+1}),s=p;}return t}tokenizeComment(){let r=this.input,t=this.len,e=this.pos,s=e-this.lineStartPos+1;if(r.charCodeAt(e)===35){let l=this.matchHexColourEnd(e,t);if(l!==-1){let d=r.slice(e,l);return this.pos=l,new a("HEX_COLOUR",chunk5IJD5L3O_cjs.c("HEX_COLOUR"),d,d,e,0,this.line,s)}let n=r.charCodeAt(e+1),p=n>=65&&n<=90||n>=97&&n<=122,u=e>this.lineStartPos?r.charCodeAt(e-1):-1,f=u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||u===95;if(p&&!f){let d=e+2;for(;d<t;){let C=r.charCodeAt(d);if(!(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||C===95||C===45))break;d++;}let A=r.slice(e+1,d);return this.pos=d,new a("TAG",chunk5IJD5L3O_cjs.c("TAG"),A,A,e,0,this.line,s)}}let o=this.pos;for(o+1<t&&r.charCodeAt(o+1)===47?o+=2:o++;o<t;){let l=r.charCodeAt(o);if(l===10||l===13)break;o++;}let i=r.slice(e,o);return this.pos=o,new a("COMMENT",chunk5IJD5L3O_cjs.c("COMMENT"),i,i,e,0,this.line,s)}};S.CHAR_CLASS=g();var I=S;exports.a=a;exports.b=I;//# sourceMappingURL=chunk-2LFLR3VZ.cjs.map
2
+ //# sourceMappingURL=chunk-2LFLR3VZ.cjs.map