@loopstack/loopstack-studio 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/components/ai-elements/message.js +2 -2
  2. package/dist/components/ai-elements/reasoning.js +9 -9
  3. package/dist/loopstack-studio.css +1 -1
  4. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
  5. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
  6. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
  7. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
  8. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
  9. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
  10. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
  11. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
  12. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
  13. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
  14. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
  15. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
  16. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
  17. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
  18. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
  19. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
  20. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
  21. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
  22. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
  23. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
  24. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
  25. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
  26. package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
  27. package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
  28. package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
  29. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
  30. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
  31. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
  32. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
  33. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
  34. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
  35. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
  36. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
  37. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
  38. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
  39. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
  40. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
  41. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
  42. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
  43. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
  44. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
  45. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
  46. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
  47. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
  48. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
  49. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
  50. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
  51. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
  52. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
  53. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
  54. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
  55. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
  56. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
  57. package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
  58. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
  59. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  60. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  61. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  65. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  66. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  67. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  68. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
  69. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  70. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  71. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  72. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  73. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  74. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  75. package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
  76. package/dist/node_modules/katex/dist/katex.js +1256 -1209
  77. package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
  78. package/dist/node_modules/lodash-es/_baseClone.js +2 -2
  79. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  80. package/dist/node_modules/lodash-es/_baseToString.js +1 -1
  81. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  82. package/dist/node_modules/lodash-es/_createSet.js +1 -1
  83. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  84. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  85. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  86. package/dist/node_modules/lodash-es/flatMap.js +1 -1
  87. package/dist/node_modules/lodash-es/forEach.js +1 -1
  88. package/dist/node_modules/lodash-es/max.js +1 -1
  89. package/dist/node_modules/lodash-es/min.js +1 -1
  90. package/dist/node_modules/lodash-es/minBy.js +1 -1
  91. package/dist/node_modules/lodash-es/reduce.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
  106. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
  107. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
  108. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
  109. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
  110. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
  111. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
  112. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
  113. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
  114. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
  115. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
  116. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
  117. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
  118. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
  119. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
  120. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
  121. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
  122. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
  123. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
  124. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
  125. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
  126. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
  127. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
  128. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
  129. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
  130. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
  131. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
  137. package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
  138. package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
  139. package/dist/node_modules/remend/dist/index.js +333 -264
  140. package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
  141. package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
  142. package/dist/node_modules/streamdown/dist/index.js +1 -1
  143. package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
  144. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
  145. package/dist/pages/DashboardPage.js +3 -3
  146. package/package.json +2 -2
  147. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
  148. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
  149. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
  150. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
  151. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
  152. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
  153. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
  154. package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
  155. package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
  156. package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
  157. package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
  158. package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
  159. package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
  160. package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
  161. package/dist/node_modules/lodash-es/_baseSome.js +0 -9
  162. package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
  163. package/dist/node_modules/lodash-es/assign.js +0 -14
  164. package/dist/node_modules/lodash-es/compact.js +0 -9
  165. package/dist/node_modules/lodash-es/difference.js +0 -8
  166. package/dist/node_modules/lodash-es/drop.js +0 -8
  167. package/dist/node_modules/lodash-es/dropRight.js +0 -8
  168. package/dist/node_modules/lodash-es/every.js +0 -11
  169. package/dist/node_modules/lodash-es/groupBy.js +0 -6
  170. package/dist/node_modules/lodash-es/head.js +0 -5
  171. package/dist/node_modules/lodash-es/includes.js +0 -13
  172. package/dist/node_modules/lodash-es/indexOf.js +0 -11
  173. package/dist/node_modules/lodash-es/isRegExp.js +0 -5
  174. package/dist/node_modules/lodash-es/negate.js +0 -16
  175. package/dist/node_modules/lodash-es/pickBy.js +0 -15
  176. package/dist/node_modules/lodash-es/reject.js +0 -10
  177. package/dist/node_modules/lodash-es/some.js +0 -11
  178. package/dist/node_modules/lodash-es/uniq.js +0 -6
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
  190. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
  191. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
  192. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
  193. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
  194. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
  195. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
  196. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
@@ -115,7 +115,7 @@ function SelectionListener({ onSelectionChange: e }) {
115
115
  let t = useStore(changeSelector);
116
116
  return e || t ? jsx(SelectionListenerInner, { onSelectionChange: e }) : null;
117
117
  }
