claude-flow-novice 2.0.4 → 2.0.5

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 (496) hide show
  1. package/dist/src/cli/commands/guidance.js +668 -487
  2. package/dist/src/cli/commands/index-validate.js +29 -18
  3. package/dist/src/cli/commands/mcp-troubleshoot.js +282 -230
  4. package/dist/src/cli/commands/neural-goal-init.js +125 -92
  5. package/dist/src/cli/commands/swarm-exec.js +393 -317
  6. package/dist/src/cli/commands/validate-framework.js +1100 -983
  7. package/dist/src/cli/commands/validate.js +223 -144
  8. package/dist/src/cli/main.js +1 -1
  9. package/dist/src/cli/simple-commands/__tests__/agent.test.js +277 -265
  10. package/dist/src/cli/simple-commands/__tests__/memory.test.js +7 -6
  11. package/dist/src/cli/simple-commands/__tests__/swarm.test.js +356 -373
  12. package/dist/src/cli/simple-commands/__tests__/task.test.js +7 -6
  13. package/dist/src/cli/simple-commands/agent.js +193 -157
  14. package/dist/src/cli/simple-commands/analysis.js +446 -336
  15. package/dist/src/cli/simple-commands/automation-executor.js +1339 -1095
  16. package/dist/src/cli/simple-commands/automation.js +469 -481
  17. package/dist/src/cli/simple-commands/batch-manager.js +313 -261
  18. package/dist/src/cli/simple-commands/claude-telemetry.js +267 -241
  19. package/dist/src/cli/simple-commands/claude-track.js +90 -68
  20. package/dist/src/cli/simple-commands/concurrent-display.js +320 -266
  21. package/dist/src/cli/simple-commands/config.js +290 -245
  22. package/dist/src/cli/simple-commands/coordination.js +234 -182
  23. package/dist/src/cli/simple-commands/enhanced-ui-views.js +615 -812
  24. package/dist/src/cli/simple-commands/enhanced-webui-complete.js +981 -922
  25. package/dist/src/cli/simple-commands/fix-hook-variables.js +294 -274
  26. package/dist/src/cli/simple-commands/github/gh-coordinator.js +457 -378
  27. package/dist/src/cli/simple-commands/github/github-api.js +574 -535
  28. package/dist/src/cli/simple-commands/github/init.js +303 -276
  29. package/dist/src/cli/simple-commands/github.js +247 -222
  30. package/dist/src/cli/simple-commands/goal.js +63 -51
  31. package/dist/src/cli/simple-commands/hive-mind/auto-save-middleware.js +278 -208
  32. package/dist/src/cli/simple-commands/hive-mind/communication.js +696 -601
  33. package/dist/src/cli/simple-commands/hive-mind/core.js +979 -907
  34. package/dist/src/cli/simple-commands/hive-mind/db-optimizer.js +655 -406
  35. package/dist/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1245 -1125
  36. package/dist/src/cli/simple-commands/hive-mind/memory.js +1090 -854
  37. package/dist/src/cli/simple-commands/hive-mind/performance-optimizer.js +574 -459
  38. package/dist/src/cli/simple-commands/hive-mind/performance-test.js +347 -263
  39. package/dist/src/cli/simple-commands/hive-mind/queen.js +768 -727
  40. package/dist/src/cli/simple-commands/hive-mind/session-manager.js +1049 -745
  41. package/dist/src/cli/simple-commands/hive-mind-optimize.js +283 -227
  42. package/dist/src/cli/simple-commands/hive-mind-wizard.js +217 -174
  43. package/dist/src/cli/simple-commands/hive-mind.js +2282 -1841
  44. package/dist/src/cli/simple-commands/hive.js +79 -90
  45. package/dist/src/cli/simple-commands/hook-safety.js +521 -431
  46. package/dist/src/cli/simple-commands/hooks/session-start-soul.js +254 -203
  47. package/dist/src/cli/simple-commands/hooks.js +1204 -1064
  48. package/dist/src/cli/simple-commands/init/agent-copier.js +319 -294
  49. package/dist/src/cli/simple-commands/init/batch-init.js +562 -496
  50. package/dist/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +19 -13
  51. package/dist/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +19 -13
  52. package/dist/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +88 -61
  53. package/dist/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +150 -125
  54. package/dist/src/cli/simple-commands/init/claude-commands/slash-commands.js +49 -42
  55. package/dist/src/cli/simple-commands/init/claude-commands/sparc-commands.js +61 -43
  56. package/dist/src/cli/simple-commands/init/copy-revised-templates.js +147 -141
  57. package/dist/src/cli/simple-commands/init/executable-wrapper.js +44 -31
  58. package/dist/src/cli/simple-commands/init/gitignore-updater.js +90 -64
  59. package/dist/src/cli/simple-commands/init/help.js +107 -104
  60. package/dist/src/cli/simple-commands/init/hive-mind-init.js +528 -509
  61. package/dist/src/cli/simple-commands/init/index.js +1759 -1510
  62. package/dist/src/cli/simple-commands/init/performance-monitor.js +317 -234
  63. package/dist/src/cli/simple-commands/init/rollback/backup-manager.js +504 -441
  64. package/dist/src/cli/simple-commands/init/rollback/index.js +364 -289
  65. package/dist/src/cli/simple-commands/init/rollback/recovery-manager.js +728 -652
  66. package/dist/src/cli/simple-commands/init/rollback/rollback-executor.js +481 -416
  67. package/dist/src/cli/simple-commands/init/rollback/state-tracker.js +448 -369
  68. package/dist/src/cli/simple-commands/init/sparc/roo-readme.js +2 -1
  69. package/dist/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -122
  70. package/dist/src/cli/simple-commands/init/sparc/workflows.js +37 -32
  71. package/dist/src/cli/simple-commands/init/sparc-structure.js +62 -55
  72. package/dist/src/cli/simple-commands/init/template-copier.js +533 -421
  73. package/dist/src/cli/simple-commands/init/templates/coordination-md.js +6 -3
  74. package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +318 -344
  75. package/dist/src/cli/simple-commands/init/templates/github-safe-enhanced.js +218 -173
  76. package/dist/src/cli/simple-commands/init/templates/github-safe.js +75 -65
  77. package/dist/src/cli/simple-commands/init/templates/memory-bank-md.js +6 -3
  78. package/dist/src/cli/simple-commands/init/templates/readme-files.js +4 -2
  79. package/dist/src/cli/simple-commands/init/templates/safe-hook-patterns.js +230 -187
  80. package/dist/src/cli/simple-commands/init/templates/sparc-modes.js +80 -53
  81. package/dist/src/cli/simple-commands/init/templates/verification-claude-md.js +85 -101
  82. package/dist/src/cli/simple-commands/init/validation/config-validator.js +330 -283
  83. package/dist/src/cli/simple-commands/init/validation/health-checker.js +561 -495
  84. package/dist/src/cli/simple-commands/init/validation/index.js +358 -302
  85. package/dist/src/cli/simple-commands/init/validation/mode-validator.js +359 -308
  86. package/dist/src/cli/simple-commands/init/validation/post-init-validator.js +366 -389
  87. package/dist/src/cli/simple-commands/init/validation/pre-init-validator.js +268 -270
  88. package/dist/src/cli/simple-commands/init/validation/test-runner.js +447 -427
  89. package/dist/src/cli/simple-commands/init.js +2 -1
  90. package/dist/src/cli/simple-commands/mcp-health.js +158 -131
  91. package/dist/src/cli/simple-commands/mcp-integration-layer.js +634 -533
  92. package/dist/src/cli/simple-commands/mcp.js +400 -345
  93. package/dist/src/cli/simple-commands/memory-consolidation.js +537 -426
  94. package/dist/src/cli/simple-commands/memory.js +311 -247
  95. package/dist/src/cli/simple-commands/migrate-hooks.js +46 -39
  96. package/dist/src/cli/simple-commands/monitor.js +363 -294
  97. package/dist/src/cli/simple-commands/neural.js +65 -51
  98. package/dist/src/cli/simple-commands/pair-autofix-only.js +662 -538
  99. package/dist/src/cli/simple-commands/pair-basic.js +656 -528
  100. package/dist/src/cli/simple-commands/pair-old.js +543 -430
  101. package/dist/src/cli/simple-commands/pair-working.js +751 -615
  102. package/dist/src/cli/simple-commands/pair.js +751 -615
  103. package/dist/src/cli/simple-commands/performance-hooks.js +111 -83
  104. package/dist/src/cli/simple-commands/performance-metrics.js +433 -348
  105. package/dist/src/cli/simple-commands/process-ui-enhanced.js +787 -708
  106. package/dist/src/cli/simple-commands/process-ui.js +254 -230
  107. package/dist/src/cli/simple-commands/realtime-update-system.js +611 -525
  108. package/dist/src/cli/simple-commands/sparc/architecture.js +1530 -1704
  109. package/dist/src/cli/simple-commands/sparc/commands.js +516 -438
  110. package/dist/src/cli/simple-commands/sparc/completion.js +1481 -1224
  111. package/dist/src/cli/simple-commands/sparc/coordinator.js +978 -913
  112. package/dist/src/cli/simple-commands/sparc/index.js +298 -241
  113. package/dist/src/cli/simple-commands/sparc/phase-base.js +390 -314
  114. package/dist/src/cli/simple-commands/sparc/pseudocode.js +869 -965
  115. package/dist/src/cli/simple-commands/sparc/refinement.js +1273 -980
  116. package/dist/src/cli/simple-commands/sparc/specification.js +645 -559
  117. package/dist/src/cli/simple-commands/sparc-modes/architect.js +1 -1
  118. package/dist/src/cli/simple-commands/sparc-modes/ask.js +1 -1
  119. package/dist/src/cli/simple-commands/sparc-modes/code.js +1 -1
  120. package/dist/src/cli/simple-commands/sparc-modes/debug.js +1 -1
  121. package/dist/src/cli/simple-commands/sparc-modes/devops.js +1 -1
  122. package/dist/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
  123. package/dist/src/cli/simple-commands/sparc-modes/generic.js +1 -1
  124. package/dist/src/cli/simple-commands/sparc-modes/index.js +55 -47
  125. package/dist/src/cli/simple-commands/sparc-modes/integration.js +1 -1
  126. package/dist/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
  127. package/dist/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
  128. package/dist/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
  129. package/dist/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
  130. package/dist/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
  131. package/dist/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
  132. package/dist/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
  133. package/dist/src/cli/simple-commands/sparc-modes/swarm.js +87 -101
  134. package/dist/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
  135. package/dist/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
  136. package/dist/src/cli/simple-commands/sparc.js +493 -465
  137. package/dist/src/cli/simple-commands/start-ui.js +132 -108
  138. package/dist/src/cli/simple-commands/start-wrapper.js +268 -240
  139. package/dist/src/cli/simple-commands/start.js +1 -1
  140. package/dist/src/cli/simple-commands/status.js +275 -254
  141. package/dist/src/cli/simple-commands/stream-chain-clean.js +171 -128
  142. package/dist/src/cli/simple-commands/stream-chain-fixed.js +82 -61
  143. package/dist/src/cli/simple-commands/stream-chain-real.js +331 -267
  144. package/dist/src/cli/simple-commands/stream-chain-working.js +263 -211
  145. package/dist/src/cli/simple-commands/stream-chain.js +318 -260
  146. package/dist/src/cli/simple-commands/stream-processor.js +315 -290
  147. package/dist/src/cli/simple-commands/swarm-executor.js +222 -189
  148. package/dist/src/cli/simple-commands/swarm-metrics-integration.js +300 -208
  149. package/dist/src/cli/simple-commands/swarm-ui.js +703 -623
  150. package/dist/src/cli/simple-commands/swarm-webui-integration.js +286 -258
  151. package/dist/src/cli/simple-commands/swarm.js +1082 -887
  152. package/dist/src/cli/simple-commands/task.js +206 -161
  153. package/dist/src/cli/simple-commands/timestamp-fix.js +89 -59
  154. package/dist/src/cli/simple-commands/token-tracker.js +316 -258
  155. package/dist/src/cli/simple-commands/tool-execution-framework.js +519 -433
  156. package/dist/src/cli/simple-commands/train-and-stream.js +331 -275
  157. package/dist/src/cli/simple-commands/training-pipeline.js +725 -619
  158. package/dist/src/cli/simple-commands/training.js +227 -170
  159. package/dist/src/cli/simple-commands/verification-hooks.js +284 -261
  160. package/dist/src/cli/simple-commands/verification-integration.js +417 -389
  161. package/dist/src/cli/simple-commands/verification-training-integration.js +606 -486
  162. package/dist/src/cli/simple-commands/verification.js +513 -493
  163. package/dist/src/cli/simple-commands/web-server.js +836 -766
  164. package/dist/src/cli/simple-commands/webui-validator.js +124 -106
  165. package/dist/src/coordination/byzantine-memory-channels.js +25 -1
  166. package/dist/src/coordination/event-bus/demo-wasm-integration.js +251 -212
  167. package/dist/src/coordination/event-bus/qe-event-bus.js +748 -608
  168. package/dist/src/coordination/event-bus/qe-event-bus.test.js +454 -379
  169. package/dist/src/coordination/iteration-tracker.js +454 -363
  170. package/dist/src/index.js +384 -35
  171. package/dist/src/mcp/DEPRECATED.js +60 -46
  172. package/dist/src/mcp/fixes/mcp-error-fixes.js +134 -115
  173. package/dist/src/mcp/implementations/agent-tracker.js +128 -114
  174. package/dist/src/mcp/implementations/daa-tools.js +350 -292
  175. package/dist/src/mcp/implementations/workflow-tools.js +361 -329
  176. package/dist/src/mcp/mcp-config-manager.js +1331 -1183
  177. package/dist/src/mcp/mcp-server-novice-simplified.js +17 -11
  178. package/dist/src/mcp/mcp-server-novice.js +17 -11
  179. package/dist/src/mcp/mcp-server-sdk.js +17 -11
  180. package/dist/src/mcp/mcp-server.js +1484 -1620
  181. package/dist/src/mcp/ruv-swarm-wrapper.js +239 -209
  182. package/dist/src/memory/advanced-serializer.js +589 -609
  183. package/dist/src/memory/enhanced-examples.js +305 -220
  184. package/dist/src/memory/enhanced-memory.js +336 -295
  185. package/dist/src/memory/enhanced-session-serializer.js +492 -408
  186. package/dist/src/memory/fallback-memory-system.js +1021 -900
  187. package/dist/src/memory/fallback-store.js +131 -93
  188. package/dist/src/memory/high-performance-serialization.js +730 -592
  189. package/dist/src/memory/in-memory-store.js +213 -161
  190. package/dist/src/memory/index.js +157 -123
  191. package/dist/src/memory/lock-free-structures.js +764 -578
  192. package/dist/src/memory/memory-mapped-persistence.js +766 -585
  193. package/dist/src/memory/memory-pressure-manager.js +707 -569
  194. package/dist/src/memory/migration.js +445 -358
  195. package/dist/src/memory/shared-memory.js +768 -641
  196. package/dist/src/memory/sqlite-store.js +325 -245
  197. package/dist/src/memory/sqlite-wrapper.js +151 -122
  198. package/dist/src/memory/swarm-memory.js +603 -470
  199. package/dist/src/memory/test-example.js +134 -126
  200. package/dist/src/memory/ultra-fast-memory-store.js +821 -622
  201. package/dist/src/memory/unified-memory-manager.js +437 -356
  202. package/dist/src/swarm/CodeRefactoringSwarm.js +952 -777
  203. package/dist/src/utils/__tests__/github-cli-safety-wrapper.test.js +400 -332
  204. package/dist/src/utils/error-handler.js +2 -36
  205. package/dist/src/utils/github-cli-safe.js +64 -56
  206. package/dist/src/utils/github-cli-safety-wrapper.js +546 -451
  207. package/dist/src/utils/npx-isolated-cache.js +119 -104
  208. package/dist/src/utils/preference-manager.js +652 -622
  209. package/dist/src/utils/timezone-utils.js +105 -86
  210. package/dist/src/web/api/apm-routes.js +353 -0
  211. package/dist/src/web/api/config/api-config.js +184 -0
  212. package/dist/src/web/api/middleware/auth.js +203 -0
  213. package/dist/src/web/api/middleware/cache.js +273 -0
  214. package/dist/src/web/api/middleware/error-handler.js +257 -0
  215. package/dist/src/web/api/middleware/request-logger.js +215 -0
  216. package/dist/src/web/api/middleware/validation.js +323 -0
  217. package/dist/src/web/api/routes/events.js +463 -0
  218. package/dist/src/web/api/routes/hierarchy.js +300 -0
  219. package/dist/src/web/api/routes/index.js +12 -0
  220. package/dist/src/web/api/routes/metrics.js +559 -0
  221. package/dist/src/web/api/routes/parallel-status.js +359 -0
  222. package/dist/src/web/api/routes/status.js +448 -0
  223. package/dist/src/web/api/server.js +462 -0
  224. package/dist/src/web/dashboard/hooks/useWebSocket.js +383 -0
  225. package/dist/src/web/dashboard/index.js +85 -0
  226. package/dist/src/web/dashboard/realtime/CustomSyncManager.js +439 -0
  227. package/dist/src/web/dashboard/realtime/NativeWebSocketManager.js +323 -0
  228. package/dist/src/web/dashboard/realtime/PerformanceBenchmark.js +527 -0
  229. package/dist/src/web/dashboard/realtime/RealtimeCommunicationManager.js +474 -0
  230. package/dist/src/web/dashboard/realtime/RealtimeServer.js +666 -0
  231. package/dist/src/web/dashboard/realtime/SSEManager.js +426 -0
  232. package/dist/src/web/dashboard/types.js +4 -0
  233. package/dist/src/web/messaging/agent-status-tracker.js +453 -0
  234. package/dist/src/web/messaging/human-intervention-system.js +305 -0
  235. package/dist/src/web/messaging/message-filter.js +302 -0
  236. package/dist/src/web/messaging/swarm-message-router.js +324 -0
  237. package/dist/src/web/messaging/transparency-logger.js +421 -0
  238. package/dist/src/web/portal-server.js +460 -0
  239. package/dist/src/web/server.js +322 -0
  240. package/dist/src/web/websocket/apm-websocket-handler.js +453 -0
  241. package/dist/src/web/websocket/websocket-manager.js +780 -0
  242. package/package.json +5 -3
  243. package/dist/src/cli/minimal-main.js +0 -22
  244. package/dist/src/enterprise/analytics-manager.js +0 -1135
  245. package/dist/src/enterprise/audit-manager.js +0 -1115
  246. package/dist/src/enterprise/cloud-manager.js +0 -891
  247. package/dist/src/enterprise/deployment-manager.js +0 -966
  248. package/dist/src/enterprise/index.js +0 -6
  249. package/dist/src/enterprise/project-manager.js +0 -584
  250. package/dist/src/enterprise/security-manager.js +0 -991
  251. package/dist/src/migration/index.js +0 -92
  252. package/dist/src/migration/logger.js +0 -121
  253. package/dist/src/migration/migration-analyzer.js +0 -268
  254. package/dist/src/migration/migration-runner.js +0 -522
  255. package/dist/src/migration/migration-validator.js +0 -285
  256. package/dist/src/migration/progress-reporter.js +0 -150
  257. package/dist/src/migration/rollback-manager.js +0 -321
  258. package/dist/src/migration/tests/migration-system.test.js +0 -7
  259. package/dist/src/migration/types.js +0 -3
  260. package/dist/src/swarm/__tests__/integration.test.js +0 -227
  261. package/dist/src/swarm/__tests__/prompt-copier.test.js +0 -344
  262. package/dist/src/swarm/advanced-orchestrator.js +0 -1095
  263. package/dist/src/swarm/claude-code-interface.js +0 -961
  264. package/dist/src/swarm/claude-flow-executor.js +0 -229
  265. package/dist/src/swarm/consensus-coordinator.js +0 -475
  266. package/dist/src/swarm/coordinator.js +0 -2993
  267. package/dist/src/swarm/direct-executor.js +0 -1180
  268. package/dist/src/swarm/error-recovery/advanced-error-detection.js +0 -691
  269. package/dist/src/swarm/error-recovery/automated-recovery-workflows.js +0 -998
  270. package/dist/src/swarm/error-recovery/error-recovery-coordinator.js +0 -1197
  271. package/dist/src/swarm/error-recovery/recovery-monitoring.js +0 -772
  272. package/dist/src/swarm/error-recovery/resilience-architecture.js +0 -714
  273. package/dist/src/swarm/error-recovery/self-healing-mechanisms.js +0 -1319
  274. package/dist/src/swarm/error-recovery/test-error-recovery-effectiveness.js +0 -808
  275. package/dist/src/swarm/executor-v2.js +0 -322
  276. package/dist/src/swarm/executor.js +0 -815
  277. package/dist/src/swarm/hive-mind-integration.js +0 -703
  278. package/dist/src/swarm/index.js +0 -41
  279. package/dist/src/swarm/json-output-aggregator.js +0 -267
  280. package/dist/src/swarm/large-scale-coordinator.js +0 -542
  281. package/dist/src/swarm/mcp-integration-wrapper.js +0 -628
  282. package/dist/src/swarm/memory.js +0 -1117
  283. package/dist/src/swarm/optimizations/__tests__/optimization.test.js +0 -348
  284. package/dist/src/swarm/optimizations/async-file-manager.js +0 -285
  285. package/dist/src/swarm/optimizations/circular-buffer.js +0 -162
  286. package/dist/src/swarm/optimizations/connection-pool.js +0 -244
  287. package/dist/src/swarm/optimizations/index.js +0 -28
  288. package/dist/src/swarm/optimizations/optimized-executor.js +0 -320
  289. package/dist/src/swarm/optimizations/ttl-map.js +0 -234
  290. package/dist/src/swarm/prompt-cli.js +0 -200
  291. package/dist/src/swarm/prompt-copier-enhanced.js +0 -202
  292. package/dist/src/swarm/prompt-copier.js +0 -381
  293. package/dist/src/swarm/prompt-manager.js +0 -295
  294. package/dist/src/swarm/prompt-utils.js +0 -310
  295. package/dist/src/swarm/result-aggregator.js +0 -718
  296. package/dist/src/swarm/sparc-executor.js +0 -1568
  297. package/dist/src/swarm/strategies/auto.js +0 -758
  298. package/dist/src/swarm/strategies/base.js +0 -128
  299. package/dist/src/swarm/strategies/research.js +0 -914
  300. package/dist/src/swarm/strategies/strategy-metrics-patch.js +0 -2
  301. package/dist/src/swarm/types.js +0 -52
  302. package/dist/src/swarm/workers/copy-worker.js +0 -56
  303. package/dist/src/validators/epic-config-schema.js +0 -214
  304. package/dist/src/validators/index.js +0 -10
  305. package/dist/src/validators/swarm-init-validator.js +0 -259
  306. package/dist/src/validators/todowrite-batching-validator.js +0 -215
  307. package/dist/src/validators/todowrite-integration.js +0 -187
  308. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/documentSymbols/browser/documentSymbols.js +0 -23
  309. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +0 -57
  310. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +0 -401
  311. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +0 -181
  312. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +0 -44
  313. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +0 -157
  314. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/edit.js +0 -71
  315. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/editorState/browser/editorState.js +0 -112
  316. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findController.js +0 -990
  317. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findDecorations.js +0 -296
  318. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findModel.js +0 -488
  319. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findOptionsWidget.js +0 -138
  320. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findState.js +0 -243
  321. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findWidget.js +0 -1177
  322. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/folding.js +0 -1093
  323. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +0 -133
  324. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingModel.js +0 -538
  325. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingRanges.js +0 -351
  326. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +0 -49
  327. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/format.js +0 -360
  328. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/formatActions.js +0 -263
  329. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/formattingEdit.js +0 -54
  330. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +0 -149
  331. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/hover/browser/contentHover.js +0 -874
  332. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/inlineCompletions/browser/commandIds.js +0 -7
  333. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/inlineCompletions/browser/commands.js +0 -199
  334. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/linesOperations/browser/copyLinesCommand.js +0 -70
  335. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +0 -26
  336. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +0 -153
  337. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +0 -33
  338. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +0 -354
  339. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/smartSelect/browser/bracketSelections.js +0 -146
  340. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/suggest/browser/completionModel.js +0 -224
  341. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +0 -119
  342. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/edcore.main.js +0 -14
  343. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.all.js +0 -63
  344. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.api.js +0 -55
  345. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.main.js +0 -7
  346. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.worker.js +0 -25
  347. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/standalone/browser/colorizer.js +0 -118
  348. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/language/css/css.worker.js +0 -36869
  349. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/language/css/cssMode.js +0 -2035
  350. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/browser/accessibilityService.js +0 -88
  351. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/common/accessibility.js +0 -9
  352. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/action.js +0 -7
  353. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/actionCommonCategories.js +0 -13
  354. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionList.js +0 -276
  355. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionWidget.js +0 -248
  356. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/common/actionWidget.js +0 -5
  357. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actions/common/actions.js +0 -409
  358. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/audioCues/browser/audioCueService.js +0 -176
  359. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/browser/clipboardService.js +0 -141
  360. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/common/clipboardService.js +0 -6
  361. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/commands/common/commands.js +0 -80
  362. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configuration.js +0 -86
  363. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationModels.js +0 -554
  364. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationRegistry.js +0 -317
  365. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurations.js +0 -41
  366. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/browser/contextKeyService.js +0 -432
  367. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkey.js +0 -1547
  368. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkeys.js +0 -18
  369. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuHandler.js +0 -124
  370. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuService.js +0 -101
  371. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextView.js +0 -7
  372. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextViewService.js +0 -72
  373. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dialogs/common/dialogs.js +0 -2
  374. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dnd/browser/dnd.js +0 -36
  375. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/editor/common/editor.js +0 -17
  376. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/environment/common/environment.js +0 -2
  377. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/extensions/common/extensions.js +0 -47
  378. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/files/common/files.js +0 -9
  379. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +0 -105
  380. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/descriptors.js +0 -11
  381. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/extensions.js +0 -15
  382. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/abstractKeybindingService.js +0 -277
  383. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -53
  384. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -354
  385. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/browser/defaultStyles.js +0 -162
  386. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/common/colorRegistry.js +0 -482
  387. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/abap/abap.js +0 -10
  388. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/apex/apex.js +0 -10
  389. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/azcli/azcli.js +0 -10
  390. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bat/bat.js +0 -10
  391. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bicep/bicep.js +0 -11
  392. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cameligo/cameligo.js +0 -10
  393. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/clojure/clojure.js +0 -10
  394. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/coffee/coffee.js +0 -10
  395. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cpp/cpp.js +0 -10
  396. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/csharp/csharp.js +0 -10
  397. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/csp/csp.js +0 -10
  398. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/css/css.js +0 -12
  399. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cypher/cypher.js +0 -10
  400. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/dart/dart.js +0 -10
  401. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/dockerfile/dockerfile.js +0 -10
  402. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/ecl/ecl.js +0 -10
  403. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/elixir/elixir.js +0 -10
  404. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/flow9/flow9.js +0 -10
  405. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.js +0 -745
  406. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.de.js +0 -31
  407. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.es.js +0 -31
  408. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.fr.js +0 -29
  409. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.it.js +0 -29
  410. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ja.js +0 -31
  411. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.js +0 -29
  412. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ko.js +0 -29
  413. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ru.js +0 -31
  414. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.zh-cn.js +0 -31
  415. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.zh-tw.js +0 -29
  416. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/language/css/cssMode.js +0 -13
  417. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/language/css/cssWorker.js +0 -81
  418. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/cli.js +0 -64
  419. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/example.js +0 -36
  420. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/index.js +0 -205
  421. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/test.js +0 -260
  422. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.browser.js +0 -34
  423. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.js +0 -35
  424. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.native.js +0 -26
  425. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/index.browser.js +0 -34
  426. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/index.js +0 -45
  427. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/nanoid.js +0 -1
  428. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/non-secure/index.js +0 -21
  429. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/url-alphabet/index.js +0 -3
  430. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/bin/nodemon.js +0 -16
  431. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/cli/index.js +0 -49
  432. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/cli/parse.js +0 -230
  433. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/command.js +0 -43
  434. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/defaults.js +0 -34
  435. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/exec.js +0 -234
  436. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/index.js +0 -93
  437. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/load.js +0 -225
  438. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/help/index.js +0 -27
  439. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/index.js +0 -1
  440. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/index.js +0 -4
  441. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/match.js +0 -287
  442. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/run.js +0 -562
  443. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/signals.js +0 -34
  444. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/watch.js +0 -244
  445. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/nodemon.js +0 -317
  446. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/add.js +0 -89
  447. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/index.js +0 -53
  448. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/parse.js +0 -43
  449. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/spawn.js +0 -74
  450. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/bus.js +0 -44
  451. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/clone.js +0 -40
  452. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/colour.js +0 -26
  453. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/index.js +0 -103
  454. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/log.js +0 -82
  455. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/merge.js +0 -47
  456. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/version.js +0 -100
  457. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/brace-expansion/index.js +0 -201
  458. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/has-flag/index.js +0 -8
  459. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/minimatch/minimatch.js +0 -947
  460. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/supports-color/browser.js +0 -5
  461. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/supports-color/index.js +0 -131
  462. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/bin/pidtree.js +0 -128
  463. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/index.js +0 -49
  464. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/bin.js +0 -61
  465. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/get.js +0 -45
  466. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/pidtree.js +0 -104
  467. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/ps.js +0 -47
  468. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/wmic.js +0 -49
  469. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/doc.js +0 -1270
  470. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/acorn.js +0 -15
  471. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/angular.js +0 -2
  472. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/babel.js +0 -15
  473. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/estree.js +0 -36
  474. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/flow.js +0 -19
  475. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/glimmer.js +0 -29
  476. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/graphql.js +0 -29
  477. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/html.js +0 -22
  478. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/markdown.js +0 -63
  479. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/meriyah.js +0 -4
  480. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/postcss.js +0 -54
  481. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/typescript.js +0 -20
  482. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/yaml.js +0 -160
  483. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/standalone.js +0 -34
  484. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/bin/react-scripts.js +0 -58
  485. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/env.js +0 -112
  486. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/getHttpsConfig.js +0 -74
  487. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/babelTransform.js +0 -37
  488. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/cssTransform.js +0 -22
  489. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/fileTransform.js +0 -40
  490. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/modules.js +0 -142
  491. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/paths.js +0 -153
  492. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
  493. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpack.config.js +0 -796
  494. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpackDevServer.config.js +0 -135
  495. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/scripts/build.js +0 -225
  496. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/scripts/eject.js +0 -340
