@bytechain.cn/colamd 1.5.1 → 2.7.7

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 (398) hide show
  1. package/LICENSE +22 -21
  2. package/README.md +160 -1012
  3. package/README_CN.md +210 -1070
  4. package/dist/main/chunks/docx-export.js +29695 -0
  5. package/dist/main/chunks/image-export.js +175 -0
  6. package/dist/main/index.js +17765 -452
  7. package/dist/preload/index.js +135 -23
  8. package/dist/renderer/assets/2DXBBFLN-BmaQ8lqV.js +667 -0
  9. package/dist/renderer/assets/46IJ22JX-Caywmaj-.js +854 -0
  10. package/dist/renderer/assets/4TTDE5I4-C82Tw8vO.js +502 -0
  11. package/dist/renderer/assets/4UF3HTLV-BD8W-BSm.js +30 -0
  12. package/dist/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
  13. package/dist/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
  14. package/dist/renderer/assets/AAXQQPKT-CCArPgA1.js +1131 -0
  15. package/dist/renderer/assets/AKE5O7KZ-DOAgUvEX.js +185 -0
  16. package/dist/renderer/assets/BNMLP6AG-igM96Ol7.js +805 -0
  17. package/dist/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
  18. package/dist/renderer/assets/DR6PKOQU-C-e6zzyf.js +302 -0
  19. package/dist/renderer/assets/E4RJ7UJB-BMF4zoOQ.js +442 -0
  20. package/dist/renderer/assets/ELSXBIJH-BI2ySIoX.js +39 -0
  21. package/dist/renderer/assets/ERTIBQVS-CnvF3w9r.js +183 -0
  22. package/dist/renderer/assets/F653G4FO-CgzvjfOe.js +1498 -0
  23. package/dist/renderer/assets/FKCDD66M-BkVPFntx.js +205 -0
  24. package/dist/renderer/assets/FP7KDXVC-K0VCFuri.js +222 -0
  25. package/dist/renderer/assets/FT5I3RHX-zgsvTvBh.js +244 -0
  26. package/dist/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
  27. package/dist/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
  28. package/dist/renderer/assets/GY35JXOZ-Lo9DxsPK.js +169 -0
  29. package/dist/renderer/assets/H5EEJPP2-Bw2musel.js +354 -0
  30. package/dist/renderer/assets/HWDLEDTA-CCOSSl9K.js +982 -0
  31. package/dist/renderer/assets/JZWSX6AR-BBtw8K-1.js +67 -0
  32. package/dist/renderer/assets/KQOEJWJY-Brg31xSn.js +84 -0
  33. package/dist/renderer/assets/KS3BB3KE-2GQdjVNT.js +139 -0
  34. package/dist/renderer/assets/KXJRRZHI-B0Oj-tMS.js +503 -0
  35. package/dist/renderer/assets/MFVI5XKI-BpwEOECT.js +10 -0
  36. package/dist/renderer/assets/MWY2J62P-CSmi7lMQ.js +1103 -0
  37. package/dist/renderer/assets/MXGNCBL2-CSoCLfJw.js +217 -0
  38. package/dist/renderer/assets/N6DAJLIZ-DB-xlSjM.js +120 -0
  39. package/dist/renderer/assets/NU5M23IW-BhGgUeDk.js +117 -0
  40. package/dist/renderer/assets/NV4XNBIS-DMg8ibKU.js +1221 -0
  41. package/dist/renderer/assets/OGLU4SIR-DOU7cIL3.js +290 -0
  42. package/dist/renderer/assets/OUNS5N76-BO_k5M0O.js +1065 -0
  43. package/dist/renderer/assets/PU4ISKXV-Cw53csyu.js +516 -0
  44. package/dist/renderer/assets/PUZGS23X-_iUQg51-.js +21 -0
  45. package/dist/renderer/assets/Q3IYVLG5-ZFBZi3vs.js +501 -0
  46. package/dist/renderer/assets/QYHQDLKZ-BPb6lHi6.js +984 -0
  47. package/dist/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
  48. package/dist/renderer/assets/RZSVICHU-I7fvqLMQ.js +263 -0
  49. package/dist/renderer/assets/UEXXS2NB-AVpw2xTC.js +25 -0
  50. package/dist/renderer/assets/UHTQJXKL-6oSc4D2k.js +135 -0
  51. package/dist/renderer/assets/URA2L2QI-DkFUeeK0.js +201 -0
  52. package/dist/renderer/assets/UXCHDUKG-B54p4156.js +174 -0
  53. package/dist/renderer/assets/VKNV3BUX-Cc_4x0WI.js +278 -0
  54. package/dist/renderer/assets/VMV7XPHP-BjfrE66I.js +127 -0
  55. package/dist/renderer/assets/WEVWDWVA-Ca8eMbXN.js +57 -0
  56. package/dist/renderer/assets/XRRJ35LF-EWRU-xXu.js +120 -0
  57. package/dist/renderer/assets/YFKBLVVN-D2oaE2c2.js +991 -0
  58. package/dist/renderer/assets/YHRE5QGZ-ucJgE2vP.js +698 -0
  59. package/dist/renderer/assets/ZF3OVT4B-SN2E7Wbi.js +421 -0
  60. package/dist/renderer/assets/apl-fqmucPXA.js +140 -0
  61. package/dist/renderer/assets/asciiarmor-DucZyvP0.js +56 -0
  62. package/dist/renderer/assets/asn1-BnOEsgAm.js +144 -0
  63. package/dist/renderer/assets/asterisk-QAlztEwS.js +345 -0
  64. package/dist/renderer/assets/brainfuck-DZVCuF_t.js +53 -0
  65. package/dist/renderer/assets/clike-xqXYL6ge.js +805 -0
  66. package/dist/renderer/assets/clojure-BhXMqnxz.js +849 -0
  67. package/dist/renderer/assets/cmake-BGaNd9E7.js +71 -0
  68. package/dist/renderer/assets/cobol-4yqQntpt.js +120 -0
  69. package/dist/renderer/assets/coffeescript-D2dXvhEc.js +308 -0
  70. package/dist/renderer/assets/commonlisp-CF_VNHQR.js +130 -0
  71. package/dist/renderer/assets/crystal-DyuLTqLs.js +398 -0
  72. package/dist/renderer/assets/css-c-jst79C.js +1783 -0
  73. package/dist/renderer/assets/cypher-Dlu_3r4V.js +121 -0
  74. package/dist/renderer/assets/d-UURgV0Ux.js +179 -0
  75. package/dist/renderer/assets/diff-B_Bi2Crb.js +25 -0
  76. package/dist/renderer/assets/dockerfile-Bvk733Ga.js +201 -0
  77. package/dist/renderer/assets/dtd-Dy74G54E.js +114 -0
  78. package/dist/renderer/assets/dylan-TSb-Nfix.js +314 -0
  79. package/dist/renderer/assets/ebnf-4fKAGW3a.js +140 -0
  80. package/dist/renderer/assets/ecl-B59qGGVg.js +178 -0
  81. package/dist/renderer/assets/eiffel-Dze7nlu3.js +134 -0
  82. package/dist/renderer/assets/elm-DG7jkhNZ.js +176 -0
  83. package/dist/renderer/assets/erlang-BO6gOnGA.js +674 -0
  84. package/dist/renderer/assets/factor-CMxFHDqz.js +65 -0
  85. package/dist/renderer/assets/fcl-CDDUNjTj.js +141 -0
  86. package/dist/renderer/assets/forth-B9D2JCeE.js +116 -0
  87. package/dist/renderer/assets/fortran-CAG2BFbe.js +467 -0
  88. package/dist/renderer/assets/gas-d3KEcW3x.js +294 -0
  89. package/dist/renderer/assets/gherkin-DhZlEZiy.js +115 -0
  90. package/dist/renderer/assets/groovy-CpwJiBl7.js +223 -0
  91. package/dist/renderer/assets/haskell-ySd-OUo8.js +459 -0
  92. package/dist/renderer/assets/haxe-7MlzfeYV.js +514 -0
  93. package/dist/renderer/assets/http-BqypyemW.js +79 -0
  94. package/dist/renderer/assets/idl-4HIGJlDI.js +985 -0
  95. package/dist/renderer/assets/index-6G13Twgt.js +311 -0
  96. package/dist/renderer/assets/index-B2_pQa3G.js +384 -0
  97. package/dist/renderer/assets/index-B4keY9Xz.js +328 -0
  98. package/dist/renderer/assets/index-B5Jih3QA.js +47421 -0
  99. package/dist/renderer/assets/index-BH0PaTow.js +405 -0
  100. package/dist/renderer/assets/index-BWfIKsyn.js +8 -0
  101. package/dist/renderer/assets/index-B_BLxvag.js +156 -0
  102. package/dist/renderer/assets/index-BnXxA35e.js +325 -0
  103. package/dist/renderer/assets/index-Bu1PrnbA.js +81 -0
  104. package/dist/renderer/assets/index-BvXJHaQ4.js +60 -0
  105. package/dist/renderer/assets/index-BzHXcCGC.js +307 -0
  106. package/dist/renderer/assets/index-CXI9cRfo.js +287 -0
  107. package/dist/renderer/assets/index-Ccsf_83j.js +149 -0
  108. package/dist/renderer/assets/index-CkLQq2g4.js +688 -0
  109. package/dist/renderer/assets/index-DNL6Tijf.js +8 -0
  110. package/dist/renderer/assets/index-DRZsGkXi.js +78 -0
  111. package/dist/renderer/assets/index-Dfyz4Aee.js +181 -0
  112. package/dist/renderer/assets/index-HtqODURL.js +703 -0
  113. package/dist/renderer/assets/{index-DxOzbfR-.js → index-MJfkvBRx.js} +1 -1
  114. package/dist/renderer/assets/index-NsiBA9UX.js +113 -0
  115. package/dist/renderer/assets/index-aUzhL6sM.js +96 -0
  116. package/dist/renderer/assets/index-bx07CRyn.css +2503 -0
  117. package/dist/renderer/assets/{index-CBcVpA3d.js → index-k1ZFPJcr.js} +3 -4
  118. package/dist/renderer/assets/javascript-C_OHM9hj.js +994 -0
  119. package/dist/renderer/assets/julia-Bs6JJhYG.js +407 -0
  120. package/dist/renderer/assets/lazy-BY7ljzvO.js +1041 -0
  121. package/dist/renderer/assets/livescript-DmzgM3Yt.js +296 -0
  122. package/dist/renderer/assets/lua-Cvg8VrAA.js +256 -0
  123. package/dist/renderer/assets/mathematica-DNLOL9PQ.js +110 -0
  124. package/dist/renderer/assets/mbox-Ga7d4MMN.js +117 -0
  125. package/dist/renderer/assets/mirc-Dma3B8rS.js +107 -0
  126. package/dist/renderer/assets/mllike-DHn7xckP.js +334 -0
  127. package/dist/renderer/assets/modelica-0d55jYY0.js +147 -0
  128. package/dist/renderer/assets/mscgen-DdqZYINH.js +135 -0
  129. package/dist/renderer/assets/mumps-Btr8VblO.js +93 -0
  130. package/dist/renderer/assets/nginx-DTDtBDVN.js +141 -0
  131. package/dist/renderer/assets/nsis-CyKBdPWp.js +62 -0
  132. package/dist/renderer/assets/ntriples-CvgOYMpL.js +153 -0
  133. package/dist/renderer/assets/octave-DYBj3-tl.js +200 -0
  134. package/dist/renderer/assets/oz-R_e8WMIi.js +231 -0
  135. package/dist/renderer/assets/pascal-GD8iposT.js +105 -0
  136. package/dist/renderer/assets/perl-DL9mHpoi.js +1105 -0
  137. package/dist/renderer/assets/pig-C_4T4YIV.js +101 -0
  138. package/dist/renderer/assets/powershell-B0suO7Vd.js +328 -0
  139. package/dist/renderer/assets/properties-BR-vP1aU.js +58 -0
  140. package/dist/renderer/assets/protobuf-BxgpyhoW.js +77 -0
  141. package/dist/renderer/assets/pug-CTXt1f8z.js +405 -0
  142. package/dist/renderer/assets/puppet-Bdao66PW.js +137 -0
  143. package/dist/renderer/assets/python-CvWbmiX4.js +427 -0
  144. package/dist/renderer/assets/q-CrbCVq4a.js +131 -0
  145. package/dist/renderer/assets/r-V7nswm59.js +170 -0
  146. package/dist/renderer/assets/rpm-C-DLY-If.js +109 -0
  147. package/dist/renderer/assets/ruby-CQTpZw6f.js +331 -0
  148. package/dist/renderer/assets/sas-D2UG-yhZ.js +207 -0
  149. package/dist/renderer/assets/scheme-BKzrkGJD.js +222 -0
  150. package/dist/renderer/assets/shell-BlsXDxCn.js +222 -0
  151. package/dist/renderer/assets/sieve-CjwBwOY5.js +135 -0
  152. package/dist/renderer/assets/simple-mode-DMneyfDu.js +130 -0
  153. package/dist/renderer/assets/smalltalk-BOIGQuhN.js +121 -0
  154. package/dist/renderer/assets/solr-CwD7U71z.js +69 -0
  155. package/dist/renderer/assets/sparql-DYskk2vE.js +249 -0
  156. package/dist/renderer/assets/spreadsheet-Bgtt3oLP.js +87 -0
  157. package/dist/renderer/assets/sql-BSrOzCRI.js +354 -0
  158. package/dist/renderer/assets/stex-B6LNC55o.js +231 -0
  159. package/dist/renderer/assets/stylus-BkS-boTH.js +565 -0
  160. package/dist/renderer/assets/swift-FRZi1uvB.js +291 -0
  161. package/dist/renderer/assets/tcl-CUcaCdmq.js +114 -0
  162. package/dist/renderer/assets/textile-BnFpjsrl.js +414 -0
  163. package/dist/renderer/assets/tiddlywiki-CjprD-Qp.js +218 -0
  164. package/dist/renderer/assets/tiki-DK9DOeWn.js +268 -0
  165. package/dist/renderer/assets/toml-BOuWGMcf.js +76 -0
  166. package/dist/renderer/assets/troff-E1bJ0PPL.js +61 -0
  167. package/dist/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
  168. package/dist/renderer/assets/ttcn-tKd4HLu4.js +192 -0
  169. package/dist/renderer/assets/turtle-Dq7-1WAf.js +124 -0
  170. package/dist/renderer/assets/vb-Dp90gtsv.js +196 -0
  171. package/dist/renderer/assets/vbscript-CI6_mxxU.js +479 -0
  172. package/dist/renderer/assets/velocity-BwIZK1TH.js +149 -0
  173. package/dist/renderer/assets/verilog-DDCYnHN8.js +430 -0
  174. package/dist/renderer/assets/vhdl-DCkMIyT9.js +158 -0
  175. package/dist/renderer/assets/{web-BKE0SH0E.js → web-C4yaM4Cl.js} +1 -1
  176. package/dist/renderer/assets/{web-CBsFp24u.js → web-CF2Dtak3.js} +2 -3
  177. package/dist/renderer/assets/{web-Dc8YgoHP.js → web-DUy9unYf.js} +1 -1
  178. package/dist/renderer/assets/webidl-BTLTThCm.js +204 -0
  179. package/dist/renderer/assets/xquery-BrBUuxMR.js +525 -0
  180. package/dist/renderer/assets/yacas-b5lAVEIl.js +130 -0
  181. package/dist/renderer/assets/z80-BZV19vqv.js +93 -0
  182. package/dist/renderer/index.html +97 -77
  183. package/package.json +88 -60
  184. package/themes/README.md +99 -300
  185. package/themes/bear.css +38 -0
  186. package/themes/dark.css +20 -0
  187. package/themes/dracula.css +38 -0
  188. package/themes/elegant.css +53 -671
  189. package/themes/gruvbox.css +42 -0
  190. package/themes/light.css +20 -0
  191. package/themes/midnight.css +31 -0
  192. package/themes/nord.css +38 -0
  193. package/themes/notion.css +48 -0
  194. package/themes/sepia.css +48 -0
  195. package/themes/solarized-dark.css +35 -0
  196. package/themes/template.css +76 -498
  197. package/themes/writer.css +44 -0
  198. package/.github/workflows/release.yml +0 -66
  199. package/.trae/specs/optimize-theme-loading/checklist.md +0 -20
  200. package/.trae/specs/optimize-theme-loading/spec.md +0 -103
  201. package/.trae/specs/optimize-theme-loading/tasks.md +0 -40
  202. package/CHANGELOG.md +0 -320
  203. package/CLAUDE.md +0 -143
  204. package/android/app/build/.npmkeep +0 -0
  205. package/android/app/build.gradle +0 -76
  206. package/android/app/capacitor.build.gradle +0 -24
  207. package/android/app/proguard-rules.pro +0 -21
  208. package/android/app/release.keystore +0 -0
  209. package/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +0 -26
  210. package/android/app/src/main/AndroidManifest.xml +0 -64
  211. package/android/app/src/main/java/cn/bytechain/colamd/MainActivity.java +0 -180
  212. package/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -170
  213. package/android/app/src/main/res/drawable/splash.png +0 -0
  214. package/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
  215. package/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
  216. package/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
  217. package/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
  218. package/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
  219. package/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
  220. package/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
  221. package/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
  222. package/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
  223. package/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
  224. package/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
  225. package/android/app/src/main/res/layout/activity_main.xml +0 -12
  226. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
  227. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
  228. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  229. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  230. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  231. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  232. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  233. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  234. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  235. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  236. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  237. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  238. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  239. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  240. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  241. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  242. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  243. package/android/app/src/main/res/values/ic_launcher_background.xml +0 -4
  244. package/android/app/src/main/res/values/strings.xml +0 -7
  245. package/android/app/src/main/res/values/styles.xml +0 -22
  246. package/android/app/src/main/res/xml/file_paths.xml +0 -5
  247. package/android/app/src/main/res/xml/network_security_config.xml +0 -8
  248. package/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +0 -18
  249. package/android/build.gradle +0 -29
  250. package/android/capacitor.settings.gradle +0 -21
  251. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  252. package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  253. package/android/gradle.properties +0 -22
  254. package/android/gradlew +0 -248
  255. package/android/gradlew.bat +0 -92
  256. package/android/settings.gradle +0 -5
  257. package/android/variables.gradle +0 -16
  258. package/capacitor.config.js +0 -29
  259. package/capacitor.config.ts +0 -30
  260. package/demo.md +0 -193
  261. package/dist/renderer/assets/arc-_lugyDzx.js +0 -131
  262. package/dist/renderer/assets/architectureDiagram-3BPJPVTR-DDfP-F9D.js +0 -8721
  263. package/dist/renderer/assets/blockDiagram-GPEHLZMM-DOETUKma.js +0 -3826
  264. package/dist/renderer/assets/c4Diagram-AAUBKEIU-kAmLfVtk.js +0 -2483
  265. package/dist/renderer/assets/channel-CD4vJFwr.js +0 -7
  266. package/dist/renderer/assets/chunk-2J33WTMH-DkVrgw4l.js +0 -24
  267. package/dist/renderer/assets/chunk-4BX2VUAB-JTZ-VKNX.js +0 -16
  268. package/dist/renderer/assets/chunk-55IACEB6-Di_O5box.js +0 -13
  269. package/dist/renderer/assets/chunk-727SXJPM-BgKvwR8w.js +0 -2016
  270. package/dist/renderer/assets/chunk-AQP2D5EJ-DonSXCCQ.js +0 -1953
  271. package/dist/renderer/assets/chunk-FMBD7UC4-CsV8Lmy6.js +0 -19
  272. package/dist/renderer/assets/chunk-ND2GUHAM-C_-_dlq7.js +0 -116
  273. package/dist/renderer/assets/chunk-QZHKN3VN-aCmcDsfu.js +0 -19
  274. package/dist/renderer/assets/classDiagram-4FO5ZUOK-nuHQLjzM.js +0 -24
  275. package/dist/renderer/assets/classDiagram-v2-Q7XG4LA2-nuHQLjzM.js +0 -24
  276. package/dist/renderer/assets/cose-bilkent-S5V4N54A-Di1_SXt9.js +0 -4943
  277. package/dist/renderer/assets/cytoscape.esm-CpHeHM5e.js +0 -30269
  278. package/dist/renderer/assets/dagre-BM42HDAG-CqOUIYsL.js +0 -706
  279. package/dist/renderer/assets/defaultLocale-B2RvLBDe.js +0 -206
  280. package/dist/renderer/assets/diagram-2AECGRRQ-F-fP19TC.js +0 -302
  281. package/dist/renderer/assets/diagram-5GNKFQAL-BD5XZc8G.js +0 -170
  282. package/dist/renderer/assets/diagram-KO2AKTUF-Qa3ZxA67.js +0 -633
  283. package/dist/renderer/assets/diagram-LMA3HP47-DqDnw2RA.js +0 -213
  284. package/dist/renderer/assets/diagram-OG6HWLK6-BH4Elzby.js +0 -852
  285. package/dist/renderer/assets/erDiagram-TEJ5UH35-CaKZCewa.js +0 -1228
  286. package/dist/renderer/assets/flowDiagram-I6XJVG4X-C8znUgyL.js +0 -2333
  287. package/dist/renderer/assets/ganttDiagram-6RSMTGT7-DnRvbMnU.js +0 -3721
  288. package/dist/renderer/assets/gitGraphDiagram-PVQCEYII-CZuRZzk4.js +0 -1374
  289. package/dist/renderer/assets/graph-CYiEKt0j.js +0 -1988
  290. package/dist/renderer/assets/index-B4uDgADr.js +0 -530
  291. package/dist/renderer/assets/index-BX6JHKv6.js +0 -73314
  292. package/dist/renderer/assets/index-CGj1spkU.js +0 -27
  293. package/dist/renderer/assets/index-CcwAgVRi.css +0 -2226
  294. package/dist/renderer/assets/index-D4CPFkph.js +0 -9
  295. package/dist/renderer/assets/index-Y89U1ptl.js +0 -9
  296. package/dist/renderer/assets/infoDiagram-5YYISTIA-BlBUdqMb.js +0 -32
  297. package/dist/renderer/assets/init-ZxktEp_H.js +0 -16
  298. package/dist/renderer/assets/ishikawaDiagram-YF4QCWOH-TeVytCrP.js +0 -968
  299. package/dist/renderer/assets/journeyDiagram-JHISSGLW-BLZa3jnX.js +0 -1256
  300. package/dist/renderer/assets/kanban-definition-UN3LZRKU-foVxWrJn.js +0 -1053
  301. package/dist/renderer/assets/layout-DOAlFUVb.js +0 -2610
  302. package/dist/renderer/assets/linear-BMBn6kVq.js +0 -340
  303. package/dist/renderer/assets/mindmap-definition-RKZ34NQL-5pGeNCcp.js +0 -1181
  304. package/dist/renderer/assets/ordinal-DSZU4PqD.js +0 -76
  305. package/dist/renderer/assets/pieDiagram-4H26LBE5-N9aAUxfr.js +0 -247
  306. package/dist/renderer/assets/preload-helper-tXtZnHb0.js +0 -88
  307. package/dist/renderer/assets/quadrantDiagram-W4KKPZXB-BPxbtjga.js +0 -1345
  308. package/dist/renderer/assets/requirementDiagram-4Y6WPE33-CK1LrJyG.js +0 -1205
  309. package/dist/renderer/assets/sankeyDiagram-5OEKKPKP-BNj7Sqii.js +0 -1275
  310. package/dist/renderer/assets/sequenceDiagram-3UESZ5HK-B-r7lNhI.js +0 -4515
  311. package/dist/renderer/assets/stateDiagram-AJRCARHV-wrWE0MRa.js +0 -451
  312. package/dist/renderer/assets/stateDiagram-v2-BHNVJYJU-CE-Lqo2d.js +0 -22
  313. package/dist/renderer/assets/timeline-definition-PNZ67QCA-BkeMGH4J.js +0 -1597
  314. package/dist/renderer/assets/vennDiagram-CIIHVFJN-BTxVzto3.js +0 -2487
  315. package/dist/renderer/assets/wardley-L42UT6IY-b-_GPpqL.js +0 -30699
  316. package/dist/renderer/assets/wardleyDiagram-YWT4CUSO-D2r5dVGW.js +0 -976
  317. package/dist/renderer/assets/web-TfDzToU7.js +0 -58
  318. package/dist/renderer/assets/xychartDiagram-2RQKCTM6-BHQdINVc.js +0 -1933
  319. package/docs/RELEASE_NOTES_v1.5.1.md +0 -382
  320. package/docs/academic-demo.md +0 -567
  321. package/docs/agent-diff-view.md +0 -48
  322. package/docs/demo.html +0 -748
  323. package/docs/demo.md +0 -546
  324. package/docs/demo.pdf +0 -0
  325. package/docs/theme-paradigm.md +0 -797
  326. package/electron-builder.yml +0 -64
  327. package/electron.vite.config.js +0 -31
  328. package/electron.vite.config.ts +0 -30
  329. package/ios/App/App/AppDelegate.swift +0 -49
  330. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  331. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -14
  332. package/ios/App/App/Assets.xcassets/Contents.json +0 -6
  333. package/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +0 -23
  334. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  335. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  336. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  337. package/ios/App/App/Base.lproj/LaunchScreen.storyboard +0 -32
  338. package/ios/App/App/Base.lproj/Main.storyboard +0 -19
  339. package/ios/App/App/Info.plist +0 -49
  340. package/ios/App/App.xcodeproj/project.pbxproj +0 -408
  341. package/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  342. package/ios/App/Podfile +0 -28
  343. package/resources/entitlements.mac.plist +0 -12
  344. package/resources/icon.icns +0 -0
  345. package/resources/icon.png +0 -0
  346. package/resources/icon.svg +0 -23
  347. package/resources/templates/slides/icon.png +0 -0
  348. package/resources/templates/slides/slides-template.md +0 -74
  349. package/resources/templates/slides/template-forest-ink.html +0 -540
  350. package/resources/templates/slides/template.html +0 -535
  351. package/scripts/afterPack.js +0 -13
  352. package/scripts/generate-icons.js +0 -102
  353. package/src/main/index.ts +0 -919
  354. package/src/preload/index.d.ts +0 -51
  355. package/src/preload/index.js +0 -70
  356. package/src/preload/index.ts +0 -110
  357. package/src/renderer/capacitor-api.ts +0 -713
  358. package/src/renderer/editor/editor.ts +0 -287
  359. package/src/renderer/editor/html-view.ts +0 -15
  360. package/src/renderer/editor/plugins/index.ts +0 -86
  361. package/src/renderer/editor/plugins/math-plugin.ts +0 -305
  362. package/src/renderer/editor/plugins/mermaid-plugin-custom.css +0 -46
  363. package/src/renderer/editor/plugins/mermaid-plugin-dark.css +0 -428
  364. package/src/renderer/editor/plugins/mermaid-plugin-elegant.css +0 -443
  365. package/src/renderer/editor/plugins/mermaid-plugin-newsprint.css +0 -208
  366. package/src/renderer/editor/plugins/mermaid-plugin.css +0 -111
  367. package/src/renderer/editor/plugins/mermaid-plugin.ts +0 -680
  368. package/src/renderer/editor/plugins/themes/base/dark.css +0 -23
  369. package/src/renderer/editor/plugins/themes/base/elegant.css +0 -32
  370. package/src/renderer/editor/plugins/themes/base/light.css +0 -20
  371. package/src/renderer/editor/plugins/themes/base/newsprint.css +0 -27
  372. package/src/renderer/editor/plugins/themes/base.css +0 -509
  373. package/src/renderer/editor/plugins/themes/components/mermaid/academic.css +0 -43
  374. package/src/renderer/editor/plugins/themes/components/mermaid/dark.css +0 -20
  375. package/src/renderer/editor/plugins/themes/components/mermaid/elegant.css +0 -24
  376. package/src/renderer/editor/plugins/themes/components/mermaid/light.css +0 -21
  377. package/src/renderer/editor/plugins/themes/components/mermaid/newsprint.css +0 -26
  378. package/src/renderer/editor/plugins/themes/components/mermaid/variables.css +0 -592
  379. package/src/renderer/editor/plugins/themes/foundation.css +0 -143
  380. package/src/renderer/editor/plugins/themes/theme-manager.ts +0 -133
  381. package/src/renderer/env.d.ts +0 -10
  382. package/src/renderer/index.html +0 -76
  383. package/src/renderer/main.ts +0 -775
  384. package/src/renderer/mobile.css +0 -428
  385. package/themes/academic-paper-pt.css +0 -1321
  386. package/themes/academic-paper.css +0 -1416
  387. package/themes/forest-ink.css +0 -664
  388. package/themes/guizang.css +0 -732
  389. package/themes/pixso-design.css +0 -1261
  390. package/themes/swiss-design.css +0 -596
  391. package/tsconfig.json +0 -14
  392. package/tsconfig.main.json +0 -12
  393. package/tsconfig.main.tsbuildinfo +0 -1
  394. package/tsconfig.preload.json +0 -12
  395. package/tsconfig.preload.tsbuildinfo +0 -1
  396. package/tsconfig.renderer.json +0 -13
  397. package/tsconfig.renderer.tsbuildinfo +0 -1
  398. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,994 @@