118
- var defaultNodeOrigin = [0, 0], defaultViewport = {
118
+ var useIsomorphicLayoutEffect = typeof window < "u" ? useLayoutEffect : useEffect, defaultNodeOrigin = [0, 0], defaultViewport = {
119
119
  x: 0,
120
120
  y: 0,
121
121
  zoom: 1
@@ -139,11 +139,11 @@ var defaultNodeOrigin = [0, 0], defaultViewport = {
139
139
  };
140
140
  function StoreUpdater(e) {
141
141
  let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: c } = useStore(selector$l, shallow), l = useStoreApi();
142
- useEffect(() => (c(e.defaultNodes, e.defaultEdges), () => {
142
+ useIsomorphicLayoutEffect(() => (c(e.defaultNodes, e.defaultEdges), () => {
143
143
  u.current = initPrevValues, s();
144
144
  }), []);
145
145
  let u = useRef(initPrevValues);
146
- return useEffect(() => {
146
+ return useIsomorphicLayoutEffect(() => {
147
147
  for (let s of fieldsToTrack) {
148
148
  let c = e[s];
149
149
  c !== u.current[s] && e[s] !== void 0 && (s === "nodes" ? t(c) : s === "edges" ? n(c) : s === "minZoom" ? r(c) : s === "maxZoom" ? i(c) : s === "translateExtent" ? a(c) : s === "nodeExtent" ? o(c) : s === "ariaLabelConfig" ? l.setState({ ariaLabelConfig: mergeAriaLabelConfig(c) }) : s === "fitView" ? l.setState({ fitViewQueued: c }) : s === "fitViewOptions" ? l.setState({ fitViewOptions: c }) : l.setState({ [s]: c }));
@@ -212,15 +212,15 @@ var useViewportHelper = () => {
212
212
  return useMemo(() => ({
213
213
  zoomIn: (t) => {
214
214
  let { panZoom: n } = e.getState();
215
- return n ? n.scaleBy(1.2, { duration: t?.duration }) : Promise.resolve(!1);
215
+ return n ? n.scaleBy(1.2, t) : Promise.resolve(!1);
216
216
  },
217
217
  zoomOut: (t) => {
218
218
  let { panZoom: n } = e.getState();
219
- return n ? n.scaleBy(1 / 1.2, { duration: t?.duration }) : Promise.resolve(!1);
219
+ return n ? n.scaleBy(1 / 1.2, t) : Promise.resolve(!1);
220
220
  },
221
221
  zoomTo: (t, n) => {
222
222
  let { panZoom: r } = e.getState();
223
- return r ? r.scaleTo(t, { duration: n?.duration }) : Promise.resolve(!1);
223
+ return r ? r.scaleTo(t, n) : Promise.resolve(!1);
224
224
  },
225
225
  getZoom: () => e.getState().transform[2],
226
226
  setViewport: async (t, n) => {
@@ -361,7 +361,6 @@ var isNode = (e) => isNodeBase(e), isEdge = (e) => isEdgeBase(e);
361
361
  function fixedForwardRef(e) {
362
362
  return forwardRef(e);
363
363
  }
364
- var useIsomorphicLayoutEffect = typeof window < "u" ? useLayoutEffect : useEffect;
365
364
  function useQueue(e) {
366
365
  let [t, n] = useState(BigInt(0)), [r] = useState(() => createQueue(() => n((e) => e + BigInt(1))));
367
366
  return useIsomorphicLayoutEffect(() => {
@@ -2250,7 +2249,7 @@ GraphViewComponent.displayName = "GraphView";
2250
2249
  var GraphView = memo(GraphViewComponent), getInitialState = ({ nodes: e, edges: t, defaultNodes: r, defaultEdges: i, width: a, height: o, fitView: s, fitViewOptions: c, minZoom: l = .5, maxZoom: u = 2, nodeOrigin: d, nodeExtent: f, zIndexMode: p = "basic" } = {}) => {
2251
2250
  let h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), x = i ?? t ?? [], S = r ?? e ?? [], C = d ?? [0, 0], w = f ?? infiniteExtent;
2252
2251
  updateConnectionLookup(_, b, x);
2253
- let T = adoptUserNodes(S, h, g, {
2252
+ let { nodesInitialized: T } = adoptUserNodes(S, h, g, {
2254
2253
  nodeOrigin: C,
2255
2254
  nodeExtent: w,
2256
2255
  zIndexMode: p
@@ -2361,21 +2360,23 @@ var GraphView = memo(GraphViewComponent), getInitialState = ({ nodes: e, edges:
2361
2360
  zIndexMode: p
2362
2361
  }),
2363
2362
  setNodes: (e) => {
2364
- let { nodeLookup: t, parentLookup: n, nodeOrigin: r, elevateNodesOnSelect: i, fitViewQueued: a, zIndexMode: o } = g(), s = adoptUserNodes(e, t, n, {
2363
+ let { nodeLookup: t, parentLookup: n, nodeOrigin: r, elevateNodesOnSelect: i, fitViewQueued: a, zIndexMode: o, nodesSelectionActive: s } = g(), { nodesInitialized: c, hasSelectedNodes: l } = adoptUserNodes(e, t, n, {
2365
2364
  nodeOrigin: r,
2366
2365
  nodeExtent: f,
2367
2366
  elevateNodesOnSelect: i,
2368
2367
  checkEquality: !0,
2369
2368
  zIndexMode: o
2370
- });
2371
- a && s ? (_(), h({
2369
+ }), u = s && l;
2370
+ a && c ? (_(), h({
2372
2371
  nodes: e,
2373
- nodesInitialized: s,
2372
+ nodesInitialized: c,
2374
2373
  fitViewQueued: !1,
2375
- fitViewOptions: void 0
2374
+ fitViewOptions: void 0,
2375
+ nodesSelectionActive: u
2376
2376
  })) : h({
2377
2377
  nodes: e,
2378
- nodesInitialized: s
2378
+ nodesInitialized: c,
2379
+ nodesSelectionActive: u
2379
2380
  });
2380
2381
  },
2381
2382
  setEdges: (e) => {
@@ -2618,6 +2619,67 @@ function ReactFlow({ nodes: n, edges: r, defaultNodes: a, defaultEdges: o, class
2618
2619
  nodeExtent: ar,
2619
2620
  zIndexMode: ui,
2620
2621
  children: [
2622
+ jsx(StoreUpdater, {
2623
+ nodes: n,
2624
+ edges: r,
2625
+ defaultNodes: a,
2626
+ defaultEdges: o,
2627
+ onConnect: _,
2628
+ onConnectStart: v,
2629
+ onConnectEnd: y,
2630
+ onClickConnectStart: b,
2631
+ onClickConnectEnd: x,
2632
+ nodesDraggable: $,
2633
+ autoPanOnNodeFocus: qn,
2634
+ nodesConnectable: Jn,
2635
+ nodesFocusable: Yn,
2636
+ edgesFocusable: Zn,
2637
+ edgesReconnectable: Qn,
2638
+ elementsSelectable: $n,
2639
+ elevateNodesOnSelect: Ur,
2640
+ elevateEdgesOnSelect: Wr,
2641
+ minZoom: tr,
2642
+ maxZoom: nr,
2643
+ nodeExtent: ar,
2644
+ onNodesChange: Mr,
2645
+ onEdgesChange: Nr,
2646
+ snapToGrid: Wn,
2647
+ snapGrid: Gn,
2648
+ connectionMode: V,
2649
+ translateExtent: rr,
2650
+ connectOnClick: zr,
2651
+ defaultEdgeOptions: Hr,
2652
+ fitView: Lr,
2653
+ fitViewOptions: Rr,
2654
+ onNodesDelete: A,
2655
+ onEdgesDelete: j,
2656
+ onDelete: M,
2657
+ onNodeDragStart: D,
2658
+ onNodeDrag: O,
2659
+ onNodeDragStop: k,
2660
+ onSelectionDrag: F,
2661
+ onSelectionDragStart: P,
2662
+ onSelectionDragStop: I,
2663
+ onMove: m,
2664
+ onMoveStart: h,
2665
+ onMoveEnd: g,
2666
+ noPanClassName: Ir,
2667
+ nodeOrigin: Xn,
2668
+ rfId: pi,
2669
+ autoPanOnConnect: Kr,
2670
+ autoPanOnNodeDrag: qr,
2671
+ autoPanSpeed: Jr,
2672
+ onError: Zr,
2673
+ connectionRadius: Yr,
2674
+ isValidConnection: Xr,
2675
+ selectNodesOnDrag: Q,
2676
+ nodeDragThreshold: ei,
2677
+ connectionDragThreshold: ti,
2678
+ onBeforeDelete: B,
2679
+ debug: si,
2680
+ ariaLabelConfig: li,
2681
+ zIndexMode: ui
2682
+ }),
2621
2683
  jsx(GraphView, {
2622
2684
  onInit: p,
2623
2685
  onNodeClick: d,
@@ -2683,67 +2745,6 @@ function ReactFlow({ nodes: n, edges: r, defaultNodes: a, defaultEdges: o, class
2683
2745
  viewport: ni,
2684
2746
  onViewportChange: ri
2685
2747
  }),
2686
- jsx(StoreUpdater, {
2687
- nodes: n,
2688
- edges: r,
2689
- defaultNodes: a,
2690
- defaultEdges: o,
2691
- onConnect: _,
2692
- onConnectStart: v,
2693
- onConnectEnd: y,
2694
- onClickConnectStart: b,
2695
- onClickConnectEnd: x,
2696
- nodesDraggable: $,
2697
- autoPanOnNodeFocus: qn,
2698
- nodesConnectable: Jn,
2699
- nodesFocusable: Yn,
2700
- edgesFocusable: Zn,
2701
- edgesReconnectable: Qn,
2702
- elementsSelectable: $n,
2703
- elevateNodesOnSelect: Ur,
2704
- elevateEdgesOnSelect: Wr,
2705
- minZoom: tr,
2706
- maxZoom: nr,
2707
- nodeExtent: ar,
2708
- onNodesChange: Mr,
2709
- onEdgesChange: Nr,
2710
- snapToGrid: Wn,
2711
- snapGrid: Gn,
2712
- connectionMode: V,
2713
- translateExtent: rr,
2714
- connectOnClick: zr,
2715
- defaultEdgeOptions: Hr,
2716
- fitView: Lr,
2717
- fitViewOptions: Rr,
2718
- onNodesDelete: A,
2719
- onEdgesDelete: j,
2720
- onDelete: M,
2721
- onNodeDragStart: D,
2722
- onNodeDrag: O,
2723
- onNodeDragStop: k,
2724
- onSelectionDrag: F,
2725
- onSelectionDragStart: P,
2726
- onSelectionDragStop: I,
2727
- onMove: m,
2728
- onMoveStart: h,
2729
- onMoveEnd: g,
2730
- noPanClassName: Ir,
2731
- nodeOrigin: Xn,
2732
- rfId: pi,
2733
- autoPanOnConnect: Kr,
2734
- autoPanOnNodeDrag: qr,
2735
- autoPanSpeed: Jr,
2736
- onError: Zr,
2737
- connectionRadius: Yr,
2738
- isValidConnection: Xr,
2739
- selectNodesOnDrag: Q,
2740
- nodeDragThreshold: ei,
2741
- connectionDragThreshold: ti,
2742
- onBeforeDelete: B,
2743
- debug: si,
2744
- ariaLabelConfig: li,
2745
- zIndexMode: ui
2746
- }),
2747
2748
  jsx(SelectionListener, { onSelectionChange: N }),
2748
2749
  Sr,
2749
2750
  jsx(Attribution, {
@@ -628,18 +628,19 @@ function getPoints({ source: e, sourcePosition: s = Position.Bottom, target: c,
628
628
  };
629
629
  Math.max(Math.abs(_.x - b[0].x), Math.abs(w.x - b[0].x)) >= Math.max(Math.abs(_.y - b[0].y), Math.abs(w.y - b[0].y)) ? (x = (_.x + w.x) / 2, S = b[0].y) : (x = b[0].x, S = (_.y + w.y) / 2);
630
630
  }
631
+ let O = {
632
+ x: h.x + C.x,
633
+ y: h.y + C.y
634
+ }, k = {
635
+ x: g.x + T.x,
636
+ y: g.y + T.y
637
+ };
631
638
  return [
632
639
  [
633
640
  e,
634
- {
635
- x: h.x + C.x,
636
- y: h.y + C.y
637
- },
641
+ ...O.x !== b[0].x || O.y !== b[0].y ? [O] : [],
638
642
  ...b,
639
- {
640
- x: g.x + T.x,
641
- y: g.y + T.y
642
- },
643
+ ...k.x !== b[b.length - 1].x || k.y !== b[b.length - 1].y ? [k] : [],
643
644
  c
644
645
  ],
645
646
  x,
@@ -676,12 +677,10 @@ function getSmoothStepPath({ sourceX: e, sourceY: s, sourcePosition: c = Positio
676
677
  },
677
678
  offset: h,
678
679
  stepPosition: g
679
- });
680
- return [
681
- _.reduce((e, s, c) => {
682
- let l = "";
683
- return l = c > 0 && c < _.length - 1 ? getBend(_[c - 1], s, _[c + 1], f) : `${c === 0 ? "M" : "L"}${s.x} ${s.y}`, e += l, e;
684
- }, ""),
680
+ }), S = `M${_[0].x} ${_[0].y}`;
681
+ for (let e = 1; e < _.length - 1; e++) S += getBend(_[e - 1], _[e], _[e + 1], f);
682
+ return S += `L${_[_.length - 1].x} ${_[_.length - 1].y}`, [
683
+ S,
685
684
  v,
686
685
  y,
687
686
  b,
@@ -811,31 +810,34 @@ function isManualZIndexMode(e) {
811
810
  return e === "manual";
812
811
  }
813
812
  function adoptUserNodes(e, s, c, l = {}) {
814
- let u = mergeObjects(adoptUserNodesDefaultOptions, l), d = { i: 0 }, f = new Map(s), p = u?.elevateNodesOnSelect && !isManualZIndexMode(u.zIndexMode) ? SELECTED_NODE_Z : 0, m = e.length > 0;
813
+ let u = mergeObjects(adoptUserNodesDefaultOptions, l), d = { i: 0 }, f = new Map(s), p = u?.elevateNodesOnSelect && !isManualZIndexMode(u.zIndexMode) ? SELECTED_NODE_Z : 0, m = e.length > 0, h = !1;
815
814
  s.clear(), c.clear();
816
- for (let h of e) {
817
- let e = f.get(h.id);
818
- if (u.checkEquality && h === e?.internals.userNode) s.set(h.id, e);
815
+ for (let g of e) {
816
+ let e = f.get(g.id);
817
+ if (u.checkEquality && g === e?.internals.userNode) s.set(g.id, e);
819
818
  else {
820
- let c = clampPosition(getNodePositionWithOrigin(h, u.nodeOrigin), isCoordinateExtent(h.extent) ? h.extent : u.nodeExtent, getNodeDimensions(h));
819
+ let c = clampPosition(getNodePositionWithOrigin(g, u.nodeOrigin), isCoordinateExtent(g.extent) ? g.extent : u.nodeExtent, getNodeDimensions(g));
821
820
  e = {
822
821
  ...u.defaults,
823
- ...h,
822
+ ...g,
824
823
  measured: {
825
- width: h.measured?.width,
826
- height: h.measured?.height
824
+ width: g.measured?.width,
825
+ height: g.measured?.height
827
826
  },
828
827
  internals: {
829
828
  positionAbsolute: c,
830
- handleBounds: parseHandles(h, e),
831
- z: calculateZ(h, p, u.zIndexMode),
832
- userNode: h
829
+ handleBounds: parseHandles(g, e),
830
+ z: calculateZ(g, p, u.zIndexMode),
831
+ userNode: g
833
832
  }
834
- }, s.set(h.id, e);
833
+ }, s.set(g.id, e);
835
834
  }
836
- (e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (m = !1), h.parentId && updateChildNode(e, s, c, l, d);
835
+ (e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (m = !1), g.parentId && updateChildNode(e, s, c, l, d), h ||= g.selected ?? !1;
837
836
  }
838
- return m;
837
+ return {
838
+ nodesInitialized: m,
839
+ hasSelectedNodes: h
840
+ };
839
841
  }
840
842
  function updateParentLookup(e, s) {
841
843
  if (!e.parentId) return;
@@ -1,58 +1,49 @@
1
- import isFunction_default from "../../../../../lodash-es/isFunction.js";
2
- import isArray_default from "../../../../../lodash-es/isArray.js";
3
- import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
4
- import keys_default from "../../../../../lodash-es/keys.js";
5
- import compact_default from "../../../../../lodash-es/compact.js";
6
- import forEach_default from "../../../../../lodash-es/forEach.js";
7
- import filter_default from "../../../../../lodash-es/filter.js";
8
- import map_default from "../../../../../lodash-es/map.js";
9
- import isUndefined_default from "../../../../../lodash-es/isUndefined.js";
10
1
  import { defineNameProp } from "../../lang/lang_extensions.js";
11
- function defaultVisit(e, d) {
12
- let f = keys_default(e), m = f.length;
13
- for (let p = 0; p < m; p++) {
14
- let m = e[f[p]], h = m.length;
15
- for (let e = 0; e < h; e++) {
16
- let f = m[e];
17
- f.tokenTypeIdx === void 0 && this[f.name](f.children, d);
2
+ function defaultVisit(e, t) {
3
+ let n = Object.keys(e), r = n.length;
4
+ for (let i = 0; i < r; i++) {
5
+ let r = e[n[i]], a = r.length;
6
+ for (let e = 0; e < a; e++) {
7
+ let n = r[e];
8
+ n.tokenTypeIdx === void 0 && this[n.name](n.children, t);
18
9
  }
19
10
  }
20
11
  }
21
- function createBaseSemanticVisitorConstructor(e, p) {
22
- let m = function() {};
23
- return defineNameProp(m, e + "BaseSemantics"), m.prototype = {
24
- visit: function(e, f) {
25
- if (isArray_default(e) && (e = e[0]), !isUndefined_default(e)) return this[e.name](e.children, f);
12
+ function createBaseSemanticVisitorConstructor(t, n) {
13
+ let r = function() {};
14
+ return defineNameProp(r, t + "BaseSemantics"), r.prototype = {
15
+ visit: function(e, t) {
16
+ if (Array.isArray(e) && (e = e[0]), e !== void 0) return this[e.name](e.children, t);
26
17
  },
27
18
  validateVisitor: function() {
28
- let e = validateVisitor(this, p);
29
- if (!isEmpty_default(e)) {
30
- let d = map_default(e, (e) => e.msg);
31
- throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${d.join("\n\n").replace(/\n/g, "\n ")}`);
19
+ let e = validateVisitor(this, n);
20
+ if (e.length !== 0) {
21
+ let t = e.map((e) => e.msg);
22
+ throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g, "\n ")}`);
32
23
  }
33
24
  }
34
- }, m.prototype.constructor = m, m._RULE_NAMES = p, m;
25
+ }, r.prototype.constructor = r, r._RULE_NAMES = n, r;
35
26
  }
36
- function createBaseVisitorConstructorWithDefaults(e, d, f) {
37
- let p = function() {};
38
- defineNameProp(p, e + "BaseSemanticsWithDefaults");
39
- let m = Object.create(f.prototype);
40
- return forEach_default(d, (e) => {
41
- m[e] = defaultVisit;
42
- }), p.prototype = m, p.prototype.constructor = p, p;
27
+ function createBaseVisitorConstructorWithDefaults(n, r, i) {
28
+ let a = function() {};
29
+ defineNameProp(a, n + "BaseSemanticsWithDefaults");
30
+ let o = Object.create(i.prototype);
31
+ return r.forEach((e) => {
32
+ o[e] = defaultVisit;
33
+ }), a.prototype = o, a.prototype.constructor = a, a;
43
34
  }
44
35
  var CstVisitorDefinitionError;
45
36
  (function(e) {
46
37
  e[e.REDUNDANT_METHOD = 0] = "REDUNDANT_METHOD", e[e.MISSING_METHOD = 1] = "MISSING_METHOD";
47
38
  })(CstVisitorDefinitionError ||= {});
48
- function validateVisitor(e, d) {
49
- return validateMissingCstMethods(e, d);
39
+ function validateVisitor(e, t) {
40
+ return validateMissingCstMethods(e, t);
50
41
  }
51
- function validateMissingCstMethods(d, f) {
52
- return compact_default(map_default(filter_default(f, (f) => isFunction_default(d[f]) === !1), (e) => ({
53
- msg: `Missing visitor method: <${e}> on ${d.constructor.name} CST Visitor.`,
42
+ function validateMissingCstMethods(e, t) {
43
+ return t.filter((t) => typeof e[t] != "function").map((t) => ({
44
+ msg: `Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,
54
45
  type: CstVisitorDefinitionError.MISSING_METHOD,
55
- methodName: e
56
- })));
46
+ methodName: t
47
+ })).filter(Boolean);
57
48
  }
58
49
  export { createBaseSemanticVisitorConstructor, createBaseVisitorConstructorWithDefaults };
@@ -1,6 +1,3 @@
1
- import head_default from "../../../../lodash-es/head.js";
2
- import map_default from "../../../../lodash-es/map.js";
3
- import reduce_default from "../../../../lodash-es/reduce.js";
4
1
  import { NonTerminal, Rule, Terminal } from "../../../../@chevrotain/gast/lib/src/model.js";
5
2
  import { getProductionDslName } from "../../../../@chevrotain/gast/lib/src/helpers.js";
6
3
  import { hasTokenLabel, tokenLabel } from "../scan/tokens_public.js";
@@ -11,44 +8,44 @@ const defaultParserErrorProvider = {
11
8
  buildNotAllInputParsedMessage({ firstRedundant: e, ruleName: t }) {
12
9
  return "Redundant input, expecting EOF but found: " + e.image;
13
10
  },
14
- buildNoViableAltMessage({ expectedPathsPerAlt: r, actual: i, previous: a, customUserDescription: o, ruleName: s }) {
15
- let l = "\nbut found: '" + head_default(i).image + "'";
16
- return o ? "Expecting: " + o + l : `Expecting: one of these possible Token sequences:\n${map_default(map_default(reduce_default(r, (e, t) => e.concat(t), []), (e) => `[${map_default(e, (e) => tokenLabel(e)).join(", ")}]`), (e, t) => ` ${t + 1}. ${e}`).join("\n")}` + l;
11
+ buildNoViableAltMessage({ expectedPathsPerAlt: e, actual: t, previous: n, customUserDescription: r, ruleName: i }) {
12
+ let o = "\nbut found: '" + t[0].image + "'";
13
+ return r ? "Expecting: " + r + o : `Expecting: one of these possible Token sequences:\n${e.reduce((e, t) => e.concat(t), []).map((e) => `[${e.map((e) => tokenLabel(e)).join(", ")}]`).map((e, t) => ` ${t + 1}. ${e}`).join("\n")}` + o;
17
14
  },
18
- buildEarlyExitMessage({ expectedIterationPaths: n, actual: r, customUserDescription: i, ruleName: a }) {
19
- let o = "\nbut found: '" + head_default(r).image + "'";
20
- return i ? "Expecting: " + i + o : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${map_default(n, (e) => `[${map_default(e, (e) => tokenLabel(e)).join(",")}]`).join(" ,")}>` + o;
15
+ buildEarlyExitMessage({ expectedIterationPaths: e, actual: t, customUserDescription: n, ruleName: r }) {
16
+ let i = "\nbut found: '" + t[0].image + "'";
17
+ return n ? "Expecting: " + n + i : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map((e) => `[${e.map((e) => tokenLabel(e)).join(",")}]`).join(" ,")}>` + i;
21
18
  }
22
19
  };
23
20
  Object.freeze(defaultParserErrorProvider);
24
21
  const defaultGrammarResolverErrorProvider = { buildRuleNotFoundError(e, t) {
25
22
  return "Invalid grammar, reference to a rule which is not defined: ->" + t.nonTerminalName + "<-\ninside top level rule: ->" + e.name + "<-";
26
23
  } }, defaultGrammarValidatorErrorProvider = {
27
- buildDuplicateFoundError(t, n) {
28
- function i(e) {
29
- return e instanceof Terminal ? e.terminalType.name : e instanceof NonTerminal ? e.nonTerminalName : "";
24
+ buildDuplicateFoundError(t, i) {
25
+ function a(t) {
26
+ return t instanceof Terminal ? t.terminalType.name : t instanceof NonTerminal ? t.nonTerminalName : "";
30
27
  }
31
- let s = t.name, c = head_default(n), l = c.idx, u = getProductionDslName(c), d = i(c), f = `->${u}${l > 0 ? l : ""}<- ${d ? `with argument: ->${d}<-` : ""}
32
- appears more than once (${n.length} times) in the top level rule: ->${s}<-.
28
+ let o = t.name, s = i[0], c = s.idx, l = getProductionDslName(s), u = a(s), d = `->${l}${c > 0 ? c : ""}<- ${u ? `with argument: ->${u}<-` : ""}
29
+ appears more than once (${i.length} times) in the top level rule: ->${o}<-.
33
30
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
34
31
  `;
35
- return f = f.replace(/[ \t]+/g, " "), f = f.replace(/\s\s+/g, "\n"), f;
32
+ return d = d.replace(/[ \t]+/g, " "), d = d.replace(/\s\s+/g, "\n"), d;
36
33
  },
37
34
  buildNamespaceConflictError(e) {
38
35
  return `Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`;
39
36
  },
40
37
  buildAlternationPrefixAmbiguityError(e) {
41
- let n = map_default(e.prefixPath, (e) => tokenLabel(e)).join(", "), r = e.alternation.idx === 0 ? "" : e.alternation.idx;
42
- return `Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${r}> inside <${e.topLevelRule.name}> Rule,\n<${n}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`;
38
+ let t = e.prefixPath.map((e) => tokenLabel(e)).join(", "), n = e.alternation.idx === 0 ? "" : e.alternation.idx;
39
+ return `Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`;
43
40
  },
44
41
  buildAlternationAmbiguityError(e) {
45
- let n = e.alternation.idx === 0 ? "" : e.alternation.idx, r = e.prefixPath.length === 0, i = `Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,\n`;
46
- if (r) i += "These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n";
42
+ let t = e.alternation.idx === 0 ? "" : e.alternation.idx, n = e.prefixPath.length === 0, r = `Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,\n`;
43
+ if (n) r += "These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n";
47
44
  else {
48
- let n = map_default(e.prefixPath, (e) => tokenLabel(e)).join(", ");
49
- i += `<${n}> may appears as a prefix path in all these alternatives.\n`;
45
+ let t = e.prefixPath.map((e) => tokenLabel(e)).join(", ");
46
+ r += `<${t}> may appears as a prefix path in all these alternatives.\n`;
50
47
  }
51
- return i += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", i;
48
+ return r += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", r;
52
49
  },
53
50
  buildEmptyRepetitionError(e) {
54
51
  let t = getProductionDslName(e.repetition);
@@ -65,16 +62,16 @@ const defaultGrammarResolverErrorProvider = { buildRuleNotFoundError(e, t) {
65
62
  return `An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length + 1} alternatives.`;
66
63
  },
67
64
  buildLeftRecursionError(e) {
68
- let n = e.topLevelRule.name;
69
- return `Left Recursion found in grammar.\nrule: <${n}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${n} --> ${map_default(e.leftRecursionPath, (e) => e.name).concat([n]).join(" --> ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
65
+ let t = e.topLevelRule.name;
66
+ return `Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --> ${e.leftRecursionPath.map((e) => e.name).concat([t]).join(" --> ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
70
67
  },
71
68
  buildInvalidRuleNameError(e) {
72
69
  /* istanbul ignore next */
73
70
  return "deprecated";
74
71
  },
75
72
  buildDuplicateRuleNameError(e) {
76
- let t;
77
- return t = e.topLevelRule instanceof Rule ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`;
73
+ let n;
74
+ return n = e.topLevelRule instanceof Rule ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${n}<- is already defined in the grammar: ->${e.grammarName}<-`;
78
75
  }
79
76
  };
80
77
  export { defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider, defaultParserErrorProvider };
@@ -1,4 +1,3 @@
1
- import includes_default from "../../../../lodash-es/includes.js";
2
1
  var MISMATCHED_TOKEN_EXCEPTION = "MismatchedTokenException", NO_VIABLE_ALT_EXCEPTION = "NoViableAltException", EARLY_EXIT_EXCEPTION = "EarlyExitException", NOT_ALL_INPUT_PARSED_EXCEPTION = "NotAllInputParsedException", RECOGNITION_EXCEPTION_NAMES = [
3
2
  MISMATCHED_TOKEN_EXCEPTION,
4
3
  NO_VIABLE_ALT_EXCEPTION,
@@ -6,29 +5,29 @@ var MISMATCHED_TOKEN_EXCEPTION = "MismatchedTokenException", NO_VIABLE_ALT_EXCEP
6
5
  NOT_ALL_INPUT_PARSED_EXCEPTION
7
6
  ];
8
7
  Object.freeze(RECOGNITION_EXCEPTION_NAMES);
9
- function isRecognitionException(l) {
10
- return includes_default(RECOGNITION_EXCEPTION_NAMES, l.name);
8
+ function isRecognitionException(e) {
9
+ return RECOGNITION_EXCEPTION_NAMES.includes(e.name);
11
10
  }
12
11
  var RecognitionException = class extends Error {
13
- constructor(e, l) {
12
+ constructor(e, c) {
14
13
  /* istanbul ignore next - V8 workaround to remove constructor from stacktrace when typescript target is ES5 */
15
- super(e), this.token = l, this.resyncedTokens = [], Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
14
+ super(e), this.token = c, this.resyncedTokens = [], Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
16
15
  }
17
16
  }, MismatchedTokenException = class extends RecognitionException {
18
- constructor(e, u, d) {
19
- super(e, u), this.previousToken = d, this.name = MISMATCHED_TOKEN_EXCEPTION;
17
+ constructor(c, l, u) {
18
+ super(c, l), this.previousToken = u, this.name = MISMATCHED_TOKEN_EXCEPTION;
20
19
  }
21
20
  }, NoViableAltException = class extends RecognitionException {
22
- constructor(e, l, d) {
23
- super(e, l), this.previousToken = d, this.name = NO_VIABLE_ALT_EXCEPTION;
21
+ constructor(e, l, u) {
22
+ super(e, l), this.previousToken = u, this.name = NO_VIABLE_ALT_EXCEPTION;
24
23
  }
25
24
  }, NotAllInputParsedException = class extends RecognitionException {
26
- constructor(e, l) {
27
- super(e, l), this.name = NOT_ALL_INPUT_PARSED_EXCEPTION;
25
+ constructor(e, c) {
26
+ super(e, c), this.name = NOT_ALL_INPUT_PARSED_EXCEPTION;
28
27
  }
29
28
  }, EarlyExitException = class extends RecognitionException {
30
- constructor(e, l, u) {
31
- super(e, l), this.previousToken = u, this.name = EARLY_EXIT_EXCEPTION;
29
+ constructor(e, c, u) {
30
+ super(e, c), this.previousToken = u, this.name = EARLY_EXIT_EXCEPTION;
32
31
  }
33
32
  };
34
33
  export { EarlyExitException, MismatchedTokenException, NoViableAltException, NotAllInputParsedException, isRecognitionException };