@@ -1,1547 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
- import { isChrome, isEdge, isFirefox, isLinux, isMacintosh, isSafari, isWeb, isWindows } from '../../../base/common/platform.js';
6
- import { isFalsyOrWhitespace } from '../../../base/common/strings.js';
7
- import { Scanner } from './scanner.js';
8
- import { createDecorator } from '../../instantiation/common/instantiation.js';
9
- import { localize } from '../../../nls.js';
10
- const CONSTANT_VALUES = new Map();
11
- CONSTANT_VALUES.set('false', false);
12
- CONSTANT_VALUES.set('true', true);
13
- CONSTANT_VALUES.set('isMac', isMacintosh);
14
- CONSTANT_VALUES.set('isLinux', isLinux);
15
- CONSTANT_VALUES.set('isWindows', isWindows);
16
- CONSTANT_VALUES.set('isWeb', isWeb);
17
- CONSTANT_VALUES.set('isMacNative', isMacintosh && !isWeb);
18
- CONSTANT_VALUES.set('isEdge', isEdge);
19
- CONSTANT_VALUES.set('isFirefox', isFirefox);
20
- CONSTANT_VALUES.set('isChrome', isChrome);
21
- CONSTANT_VALUES.set('isSafari', isSafari);
22
- const hasOwnProperty = Object.prototype.hasOwnProperty;
23
- const defaultConfig = {
24
- regexParsingWithErrorRecovery: true
25
- };
26
- const errorEmptyString = localize('contextkey.parser.error.emptyString', "Empty context key expression");
27
- const hintEmptyString = localize('contextkey.parser.error.emptyString.hint', "Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.");
28
- const errorNoInAfterNot = localize('contextkey.parser.error.noInAfterNot', "'in' after 'not'.");
29
- const errorClosingParenthesis = localize('contextkey.parser.error.closingParenthesis', "closing parenthesis ')'");
30
- const errorUnexpectedToken = localize('contextkey.parser.error.unexpectedToken', "Unexpected token");
31
- const hintUnexpectedToken = localize('contextkey.parser.error.unexpectedToken.hint', "Did you forget to put && or || before the token?");
32
- const errorUnexpectedEOF = localize('contextkey.parser.error.unexpectedEOF', "Unexpected end of expression");
33
- const hintUnexpectedEOF = localize('contextkey.parser.error.unexpectedEOF.hint', "Did you forget to put a context key?");
34
- /**
35
- * A parser for context key expressions.
36
- *
37
- * Example:
38
- * ```ts
39
- * const parser = new Parser();
40
- * const expr = parser.parse('foo == "bar" && baz == true');
41
- *
42
- * if (expr === undefined) {
43
- * // there were lexing or parsing errors
44
- * // process lexing errors with `parser.lexingErrors`
45
- * // process parsing errors with `parser.parsingErrors`
46
- * } else {
47
- * // expr is a valid expression
48
- * }
49
- * ```
50
- */
51
- export class Parser {
52
- constructor(_config = defaultConfig) {
53
- this._config = _config;
54
- // lifetime note: `_scanner` lives as long as the parser does, i.e., is not reset between calls to `parse`
55
- this._scanner = new Scanner();
56
- // lifetime note: `_tokens`, `_current`, and `_parsingErrors` must be reset between calls to `parse`
57
- this._tokens = [];
58
- this._current = 0; // invariant: 0 <= this._current < this._tokens.length ; any incrementation of this value must first call `_isAtEnd`
59
- this._parsingErrors = [];
60
- this._flagsGYRe = /g|y/g;
61
- }
62
- /**
63
- * Parse a context key expression.
64
- *
65
- * @param input the expression to parse
66
- * @returns the parsed expression or `undefined` if there's an error - call `lexingErrors` and `parsingErrors` to see the errors
67
- */
68
- parse(input) {
69
- if (input === '') {
70
- this._parsingErrors.push({ message: errorEmptyString, offset: 0, lexeme: '', additionalInfo: hintEmptyString });
71
- return undefined;
72
- }
73
- this._tokens = this._scanner.reset(input).scan();
74
- // @ulugbekna: we do not stop parsing if there are lexing errors to be able to reconstruct regexes with unescaped slashes; TODO@ulugbekna: make this respect config option for recovery
75
- this._current = 0;
76
- this._parsingErrors = [];
77
- try {
78
- const expr = this._expr();
79
- if (!this._isAtEnd()) {
80
- const peek = this._peek();
81
- const additionalInfo = peek.type === 17 /* TokenType.Str */ ? hintUnexpectedToken : undefined;
82
- this._parsingErrors.push({ message: errorUnexpectedToken, offset: peek.offset, lexeme: Scanner.getLexeme(peek), additionalInfo });
83
- throw Parser._parseError;
84
- }
85
- return expr;
86
- }
87
- catch (e) {
88
- if (!(e === Parser._parseError)) {
89
- throw e;
90
- }
91
- return undefined;
92
- }
93
- }
94
- _expr() {
95
- return this._or();
96
- }
97
- _or() {
98
- const expr = [this._and()];
99
- while (this._matchOne(16 /* TokenType.Or */)) {
100
- const right = this._and();
101
- expr.push(right);
102
- }
103
- return expr.length === 1 ? expr[0] : ContextKeyExpr.or(...expr);
104
- }
105
- _and() {
106
- const expr = [this._term()];
107
- while (this._matchOne(15 /* TokenType.And */)) {
108
- const right = this._term();
109
- expr.push(right);
110
- }
111
- return expr.length === 1 ? expr[0] : ContextKeyExpr.and(...expr);
112
- }
113
- _term() {
114
- if (this._matchOne(2 /* TokenType.Neg */)) {
115
- const peek = this._peek();
116
- switch (peek.type) {
117
- case 11 /* TokenType.True */:
118
- this._advance();
119
- return ContextKeyFalseExpr.INSTANCE;
120
- case 12 /* TokenType.False */:
121
- this._advance();
122
- return ContextKeyTrueExpr.INSTANCE;
123
- case 0 /* TokenType.LParen */: {
124
- this._advance();
125
- const expr = this._expr();
126
- this._consume(1 /* TokenType.RParen */, errorClosingParenthesis);
127
- return expr === null || expr === void 0 ? void 0 : expr.negate();
128
- }
129
- case 17 /* TokenType.Str */:
130
- this._advance();
131
- return ContextKeyNotExpr.create(peek.lexeme);
132
- default:
133
- throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`, peek);
134
- }
135
- }
136
- return this._primary();
137
- }
138
- _primary() {
139
- const peek = this._peek();
140
- switch (peek.type) {
141
- case 11 /* TokenType.True */:
142
- this._advance();
143
- return ContextKeyExpr.true();
144
- case 12 /* TokenType.False */:
145
- this._advance();
146
- return ContextKeyExpr.false();
147
- case 0 /* TokenType.LParen */: {
148
- this._advance();
149
- const expr = this._expr();
150
- this._consume(1 /* TokenType.RParen */, errorClosingParenthesis);
151
- return expr;
152
- }
153
- case 17 /* TokenType.Str */: {
154
- // KEY
155
- const key = peek.lexeme;
156
- this._advance();
157
- // =~ regex
158
- if (this._matchOne(9 /* TokenType.RegexOp */)) {
159
- // @ulugbekna: we need to reconstruct the regex from the tokens because some extensions use unescaped slashes in regexes
160
- const expr = this._peek();
161
- if (!this._config.regexParsingWithErrorRecovery) {
162
- this._advance();
163
- if (expr.type !== 10 /* TokenType.RegexStr */) {
164
- throw this._errExpectedButGot(`REGEX`, expr);
165
- }
166
- const regexLexeme = expr.lexeme;
167
- const closingSlashIndex = regexLexeme.lastIndexOf('/');
168
- const flags = closingSlashIndex === regexLexeme.length - 1 ? undefined : this._removeFlagsGY(regexLexeme.substring(closingSlashIndex + 1));
169
- let regexp;
170
- try {
171
- regexp = new RegExp(regexLexeme.substring(1, closingSlashIndex), flags);
172
- }
173
- catch (e) {
174
- throw this._errExpectedButGot(`REGEX`, expr);
175
- }
176
- return ContextKeyRegexExpr.create(key, regexp);
177
- }
178
- switch (expr.type) {
179
- case 10 /* TokenType.RegexStr */:
180
- case 19 /* TokenType.Error */: { // also handle an ErrorToken in case of smth such as /(/file)/
181
- const lexemeReconstruction = [expr.lexeme]; // /REGEX/ or /REGEX/FLAGS
182
- this._advance();
183
- let followingToken = this._peek();
184
- let parenBalance = 0;
185
- for (let i = 0; i < expr.lexeme.length; i++) {
186
- if (expr.lexeme.charCodeAt(i) === 40 /* CharCode.OpenParen */) {
187
- parenBalance++;
188
- }
189
- else if (expr.lexeme.charCodeAt(i) === 41 /* CharCode.CloseParen */) {
190
- parenBalance--;
191
- }
192
- }
193
- while (!this._isAtEnd() && followingToken.type !== 15 /* TokenType.And */ && followingToken.type !== 16 /* TokenType.Or */) {
194
- switch (followingToken.type) {
195
- case 0 /* TokenType.LParen */:
196
- parenBalance++;
197
- break;
198
- case 1 /* TokenType.RParen */:
199
- parenBalance--;
200
- break;
201
- case 10 /* TokenType.RegexStr */:
202
- case 18 /* TokenType.QuotedStr */:
203
- for (let i = 0; i < followingToken.lexeme.length; i++) {
204
- if (followingToken.lexeme.charCodeAt(i) === 40 /* CharCode.OpenParen */) {
205
- parenBalance++;
206
- }
207
- else if (expr.lexeme.charCodeAt(i) === 41 /* CharCode.CloseParen */) {
208
- parenBalance--;
209
- }
210
- }
211
- }
212
- if (parenBalance < 0) {
213
- break;
214
- }
215
- lexemeReconstruction.push(Scanner.getLexeme(followingToken));
216
- this._advance();
217
- followingToken = this._peek();
218
- }
219
- const regexLexeme = lexemeReconstruction.join('');
220
- const closingSlashIndex = regexLexeme.lastIndexOf('/');
221
- const flags = closingSlashIndex === regexLexeme.length - 1 ? undefined : this._removeFlagsGY(regexLexeme.substring(closingSlashIndex + 1));
222
- let regexp;
223
- try {
224
- regexp = new RegExp(regexLexeme.substring(1, closingSlashIndex), flags);
225
- }
226
- catch (e) {
227
- throw this._errExpectedButGot(`REGEX`, expr);
228
- }
229
- return ContextKeyExpr.regex(key, regexp);
230
- }
231
- case 18 /* TokenType.QuotedStr */: {
232
- const serializedValue = expr.lexeme;
233
- this._advance();
234
- // replicate old regex parsing behavior
235
- let regex = null;
236
- if (!isFalsyOrWhitespace(serializedValue)) {
237
- const start = serializedValue.indexOf('/');
238
- const end = serializedValue.lastIndexOf('/');
239
- if (start !== end && start >= 0) {
240
- const value = serializedValue.slice(start + 1, end);
241
- const caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : '';
242
- try {
243
- regex = new RegExp(value, caseIgnoreFlag);
244
- }
245
- catch (_e) {
246
- throw this._errExpectedButGot(`REGEX`, expr);
247
- }
248
- }
249
- }
250
- if (regex === null) {
251
- throw this._errExpectedButGot('REGEX', expr);
252
- }
253
- return ContextKeyRegexExpr.create(key, regex);
254
- }
255
- default:
256
- throw this._errExpectedButGot('REGEX', this._peek());
257
- }
258
- }
259
- // [ 'not' 'in' value ]
260
- if (this._matchOne(14 /* TokenType.Not */)) {
261
- this._consume(13 /* TokenType.In */, errorNoInAfterNot);
262
- const right = this._value();
263
- return ContextKeyExpr.notIn(key, right);
264
- }
265
- // [ ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in') value ]
266
- const maybeOp = this._peek().type;
267
- switch (maybeOp) {
268
- case 3 /* TokenType.Eq */: {
269
- this._advance();
270
- const right = this._value();
271
- if (this._previous().type === 18 /* TokenType.QuotedStr */) { // to preserve old parser behavior: "foo == 'true'" is preserved as "foo == 'true'", but "foo == true" is optimized as "foo"
272
- return ContextKeyExpr.equals(key, right);
273
- }
274
- switch (right) {
275
- case 'true':
276
- return ContextKeyExpr.has(key);
277
- case 'false':
278
- return ContextKeyExpr.not(key);
279
- default:
280
- return ContextKeyExpr.equals(key, right);
281
- }
282
- }
283
- case 4 /* TokenType.NotEq */: {
284
- this._advance();
285
- const right = this._value();
286
- if (this._previous().type === 18 /* TokenType.QuotedStr */) { // same as above with "foo != 'true'"
287
- return ContextKeyExpr.notEquals(key, right);
288
- }
289
- switch (right) {
290
- case 'true':
291
- return ContextKeyExpr.not(key);
292
- case 'false':
293
- return ContextKeyExpr.has(key);
294
- default:
295
- return ContextKeyExpr.notEquals(key, right);
296
- }
297
- }
298
- // TODO: ContextKeyExpr.smaller(key, right) accepts only `number` as `right` AND during eval of this node, we just eval to `false` if `right` is not a number
299
- // consequently, package.json linter should _warn_ the user if they're passing undesired things to ops
300
- case 5 /* TokenType.Lt */:
301
- this._advance();
302
- return ContextKeySmallerExpr.create(key, this._value());
303
- case 6 /* TokenType.LtEq */:
304
- this._advance();
305
- return ContextKeySmallerEqualsExpr.create(key, this._value());
306
- case 7 /* TokenType.Gt */:
307
- this._advance();
308
- return ContextKeyGreaterExpr.create(key, this._value());
309
- case 8 /* TokenType.GtEq */:
310
- this._advance();
311
- return ContextKeyGreaterEqualsExpr.create(key, this._value());
312
- case 13 /* TokenType.In */:
313
- this._advance();
314
- return ContextKeyExpr.in(key, this._value());
315
- default:
316
- return ContextKeyExpr.has(key);
317
- }
318
- }
319
- case 20 /* TokenType.EOF */:
320
- this._parsingErrors.push({ message: errorUnexpectedEOF, offset: peek.offset, lexeme: '', additionalInfo: hintUnexpectedEOF });
321
- throw Parser._parseError;
322
- default:
323
- throw this._errExpectedButGot(`true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`, this._peek());
324
- }
325
- }
326
- _value() {
327
- const token = this._peek();
328
- switch (token.type) {
329
- case 17 /* TokenType.Str */:
330
- case 18 /* TokenType.QuotedStr */:
331
- this._advance();
332
- return token.lexeme;
333
- case 11 /* TokenType.True */:
334
- this._advance();
335
- return 'true';
336
- case 12 /* TokenType.False */:
337
- this._advance();
338
- return 'false';
339
- case 13 /* TokenType.In */: // we support `in` as a value, e.g., "when": "languageId == in" - exists in existing extensions
340
- this._advance();
341
- return 'in';
342
- default:
343
- // this allows "when": "foo == " which's used by existing extensions
344
- // we do not call `_advance` on purpose - we don't want to eat unintended tokens
345
- return '';
346
- }
347
- }
348
- _removeFlagsGY(flags) {
349
- return flags.replaceAll(this._flagsGYRe, '');
350
- }
351
- // careful: this can throw if current token is the initial one (ie index = 0)
352
- _previous() {
353
- return this._tokens[this._current - 1];
354
- }
355
- _matchOne(token) {
356
- if (this._check(token)) {
357
- this._advance();
358
- return true;
359
- }
360
- return false;
361
- }
362
- _advance() {
363
- if (!this._isAtEnd()) {
364
- this._current++;
365
- }
366
- return this._previous();
367
- }
368
- _consume(type, message) {
369
- if (this._check(type)) {
370
- return this._advance();
371
- }
372
- throw this._errExpectedButGot(message, this._peek());
373
- }
374
- _errExpectedButGot(expected, got, additionalInfo) {
375
- const message = localize('contextkey.parser.error.expectedButGot', "Expected: {0}\nReceived: '{1}'.", expected, Scanner.getLexeme(got));
376
- const offset = got.offset;
377
- const lexeme = Scanner.getLexeme(got);
378
- this._parsingErrors.push({ message, offset, lexeme, additionalInfo });
379
- return Parser._parseError;
380
- }
381
- _check(type) {
382
- return this._peek().type === type;
383
- }
384
- _peek() {
385
- return this._tokens[this._current];
386
- }
387
- _isAtEnd() {
388
- return this._peek().type === 20 /* TokenType.EOF */;
389
- }
390
- }
391
- // Note: this doesn't produce an exact syntax tree but a normalized one
392
- // ContextKeyExpression's that we use as AST nodes do not expose constructors that do not normalize
393
- Parser._parseError = new Error();
394
- export class ContextKeyExpr {
395
- static false() {
396
- return ContextKeyFalseExpr.INSTANCE;
397
- }
398
- static true() {
399
- return ContextKeyTrueExpr.INSTANCE;
400
- }
401
- static has(key) {
402
- return ContextKeyDefinedExpr.create(key);
403
- }
404
- static equals(key, value) {
405
- return ContextKeyEqualsExpr.create(key, value);
406
- }
407
- static notEquals(key, value) {
408
- return ContextKeyNotEqualsExpr.create(key, value);
409
- }
410
- static regex(key, value) {
411
- return ContextKeyRegexExpr.create(key, value);
412
- }
413
- static in(key, value) {
414
- return ContextKeyInExpr.create(key, value);
415
- }
416
- static notIn(key, value) {
417
- return ContextKeyNotInExpr.create(key, value);
418
- }
419
- static not(key) {
420
- return ContextKeyNotExpr.create(key);
421
- }
422
- static and(...expr) {
423
- return ContextKeyAndExpr.create(expr, null, true);
424
- }
425
- static or(...expr) {
426
- return ContextKeyOrExpr.create(expr, null, true);
427
- }
428
- static deserialize(serialized) {
429
- if (serialized === undefined || serialized === null) { // an empty string needs to be handled by the parser to get a corresponding parsing error reported
430
- return undefined;
431
- }
432
- const expr = this._parser.parse(serialized);
433
- return expr;
434
- }
435
- }
436
- ContextKeyExpr._parser = new Parser({ regexParsingWithErrorRecovery: false });
437
- export function expressionsAreEqualWithConstantSubstitution(a, b) {
438
- const aExpr = a ? a.substituteConstants() : undefined;
439
- const bExpr = b ? b.substituteConstants() : undefined;
440
- if (!aExpr && !bExpr) {
441
- return true;
442
- }
443
- if (!aExpr || !bExpr) {
444
- return false;
445
- }
446
- return aExpr.equals(bExpr);
447
- }
448
- function cmp(a, b) {
449
- return a.cmp(b);
450
- }
451
- export class ContextKeyFalseExpr {
452
- constructor() {
453
- this.type = 0 /* ContextKeyExprType.False */;
454
- }
455
- cmp(other) {
456
- return this.type - other.type;
457
- }
458
- equals(other) {
459
- return (other.type === this.type);
460
- }
461
- substituteConstants() {
462
- return this;
463
- }
464
- evaluate(context) {
465
- return false;
466
- }
467
- serialize() {
468
- return 'false';
469
- }
470
- keys() {
471
- return [];
472
- }
473
- negate() {
474
- return ContextKeyTrueExpr.INSTANCE;
475
- }
476
- }
477
- ContextKeyFalseExpr.INSTANCE = new ContextKeyFalseExpr();
478
- export class ContextKeyTrueExpr {
479
- constructor() {
480
- this.type = 1 /* ContextKeyExprType.True */;
481
- }
482
- cmp(other) {
483
- return this.type - other.type;
484
- }
485
- equals(other) {
486
- return (other.type === this.type);
487
- }
488
- substituteConstants() {
489
- return this;
490
- }
491
- evaluate(context) {
492
- return true;
493
- }
494
- serialize() {
495
- return 'true';
496
- }
497
- keys() {
498
- return [];
499
- }
500
- negate() {
501
- return ContextKeyFalseExpr.INSTANCE;
502
- }
503
- }
504
- ContextKeyTrueExpr.INSTANCE = new ContextKeyTrueExpr();
505
- export class ContextKeyDefinedExpr {
506
- static create(key, negated = null) {
507
- const constantValue = CONSTANT_VALUES.get(key);
508
- if (typeof constantValue === 'boolean') {
509
- return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;
510
- }
511
- return new ContextKeyDefinedExpr(key, negated);
512
- }
513
- constructor(key, negated) {
514
- this.key = key;
515
- this.negated = negated;
516
- this.type = 2 /* ContextKeyExprType.Defined */;
517
- }
518
- cmp(other) {
519
- if (other.type !== this.type) {
520
- return this.type - other.type;
521
- }
522
- return cmp1(this.key, other.key);
523
- }
524
- equals(other) {
525
- if (other.type === this.type) {
526
- return (this.key === other.key);
527
- }
528
- return false;
529
- }
530
- substituteConstants() {
531
- const constantValue = CONSTANT_VALUES.get(this.key);
532
- if (typeof constantValue === 'boolean') {
533
- return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;
534
- }
535
- return this;
536
- }
537
- evaluate(context) {
538
- return (!!context.getValue(this.key));
539
- }
540
- serialize() {
541
- return this.key;
542
- }
543
- keys() {
544
- return [this.key];
545
- }
546
- negate() {
547
- if (!this.negated) {
548
- this.negated = ContextKeyNotExpr.create(this.key, this);
549
- }
550
- return this.negated;
551
- }
552
- }
553
- export class ContextKeyEqualsExpr {
554
- static create(key, value, negated = null) {
555
- if (typeof value === 'boolean') {
556
- return (value ? ContextKeyDefinedExpr.create(key, negated) : ContextKeyNotExpr.create(key, negated));
557
- }
558
- const constantValue = CONSTANT_VALUES.get(key);
559
- if (typeof constantValue === 'boolean') {
560
- const trueValue = constantValue ? 'true' : 'false';
561
- return (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);
562
- }
563
- return new ContextKeyEqualsExpr(key, value, negated);
564
- }
565
- constructor(key, value, negated) {
566
- this.key = key;
567
- this.value = value;
568
- this.negated = negated;
569
- this.type = 4 /* ContextKeyExprType.Equals */;
570
- }
571
- cmp(other) {
572
- if (other.type !== this.type) {
573
- return this.type - other.type;
574
- }
575
- return cmp2(this.key, this.value, other.key, other.value);
576
- }
577
- equals(other) {
578
- if (other.type === this.type) {
579
- return (this.key === other.key && this.value === other.value);
580
- }
581
- return false;
582
- }
583
- substituteConstants() {
584
- const constantValue = CONSTANT_VALUES.get(this.key);
585
- if (typeof constantValue === 'boolean') {
586
- const trueValue = constantValue ? 'true' : 'false';
587
- return (this.value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);
588
- }
589
- return this;
590
- }
591
- evaluate(context) {
592
- // Intentional ==
593
- // eslint-disable-next-line eqeqeq
594
- return (context.getValue(this.key) == this.value);
595
- }
596
- serialize() {
597
- return `${this.key} == '${this.value}'`;
598
- }
599
- keys() {
600
- return [this.key];
601
- }
602
- negate() {
603
- if (!this.negated) {
604
- this.negated = ContextKeyNotEqualsExpr.create(this.key, this.value, this);
605
- }
606
- return this.negated;
607
- }
608
- }
609
- export class ContextKeyInExpr {
610
- static create(key, valueKey) {
611
- return new ContextKeyInExpr(key, valueKey);
612
- }
613
- constructor(key, valueKey) {
614
- this.key = key;
615
- this.valueKey = valueKey;
616
- this.type = 10 /* ContextKeyExprType.In */;
617
- this.negated = null;
618
- }
619
- cmp(other) {
620
- if (other.type !== this.type) {
621
- return this.type - other.type;
622
- }
623
- return cmp2(this.key, this.valueKey, other.key, other.valueKey);
624
- }
625
- equals(other) {
626
- if (other.type === this.type) {
627
- return (this.key === other.key && this.valueKey === other.valueKey);
628
- }
629
- return false;
630
- }
631
- substituteConstants() {
632
- return this;
633
- }
634
- evaluate(context) {
635
- const source = context.getValue(this.valueKey);
636
- const item = context.getValue(this.key);
637
- if (Array.isArray(source)) {
638
- return source.includes(item);
639
- }
640
- if (typeof item === 'string' && typeof source === 'object' && source !== null) {
641
- return hasOwnProperty.call(source, item);
642
- }
643
- return false;
644
- }
645
- serialize() {
646
- return `${this.key} in '${this.valueKey}'`;
647
- }
648
- keys() {
649
- return [this.key, this.valueKey];
650
- }
651
- negate() {
652
- if (!this.negated) {
653
- this.negated = ContextKeyNotInExpr.create(this.key, this.valueKey);
654
- }
655
- return this.negated;
656
- }
657
- }
658
- export class ContextKeyNotInExpr {
659
- static create(key, valueKey) {
660
- return new ContextKeyNotInExpr(key, valueKey);
661
- }
662
- constructor(key, valueKey) {
663
- this.key = key;
664
- this.valueKey = valueKey;
665
- this.type = 11 /* ContextKeyExprType.NotIn */;
666
- this._negated = ContextKeyInExpr.create(key, valueKey);
667
- }
668
- cmp(other) {
669
- if (other.type !== this.type) {
670
- return this.type - other.type;
671
- }
672
- return this._negated.cmp(other._negated);
673
- }
674
- equals(other) {
675
- if (other.type === this.type) {
676
- return this._negated.equals(other._negated);
677
- }
678
- return false;
679
- }
680
- substituteConstants() {
681
- return this;
682
- }
683
- evaluate(context) {
684
- return !this._negated.evaluate(context);
685
- }
686
- serialize() {
687
- return `${this.key} not in '${this.valueKey}'`;
688
- }
689
- keys() {
690
- return this._negated.keys();
691
- }
692
- negate() {
693
- return this._negated;
694
- }
695
- }
696
- export class ContextKeyNotEqualsExpr {
697
- static create(key, value, negated = null) {
698
- if (typeof value === 'boolean') {
699
- if (value) {
700
- return ContextKeyNotExpr.create(key, negated);
701
- }
702
- return ContextKeyDefinedExpr.create(key, negated);
703
- }
704
- const constantValue = CONSTANT_VALUES.get(key);
705
- if (typeof constantValue === 'boolean') {
706
- const falseValue = constantValue ? 'true' : 'false';
707
- return (value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
708
- }
709
- return new ContextKeyNotEqualsExpr(key, value, negated);
710
- }
711
- constructor(key, value, negated) {
712
- this.key = key;
713
- this.value = value;
714
- this.negated = negated;
715
- this.type = 5 /* ContextKeyExprType.NotEquals */;
716
- }
717
- cmp(other) {
718
- if (other.type !== this.type) {
719
- return this.type - other.type;
720
- }
721
- return cmp2(this.key, this.value, other.key, other.value);
722
- }
723
- equals(other) {
724
- if (other.type === this.type) {
725
- return (this.key === other.key && this.value === other.value);
726
- }
727
- return false;
728
- }
729
- substituteConstants() {
730
- const constantValue = CONSTANT_VALUES.get(this.key);
731
- if (typeof constantValue === 'boolean') {
732
- const falseValue = constantValue ? 'true' : 'false';
733
- return (this.value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
734
- }
735
- return this;
736
- }
737
- evaluate(context) {
738
- // Intentional !=
739
- // eslint-disable-next-line eqeqeq
740
- return (context.getValue(this.key) != this.value);
741
- }
742
- serialize() {
743
- return `${this.key} != '${this.value}'`;
744
- }
745
- keys() {
746
- return [this.key];
747
- }
748
- negate() {
749
- if (!this.negated) {
750
- this.negated = ContextKeyEqualsExpr.create(this.key, this.value, this);
751
- }
752
- return this.negated;
753
- }
754
- }
755
- export class ContextKeyNotExpr {
756
- static create(key, negated = null) {
757
- const constantValue = CONSTANT_VALUES.get(key);
758
- if (typeof constantValue === 'boolean') {
759
- return (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
760
- }
761
- return new ContextKeyNotExpr(key, negated);
762
- }
763
- constructor(key, negated) {
764
- this.key = key;
765
- this.negated = negated;
766
- this.type = 3 /* ContextKeyExprType.Not */;
767
- }
768
- cmp(other) {
769
- if (other.type !== this.type) {
770
- return this.type - other.type;
771
- }
772
- return cmp1(this.key, other.key);
773
- }
774
- equals(other) {
775
- if (other.type === this.type) {
776
- return (this.key === other.key);
777
- }
778
- return false;
779
- }
780
- substituteConstants() {
781
- const constantValue = CONSTANT_VALUES.get(this.key);
782
- if (typeof constantValue === 'boolean') {
783
- return (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
784
- }
785
- return this;
786
- }
787
- evaluate(context) {
788
- return (!context.getValue(this.key));
789
- }
790
- serialize() {
791
- return `!${this.key}`;
792
- }
793
- keys() {
794
- return [this.key];
795
- }
796
- negate() {
797
- if (!this.negated) {
798
- this.negated = ContextKeyDefinedExpr.create(this.key, this);
799
- }
800
- return this.negated;
801
- }
802
- }
803
- function withFloatOrStr(value, callback) {
804
- if (typeof value === 'string') {
805
- const n = parseFloat(value);
806
- if (!isNaN(n)) {
807
- value = n;
808
- }
809
- }
810
- if (typeof value === 'string' || typeof value === 'number') {
811
- return callback(value);
812
- }
813
- return ContextKeyFalseExpr.INSTANCE;
814
- }
815
- export class ContextKeyGreaterExpr {
816
- static create(key, _value, negated = null) {
817
- return withFloatOrStr(_value, (value) => new ContextKeyGreaterExpr(key, value, negated));
818
- }
819
- constructor(key, value, negated) {
820
- this.key = key;
821
- this.value = value;
822
- this.negated = negated;
823
- this.type = 12 /* ContextKeyExprType.Greater */;
824
- }
825
- cmp(other) {
826
- if (other.type !== this.type) {
827
- return this.type - other.type;
828
- }
829
- return cmp2(this.key, this.value, other.key, other.value);
830
- }
831
- equals(other) {
832
- if (other.type === this.type) {
833
- return (this.key === other.key && this.value === other.value);
834
- }
835
- return false;
836
- }
837
- substituteConstants() {
838
- return this;
839
- }
840
- evaluate(context) {
841
- if (typeof this.value === 'string') {
842
- return false;
843
- }
844
- return (parseFloat(context.getValue(this.key)) > this.value);
845
- }
846
- serialize() {
847
- return `${this.key} > ${this.value}`;
848
- }
849
- keys() {
850
- return [this.key];
851
- }
852
- negate() {
853
- if (!this.negated) {
854
- this.negated = ContextKeySmallerEqualsExpr.create(this.key, this.value, this);
855
- }
856
- return this.negated;
857
- }
858
- }
859
- export class ContextKeyGreaterEqualsExpr {
860
- static create(key, _value, negated = null) {
861
- return withFloatOrStr(_value, (value) => new ContextKeyGreaterEqualsExpr(key, value, negated));
862
- }
863
- constructor(key, value, negated) {
864
- this.key = key;
865
- this.value = value;
866
- this.negated = negated;
867
- this.type = 13 /* ContextKeyExprType.GreaterEquals */;
868
- }
869
- cmp(other) {
870
- if (other.type !== this.type) {
871
- return this.type - other.type;
872
- }
873
- return cmp2(this.key, this.value, other.key, other.value);
874
- }
875
- equals(other) {
876
- if (other.type === this.type) {
877
- return (this.key === other.key && this.value === other.value);
878
- }
879
- return false;
880
- }
881
- substituteConstants() {
882
- return this;
883
- }
884
- evaluate(context) {
885
- if (typeof this.value === 'string') {
886
- return false;
887
- }
888
- return (parseFloat(context.getValue(this.key)) >= this.value);
889
- }
890
- serialize() {
891
- return `${this.key} >= ${this.value}`;
892
- }
893
- keys() {
894
- return [this.key];
895
- }
896
- negate() {
897
- if (!this.negated) {
898
- this.negated = ContextKeySmallerExpr.create(this.key, this.value, this);
899
- }
900
- return this.negated;
901
- }
902
- }
903
- export class ContextKeySmallerExpr {
904
- static create(key, _value, negated = null) {
905
- return withFloatOrStr(_value, (value) => new ContextKeySmallerExpr(key, value, negated));
906
- }
907
- constructor(key, value, negated) {
908
- this.key = key;
909
- this.value = value;
910
- this.negated = negated;
911
- this.type = 14 /* ContextKeyExprType.Smaller */;
912
- }
913
- cmp(other) {
914
- if (other.type !== this.type) {
915
- return this.type - other.type;
916
- }
917
- return cmp2(this.key, this.value, other.key, other.value);
918
- }
919
- equals(other) {
920
- if (other.type === this.type) {
921
- return (this.key === other.key && this.value === other.value);
922
- }
923
- return false;
924
- }
925
- substituteConstants() {
926
- return this;
927
- }
928
- evaluate(context) {
929
- if (typeof this.value === 'string') {
930
- return false;
931
- }
932
- return (parseFloat(context.getValue(this.key)) < this.value);
933
- }
934
- serialize() {
935
- return `${this.key} < ${this.value}`;
936
- }
937
- keys() {
938
- return [this.key];
939
- }
940
- negate() {
941
- if (!this.negated) {
942
- this.negated = ContextKeyGreaterEqualsExpr.create(this.key, this.value, this);
943
- }
944
- return this.negated;
945
- }
946
- }
947
- export class ContextKeySmallerEqualsExpr {
948
- static create(key, _value, negated = null) {
949
- return withFloatOrStr(_value, (value) => new ContextKeySmallerEqualsExpr(key, value, negated));
950
- }
951
- constructor(key, value, negated) {
952
- this.key = key;
953
- this.value = value;
954
- this.negated = negated;
955
- this.type = 15 /* ContextKeyExprType.SmallerEquals */;
956
- }
957
- cmp(other) {
958
- if (other.type !== this.type) {
959
- return this.type - other.type;
960
- }
961
- return cmp2(this.key, this.value, other.key, other.value);
962
- }
963
- equals(other) {
964
- if (other.type === this.type) {
965
- return (this.key === other.key && this.value === other.value);
966
- }
967
- return false;
968
- }
969
- substituteConstants() {
970
- return this;
971
- }
972
- evaluate(context) {
973
- if (typeof this.value === 'string') {
974
- return false;
975
- }
976
- return (parseFloat(context.getValue(this.key)) <= this.value);
977
- }
978
- serialize() {
979
- return `${this.key} <= ${this.value}`;
980
- }
981
- keys() {
982
- return [this.key];
983
- }
984
- negate() {
985
- if (!this.negated) {
986
- this.negated = ContextKeyGreaterExpr.create(this.key, this.value, this);
987
- }
988
- return this.negated;
989
- }
990
- }
991
- export class ContextKeyRegexExpr {
992
- static create(key, regexp) {
993
- return new ContextKeyRegexExpr(key, regexp);
994
- }
995
- constructor(key, regexp) {
996
- this.key = key;
997
- this.regexp = regexp;
998
- this.type = 7 /* ContextKeyExprType.Regex */;
999
- this.negated = null;
1000
- //
1001
- }
1002
- cmp(other) {
1003
- if (other.type !== this.type) {
1004
- return this.type - other.type;
1005
- }
1006
- if (this.key < other.key) {
1007
- return -1;
1008
- }
1009
- if (this.key > other.key) {
1010
- return 1;
1011
- }
1012
- const thisSource = this.regexp ? this.regexp.source : '';
1013
- const otherSource = other.regexp ? other.regexp.source : '';
1014
- if (thisSource < otherSource) {
1015
- return -1;
1016
- }
1017
- if (thisSource > otherSource) {
1018
- return 1;
1019
- }
1020
- return 0;
1021
- }
1022
- equals(other) {
1023
- if (other.type === this.type) {
1024
- const thisSource = this.regexp ? this.regexp.source : '';
1025
- const otherSource = other.regexp ? other.regexp.source : '';
1026
- return (this.key === other.key && thisSource === otherSource);
1027
- }
1028
- return false;
1029
- }
1030
- substituteConstants() {
1031
- return this;
1032
- }
1033
- evaluate(context) {
1034
- const value = context.getValue(this.key);
1035
- return this.regexp ? this.regexp.test(value) : false;
1036
- }
1037
- serialize() {
1038
- const value = this.regexp
1039
- ? `/${this.regexp.source}/${this.regexp.flags}`
1040
- : '/invalid/';
1041
- return `${this.key} =~ ${value}`;
1042
- }
1043
- keys() {
1044
- return [this.key];
1045
- }
1046
- negate() {
1047
- if (!this.negated) {
1048
- this.negated = ContextKeyNotRegexExpr.create(this);
1049
- }
1050
- return this.negated;
1051
- }
1052
- }
1053
- export class ContextKeyNotRegexExpr {
1054
- static create(actual) {
1055
- return new ContextKeyNotRegexExpr(actual);
1056
- }
1057
- constructor(_actual) {
1058
- this._actual = _actual;
1059
- this.type = 8 /* ContextKeyExprType.NotRegex */;
1060
- //
1061
- }
1062
- cmp(other) {
1063
- if (other.type !== this.type) {
1064
- return this.type - other.type;
1065
- }
1066
- return this._actual.cmp(other._actual);
1067
- }
1068
- equals(other) {
1069
- if (other.type === this.type) {
1070
- return this._actual.equals(other._actual);
1071
- }
1072
- return false;
1073
- }
1074
- substituteConstants() {
1075
- return this;
1076
- }
1077
- evaluate(context) {
1078
- return !this._actual.evaluate(context);
1079
- }
1080
- serialize() {
1081
- return `!(${this._actual.serialize()})`;
1082
- }
1083
- keys() {
1084
- return this._actual.keys();
1085
- }
1086
- negate() {
1087
- return this._actual;
1088
- }
1089
- }
1090
- /**
1091
- * @returns the same instance if nothing changed.
1092
- */
1093
- function eliminateConstantsInArray(arr) {
1094
- // Allocate array only if there is a difference
1095
- let newArr = null;
1096
- for (let i = 0, len = arr.length; i < len; i++) {
1097
- const newExpr = arr[i].substituteConstants();
1098
- if (arr[i] !== newExpr) {
1099
- // something has changed!
1100
- // allocate array on first difference
1101
- if (newArr === null) {
1102
- newArr = [];
1103
- for (let j = 0; j < i; j++) {
1104
- newArr[j] = arr[j];
1105
- }
1106
- }
1107
- }
1108
- if (newArr !== null) {
1109
- newArr[i] = newExpr;
1110
- }
1111
- }
1112
- if (newArr === null) {
1113
- return arr;
1114
- }
1115
- return newArr;
1116
- }
1117
- export class ContextKeyAndExpr {
1118
- static create(_expr, negated, extraRedundantCheck) {
1119
- return ContextKeyAndExpr._normalizeArr(_expr, negated, extraRedundantCheck);
1120
- }
1121
- constructor(expr, negated) {
1122
- this.expr = expr;
1123
- this.negated = negated;
1124
- this.type = 6 /* ContextKeyExprType.And */;
1125
- }
1126
- cmp(other) {
1127
- if (other.type !== this.type) {
1128
- return this.type - other.type;
1129
- }
1130
- if (this.expr.length < other.expr.length) {
1131
- return -1;
1132
- }
1133
- if (this.expr.length > other.expr.length) {
1134
- return 1;
1135
- }
1136
- for (let i = 0, len = this.expr.length; i < len; i++) {
1137
- const r = cmp(this.expr[i], other.expr[i]);
1138
- if (r !== 0) {
1139
- return r;
1140
- }
1141
- }
1142
- return 0;
1143
- }
1144
- equals(other) {
1145
- if (other.type === this.type) {
1146
- if (this.expr.length !== other.expr.length) {
1147
- return false;
1148
- }
1149
- for (let i = 0, len = this.expr.length; i < len; i++) {
1150
- if (!this.expr[i].equals(other.expr[i])) {
1151
- return false;
1152
- }
1153
- }
1154
- return true;
1155
- }
1156
- return false;
1157
- }
1158
- substituteConstants() {
1159
- const exprArr = eliminateConstantsInArray(this.expr);
1160
- if (exprArr === this.expr) {
1161
- // no change
1162
- return this;
1163
- }
1164
- return ContextKeyAndExpr.create(exprArr, this.negated, false);
1165
- }
1166
- evaluate(context) {
1167
- for (let i = 0, len = this.expr.length; i < len; i++) {
1168
- if (!this.expr[i].evaluate(context)) {
1169
- return false;
1170
- }
1171
- }
1172
- return true;
1173
- }
1174
- static _normalizeArr(arr, negated, extraRedundantCheck) {
1175
- const expr = [];
1176
- let hasTrue = false;
1177
- for (const e of arr) {
1178
- if (!e) {
1179
- continue;
1180
- }
1181
- if (e.type === 1 /* ContextKeyExprType.True */) {
1182
- // anything && true ==> anything
1183
- hasTrue = true;
1184
- continue;
1185
- }
1186
- if (e.type === 0 /* ContextKeyExprType.False */) {
1187
- // anything && false ==> false
1188
- return ContextKeyFalseExpr.INSTANCE;
1189
- }
1190
- if (e.type === 6 /* ContextKeyExprType.And */) {
1191
- expr.push(...e.expr);
1192
- continue;
1193
- }
1194
- expr.push(e);
1195
- }
1196
- if (expr.length === 0 && hasTrue) {
1197
- return ContextKeyTrueExpr.INSTANCE;
1198
- }
1199
- if (expr.length === 0) {
1200
- return undefined;
1201
- }
1202
- if (expr.length === 1) {
1203
- return expr[0];
1204
- }
1205
- expr.sort(cmp);
1206
- // eliminate duplicate terms
1207
- for (let i = 1; i < expr.length; i++) {
1208
- if (expr[i - 1].equals(expr[i])) {
1209
- expr.splice(i, 1);
1210
- i--;
1211
- }
1212
- }
1213
- if (expr.length === 1) {
1214
- return expr[0];
1215
- }
1216
- // We must distribute any OR expression because we don't support parens
1217
- // OR extensions will be at the end (due to sorting rules)
1218
- while (expr.length > 1) {
1219
- const lastElement = expr[expr.length - 1];
1220
- if (lastElement.type !== 9 /* ContextKeyExprType.Or */) {
1221
- break;
1222
- }
1223
- // pop the last element
1224
- expr.pop();
1225
- // pop the second to last element
1226
- const secondToLastElement = expr.pop();
1227
- const isFinished = (expr.length === 0);
1228
- // distribute `lastElement` over `secondToLastElement`
1229
- const resultElement = ContextKeyOrExpr.create(lastElement.expr.map(el => ContextKeyAndExpr.create([el, secondToLastElement], null, extraRedundantCheck)), null, isFinished);
1230
- if (resultElement) {
1231
- expr.push(resultElement);
1232
- expr.sort(cmp);
1233
- }
1234
- }
1235
- if (expr.length === 1) {
1236
- return expr[0];
1237
- }
1238
- // resolve false AND expressions
1239
- if (extraRedundantCheck) {
1240
- for (let i = 0; i < expr.length; i++) {
1241
- for (let j = i + 1; j < expr.length; j++) {
1242
- if (expr[i].negate().equals(expr[j])) {
1243
- // A && !A case
1244
- return ContextKeyFalseExpr.INSTANCE;
1245
- }
1246
- }
1247
- }
1248
- if (expr.length === 1) {
1249
- return expr[0];
1250
- }
1251
- }
1252
- return new ContextKeyAndExpr(expr, negated);
1253
- }
1254
- serialize() {
1255
- return this.expr.map(e => e.serialize()).join(' && ');
1256
- }
1257
- keys() {
1258
- const result = [];
1259
- for (const expr of this.expr) {
1260
- result.push(...expr.keys());
1261
- }
1262
- return result;
1263
- }
1264
- negate() {
1265
- if (!this.negated) {
1266
- const result = [];
1267
- for (const expr of this.expr) {
1268
- result.push(expr.negate());
1269
- }
1270
- this.negated = ContextKeyOrExpr.create(result, this, true);
1271
- }
1272
- return this.negated;
1273
- }
1274
- }
1275
- export class ContextKeyOrExpr {
1276
- static create(_expr, negated, extraRedundantCheck) {
1277
- return ContextKeyOrExpr._normalizeArr(_expr, negated, extraRedundantCheck);
1278
- }
1279
- constructor(expr, negated) {
1280
- this.expr = expr;
1281
- this.negated = negated;
1282
- this.type = 9 /* ContextKeyExprType.Or */;
1283
- }
1284
- cmp(other) {
1285
- if (other.type !== this.type) {
1286
- return this.type - other.type;
1287
- }
1288
- if (this.expr.length < other.expr.length) {
1289
- return -1;
1290
- }
1291
- if (this.expr.length > other.expr.length) {
1292
- return 1;
1293
- }
1294
- for (let i = 0, len = this.expr.length; i < len; i++) {
1295
- const r = cmp(this.expr[i], other.expr[i]);
1296
- if (r !== 0) {
1297
- return r;
1298
- }
1299
- }
1300
- return 0;
1301
- }
1302
- equals(other) {
1303
- if (other.type === this.type) {
1304
- if (this.expr.length !== other.expr.length) {
1305
- return false;
1306
- }
1307
- for (let i = 0, len = this.expr.length; i < len; i++) {
1308
- if (!this.expr[i].equals(other.expr[i])) {
1309
- return false;
1310
- }
1311
- }
1312
- return true;
1313
- }
1314
- return false;
1315
- }
1316
- substituteConstants() {
1317
- const exprArr = eliminateConstantsInArray(this.expr);
1318
- if (exprArr === this.expr) {
1319
- // no change
1320
- return this;
1321
- }
1322
- return ContextKeyOrExpr.create(exprArr, this.negated, false);
1323
- }
1324
- evaluate(context) {
1325
- for (let i = 0, len = this.expr.length; i < len; i++) {
1326
- if (this.expr[i].evaluate(context)) {
1327
- return true;
1328
- }
1329
- }
1330
- return false;
1331
- }
1332
- static _normalizeArr(arr, negated, extraRedundantCheck) {
1333
- let expr = [];
1334
- let hasFalse = false;
1335
- if (arr) {
1336
- for (let i = 0, len = arr.length; i < len; i++) {
1337
- const e = arr[i];
1338
- if (!e) {
1339
- continue;
1340
- }
1341
- if (e.type === 0 /* ContextKeyExprType.False */) {
1342
- // anything || false ==> anything
1343
- hasFalse = true;
1344
- continue;
1345
- }
1346
- if (e.type === 1 /* ContextKeyExprType.True */) {
1347
- // anything || true ==> true
1348
- return ContextKeyTrueExpr.INSTANCE;
1349
- }
1350
- if (e.type === 9 /* ContextKeyExprType.Or */) {
1351
- expr = expr.concat(e.expr);
1352
- continue;
1353
- }
1354
- expr.push(e);
1355
- }
1356
- if (expr.length === 0 && hasFalse) {
1357
- return ContextKeyFalseExpr.INSTANCE;
1358
- }
1359
- expr.sort(cmp);
1360
- }
1361
- if (expr.length === 0) {
1362
- return undefined;
1363
- }
1364
- if (expr.length === 1) {
1365
- return expr[0];
1366
- }
1367
- // eliminate duplicate terms
1368
- for (let i = 1; i < expr.length; i++) {
1369
- if (expr[i - 1].equals(expr[i])) {
1370
- expr.splice(i, 1);
1371
- i--;
1372
- }
1373
- }
1374
- if (expr.length === 1) {
1375
- return expr[0];
1376
- }
1377
- // resolve true OR expressions
1378
- if (extraRedundantCheck) {
1379
- for (let i = 0; i < expr.length; i++) {
1380
- for (let j = i + 1; j < expr.length; j++) {
1381
- if (expr[i].negate().equals(expr[j])) {
1382
- // A || !A case
1383
- return ContextKeyTrueExpr.INSTANCE;
1384
- }
1385
- }
1386
- }
1387
- if (expr.length === 1) {
1388
- return expr[0];
1389
- }
1390
- }
1391
- return new ContextKeyOrExpr(expr, negated);
1392
- }
1393
- serialize() {
1394
- return this.expr.map(e => e.serialize()).join(' || ');
1395
- }
1396
- keys() {
1397
- const result = [];
1398
- for (const expr of this.expr) {
1399
- result.push(...expr.keys());
1400
- }
1401
- return result;
1402
- }
1403
- negate() {
1404
- if (!this.negated) {
1405
- const result = [];
1406
- for (const expr of this.expr) {
1407
- result.push(expr.negate());
1408
- }
1409
- // We don't support parens, so here we distribute the AND over the OR terminals
1410
- // We always take the first 2 AND pairs and distribute them
1411
- while (result.length > 1) {
1412
- const LEFT = result.shift();
1413
- const RIGHT = result.shift();
1414
- const all = [];
1415
- for (const left of getTerminals(LEFT)) {
1416
- for (const right of getTerminals(RIGHT)) {
1417
- all.push(ContextKeyAndExpr.create([left, right], null, false));
1418
- }
1419
- }
1420
- result.unshift(ContextKeyOrExpr.create(all, null, false));
1421
- }
1422
- this.negated = ContextKeyOrExpr.create(result, this, true);
1423
- }
1424
- return this.negated;
1425
- }
1426
- }
1427
- export class RawContextKey extends ContextKeyDefinedExpr {
1428
- static all() {
1429
- return RawContextKey._info.values();
1430
- }
1431
- constructor(key, defaultValue, metaOrHide) {
1432
- super(key, null);
1433
- this._defaultValue = defaultValue;
1434
- // collect all context keys into a central place
1435
- if (typeof metaOrHide === 'object') {
1436
- RawContextKey._info.push({ ...metaOrHide, key });
1437
- }
1438
- else if (metaOrHide !== true) {
1439
- RawContextKey._info.push({ key, description: metaOrHide, type: defaultValue !== null && defaultValue !== undefined ? typeof defaultValue : undefined });
1440
- }
1441
- }
1442
- bindTo(target) {
1443
- return target.createKey(this.key, this._defaultValue);
1444
- }
1445
- getValue(target) {
1446
- return target.getContextKeyValue(this.key);
1447
- }
1448
- toNegated() {
1449
- return this.negate();
1450
- }
1451
- isEqualTo(value) {
1452
- return ContextKeyEqualsExpr.create(this.key, value);
1453
- }
1454
- }
1455
- RawContextKey._info = [];
1456
- export const IContextKeyService = createDecorator('contextKeyService');
1457
- function cmp1(key1, key2) {
1458
- if (key1 < key2) {
1459
- return -1;
1460
- }
1461
- if (key1 > key2) {
1462
- return 1;
1463
- }
1464
- return 0;
1465
- }
1466
- function cmp2(key1, value1, key2, value2) {
1467
- if (key1 < key2) {
1468
- return -1;
1469
- }
1470
- if (key1 > key2) {
1471
- return 1;
1472
- }
1473
- if (value1 < value2) {
1474
- return -1;
1475
- }
1476
- if (value1 > value2) {
1477
- return 1;
1478
- }
1479
- return 0;
1480
- }
1481
- /**
1482
- * Returns true if it is provable `p` implies `q`.
1483
- */
1484
- export function implies(p, q) {
1485
- if (p.type === 0 /* ContextKeyExprType.False */ || q.type === 1 /* ContextKeyExprType.True */) {
1486
- // false implies anything
1487
- // anything implies true
1488
- return true;
1489
- }
1490
- if (p.type === 9 /* ContextKeyExprType.Or */) {
1491
- if (q.type === 9 /* ContextKeyExprType.Or */) {
1492
- // `a || b || c` can only imply something like `a || b || c || d`
1493
- return allElementsIncluded(p.expr, q.expr);
1494
- }
1495
- return false;
1496
- }
1497
- if (q.type === 9 /* ContextKeyExprType.Or */) {
1498
- for (const element of q.expr) {
1499
- if (implies(p, element)) {
1500
- return true;
1501
- }
1502
- }
1503
- return false;
1504
- }
1505
- if (p.type === 6 /* ContextKeyExprType.And */) {
1506
- if (q.type === 6 /* ContextKeyExprType.And */) {
1507
- // `a && b && c` implies `a && c`
1508
- return allElementsIncluded(q.expr, p.expr);
1509
- }
1510
- for (const element of p.expr) {
1511
- if (implies(element, q)) {
1512
- return true;
1513
- }
1514
- }
1515
- return false;
1516
- }
1517
- return p.equals(q);
1518
- }
1519
- /**
1520
- * Returns true if all elements in `p` are also present in `q`.
1521
- * The two arrays are assumed to be sorted
1522
- */
1523
- function allElementsIncluded(p, q) {
1524
- let pIndex = 0;
1525
- let qIndex = 0;
1526
- while (pIndex < p.length && qIndex < q.length) {
1527
- const cmp = p[pIndex].cmp(q[qIndex]);
1528
- if (cmp < 0) {
1529
- // an element from `p` is missing from `q`
1530
- return false;
1531
- }
1532
- else if (cmp === 0) {
1533
- pIndex++;
1534
- qIndex++;
1535
- }
1536
- else {
1537
- qIndex++;
1538
- }
1539
- }
1540
- return (pIndex === p.length);
1541
- }
1542
- function getTerminals(node) {
1543
- if (node.type === 9 /* ContextKeyExprType.Or */) {
1544
- return node.expr;
1545
- }
1546
- return [node];
1547
- }