1
+ function mkJavaScript(parserConfig) {
2
+ var statementIndent = parserConfig.statementIndent;
3
+ var jsonldMode = parserConfig.jsonld;
4
+ var jsonMode = parserConfig.json || jsonldMode;
5
+ var isTS = parserConfig.typescript;
6
+ var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
7
+ var keywords = (function() {
8
+ function kw(type2) {
9
+ return { type: type2, style: "keyword" };
10
+ }
11
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
12
+ var operator = kw("operator"), atom = { type: "atom", style: "atom" };
13
+ return {
14
+ "if": kw("if"),
15
+ "while": A,
16
+ "with": A,
17
+ "else": B,
18
+ "do": B,
19
+ "try": B,
20
+ "finally": B,
21
+ "return": D,
22
+ "break": D,
23
+ "continue": D,
24
+ "new": kw("new"),
25
+ "delete": C,
26
+ "void": C,
27
+ "throw": C,
28
+ "debugger": kw("debugger"),
29
+ "var": kw("var"),
30
+ "const": kw("var"),
31
+ "let": kw("var"),
32
+ "function": kw("function"),
33
+ "catch": kw("catch"),
34
+ "for": kw("for"),
35
+ "switch": kw("switch"),
36
+ "case": kw("case"),
37
+ "default": kw("default"),
38
+ "in": operator,
39
+ "typeof": operator,
40
+ "instanceof": operator,
41
+ "true": atom,
42
+ "false": atom,
43
+ "null": atom,
44
+ "undefined": atom,
45
+ "NaN": atom,
46
+ "Infinity": atom,
47
+ "this": kw("this"),
48
+ "class": kw("class"),
49
+ "super": kw("atom"),
50
+ "yield": C,
51
+ "export": kw("export"),
52
+ "import": kw("import"),
53
+ "extends": C,
54
+ "await": C
55
+ };
56
+ })();
57
+ var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
58
+ var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
59
+ function readRegexp(stream) {
60
+ var escaped = false, next, inSet = false;
61
+ while ((next = stream.next()) != null) {
62
+ if (!escaped) {
63
+ if (next == "/" && !inSet) return;
64
+ if (next == "[") inSet = true;
65
+ else if (inSet && next == "]") inSet = false;
66
+ }
67
+ escaped = !escaped && next == "\\";
68
+ }
69
+ }
70
+ var type, content;
71
+ function ret(tp, style, cont2) {
72
+ type = tp;
73
+ content = cont2;
74
+ return style;
75
+ }
76
+ function tokenBase(stream, state) {
77
+ var ch = stream.next();
78
+ if (ch == '"' || ch == "'") {
79
+ state.tokenize = tokenString(ch);
80
+ return state.tokenize(stream, state);
81
+ } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) {
82
+ return ret("number", "number");
83
+ } else if (ch == "." && stream.match("..")) {
84
+ return ret("spread", "meta");
85
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
86
+ return ret(ch);
87
+ } else if (ch == "=" && stream.eat(">")) {
88
+ return ret("=>", "operator");
89
+ } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {
90
+ return ret("number", "number");
91
+ } else if (/\d/.test(ch)) {
92
+ stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);
93
+ return ret("number", "number");
94
+ } else if (ch == "/") {
95
+ if (stream.eat("*")) {
96
+ state.tokenize = tokenComment;
97
+ return tokenComment(stream, state);
98
+ } else if (stream.eat("/")) {
99
+ stream.skipToEnd();
100
+ return ret("comment", "comment");
101
+ } else if (expressionAllowed(stream, state, 1)) {
102
+ readRegexp(stream);
103
+ stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
104
+ return ret("regexp", "string.special");
105
+ } else {
106
+ stream.eat("=");
107
+ return ret("operator", "operator", stream.current());
108
+ }
109
+ } else if (ch == "`") {
110
+ state.tokenize = tokenQuasi;
111
+ return tokenQuasi(stream, state);
112
+ } else if (ch == "#" && stream.peek() == "!") {
113
+ stream.skipToEnd();
114
+ return ret("meta", "meta");
115
+ } else if (ch == "#" && stream.eatWhile(wordRE)) {
116
+ return ret("variable", "property");
117
+ } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start))) {
118
+ stream.skipToEnd();
119
+ return ret("comment", "comment");
120
+ } else if (isOperatorChar.test(ch)) {
121
+ if (ch != ">" || !state.lexical || state.lexical.type != ">") {
122
+ if (stream.eat("=")) {
123
+ if (ch == "!" || ch == "=") stream.eat("=");
124
+ } else if (/[<>*+\-|&?]/.test(ch)) {
125
+ stream.eat(ch);
126
+ if (ch == ">") stream.eat(ch);
127
+ }
128
+ }
129
+ if (ch == "?" && stream.eat(".")) return ret(".");
130
+ return ret("operator", "operator", stream.current());
131
+ } else if (wordRE.test(ch)) {
132
+ stream.eatWhile(wordRE);
133
+ var word = stream.current();
134
+ if (state.lastType != ".") {
135
+ if (keywords.propertyIsEnumerable(word)) {
136
+ var kw = keywords[word];
137
+ return ret(kw.type, kw.style, word);
138
+ }
139
+ if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
140
+ return ret("async", "keyword", word);
141
+ }
142
+ return ret("variable", "variable", word);
143
+ }
144
+ }
145
+ function tokenString(quote) {
146
+ return function(stream, state) {
147
+ var escaped = false, next;
148
+ if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)) {
149
+ state.tokenize = tokenBase;
150
+ return ret("jsonld-keyword", "meta");
151
+ }
152
+ while ((next = stream.next()) != null) {
153
+ if (next == quote && !escaped) break;
154
+ escaped = !escaped && next == "\\";
155
+ }
156
+ if (!escaped) state.tokenize = tokenBase;
157
+ return ret("string", "string");
158
+ };
159
+ }
160
+ function tokenComment(stream, state) {
161
+ var maybeEnd = false, ch;
162
+ while (ch = stream.next()) {
163
+ if (ch == "/" && maybeEnd) {
164
+ state.tokenize = tokenBase;
165
+ break;
166
+ }
167
+ maybeEnd = ch == "*";
168
+ }
169
+ return ret("comment", "comment");
170
+ }
171
+ function tokenQuasi(stream, state) {
172
+ var escaped = false, next;
173
+ while ((next = stream.next()) != null) {
174
+ if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
175
+ state.tokenize = tokenBase;
176
+ break;
177
+ }
178
+ escaped = !escaped && next == "\\";
179
+ }
180
+ return ret("quasi", "string.special", stream.current());
181
+ }
182
+ var brackets = "([{}])";
183
+ function findFatArrow(stream, state) {
184
+ if (state.fatArrowAt) state.fatArrowAt = null;
185
+ var arrow = stream.string.indexOf("=>", stream.start);
186
+ if (arrow < 0) return;
187
+ if (isTS) {
188
+ var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow));
189
+ if (m) arrow = m.index;
190
+ }
191
+ var depth = 0, sawSomething = false;
192
+ for (var pos = arrow - 1; pos >= 0; --pos) {
193
+ var ch = stream.string.charAt(pos);
194
+ var bracket = brackets.indexOf(ch);
195
+ if (bracket >= 0 && bracket < 3) {
196
+ if (!depth) {
197
+ ++pos;
198
+ break;
199
+ }
200
+ if (--depth == 0) {
201
+ if (ch == "(") sawSomething = true;
202
+ break;
203
+ }
204
+ } else if (bracket >= 3 && bracket < 6) {
205
+ ++depth;
206
+ } else if (wordRE.test(ch)) {
207
+ sawSomething = true;
208
+ } else if (/["'\/`]/.test(ch)) {
209
+ for (; ; --pos) {
210
+ if (pos == 0) return;
211
+ var next = stream.string.charAt(pos - 1);
212
+ if (next == ch && stream.string.charAt(pos - 2) != "\\") {
213
+ pos--;
214
+ break;
215
+ }
216
+ }
217
+ } else if (sawSomething && !depth) {
218
+ ++pos;
219
+ break;
220
+ }
221
+ }
222
+ if (sawSomething && !depth) state.fatArrowAt = pos;
223
+ }
224
+ var atomicTypes = {
225
+ "atom": true,
226
+ "number": true,
227
+ "variable": true,
228
+ "string": true,
229
+ "regexp": true,
230
+ "this": true,
231
+ "import": true,
232
+ "jsonld-keyword": true
233
+ };
234
+ function JSLexical(indented, column, type2, align, prev, info) {
235
+ this.indented = indented;
236
+ this.column = column;
237
+ this.type = type2;
238
+ this.prev = prev;
239
+ this.info = info;
240
+ if (align != null) this.align = align;
241
+ }
242
+ function inScope(state, varname) {
243
+ for (var v = state.localVars; v; v = v.next)
244
+ if (v.name == varname) return true;
245
+ for (var cx2 = state.context; cx2; cx2 = cx2.prev) {
246
+ for (var v = cx2.vars; v; v = v.next)
247
+ if (v.name == varname) return true;
248
+ }
249
+ }
250
+ function parseJS(state, style, type2, content2, stream) {
251
+ var cc = state.cc;
252
+ cx.state = state;
253
+ cx.stream = stream;
254
+ cx.marked = null;
255
+ cx.cc = cc;
256
+ cx.style = style;
257
+ if (!state.lexical.hasOwnProperty("align"))
258
+ state.lexical.align = true;
259
+ while (true) {
260
+ var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
261
+ if (combinator(type2, content2)) {
262
+ while (cc.length && cc[cc.length - 1].lex)
263
+ cc.pop()();
264
+ if (cx.marked) return cx.marked;
265
+ if (type2 == "variable" && inScope(state, content2)) return "variableName.local";
266
+ return style;
267
+ }
268
+ }
269
+ }
270
+ var cx = { state: null, marked: null, cc: null };
271
+ function pass() {
272
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
273
+ }
274
+ function cont() {
275
+ pass.apply(null, arguments);
276
+ return true;
277
+ }
278
+ function inList(name, list) {
279
+ for (var v = list; v; v = v.next) if (v.name == name) return true;
280
+ return false;
281
+ }
282
+ function register(varname) {
283
+ var state = cx.state;
284
+ cx.marked = "def";
285
+ if (state.context) {
286
+ if (state.lexical.info == "var" && state.context && state.context.block) {
287
+ var newContext = registerVarScoped(varname, state.context);
288
+ if (newContext != null) {
289
+ state.context = newContext;
290
+ return;
291
+ }
292
+ } else if (!inList(varname, state.localVars)) {
293
+ state.localVars = new Var(varname, state.localVars);
294
+ return;
295
+ }
296
+ }
297
+ if (parserConfig.globalVars && !inList(varname, state.globalVars))
298
+ state.globalVars = new Var(varname, state.globalVars);
299
+ }
300
+ function registerVarScoped(varname, context) {
301
+ if (!context) {
302
+ return null;
303
+ } else if (context.block) {
304
+ var inner = registerVarScoped(varname, context.prev);
305
+ if (!inner) return null;
306
+ if (inner == context.prev) return context;
307
+ return new Context(inner, context.vars, true);
308
+ } else if (inList(varname, context.vars)) {
309
+ return context;
310
+ } else {
311
+ return new Context(context.prev, new Var(varname, context.vars), false);
312
+ }
313
+ }
314
+ function isModifier(name) {
315
+ return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly";
316
+ }
317
+ function Context(prev, vars, block2) {
318
+ this.prev = prev;
319
+ this.vars = vars;
320
+ this.block = block2;
321
+ }
322
+ function Var(name, next) {
323
+ this.name = name;
324
+ this.next = next;
325
+ }
326
+ var defaultVars = new Var("this", new Var("arguments", null));
327
+ function pushcontext() {
328
+ cx.state.context = new Context(cx.state.context, cx.state.localVars, false);
329
+ cx.state.localVars = defaultVars;
330
+ }
331
+ function pushblockcontext() {
332
+ cx.state.context = new Context(cx.state.context, cx.state.localVars, true);
333
+ cx.state.localVars = null;
334
+ }
335
+ pushcontext.lex = pushblockcontext.lex = true;
336
+ function popcontext() {
337
+ cx.state.localVars = cx.state.context.vars;
338
+ cx.state.context = cx.state.context.prev;
339
+ }
340
+ popcontext.lex = true;
341
+ function pushlex(type2, info) {
342
+ var result = function() {
343
+ var state = cx.state, indent = state.indented;
344
+ if (state.lexical.type == "stat") indent = state.lexical.indented;
345
+ else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
346
+ indent = outer.indented;
347
+ state.lexical = new JSLexical(indent, cx.stream.column(), type2, null, state.lexical, info);
348
+ };
349
+ result.lex = true;
350
+ return result;
351
+ }
352
+ function poplex() {
353
+ var state = cx.state;
354
+ if (state.lexical.prev) {
355
+ if (state.lexical.type == ")")
356
+ state.indented = state.lexical.indented;
357
+ state.lexical = state.lexical.prev;
358
+ }
359
+ }
360
+ poplex.lex = true;
361
+ function expect(wanted) {
362
+ function exp(type2) {
363
+ if (type2 == wanted) return cont();
364
+ else if (wanted == ";" || type2 == "}" || type2 == ")" || type2 == "]") return pass();
365
+ else return cont(exp);
366
+ }
367
+ return exp;
368
+ }
369
+ function statement(type2, value) {
370
+ if (type2 == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
371
+ if (type2 == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
372
+ if (type2 == "keyword b") return cont(pushlex("form"), statement, poplex);
373
+ if (type2 == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
374
+ if (type2 == "debugger") return cont(expect(";"));
375
+ if (type2 == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
376
+ if (type2 == ";") return cont();
377
+ if (type2 == "if") {
378
+ if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
379
+ cx.state.cc.pop()();
380
+ return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
381
+ }
382
+ if (type2 == "function") return cont(functiondef);
383
+ if (type2 == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
384
+ if (type2 == "class" || isTS && value == "interface") {
385
+ cx.marked = "keyword";
386
+ return cont(pushlex("form", type2 == "class" ? type2 : value), className, poplex);
387
+ }
388
+ if (type2 == "variable") {
389
+ if (isTS && value == "declare") {
390
+ cx.marked = "keyword";
391
+ return cont(statement);
392
+ } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
393
+ cx.marked = "keyword";
394
+ if (value == "enum") return cont(enumdef);
395
+ else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));
396
+ else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex);
397
+ } else if (isTS && value == "namespace") {
398
+ cx.marked = "keyword";
399
+ return cont(pushlex("form"), expression, statement, poplex);
400
+ } else if (isTS && value == "abstract") {
401
+ cx.marked = "keyword";
402
+ return cont(statement);
403
+ } else {
404
+ return cont(pushlex("stat"), maybelabel);
405
+ }
406
+ }
407
+ if (type2 == "switch") return cont(
408
+ pushlex("form"),
409
+ parenExpr,
410
+ expect("{"),
411
+ pushlex("}", "switch"),
412
+ pushblockcontext,
413
+ block,
414
+ poplex,
415
+ poplex,
416
+ popcontext
417
+ );
418
+ if (type2 == "case") return cont(expression, expect(":"));
419
+ if (type2 == "default") return cont(expect(":"));
420
+ if (type2 == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
421
+ if (type2 == "export") return cont(pushlex("stat"), afterExport, poplex);
422
+ if (type2 == "import") return cont(pushlex("stat"), afterImport, poplex);
423
+ if (type2 == "async") return cont(statement);
424
+ if (value == "@") return cont(expression, statement);
425
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
426
+ }
427
+ function maybeCatchBinding(type2) {
428
+ if (type2 == "(") return cont(funarg, expect(")"));
429
+ }
430
+ function expression(type2, value) {
431
+ return expressionInner(type2, value, false);
432
+ }
433
+ function expressionNoComma(type2, value) {
434
+ return expressionInner(type2, value, true);
435
+ }
436
+ function parenExpr(type2) {
437
+ if (type2 != "(") return pass();
438
+ return cont(pushlex(")"), maybeexpression, expect(")"), poplex);
439
+ }
440
+ function expressionInner(type2, value, noComma) {
441
+ if (cx.state.fatArrowAt == cx.stream.start) {
442
+ var body = noComma ? arrowBodyNoComma : arrowBody;
443
+ if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
444
+ else if (type2 == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
445
+ }
446
+ var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
447
+ if (atomicTypes.hasOwnProperty(type2)) return cont(maybeop);
448
+ if (type2 == "function") return cont(functiondef, maybeop);
449
+ if (type2 == "class" || isTS && value == "interface") {
450
+ cx.marked = "keyword";
451
+ return cont(pushlex("form"), classExpression, poplex);
452
+ }
453
+ if (type2 == "keyword c" || type2 == "async") return cont(noComma ? expressionNoComma : expression);
454
+ if (type2 == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
455
+ if (type2 == "operator" || type2 == "spread") return cont(noComma ? expressionNoComma : expression);
456
+ if (type2 == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
457
+ if (type2 == "{") return contCommasep(objprop, "}", null, maybeop);
458
+ if (type2 == "quasi") return pass(quasi, maybeop);
459
+ if (type2 == "new") return cont(maybeTarget(noComma));
460
+ return cont();
461
+ }
462
+ function maybeexpression(type2) {
463
+ if (type2.match(/[;\}\)\],]/)) return pass();
464
+ return pass(expression);
465
+ }
466
+ function maybeoperatorComma(type2, value) {
467
+ if (type2 == ",") return cont(maybeexpression);
468
+ return maybeoperatorNoComma(type2, value, false);
469
+ }
470
+ function maybeoperatorNoComma(type2, value, noComma) {
471
+ var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
472
+ var expr = noComma == false ? expression : expressionNoComma;
473
+ if (type2 == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
474
+ if (type2 == "operator") {
475
+ if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
476
+ if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
477
+ return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
478
+ if (value == "?") return cont(expression, expect(":"), expr);
479
+ return cont(expr);
480
+ }
481
+ if (type2 == "quasi") {
482
+ return pass(quasi, me);
483
+ }
484
+ if (type2 == ";") return;
485
+ if (type2 == "(") return contCommasep(expressionNoComma, ")", "call", me);
486
+ if (type2 == ".") return cont(property, me);
487
+ if (type2 == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
488
+ if (isTS && value == "as") {
489
+ cx.marked = "keyword";
490
+ return cont(typeexpr, me);
491
+ }
492
+ if (type2 == "regexp") {
493
+ cx.state.lastType = cx.marked = "operator";
494
+ cx.stream.backUp(cx.stream.pos - cx.stream.start - 1);
495
+ return cont(expr);
496
+ }
497
+ }
498
+ function quasi(type2, value) {
499
+ if (type2 != "quasi") return pass();
500
+ if (value.slice(value.length - 2) != "${") return cont(quasi);
501
+ return cont(maybeexpression, continueQuasi);
502
+ }
503
+ function continueQuasi(type2) {
504
+ if (type2 == "}") {
505
+ cx.marked = "string.special";
506
+ cx.state.tokenize = tokenQuasi;
507
+ return cont(quasi);
508
+ }
509
+ }
510
+ function arrowBody(type2) {
511
+ findFatArrow(cx.stream, cx.state);
512
+ return pass(type2 == "{" ? statement : expression);
513
+ }
514
+ function arrowBodyNoComma(type2) {
515
+ findFatArrow(cx.stream, cx.state);
516
+ return pass(type2 == "{" ? statement : expressionNoComma);
517
+ }
518
+ function maybeTarget(noComma) {
519
+ return function(type2) {
520
+ if (type2 == ".") return cont(noComma ? targetNoComma : target);
521
+ else if (type2 == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma);
522
+ else return pass(noComma ? expressionNoComma : expression);
523
+ };
524
+ }
525
+ function target(_, value) {
526
+ if (value == "target") {
527
+ cx.marked = "keyword";
528
+ return cont(maybeoperatorComma);
529
+ }
530
+ }
531
+ function targetNoComma(_, value) {
532
+ if (value == "target") {
533
+ cx.marked = "keyword";
534
+ return cont(maybeoperatorNoComma);
535
+ }
536
+ }
537
+ function maybelabel(type2) {
538
+ if (type2 == ":") return cont(poplex, statement);
539
+ return pass(maybeoperatorComma, expect(";"), poplex);
540
+ }
541
+ function property(type2) {
542
+ if (type2 == "variable") {
543
+ cx.marked = "property";
544
+ return cont();
545
+ }
546
+ }
547
+ function objprop(type2, value) {
548
+ if (type2 == "async") {
549
+ cx.marked = "property";
550
+ return cont(objprop);
551
+ } else if (type2 == "variable" || cx.style == "keyword") {
552
+ cx.marked = "property";
553
+ if (value == "get" || value == "set") return cont(getterSetter);
554
+ var m;
555
+ if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
556
+ cx.state.fatArrowAt = cx.stream.pos + m[0].length;
557
+ return cont(afterprop);
558
+ } else if (type2 == "number" || type2 == "string") {
559
+ cx.marked = jsonldMode ? "property" : cx.style + " property";
560
+ return cont(afterprop);
561
+ } else if (type2 == "jsonld-keyword") {
562
+ return cont(afterprop);
563
+ } else if (isTS && isModifier(value)) {
564
+ cx.marked = "keyword";
565
+ return cont(objprop);
566
+ } else if (type2 == "[") {
567
+ return cont(expression, maybetype, expect("]"), afterprop);
568
+ } else if (type2 == "spread") {
569
+ return cont(expressionNoComma, afterprop);
570
+ } else if (value == "*") {
571
+ cx.marked = "keyword";
572
+ return cont(objprop);
573
+ } else if (type2 == ":") {
574
+ return pass(afterprop);
575
+ }
576
+ }
577
+ function getterSetter(type2) {
578
+ if (type2 != "variable") return pass(afterprop);
579
+ cx.marked = "property";
580
+ return cont(functiondef);
581
+ }
582
+ function afterprop(type2) {
583
+ if (type2 == ":") return cont(expressionNoComma);
584
+ if (type2 == "(") return pass(functiondef);
585
+ }
586
+ function commasep(what, end, sep) {
587
+ function proceed(type2, value) {
588
+ if (sep ? sep.indexOf(type2) > -1 : type2 == ",") {
589
+ var lex = cx.state.lexical;
590
+ if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
591
+ return cont(function(type3, value2) {
592
+ if (type3 == end || value2 == end) return pass();
593
+ return pass(what);
594
+ }, proceed);
595
+ }
596
+ if (type2 == end || value == end) return cont();
597
+ if (sep && sep.indexOf(";") > -1) return pass(what);
598
+ return cont(expect(end));
599
+ }
600
+ return function(type2, value) {
601
+ if (type2 == end || value == end) return cont();
602
+ return pass(what, proceed);
603
+ };
604
+ }
605
+ function contCommasep(what, end, info) {
606
+ for (var i = 3; i < arguments.length; i++)
607
+ cx.cc.push(arguments[i]);
608
+ return cont(pushlex(end, info), commasep(what, end), poplex);
609
+ }
610
+ function block(type2) {
611
+ if (type2 == "}") return cont();
612
+ return pass(statement, block);
613
+ }
614
+ function maybetype(type2, value) {
615
+ if (isTS) {
616
+ if (type2 == ":") return cont(typeexpr);
617
+ if (value == "?") return cont(maybetype);
618
+ }
619
+ }
620
+ function maybetypeOrIn(type2, value) {
621
+ if (isTS && (type2 == ":" || value == "in")) return cont(typeexpr);
622
+ }
623
+ function mayberettype(type2) {
624
+ if (isTS && type2 == ":") {
625
+ if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr);
626
+ else return cont(typeexpr);
627
+ }
628
+ }
629
+ function isKW(_, value) {
630
+ if (value == "is") {
631
+ cx.marked = "keyword";
632
+ return cont();
633
+ }
634
+ }
635
+ function typeexpr(type2, value) {
636
+ if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
637
+ cx.marked = "keyword";
638
+ return cont(value == "typeof" ? expressionNoComma : typeexpr);
639
+ }
640
+ if (type2 == "variable" || value == "void") {
641
+ cx.marked = "type";
642
+ return cont(afterType);
643
+ }
644
+ if (value == "|" || value == "&") return cont(typeexpr);
645
+ if (type2 == "string" || type2 == "number" || type2 == "atom") return cont(afterType);
646
+ if (type2 == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType);
647
+ if (type2 == "{") return cont(pushlex("}"), typeprops, poplex, afterType);
648
+ if (type2 == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType);
649
+ if (type2 == "<") return cont(commasep(typeexpr, ">"), typeexpr);
650
+ if (type2 == "quasi") return pass(quasiType, afterType);
651
+ }
652
+ function maybeReturnType(type2) {
653
+ if (type2 == "=>") return cont(typeexpr);
654
+ }
655
+ function typeprops(type2) {
656
+ if (type2.match(/[\}\)\]]/)) return cont();
657
+ if (type2 == "," || type2 == ";") return cont(typeprops);
658
+ return pass(typeprop, typeprops);
659
+ }
660
+ function typeprop(type2, value) {
661
+ if (type2 == "variable" || cx.style == "keyword") {
662
+ cx.marked = "property";
663
+ return cont(typeprop);
664
+ } else if (value == "?" || type2 == "number" || type2 == "string") {
665
+ return cont(typeprop);
666
+ } else if (type2 == ":") {
667
+ return cont(typeexpr);
668
+ } else if (type2 == "[") {
669
+ return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop);
670
+ } else if (type2 == "(") {
671
+ return pass(functiondecl, typeprop);
672
+ } else if (!type2.match(/[;\}\)\],]/)) {
673
+ return cont();
674
+ }
675
+ }
676
+ function quasiType(type2, value) {
677
+ if (type2 != "quasi") return pass();
678
+ if (value.slice(value.length - 2) != "${") return cont(quasiType);
679
+ return cont(typeexpr, continueQuasiType);
680
+ }
681
+ function continueQuasiType(type2) {
682
+ if (type2 == "}") {
683
+ cx.marked = "string.special";
684
+ cx.state.tokenize = tokenQuasi;
685
+ return cont(quasiType);
686
+ }
687
+ }
688
+ function typearg(type2, value) {
689
+ if (type2 == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg);
690
+ if (type2 == ":") return cont(typeexpr);
691
+ if (type2 == "spread") return cont(typearg);
692
+ return pass(typeexpr);
693
+ }
694
+ function afterType(type2, value) {
695
+ if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType);
696
+ if (value == "|" || type2 == "." || value == "&") return cont(typeexpr);
697
+ if (type2 == "[") return cont(typeexpr, expect("]"), afterType);
698
+ if (value == "extends" || value == "implements") {
699
+ cx.marked = "keyword";
700
+ return cont(typeexpr);
701
+ }
702
+ if (value == "?") return cont(typeexpr, expect(":"), typeexpr);
703
+ }
704
+ function maybeTypeArgs(_, value) {
705
+ if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType);
706
+ }
707
+ function typeparam() {
708
+ return pass(typeexpr, maybeTypeDefault);
709
+ }
710
+ function maybeTypeDefault(_, value) {
711
+ if (value == "=") return cont(typeexpr);
712
+ }
713
+ function vardef(_, value) {
714
+ if (value == "enum") {
715
+ cx.marked = "keyword";
716
+ return cont(enumdef);
717
+ }
718
+ return pass(pattern, maybetype, maybeAssign, vardefCont);
719
+ }
720
+ function pattern(type2, value) {
721
+ if (isTS && isModifier(value)) {
722
+ cx.marked = "keyword";
723
+ return cont(pattern);
724
+ }
725
+ if (type2 == "variable") {
726
+ register(value);
727
+ return cont();
728
+ }
729
+ if (type2 == "spread") return cont(pattern);
730
+ if (type2 == "[") return contCommasep(eltpattern, "]");
731
+ if (type2 == "{") return contCommasep(proppattern, "}");
732
+ }
733
+ function proppattern(type2, value) {
734
+ if (type2 == "variable" && !cx.stream.match(/^\s*:/, false)) {
735
+ register(value);
736
+ return cont(maybeAssign);
737
+ }
738
+ if (type2 == "variable") cx.marked = "property";
739
+ if (type2 == "spread") return cont(pattern);
740
+ if (type2 == "}") return pass();
741
+ if (type2 == "[") return cont(expression, expect("]"), expect(":"), proppattern);
742
+ return cont(expect(":"), pattern, maybeAssign);
743
+ }
744
+ function eltpattern() {
745
+ return pass(pattern, maybeAssign);
746
+ }
747
+ function maybeAssign(_type, value) {
748
+ if (value == "=") return cont(expressionNoComma);
749
+ }
750
+ function vardefCont(type2) {
751
+ if (type2 == ",") return cont(vardef);
752
+ }
753
+ function maybeelse(type2, value) {
754
+ if (type2 == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
755
+ }
756
+ function forspec(type2, value) {
757
+ if (value == "await") return cont(forspec);
758
+ if (type2 == "(") return cont(pushlex(")"), forspec1, poplex);
759
+ }
760
+ function forspec1(type2) {
761
+ if (type2 == "var") return cont(vardef, forspec2);
762
+ if (type2 == "variable") return cont(forspec2);
763
+ return pass(forspec2);
764
+ }
765
+ function forspec2(type2, value) {
766
+ if (type2 == ")") return cont();
767
+ if (type2 == ";") return cont(forspec2);
768
+ if (value == "in" || value == "of") {
769
+ cx.marked = "keyword";
770
+ return cont(expression, forspec2);
771
+ }
772
+ return pass(expression, forspec2);
773
+ }
774
+ function functiondef(type2, value) {
775
+ if (value == "*") {
776
+ cx.marked = "keyword";
777
+ return cont(functiondef);
778
+ }
779
+ if (type2 == "variable") {
780
+ register(value);
781
+ return cont(functiondef);
782
+ }
783
+ if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
784
+ if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef);
785
+ }
786
+ function functiondecl(type2, value) {
787
+ if (value == "*") {
788
+ cx.marked = "keyword";
789
+ return cont(functiondecl);
790
+ }
791
+ if (type2 == "variable") {
792
+ register(value);
793
+ return cont(functiondecl);
794
+ }
795
+ if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
796
+ if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl);
797
+ }
798
+ function typename(type2, value) {
799
+ if (type2 == "keyword" || type2 == "variable") {
800
+ cx.marked = "type";
801
+ return cont(typename);
802
+ } else if (value == "<") {
803
+ return cont(pushlex(">"), commasep(typeparam, ">"), poplex);
804
+ }
805
+ }
806
+ function funarg(type2, value) {
807
+ if (value == "@") cont(expression, funarg);
808
+ if (type2 == "spread") return cont(funarg);
809
+ if (isTS && isModifier(value)) {
810
+ cx.marked = "keyword";
811
+ return cont(funarg);
812
+ }
813
+ if (isTS && type2 == "this") return cont(maybetype, maybeAssign);
814
+ return pass(pattern, maybetype, maybeAssign);
815
+ }
816
+ function classExpression(type2, value) {
817
+ if (type2 == "variable") return className(type2, value);
818
+ return classNameAfter(type2, value);
819
+ }
820
+ function className(type2, value) {
821
+ if (type2 == "variable") {
822
+ register(value);
823
+ return cont(classNameAfter);
824
+ }
825
+ }
826
+ function classNameAfter(type2, value) {
827
+ if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter);
828
+ if (value == "extends" || value == "implements" || isTS && type2 == ",") {
829
+ if (value == "implements") cx.marked = "keyword";
830
+ return cont(isTS ? typeexpr : expression, classNameAfter);
831
+ }
832
+ if (type2 == "{") return cont(pushlex("}"), classBody, poplex);
833
+ }
834
+ function classBody(type2, value) {
835
+ if (type2 == "async" || type2 == "variable" && (value == "static" || value == "get" || value == "set" || isTS && isModifier(value)) && cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false)) {
836
+ cx.marked = "keyword";
837
+ return cont(classBody);
838
+ }
839
+ if (type2 == "variable" || cx.style == "keyword") {
840
+ cx.marked = "property";
841
+ return cont(classfield, classBody);
842
+ }
843
+ if (type2 == "number" || type2 == "string") return cont(classfield, classBody);
844
+ if (type2 == "[")
845
+ return cont(expression, maybetype, expect("]"), classfield, classBody);
846
+ if (value == "*") {
847
+ cx.marked = "keyword";
848
+ return cont(classBody);
849
+ }
850
+ if (isTS && type2 == "(") return pass(functiondecl, classBody);
851
+ if (type2 == ";" || type2 == ",") return cont(classBody);
852
+ if (type2 == "}") return cont();
853
+ if (value == "@") return cont(expression, classBody);
854
+ }
855
+ function classfield(type2, value) {
856
+ if (value == "!" || value == "?") return cont(classfield);
857
+ if (type2 == ":") return cont(typeexpr, maybeAssign);
858
+ if (value == "=") return cont(expressionNoComma);
859
+ var context = cx.state.lexical.prev, isInterface = context && context.info == "interface";
860
+ return pass(isInterface ? functiondecl : functiondef);
861
+ }
862
+ function afterExport(type2, value) {
863
+ if (value == "*") {
864
+ cx.marked = "keyword";
865
+ return cont(maybeFrom, expect(";"));
866
+ }
867
+ if (value == "default") {
868
+ cx.marked = "keyword";
869
+ return cont(expression, expect(";"));
870
+ }
871
+ if (type2 == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
872
+ return pass(statement);
873
+ }
874
+ function exportField(type2, value) {
875
+ if (value == "as") {
876
+ cx.marked = "keyword";
877
+ return cont(expect("variable"));
878
+ }
879
+ if (type2 == "variable") return pass(expressionNoComma, exportField);
880
+ }
881
+ function afterImport(type2) {
882
+ if (type2 == "string") return cont();
883
+ if (type2 == "(") return pass(expression);
884
+ if (type2 == ".") return pass(maybeoperatorComma);
885
+ return pass(importSpec, maybeMoreImports, maybeFrom);
886
+ }
887
+ function importSpec(type2, value) {
888
+ if (type2 == "{") return contCommasep(importSpec, "}");
889
+ if (type2 == "variable") register(value);
890
+ if (value == "*") cx.marked = "keyword";
891
+ return cont(maybeAs);
892
+ }
893
+ function maybeMoreImports(type2) {
894
+ if (type2 == ",") return cont(importSpec, maybeMoreImports);
895
+ }
896
+ function maybeAs(_type, value) {
897
+ if (value == "as") {
898
+ cx.marked = "keyword";
899
+ return cont(importSpec);
900
+ }
901
+ }
902
+ function maybeFrom(_type, value) {
903
+ if (value == "from") {
904
+ cx.marked = "keyword";
905
+ return cont(expression);
906
+ }
907
+ }
908
+ function arrayLiteral(type2) {
909
+ if (type2 == "]") return cont();
910
+ return pass(commasep(expressionNoComma, "]"));
911
+ }
912
+ function enumdef() {
913
+ return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex);
914
+ }
915
+ function enummember() {
916
+ return pass(pattern, maybeAssign);
917
+ }
918
+ function isContinuedStatement(state, textAfter) {
919
+ return state.lastType == "operator" || state.lastType == "," || isOperatorChar.test(textAfter.charAt(0)) || /[,.]/.test(textAfter.charAt(0));
920
+ }
921
+ function expressionAllowed(stream, state, backUp) {
922
+ return state.tokenize == tokenBase && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - backUp));
923
+ }
924
+ return {
925
+ name: parserConfig.name,
926
+ startState: function(indentUnit) {
927
+ var state = {
928
+ tokenize: tokenBase,
929
+ lastType: "sof",
930
+ cc: [],
931
+ lexical: new JSLexical(-indentUnit, 0, "block", false),
932
+ localVars: parserConfig.localVars,
933
+ context: parserConfig.localVars && new Context(null, null, false),
934
+ indented: 0
935
+ };
936
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
937
+ state.globalVars = parserConfig.globalVars;
938
+ return state;
939
+ },
940
+ token: function(stream, state) {
941
+ if (stream.sol()) {
942
+ if (!state.lexical.hasOwnProperty("align"))
943
+ state.lexical.align = false;
944
+ state.indented = stream.indentation();
945
+ findFatArrow(stream, state);
946
+ }
947
+ if (state.tokenize != tokenComment && stream.eatSpace()) return null;
948
+ var style = state.tokenize(stream, state);
949
+ if (type == "comment") return style;
950
+ state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
951
+ return parseJS(state, style, type, content, stream);
952
+ },
953
+ indent: function(state, textAfter, cx2) {
954
+ if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return null;
955
+ if (state.tokenize != tokenBase) return 0;
956
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top;
957
+ if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
958
+ var c = state.cc[i];
959
+ if (c == poplex) lexical = lexical.prev;
960
+ else if (c != maybeelse && c != popcontext) break;
961
+ }
962
+ while ((lexical.type == "stat" || lexical.type == "form") && (firstChar == "}" || (top = state.cc[state.cc.length - 1]) && (top == maybeoperatorComma || top == maybeoperatorNoComma) && !/^[,\.=+\-*:?[\(]/.test(textAfter)))
963
+ lexical = lexical.prev;
964
+ if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
965
+ lexical = lexical.prev;
966
+ var type2 = lexical.type, closing = firstChar == type2;
967
+ if (type2 == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
968
+ else if (type2 == "form" && firstChar == "{") return lexical.indented;
969
+ else if (type2 == "form") return lexical.indented + cx2.unit;
970
+ else if (type2 == "stat")
971
+ return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || cx2.unit : 0);
972
+ else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
973
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? cx2.unit : 2 * cx2.unit);
974
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
975
+ else return lexical.indented + (closing ? 0 : cx2.unit);
976
+ },
977
+ languageData: {
978
+ indentOnInput: /^\s*(?:case .*?:|default:|\{|\})$/,
979
+ commentTokens: jsonMode ? void 0 : { line: "//", block: { open: "/*", close: "*/" } },
980
+ closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
981
+ wordChars: "$"
982
+ }
983
+ };
984
+ }
985
+ const javascript = mkJavaScript({ name: "javascript" });
986
+ const json = mkJavaScript({ name: "json", json: true });
987
+ const jsonld = mkJavaScript({ name: "json", jsonld: true });
988
+ const typescript = mkJavaScript({ name: "typescript", typescript: true });
989
+ export {
990
+ javascript,
991
+ json,
992
+ jsonld,
993
+ typescript
994
+ };